Simple UART0 usage with SimpleLib

Dependencies:   mbed SimpleLib

Revision:
2:d367033913a2
Parent:
1:6a9f5827b72e
--- a/main.cpp	Sat Nov 13 11:21:01 2010 +0000
+++ b/main.cpp	Sat Nov 13 14:48:05 2010 +0000
@@ -5,8 +5,6 @@
 #include "serial.h"
 #include "leds.h"
 
-Serial pc(USBTX, USBRX);
-
 void serialOut(unsigned char c) {
     SERIAL_PUTCHAR(c);
 }
@@ -18,6 +16,19 @@
     }
 }
 
+void serialOutHex32(unsigned int i)
+{
+    for(int j = 0; j < 8; j++)
+    {
+        unsigned char c = (i & 0xF0000000) >> 28;
+        if(c < 10)
+            serialOut('0' + c);
+        else
+            serialOut('A' + c - 10);
+        i = i << 4;
+    }
+}
+
 SERIAL_INTERRUPT_HANDLER(void) {
     // Check if interrupt is pending
     if(!SERIAL_CHECK_INTERRUPT())
@@ -34,12 +45,11 @@
 
 int main() {
     // Hardware Init
-    // SERIAL_INIT();
-    // SERIAL_SETBAUD(9600);
-    pc.baud(9600);
+    SERIAL_INIT();
+    SERIAL_SETBAUD(9600);
     SERIAL_ENABLE_INTERRUPT(SERIAL_INT_RX);
-
+    
     serialOutString("Simple UART Sample Code\r\n");
-
+    
     while (1);
 }
\ No newline at end of file