Repository: incubator-mynewt-core Updated Branches: refs/heads/develop b06c2a05c -> 755456ce7
MYNEWT-542 Fix controller errors when os cputime not 1 MHZ Went through most of the rest of the bsps and fixed hal_bsp.c and syscfg.yml to remove the CLOCK_FREQ definition. Did not change the mips implementation. 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/755456ce Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/755456ce Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/755456ce Branch: refs/heads/develop Commit: 755456ce7d6f47d6e4c37f372d7099e96bd240db Parents: b06c2a0 Author: William San Filippo <[email protected]> Authored: Wed Jan 18 11:22:44 2017 -0800 Committer: William San Filippo <[email protected]> Committed: Wed Jan 18 11:23:48 2017 -0800 ---------------------------------------------------------------------- hw/bsp/bmd300eval/src/hal_bsp.c | 2 +- hw/bsp/nrf51-arduino_101/src/hal_bsp.c | 5 +++-- hw/bsp/nrf51-arduino_101/syscfg.yml | 4 ---- hw/bsp/nrf51-blenano/src/hal_bsp.c | 8 ++------ hw/bsp/nrf51-blenano/syscfg.yml | 4 ---- hw/bsp/nrf51dk-16kbram/src/hal_bsp.c | 5 +++-- hw/bsp/nrf51dk-16kbram/syscfg.yml | 4 ---- hw/bsp/nrf51dk/src/hal_bsp.c | 5 +++-- hw/bsp/nrf51dk/syscfg.yml | 4 ---- hw/bsp/nrf52840pdk/src/hal_bsp.c | 2 +- hw/bsp/nrf52dk/src/hal_bsp.c | 2 +- hw/bsp/nucleo-f401re/syscfg.yml | 4 ---- hw/bsp/olimex_stm32-e407_devboard/syscfg.yml | 4 ---- hw/bsp/usbmkw41z/syscfg.yml | 4 ---- 14 files changed, 14 insertions(+), 43 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/bmd300eval/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd300eval/src/hal_bsp.c b/hw/bsp/bmd300eval/src/hal_bsp.c index 057e08b..4f6ebb1 100644 --- a/hw/bsp/bmd300eval/src/hal_bsp.c +++ b/hw/bsp/bmd300eval/src/hal_bsp.c @@ -48,7 +48,7 @@ static struct uart_dev os_bsp_bitbang_uart1; static const struct uart_bitbang_conf os_bsp_uart1_cfg = { .ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX), .ubc_txpin = MYNEWT_VAL(UART_1_PIN_RX), - .ubc_cputimer_freq = MYNEWT_VAL(CLOCK_FREQ), + .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ), }; #endif http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51-arduino_101/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c index 7975d54..6a5c4d3 100644 --- a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c +++ b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c @@ -158,9 +158,10 @@ hal_bsp_init(void) assert(rc == 0); #endif - /* Set cputime to count at 1 usec increments */ - rc = os_cputime_init(MYNEWT_VAL(CLOCK_FREQ)); +#if (MYNEWT_VAL(OS_CPUTIME_TIMER_NUM) >= 0) + rc = os_cputime_init(MYNEWT_VAL(OS_CPUTIME_FREQ)); assert(rc == 0); +#endif #if MYNEWT_VAL(SPI_0_MASTER) rc = hal_spi_init(0, (void *)&os_bsp_spi0m_cfg, HAL_SPI_TYPE_MASTER); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51-arduino_101/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-arduino_101/syscfg.yml b/hw/bsp/nrf51-arduino_101/syscfg.yml index 75c3aca..c513e26 100644 --- a/hw/bsp/nrf51-arduino_101/syscfg.yml +++ b/hw/bsp/nrf51-arduino_101/syscfg.yml @@ -24,10 +24,6 @@ syscfg.defs: description: 'TBD' value: 1 - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - XTAL_32768: description: 'TBD' value: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51-blenano/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-blenano/src/hal_bsp.c b/hw/bsp/nrf51-blenano/src/hal_bsp.c index 85c1c99..23f5c84 100644 --- a/hw/bsp/nrf51-blenano/src/hal_bsp.c +++ b/hw/bsp/nrf51-blenano/src/hal_bsp.c @@ -159,12 +159,8 @@ hal_bsp_init(void) assert(rc == 0); #endif - /* - * XXXX, depending on what timer OS_CPUTIME_TIMER_NUM is set to use. - */ -#if MYNEWT_VAL(TIMER_0) - /* Set cputime to count at 1 usec increments */ - rc = os_cputime_init(MYNEWT_VAL(CLOCK_FREQ)); +#if (MYNEWT_VAL(OS_CPUTIME_TIMER_NUM) >= 0) + rc = os_cputime_init(MYNEWT_VAL(OS_CPUTIME_FREQ)); assert(rc == 0); #endif http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51-blenano/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-blenano/syscfg.yml b/hw/bsp/nrf51-blenano/syscfg.yml index 2376352..6ff8328 100644 --- a/hw/bsp/nrf51-blenano/syscfg.yml +++ b/hw/bsp/nrf51-blenano/syscfg.yml @@ -24,10 +24,6 @@ syscfg.defs: description: 'TBD' value: 1 - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - XTAL_32768: description: 'TBD' value: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c b/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c index 68e262f..5db6490 100644 --- a/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c +++ b/hw/bsp/nrf51dk-16kbram/src/hal_bsp.c @@ -169,9 +169,10 @@ hal_bsp_init(void) assert(rc == 0); #endif - /* Set cputime to count at 1 usec increments */ - rc = os_cputime_init(MYNEWT_VAL(CLOCK_FREQ)); +#if (MYNEWT_VAL(OS_CPUTIME_TIMER_NUM) >= 0) + rc = os_cputime_init(MYNEWT_VAL(OS_CPUTIME_FREQ)); assert(rc == 0); +#endif #if MYNEWT_VAL(SPI_0_MASTER) rc = hal_spi_init(0, (void *)&os_bsp_spi0m_cfg, HAL_SPI_TYPE_MASTER); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51dk-16kbram/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk-16kbram/syscfg.yml b/hw/bsp/nrf51dk-16kbram/syscfg.yml index 0bcd8d9..9794dcf 100644 --- a/hw/bsp/nrf51dk-16kbram/syscfg.yml +++ b/hw/bsp/nrf51dk-16kbram/syscfg.yml @@ -24,10 +24,6 @@ syscfg.defs: description: 'TBD' value: 1 - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - XTAL_32768: description: 'TBD' value: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51dk/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk/src/hal_bsp.c b/hw/bsp/nrf51dk/src/hal_bsp.c index 8f5b832..17b06d1 100644 --- a/hw/bsp/nrf51dk/src/hal_bsp.c +++ b/hw/bsp/nrf51dk/src/hal_bsp.c @@ -167,9 +167,10 @@ hal_bsp_init(void) assert(rc == 0); #endif - /* Set cputime to count at 1 usec increments */ - rc = os_cputime_init(MYNEWT_VAL(CLOCK_FREQ)); +#if (MYNEWT_VAL(OS_CPUTIME_TIMER_NUM) >= 0) + rc = os_cputime_init(MYNEWT_VAL(OS_CPUTIME_FREQ)); assert(rc == 0); +#endif #if MYNEWT_VAL(SPI_0_MASTER) rc = hal_spi_init(0, (void *)&os_bsp_spi0m_cfg, HAL_SPI_TYPE_MASTER); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf51dk/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk/syscfg.yml b/hw/bsp/nrf51dk/syscfg.yml index 4b9e608..5a19cb6 100644 --- a/hw/bsp/nrf51dk/syscfg.yml +++ b/hw/bsp/nrf51dk/syscfg.yml @@ -24,10 +24,6 @@ syscfg.defs: description: 'TBD' value: 1 - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - XTAL_32768: description: 'TBD' value: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nrf52840pdk/src/hal_bsp.c ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52840pdk/src/hal_bsp.c b/hw/bsp/nrf52840pdk/src/hal_bsp.c index 7a1c6e8..c904cdb 100644 --- a/hw/bsp/nrf52840pdk/src/hal_bsp.c +++ b/hw/bsp/nrf52840pdk/src/hal_bsp.c @@ -51,7 +51,7 @@ static struct uart_dev os_bsp_bitbang_uart1; static const struct uart_bitbang_conf os_bsp_uart1_cfg = { .ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX), .ubc_txpin = MYNEWT_VAL(UART_1_PIN_RX), - .ubc_cputimer_freq = MYNEWT_VAL(CLOCK_FREQ), + .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ), }; #endif http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/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 be27d0c..40ce57b 100644 --- a/hw/bsp/nrf52dk/src/hal_bsp.c +++ b/hw/bsp/nrf52dk/src/hal_bsp.c @@ -58,7 +58,7 @@ static struct uart_dev os_bsp_bitbang_uart1; static const struct uart_bitbang_conf os_bsp_uart1_cfg = { .ubc_rxpin = MYNEWT_VAL(UART_1_PIN_TX), .ubc_txpin = MYNEWT_VAL(UART_1_PIN_RX), - .ubc_cputimer_freq = MYNEWT_VAL(CLOCK_FREQ), + .ubc_cputimer_freq = MYNEWT_VAL(OS_CPUTIME_FREQ), }; #endif http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/nucleo-f401re/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nucleo-f401re/syscfg.yml b/hw/bsp/nucleo-f401re/syscfg.yml index c27ed47..0747b1b 100644 --- a/hw/bsp/nucleo-f401re/syscfg.yml +++ b/hw/bsp/nucleo-f401re/syscfg.yml @@ -18,10 +18,6 @@ # syscfg.defs: - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - UART_0: description: 'TBD' value: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml b/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml index bccc40c..d1d19fd 100644 --- a/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml +++ b/hw/bsp/olimex_stm32-e407_devboard/syscfg.yml @@ -19,10 +19,6 @@ # Package: hw/bsp/olimex_stm32-e407_devboard syscfg.defs: - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - ADC_1: description: "ADC_1" value: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/755456ce/hw/bsp/usbmkw41z/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/usbmkw41z/syscfg.yml b/hw/bsp/usbmkw41z/syscfg.yml index 8379c99..b3e024e 100644 --- a/hw/bsp/usbmkw41z/syscfg.yml +++ b/hw/bsp/usbmkw41z/syscfg.yml @@ -24,10 +24,6 @@ syscfg.defs: description: 'TBD' value: 1 - CLOCK_FREQ: - description: 'TBD' - value: 1000000 - syscfg.vals: CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
