X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=device%2Flib%2Fserial.c;h=bb48557edb74b24a271e9a2d9f1cc3adef14cac8;hb=d1509cf37c6ba9cc5aa238fcce11824efefc7941;hp=321c46ee774600cafe4bf3e42ef8181838a7271e;hpb=ebd55a1718bd19fd8fcf0c072af147a083e3382b;p=fw%2Fsdcc 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; }