📄 main.lst
字号:
37:main.c ****
375 .LM25:
376 0046 2EBD out 78-0x20,r18
38:main.c ****
378 .LM26:
379 0048 89B7 in r24,89-0x20
380 004a 8460 ori r24,lo8(4)
381 004c 89BF out 89-0x20,r24
39:main.c ****
40:main.c **** set_buzzer();
383 .LM27:
384 004e 00D0 rcall convert_ds18b20
41:main.c ****
42:main.c **** set_buzzer_ddr();
386 .LM28:
387 0050 00D0 rcall ds1302_read_time
388 .LBB2:
390 .Ltext1:
1:C:/WinAVR/avr/include/avr/eeprom.h **** /* Copyright (c) 2002, 2003, 2004 Marek Michalkiewicz
2:C:/WinAVR/avr/include/avr/eeprom.h **** Copyright (c) 2005, 2006 Bjoern Haase
3:C:/WinAVR/avr/include/avr/eeprom.h **** All rights reserved.
4:C:/WinAVR/avr/include/avr/eeprom.h ****
5:C:/WinAVR/avr/include/avr/eeprom.h **** Redistribution and use in source and binary forms, with or without
6:C:/WinAVR/avr/include/avr/eeprom.h **** modification, are permitted provided that the following conditions are met:
7:C:/WinAVR/avr/include/avr/eeprom.h ****
8:C:/WinAVR/avr/include/avr/eeprom.h **** * Redistributions of source code must retain the above copyright
9:C:/WinAVR/avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer.
10:C:/WinAVR/avr/include/avr/eeprom.h ****
11:C:/WinAVR/avr/include/avr/eeprom.h **** * Redistributions in binary form must reproduce the above copyright
12:C:/WinAVR/avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer in
13:C:/WinAVR/avr/include/avr/eeprom.h **** the documentation and/or other materials provided with the
14:C:/WinAVR/avr/include/avr/eeprom.h **** distribution.
15:C:/WinAVR/avr/include/avr/eeprom.h ****
16:C:/WinAVR/avr/include/avr/eeprom.h **** * Neither the name of the copyright holders nor the names of
17:C:/WinAVR/avr/include/avr/eeprom.h **** contributors may be used to endorse or promote products derived
18:C:/WinAVR/avr/include/avr/eeprom.h **** from this software without specific prior written permission.
19:C:/WinAVR/avr/include/avr/eeprom.h ****
20:C:/WinAVR/avr/include/avr/eeprom.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21:C:/WinAVR/avr/include/avr/eeprom.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22:C:/WinAVR/avr/include/avr/eeprom.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23:C:/WinAVR/avr/include/avr/eeprom.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24:C:/WinAVR/avr/include/avr/eeprom.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25:C:/WinAVR/avr/include/avr/eeprom.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26:C:/WinAVR/avr/include/avr/eeprom.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27:C:/WinAVR/avr/include/avr/eeprom.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28:C:/WinAVR/avr/include/avr/eeprom.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29:C:/WinAVR/avr/include/avr/eeprom.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30:C:/WinAVR/avr/include/avr/eeprom.h **** POSSIBILITY OF SUCH DAMAGE. */
31:C:/WinAVR/avr/include/avr/eeprom.h ****
32:C:/WinAVR/avr/include/avr/eeprom.h **** /* $Id: eeprom.h,v 1.17.2.1 2006/02/26 21:51:04 aesok Exp $ */
33:C:/WinAVR/avr/include/avr/eeprom.h ****
34:C:/WinAVR/avr/include/avr/eeprom.h **** /*
35:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom.h
36:C:/WinAVR/avr/include/avr/eeprom.h ****
37:C:/WinAVR/avr/include/avr/eeprom.h **** Contributors:
38:C:/WinAVR/avr/include/avr/eeprom.h **** Created by Marek Michalkiewicz <marekm@linux.org.pl>
39:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_write_word and eeprom_write_block added by Artur Lipowski
40:C:/WinAVR/avr/include/avr/eeprom.h **** <LAL@pro.onet.pl>
41:C:/WinAVR/avr/include/avr/eeprom.h **** Complete rewrite using the original interface by Bjoern Haase
42:C:/WinAVR/avr/include/avr/eeprom.h **** <bjoern.haase@de.bosch.com>.
43:C:/WinAVR/avr/include/avr/eeprom.h **** */
44:C:/WinAVR/avr/include/avr/eeprom.h ****
45:C:/WinAVR/avr/include/avr/eeprom.h **** #ifndef _EEPROM_H_
46:C:/WinAVR/avr/include/avr/eeprom.h **** #define _EEPROM_H_ 1
47:C:/WinAVR/avr/include/avr/eeprom.h ****
48:C:/WinAVR/avr/include/avr/eeprom.h **** #define __need_size_t
49:C:/WinAVR/avr/include/avr/eeprom.h **** #include <stddef.h>
50:C:/WinAVR/avr/include/avr/eeprom.h **** #include <inttypes.h>
51:C:/WinAVR/avr/include/avr/eeprom.h ****
52:C:/WinAVR/avr/include/avr/eeprom.h ****
53:C:/WinAVR/avr/include/avr/eeprom.h **** #ifdef __AVR_MEGA__
54:C:/WinAVR/avr/include/avr/eeprom.h **** #define XCALL "call"
55:C:/WinAVR/avr/include/avr/eeprom.h **** #else
56:C:/WinAVR/avr/include/avr/eeprom.h **** #define XCALL "rcall"
57:C:/WinAVR/avr/include/avr/eeprom.h **** #endif
58:C:/WinAVR/avr/include/avr/eeprom.h ****
59:C:/WinAVR/avr/include/avr/eeprom.h **** #include <avr/io.h>
60:C:/WinAVR/avr/include/avr/eeprom.h **** #ifndef __EEPROM_REG_LOCATIONS__
61:C:/WinAVR/avr/include/avr/eeprom.h **** /** \def __EEPROM_REG_LOCATIONS__
62:C:/WinAVR/avr/include/avr/eeprom.h **** \ingroup avr_eeprom
63:C:/WinAVR/avr/include/avr/eeprom.h **** In order to be able to work without a requiring a multilib
64:C:/WinAVR/avr/include/avr/eeprom.h **** approach for dealing with controllers having the EEPROM registers
65:C:/WinAVR/avr/include/avr/eeprom.h **** at different positions in memory space, the eeprom functions evaluate
66:C:/WinAVR/avr/include/avr/eeprom.h **** __EEPROM_REG_LOCATIONS__: It is assumed to be defined by
67:C:/WinAVR/avr/include/avr/eeprom.h **** the device io header and contains 6 uppercase hex digits encoding the
68:C:/WinAVR/avr/include/avr/eeprom.h **** addresses of EECR,EEDR and EEAR.
69:C:/WinAVR/avr/include/avr/eeprom.h **** First two letters: EECR address.
70:C:/WinAVR/avr/include/avr/eeprom.h **** Second two letters: EEDR address.
71:C:/WinAVR/avr/include/avr/eeprom.h **** Last two letters: EEAR address.
72:C:/WinAVR/avr/include/avr/eeprom.h **** The default 1C1D1E corresponds to the
73:C:/WinAVR/avr/include/avr/eeprom.h **** register location that is valid for most controllers. The value
74:C:/WinAVR/avr/include/avr/eeprom.h **** of this define symbol is used for appending it to the base name of the
75:C:/WinAVR/avr/include/avr/eeprom.h **** assembler functions. */
76:C:/WinAVR/avr/include/avr/eeprom.h **** #define __EEPROM_REG_LOCATIONS__ 1C1D1E
77:C:/WinAVR/avr/include/avr/eeprom.h **** #endif
78:C:/WinAVR/avr/include/avr/eeprom.h **** #define _STR2(EXP) _STR1(EXP)
79:C:/WinAVR/avr/include/avr/eeprom.h **** #define _STR1(EXP) #EXP
80:C:/WinAVR/avr/include/avr/eeprom.h **** #define _REG_LOCATION_SUFFIX _STR2(__EEPROM_REG_LOCATIONS__)
81:C:/WinAVR/avr/include/avr/eeprom.h ****
82:C:/WinAVR/avr/include/avr/eeprom.h **** #ifndef CR_TAB
83:C:/WinAVR/avr/include/avr/eeprom.h **** #define CR_TAB "\n\t"
84:C:/WinAVR/avr/include/avr/eeprom.h **** #endif
85:C:/WinAVR/avr/include/avr/eeprom.h ****
86:C:/WinAVR/avr/include/avr/eeprom.h ****
87:C:/WinAVR/avr/include/avr/eeprom.h **** /** \defgroup avr_eeprom <avr/eeprom.h>: EEPROM handling
88:C:/WinAVR/avr/include/avr/eeprom.h **** \code #include <avr/eeprom.h> \endcode
89:C:/WinAVR/avr/include/avr/eeprom.h ****
90:C:/WinAVR/avr/include/avr/eeprom.h **** This header file declares the interface to some simple library
91:C:/WinAVR/avr/include/avr/eeprom.h **** routines suitable for handling the data EEPROM contained in the
92:C:/WinAVR/avr/include/avr/eeprom.h **** AVR microcontrollers. The implementation uses a simple polled
93:C:/WinAVR/avr/include/avr/eeprom.h **** mode interface. Applications that require interrupt-controlled
94:C:/WinAVR/avr/include/avr/eeprom.h **** EEPROM access to ensure that no time will be wasted in spinloops
95:C:/WinAVR/avr/include/avr/eeprom.h **** will have to deploy their own implementation.
96:C:/WinAVR/avr/include/avr/eeprom.h ****
97:C:/WinAVR/avr/include/avr/eeprom.h **** \note All of the read/write functions first make sure the EEPROM
98:C:/WinAVR/avr/include/avr/eeprom.h **** is ready to be accessed. Since this may cause long delays if a
99:C:/WinAVR/avr/include/avr/eeprom.h **** write operation is still pending, time-critical applications
100:C:/WinAVR/avr/include/avr/eeprom.h **** should first poll the EEPROM e. g. using eeprom_is_ready() before
101:C:/WinAVR/avr/include/avr/eeprom.h **** attempting any actual I/O.
102:C:/WinAVR/avr/include/avr/eeprom.h ****
103:C:/WinAVR/avr/include/avr/eeprom.h **** \note This header file declares inline functions that call the
104:C:/WinAVR/avr/include/avr/eeprom.h **** assembler subroutines directly. This prevents that the compiler
105:C:/WinAVR/avr/include/avr/eeprom.h **** generates push/pops for the call-clobbered registers. This way
106:C:/WinAVR/avr/include/avr/eeprom.h **** also a specific calling convention could be used for the eeprom
107:C:/WinAVR/avr/include/avr/eeprom.h **** routines e.g. by passing values in __tmp_reg__, eeprom addresses in
108:C:/WinAVR/avr/include/avr/eeprom.h **** X and memory addresses in Z registers. Method is optimized for code
109:C:/WinAVR/avr/include/avr/eeprom.h **** size.
110:C:/WinAVR/avr/include/avr/eeprom.h ****
111:C:/WinAVR/avr/include/avr/eeprom.h **** \note Presently supported are two locations of the EEPROM register
112:C:/WinAVR/avr/include/avr/eeprom.h **** set: 0x1F,0x20,0x21 and 0x1C,0x1D,0x1E
113:C:/WinAVR/avr/include/avr/eeprom.h **** (see ::__EEPROM_REG_LOCATIONS__).
114:C:/WinAVR/avr/include/avr/eeprom.h ****
115:C:/WinAVR/avr/include/avr/eeprom.h **** \note As these functions modify IO registers, they are known to be
116:C:/WinAVR/avr/include/avr/eeprom.h **** non-reentrant. If any of these functions are used from both,
117:C:/WinAVR/avr/include/avr/eeprom.h **** standard and interrupt context, the applications must ensure
118:C:/WinAVR/avr/include/avr/eeprom.h **** proper protection (e.g. by disabling interrupts before accessing
119:C:/WinAVR/avr/include/avr/eeprom.h **** them).
120:C:/WinAVR/avr/include/avr/eeprom.h ****
121:C:/WinAVR/avr/include/avr/eeprom.h **** */
122:C:/WinAVR/avr/include/avr/eeprom.h ****
123:C:/WinAVR/avr/include/avr/eeprom.h ****
124:C:/WinAVR/avr/include/avr/eeprom.h **** /* forward declarations of the inline functions so that doxygen does
125:C:/WinAVR/avr/include/avr/eeprom.h **** not get confused by the attribute expression. */
126:C:/WinAVR/avr/include/avr/eeprom.h ****
127:C:/WinAVR/avr/include/avr/eeprom.h **** static inline uint8_t __attribute__ ((always_inline))
128:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr);
129:C:/WinAVR/avr/include/avr/eeprom.h ****
130:C:/WinAVR/avr/include/avr/eeprom.h **** static inline uint16_t __attribute__ ((always_inline))
131:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_read_word (const uint16_t *addr);
132:C:/WinAVR/avr/include/avr/eeprom.h ****
133:C:/WinAVR/avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline))
134:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_read_block (void *pointer_ram,
135:C:/WinAVR/avr/include/avr/eeprom.h **** const void *pointer_eeprom,
136:C:/WinAVR/avr/include/avr/eeprom.h **** size_t size);
137:C:/WinAVR/avr/include/avr/eeprom.h ****
138:C:/WinAVR/avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline))
139:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_write_byte (uint8_t *addr,uint8_t value);
140:C:/WinAVR/avr/include/avr/eeprom.h ****
141:C:/WinAVR/avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline))
142:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_write_word (uint16_t *addr,uint16_t value);
143:C:/WinAVR/avr/include/avr/eeprom.h ****
144:C:/WinAVR/avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline))
145:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_write_block (const void *pointer_ram,
146:C:/WinAVR/avr/include/avr/eeprom.h **** void *pointer_eeprom,
147:C:/WinAVR/avr/include/avr/eeprom.h **** size_t size);
148:C:/WinAVR/avr/include/avr/eeprom.h ****
149:C:/WinAVR/avr/include/avr/eeprom.h **** /** \name avr-libc declarations */
150:C:/WinAVR/avr/include/avr/eeprom.h ****
151:C:/WinAVR/avr/include/avr/eeprom.h **** /*@{*/
152:C:/WinAVR/avr/include/avr/eeprom.h ****
153:C:/WinAVR/avr/include/avr/eeprom.h **** /** \def EEMEM
154:C:/WinAVR/avr/include/avr/eeprom.h **** \ingroup avr_eeprom
155:C:/WinAVR/avr/include/avr/eeprom.h **** Attribute expression causing a variable to be allocated within the .eeprom
156:C:/WinAVR/avr/include/avr/eeprom.h **** section. */
157:C:/WinAVR/avr/include/avr/eeprom.h **** #define EEMEM __attribute__((section(".eeprom")))
158:C:/WinAVR/avr/include/avr/eeprom.h ****
159:C:/WinAVR/avr/include/avr/eeprom.h **** /** \def eeprom_is_ready
160:C:/WinAVR/avr/include/avr/eeprom.h **** \ingroup avr_eeprom
161:C:/WinAVR/avr/include/avr/eeprom.h **** \returns 1 if EEPROM is ready for a new read/write operation, 0 if not. */
162:C:/WinAVR/avr/include/avr/eeprom.h ****
163:C:/WinAVR/avr/include/avr/eeprom.h **** #if defined(__DOXYGEN__)
164:C:/WinAVR/avr/include/avr/eeprom.h **** # define eeprom_is_ready()
165:C:/WinAVR/avr/include/avr/eeprom.h **** #elif defined(EEWE)
166:C:/WinAVR/avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(EECR, EEWE)
167:C:/WinAVR/avr/include/avr/eeprom.h **** #elif defined(EEPE)
168:C:/WinAVR/avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(EECR, EEPE)
169:C:/WinAVR/avr/include/avr/eeprom.h **** #elif defined(DEECR) && defined(EEL)
170:C:/WinAVR/avr/include/avr/eeprom.h **** # define eeprom_is_ready() bit_is_clear(DEECR, EEL)
171:C:/WinAVR/avr/include/avr/eeprom.h **** #else
172:C:/WinAVR/avr/include/avr/eeprom.h **** # error "No write enable bit known for this device's EEPROM."
173:C:/WinAVR/avr/include/avr/eeprom.h **** #endif
174:C:/WinAVR/avr/include/avr/eeprom.h ****
175:C:/WinAVR/avr/include/avr/eeprom.h **** /** \def eeprom_busy_wait
176:C:/WinAVR/avr/include/avr/eeprom.h **** \ingroup avr_eeprom
177:C:/WinAVR/avr/include/avr/eeprom.h ****
178:C:/WinAVR/avr/include/avr/eeprom.h **** Loops until the eeprom is no longer busy.
179:C:/WinAVR/avr/include/avr/eeprom.h ****
180:C:/WinAVR/avr/include/avr/eeprom.h **** \returns Nothing. */
181:C:/WinAVR/avr/include/avr/eeprom.h ****
182:C:/WinAVR/avr/include/avr/eeprom.h **** #define eeprom_busy_wait() do {} while (!eeprom_is_ready())
183:C:/WinAVR/avr/include/avr/eeprom.h ****
184:C:/WinAVR/avr/include/avr/eeprom.h ****
185:C:/WinAVR/avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom
186:C:/WinAVR/avr/include/avr/eeprom.h **** Read one byte from EEPROM address \c addr. */
187:C:/WinAVR/avr/include/avr/eeprom.h ****
188:C:/WinAVR/avr/include/avr/eeprom.h **** uint8_t
189:C:/WinAVR/avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr)
190:C:/WinAVR/avr/include/avr/eeprom.h **** {
392 .LM29:
393 0052 A0E1 ldi r26,lo8(16)
394 0054 B0E0 ldi r27,hi8(16)
395 .LBB3:
191:C:/WinAVR/avr/include/avr/eeprom.h **** uint8_t result;
192:C:/WinAVR/avr/include/avr/eeprom.h **** asm volatile
397 .LM30:
398 /* #APP */
399 0056 00D0 rcall __eeprom_read_byte_1C1D1E
400 0058 802D mov r24,__tmp_reg__
401 /* #NOAPP */
402 .LBE3:
403 .LBE2:
405 .LM31:
406 005a 8093 0000 sts timer0_hour,r24
407 .LBB4:
408 005e A1E1 ldi r26,lo8(17)
409 0060 B0E0 ldi r27,hi8(17)
410 .LBB5:
412 .LM32:
413 /* #APP */
414 0062 00D0 rcall __eeprom_read_byte_1C1D1E
415 0064 802D mov r24,__tmp_reg__
416 /* #NOAPP */
417 .LBE5:
418 .LBE4:
420 .LM33:
421 0066 8093 0000 sts timer0_minute,r24
422 .LBB6:
423 006a A2E1 ldi r26,lo8(18)
424 006c B0E0 ldi r27,hi8(18)
425 .LBB7:
427 .LM34:
428 /* #APP */
429 006e 00D0 rcall __eeprom_read_byte_1C1D1E
430 0070 802D mov r24,__tmp_reg__
431 /* #NOAPP */
432 .LBE7:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -