Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

UART3Interrupt.cpp

Committer:
klauss
Date:
2015-03-13
Revision:
106:a34fcf9f0e02
Parent:
105:a930035b6556
Child:
109:a5b8264ffbbc

File content as of revision 106:a34fcf9f0e02:

#include "UART3Interrupt.h"

char RXBuffer[CB_BUFFER_SIZE];
///< UART3 RX Buffer

volatile uint16_t RX_c = 0;   

///< UART3 Serial Interrupt Handler
void SerialRecvInterrupt( void ){
    while ( LPC_UART3 -> LSR & ( 0<<1 ) ) {}
    // Receive data from UART3 RX
    *( RXBuffer + RX_c ) = LPC_UART3 -> RBR;
    
    if( RXBuffer[ RX_c ] != RXBuffer[ RX_c - 1 ] )
    {
        // FIXME remove this if ...
    }
    
    RX_c++;
    
    led4 =!led4;
    
    if ( RX_c == 300 ){ 
        status = __READ__;
        missed_pkg++;
        cpld_pkg_rx_counter++;
    }
}

void RXFrameSync (void) {
    RX_c = 0;
    status = __WAITING__;
}