Add command SetOption76 0/1

Add command SetOption76 0/1 to enable incrementing bootcount when deepsleep is enabled (#6930)
This commit is contained in:
Theo Arends 2019-11-15 11:50:41 +01:00
parent 216c548a1e
commit 5c324357e6
3 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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) {