Solved
Daylight Saving: The Details?
This is a spiritual followup to this post: https://community.st.com/s/question/0D50X00009XkYuH/rtc-daylight-saving-time-stm32f3-discovery
So I do get which functions to use for daylight saving, and how to BCK bit remembers if I already changed to DST or not.
But:
- Since I have to call either function manually, how do I compute "second Sunday in March" or "last Sunday in March"? If I check the date every (running) minute, how can I count Sundays (in particular if the board was powered off during the first Sunday)? Do I need to revert to time() etc.?
- Wouldn't frequent checks drain performance? Is there no better way, e.g., by using callbacks? Should I set alerts for the DST dates?
- If the BCK bit has to be set again after each boot, how do I know if it should be set of not? By comparing the current date against the DST dates? But then I could power down the board just before DST start, and power on again after it. Then the BCK bit would be set, but the time would not have been adjusted, which is wrong.
Calling daylight saving functions seems easy enough, but how to implement this efficiently? Note that the F7 HAL libraries don't include daylight savings examples.
