Subject: Re: Realtime clock
To: None <amiga-dev@netbsd.org>
From: Blaz Zupan <blaz@gmizo.uni-mb.si>
List: amiga-dev
Date: 11/06/1994 13:15:50
Ok, here is a context diff from the original clock.c source
(nothing special really). It works on my 2000, dunno about
3000 or 4000. Check it out and report.
(patch with `patch /sys/arch/amiga/dev/clock.c <THIS_FILE')
--- snip ---
*** clock.c.orig Fri Jun 17 12:13:36 1994
--- clock.c Sun Nov 6 00:09:36 1994
***************
*** 764,771 ****
* there seem to be problems with the bitfield addressing
* currently used..
*/
- return(0);
- #if not_yet
if (rt)
return 0;
--- 764,769 ----
***************
*** 807,813 ****
day1 = day / 10;
day2 = day % 10;
! rt->control1 = CONTROL1_HOLD_CLOCK;
rt->second1 = sec1;
rt->second2 = sec2;
rt->minute1 = min1;
--- 805,811 ----
day1 = day / 10;
day2 = day % 10;
! rt->control1 = A3CONTROL1_HOLD_CLOCK;
rt->second1 = sec1;
rt->second2 = sec2;
rt->minute1 = min1;
***************
*** 820,829 ****
rt->month2 = mon2;
rt->year1 = year1;
rt->year2 = year2;
! rt->control2 = CONTROL1_FREE_CLOCK;
return 1;
- #endif
}
long
--- 818,826 ----
rt->month2 = mon2;
rt->year1 = year1;
rt->year2 = year2;
! rt->control2 = A3CONTROL1_FREE_CLOCK;
return 1;
}
long
***************
*** 915,922 ****
*
* XXX Check out the above where we (hour1 & 3)
*/
- return(0);
- #if not_yet
if (! rt)
return 0;
--- 912,917 ----
***************
*** 961,967 ****
/*
* XXXX spin wait as with reading???
*/
! rt->control1 = A2CONTROL1_HOLD_CLOCK;
rt->second1 = sec1;
rt->second2 = sec2;
rt->minute1 = min1;
--- 956,962 ----
/*
* XXXX spin wait as with reading???
*/
! rt->control1 |= A2CONTROL1_HOLD;
rt->second1 = sec1;
rt->second2 = sec2;
rt->minute1 = min1;
***************
*** 974,981 ****
rt->month2 = mon2;
rt->year1 = year1;
rt->year2 = year2;
! rt->control2 = CONTROL1_FREE_CLOCK;
return 1;
- #endif
}
--- 969,975 ----
rt->month2 = mon2;
rt->year1 = year1;
rt->year2 = year2;
! rt->control2 &= ~A2CONTROL1_HOLD;
return 1;
}