Skip to content

Commit

Permalink
snprintf_P rename
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Sep 19, 2021
1 parent 88a4275 commit 56f1c79
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/web/WebSettingsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) {

for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
char buf[20];
snprintf_P(buf, sizeof(buf), "sensor_id%d", i);
snprintf(buf, sizeof(buf), "sensor_id%d", i);
root[buf] = settings.sensor[i].id;
snprintf_P(buf, sizeof(buf), "sensor_name%d", i);
snprintf(buf, sizeof(buf), "sensor_name%d", i);
root[buf] = settings.sensor[i].name;
snprintf_P(buf, sizeof(buf), "sensor_offset%d", i);
snprintf(buf, sizeof(buf), "sensor_offset%d", i);
root[buf] = settings.sensor[i].offset;
}
}
Expand Down Expand Up @@ -207,11 +207,11 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)

for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
char buf[20];
snprintf_P(buf, sizeof(buf), "sensor_id%d", i);
snprintf(buf, sizeof(buf), "sensor_id%d", i);
settings.sensor[i].id = root[buf] | EMSESP_DEFAULT_SENSOR_NAME;
snprintf_P(buf, sizeof(buf), "sensor_name%d", i);
snprintf(buf, sizeof(buf), "sensor_name%d", i);
settings.sensor[i].name = root[buf] | EMSESP_DEFAULT_SENSOR_NAME;
snprintf_P(buf, sizeof(buf), "sensor_offset%d", i);
snprintf(buf, sizeof(buf), "sensor_offset%d", i);
settings.sensor[i].offset = root[buf] | 0;
}

Expand Down

0 comments on commit 56f1c79

Please sign in to comment.