cancel
Showing results for 
Search instead for 
Did you mean: 

New FWLib 91x_vic.c Problems

rgreenthal
Associate II
Posted on May 02, 2008 at 18:35

New FWLib 91x_vic.c Problems

1 REPLY 1
rgreenthal
Associate II
Posted on May 17, 2011 at 09:52

/*******************************************************************************

* Function Name : VIC_GetISRVectAdd

* Description : Get the ISR vector address of the correspondent line.

* Input : VIC_Source: specifies the number of the source line.

* This parameter can be one of the following values:

* - WDG_ITLine : VIC source 0

* - SW_ITLine : VIC source 1

* - ARMRX_ITLine : VIC source 2

* - ARMTX_ITLine : VIC source 3

* - TIM0_ITLine : VIC source 4

* - TIM1_ITLine : VIC source 5

* - TIM2_ITLine : VIC source 6

* - TIM3_ITLine : VIC source 7

* - USBHP_ITLine : VIC source 8

* - USBLP_ITLine : VIC source 9

* - SCU_ITLine : VIC source 10

* - ENET_ITLine : VIC source 11

* - DMA_ITLine : VIC source 12

* - CAN_ITLine : VIC source 13

* - MC_ITLine : VIC source 14

* - ADC_ITLine : VIC source 15

* - UART0_ITLine : VIC source 16

* - UART1_ITLine : VIC source 17

* - UART2_ITLine : VIC source 18

* - I2C0_ITLine : VIC source 19

* - I2C1_ITLine : VIC source 20

* - SSP0_ITLine : VIC source 21

* - SSP1_ITLine : VIC source 22

* - LVD_ITLine : VIC source 23

* - RTC_ITLine : VIC source 24

* - WIU_ITLine : VIC source 25

* - EXTIT0_ITLine: VIC source 26

* - EXTIT1_ITLine: VIC source 27

* - EXTIT2_ITLine: VIC source 28

* - EXTIT3_ITLine: VIC source 29

* - USBWU_ITLine : VIC source 30

* - PFQBC_ITLine : VIC source 31

* Output : None

* Return : The correspondent ISR vector address.

*******************************************************************************/

u32 VIC_GetISRVectAdd(u16 VIC_Source)

{

if (VIC_Source < VIC_REGISTER_NUMBER) /* VIC0 */

return VIC0->VAiR[VIC_Source];

else /* VIC1 */

return VIC1->VAiR[VIC_Source - VIC_REGISTER_NUMBER];

}

Should be

* Input2 : VIC_Priority: specifies the priority of the interrupt.

· It can be a value from 0 to 15. 0 is the highest priority.

u32 VIC_GetISRVectAdd(u16 VIC_Source , u16 VIC_Priority)

{

if (VIC_Source < VIC_REGISTER_NUMBER) /* VIC0 */

return VIC0->VAiR[VIC_Priority];

else /* VIC1 */

return VIC1->VAiR[VIC_Priority];

}