diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index 51fd6a9e..83952666 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -495,17 +495,17 @@ static lv_font_t * haspPayloadToFont(const char * payload) static void gauge_format_10(lv_obj_t * gauge, char * buf, int bufsize, int32_t value) { - snprintf(buf, bufsize, PSTR("%d"), value / 10); + snprintf_P(buf, bufsize, PSTR("%d"), value / 10); } static void gauge_format_100(lv_obj_t * gauge, char * buf, int bufsize, int32_t value) { - snprintf(buf, bufsize, PSTR("%d"), value / 100); + snprintf_P(buf, bufsize, PSTR("%d"), value / 100); } static void gauge_format_1k(lv_obj_t * gauge, char * buf, int bufsize, int32_t value) { - snprintf(buf, bufsize, PSTR("%d"), value / 1000); + snprintf_P(buf, bufsize, PSTR("%d"), value / 1000); } static void gauge_format_10k(lv_obj_t * gauge, char * buf, int bufsize, int32_t value) diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp index eb9b2fb1..70c209a3 100644 --- a/src/hasp_config.cpp +++ b/src/hasp_config.cpp @@ -27,7 +27,7 @@ void confDebugSet(const __FlashStringHelper * fstr_name) { /*char buffer[128]; - snprintf(buffer, sizeof(buffer), PSTR(" * %s set"), name); + snprintf_P(buffer, sizeof(buffer), PSTR(" * %s set"), name); debugPrintln(buffer);*/ Log.verbose(TAG_CONF, F(" * %S set"), fstr_name); } diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp index ae61f1a4..b11ec893 100644 --- a/src/hasp_debug.cpp +++ b/src/hasp_debug.cpp @@ -120,7 +120,7 @@ void debugPrintHaspHeader(Print * output) " Home Automation Switch Plate\r\n" " Open Hardware edition v")); char buffer[32]; - snprintf(buffer, sizeof(buffer), PSTR("%u.%u.%u"), HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION); + snprintf_P(buffer, sizeof(buffer), PSTR("%u.%u.%u"), HASP_VERSION_MAJOR, HASP_VERSION_MINOR, HASP_VERSION_REVISION); output->println(buffer); output->println(); } diff --git a/src/hasp_oobe.cpp b/src/hasp_oobe.cpp index 5468d05a..617fb0aa 100644 --- a/src/hasp_oobe.cpp +++ b/src/hasp_oobe.cpp @@ -138,7 +138,7 @@ static void oobeSetupQR(const char * ssid, const char * pass) lv_qrcode_update(qr, buffer, strlen(buffer)); lv_obj_t * qrlabel = lv_label_create(oobepage[0], NULL); - snprintf(buffer, sizeof(buffer), PSTR("Scan to connect")); + snprintf_P(buffer, sizeof(buffer), PSTR("Scan to connect")); lv_label_set_text(qrlabel, buffer); if(disp->driver.hor_res <= disp->driver.ver_res) { @@ -157,7 +157,7 @@ static void oobeSetupQR(const char * ssid, const char * pass) #endif lv_obj_t * aplabel = lv_label_create(container, NULL); - snprintf(buffer, sizeof(buffer), PSTR("Tap the screen to setup WiFi or connect to this Access Point:")); + snprintf_P(buffer, sizeof(buffer), PSTR("Tap the screen to setup WiFi or connect to this Access Point:")); lv_label_set_text(aplabel, buffer); lv_label_set_long_mode(aplabel, LV_LABEL_LONG_BREAK); @@ -248,13 +248,13 @@ static void oobeSetupSsid(void) /* Create a label and position it above the text box */ lv_obj_t * pwd_label = lv_label_create(oobepage[1], NULL); - snprintf(buffer, sizeof(buffer), PSTR("Password:")); + snprintf_P(buffer, sizeof(buffer), PSTR("Password:")); lv_label_set_text(pwd_label, buffer); lv_obj_align(pwd_label, pwd_ta, labelpos, 0, 0); /* Create a label and position it above the text box */ lv_obj_t * oneline_label = lv_label_create(oobepage[1], NULL); - snprintf(buffer, sizeof(buffer), PSTR("Ssid:")); + snprintf_P(buffer, sizeof(buffer), PSTR("Ssid:")); lv_label_set_text(oneline_label, buffer); lv_obj_align(oneline_label, oneline_ta, labelpos, 0, 0); diff --git a/src/net/hasp_ethernet_stm32.cpp b/src/net/hasp_ethernet_stm32.cpp index 65fed22c..6ef34e6e 100644 --- a/src/net/hasp_ethernet_stm32.cpp +++ b/src/net/hasp_ethernet_stm32.cpp @@ -39,7 +39,7 @@ void ethernetSetup() char ethHostname[12]; memset(ethHostname, 0, sizeof(ethHostname)); - snprintf(ethHostname, sizeof(ethHostname), PSTR("HASP-%02x%02x%02x"), mac[3], mac[4], mac[5]); + snprintf_P(ethHostname, sizeof(ethHostname), PSTR("HASP-%02x%02x%02x"), mac[3], mac[4], mac[5]); Ethernet.setCsPin(W5500_CS); Ethernet.setRstPin(W5500_RST); diff --git a/src/svc/hasp_http.cpp b/src/svc/hasp_http.cpp index 1be02610..b4dc5b71 100644 --- a/src/svc/hasp_http.cpp +++ b/src/svc/hasp_http.cpp @@ -835,7 +835,7 @@ void handleFileDelete() if(!httpIsAuthenticated(F("filedelete"))) return; char mimetype[16]; - snprintf(mimetype, sizeof(mimetype), PSTR("text/plain")); + snprintf_P(mimetype, sizeof(mimetype), PSTR("text/plain")); if(webServer.args() == 0) { return webServer.send_P(500, mimetype, PSTR("BAD ARGS")); @@ -1802,7 +1802,7 @@ void httpSetup() webServer.on(F("/edit"), HTTP_GET, []() { if(!handleFileRead("/edit.htm")) { char mimetype[16]; - snprintf(mimetype, sizeof(mimetype), PSTR("text/plain")); + snprintf_P(mimetype, sizeof(mimetype), PSTR("text/plain")); webServer.send_P(404, mimetype, PSTR("FileNotFound")); } }); diff --git a/src/svc/hasp_slave.cpp b/src/svc/hasp_slave.cpp index db94add5..dd7ea9be 100644 --- a/src/svc/hasp_slave.cpp +++ b/src/svc/hasp_slave.cpp @@ -36,7 +36,7 @@ void slave_send_state(const __FlashStringHelper * subtopic, const char * payload char cBuffer[strlen(payload) + 64]; memset(cBuffer, 0, sizeof(cBuffer)); - snprintf(cBuffer, sizeof(cBuffer), PSTR("publish %sstate/%s %s"), slaveNodeTopic, subtopic, payload); + snprintf_P(cBuffer, sizeof(cBuffer), PSTR("publish %sstate/%s %s"), slaveNodeTopic, subtopic, payload); slave.ExecuteCommand((char *)cBuffer); // Log after char buffers are cleared