2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: ReadBattClock() function.
8 #include "battclock_intern.h"
9 #include <asm/registers.h>
11 /*****************************************************************************
14 #include <proto/battclock.h>
15 #include <proto/utility.h>
16 #include <utility/date.h>
18 AROS_LH0(ULONG
, ReadBattClock
,
24 struct BattClockBase
*, BattClockBase
, 2, Battclock
)
27 Return the value stored in the battery back up clock. This value
28 is the number of seconds that have elapsed since midnight on the
29 1st of January 1978 (00:00:00 1.1.1978).
31 If the value of the battery clock is invalid, then the clock will
37 The number of seconds since 1.1.1978 00:00:00
46 WriteBattClock, ResetBattClock
51 27-11-96 digulla automatically created from
52 battclock_lib.fd and clib/battclock_protos.h
54 *****************************************************************************/
58 struct ClockData date
;
60 ULONG rtctime
= RREG_L(RTCTIME
);
62 date
.sec
= (rtctime
& SECONDS_M
);
63 date
.min
= (rtctime
& MINUTES_M
) >> 16;
64 date
.hour
= (rtctime
& HOURS_M
) >> 24;
70 secs
= Date2Amiga(&date
);