IoT_SCV_CH584M/bsp/src/bsp_tim.c

31 lines
444 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "bsp_tim.h"
// tick_1ms_cnt在SysTick_Handler()中1ms +1
volatile uint32_t tick_1ms_cnt = 0;
/**
* @description: 以SysTick1ms为基础
* @return {uint32_t}
*/
uint32_t BSP_Get_Tick(void)
{
/* Platform implementation */
return tick_1ms_cnt;
}
// SysTick中断函数
__INTERRUPT
__HIGH_CODE
void SysTick_Handler()
{
static uint8_t cnt_ms = 0;
SysTick->SR = 0; // 清除中断标志
tick_1ms_cnt++;
cnt_ms++;
}