Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: UART3Interrupt.cpp
- Revision:
- 119:ee6a53069455
- Parent:
- 117:e9facba9db27
- Child:
- 121:ee02790d00b7
diff -r b93b17c50910 -r ee6a53069455 UART3Interrupt.cpp --- a/UART3Interrupt.cpp Fri Apr 24 13:54:24 2015 +0000 +++ b/UART3Interrupt.cpp Thu Apr 30 15:42:41 2015 +0000 @@ -1,6 +1,6 @@ #include "UART3Interrupt.h" -char RXBuffer[__CB_BUFFER_SIZE__]; +char RXBuffer[CB_BUFFER_SIZE]; ///< UART3 RX Buffer volatile uint16_t RX_c = 0; @@ -11,16 +11,12 @@ // Receive data from UART3 RX *( RXBuffer + RX_c ) = LPC_UART3 -> RBR; - if( RXBuffer[ RX_c ] != RXBuffer[ RX_c - 1 ] ){ - // led3 =!led3; - } - RX_c++; led4 =!led4; if ( RX_c == 300 ){ - status = __READ__; + status = READ; missed_pkg++; cpld_pkg_rx_counter++; } @@ -28,73 +24,5 @@ void RXFrameSync (void) { RX_c = 0; - status = __WAITING__; -} - - - - - - - - - - - - - - -/* -void initRX (void) { - -RXHeadPtr = IntBuff; // Initial state -RXHeadPtr = RXTailPtr; - -} - -void SerialRecvInterrupt (void) // UART3 Serial Interrupt Handler -{ - static uint8_t data = 0; - while ( LPC_UART3->LSR &= (0<<1) ) {} - // *(RXBuffer+idx) = LPC_UART3->RBR; Receive data from UART3 RX - - data = LPC_UART3->RBR; // Receive data from UART3 RX - - RXHeadPtr = &data; - - RXHeadPtr++; - move++; - - if ( RXHeadPtr == (IntBuff+899) ) - { - RXHeadPtr = IntBuff; - } - -} - -void RcvRX( void ) { - - static uint16_t p = 0; - static uint8_t data = 0; - - if ( move ) { - - data = *RXTailPtr; - - RXBuffer[p] = data; - RXTailPtr++; - move--; - p++; - } - - if ( RXTailPtr == (IntBuff+899) ) { - RXTailPtr = IntBuff; - } - - if ( p == 300 ) { - processRX = 1; - p = 0; - } - -} -*/ \ No newline at end of file + status = WAITING; +} \ No newline at end of file