Skip to content

Commit

Permalink
Update rtc.fs
Browse files Browse the repository at this point in the history
The shadow regs are froozen until RTC_DR3 is read.
  • Loading branch information
Eelkhoorn committed Sep 12, 2018
1 parent d6968f8 commit 107d86e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/hw/rtc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#require ]C!
#require ]B!

nvm

\ Print BCD byte with leading zero
: BCD. ( b -- )
DUP
Expand Down Expand Up @@ -46,6 +48,7 @@
RTC_TR1 c@ \ Seconds in BCD
RTC_TR2 c@ \ Minutes in BCD
RTC_TR3 c@ \ Hours in BCD
RTC_DR3 C@ DROP
;

\ Output time hh:mm:ss
Expand Down Expand Up @@ -105,6 +108,7 @@
RTC-DONE
;

ram

\ ------------------------------------------------------------------------------
\\ Example:
Expand All @@ -115,7 +119,7 @@
rtc-init
hex
\ Set date/time
18 5 11 5 14 11 00 rtc-set \ may 11 2018, friday, 14:11:00
18 5 11 5 14 11 00 rtc! \ may 11 2018, friday, 14:11:00

decimal
\ Print date and time. It is independet of radix.
Expand Down

0 comments on commit 107d86e

Please sign in to comment.