fix: resolve compiler warnings (from PR #8 by @waltje)
- weather.cpp: StaticJsonDocument → JsonDocument (ArduinoJson v7 API) - display.cpp: daylightStr buffer 16 → 32 bytes (suppress GCC sprintf warning) - ntp_client.cpp: remove unused weekday variable Applied manually due to repo layout mismatch in original PR. Co-authored-by: waltje <waltje@users.noreply.github.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
waltje
Claude Sonnet 4.6
parent
09b8680408
commit
8d404506c4
@@ -168,7 +168,7 @@ void ICACHE_FLASH_ATTR displaySunTimes() {
|
||||
int daylightHours = daylightMinutes / 60;
|
||||
int daylightMins = daylightMinutes % 60;
|
||||
|
||||
char daylightStr[16];
|
||||
char daylightStr[32];
|
||||
sprintf(daylightStr, "Day %dh %dm", daylightHours, daylightMins);
|
||||
|
||||
display.setTextSize(1);
|
||||
|
||||
@@ -16,7 +16,6 @@ bool ICACHE_FLASH_ATTR isDST(unsigned long epochTime) {
|
||||
|
||||
int month = timeinfo->tm_mon + 1; // 1-12
|
||||
int day = timeinfo->tm_mday; // 1-31
|
||||
int weekday = timeinfo->tm_wday; // 0=Sunday
|
||||
int hour = timeinfo->tm_hour;
|
||||
|
||||
// Not DST: November - February
|
||||
|
||||
@@ -28,7 +28,7 @@ void ICACHE_FLASH_ATTR onWeatherResponse(void* optParm, AsyncHTTPRequest* reques
|
||||
Serial.printf("Weather response: %d bytes\n", payload.length());
|
||||
|
||||
// Parse JSON response
|
||||
StaticJsonDocument<1536> doc;
|
||||
JsonDocument doc;
|
||||
DeserializationError error = deserializeJson(doc, payload);
|
||||
|
||||
if (!error) {
|
||||
|
||||
@@ -161,7 +161,6 @@ bool isDST(unsigned long epochTime) {
|
||||
|
||||
int month = timeinfo->tm_mon + 1; // 1-12
|
||||
int day = timeinfo->tm_mday; // 1-31
|
||||
int weekday = timeinfo->tm_wday; // 0=Sunday
|
||||
int hour = timeinfo->tm_hour;
|
||||
|
||||
// Not DST: November - February
|
||||
@@ -1101,7 +1100,7 @@ void ICACHE_FLASH_ATTR displaySunTimes() {
|
||||
int daylightMins = daylightMinutes % 60;
|
||||
|
||||
// Format: "Day 9h 41m" or "9h 41m"
|
||||
char daylightStr[16];
|
||||
char daylightStr[32];
|
||||
sprintf(daylightStr, "Day %dh %dm", daylightHours, daylightMins);
|
||||
|
||||
display.setTextSize(1); // Size 1 to fit more text
|
||||
@@ -2027,7 +2026,7 @@ void onWeatherResponse(void* optParm, AsyncHTTPRequest* request, int readyState)
|
||||
Serial.printf("✓ Weather response: %d bytes\n", payload.length());
|
||||
|
||||
// Parse JSON response
|
||||
StaticJsonDocument<1536> doc;
|
||||
JsonDocument doc;
|
||||
DeserializationError error = deserializeJson(doc, payload);
|
||||
|
||||
if (!error) {
|
||||
|
||||
Reference in New Issue
Block a user