summaryrefslogtreecommitdiff
path: root/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/vectors.c
blob: 9d44fc47ec2dc15aa305371041720c4785140386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
/* ELIGIBILITY FOR ANY PURPOSES.                                             */
/*                 (C) Fujitsu Microelectronics Europe GmbH                  */

/*---------------------------------------------------------------------------
  VECTORS.C
  - Interrupt level (priority) setting
  - Interrupt vector definition
-----------------------------------------------------------------------------*/
#include "mb96348hs.h"
#include "FreeRTOSConfig.h"

/*---------------------------------------------------------------------------
   InitIrqLevels()
   This function  pre-sets all interrupt control registers. It can be used
   to set all interrupt priorities in static applications. If this file
   contains assignments to dedicated resources, verify  that the
   appropriate controller is used.
   NOTE: value 7 disables the interrupt and value 0 sets highest priority.
-----------------------------------------------------------------------------*/
#define MIN_ICR				12
#define MAX_ICR				96

#define DEFAULT_ILM_MASK	7

void InitIrqLevels( void )
{
volatile int irq;

	for( irq = MIN_ICR; irq <= MAX_ICR; irq++ )
	{
		ICR = ( irq << 8 ) | DEFAULT_ILM_MASK;
	}

	ICR = ( (51 & 0xFF) << 8 ) | configKERNEL_INTERRUPT_PRIORITY;			/* Reload Timer 0 of MB9634x Series */
	ICR = ( (12 & 0xFF) << 8 ) | configKERNEL_INTERRUPT_PRIORITY;			/* Delayed interrupt of 16FX Family */

	ICR = ( 79 << 8 ) | configKERNEL_INTERRUPT_PRIORITY;				/* UART 0 Rx of MB9634x Series */
	ICR = ( 80 << 8 ) | configKERNEL_INTERRUPT_PRIORITY;				/* UART 0 Tx of MB9634x Series */
}

/*---------------------------------------------------------------------------
   Prototypes
   Add your own prototypes here. Each vector definition needs is proto-
   type. Either do it here or include a header file containing them.
-----------------------------------------------------------------------------*/
__interrupt void		DefaultIRQHandler( void );

extern __interrupt void prvRLT0_TICKISR( void );

extern __interrupt void UART0_RxISR( void );
extern __interrupt void UART0_TxISR( void );
extern __interrupt void UART0_TraceRxISR( void );
extern __interrupt void vPortYield( void );
extern __interrupt void vPortYieldDelayed( void );

#if ( INCLUDE_TraceListTasks == 1 )
	extern __interrupt void UART1_RxISR( void );
#endif

/*---------------------------------------------------------------------------
   Vector definiton for MB9634x
   Use following statements to define vectors. All resource related
   vectors are predefined. Remaining software interrupts can be added here
   as well.
   NOTE: If software interrupts 0 to 7 are defined here, this might 
   conflict with the reset vector in the start-up file.
-----------------------------------------------------------------------------*/
#pragma intvect DefaultIRQHandler 11		/* Non-maskable Interrupt       */

#pragma intvect vPortYieldDelayed 12		/* Delayed Interrupt            */

#pragma intvect DefaultIRQHandler 13		/* RC Timer                     */
#pragma intvect DefaultIRQHandler 14		/* Main Clock Timer             */
#pragma intvect DefaultIRQHandler 15		/* Sub Clock Timer              */
#pragma intvect DefaultIRQHandler 16		/* Reserved                     */
#pragma intvect DefaultIRQHandler 17		/* EXT0                         */
#pragma intvect DefaultIRQHandler 18		/* EXT1                         */
#pragma intvect DefaultIRQHandler 19		/* EXT2                         */
#pragma intvect DefaultIRQHandler 20		/* EXT3                         */
#pragma intvect DefaultIRQHandler 21		/* EXT4                         */
#pragma intvect DefaultIRQHandler 22		/* EXT5                         */
#pragma intvect DefaultIRQHandler 23		/* EXT6                         */
#pragma intvect DefaultIRQHandler 24		/* EXT7                         */
#pragma intvect DefaultIRQHandler 25		/* EXT8                         */
#pragma intvect DefaultIRQHandler 26		/* EXT9                         */
#pragma intvect DefaultIRQHandler 27		/* EXT10                        */
#pragma intvect DefaultIRQHandler 28		/* EXT11                        */
#pragma intvect DefaultIRQHandler 29		/* EXT12                        */
#pragma intvect DefaultIRQHandler 30		/* EXT13                        */
#pragma intvect DefaultIRQHandler 31		/* EXT14                        */
#pragma intvect DefaultIRQHandler 32		/* EXT15                        */
#pragma intvect DefaultIRQHandler 33		/* CAN0                         */
#pragma intvect DefaultIRQHandler 34		/* CAN1                         */
#pragma intvect DefaultIRQHandler 35		/* PPG0                         */
#pragma intvect DefaultIRQHandler 36		/* PPG1                         */
#pragma intvect DefaultIRQHandler 37		/* PPG2                         */
#pragma intvect DefaultIRQHandler 38		/* PPG3                         */
#pragma intvect DefaultIRQHandler 39		/* PPG4                         */
#pragma intvect DefaultIRQHandler 40		/* PPG5                         */
#pragma intvect DefaultIRQHandler 41		/* PPG6                         */
#pragma intvect DefaultIRQHandler 42		/* PPG7                         */
#pragma intvect DefaultIRQHandler 43		/* PPG8                         */
#pragma intvect DefaultIRQHandler 44		/* PPG9                         */
#pragma intvect DefaultIRQHandler 45		/* PPG10                        */
#pragma intvect DefaultIRQHandler 46		/* PPG11                        */
#pragma intvect DefaultIRQHandler 47		/* PPG12                        */
#pragma intvect DefaultIRQHandler 48		/* PPG13                        */
#pragma intvect DefaultIRQHandler 49		/* PPG14                        */
#pragma intvect DefaultIRQHandler 50		/* PPG15                        */

