1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-01 10:23:19 +02:00

Case-insensitive enums for runtime settings

This commit is contained in:
Mitch Bradley
2021-07-01 22:55:30 -10:00
parent 42a349aa22
commit 39fda6a642

View File

@@ -58,7 +58,7 @@ namespace Configuration {
if (newValue_ == nullptr) { if (newValue_ == nullptr) {
grbl_sendf(out_->client(), "$%s=%s\r\n", setting_, value ? "true" : "false"); grbl_sendf(out_->client(), "$%s=%s\r\n", setting_, value ? "true" : "false");
} else { } else {
value = (!strcmp(newValue_, "true")); value = (!strcasecmp(newValue_, "true"));
} }
} }
} }
@@ -109,7 +109,7 @@ namespace Configuration {
} }
} else { } else {
for (; e->name; ++e) { for (; e->name; ++e) {
if (!strcmp(newValue_, e->name)) { if (!strcasecmp(newValue_, e->name)) {
value = e->value; value = e->value;
return; return;
} }