I tried the following hack to resolve the issue (by deliberately writing invalid values into the POWMAN_SET_TIME_* registers so retained values would not reset the time on reset):
It did not work:
Clearly it is the actual original time value set that is being retained as not just the last values, valid or invalid, written into the POWMAN_SET_TIME_* registers.
Code:
\ Set the time : time! ( D: time -- ) timer-enabled? { enabled? } disable-timer dup 16 rshift POWMAN_SET_TIME_63TO48 passwd! $FFFF and POWMAN_SET_TIME_47TO32 passwd! dup 16 rshift POWMAN_SET_TIME_31TO16 passwd! $FFFF and POWMAN_SET_TIME_15TO0 passwd! \ The following are deliberately invalid writes to fix an issue with the \ time being reset on reboot. 0 POWMAN_SET_TIME_63TO48 ! 0 POWMAN_SET_TIME_47TO32 ! 0 POWMAN_SET_TIME_31TO16 ! 0 POWMAN_SET_TIME_15TO0 ! enabled? if enable-timer then ;
Code:
fat32-tools import enable-line oks" TEST/BOOTTIM1.FS" included compile-to-flashmarker erase-boottime: show-date-time ( -- ) rtc::date-time-size [: { date-time } date-time rtc::date-time@ date-time rtc::date-time. ;] with-aligned-allot;: show-date-time-repeat ( -- ) begin key? not while cr show-date-time 1000 ms repeat key drop;: turnkey ( -- ) show-date-time-repeat ; ok2024 08 30 15 59 00 rtc::simple-date-time! okshow-date-time Fri, 30 Aug 2024 15:59:03 okshow-date-time Fri, 30 Aug 2024 15:59:05 okshow-date-time Fri, 30 Aug 2024 15:59:07 okshow-date-time Fri, 30 Aug 2024 15:59:08 ok
Code:
Fri, 30 Aug 2024 15:59:02Fri, 30 Aug 2024 15:59:03Fri, 30 Aug 2024 15:59:04Fri, 30 Aug 2024 15:59:05Fri, 30 Aug 2024 15:59:06<snip>Fri, 30 Aug 2024 16:01:33Fri, 30 Aug 2024 16:01:35Fri, 30 Aug 2024 16:01:36Fri, 30 Aug 2024 16:01:37Fri, 30 Aug 2024 16:01:38
Code:
Fri, 30 Aug 2024 15:59:01Fri, 30 Aug 2024 15:59:02Fri, 30 Aug 2024 15:59:03Fri, 30 Aug 2024 15:59:04Fri, 30 Aug 2024 15:59:05
Statistics: Posted by tabemann — Fri Aug 30, 2024 9:07 pm