2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
4 Desc: ReadBattClock() function.
9 #include <aros/debug.h>
10 #include <aros/libcall.h>
11 #include <aros/symbolsets.h>
13 #include <utility/date.h>
14 #include <proto/utility.h>
16 #include "battclock_intern.h"
18 #include <proto/battclock.h>
20 /* See rom/battclock/readbattclock.c for documentation */
22 AROS_LH0(ULONG
, ReadBattClock
,
23 struct BattClockBase
*, BattClockBase
, 2, Battclock
)
27 volatile UBYTE
*p
= BattClockBase
->clockptr
;
28 struct UtilityBase
*UtilityBase
= BattClockBase
->UtilityBase
;
33 D(bug("ReadBattClock\n"));
37 cd
.sec
= getbcd(p
, reg
);
38 cd
.min
= getbcd(p
, reg
+ 2);
39 cd
.hour
= getbcd(p
, reg
+ 4);
40 if (BattClockBase
->clocktype
== MSM6242B
)
44 cd
.mday
= getbcd(p
, reg
);
45 cd
.month
= getbcd(p
, reg
+ 2);
46 cd
.year
= getbcd(p
, reg
+ 4) + 1900;
51 D(bug("%02d:%02d %02d.%02d.%d = %d\n", cd
.hour
, cd
.min
, cd
.mday
, cd
.month
, cd
.year
, t
));