diff --git a/src/Core.cpp b/src/Core.cpp index 8d83215..1a96126 100644 --- a/src/Core.cpp +++ b/src/Core.cpp @@ -61,6 +61,8 @@ namespace core { } if (acquired) updateRtcTime(); + + hardware::sim808::powerOff(); //forcing power off, regardless of the counts and current use mainunit::deepSleep(sleepTime); } diff --git a/src/MainUnit.cpp b/src/MainUnit.cpp index 37b51df..0f705ed 100644 --- a/src/MainUnit.cpp +++ b/src/MainUnit.cpp @@ -34,9 +34,10 @@ namespace mainunit { } void interruptIn(uint16_t seconds) { - rtc::setAlarm(seconds); - pinMode(RTC_WAKE, INPUT); + + EIFR |= 1 << INTF1; //forcing interrupt clear as sometimes, it does not seems to work (1 second appart positions) + rtc::setAlarm(seconds); attachInterrupt(digitalPinToInterrupt(RTC_WAKE), interrupt, FALLING); } diff --git a/src/config/System.h b/src/config/System.h index 5fc3938..61fb742 100644 --- a/src/config/System.h +++ b/src/config/System.h @@ -3,7 +3,7 @@ #define CONFIG_ADDR 0 ///< Address of the config block in the I2C EEPROM chip. #define CONFIG_RESERVED_SIZE 128 ///< Reserved size for the config block in the I2C EEPROM chip. #define CONFIG_SEED 14 ///< Seed use to detect invalid or outdate configuration data. -#define VERSION "1.42" /// Version string, only used for indicative purpose. +#define VERSION "1.43" /// Version string, only used for indicative purpose. /**