请教各位,我使用STM8S105来学习,使用IAR FOR STM8,但今天在使用时发现IAR自带的头文件中的中断向量定义与STM8S105的手册不一至,IAR中STM8S105K4.H头文件的定义如下:/*--------------------------------------------------------------------
* Interrupt vector numbers
*-----------------------------------------------------------------------*/
#define SPI_TXE_vector 0x0C
#define SPI_RXNE_vector 0x0C
#define SPI_WKUP_vector 0x0C
#define SPI_MODF_vector 0x0C
#define SPI_CRCERR_vector 0x0C
#define SPI_OVR_vector 0x0C
#define TIM1_OVR_TIF_vector 0x0D
#define TIM1_OVR_BIF_vector 0x0D
#define TIM1_OVR_UIF_vector 0x0D
#define TIM1_CAPCOM_CC1IF_vector 0x0E
#define TIM1_CAPCOM_CC2IF_vector 0x0E
#define TIM1_CAPCOM_COMIF_vector 0x0E
#define TIM1_CAPCOM_CC4IF_vector 0x0E
#define TIM1_CAPCOM_CC3IF_vector 0x0E
#define TIM2_OVR_UIF_vector 0x0F
#define TIM3_OVR_UIF_vector 0x11
#define TIM2_CAPCOM_CC3IF_vector 0x10
#define TIM3_CAPCOM_CC3IF_vector 0x12
#define TIM2_CAPCOM_CC1IF_vector 0x10
#define TIM2_CAPCOM_TIF_vector 0x10
#define TIM3_CAPCOM_TIF_vector 0x12
#define TIM3_CAPCOM_CC1IF_vector 0x12
#define TIM3_CAPCOM_CC2IF_vector 0x12
#define TIM2_CAPCOM_CC2IF_vector 0x10
#define I2C_SB_vector 0x15
#define I2C_ADDR_vector 0x15
#define I2C_ADD10_vector 0x15
#define I2C_STOPF_vector 0x15
#define I2C_BTF_vector 0x15
#define I2C_OVR_vector 0x15
#define I2C_RXNE_vector 0x15
#define I2C_TXE_vector 0x15
#define I2C_BERR_vector 0x15
#define I2C_ARLO_vector 0x15
#define I2C_AF_vector 0x15
#define I2C_WUFH_vector 0x15
#define UART2_T_TXE_vector 0x16
#define UART2_T_TC_vector 0x16
#define UART2_R_OR_vector 0x17
#define UART2_R_RXNE_vector 0x17
#define UART2_R_IDLE_vector 0x17
#define UART2_R_PE_vector 0x17
#define UART2_R_LBDF_vector 0x17
#define ADC1_AWS2_vector 0x18
#define ADC1_AWS1_vector 0x18
#define ADC1_AWS0_vector 0x18
#define ADC1_AWS3_vector 0x18
#define ADC1_EOC_vector 0x18
#define ADC1_AWS5_vector 0x18
#define ADC1_AWS6_vector 0x18
#define ADC1_AWS7_vector 0x18
#define ADC1_AWS8_vector 0x18
#define ADC1_AWS9_vector 0x18
#define ADC1_AWDG_vector 0x18
#define ADC1_AWS4_vector 0x18
#define TIM4_OVR_UIF_vector 0x19
#define FLASH_EOP_vector 0x1A
#define FLASH_WR_PG_DIS_vector 0x1A
而我在查找STM8S105的数据手册时看到的中断向量的定义如下:
IRQ NO Source block Description
0 TLI External top level interrupt
1 AWU Auto wake up from halt
2 CLK Clock controller
3 EXTI0 Port A external interrupts
4 EXTI1 Port B external interrupts
5 EXTI2 Port C external interrupts
6 EXTI3 Port D external interrupts
7 EXTI4 Port E external interrupts
8 Reserved
9 Reserved
10 SPI End of transfer
11 TIM1 TIM1update/overflow/underflow/trigger/break
12 TIM1 TIM1 capture/ compare
13 TIM TIM update/ overflow
14 TIM TIM capture/ compare
15 TIM3 Update/ overflow
16 TIM3 Capture/ compare
17 Reserved
18 Reserved
19 I2C I2C interrupt
20 UART2 Tx complete
21 UART2 Receive register DATA FULL
22 ADC1 ADC1 end of conversion/analog watchdog interrupt
23 TIM TIM update/ overflow
24 Flash EOP/ WR_PG_DIS
请问如此以来,如果我要在IAR用中断程序,那不是出错了吗? |