Re: [Sdcc-user] STM8 interrupt example ?

2017-01-23 Thread Травкин Роман
Typical interrupt is "void HandlerName() __interrupt(n)", where n -- interrupt number according to chip datasheet. Handler name could be anything you want. For trap interrupt use "void HandlerName() _trap". void TIM4_OVF_handler() __interrupt(23){      TIM4->SR1 &= ~TIM4_SR1_UIF;   // Reset flag as

Re: [Sdcc-user] STM8 interrupt example ?

2017-01-23 Thread aarrgghh.co.uk
Thanks I've tried that but I'm still not having any luck. This is my code. #include #define CLK_DIVR(*(volatile uint8_t *)0x50C6) #define TIM1_CR1(*(volatile uint8_t *)0x5250) #define TIM1_IER(*(volatile uint8_t *)0x5254) #define TIM1_SR1(*(volatile uint8_t *)0x5255) #define TI

Re: [Sdcc-user] STM8 interrupt example ?

2017-01-23 Thread Травкин Роман
You haven't enabled interrupts. Assembler command "rim" -- enables interrrupts, "sim" --disasbles.add __asm__ ("rim") before while(1). PD_DDR = 1<<3; PD_CR1 = 1<<3;   __asm__ ("rim");    while(1){    } You may also may look at adapted stm8s.h from SPL https://yadi.sk/d/Asn1BiuX3AbQsB 24.01.2017, 00