summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-06-05 16:16:20 +0800
committerGitHub <[email protected]>2017-06-05 16:16:20 +0800
commit2a8890b188c2c70fdfa2afeadb3909c6529e5c24 (patch)
tree48484799f256a46183f7834e0f54684e30b53cbe
parente4823f3247b7a9fedce02b51749b37bafd7258e9 (diff)
parenta4a96bbface4aeee754559857ba323755609eb3d (diff)
Merge pull request #745 from TanekLiang/master
[bsp] re-implement tick interface for stm32f429-apollo HAL library and fixed typo
-rw-r--r--bsp/stm32f429-apollo/drivers/board.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/bsp/stm32f429-apollo/drivers/board.c b/bsp/stm32f429-apollo/drivers/board.c
index 544ce33f5c..9c4ba3f7f5 100644
--- a/bsp/stm32f429-apollo/drivers/board.c
+++ b/bsp/stm32f429-apollo/drivers/board.c
@@ -89,7 +89,7 @@ void SystemClock_Config(void)
Error_Handler();
}
- HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
+ HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/RT_TICK_PER_SECOND);
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
@@ -105,30 +105,35 @@ void SysTick_Handler(void)
{
/* enter interrupt */
rt_interrupt_enter();
- /* tick for HAL Library */
- HAL_IncTick();
+
rt_tick_increase();
/* leave interrupt */
rt_interrupt_leave();
}
-/* re-implementat tick interface for STM32 HAL */
+/* re-implement tick interface for STM32 HAL */
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
- /*Configure the SysTick to have interrupt in 1ms time basis*/
- HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/RT_TICK_PER_SECOND);
-
- /*Configure the SysTick IRQ priority */
- HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority ,0);
-
/* Return function status */
return HAL_OK;
}
+uint32_t HAL_GetTick(void)
+{
+ return rt_tick_get() * 1000 / RT_TICK_PER_SECOND;
+}
+
+void HAL_SuspendTick(void)
+{
+}
+
+void HAL_ResumeTick(void)
+{
+}
+
void HAL_Delay(__IO uint32_t Delay)
{
-// rt_thread_delay(Delay);
}
/**
@@ -142,7 +147,7 @@ void rt_hw_board_init()
/* Set the Vector Table base location at 0x10000000 */
SCB->VTOR = (0x10000000 & NVIC_VTOR_MASK);
#else /* VECT_TAB_FLASH */
- /* Set the Vector Table base location at 0x00000000 */
+ /* Set the Vector Table base location at 0x08000000 */
SCB->VTOR = (0x08000000 & NVIC_VTOR_MASK);
#endif
HAL_Init();
@@ -161,10 +166,6 @@ void rt_hw_board_init()
mpu_init();
#endif
-
-
-
-// nand_hy27uf_hw_init();
}
/*@}*/