X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=device%2Flib%2Fds390%2Ftinibios.c;h=13f87e12ca7c42d641e8910e30b008b4aa7902f2;hb=85ea7f79d191a61dccccc85ca90a8bff5e4efe66;hp=71c56cbdc830defbc5e238337d5f1876104be751;hpb=02e2c82005c8878026aea05436e0f59f3f5f8531;p=fw%2Fsdcc diff --git a/device/lib/ds390/tinibios.c b/device/lib/ds390/tinibios.c index 71c56cbd..13f87e12 100755 --- a/device/lib/ds390/tinibios.c +++ b/device/lib/ds390/tinibios.c @@ -341,6 +341,7 @@ void Serial1Init (unsigned long baud, unsigned char buffered) { if (baud==0) { ES1=0; // disable interrupt SCON1 &= 0xef; // disable receiver + return; // and don't touch it } ES1 = 0; // disable channel 1 interrupt @@ -486,37 +487,34 @@ 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 - mov a,#0x01 - add a,_milliSeconds+0 - mov _milliSeconds,a - jnc _ClockIrqHandlerDone - clr a - addc a,_milliSeconds+1 - mov _milliSeconds+1,a - jnc _ClockIrqHandlerDone - clr a - addc a,_milliSeconds+2 - mov _milliSeconds+1,a - jnc _ClockIrqHandlerDone clr a - addc a,_milliSeconds+3 - mov _milliSeconds+1,a + inc _milliSeconds+0 + cjne a,_milliSeconds+0,_ClockIrqHandlerDone + inc _milliSeconds+1 + cjne a,_milliSeconds+1,_ClockIrqHandlerDone + inc _milliSeconds+2 + cjne a,_milliSeconds+2,_ClockIrqHandlerDone + inc _milliSeconds+3 _ClockIrqHandlerDone: + pop psw + pop acc + reti _endasm; } -#pragma EXCLUDE NONE #endif // we can't just use milliSeconds