#pragma intvect prvRLT0_TICKISR 51			/* RLT0                         */

#pragma intvect DefaultIRQHandler 52		/* RLT1                         */
#pragma intvect DefaultIRQHandler 53		/* RLT2                         */
#pragma intvect DefaultIRQHandler 54		/* RLT3                         */
#pragma intvect DefaultIRQHandler 55		/* PPGRLT - RLT6                */
#pragma intvect DefaultIRQHandler 56		/* ICU0                         */
#pragma intvect DefaultIRQHandler 57		/* ICU1                         */
#pragma intvect DefaultIRQHandler 58		/* ICU2                         */
#pragma intvect DefaultIRQHandler 59		/* ICU3                         */
#pragma intvect DefaultIRQHandler 60		/* ICU4                         */
#pragma intvect DefaultIRQHandler 61		/* ICU5                         */
#pragma intvect DefaultIRQHandler 62		/* ICU6                         */
#pragma intvect DefaultIRQHandler 63		/* ICU7                         */
#pragma intvect DefaultIRQHandler 64		/* OCU0                         */
#pragma intvect DefaultIRQHandler 65		/* OCU1                         */
#pragma intvect DefaultIRQHandler 66		/* OCU2                         */
#pragma intvect DefaultIRQHandler 67		/* OCU3                         */
#pragma intvect DefaultIRQHandler 68		/* OCU4                         */
#pragma intvect DefaultIRQHandler 69		/* OCU5                         */
#pragma intvect DefaultIRQHandler 70		/* OCU6                         */
#pragma intvect DefaultIRQHandler 71		/* OCU7                         */
#pragma intvect DefaultIRQHandler 72		/* FRT0                         */
#pragma intvect DefaultIRQHandler 73		/* FRT1                         */
#pragma intvect DefaultIRQHandler 74		/* I2C0                         */
#pragma intvect DefaultIRQHandler 75		/* I2C1                         */
#pragma intvect DefaultIRQHandler 76		/* ADC                          */
#pragma intvect DefaultIRQHandler 77		/* ALARM0                       */
#pragma intvect DefaultIRQHandler 78		/* ALARM1                       */

#if ( INCLUDE_TraceListTasks == 1 )  
	#pragma intvect UART0_TraceRxISR       79   /* LIN-UART 0 RX                */	
	#pragma intvect DefaultIRQHandler       80   /* LIN-UART 0 TX                */
#else
	#pragma intvect UART0_RxISR 79   /* LIN-UART 0 RX                */
	#pragma intvect UART0_TxISR 80   /* LIN-UART 0 TX                */
#endif

#pragma intvect DefaultIRQHandler 81	/* LIN-UART 1 RX                */
#pragma intvect DefaultIRQHandler 82		/* LIN-UART 1 TX                */
#pragma intvect DefaultIRQHandler 83		/* LIN-UART 2 RX                */
#pragma intvect DefaultIRQHandler 84		/* LIN-UART 2 TX                */
#pragma intvect DefaultIRQHandler 85		/* LIN-UART 3 RX                */
#pragma intvect DefaultIRQHandler 86		/* LIN-UART 3 TX                */
#pragma intvect DefaultIRQHandler 87		/* MAIN FLASH IRQ               */
#pragma intvect DefaultIRQHandler 88		/* SATELLITE FLASH IRQ (not on all devices) */
#pragma intvect DefaultIRQHandler 89		/* LIN-UART 7 RX (not on all devices) */
#pragma intvect DefaultIRQHandler 90		/* LIN-UART 7 TX (not on all devices) */
#pragma intvect DefaultIRQHandler 91		/* LIN-UART 8 RX (not on all devices) */
#pragma intvect DefaultIRQHandler 92		/* LIN-UART 8 TX (not on all devices) */
#pragma intvect DefaultIRQHandler 93		/* LIN-UART 9 RX (not on all devices) */
#pragma intvect DefaultIRQHandler 94		/* LIN-UART 9 TX (not on all devices) */
#pragma intvect DefaultIRQHandler 95		/* RTC (not on all devices)     */
#pragma intvect DefaultIRQHandler 96		/* CAL (not on all devices)     */

#pragma intvect vPortYield 122				/* INT #122       */

/*---------------------------------------------------------------------------
   DefaultIRQHandler()
   This function is a placeholder for all vector definitions. Either use
   your own placeholder or add necessary code here. 
-----------------------------------------------------------------------------*/
__interrupt void DefaultIRQHandler( void )
{
	__DI();				/* disable interrupts */
	while( 1 )
	{
		__wait_nop();	/* halt system */
	}
}