Create a UART to USB Serial bridge with the DipCortex
Fork of DipCortex-USB-CDC by
Revision 5:dbe3aba53ebf, committed 2014-02-23
- Comitter:
- SolderSplashLabs
- Date:
- Sun Feb 23 23:02:12 2014 +0000
- Parent:
- 4:4d7bb9e0afe5
- Commit message:
- Removing changes committed to wrong repo
Changed in this revision
DipCortex-EEprom.lib | Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/DipCortex-EEprom.lib Sun Feb 23 22:56:23 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/SolderSplashLabs/code/DipCortex-EEprom/#53297f36733d
--- a/main.cpp Sun Feb 23 22:56:23 2014 +0000 +++ b/main.cpp Sun Feb 23 23:02:12 2014 +0000 @@ -4,7 +4,6 @@ #include "mbed.h" #include "USBSerial.h" -#include "DipCortex-EEprom.h" // Serial TX Pin19, Serial RX Pin20 // Using port and pin names as the mbed definitions pin defs for the M0 are incorrect @@ -26,40 +25,15 @@ int main() { -volatile char charIn; -char tempBuf[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; -int i = 0; - - IAP_Init(); pc.attach(settingsChanged); - // wait for a key press - charIn = pc.getc(); - - while (1) - { - pc.printf("Press a key to start\r\n"); - charIn = pc.getc(); - - // Test read - tempBuf[0] = 0; - IAP_Eeprom_Read(1, (uint8_t *)&tempBuf, 15); - pc.printf("EEprom Read : %s\r\n", &tempBuf[0]); + while (1) { + while (uart.readable()) { + pc.putc(uart.getc()); + } - // Write - sprintf( &tempBuf[0], "Testing %i", i ); - IAP_Eeprom_Write(1, (uint8_t *)&tempBuf, 15); - pc.printf("EEprom Writen : %s\r\n", &tempBuf[0]); - - tempBuf[0] = 0; - pc.printf("Press a key to read back\r\n"); - charIn = pc.getc(); - - // Read Back - tempBuf[0] = 0; - IAP_Eeprom_Read(1, (uint8_t *)&tempBuf, 15); - pc.printf("EEprom Read : %s\r\n", &tempBuf[0]); - - i++; + while (pc.readable()) { + uart.putc(pc.getc()); + } } }