Test program to demonstrate usage of uTerminal library

Dependencies:   mbed uTerminal

Files at this revision

API Documentation at this revision

Comitter:
fbcosentino
Date:
Mon Feb 18 18:24:49 2019 +0000
Parent:
0:e9d152d29a2e
Commit message:
Examples for new USB feature

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
uTerminal.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Feb 18 17:01:05 2019 +0000
+++ b/main.cpp	Mon Feb 18 18:24:49 2019 +0000
@@ -1,4 +1,5 @@
 /**
+ *  @file main.cpp
  *  uTerminal_Example is a simple example demonstrating how to 
  *  use the uTerminal library.
  *
@@ -8,7 +9,27 @@
 #include "mbed.h"
 #include "uTerminal.h"
 
-uTerminal terminal(P0_19, P0_18); // TX, RX pins for board n-DAP
+//================================================================
+// INSTANCING THE TERMINAL:
+
+/*
+// Create a Serial object yourself
+Serial pc(P0_19, P0_18); // TX, RX pins for board n-DAP
+uTerminal terminal(&pc); // argument is the address of a Serial object
+*/
+
+// or...
+// This will automatically create an internal Serial object
+//uTerminal terminal(P0_19, P0_18); // TX, RX pins for board n-DAP
+
+// or...
+// Create a USBSerial object yourself (works with blocking and non-blocking)
+//USBSerial pc; // blocking
+USBSerial pc(0x1f00, 0x2012, 0x0001, false); // non-blocking
+uTerminal terminal(&pc); // argument is the address of a USBSerial object
+
+//================================================================
+
 
 char sbuf[1024]; // useb by sprintf
 
@@ -17,6 +38,7 @@
  *  If Auto-mode is used, this is called whenever a message arrives.
  *  Otherwise, called whenever termina.Process() is polled.
  */
+ 
 void msg_received() {
     int i;
 
@@ -38,6 +60,7 @@
     }
 }
 
+
 /**
  * Main loop
  */
--- a/uTerminal.lib	Mon Feb 18 17:01:05 2019 +0000
+++ b/uTerminal.lib	Mon Feb 18 18:24:49 2019 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/fbcosentino/code/uTerminal/#1655adb3a46e
+https://os.mbed.com/users/fbcosentino/code/uTerminal/#4e304b58f597