From: frief Date: Sat, 19 Jul 2003 20:19:02 +0000 (+0000) Subject: process RX bytes earlier than TX bytes X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ab0e6d68ae621ce25cc750c79f5f1b3392764d1a;p=fw%2Fsdcc process RX bytes earlier than TX bytes git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2758 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/device/lib/_ser.c b/device/lib/_ser.c index 064a7d00..b06f69af 100644 --- a/device/lib/_ser.c +++ b/device/lib/_ser.c @@ -83,6 +83,11 @@ ser_interrupt_handler(void) interrupt 4 using 1 { ES=0; + if (RI) { + RI = 0; + ser_rxBuffer[ser_rxIndexIn++] = SBUF; + } + if (TI) { TI = 0; if (ser_txIndexIn == ser_txIndexOut) { @@ -93,11 +98,6 @@ ser_interrupt_handler(void) interrupt 4 using 1 } } - if (RI) { - RI = 0; - ser_rxBuffer[ser_rxIndexIn++] = SBUF; - } - ES=1; } diff --git a/device/lib/serial.c b/device/lib/serial.c index 321c46ee..bb48557e 100644 --- a/device/lib/serial.c +++ b/device/lib/serial.c @@ -44,6 +44,13 @@ void serial_init(void) void serial_interrupt_handler(void) interrupt 4 using 1 { ES=0; + if ( RI ) + { + RI = 0; + srx_buffer[srx_index_in++]=SBUF; + work_flag_byte_arrived = 1; + rx_serial_buffer_empty = 0; + } if ( TI ) { TI = 0; @@ -54,13 +61,6 @@ void serial_interrupt_handler(void) interrupt 4 using 1 } else SBUF = stx_buffer[stx_index_out++]; } - if ( RI ) - { - RI = 0; - srx_buffer[srx_index_in++]=SBUF; - work_flag_byte_arrived = 1; - rx_serial_buffer_empty = 0; - } ES=1; }