那么你的项目中要有向量表:
/* BASIC INTERRUPT VECTOR TABLE FOR STM8 devices
* Copyright (c) 2007 STMicroelectronics
*/
#include "STM8S105_it.h"
typedef void @far (*interrupt_handler_t)(void);
struct interrupt_vector {
unsigned char interrupt_instruction;
interrupt_handler_t interrupt_handler;
};
@far @interrupt void NonHandledInterrupt (void)
{
/* in order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction
*/
return;
}
extern void _stext(); /* startup routine */
struct interrupt_vector const _vectab[] = {
{0x82, (interrupt_handler_t)_stext}, // reset
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // trap --- Software interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq0 --- PD7 external interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq1
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq2
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq3
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq4
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq5
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq6
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq7
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq8
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq9
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq10
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq11 --- Timer1 Update_Overflow interrupt: TIM1_UPD_OVF_IRQHandler
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq12 --- Timer1 Capture or Compare interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq13 --- Timer5 Update or Overflow interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq14 --- Timer5 Capture or Compare interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq15
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq16
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq17 --- UART1 TX interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq18 --- UART1 RX interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq19
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq20
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq21 --- (UART2 Receive interrupt UART2_IRQHandler)
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq22 --- ADC1 End of conversion interrupt ADC1_IRQHandler
{0x82, (interrupt_handler_t)TIM6_IRQHandler}, // irq23 --- Timer6 Interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq24 --- FLASH End of Program or Write_Program_Disable interrupt
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq25 --- 0x806C
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq26 --- 0x8070
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq27 --- 0x8074
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq28 --- 0x8078
{0x82, (interrupt_handler_t)NonHandledInterrupt}, // irq29 --- 0x807C
};
|