You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2018/04/30 09:49:33 UTC

[mynewt-core] 02/02: Move some timer configs inside the driver

This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 2bb24c0f86120ee97034b1b9252d85b5ff5c4ded
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Thu Apr 26 19:55:27 2018 -0300

    Move some timer configs inside the driver
    
    STM32_OFLOW_VALUE/STM32_NSEC_PER_SEC have the same value for all timers
    use in all MCU models so removing them from the configurable hal header.
---
 hw/mcu/stm/stm32_common/src/hal_timer.c      | 3 +++
 hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h | 2 --
 hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h | 2 --
 hw/mcu/stm/stm32f4xx/include/mcu/stm32_hal.h | 2 --
 hw/mcu/stm/stm32f7xx/include/mcu/stm32_hal.h | 2 --
 hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h | 2 --
 6 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/hw/mcu/stm/stm32_common/src/hal_timer.c b/hw/mcu/stm/stm32_common/src/hal_timer.c
index 2b49322..c80f7b2 100644
--- a/hw/mcu/stm/stm32_common/src/hal_timer.c
+++ b/hw/mcu/stm/stm32_common/src/hal_timer.c
@@ -27,6 +27,9 @@
 #include <hal/hal_timer.h>
 #include "mcu/stm32_hal.h"
 
+#define STM32_OFLOW_VALUE       (0x10000UL)
+#define STM32_NSEC_PER_SEC      (1000000000UL)
+
 struct stm32_hal_tmr {
     TIM_TypeDef *sht_regs;   /* Pointer to timer registers */
     uint32_t sht_oflow;      /* 16 bits of overflow to make timer 32bits */
diff --git a/hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h
index 8c308f7..9753547 100644
--- a/hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h
+++ b/hw/mcu/stm/stm32f1xx/include/mcu/stm32_hal.h
@@ -66,8 +66,6 @@ struct stm32_hal_spi_cfg {
 #include "stm32f1xx_hal_tim.h"
 
 #define STM32_HAL_TIMER_MAX     (3)
-#define STM32_OFLOW_VALUE       (0x10000UL)
-#define STM32_NSEC_PER_SEC      (1000000000UL)
 
 #ifdef __cplusplus
 }
diff --git a/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h
index 5cb0d1c..18edb52 100644
--- a/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h
+++ b/hw/mcu/stm/stm32f3xx/include/mcu/stm32_hal.h
@@ -72,8 +72,6 @@ struct stm32_hal_spi_cfg {
 #include "stm32f3xx_hal_tim.h"
 
 #define STM32_HAL_TIMER_MAX     (3)
-#define STM32_OFLOW_VALUE       (0x10000UL)
-#define STM32_NSEC_PER_SEC      (1000000000UL)
 
 #ifdef __cplusplus
 }
diff --git a/hw/mcu/stm/stm32f4xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32f4xx/include/mcu/stm32_hal.h
index da25f7d..0eb8ece 100644
--- a/hw/mcu/stm/stm32f4xx/include/mcu/stm32_hal.h
+++ b/hw/mcu/stm/stm32f4xx/include/mcu/stm32_hal.h
@@ -70,8 +70,6 @@ struct stm32_hal_spi_cfg {
 #include "stm32f4xx_hal_tim.h"
 
 #define STM32_HAL_TIMER_MAX     (3)
-#define STM32_OFLOW_VALUE       (0x10000UL)
-#define STM32_NSEC_PER_SEC      (1000000000UL)
 
 #ifdef __cplusplus
 }
diff --git a/hw/mcu/stm/stm32f7xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32f7xx/include/mcu/stm32_hal.h
index cc70131..3fa0ccb 100644
--- a/hw/mcu/stm/stm32f7xx/include/mcu/stm32_hal.h
+++ b/hw/mcu/stm/stm32f7xx/include/mcu/stm32_hal.h
@@ -74,8 +74,6 @@ struct stm32_hal_spi_cfg {
 #include "stm32f7xx_hal_tim.h"
 
 #define STM32_HAL_TIMER_MAX     (3)
-#define STM32_OFLOW_VALUE       (0x10000UL)
-#define STM32_NSEC_PER_SEC      (1000000000UL)
 
 #ifdef __cplusplus
 }
diff --git a/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h
index f4e6f83..d618d4d 100644
--- a/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h
+++ b/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h
@@ -70,8 +70,6 @@ struct stm32_hal_spi_cfg {
 #include "stm32l1xx_hal_tim.h"
 
 #define STM32_HAL_TIMER_MAX     (3)
-#define STM32_OFLOW_VALUE       (0x10000UL)
-#define STM32_NSEC_PER_SEC      (1000000000UL)
 
 #ifdef __cplusplus
 }

-- 
To stop receiving notification emails like this one, please contact
utzig@apache.org.