timer 1 is CPU time. That works by luck on a 6809 but on a Z80 clone at
lots of MHz it doesn't run very fast!
What we really need to do is expose the kernel 1/10th second raw tick clock
as timer 2
clock_time_t
clock_time(void)
{
- struct{
- uint32_t high;
- uint32_t low;
- }now;
- _time((__ktime_t *)&now,1);
- /* FIXME: needs a multiplier to turn into ms FIXME */
- return now.low;
- // return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+ static uint8_t init;
+ static time_t tbase;
+ time_t t;
+
+ if (!init) {
+ init = 1;
+ time(&tbase);
+ }
+ time(&t);
+ t -= tbase;
+ return t;
}
/*---------------------------------------------------------------------------*/
#define __CLOCK_ARCH_H__
typedef int clock_time_t;
-#define CLOCK_CONF_SECOND 10
+#define CLOCK_CONF_SECOND 1
#endif /* __CLOCK_ARCH_H__ */