You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2017/02/22 01:48:07 UTC

[5/5] incubator-mynewt-core git commit: bsp/rb-nano2; configure SPI0 if syscfg says so.

bsp/rb-nano2; configure SPI0 if syscfg says so.


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

Branch: refs/heads/develop
Commit: 4ef28aaaa7fc24325a34f17ffe97fa2c9a594595
Parents: c9fdcc0
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Feb 21 17:37:35 2017 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Feb 21 17:37:35 2017 -0800

----------------------------------------------------------------------
 hw/bsp/rb-nano2/src/hal_bsp.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4ef28aaa/hw/bsp/rb-nano2/src/hal_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/rb-nano2/src/hal_bsp.c b/hw/bsp/rb-nano2/src/hal_bsp.c
index cdcc354..4686167 100644
--- a/hw/bsp/rb-nano2/src/hal_bsp.c
+++ b/hw/bsp/rb-nano2/src/hal_bsp.c
@@ -30,8 +30,10 @@
 #include "hal/hal_flash.h"
 #include "hal/hal_spi.h"
 #include "hal/hal_watchdog.h"
+#if MYNEWT_VAL(UART_0)
 #include "uart/uart.h"
 #include "uart_hal/uart_hal.h"
+#endif
 #include "os/os_dev.h"
 
 #if MYNEWT_VAL(UART_0)
@@ -165,4 +167,14 @@ hal_bsp_init(void)
       OS_DEV_INIT_PRIMARY, 0, uart_hal_init, (void *)&os_bsp_uart0_cfg);
     assert(rc == 0);
 #endif
+
+#if MYNEWT_VAL(SPI_0_MASTER)
+    rc = hal_spi_init(0, (void *)&os_bsp_spi0m_cfg, HAL_SPI_TYPE_MASTER);
+    assert(rc == 0);
+#endif
+
+#if MYNEWT_VAL(SPI_0_SLAVE)
+    rc = hal_spi_init(0, (void *)&os_bsp_spi0s_cfg, HAL_SPI_TYPE_SLAVE);
+    assert(rc == 0);
+#endif
 }