diff --git a/tasmota/_changelog.ino b/tasmota/_changelog.ino index e075af947..137bcf1d3 100644 --- a/tasmota/_changelog.ino +++ b/tasmota/_changelog.ino @@ -7,6 +7,7 @@ * Add Keep last channels values when Color command end with '=' (#6799) * Add support for I2C sensor TLS2591 Light Intensity sensor (#6873) * Change Kept only NEC/RC5/RC6/HASH IR protocols in standard Tasmota, all other protocols require Tasmota-IR, saving 4K + * Add command SetOption76 0/1 to enable incrementing bootcount when deepsleep is enabled (#6930) * * 7.0.0.3 20191103 * Add command I2cDriver for I2C driver runtime control using document I2CDEVICES.md diff --git a/tasmota/settings.h b/tasmota/settings.h index d7a06c778..f88f33c52 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -89,7 +89,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t cors_enabled : 1; // bit 23 (v7.0.0.1) - SetOption73 - Enable HTTP CORS uint32_t ds18x20_internal_pullup : 1; // bit 24 (v7.0.0.1) - SetOption74 - Enable internal pullup for single DS18x20 sensor uint32_t grouptopic_mode : 1; // bit 25 (v7.0.0.1) - SetOption75 - GroupTopic replaces %topic% (0) or fixed topic cmnd/grouptopic (1) - uint32_t spare26 : 1; + uint32_t bootcount_update : 1; // bit 26 (v7.0.0.4) - SetOption76 - Enable incrementing bootcount when deepsleep is enabled uint32_t spare27 : 1; uint32_t spare28 : 1; uint32_t spare29 : 1; diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 568fff407..2f7979ccb 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -819,8 +819,14 @@ void PerformEverySecond(void) RtcReboot.fast_reboot_count = 0; RtcRebootSave(); - Settings.bootcount++; // Moved to here to stop flash writes during start-up - AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BOOT_COUNT " %d"), Settings.bootcount); +#ifdef USE_DEEPSLEEP + if (!(DeepSleepEnabled() && !Settings.flag3.bootcount_update)) { +#endif + Settings.bootcount++; // Moved to here to stop flash writes during start-up + AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION D_BOOT_COUNT " %d"), Settings.bootcount); +#ifdef USE_DEEPSLEEP + } +#endif } if (seriallog_timer) {