微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > stm32_timer基本定时器配置及实现灯闪烁

stm32_timer基本定时器配置及实现灯闪烁

时间:11-11 来源:互联网 点击:

led
* Description : Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* Input : - file: pointer to the source file name
* - line: assert_param error line source number
* Return : None
*******************************************************************************/
void assert_failed(u8* file, u32 line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

/* Infinite loop */
while (1)
{
}
}
#endif


stm32f10x_it.c有关TIM2_IRQHandler代码如下

void TIM2_IRQHandler(void)
{
if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM2,TIM_IT_Update);

GPIO_WriteBit(GPIOC, GPIO_Pin_6, (BitAction)((1 - GPIO_ReadOutputDataBit(GPIOC, GPIO_Pin_6))));
}
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top