updating rtc code
This commit is contained in:
parent
bf7af0e761
commit
cb504011c8
|
@ -15,6 +15,12 @@ Number must be in the range 0 to 99."
|
|||
(ash (floor x 10) 4)
|
||||
(logand (rem x 10) #xf)))
|
||||
|
||||
(defun rtc-p ()
|
||||
"(rtc-p)
|
||||
Returns t if the RTC is connected."
|
||||
(with-i2c (str *rtc-port* #x68)
|
||||
(streamp str)))
|
||||
|
||||
(defun rtc-set (h m s)
|
||||
"(rtc-set hr min sec)
|
||||
Set the time on a DS3231 RTC. Times are in BCD, so use
|
||||
|
@ -27,7 +33,7 @@ for 12:34:00."
|
|||
(write-byte 0 str)
|
||||
(write-byte s str)
|
||||
(write-byte m str)
|
||||
(write-byte h str)))
|
||||
(write-byte h str))))
|
||||
|
||||
(defun rtc-get ()
|
||||
(with-i2c (str *rtc-port* #x68)
|
||||
|
@ -49,4 +55,3 @@ Set the time using the RTC."
|
|||
"(now-rtc)
|
||||
Sets the RTC time using the now function."
|
||||
(apply rtc-set (now)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue