?? extint.lst
字號:
ARM COMPILER V2.53, extint 05/08/06 15:15:26 PAGE 1
ARM COMPILER V2.53, COMPILATION OF MODULE extint
OBJECT MODULE PLACED IN .\Obj\extint.obj
COMPILER INVOKED BY: g:\Keil\ARM\BIN\CA.exe extint.c THUMB INCDIR(..\Common\inc) DEBUG PRINT(.\LST\EXTINT.LST) TABS(4) O
-BJECT(.\Obj\extint.obj)
stmt level source
1 /*****************************************************************************
2 * extint.c: Target C file for Philips LPC214x Family Microprocessors
3 *
4 * Copyright(C) 2006, Philips Semiconductor
5 * All rights reserved.
6 *
7 * History
8 * 2005.10.01 ver 1.00 Prelimnary version, first Release
9 *
10 *****************************************************************************/
11 #include "LPC214x.H" /* LPC21xx definitions */
12 #include "type.h"
13 #include "irq.h"
14 #include "extint.h"
15
16 DWORD eint1_counter;
17
18 /*****************************************************************************
19 ** Function name: EINT1_Handler
20 **
21 ** Descriptions: external INT handler
22 **
23 ** parameters: None
24 ** Returned value: None
25 **
26 *****************************************************************************/
27 void EINT1_Handler (void) __irq
28 {
29 1 EXTINT = EINT1; /* clear interrupt */
30 1
31 1 IENABLE; /* handles nested interrupt */
32 1 eint1_counter++;
33 1 if ( eint1_counter & 0x01 ) /* alternate the LED display */
34 1 {
35 2 IOSET1 = 0x000F0000; /* turn off P1.20~23 */
36 2 IOCLR1 = 0x00F00000; /* turn on P1.16~19 */
37 2 }
38 1 else
39 1 {
40 2 IOSET1 = 0x00F00000; /* turn on P1.20~23 */
41 2 IOCLR1 = 0x000F0000; /* turn off P1.16~19 */
42 2 }
43 1 IDISABLE;
44 1 VICVectAddr = 0; /* Acknowledge Interrupt */
45 1 }
46
47 /*****************************************************************************
48 ** Function name: EINTInit
49 **
50 ** Descriptions: Initialize external interrupt pin and
51 ** install interrupt handler
52 **
53 ** parameters: None
54 ** Returned value: true or false, return false if the interrupt
55 ** handler can't be installed to the VIC table.
56 **
57 *****************************************************************************/
58 DWORD EINTInit( void )
ARM COMPILER V2.53, extint 05/08/06 15:15:26 PAGE 2
59 {
60 1 PINSEL0 = 0x20000000; /* set P0.14 as EINT1 */
61 1 PINSEL1 = 0x00000000; /* P1.16~23 GPIO output */
62 1 SCS = 0; /* set GPIOx to use regular I/O */
63 1 IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */
64 1 IOCLR1 = 0x00FF0000; /* turn off LEDs */
65 1
66 1 EXTMODE = EINT1_EDGE; /* INT1 edge trigger */
67 1 EXTPOLAR = 0; /* INT1 is falling edge by default */
68 1
69 1 if ( install_irq( EINT1_INT, (void *)EINT1_Handler ) == FALSE )
70 1 {
71 2 return (FALSE);
72 2 }
73 1
74 1 return( TRUE );
75 1 }
76
77 /******************************************************************************
78 ** End Of File
79 ******************************************************************************/
80
ARM COMPILER V2.53, extint 05/08/06 15:15:26 PAGE 3
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN CODE16 (install_irq?T)
*** PUBLICS:
PUBLIC EINT1_Handler?A
PUBLIC EINTInit?T
PUBLIC eint1_counter
*** DATA SEGMENT '?DT0?extint':
00000000 eint1_counter:
00000000 DS 4
*** CODE SEGMENT '?PR?EINT1_Handler?A?extint':
27: void EINT1_Handler (void) __irq
00000000 E92D4003 STMDB R13!,{R0-R1,LR}
29: EXTINT = EINT1; /* clear interrupt */
00000004 E3A01002 MOV R1,#0x2
00000008 E5100000 LDR R0,=0xE01FC140
0000000C E5801000 STR R1,[R0,#0x0]
31: IENABLE; /* handles nested interrupt */
00000010 E14FE000 MRS R14,SPSR
00000014 E92D4000 STMFD R13!,{LR}
00000018 E321F01F MSR CPSR_c,#0x1F
0000001C E92D4000 STMFD R13!,{LR}
32: eint1_counter++;
00000020 E5100000 LDR R0,=eint1_counter ; eint1_counter
00000024 E5901000 LDR R1,[R0,#0x0] ; eint1_counter
00000028 E2811001 ADD R1,R1,#0x0001
0000002C E5801000 STR R1,[R0,#0x0] ; eint1_counter
33: if ( eint1_counter & 0x01 ) /* alternate the LED display */
00000030 E5100000 LDR R0,=eint1_counter ; eint1_counter
00000034 E5900000 LDR R0,[R0,#0x0] ; eint1_counter
00000038 E3100001 TST R0,#0x0001
0000003C 0A000006 BEQ L_1 ; Targ=0x5C
35: IOSET1 = 0x000F0000; /* turn off P1.20~23 */
00000040 E3A0180F MOV R1,#0xF0000
00000044 E5100000 LDR R0,=0xE0028014
00000048 E5801000 STR R1,[R0,#0x0]
36: IOCLR1 = 0x00F00000; /* turn on P1.16~19 */
0000004C E3A0160F MOV R1,#0xF00000
00000050 E5100000 LDR R0,=0xE002801C
00000054 E5801000 STR R1,[R0,#0x0]
37: }
00000058 EA000005 B L_2 ; Targ=0x74
0000005C L_1:
40: IOSET1 = 0x00F00000; /* turn on P1.20~23 */
0000005C E3A0160F MOV R1,#0xF00000
00000060 E5100000 LDR R0,=0xE0028014
00000064 E5801000 STR R1,[R0,#0x0]
41: IOCLR1 = 0x000F0000; /* turn off P1.16~19 */
00000068 E3A0180F MOV R1,#0xF0000
0000006C E5100000 LDR R0,=0xE002801C
00000070 E5801000 STR R1,[R0,#0x0]
42: }
00000074 L_2:
43: IDISABLE;
00000074 E8BD4000 LDMFD R13!,{LR}
00000078 E321F092 MSR CPSR_c,#0x92
0000007C E8BD4000 LDMFD R13!,{LR}
00000080 E16FF00E MSR SPSR_cxsf,R14
44: VICVectAddr = 0; /* Acknowledge Interrupt */
00000084 E3A01000 MOV R1,#0x0
00000088 E5100000 LDR R0,=0xFFFFF030
ARM COMPILER V2.53, extint 05/08/06 15:15:26 PAGE 4
0000008C E5801000 STR R1,[R0,#0x0]
45: }
00000090 E8BD4003 LDMIA R13!,{R0-R1,LR}
00000094 E25EF004 SUBS R15,R14,#0x0004
00000098 ENDP ; 'EINT1_Handler?A'
*** CODE SEGMENT '?PR?EINTInit?T?extint':
58: DWORD EINTInit( void )
00000000 B500 PUSH {LR}
60: PINSEL0 = 0x20000000; /* set P0.14 as EINT1 */
00000002 4800 LDR R1,=0x20000000
00000004 4800 LDR R0,=0xE002C000
00000006 6001 STR R1,[R0,#0x0]
61: PINSEL1 = 0x00000000; /* P1.16~23 GPIO output */
00000008 2100 MOV R1,#0x0
0000000A 4800 LDR R0,=0xE002C004
0000000C 6001 STR R1,[R0,#0x0]
62: SCS = 0; /* set GPIOx to use regular I/O */
0000000E 4800 LDR R0,=0xE01FC1A0
00000010 6001 STR R1,[R0,#0x0]
63: IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */
00000012 4800 LDR R2,=0xFF0000
00000014 4800 LDR R0,=0xE0028018
00000016 6002 STR R2,[R0,#0x0]
64: IOCLR1 = 0x00FF0000; /* turn off LEDs */
00000018 4800 LDR R0,=0xE002801C
0000001A 6002 STR R2,[R0,#0x0]
66: EXTMODE = EINT1_EDGE; /* INT1 edge trigger */
0000001C 2202 MOV R2,#0x2
0000001E 4800 LDR R0,=0xE01FC148
00000020 6002 STR R2,[R0,#0x0]
67: EXTPOLAR = 0; /* INT1 is falling edge by default */
00000022 4800 LDR R0,=0xE01FC14C
00000024 6001 STR R1,[R0,#0x0]
69: if ( install_irq( EINT1_INT, (void *)EINT1_Handler ) == FALSE )
00000026 4900 LDR R1,=EINT1_Handler?A ; EINT1_Handler?A
00000028 200F MOV R0,#0xF
0000002A F7FF BL install_irq?T ; T=0x0001 (1)
0000002C FFE9 BL install_irq?T ; T=0x0001 (2)
0000002E 2800 CMP R0,#0x0 ; install_irq?T
00000030 D101 BNE L_3 ; T=0x00000036
71: return (FALSE);
00000032 2000 MOV R0,#0x0
00000034 E000 B L_4 ; T=0x00000038
72: }
00000036 L_3:
74: return( TRUE );
00000036 2001 MOV R0,#0x1
75: }
00000038 L_4:
00000038 BC08 POP {R3}
0000003A 4718 BX R3
0000003C ENDP ; 'EINTInit?T'
Module Information Static
----------------------------------
code size = ------
data size = 4
const size = ------
End of Module Information.
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -