From: pito <pi...@vo...> - 2010-09-09 08:46:08
|
A shorter get.rtc for the PCF8563 RTC library: : get.rtc ( -- tos> YY MM WD DD HH MM SS ) 2 \ start address 1 i2c_addr_rtc >i2c \ send > rtc 7 i2c_addr_rtc <i2c \ read 7 Bytes >r >r >r >r >r >r >r \ removes garbage r> $7f and \ SS r> $7f and \ MM r> $3f and \ HH r> $3f and \ DD r> $07 and \ WeekDay r> $1f and \ MONTH r> $ff and \ YY ; Ex: > printdate.rtc 2010/09/09-04-10:44:48 ok > p. |