DISABLE_IRQSAVE/ENABLE_IRQRESTORE: Convert to IRQ_SAVE_DISABLE/IRQ_RESTORE.
[bertos.git] / drv / ser_avr.c
index 55665a40acb333ae048b14b9bc9ac314229c676b..a54d3764dd35cb79f9960e48bf711631c2609cbf 100755 (executable)
 
 /*#*
  *#* $Log$
+ *#* Revision 1.21  2004/12/13 12:07:06  bernie
+ *#* DISABLE_IRQSAVE/ENABLE_IRQRESTORE: Convert to IRQ_SAVE_DISABLE/IRQ_RESTORE.
+ *#*
+ *#* Revision 1.20  2004/12/13 11:51:43  bernie
+ *#* Fix a latent bug with reentrant serial IRQs.
+ *#*
  *#* Revision 1.19  2004/12/13 11:51:08  bernie
  *#* DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
  *#*
@@ -473,7 +479,7 @@ static void spi_starttx(struct SerialHardware *_hw)
        struct AvrSerial *hw = (struct AvrSerial *)_hw;
 
        cpuflags_t flags;
-       DISABLE_IRQSAVE(flags);
+       IRQ_SAVE_DISABLE(flags);
 
        /* Send data only if the SPI is not already transmitting */
        if (!hw->sending && !fifo_isempty(&ser_spi->txfifo))
@@ -482,7 +488,7 @@ static void spi_starttx(struct SerialHardware *_hw)
                SPDR = fifo_pop(&ser_spi->txfifo);
        }
 
-       ENABLE_IRQRESTORE(flags);
+       IRQ_RESTORE(flags);
 }
 
 static void spi_setbaudrate(UNUSED(struct SerialHardware *, _hw), UNUSED(unsigned long, rate))
@@ -824,6 +830,7 @@ SIGNAL(SIG_UART1_RECV)
 #endif
        }
        /* Re-enable receive complete int */
+       //IRQ_DISABLE;
        //UCSR1B |= BV(RXCIE);
 
        SER_STROBE_OFF;