tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
349 stars 213 forks source link

TIM2_CAP_COM_IRQHandler not triggered #93

Closed mogupta closed 4 years ago

mogupta commented 4 years ago

Hi I tried the following example but its not triggering the TIM2_CAP_COM_IRQHandler interrupt handler. I have just changed the GPIO pins to suit my board. I also tried similar example with TIM1 , it didn't work TIM1_UPD_OVF_TRG_BRK_IRQHandler on the other hand are working. My configuration

platform = https://github.com/platformio/platform-ststm8.git
board = stm8sblue
framework = spl
upload_protocol = stlinkv2
monitor_speed = 115200
mogupta commented 4 years ago

Found the answer. All I had to do was the following. One example had the following but another had TIM1_ITConfig(TIM1_IT_COM, ENABLE); . Not sure why . TIM1_IT_CC1 seems obvious though. Not sure what is TIM1_IT_COM

  TIM1_ITConfig(TIM1_IT_CC1, ENABLE);
  TIM1_ITConfig(TIM1_IT_CC2, ENABLE);
  TIM1_ITConfig(TIM1_IT_CC3, ENABLE);
  TIM1_ITConfig(TIM1_IT_CC4, ENABLE);