Repository navigation
Avoid creating duplicate variables #54
|
I may be doing something wrong with the library but I find that at the moment, in order to edit a Is there any way to avoid creating such unnecessary variables? Here's an example of what I'm talking about (the variable I wish to remove is char switch_status[4] = "Off";
char* switch_ptr = switch;
LiquidLine line3(0, 1, "Enabled: ", switch_ptr);
void toggleEnabled1() {
schedules[0].enabled = !(schedules[0].enabled);
if (schedules[0].enabled) {
strncpy(switch_status, "On", sizeof(switch_status) - 1);
} else {
strncpy(switch_status, "Off", sizeof(switch_status) - 1);
}
}
line3.attach_function(1, toggleEnabled1);Cheers! |
Answered by
VasilKalchev
Nov 2, 2021
Replies: 1 comment
|
Hello adrianbn, There was a problem with the original way the library handled this functionality. This is now fixed and you can now pass |
0 replies
Answer selected by
VasilKalchev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello adrianbn,
There was a problem with the original way the library handled this functionality. This is now fixed and you can now pass
char switch_status[4]directly toLiquidLine.