cancel
Showing results for 
Search instead for 
Did you mean: 

writing interrupt function

hamid shahshahani
Associate II
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

2 REPLIES 2
Szymon PANECKI
Senior III
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
Posted on January 11, 2018 at 08:19

Hello Szymon

Thank you