[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] DATE/TIME cookies
- To: MiNT mailing list <mint@fishpool.com>
- Subject: Re: [MiNT] DATE/TIME cookies
- From: Guido Flohr <gufl0000@stud.uni-sb.de>
- Date: Sat, 27 Feb 1999 04:25:34 +0000
- In-reply-to: <Pine.LNX.4.05.9902261707270.2472-100000@proxy.sophics>; from Petr Stehlik on Fri, Feb 26, 1999 at 05:20:21PM +0100
- References: <004101be61a1$240f1630$2e00a8c0@julian> <Pine.LNX.4.05.9902261707270.2472-100000@proxy.sophics>
- Reply-to: gufl0000@stud.uni-sb.de
- Sender: owner-mint@fishpool.com
On Fri, Feb 26, 1999 at 05:20:21PM +0100, Petr Stehlik wrote:
> Petr
> ...still dreaming about code like
> /* in interrupt */
> if (Cookie('MagX') || Cookie('MiNT') >= 0x110) {
> Tgettime();
> Tgetdate();
> }
> else {
> /* use DTCOOKIE or another hack */
> }
When you wake up ;-) why don't you use code like this:
if (Cookie ("MiNT")) {
select (...);
Tgettime ();
} else {
/* in interrupt */
/* use DTCOOKIE or another hack */
}
Seriously, I don't understand what you need interrupts for. Do
you remember the GEM++ sources I send you a year ago or so? It
contained the sources for a window clock but I never got the idea
to hook into interrupts for that. If you do an evnt_timer (200)
the clock will run accurate enough for a desktop clock. If you
use a 1000 ms timeout things will also be smooth enough.
If you want to get odd seconds for old kernels or non-MiNT you
can easily do this with "secs += ((*_hz_200 % 200) > 100 ? 1 : 0".
This is crude but also accurate enough for a desktop clock.
Ciao
Guido
--
http://stud.uni-sb.de/~gufl0000/
mailto:gufl0000@stud.uni-sb.de
Q: What looks like a cat, flies like a bat, brays like a donkey, and
plays like a monkey?
A: Nothing.