Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
74:81c47fff88a5
Parent:
0:4d17cd9c8f9d
Child:
78:1353744f01e1
--- a/UART3Interrupt.cpp	Wed Nov 19 14:06:13 2014 +0000
+++ b/UART3Interrupt.cpp	Mon Nov 24 16:43:16 2014 +0000
@@ -1,41 +1,30 @@
-#include "mbed.h"
-#include <stdint.h>
 #include "UART3Interrupt.h"
-#include "configs.h"
 
-char RXBuffer[DATA_SIZE];                         // UART3 RX Buffer
-//volatile uint8_t IntBuff[900];                 // Interrupt Buffer
-//static volatile uint8_t *RXHeadPtr;                  // Buffer Head Pointer
-//static volatile uint8_t *RXTailPtr;                  // Buffer Tail Pointer 
-//static volatile uint16_t move = 0;                       
-//uint8_t status = 0;
+char RXBuffer[__CB_BUFFER_SIZE__];
+///< UART3 RX Buffer
+
 volatile uint16_t RX_c = 0;   
 
-void SerialRecvInterrupt (void) {                 // UART3 Serial Interrupt Handler
+///< UART3 Serial Interrupt Handler
+void SerialRecvInterrupt( void ){
+    while ( LPC_UART3 -> LSR & ( 0<<1 ) ) {}
+    // Receive data from UART3 RX
+    *( RXBuffer + RX_c ) = LPC_UART3 -> RBR;
     
-    while ( LPC_UART3->LSR & (0<<1) ) {}     
-    *(RXBuffer+RX_c) = LPC_UART3->RBR;          // Receive data from UART3 RX
-    
-    if (RXBuffer[RX_c] != RXBuffer[RX_c-1]) {
+    if( RXBuffer[ RX_c ] != RXBuffer[ RX_c - 1 ] ){
        // led3 =!led3;    
     }
     
     RX_c++;
     
-    if ( RX_c == 300 )
-    { 
-       status = 1;
+    if ( RX_c == 300 ){ 
+       status = __READ__;
     }
-        
 }
 
 void RXFrameSync (void) {
-    
-//    led1 = !led1;
-//    led4 = !led4;
-    
     RX_c = 0;
-    status = 0;
+    status = __WAITING__;
 }