[x] HAL: Upgrade to rtc branch based on latest master
[x] Ensure that the external crystal (LSE) is used for timekeeping
[x] Calculate uptime based on RTC time
[x] Implement wakeup counter based on uptime
The initialization value is 2001-01-01 00:00:00. (We don't need a correct absolute datetime, we just need to measure elapsed time.) The RTC keeps its time as long as the power is not removed.
When starting, the RTC datetime and the uptime is printed to serial, followed by the config and base measurement plan:
The wakeup cycle is calculated by using uptime_seconds // wakeup_interval_seconds. For every measurement type, the appropriate wakeup_cycle % nth_XXX == 0 calculation is done. If it's 0, the measurement is enabled in the base measurement plan. (The base measurement plan may be modified later based on availability of sensors.)
Changes:
rtc
branch based on latest masterThe initialization value is
2001-01-01 00:00:00
. (We don't need a correct absolute datetime, we just need to measure elapsed time.) The RTC keeps its time as long as the power is not removed.When starting, the RTC datetime and the uptime is printed to serial, followed by the config and base measurement plan:
The wakeup cycle is calculated by using
uptime_seconds // wakeup_interval_seconds
. For every measurement type, the appropriatewakeup_cycle % nth_XXX == 0
calculation is done. If it's 0, the measurement is enabled in the base measurement plan. (The base measurement plan may be modified later based on availability of sensors.)Refs #72.