mbed library sources(for async_print)

Dependents:   AsyncPrint

Fork of mbed-src by mbed official

Files at this revision

API Documentation at this revision

Comitter:
SteveKim
Date:
Mon Jul 13 04:32:07 2015 +0000
Parent:
586:dfaf40375987
Child:
588:3825fc0ad3d1
Commit message:
.

Changed in this revision

targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c	Wed Jul 08 15:00:09 2015 +0100
+++ b/targets/hal/TARGET_WIZNET/TARGET_W7500x/serial_api.c	Mon Jul 13 04:32:07 2015 +0000
@@ -180,18 +180,31 @@
  * INTERRUPTS HANDLING
  ******************************************************************************/
 
+// mbed Async Debug Print
+void (*p_async_print)(const char *format, ...);
+int rx_irq_counter = 0;
+
 static void uart_irq(UARTName name, int id)
 {
     UART = (UART_TypeDef *)name;
+    p_async_print("B");
     if (serial_irq_ids[id] != 0) {
+       p_async_print("C");
        if( UART_GetITStatus(UART,UART_IT_FLAG_TXI) != RESET ){
+           p_async_print("D");
            irq_handler(serial_irq_ids[id], TxIrq);
+           p_async_print("E");
            UART_ClearITPendingBit(UART,UART_IT_FLAG_TXI);
+           p_async_print("F");
         }
-       if( UART_GetITStatus(UART,UART_IT_FLAG_RXI) != RESET ){
+       if( UART_GetITStatus(UART,UART_IT_FLAG_RXI) != RESET ){           
+           p_async_print("G"); 
            irq_handler(serial_irq_ids[id], RxIrq);
+           //p_async_print("IRQ : UART_IT_FLAG_RXI(%d) \r\n", id);
+           p_async_print("H");
        }
     }
+    p_async_print("I");
 }
 
 #ifdef __cplusplus
@@ -204,7 +217,10 @@
 
 void UART1_Handler()
 {
+    rx_irq_counter++;
+    p_async_print("A");
     uart_irq(UART_1, 1);
+    p_async_print("\r\n");
 }
 #ifdef __cplusplus
 }
@@ -255,7 +271,7 @@
     UART_TypeDef *uart = (UART_TypeDef *)(obj->uart);
 //    while(!serial_readable(obj));
     while(uart->FR & UART_FR_RXFE);
-
+    
     return (uart->DR & 0xFF);
 }