📄 pio_it.lst
字号:
###############################################################################
# #
# 24/Apr/2009 16:18:23 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION #
# Copyright 1999-2007 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Source file = D:\basic-dataflash-project-at91sam7se-ek\at91lib\periphe #
# rals\pio\pio_it.c #
# Command line = D:\basic-dataflash-project-at91sam7se-ek\at91lib\periphe #
# rals\pio\pio_it.c -D at91sam7se512 -D sram -D #
# TRACE_LEVEL=4 -lC D:\basic-dataflash-project-at91sam7se- #
# ek\at91sam7se-ek\basic-dataflash-project\ewp\at91sam7se5 #
# 12_sram\List\ --remarks --diag_suppress Pe826,Pe1375 -o #
# D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\Obj\ #
# --no_cse --no_unroll --no_inline --no_code_motion #
# --no_tbaa --no_clustering --no_scheduling --debug #
# --endian little --cpu ARM7TDMI -e --fpu None #
# --dlib_config "D:\Program Files\arm\ARM\INC\DLib_Config_ #
# Full.h" -I D:\basic-dataflash-project-at91sam7se-ek\at91 #
# sam7se-ek\basic-dataflash-project\ewp\..\..\..\at91lib/p #
# eripherals\ -I D:\basic-dataflash-project-at91sam7se-ek\ #
# at91sam7se-ek\basic-dataflash-project\ewp\..\..\..\at91l #
# ib\ -I D:\basic-dataflash-project-at91sam7se-ek\at91sam7 #
# se-ek\basic-dataflash-project\ewp\..\..\..\at91lib/memor #
# ies\ -I D:\basic-dataflash-project-at91sam7se-ek\at91sam #
# 7se-ek\basic-dataflash-project\ewp\..\..\..\at91lib/boar #
# ds/at91sam7se-ek\ -I "D:\Program Files\arm\ARM\INC\" #
# --interwork --cpu_mode arm -Oh #
# List file = D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\List\pio_i #
# t.lst #
# Object file = D:\basic-dataflash-project-at91sam7se-ek\at91sam7se-ek\b #
# asic-dataflash-project\ewp\at91sam7se512_sram\Obj\pio_it #
# .o #
# #
# #
###############################################################################
D:\basic-dataflash-project-at91sam7se-ek\at91lib\peripherals\pio\pio_it.c
1 /* ----------------------------------------------------------------------------
2 * ATMEL Microcontroller Software Support
3 * ----------------------------------------------------------------------------
4 * Copyright (c) 2008, Atmel Corporation
5 *
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * - Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the disclaimer below.
13 *
14 * Atmel's name may not be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * ----------------------------------------------------------------------------
28 */
29
30 /// Disable traces for this file
31 #undef TRACE_LEVEL
32 #define TRACE_LEVEL 0
33
34 //------------------------------------------------------------------------------
35 // Headers
36 //------------------------------------------------------------------------------
37
38 #include "pio_it.h"
39 #include "pio.h"
40 #include <board.h>
41 #include <aic/aic.h>
42 #include <utility/assert.h>
#if (TRACE_LEVEL==0) && (DYNTRACE==0)
^
"D:\basic-dataflash-project-at91sam7se-ek\at91lib\utility\trace.h",134 Remark[Pe193]:
zero used for undefined preprocessing identifier
43 #include <utility/trace.h>
44
45 //------------------------------------------------------------------------------
46 // Local definitions
47 //------------------------------------------------------------------------------
48
49 /// \exclude
50 /// Maximum number of interrupt sources that can be defined. This
51 /// constant can be increased, but the current value is the smallest possible
52 /// that will be compatible with all existing projects.
53 #define MAX_INTERRUPT_SOURCES 7
54
55 //------------------------------------------------------------------------------
56 // Local types
57 //------------------------------------------------------------------------------
58
59 //------------------------------------------------------------------------------
60 /// \exclude
61 /// Describes a PIO interrupt source, including the PIO instance triggering the
62 /// interrupt and the associated interrupt handler.
63 //------------------------------------------------------------------------------
64 typedef struct {
65
66 /// Pointer to the source pin instance.
67 const Pin *pPin;
68
69 /// Interrupt handler.
70 void (*handler)(const Pin *);
71
72 } InterruptSource;
73
74 //------------------------------------------------------------------------------
75 // Local variables
76 //------------------------------------------------------------------------------
77
78 /// List of interrupt sources.
\ In section .bss, align 4
79 static InterruptSource pSources[MAX_INTERRUPT_SOURCES];
\ pSources:
\ 00000000 DS8 56
80
81 /// Number of currently defined interrupt sources.
\ In section .bss, align 4
82 static unsigned int numSources;
\ numSources:
\ 00000000 DS8 4
83
84 //------------------------------------------------------------------------------
85 // Local functions
86 //------------------------------------------------------------------------------
87
88 //------------------------------------------------------------------------------
89 /// Handles all interrupts on the given PIO controller.
90 /// \param id PIO controller ID.
91 /// \param pPio PIO controller base address.
92 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
93 static void PioInterruptHandler(unsigned int id, AT91S_PIO *pPio)
94 {
\ PioInterruptHandler:
\ 00000000 70402DE9 PUSH {R4-R6,LR}
\ 00000004 0040A0E1 MOV R4,R0
95 unsigned int status;
96 unsigned int i;
97
98 // Read PIO controller status
99 status = pPio->PIO_ISR;
\ 00000008 4C0091E5 LDR R0,[R1, #+76]
100 status &= pPio->PIO_IMR;
\ 0000000C 481091E5 LDR R1,[R1, #+72]
\ 00000010 005011E0 ANDS R5,R1,R0
101
102 // Check pending events
103 if (status != 0) {
\ 00000014 1D00000A BEQ ??PioInterruptHandler_0
104
105 TRACE_DEBUG("PIO interrupt on PIO controller #%d\n\r", id);
106
107 // Find triggering source
108 i = 0;
\ 00000018 0060A0E3 MOV R6,#+0
109 while (status != 0) {
110
111 // There cannot be an unconfigured source enabled.
112 SANITY_CHECK(i < numSources);
\ ??PioInterruptHandler_1:
\ 0000001C ........ LDR R0,??DataTable14 ;; numSources
\ 00000020 000090E5 LDR R0,[R0, #+0]
\ 00000024 000056E1 CMP R6,R0
\ 00000028 0000003A BCC ??PioInterruptHandler_2
\ ??PioInterruptHandler_3:
\ 0000002C FEFFFFEA B ??PioInterruptHandler_3
113
114 // Source is configured on the same controller
115 if (pSources[i].pPin->id == id) {
\ ??PioInterruptHandler_2:
\ 00000030 ........ LDR R0,??DataTable13 ;; pSources
\ 00000034 860190E7 LDR R0,[R0, +R6, LSL #+3]
\ 00000038 0800D0E5 LDRB R0,[R0, #+8]
\ 0000003C 040050E1 CMP R0,R4
\ 00000040 0F00001A BNE ??PioInterruptHandler_4
116
117 // Source has PIOs whose statuses have changed
118 if ((status & pSources[i].pPin->mask) != 0) {
\ 00000044 ........ LDR R0,??DataTable13 ;; pSources
\ 00000048 860190E7 LDR R0,[R0, +R6, LSL #+3]
\ 0000004C 000090E5 LDR R0,[R0, #+0]
\ 00000050 050010E1 TST R0,R5
\ 00000054 0A00000A BEQ ??PioInterruptHandler_4
119
120 TRACE_DEBUG("Interrupt source #%d triggered\n\r", i);
121
122 pSources[i].handler(pSources[i].pPin);
\ 00000058 ........ LDR R0,??DataTable13 ;; pSources
\ 0000005C 860190E7 LDR R0,[R0, +R6, LSL #+3]
\ 00000060 ........ LDR R1,??DataTable13 ;; pSources
\ 00000064 861181E0 ADD R1,R1,R6, LSL #+3
\ 00000068 041091E5 LDR R1,[R1, #+4]
\ 0000006C 0FE0A0E1 MOV LR,PC
\ 00000070 11FF2FE1 BX R1
123 status &= ~(pSources[i].pPin->mask);
\ 00000074 ........ LDR R0,??DataTable13 ;; pSources
\ 00000078 860190E7 LDR R0,[R0, +R6, LSL #+3]
\ 0000007C 000090E5 LDR R0,[R0, #+0]
\ 00000080 0050C5E1 BIC R5,R5,R0
124 }
125 }
126 i++;
\ ??PioInterruptHandler_4:
\ 00000084 016086E2 ADD R6,R6,#+1
127 }
\ 00000088 000055E3 CMP R5,#+0
\ 0000008C E2FFFF1A BNE ??PioInterruptHandler_1
128 }
129 }
\ ??PioInterruptHandler_0:
\ 00000090 7040BDE8 POP {R4-R6,LR}
\ 00000094 1EFF2FE1 BX LR ;; return
130
131 //------------------------------------------------------------------------------
132 /// Generic PIO interrupt handler. Single entry point for interrupts coming
133 /// from any PIO controller (PIO A, B, C ...). Dispatches the interrupt to
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -