Changeset 2362


Ignore:
Timestamp:
Jul 14, 2011, 6:14:19 AM (4 years ago)
Author:
wmb
Message:

OLPC XO-1.75 - RTC driver - force the Clock Halt bit off if necessary, and verify that it worked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/1.75/rtc.fth

    r2252 r2362  
     1purpose: Driver for external IDT1338 RTC chip on XO-1.75
     2
    130 0  " "  " /" begin-package
    24" rtc" name
     
    2123
    2224headers
    23 : open  ( -- true )
    24    true
     25: open  ( -- okay )
     26   0 ['] rtc@ catch  if        ( x )
     27      drop false  exit         ( -- false )
     28   then                        ( value )
     29
     30   \ Ensure that the Clock Halt bit is off
     31   dup h# 80 and  if           ( value )
     32      \ Turn off Clock Halt
     33      h# 7f and 0 rtc!         ( )
     34      \ Verify that it went off
     35      0 rtc@ h# 80 and         ( error? )
     36      dup  if  ." RTC Clock Halt is stuck on" cr  then  ( error? )
     37      0=                       ( okay? )
     38   else                        ( value )
     39      drop true                ( true )
     40   then                        ( okay? )
    2541;
    2642: close  ( -- )
Note: See TracChangeset for help on using the changeset viewer.