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 2016/12/28 22:15:16 UTC

incubator-mynewt-core git commit: nrf52dk; fix includes when building with UART_1 set. Don't call os_cputime_init() if TIMER_0 is not set.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop afecb4cdb -> 73418c724


nrf52dk; fix includes when building with UART_1 set.
Don't call os_cputime_init() if TIMER_0 is not set.


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

Branch: refs/heads/develop
Commit: 73418c724f6d0b0ef8617e425fdf8ceaed76560b
Parents: afecb4c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Dec 28 14:14:00 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Dec 28 14:14:00 2016 -0800

----------------------------------------------------------------------
 hw/bsp/nrf52dk/src/hal_bsp.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/73418c72/hw/bsp/nrf52dk/src/hal_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52dk/src/hal_bsp.c b/hw/bsp/nrf52dk/src/hal_bsp.c
index be8322e..57b0f4a 100644
--- a/hw/bsp/nrf52dk/src/hal_bsp.c
+++ b/hw/bsp/nrf52dk/src/hal_bsp.c
@@ -31,8 +31,15 @@
 #include "hal/hal_watchdog.h"
 #include "hal/hal_i2c.h"
 #include "mcu/nrf52_hal.h"
+#if MYNEWT_VAL(UART_0) || MYNEWT_VAL(UART_1)
 #include "uart/uart.h"
+#endif
+#if MYNEWT_VAL(UART_0)
 #include "uart_hal/uart_hal.h"
+#endif
+#if MYNEWT_VAL(UART_1)
+#include "uart_bitbang/uart_bitbang.h"
+#endif
 #include "os/os_dev.h"
 #include "bsp.h"
 
@@ -149,6 +156,7 @@ hal_bsp_init(void)
 {
     int rc;
 
+    (void)rc;
 #if MYNEWT_VAL(TIMER_0)
     rc = hal_timer_init(0, NULL);
     assert(rc == 0);
@@ -170,10 +178,14 @@ hal_bsp_init(void)
     assert(rc == 0);
 #endif
 
+    /*
+     * What this depends on is what the OS_CPUTIME_TIMER_NUM is set to.
+     */
+#if MYNEWT_VAL(TIMER_0)
     /* Set cputime to count at 1 usec increments */
     rc = os_cputime_init(MYNEWT_VAL(CLOCK_FREQ));
     assert(rc == 0);
-
+#endif
 #if MYNEWT_VAL(I2C_0)
     rc = hal_i2c_init(0, (void *)&hal_i2c_cfg);
     assert(rc == 0);