📄 clock.lst
字号:
1 .file "clock.c"
2 __SREG__ = 0x3f
3 __SP_H__ = 0x3e
4 __SP_L__ = 0x3d
5 __CCP__ = 0x34
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .global __do_copy_data
9 .global __do_clear_bss
11 .text
12 .Ltext0:
95 .global clock_init
97 clock_init:
1:io/clock.c **** /*
2:io/clock.c **** ,-----------------------------------------------------------------------------------------.
3:io/clock.c **** | io/clock
4:io/clock.c **** |-----------------------------------------------------------------------------------------
5:io/clock.c **** | this file implements a very basic clock
6:io/clock.c **** | - use 7.3728 Mhz Clock -> /1024/7200 = 1s clock
7:io/clock.c **** | - enables global interrupts (sei()) !
8:io/clock.c **** | - interrupt routine is small, need to call clock_do()
9:io/clock.c **** | to recalc the time at least every 255 seconds ! (call it ~ every second!)
10:io/clock.c **** |
11:io/clock.c **** | Author : Simon Schulz / avr{AT}auctionant.de
12:io/clock.c **** |
13:io/clock.c **** |
14:io/clock.c **** |
15:io/clock.c **** |-----------------------------------------------------------------------------------------
16:io/clock.c **** | License:
17:io/clock.c **** | This program is free software; you can redistribute it and/or modify it under
18:io/clock.c **** | the terms of the GNU General Public License as published by the Free Software
19:io/clock.c **** | Foundation; either version 2 of the License, or (at your option) any later
20:io/clock.c **** | version.
21:io/clock.c **** | This program is distributed in the hope that it will be useful, but
22:io/clock.c **** |
23:io/clock.c **** | WITHOUT ANY WARRANTY;
24:io/clock.c **** |
25:io/clock.c **** | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
26:io/clock.c **** | PURPOSE. See the GNU General Public License for more details.
27:io/clock.c **** |
28:io/clock.c **** | You should have received a copy of the GNU General Public License along with
29:io/clock.c **** | this program; if not, write to the Free Software Foundation, Inc., 51
30:io/clock.c **** | Franklin St, Fifth Floor, Boston, MA 02110, USA
31:io/clock.c **** |
32:io/clock.c **** | http://www.gnu.de/gpl-ger.html
33:io/clock.c **** `-----------------------------------------------------------------------------------------*/
34:io/clock.c ****
35:io/clock.c **** #include "clock.h"
36:io/clock.c **** //ACTIVATE DEBUG by editing this file:
37:io/clock.c **** #include "debug.h"
38:io/clock.c **** #include <compat/deprecated.h>
39:io/clock.c **** //clock (hour,min,sec)
40:io/clock.c **** unsigned char clock[3];
41:io/clock.c ****
42:io/clock.c **** //count how many interrupts passed since last clock_do() call
43:io/clock.c **** volatile unsigned char clock_intcount;
44:io/clock.c **** //stores the nes second/minute flag
45:io/clock.c **** volatile unsigned char clock_new_flag;
46:io/clock.c **** //used as a timer for uart io (mca25) for example
47:io/clock.c **** volatile unsigned char clock_timeout_timer;
48:io/clock.c ****
49:io/clock.c **** void clock_init(){
98 8,0,50,.LM1-.LFBB1
99 .LM1:
100 sts clock_new_flag,__zero_reg__
101 .LBB4:
102 .LBB5:
50:io/clock.c **** mca25) for example
103 lock_init, @function
104 clock_init:
106 .LM0:
107 .LFBB1:
108 /* prologue: function */
109 /* frame size = 0 */
1:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /* Copyright (c) 2005,2006 Joerg Wunsch
2:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** All rights reserved.
3:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
4:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** Redistribution and use in source and binary forms, with or without
5:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** modification, are permitted provided that the following conditions are met:
6:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
7:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** * Redistributions of source code must retain the above copyright
8:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** notice, this list of conditions and the following disclaimer.
9:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
10:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** * Redistributions in binary form must reproduce the above copyright
11:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** notice, this list of conditions and the following disclaimer in
12:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** the documentation and/or other materials provided with the
13:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** distribution.
14:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
15:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** * Neither the name of the copyright holders nor the names of
16:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** contributors may be used to endorse or promote products derived
17:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** from this software without specific prior written permission.
18:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
19:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** POSSIBILITY OF SUCH DAMAGE. */
30:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
31:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /* $Id: deprecated.h,v 1.6.2.2 2008/07/30 21:39:21 arcanum Exp $ */
32:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
33:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #ifndef _COMPAT_DEPRECATED_H_
34:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #define _COMPAT_DEPRECATED_H_
35:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
36:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /** \defgroup deprecated_items <compat/deprecated.h>: Deprecated items
37:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
38:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** This header file contains several items that used to be available
39:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** in previous versions of this library, but have eventually been
40:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** deprecated over time.
41:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
42:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \code #include <compat/deprecated.h> \endcode
43:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
44:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** These items are supplied within that header file for backward
45:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** compatibility reasons only, so old source code that has been
46:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** written for previous library versions could easily be maintained
47:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** until its end-of-life. Use of any of these items in new code is
48:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** strongly discouraged.
49:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** */
50:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
51:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /** \name Allowing specific system-wide interrupts
52:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
53:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** In addition to globally enabling interrupts, each device's particular
54:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** interrupt needs to be enabled separately if interrupts for this device are
55:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** desired. While some devices maintain their interrupt enable bit inside
56:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** the device's register set, external and timer interrupts have system-wide
57:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** configuration registers.
58:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
59:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** Example:
60:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
61:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \code
62:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** // Enable timer 1 overflow interrupts.
63:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** timer_enable_int(_BV(TOIE1));
64:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
65:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** // Do some work...
66:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
67:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** // Disable all timer interrupts.
68:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** timer_enable_int(0);
69:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \endcode
70:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
71:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \note Be careful when you use these functions. If you already have a
72:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** different interrupt enabled, you could inadvertantly disable it by
73:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** enabling another intterupt. */
74:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
75:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /*@{*/
76:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
77:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /** \ingroup deprecated_items
78:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \def enable_external_int(mask)
79:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \deprecated
80:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
81:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** This macro gives access to the \c GIMSK register (or \c EIMSK register
82:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** if using an AVR Mega device or \c GICR register for others). Although this
83:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** macro is essentially the same as assigning to the register, it does
84:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** adapt slightly to the type of device being used. This macro is
85:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** unavailable if none of the registers listed above are defined. */
86:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
87:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /* Define common register definition if available. */
88:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #if defined(EIMSK)
89:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** # define __EICR EIMSK
90:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #elif defined(GIMSK)
91:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** # define __EICR GIMSK
92:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #elif defined(GICR)
93:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** # define __EICR GICR
94:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #endif
95:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
96:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /* If common register defined, define macro. */
97:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #if defined(__EICR) || defined(__DOXYGEN__)
98:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #define enable_external_int(mask) (__EICR = mask)
99:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #endif
100:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
101:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** /** \ingroup deprecated_items
102:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** \deprecated
103:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
104:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** This function modifies the \c timsk register.
105:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** The value you pass via \c ints is device specific. */
106:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h ****
107:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** static __inline__ void timer_enable_int (unsigned char ints)
108:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** {
109:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** #ifdef TIMSK
110:c:/winavr-20081205/lib/gcc/../../avr/include/compat/deprecated.h **** TIMSK = ints;
110 n 162,0,0,0
112 0004 84E0 .global clock_init
114 clock_init:
116 .LM0:
117 .LFBB1:
51:io/clock.c **** atile unsigned char clock_new_flag;
52:io/clock.c **** //used as a timer for uart io (mca25) for example
53:io/clock.c **** volatile unsigned char clock_timeout_timer;
54:io/clock.c ****
55:io/clock.c **** void clock_init(){
56:io/clock.c **** clock_new_flag=0;
118 gue: function */
119 /* frame size = 0 */
57:io/clock.c **** latile unsigned char clock_timeout_timer;
121 it:F(0,15)",36,0,0,clock_init
122 .global clock_init
58:io/clock.c **** a timer for uart io (mca25) for example
124 ,7)",128,0,0,0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -