![install stm8 cosmic install stm8 cosmic](https://content.instructables.com/ORIG/F8D/U7F8/KIED62UC/F8DU7F8KIED62UC.jpg)
In the above example, the two added lines are shown in red. The file below "wait.h" is an example.Įxtern u8 void WaitInterruptHandler(void) Now, in the include file for the library module that I am working on I add two statements. Interrupt_handler_t void NonHandledInterrupt (void), /* reset */ Typedef void (*interrupt_handler_t)(void) I do it by using the following as my stm8_interrupt_vector.c file. This is especially true when, during the course of development, you are adding and removing multiple interrupt routines. This can get unwieldy when you have to do it for several different interrupt routines and is just one more thing to remember to get your project working correctly.
INSTALL STM8 COSMIC CODE
Usually, you would do this by modifying the line of code for the interrupt vector that is already in the file. To specify an interrupt vector to be used you must put a reference to your interrupt routine into one of the interrupt vectors in the stm8_interrupt_vector.c file. In this manner, I can build up a library that is easy to use and contains everything needed to support the RTCC in one source file. This is especially useful when you are writing code to be used as a library routine to be used over and over in the future.Īs an example, if I am writing code to support a real time clock calendar (RTCC) I also want the interrupt routines needed for the RTCC module to be in the same source file as the other RTCC code.
![install stm8 cosmic install stm8 cosmic](https://docplayer.net/docs-images/40/16369918/images/page_2.jpg)
I prefer to put my interrupt routines in the same C file that contains the other code needed for that routine. However, ST wants you to put all of your interrupt routines in one module called "stm8s_it.c". The STM8S interrupt structure is pretty straight forward. That's incredible for a board that offers an eight bit microcontroller along with I/O, ADC, multiple timers, a hardware UART, SPI, I2C and much more. I have purchased about seven of the STM8S-Discovery development boards.