Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 43776f285 -> 80ed11d38


MK64F12; allow uart0 to be used as console.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/80ed11d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/80ed11d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/80ed11d3

Branch: refs/heads/develop
Commit: 80ed11d38079f435b25a41411700879dc22db50f
Parents: 43776f2
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Jan 31 10:54:02 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Jan 31 10:54:02 2017 -0800

----------------------------------------------------------------------
 hw/mcu/nxp/MK64F12/src/hal_uart.c | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/80ed11d3/hw/mcu/nxp/MK64F12/src/hal_uart.c
----------------------------------------------------------------------
diff --git a/hw/mcu/nxp/MK64F12/src/hal_uart.c 
b/hw/mcu/nxp/MK64F12/src/hal_uart.c
index d429ab6..ba56d5e 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_uart.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_uart.c
@@ -391,15 +391,13 @@ hal_uart_config(int port, int32_t speed, uint8_t 
databits, uint8_t stopbits,
     NVIC_SetVector(u->u_irq, (uint32_t)s_uartirqs[port]);
 
     /* Initialize UART device */
-    if (port != 0) {
-        UART_Init(u->u_base, &uconfig, CLOCK_GetFreq(u->clk_src));
-        UART_EnableTx(u->u_base, true);
-        UART_EnableRx(u->u_base, true);
-        UART_EnableInterrupts(u->u_base,
-                              kUART_RxDataRegFullInterruptEnable
-                              | kUART_RxOverrunInterruptEnable);
-        EnableIRQ(u->u_irq);
-    }
+    UART_Init(u->u_base, &uconfig, CLOCK_GetFreq(u->clk_src));
+    UART_EnableTx(u->u_base, true);
+    UART_EnableRx(u->u_base, true);
+    UART_EnableInterrupts(u->u_base,
+                          kUART_RxDataRegFullInterruptEnable |
+                          kUART_RxOverrunInterruptEnable);
+    EnableIRQ(u->u_irq);
 
     return 0;
 }
@@ -451,14 +449,5 @@ int hal_uart_init(int port, void *cfg)
         }
     }
 
-    if (port == 0) {
-        CLOCK_EnableClock(uarts[0].p_clock);
-        PORT_SetPinMux(uarts[0].p_base, uarts[0].u_pin_rx, kPORT_MuxAlt3);
-        PORT_SetPinMux(uarts[0].p_base, uarts[0].u_pin_tx, kPORT_MuxAlt3);
-        DbgConsole_Init((uint32_t)uarts[0].u_base, 115200,
-                        DEBUG_CONSOLE_DEVICE_TYPE_UART, 
CLOCK_GetFreq(uarts[0].clk_src));
-        PRINTF("UART%d CONFIGURED\r\n", port);
-    }
-
     return 0;
 }

Reply via email to