码迷,mamicode.com
首页 > 其他好文 > 详细

External Input Counter and External interrupt

时间:2015-08-27 00:07:05      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:

External Input Counter and External interrupt : count the input signal from the button. 

So what is the different between two methods ?

While external interrupt needs to jump into the interrupt routine to do the increment or decrement of a variable,

counter can handle the job nicely without jumping anywhere with External Input Counter.

Therefore, it will be obviously useful when your program has many types of interrupt running. 

HAL_TIM_Base_Start(&htim2);    //Start TIM2 without interrupt

while (1)
{
  count = __HAL_TIM_GetCounter(&htim2);    //read TIM2 counter value
}

 

External Input Counter and External interrupt

标签:

原文地址:http://www.cnblogs.com/shangdawei/p/4761801.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!