gfroerli / firmware

Firmware for the water temperature sensor project
GNU General Public License v3.0
6 stars 1 forks source link

RTC wakeup counter #113

Closed dbrgn closed 2 years ago

dbrgn commented 3 years ago

Changes:

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:

screenshot-20211209-232551

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.)

Refs #72.

dbrgn commented 2 years ago

@rnestler ready for review!

dbrgn commented 2 years ago

@rnestler all issues resolved!

rnestler commented 2 years ago

I still can't boot on my board, but that is due to the external oscillator being broken.