* src/SDCCsymt.c (compStructSize): make bitfields without (un)signed specifier unsigned
[fw/sdcc] / device / lib / ds390 / tinibios.c
index 318ee0276a09fb73d2f38fec5dc34f34e9dfb519..b9c89688d7baf3e8b768e4c4e4ff0f894d5c05a0 100755 (executable)
@@ -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