mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-04 20:58:03 +00:00
apps/canutils/libuavcan: Fix for recent change to STM32 timer frequency definiitions
This commit is contained in:
parent
19be2cafea
commit
a442f52a1e
1 changed files with 40 additions and 0 deletions
|
|
@ -23,3 +23,43 @@
|
|||
}
|
||||
};
|
||||
|
||||
--- libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp.orig 2016-06-05 09:12:29.086814547 -0600
|
||||
+++ libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp 2016-06-05 09:15:03.676810202 -0600
|
||||
@@ -31,17 +31,30 @@
|
||||
|
||||
# if UAVCAN_STM32_NUTTX
|
||||
# define TIMX UAVCAN_STM32_GLUE3(STM32_TIM, UAVCAN_STM32_TIMER_NUMBER, _BASE)
|
||||
-# define TMR_REG(o) (TIMX + (o))
|
||||
-# define TIMX_INPUT_CLOCK STM32_TIM27_FREQUENCY
|
||||
+# define TMR_REG(o) (TIMX + (o))
|
||||
|
||||
-# define TIMX_IRQn UAVCAN_STM32_GLUE2(STM32_IRQ_TIM, UAVCAN_STM32_TIMER_NUMBER)
|
||||
+# if UAVCAN_STM32_TIMER_NUMBER == 2
|
||||
+# define TIMX_INPUT_CLOCK BOARD_TIM2_FREQUENCY
|
||||
+# elif UAVCAN_STM32_TIMER_NUMBER == 3
|
||||
+# define TIMX_INPUT_CLOCK BOARD_TIM3_FREQUENCY
|
||||
+# elif UAVCAN_STM32_TIMER_NUMBER == 4
|
||||
+# define TIMX_INPUT_CLOCK BOARD_TIM4_FREQUENCY
|
||||
+# elif UAVCAN_STM32_TIMER_NUMBER == 5
|
||||
+# define TIMX_INPUT_CLOCK BOARD_TIM5_FREQUENCY
|
||||
+# elif UAVCAN_STM32_TIMER_NUMBER == 6
|
||||
+# define TIMX_INPUT_CLOCK BOARD_TIM6_FREQUENCY
|
||||
+# elif UAVCAN_STM32_TIMER_NUMBER == 7
|
||||
+# define TIMX_INPUT_CLOCK BOARD_TIM7_FREQUENCY
|
||||
+# endif
|
||||
+
|
||||
+# define TIMX_IRQn UAVCAN_STM32_GLUE2(STM32_IRQ_TIM, UAVCAN_STM32_TIMER_NUMBER)
|
||||
# endif
|
||||
|
||||
# if UAVCAN_STM32_TIMER_NUMBER >= 2 && UAVCAN_STM32_TIMER_NUMBER <= 7
|
||||
-# define TIMX_RCC_ENR RCC->APB1ENR
|
||||
-# define TIMX_RCC_RSTR RCC->APB1RSTR
|
||||
-# define TIMX_RCC_ENR_MASK UAVCAN_STM32_GLUE3(RCC_APB1ENR_TIM, UAVCAN_STM32_TIMER_NUMBER, EN)
|
||||
-# define TIMX_RCC_RSTR_MASK UAVCAN_STM32_GLUE3(RCC_APB1RSTR_TIM, UAVCAN_STM32_TIMER_NUMBER, RST)
|
||||
+# define TIMX_RCC_ENR RCC->APB1ENR
|
||||
+# define TIMX_RCC_RSTR RCC->APB1RSTR
|
||||
+# define TIMX_RCC_ENR_MASK UAVCAN_STM32_GLUE3(RCC_APB1ENR_TIM, UAVCAN_STM32_TIMER_NUMBER, EN)
|
||||
+# define TIMX_RCC_RSTR_MASK UAVCAN_STM32_GLUE3(RCC_APB1RSTR_TIM, UAVCAN_STM32_TIMER_NUMBER, RST)
|
||||
# else
|
||||
# error "This UAVCAN_STM32_TIMER_NUMBER is not supported yet"
|
||||
# endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue