📄 pio_it.lst
字号:
###############################################################################
# #
# 29/Jul/2008 15:06:15 #
# 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:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91lib\peripherals\pio\pio_it. #
# c #
# Command line = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91lib\peripherals\pio\pio_it. #
# c -D at91sam7se512 -lC D:\rock\atarm\at91sam7se\software #
# \usb-device-core-project-1.3-iar5-at91sam7se-ek\at91sam7 #
# se-ek\usb-device-core-project\ewp\at91sam7se512_sdram\Li #
# st\ --remarks -o D:\rock\atarm\at91sam7se\software\usb-d #
# evice-core-project-1.3-iar5-at91sam7se-ek\at91sam7se-ek\ #
# usb-device-core-project\ewp\at91sam7se512_sdram\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\IAR Systems\Embedded #
# Workbench 5.0 Evaluation\ARM\INC\DLib_Config_Full.h" -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\boards\at91sam7se-ek\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\peripherals\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\components\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\usb\ -I "D:\Program #
# Files\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\" --interwork --cpu_mode arm -On #
# List file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\List\pio_it.lst #
# Object file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\Obj\pio_it.o #
# #
# #
###############################################################################
D:\rock\atarm\at91sam7se\software\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91lib\peripherals\pio\pio_it.c
1 /* ----------------------------------------------------------------------------
2 * ATMEL Microcontroller Software Support - ROUSSET -
3 * ----------------------------------------------------------------------------
4 * Copyright (c) 2006, 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 disclaiimer below.
13 *
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the disclaimer below in the documentation and/or
16 * other materials provided with the distribution.
17 *
18 * Atmel's name may not be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
24 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * ----------------------------------------------------------------------------
32 */
33
34 /// Disable traces for this file
35 #ifndef NOTRACE
36 #define NOTRACE
37 #endif
38
39 //------------------------------------------------------------------------------
40 // Headers
41 //------------------------------------------------------------------------------
42
43 #include "pio_it.h"
44 #include "pio.h"
45 #include <aic/aic.h>
46 #include <board.h>
47 #include <utility/assert.h>
48 #include <utility/trace.h>
49
50 //------------------------------------------------------------------------------
51 // Local definitions
52 //------------------------------------------------------------------------------
53
54 /// Returns the current value of a register.
55 #define READ(peripheral, register) (peripheral->register)
56 /// Modifies the current value of a register.
57 #define WRITE(peripheral, register, value) (peripheral->register = value)
58
59 /// Maximum number of interrupt sources that can be defined.
60 #define MAX_INTERRUPT_SOURCES 7
61
62 //------------------------------------------------------------------------------
63 // Local types
64 //------------------------------------------------------------------------------
65
66 /// Describes a PIO interrupt source, including the PIO instance triggering the
67 /// interrupt and the associated interrupt handler.
68 typedef struct _InterruptSource {
69
70 /// Interrupt source pin.
71 const Pin *pPin;
72
73 /// Interrupt handler.
74 void (*handler)(const Pin *);
75
76 } InterruptSource;
77
78 //------------------------------------------------------------------------------
79 // Local variables
80 //------------------------------------------------------------------------------
81
82 /// List of interrupt sources.
\ In section .bss, align 4
83 static InterruptSource pSources[MAX_INTERRUPT_SOURCES];
\ pSources:
\ 00000000 DS8 56
84
85 /// Number of currently defined interrupt sources.
\ In section .bss, align 4
86 static unsigned int numSources;
\ numSources:
\ 00000000 DS8 4
87
88 //------------------------------------------------------------------------------
89 // Local functions
90 //------------------------------------------------------------------------------
91
92 //------------------------------------------------------------------------------
93 /// Handles all interrupts on the given PIO controller.
94 /// \param id PIO controller ID.
95 /// \param pBase PIO controller base address.
96 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
97 void PioInterruptHandler(unsigned int id, AT91S_PIO *pBase)
98 {
\ PioInterruptHandler:
\ 00000000 F1402DE9 PUSH {R0,R4-R7,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
99 unsigned int status;
100 unsigned int i;
101
102 // Check PIO controller status
103 status = pBase->PIO_ISR & pBase->PIO_IMR;
^
Warning[Pa082]: undefined behavior: the order of volatile accesses is
undefined in this statement
\ 0000000C 4C0095E5 LDR R0,[R5, #+76]
\ 00000010 481095E5 LDR R1,[R5, #+72]
\ 00000014 000011E0 ANDS R0,R1,R0
\ 00000018 0060B0E1 MOVS R6,R0
104 if (status != 0) {
\ 0000001C 000056E3 CMP R6,#+0
\ 00000020 2300000A BEQ ??PioInterruptHandler_0
105
106 trace_LOG(trace_DEBUG, "-D- PIO interrupt on PIO controller #%d\n\r", id);
107
108 // Check all sources
109 i = 0;
\ 00000024 0000A0E3 MOV R0,#+0
\ 00000028 0070B0E1 MOVS R7,R0
110 while (status != 0) {
\ ??PioInterruptHandler_1:
\ 0000002C 000056E3 CMP R6,#+0
\ 00000030 1F00000A BEQ ??PioInterruptHandler_0
111
112 // There cannot be an unconfigured source enabled.
113 SANITY_CHECK(i < numSources);
114
115 // Source if configured on PIOA
116 if (pSources[i].pPin->id == id) {
\ 00000034 0800A0E3 MOV R0,#+8
\ 00000038 ........ LDR R1,??DataTable10 ;; pSources
\ 0000003C 901721E0 MLA R1,R0,R7,R1
\ 00000040 000091E5 LDR R0,[R1, #+0]
\ 00000044 0800D0E5 LDRB R0,[R0, #+8]
\ 00000048 040050E1 CMP R0,R4
\ 0000004C 1600001A BNE ??PioInterruptHandler_2
117
118 // Source has PIOs which have changed
119 if ((status & pSources[i].pPin->mask) != 0) {
\ 00000050 0800A0E3 MOV R0,#+8
\ 00000054 ........ LDR R1,??DataTable10 ;; pSources
\ 00000058 901721E0 MLA R1,R0,R7,R1
\ 0000005C 000091E5 LDR R0,[R1, #+0]
\ 00000060 000090E5 LDR R0,[R0, #+0]
\ 00000064 060010E1 TST R0,R6
\ 00000068 0F00000A BEQ ??PioInterruptHandler_2
120
121 trace_LOG(trace_DEBUG, "-D- Interrupt source #%d triggered\n\r", i);
122
123 pSources[i].handler(pSources[i].pPin);
\ 0000006C 0800A0E3 MOV R0,#+8
\ 00000070 ........ LDR R1,??DataTable10 ;; pSources
\ 00000074 901721E0 MLA R1,R0,R7,R1
\ 00000078 000091E5 LDR R0,[R1, #+0]
\ 0000007C 0810A0E3 MOV R1,#+8
\ 00000080 ........ LDR R2,??DataTable10 ;; pSources
\ 00000084 912722E0 MLA R2,R1,R7,R2
\ 00000088 041092E5 LDR R1,[R2, #+4]
\ 0000008C 0FE0A0E1 MOV LR,PC
\ 00000090 11FF2FE1 BX R1
124 status &= ~(pSources[i].pPin->mask);
\ 00000094 0800A0E3 MOV R0,#+8
\ 00000098 ........ LDR R1,??DataTable10 ;; pSources
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -