mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [01/50] [abbrv] incubator-mynewt-core git commit: olimex-e407 - hal_uart_close().
Date Thu, 11 Aug 2016 21:27:01 GMT
Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/phyrx_no_mbuf a621643fd -> 6a5c8ae64


olimex-e407 - hal_uart_close().


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

Branch: refs/heads/phyrx_no_mbuf
Commit: 2a569b8bb759e154d006a93b32ef00f8967f5d89
Parents: d92d63b
Author: Christopher Collins <ccollins@apache.org>
Authored: Tue Aug 2 12:40:46 2016 -0700
Committer: William San Filippo <wills@runtime.io>
Committed: Thu Aug 11 14:26:24 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/2a569b8b/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 3b2868f..43d83eb 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_uart.c
@@ -371,3 +371,19 @@ hal_uart_config(int port, int32_t baudrate, uint8_t databits, uint8_t
stopbits,
 
     return 0;
 }
+
+int
+hal_uart_close(int port)
+{
+    struct hal_uart *u;
+
+    if (port >= UART_CNT) {
+        return -1;
+    }
+    u = &uarts[port];
+
+    u->u_open = 0;
+    u->u_regs->CR1 = 0;
+
+    return 0;
+}


Mime
View raw message