X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device%2Flib%2Fds390%2Ftinibios.c;h=b9c89688d7baf3e8b768e4c4e4ff0f894d5c05a0;hb=dbc215a18455517c746d70c7b53d879ded354b39;hp=318ee0276a09fb73d2f38fec5dc34f34e9dfb519;hpb=2991add55f7fe35951cb563c1402b826753a3706;p=fw%2Fsdcc diff --git a/device/lib/ds390/tinibios.c b/device/lib/ds390/tinibios.c index 318ee027..b9c89688 100755 --- a/device/lib/ds390/tinibios.c +++ b/device/lib/ds390/tinibios.c @@ -134,8 +134,10 @@ unsigned int cpuSpeed; void CpuSpeed(unsigned int speed) { + #if 0 while (0 && (EXIF&0x04)) ; // cpu operates from ring buffer + #endif PMR = 0x80; // div4, CTM off, multiplier 2x switch (speed) { @@ -487,16 +489,18 @@ void ClockInit() { // This needs to be SUPER fast. What we really want is: #if 0 -void ClockIrqHandler (void) interrupt 1 { +void junk_ClockIrqHandler (void) interrupt 10 { TL0=timer0ReloadValue&0xff; TH0=timer0ReloadValue>>8; milliSeconds++; } #else // but look at the code, and the pushes and pops, so: -#pragma EXCLUDE b,dpl,dph,dpx -void ClockIrqHandler (void) interrupt 1 { +void ClockIrqHandler (void) interrupt 1 _naked +{ _asm + push acc + push psw mov _TL0,_timer0ReloadValue mov _TH0,_timer0ReloadValue+1 clr a @@ -507,11 +511,12 @@ void ClockIrqHandler (void) interrupt 1 { inc _milliSeconds+2 cjne a,_milliSeconds+2,_ClockIrqHandlerDone inc _milliSeconds+3 - cjne a,_milliSeconds+3,_ClockIrqHandlerDone _ClockIrqHandlerDone: + pop psw + pop acc + reti _endasm; } -#pragma EXCLUDE NONE #endif // we can't just use milliSeconds