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:
2014-11-24
Revision:
74:81c47fff88a5
Parent:
0:4d17cd9c8f9d
Child:
78:1353744f01e1

File content as of revision 74:81c47fff88a5:

#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 ] ){
       // led3 =!led3;    
    }
    
    RX_c++;
    
    if ( RX_c == 300 ){ 
       status = __READ__;
    }
}

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;
    }    
    
}
*/