platformio / platform-ststm8

ST STM8: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm8
Apache License 2.0
41 stars 26 forks source link

TIM2_CAP_COM_IRQHandler not triggered #14

Closed mogupta closed 4 years ago

mogupta commented 4 years ago

Hi @valeros and @ivankravets 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);