Guest User

Untitled

a guest
Dec 15th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.08 KB | None | 0 0
  1. /*  BASIC INTERRUPT VECTOR TABLE FOR STM8 devices
  2.  *  Copyright (c) 2007 STMicroelectronics
  3.  */
  4.  
  5. #include "stm8s_tim4.h"
  6.  
  7. typedef void @far (*interrupt_handler_t)(void);
  8.  
  9. struct interrupt_vector {
  10.     unsigned char interrupt_instruction;
  11.     interrupt_handler_t interrupt_handler;
  12. };
  13.  
  14. @far @interrupt void NonHandledInterrupt (void)
  15. {
  16.     /* in order to detect unexpected events during development,
  17.        it is recommended to set a breakpoint on the following instruction
  18.     */
  19.     return;
  20. }
  21.  
  22. @far @interrupt void TIM4_UPD_OVF_IRQHandler(void){
  23.     decrement_timer();
  24.   TIM4_ClearITPendingBit(TIM4_IT_UPDATE);
  25. }
  26.  
  27.  
  28.  
  29. extern void _stext();     /* startup routine */
  30.  
  31. struct interrupt_vector const _vectab[] = {
  32.     {0x82, (interrupt_handler_t)_stext}, /* reset */
  33.     {0x82, NonHandledInterrupt}, /* trap  */
  34.     {0x82, NonHandledInterrupt}, /* irq0  */
  35.     {0x82, NonHandledInterrupt}, /* irq1  */
  36.     {0x82, NonHandledInterrupt}, /* irq2  */
  37.     {0x82, NonHandledInterrupt}, /* irq3  */
  38.     {0x82, NonHandledInterrupt}, /* irq4  */
  39.     {0x82, NonHandledInterrupt}, /* irq5  */
  40.     {0x82, NonHandledInterrupt}, /* irq6  */
  41.     {0x82, NonHandledInterrupt}, /* irq7  */
  42.     {0x82, NonHandledInterrupt}, /* irq8  */
  43.     {0x82, NonHandledInterrupt}, /* irq9  */
  44.     {0x82, NonHandledInterrupt}, /* irq10 */
  45.     {0x82, NonHandledInterrupt}, /* irq11 */
  46.     {0x82, NonHandledInterrupt}, /* irq12 */
  47.     {0x82, NonHandledInterrupt}, /* irq13 */
  48.     {0x82, NonHandledInterrupt}, /* irq14 */
  49.     {0x82, NonHandledInterrupt}, /* irq15 */
  50.     {0x82, NonHandledInterrupt}, /* irq16 */
  51.     {0x82, NonHandledInterrupt}, /* irq17 */
  52.     {0x82, NonHandledInterrupt}, /* irq18 */
  53.     {0x82, NonHandledInterrupt}, /* irq19 */
  54.     {0x82, NonHandledInterrupt}, /* irq20 */
  55.     {0x82, NonHandledInterrupt}, /* irq21 */
  56.     {0x82, NonHandledInterrupt}, /* irq22 */
  57.     {0x82, (interrupt_handler_t)TIM4_UPD_OVF_IRQHandler}, /* irq23 */
  58.     {0x82, NonHandledInterrupt}, /* irq24 */
  59.     {0x82, NonHandledInterrupt}, /* irq25 */
  60.     {0x82, NonHandledInterrupt}, /* irq26 */
  61.     {0x82, NonHandledInterrupt}, /* irq27 */
  62.     {0x82, NonHandledInterrupt}, /* irq28 */
  63.     {0x82, NonHandledInterrupt}, /* irq29 */
  64. };
Advertisement
Add Comment
Please, Sign In to add comment