diff --git a/BresserWeatherSensorLWCmd.cpp b/BresserWeatherSensorLWCmd.cpp index b8ff4d5..69a814d 100644 --- a/BresserWeatherSensorLWCmd.cpp +++ b/BresserWeatherSensorLWCmd.cpp @@ -37,6 +37,7 @@ // 20240723 Extracted from BresserWeatherSensorLW.ino // 20240729 Added PowerFeather specific status information // 20240818 Replaced delay() with light sleep for ESP32 +// 20240829 Added missing implementation of CMD_SET_LW_STATUS_INTERVAL // // ToDo: // - @@ -134,6 +135,16 @@ uint8_t decodeDownlink(uint8_t port, uint8_t *payload, size_t size) return 0; } + if ((port == CMD_SET_LW_STATUS_INTERVAL) && (size == 1)) + { + prefs.lw_stat_interval = payload[0]; + log_d("Set lw_stat_interval: %u", prefs.lw_stat_interval); + preferences.begin("BWS-LW", false); + preferences.putUChar("lw_stat_int", prefs.lw_stat_interval); + preferences.end(); + return 0; + } + if ((port == CMD_GET_LW_CONFIG) && (payload[0] == 0x00) && (size == 1)) { log_d("Get config"); diff --git a/src/AppLayer.cpp b/src/AppLayer.cpp index bfa0e52..1b8b09f 100644 --- a/src/AppLayer.cpp +++ b/src/AppLayer.cpp @@ -114,7 +114,7 @@ void AppLayer::getPayloadStage1(uint8_t &port, LoraEncoder &encoder) #endif // FIXME: To be removed later - // Battery status flags for compatibility with BresserWeatherSensorTTN + // Battery status flags for compatibility with BresserWeatherSensorTTN and ESP32-e-Paper-Weather-Display if ((appPayloadCfg[0] & 1) && (encoder.getLength() <= PAYLOAD_SIZE - 1)) { log_i("Battery status flags: ws=%u, soil=%u, lgt=%u", appStatus[SENSOR_TYPE_WEATHER1] & 1, diff --git a/src/rp2040/pico_rtc_utils.h b/src/rp2040/pico_rtc_utils.h index 5b607aa..af2dc9c 100644 --- a/src/rp2040/pico_rtc_utils.h +++ b/src/rp2040/pico_rtc_utils.h @@ -52,6 +52,7 @@ #include #include #include +#include #include "pico_sleep.h" #include "pico_rosc.h" #include "../logging.h" diff --git a/src/rp2040/pico_sleep.h b/src/rp2040/pico_sleep.h index 8d4f3b9..22028b6 100644 --- a/src/rp2040/pico_sleep.h +++ b/src/rp2040/pico_sleep.h @@ -10,6 +10,7 @@ #include "pico.h" #include "hardware/rtc.h" +#include "hardware/clocks.h" #ifdef __cplusplus extern "C" {