Mercurial > hg > Members > kono > os9 > sbc09
diff io.c @ 53:fe88cea67ef0
clock interrupt
get time
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 22 Jul 2018 17:55:06 +0900 |
parents | 51b437557f42 |
children | fc10b7ae23d0 |
line wrap: on
line diff
--- a/io.c Sun Jul 22 15:52:39 2018 +0900 +++ b/io.c Sun Jul 22 17:55:06 2018 +0900 @@ -312,7 +312,7 @@ time_t tm = time(0); struct tm *t = localtime(&tm); mem[IOPAGE+0x31] = t->tm_year; - mem[IOPAGE+0x32] = t->tm_mon; + mem[IOPAGE+0x32] = t->tm_mon+1; mem[IOPAGE+0x33] = t->tm_mday; mem[IOPAGE+0x34] = t->tm_hour; mem[IOPAGE+0x35] = t->tm_min; @@ -369,8 +369,12 @@ void timehandler(int sig) { attention = 1; +#ifdef USE_MMU + irq = 1; +#else irq = 2; - mem[(IOPAGE&0xfe00)+0x30] |= 0x10 ; +#endif + mem[IOPAGE+0x30] |= 0x10 ; // signal(SIGALRM, timehandler); } @@ -401,9 +405,9 @@ fcntl(0, F_SETFL, tflags | O_NDELAY); /* Make input from stdin non-blocking */ signal(SIGALRM, timehandler); timercontrol.it_interval.tv_sec = 0; - timercontrol.it_interval.tv_usec = 20000; + timercontrol.it_interval.tv_usec = 200000; timercontrol.it_value.tv_sec = 0; - timercontrol.it_value.tv_usec = 20000; + timercontrol.it_value.tv_usec = 200000; if (timer) setitimer(ITIMER_REAL, &timercontrol, NULL); }