📄 interruptconfig.lst
字号:
264: Usually there is no need to modify this routine.
265: In released version of Metrowerks this is done in start12.c.
266: ******************************************************************************/
267: void
268: CopyXGateCode(void)
269: {
Function: CopyXGateCode
Source : D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration\InterruptConfig.c
Options : -CPUHCS12XE -D__FAR_DATA -D__NO_FLOAT__ -Env"GENPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"LIBPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"OBJPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Env"TEXTPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Lasm=%n.lst -Mb -ObjN="D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Example_9_Data\Flash_P&E_target\ObjectCode\InterruptConfig.c.o" -WmsgSd1106
270: __asm {
271: LDX #__SEG_START_XGATE_CODE
0000 ce0000 [2] LDX #__SEG_START_XGATE_CODE
272: LDAB #PAGE(__SEG_START_XGATE_CODE)
0003 c600 [1] LDAB #PAGE(__SEG_START_XGATE_CODE)
273: LDY #GLOBAL(__SEG_RELOCATE_TO_XGATE_CODE)
0005 cd0000 [2] LDY #GLOBAL(__SEG_RELOCATE_TO_XGATE_CODE)
274: LDAA #GLOBAL_PAGE(__SEG_RELOCATE_TO_XGATE_CODE)
0008 8600 [1] LDAA #GLOBAL_PAGE(__SEG_RELOCATE_TO_XGATE_CODE)
275: JSR _FAR_COPY_LOGICAL_GLOBAL_RC;
000a 160000 [4] JSR _FAR_COPY_LOGICAL_GLOBAL_RC
276: DC.W LOGICAL(__SEG_SIZE_XGATE_CODE)
000d 0000 DC.W __SEG_SIZE_XGATE_CODE
277: }
278: }
000f 0a [7] RTC
279:
280: /******************************************************************************
281: Function Name : ConfigureInterrupts
282: Engineer : r32151
283: Date : 09/09/2005
284: Parameters : usingXgate - used to gate whether to initialise the XGate
285: module or not. Should only = XGATE_ON if an entry in the
286: Interrupt Configuration Table has the RQST bit set.
287: Call as #define XGATE_ON / XGATE_OFF
288:
289: download - controls whether to copy code to RAM or not
290: Call as XGATE_CODE_LOADED_BY_CONFIG / XGATE_CODE_LOADED_BY_STARTUP
291:
292: Returns : None
293: Notes : This routine performs the recommended initialisation routine
294: from the XGate Block User Guide. In doing so it also configures
295: the interrupt priority levels for S12 interrupts.
296: The usingXgate parameter should only = XGATE_ON if an entry in
297: the Interrupt Configuration Table has the RQST bit set.
298: Usually there is no need to modify this routine.
299: Updated version to set the Stack pointers for XGATE V3.
300: Updated to initialise the XGATE stack pointers to utilise the
301: memory allocated to XgateHiStack[] and XgateLoStack[] arrays.
302: ******************************************************************************/
303: void
304: ConfigureInterrupts(char usingXgate, char download)
305: {
Function: ConfigureInterrupts
Source : D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration\InterruptConfig.c
Options : -CPUHCS12XE -D__FAR_DATA -D__NO_FLOAT__ -Env"GENPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"LIBPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"OBJPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Env"TEXTPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Lasm=%n.lst -Mb -ObjN="D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Example_9_Data\Flash_P&E_target\ObjectCode\InterruptConfig.c.o" -WmsgSd1106
0000 6bad [2] STAB 3,-SP
306: volatile tU16 *chIdPtr = &XGATE.xgif_70;
0002 cc0000 [2] LDD #XGATE:8
0005 6c81 [2] STD 1,SP
307: /* ensure XGE, XGDBG & XGSWEIF(write one to clear) = 0 */
308: if (usingXgate == XGATE_ON)
0007 e686 [3] LDAB 6,SP
0009 042163 [3] DBNE B,*+102 ;abs = 006f
309: {
310: XGATE.xgmctl = XGSWEF | XGSWEFM;
000c cc0202 [2] LDD #514
000f 7c0000 [3] STD XGATE
311: /* ensure XGate is idle */
312: while (XGATE.xgchid !=0) { /* wait */ }
0012 f60000 [3] LDAB XGATE:2
0015 26fb [3/1] BNE *-3 ;abs = 0012
313: /* index to vector base register */
314: XGATE.xgispsel.bit.xgispsel = VBR_SEL;
0017 1d000003 [4] BCLR XGATE:5,#3
315: /* configure XGate Vector base register to point at the vector table */
316: XGATE.xgvbr = (tU16)((void *__far)XgateVectorTable) - XVEC_TABLE_OFFSET; /* initialise Xgate vector base */
001b ce0000 [2] LDX #GLOBAL(XgateVectorTable)
001e 1ae188 [2] LEAX -120,X
0021 0756 [4] BSR *+88 ;abs = 0079
317: /* index to low priority stack base register */
318: XGATE.xgispsel.bit.xgispsel = STACK_LO_SEL;
0023 ca01 [1] ORAB #1
0025 7b0000 [3] STAB XGATE:5
319: /* set the low priority stack start address */
320: XGATE.xgvbr = (tU16)(char *__far)XgateLoStack + sizeof(XgateLoStack);
0028 ce0000 [2] LDX #GLOBAL(XgateLoStack)
002b c600 [1] LDAB #GLOBAL_PAGE(XgateLoStack)
002d 1ae080 [2] LEAX 128,X
0030 0747 [4] BSR *+73 ;abs = 0079
321: /* index to high priority stack base register */
322: XGATE.xgispsel.bit.xgispsel = STACK_HI_SEL;
0032 ca02 [1] ORAB #2
0034 7b0000 [3] STAB XGATE:5
323: /* set the high priority stack start address */
324: XGATE.xgvbr = (tU16)(char *__far)XgateHiStack + sizeof(XgateHiStack);
0037 ce0000 [2] LDX #GLOBAL(XgateHiStack)
003a c600 [1] LDAB #GLOBAL_PAGE(XgateHiStack)
003c 87 [1] CLRA
003d 1ae080 [2] LEAX 128,X
0040 7e0000 [3] STX XGATE:6
0043 ee81 [3] LDX 1,SP
325: /* clear XGate channel interrupt flags - chIdPtr is initialised to xgif_70 */
326: do {
327: *chIdPtr = 0xFFFF; /* flags = 1 to clear */
0045 ccffff [2] LDD #65535
0048 6c00 [2] STD 0,X
328: } while(chIdPtr++ != &XGATE.xgif_00);
004a 1902 [2] LEAY 2,X
004c 8e0000 [2] CPX #XGATE:22
004f b765 [1] TFR Y,X
0051 26f2 [3/1] BNE *-12 ;abs = 0045
329: /* clear any software trigger flags */
330: XGATE.xgswt.word = 0xFF00;
0053 c7 [1] CLRB
0054 7c0000 [3] STD XGATE:24
331: if (download == XGATE_CODE_LOADED_BY_CONFIG)
0057 e680 [3] LDAB 0,SP
0059 042104 [3] DBNE B,*+7 ;abs = 0060
332: { /* copy XGate code */
333: CopyXGateCode();
005c 4a000000 [7] CALL CopyXGateCode,PAGE(CopyXGateCode)
334: }
335: /* initialise interrupt priorities and routing */
336: ConfigureInterruptPriorities(InterruptConfigurationTable);
0060 cc0000 [2] LDD #InterruptConfigurationTable
0063 4a000000 [7] CALL ConfigureInterruptPriorities,PAGE(ConfigureInterruptPriorities)
337: /* Xgate configuration */
338: XGATE.xgmctl = XGE | XGIE | XGSWEF | _XGFRZ | _XGFACT |0xFF00;
0067 ccffc3 [2] LDD #65475
006a 7c0000 [3] STD XGATE
339: }
006d 2007 [3] BRA *+9 ;abs = 0076
340: else
341: {
342: /* initialise interrupt priorities and routing */
343: ConfigureInterruptPriorities(InterruptConfigurationTable);
006f cc0000 [2] LDD #InterruptConfigurationTable
0072 4a000000 [7] CALL ConfigureInterruptPriorities,PAGE(ConfigureInterruptPriorities)
344: }
345: }
0076 1b83 [2] LEAS 3,SP
0078 0a [7] RTC
0079 7e0000 [3] STX XGATE:6
007c f60000 [3] LDAB XGATE:5
007f c4fc [1] ANDB #252
0081 3d [5] RTS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -