Skip to main content
Visitor II
January 10, 2018
Question

writing interrupt function

  • January 10, 2018
  • 1 reply
  • 1035 views
Posted on January 10, 2018 at 07:18

Hello  i am beginner , i do not know how to write interrupt function in IAR 

for stm8s003f3  please help me

    This topic has been closed for replies.

    1 reply

    Visitor II
    January 10, 2018
    Posted on January 10, 2018 at 16:07

    Hello Hamid,

    If you are using Standard Peripheral Library for STM8, then you should open file, which has ''_it.c'' at the end of the name. For example for STM8L052x or STM8L152x this file has name stm8l15x_it.c. Inside this file there are already functions, which act as a handlers for interrupts. You just need to refer to the handler related to the interrupt, which you use, and fill in the body of the function with your user code. As an example I highlighted below handler for EXTI1 interrupt.

    0690X00000609POQAY.png

    Regards

    Szymon
    Visitor II
    January 11, 2018
    Posted on January 11, 2018 at 08:19

    Hello Szymon

    Thank you