You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2016/10/10 19:27:03 UTC

[47/50] [abbrv] incubator-mynewt-core git commit: MYNEWT-392 STM32F4 hal_uart_init() func missing

MYNEWT-392 STM32F4 hal_uart_init() func missing

- Adding hal_uart_init() function which passes the config looking up the
  uart port. Since uart_config takes care of setting the interrupt
  vector and enabling it, not changing that.


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/c10e6631
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/c10e6631
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/c10e6631

Branch: refs/heads/sterly_refactor
Commit: c10e6631060d44bc9ac2ae62f7b5a56bf1246033
Parents: d4c5807
Author: Vipul Rahane <vi...@runtime.io>
Authored: Thu Sep 22 13:11:03 2016 -0700
Committer: Vipul Rahane <vi...@runtime.io>
Committed: Thu Sep 22 20:21:03 2016 -0700

----------------------------------------------------------------------
 hw/mcu/stm/stm32f4xx/src/hal_uart.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/c10e6631/hw/mcu/stm/stm32f4xx/src/hal_uart.c
----------------------------------------------------------------------
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_uart.c b/hw/mcu/stm/stm32f4xx/src/hal_uart.c
index 685e3d2..3f78359 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_uart.c
@@ -261,6 +261,24 @@ hal_uart_set_nvic(IRQn_Type irqn, struct hal_uart *uart)
 }
 
 int
+hal_uart_init(int port, void *arg)
+{
+    struct hal_uart *u;
+
+    if (port != 0) {
+        return -1;
+    }
+
+    u = &uarts[port];
+    if (u->u_open) {
+        return -1;
+    }
+    u->u_cfg = arg;
+
+    return 0;
+}
+
+int
 hal_uart_config(int port, int32_t baudrate, uint8_t databits, uint8_t stopbits,
   enum hal_uart_parity parity, enum hal_uart_flow_ctl flow_ctl)
 {