Super Vision / Mbed 2 deprecated sv_usb_firmware

Dependencies:   MODSERIAL USBDevice_for_Rev_C_HW mbed

Fork of mbed_sv_firmware_with_init by Bob Recny

Revision:
18:d128c7020292
Parent:
17:1e704604e1ac
Child:
19:d3bef4fbab69
--- a/main.cpp	Sun Mar 01 02:53:23 2015 +0000
+++ b/main.cpp	Mon Mar 02 17:00:37 2015 +0000
@@ -13,7 +13,7 @@
 
 #include "mbed.h"
 #include "USBSerial.h"
-#include "MODSERIAL.h"
+//#include "MODSERIAL.h"
 
 // Constants
 #define LEDON       0                   // Low active for LEDs - turns LED on
@@ -46,7 +46,8 @@
 
 // Peripherals
 USBSerial cdc;                          // CDC Class USB<>Serial adapter.  Needs custom INF, but uses existing Windows drivers.
-MODSERIAL uart(PTA2, PTA1);             // UART port connected to RFID-FE board
+//MODSERIAL uart(PTA2, PTA1);             // UART port connected to RFID-FE board
+Serial uart(PTA2, PTA1);             // UART port connected to RFID-FE board
 I2C i2c(PTB1, PTB0);                    // I2C port connected to VL6180X and EEPROM - note addresses above)
 
 // GPIO signals
@@ -118,9 +119,9 @@
     rfid_rst = 1;                                                   // RFID FE Reset (active high)
 //    rfid_pwr = 1;                                                   // RFID power switch on USB board (active high for prototype 1)
     rfid_pwr = 0;                                                   // RFID power switch on USB board (active low for all others)
-    wait(0.25);                                                     // wait 250ms before...
+    wait(0.35);                                                     // wait 250ms before...
     rfid_rst = 0;                                                   // ... taking RFID out of reset
-    wait(0.25);
+    wait(0.35);
     
     while(!uart.readable())                                           // wait for RESET message from RFID
     {
@@ -130,8 +131,8 @@
         wait(0.1);
     }                                           
     
-    uart.txBufferFlush();                                           // clear out UART buffers
-    uart.rxBufferFlush();
+    //uart.txBufferFlush();                                           // clear out UART buffers
+    //uart.rxBufferFlush();
     
     led_err.write(LEDOFF);
         
@@ -518,6 +519,7 @@
         }
 
         if (uart.readable())                                        // message availalbe from rfid
+//        while (uart.readable())                                        // message availalbe from rfid
         {
             rfid_rd();
             em_pos = 0;