790 lines
26 KiB
Text
790 lines
26 KiB
Text
|
|
AtTiny_alarm_clock.elf: file format elf32-avr
|
|
|
|
Sections:
|
|
Idx Name Size VMA LMA File off Algn
|
|
0 .text 000003e6 00000000 00000000 00000094 2**1
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
1 .data 00000054 00800060 000003e6 0000047a 2**0
|
|
CONTENTS, ALLOC, LOAD, DATA
|
|
2 .bss 00000008 008000b4 008000b4 000004ce 2**0
|
|
ALLOC
|
|
3 .comment 00000030 00000000 00000000 000004ce 2**0
|
|
CONTENTS, READONLY
|
|
4 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 00000500 2**2
|
|
CONTENTS, READONLY
|
|
5 .debug_aranges 000000a0 00000000 00000000 00000540 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
6 .debug_info 00000c54 00000000 00000000 000005e0 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
7 .debug_abbrev 0000073a 00000000 00000000 00001234 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
8 .debug_line 00000689 00000000 00000000 0000196e 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
9 .debug_frame 00000164 00000000 00000000 00001ff8 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
10 .debug_str 00000493 00000000 00000000 0000215c 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
11 .debug_loc 00000470 00000000 00000000 000025ef 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
12 .debug_ranges 00000088 00000000 00000000 00002a5f 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
|
Disassembly of section .text:
|
|
|
|
00000000 <__vectors>:
|
|
0: 14 c0 rjmp .+40 ; 0x2a <__ctors_end>
|
|
2: 2c c0 rjmp .+88 ; 0x5c <__bad_interrupt>
|
|
4: 2b c0 rjmp .+86 ; 0x5c <__bad_interrupt>
|
|
6: 2a c0 rjmp .+84 ; 0x5c <__bad_interrupt>
|
|
8: 29 c0 rjmp .+82 ; 0x5c <__bad_interrupt>
|
|
a: a7 c0 rjmp .+334 ; 0x15a <__vector_5>
|
|
c: 27 c0 rjmp .+78 ; 0x5c <__bad_interrupt>
|
|
e: 26 c0 rjmp .+76 ; 0x5c <__bad_interrupt>
|
|
10: 25 c0 rjmp .+74 ; 0x5c <__bad_interrupt>
|
|
12: 24 c0 rjmp .+72 ; 0x5c <__bad_interrupt>
|
|
14: 23 c0 rjmp .+70 ; 0x5c <__bad_interrupt>
|
|
16: 22 c0 rjmp .+68 ; 0x5c <__bad_interrupt>
|
|
18: 21 c0 rjmp .+66 ; 0x5c <__bad_interrupt>
|
|
1a: 20 c0 rjmp .+64 ; 0x5c <__bad_interrupt>
|
|
1c: 1f c0 rjmp .+62 ; 0x5c <__bad_interrupt>
|
|
1e: 1e c0 rjmp .+60 ; 0x5c <__bad_interrupt>
|
|
20: 1d c0 rjmp .+58 ; 0x5c <__bad_interrupt>
|
|
22: 1c c0 rjmp .+56 ; 0x5c <__bad_interrupt>
|
|
24: 1b c0 rjmp .+54 ; 0x5c <__bad_interrupt>
|
|
26: 1a c0 rjmp .+52 ; 0x5c <__bad_interrupt>
|
|
28: 19 c0 rjmp .+50 ; 0x5c <__bad_interrupt>
|
|
|
|
0000002a <__ctors_end>:
|
|
2a: 11 24 eor r1, r1
|
|
2c: 1f be out 0x3f, r1 ; 63
|
|
2e: cf ed ldi r28, 0xDF ; 223
|
|
30: cd bf out 0x3d, r28 ; 61
|
|
|
|
00000032 <__do_copy_data>:
|
|
32: 10 e0 ldi r17, 0x00 ; 0
|
|
34: a0 e6 ldi r26, 0x60 ; 96
|
|
36: b0 e0 ldi r27, 0x00 ; 0
|
|
38: e6 ee ldi r30, 0xE6 ; 230
|
|
3a: f3 e0 ldi r31, 0x03 ; 3
|
|
3c: 02 c0 rjmp .+4 ; 0x42 <__SREG__+0x3>
|
|
3e: 05 90 lpm r0, Z+
|
|
40: 0d 92 st X+, r0
|
|
42: a4 3b cpi r26, 0xB4 ; 180
|
|
44: b1 07 cpc r27, r17
|
|
46: d9 f7 brne .-10 ; 0x3e <__SP_L__+0x1>
|
|
|
|
00000048 <__do_clear_bss>:
|
|
48: 20 e0 ldi r18, 0x00 ; 0
|
|
4a: a4 eb ldi r26, 0xB4 ; 180
|
|
4c: b0 e0 ldi r27, 0x00 ; 0
|
|
4e: 01 c0 rjmp .+2 ; 0x52 <.do_clear_bss_start>
|
|
|
|
00000050 <.do_clear_bss_loop>:
|
|
50: 1d 92 st X+, r1
|
|
|
|
00000052 <.do_clear_bss_start>:
|
|
52: ac 3b cpi r26, 0xBC ; 188
|
|
54: b2 07 cpc r27, r18
|
|
56: e1 f7 brne .-8 ; 0x50 <.do_clear_bss_loop>
|
|
58: f5 d0 rcall .+490 ; 0x244 <main>
|
|
5a: c3 c1 rjmp .+902 ; 0x3e2 <_exit>
|
|
|
|
0000005c <__bad_interrupt>:
|
|
5c: d1 cf rjmp .-94 ; 0x0 <__vectors>
|
|
|
|
0000005e <lcd_5ms>:
|
|
|
|
void lcd_1s(void){
|
|
for(uint8_t i=200;i>0;i--){
|
|
lcd_5ms();
|
|
}
|
|
}
|
|
5e: cf 93 push r28
|
|
60: c2 e3 ldi r28, 0x32 ; 50
|
|
62: 62 d0 rcall .+196 ; 0x128 <wait_100us>
|
|
64: c1 50 subi r28, 0x01 ; 1
|
|
66: e9 f7 brne .-6 ; 0x62 <lcd_5ms+0x4>
|
|
68: cf 91 pop r28
|
|
6a: 08 95 ret
|
|
|
|
0000006c <lcd_write>:
|
|
|
|
void lcd_instruct(uint8_t zeichen){
|
|
lcd_write(instruct,zeichen,0);
|
|
}
|
|
|
|
void lcd_write(uint8_t lcd_whichwrite, uint8_t zeichen, uint8_t position){
|
|
6c: cf 93 push r28
|
|
6e: c6 2f mov r28, r22
|
|
switch (lcd_whichwrite){
|
|
70: 84 30 cpi r24, 0x04 ; 4
|
|
72: 38 f4 brcc .+14 ; 0x82 <lcd_write+0x16>
|
|
74: 82 30 cpi r24, 0x02 ; 2
|
|
76: 48 f4 brcc .+18 ; 0x8a <lcd_write+0x1e>
|
|
78: 88 23 and r24, r24
|
|
7a: 71 f0 breq .+28 ; 0x98 <lcd_write+0x2c>
|
|
7c: 81 30 cpi r24, 0x01 ; 1
|
|
7e: 49 f0 breq .+18 ; 0x92 <lcd_write+0x26>
|
|
80: 0c c0 rjmp .+24 ; 0x9a <lcd_write+0x2e>
|
|
82: 84 30 cpi r24, 0x04 ; 4
|
|
84: 51 f4 brne .+20 ; 0x9a <lcd_write+0x2e>
|
|
case instruct :
|
|
unset_lcd_RS;
|
|
86: 93 98 cbi 0x12, 3 ; 18
|
|
break;
|
|
88: 08 c0 rjmp .+16 ; 0x9a <lcd_write+0x2e>
|
|
case line2:
|
|
case line1:
|
|
position = position & 0x3f;
|
|
8a: 4f 73 andi r20, 0x3F ; 63
|
|
if (lcd_whichwrite == line2){ position=position + 0x40; };
|
|
8c: 83 30 cpi r24, 0x03 ; 3
|
|
8e: 09 f4 brne .+2 ; 0x92 <lcd_write+0x26>
|
|
90: 40 5c subi r20, 0xC0 ; 192
|
|
case therepos:
|
|
lcd_instruct(lcd_mask_Write_Adress(position));
|
|
92: 84 2f mov r24, r20
|
|
94: 80 68 ori r24, 0x80 ; 128
|
|
96: 24 d0 rcall .+72 ; 0xe0 <lcd_instruct>
|
|
case here:
|
|
set_lcd_RS;
|
|
98: 93 9a sbi 0x12, 3 ; 18
|
|
break;
|
|
|
|
|
|
}
|
|
set_lcd_E;
|
|
9a: 92 9a sbi 0x12, 2 ; 18
|
|
set_lcd_E;
|
|
9c: 92 9a sbi 0x12, 2 ; 18
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
9e: 98 b3 in r25, 0x18 ; 24
|
|
a0: 9f 70 andi r25, 0x0F ; 15
|
|
a2: 8c 2f mov r24, r28
|
|
a4: 80 7f andi r24, 0xF0 ; 240
|
|
a6: 98 2b or r25, r24
|
|
a8: 98 bb out 0x18, r25 ; 24
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
aa: 98 b3 in r25, 0x18 ; 24
|
|
ac: 9f 70 andi r25, 0x0F ; 15
|
|
ae: 89 2b or r24, r25
|
|
b0: 88 bb out 0x18, r24 ; 24
|
|
unset_lcd_E;
|
|
b2: 92 98 cbi 0x12, 2 ; 18
|
|
unset_lcd_E;
|
|
b4: 92 98 cbi 0x12, 2 ; 18
|
|
wait_100us();
|
|
b6: 38 d0 rcall .+112 ; 0x128 <wait_100us>
|
|
if (lcd_dataport_DDR==0xf0){
|
|
b8: 87 b3 in r24, 0x17 ; 23
|
|
ba: 80 3f cpi r24, 0xF0 ; 240
|
|
bc: 79 f4 brne .+30 ; 0xdc <lcd_write+0x70>
|
|
zeichen=zeichen << 4;
|
|
set_lcd_E;
|
|
be: 92 9a sbi 0x12, 2 ; 18
|
|
set_lcd_E;
|
|
c0: 92 9a sbi 0x12, 2 ; 18
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
c2: 88 b3 in r24, 0x18 ; 24
|
|
c4: c2 95 swap r28
|
|
c6: c0 7f andi r28, 0xF0 ; 240
|
|
c8: 8f 70 andi r24, 0x0F ; 15
|
|
ca: 8c 2b or r24, r28
|
|
cc: 88 bb out 0x18, r24 ; 24
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
ce: 88 b3 in r24, 0x18 ; 24
|
|
d0: 8f 70 andi r24, 0x0F ; 15
|
|
d2: c8 2b or r28, r24
|
|
d4: c8 bb out 0x18, r28 ; 24
|
|
unset_lcd_E;
|
|
d6: 92 98 cbi 0x12, 2 ; 18
|
|
unset_lcd_E;
|
|
d8: 92 98 cbi 0x12, 2 ; 18
|
|
wait_100us();
|
|
da: 26 d0 rcall .+76 ; 0x128 <wait_100us>
|
|
}
|
|
}
|
|
dc: cf 91 pop r28
|
|
de: 08 95 ret
|
|
|
|
000000e0 <lcd_instruct>:
|
|
lcd_5ms();
|
|
}
|
|
}
|
|
|
|
void lcd_instruct(uint8_t zeichen){
|
|
lcd_write(instruct,zeichen,0);
|
|
e0: 40 e0 ldi r20, 0x00 ; 0
|
|
e2: 68 2f mov r22, r24
|
|
e4: 84 e0 ldi r24, 0x04 ; 4
|
|
e6: c2 df rcall .-124 ; 0x6c <lcd_write>
|
|
e8: 08 95 ret
|
|
|
|
000000ea <lcd_init>:
|
|
|
|
|
|
|
|
void lcd_init(void){
|
|
/* setting up ports first */
|
|
lcd_dataport_DDR=0xff;
|
|
ea: 8f ef ldi r24, 0xFF ; 255
|
|
ec: 87 bb out 0x17, r24 ; 23
|
|
set_lcd_RS_DDR;
|
|
ee: 8b 9a sbi 0x11, 3 ; 17
|
|
set_lcd_E_DDR;
|
|
f0: 8a 9a sbi 0x11, 2 ; 17
|
|
/* end setting up ports */
|
|
lcd_dataport=0xff;
|
|
f2: 88 bb out 0x18, r24 ; 24
|
|
set_lcd_RS;
|
|
f4: 93 9a sbi 0x12, 3 ; 18
|
|
set_lcd_E;
|
|
f6: 92 9a sbi 0x12, 2 ; 18
|
|
lcd_5ms();
|
|
f8: b2 df rcall .-156 ; 0x5e <lcd_5ms>
|
|
lcd_5ms();
|
|
fa: b1 df rcall .-158 ; 0x5e <lcd_5ms>
|
|
lcd_5ms();
|
|
fc: b0 df rcall .-160 ; 0x5e <lcd_5ms>
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT);
|
|
fe: 80 e3 ldi r24, 0x30 ; 48
|
|
100: ef df rcall .-34 ; 0xe0 <lcd_instruct>
|
|
lcd_5ms();
|
|
102: ad df rcall .-166 ; 0x5e <lcd_5ms>
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT);
|
|
104: 80 e3 ldi r24, 0x30 ; 48
|
|
106: ec df rcall .-40 ; 0xe0 <lcd_instruct>
|
|
wait_100us();
|
|
108: 0f d0 rcall .+30 ; 0x128 <wait_100us>
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT);
|
|
10a: 80 e3 ldi r24, 0x30 ; 48
|
|
10c: e9 df rcall .-46 ; 0xe0 <lcd_instruct>
|
|
if (lcd_dataport_mask==0xf0){
|
|
lcd_instruct(lcd_SET_FUNCTION_4BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
|
|
10e: 88 e2 ldi r24, 0x28 ; 40
|
|
110: e7 df rcall .-50 ; 0xe0 <lcd_instruct>
|
|
}else{
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
|
|
}
|
|
lcd_dataport_DDR&=lcd_dataport_mask;
|
|
112: 87 b3 in r24, 0x17 ; 23
|
|
114: 80 7f andi r24, 0xF0 ; 240
|
|
116: 87 bb out 0x17, r24 ; 23
|
|
lcd_instruct(lcd_DISPLAY_OO_ON|lcd_DISPLAY_OO_CURSOR_OFF);
|
|
118: 8c e0 ldi r24, 0x0C ; 12
|
|
11a: e2 df rcall .-60 ; 0xe0 <lcd_instruct>
|
|
lcd_instruct(lcd_ENTRY_MODE_SET|lcd_ENTRY_MODE_SET_INCREASE | lcd_ENTRY_MS_DISPLAY_NOT_S);
|
|
11c: 86 e0 ldi r24, 0x06 ; 6
|
|
11e: e0 df rcall .-64 ; 0xe0 <lcd_instruct>
|
|
lcd_instruct(lcd_RETURN_HOME);
|
|
120: 82 e0 ldi r24, 0x02 ; 2
|
|
122: de df rcall .-68 ; 0xe0 <lcd_instruct>
|
|
lcd_5ms();
|
|
124: 9c df rcall .-200 ; 0x5e <lcd_5ms>
|
|
126: 08 95 ret
|
|
|
|
00000128 <wait_100us>:
|
|
#include <inttypes.h>
|
|
#include <avr/io.h>
|
|
#include "lcd4.h"
|
|
|
|
void wait_100us(void){
|
|
128: cf 93 push r28
|
|
12a: df 93 push r29
|
|
12c: 1f 92 push r1
|
|
12e: cd b7 in r28, 0x3d ; 61
|
|
130: dd 27 eor r29, r29
|
|
for (volatile uint8_t i=68;i--;i>0){
|
|
132: 84 e4 ldi r24, 0x44 ; 68
|
|
134: 89 83 std Y+1, r24 ; 0x01
|
|
136: 89 81 ldd r24, Y+1 ; 0x01
|
|
138: 9f ef ldi r25, 0xFF ; 255
|
|
13a: 98 0f add r25, r24
|
|
13c: 99 83 std Y+1, r25 ; 0x01
|
|
13e: 88 23 and r24, r24
|
|
140: 41 f0 breq .+16 ; 0x152 <wait_100us+0x2a>
|
|
i;
|
|
142: 89 81 ldd r24, Y+1 ; 0x01
|
|
#include <inttypes.h>
|
|
#include <avr/io.h>
|
|
#include "lcd4.h"
|
|
|
|
void wait_100us(void){
|
|
for (volatile uint8_t i=68;i--;i>0){
|
|
144: 89 81 ldd r24, Y+1 ; 0x01
|
|
146: 89 81 ldd r24, Y+1 ; 0x01
|
|
148: 9f ef ldi r25, 0xFF ; 255
|
|
14a: 98 0f add r25, r24
|
|
14c: 99 83 std Y+1, r25 ; 0x01
|
|
14e: 81 11 cpse r24, r1
|
|
150: f8 cf rjmp .-16 ; 0x142 <wait_100us+0x1a>
|
|
i;
|
|
}
|
|
}
|
|
152: 0f 90 pop r0
|
|
154: df 91 pop r29
|
|
156: cf 91 pop r28
|
|
158: 08 95 ret
|
|
|
|
0000015a <__vector_5>:
|
|
|
|
int clock_state_changed = 0;
|
|
int update_display = 1;
|
|
|
|
ISR (TIMER1_OVF_vect) // Timer1 ISR
|
|
{
|
|
15a: 1f 92 push r1
|
|
15c: 0f 92 push r0
|
|
15e: 0f b6 in r0, 0x3f ; 63
|
|
160: 0f 92 push r0
|
|
162: 11 24 eor r1, r1
|
|
164: 8f 93 push r24
|
|
166: 9f 93 push r25
|
|
//counter++;
|
|
TCNT1 = 63974;
|
|
168: 86 ee ldi r24, 0xE6 ; 230
|
|
16a: 99 ef ldi r25, 0xF9 ; 249
|
|
16c: 9d bd out 0x2d, r25 ; 45
|
|
16e: 8c bd out 0x2c, r24 ; 44
|
|
}
|
|
170: 9f 91 pop r25
|
|
172: 8f 91 pop r24
|
|
174: 0f 90 pop r0
|
|
176: 0f be out 0x3f, r0 ; 63
|
|
178: 0f 90 pop r0
|
|
17a: 1f 90 pop r1
|
|
17c: 18 95 reti
|
|
|
|
0000017e <lcd_write_text>:
|
|
}
|
|
}
|
|
}
|
|
|
|
void lcd_write_text(int row, int col, uint8_t text[])
|
|
{
|
|
17e: ef 92 push r14
|
|
180: ff 92 push r15
|
|
182: 0f 93 push r16
|
|
184: 1f 93 push r17
|
|
186: cf 93 push r28
|
|
188: 7c 01 movw r14, r24
|
|
switch(row){
|
|
18a: 89 2b or r24, r25
|
|
18c: 29 f0 breq .+10 ; 0x198 <lcd_write_text+0x1a>
|
|
18e: 81 e0 ldi r24, 0x01 ; 1
|
|
190: e8 16 cp r14, r24
|
|
192: f1 04 cpc r15, r1
|
|
194: 31 f0 breq .+12 ; 0x1a2 <lcd_write_text+0x24>
|
|
196: 0a c0 rjmp .+20 ; 0x1ac <lcd_write_text+0x2e>
|
|
case 0:
|
|
row = line1;
|
|
198: 68 94 set
|
|
19a: ee 24 eor r14, r14
|
|
19c: e1 f8 bld r14, 1
|
|
19e: f1 2c mov r15, r1
|
|
1a0: 05 c0 rjmp .+10 ; 0x1ac <lcd_write_text+0x2e>
|
|
break;
|
|
case 1:
|
|
row = line2;
|
|
1a2: 0f 2e mov r0, r31
|
|
1a4: f3 e0 ldi r31, 0x03 ; 3
|
|
1a6: ef 2e mov r14, r31
|
|
1a8: f1 2c mov r15, r1
|
|
1aa: f0 2d mov r31, r0
|
|
1ac: 04 2f mov r16, r20
|
|
1ae: 15 2f mov r17, r21
|
|
1b0: c0 e0 ldi r28, 0x00 ; 0
|
|
break;
|
|
}
|
|
for(int i=0;i<=15;i++){
|
|
if(text[i] != 0x5F){
|
|
1b2: f8 01 movw r30, r16
|
|
1b4: 61 91 ld r22, Z+
|
|
1b6: 8f 01 movw r16, r30
|
|
1b8: 6f 35 cpi r22, 0x5F ; 95
|
|
1ba: 19 f0 breq .+6 ; 0x1c2 <lcd_write_text+0x44>
|
|
lcd_write(row, text[i], 0+i);
|
|
1bc: 4c 2f mov r20, r28
|
|
1be: 8e 2d mov r24, r14
|
|
1c0: 55 df rcall .-342 ; 0x6c <lcd_write>
|
|
}
|
|
lcd_5ms();
|
|
1c2: 4d df rcall .-358 ; 0x5e <lcd_5ms>
|
|
1c4: cf 5f subi r28, 0xFF ; 255
|
|
break;
|
|
case 1:
|
|
row = line2;
|
|
break;
|
|
}
|
|
for(int i=0;i<=15;i++){
|
|
1c6: c0 31 cpi r28, 0x10 ; 16
|
|
1c8: a1 f7 brne .-24 ; 0x1b2 <lcd_write_text+0x34>
|
|
if(text[i] != 0x5F){
|
|
lcd_write(row, text[i], 0+i);
|
|
}
|
|
lcd_5ms();
|
|
}
|
|
}
|
|
1ca: cf 91 pop r28
|
|
1cc: 1f 91 pop r17
|
|
1ce: 0f 91 pop r16
|
|
1d0: ff 90 pop r15
|
|
1d2: ef 90 pop r14
|
|
1d4: 08 95 ret
|
|
|
|
000001d6 <button_clicked>:
|
|
|
|
int button_clicked(int button)
|
|
{
|
|
if(((PIND & 0x03) == button+1) != ((flags & (1<<button))>0)){
|
|
1d6: 20 b3 in r18, 0x10 ; 16
|
|
1d8: bc 01 movw r22, r24
|
|
1da: 6f 5f subi r22, 0xFF ; 255
|
|
1dc: 7f 4f sbci r23, 0xFF ; 255
|
|
1de: 40 91 bb 00 lds r20, 0x00BB ; 0x8000bb <flags>
|
|
1e2: e1 e0 ldi r30, 0x01 ; 1
|
|
1e4: f0 e0 ldi r31, 0x00 ; 0
|
|
1e6: df 01 movw r26, r30
|
|
1e8: 02 c0 rjmp .+4 ; 0x1ee <button_clicked+0x18>
|
|
1ea: aa 0f add r26, r26
|
|
1ec: bb 1f adc r27, r27
|
|
1ee: 8a 95 dec r24
|
|
1f0: e2 f7 brpl .-8 ; 0x1ea <button_clicked+0x14>
|
|
1f2: cd 01 movw r24, r26
|
|
1f4: 23 70 andi r18, 0x03 ; 3
|
|
1f6: 30 e0 ldi r19, 0x00 ; 0
|
|
1f8: 51 e0 ldi r21, 0x01 ; 1
|
|
1fa: 26 17 cp r18, r22
|
|
1fc: 37 07 cpc r19, r23
|
|
1fe: 09 f0 breq .+2 ; 0x202 <button_clicked+0x2c>
|
|
200: 50 e0 ldi r21, 0x00 ; 0
|
|
202: 24 2f mov r18, r20
|
|
204: 30 e0 ldi r19, 0x00 ; 0
|
|
206: 28 23 and r18, r24
|
|
208: 39 23 and r19, r25
|
|
20a: e1 e0 ldi r30, 0x01 ; 1
|
|
20c: 12 16 cp r1, r18
|
|
20e: 13 06 cpc r1, r19
|
|
210: 0c f0 brlt .+2 ; 0x214 <button_clicked+0x3e>
|
|
212: e0 e0 ldi r30, 0x00 ; 0
|
|
214: 5e 17 cp r21, r30
|
|
216: 99 f0 breq .+38 ; 0x23e <button_clicked+0x68>
|
|
//if the pin is not equal to the stored state -> was pressed or released
|
|
//check is the button has been pressed or released
|
|
if((PIND & 0x03) == button+1){
|
|
218: 20 b3 in r18, 0x10 ; 16
|
|
21a: 23 70 andi r18, 0x03 ; 3
|
|
21c: 30 e0 ldi r19, 0x00 ; 0
|
|
21e: 62 17 cp r22, r18
|
|
220: 73 07 cpc r23, r19
|
|
222: 31 f4 brne .+12 ; 0x230 <button_clicked+0x5a>
|
|
//button is high -> pressed
|
|
flags |= (1<<button); //set bit
|
|
224: 84 2b or r24, r20
|
|
226: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <flags>
|
|
return(1);
|
|
22a: 81 e0 ldi r24, 0x01 ; 1
|
|
22c: 90 e0 ldi r25, 0x00 ; 0
|
|
22e: 08 95 ret
|
|
}
|
|
else{
|
|
//button is low -> released
|
|
flags &= ~(1<<button); //delete bit
|
|
230: 80 95 com r24
|
|
232: 48 23 and r20, r24
|
|
234: 40 93 bb 00 sts 0x00BB, r20 ; 0x8000bb <flags>
|
|
return(0);
|
|
238: 80 e0 ldi r24, 0x00 ; 0
|
|
23a: 90 e0 ldi r25, 0x00 ; 0
|
|
23c: 08 95 ret
|
|
}
|
|
}
|
|
return(0);
|
|
23e: 80 e0 ldi r24, 0x00 ; 0
|
|
240: 90 e0 ldi r25, 0x00 ; 0
|
|
}
|
|
242: 08 95 ret
|
|
|
|
00000244 <main>:
|
|
//counter++;
|
|
TCNT1 = 63974;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
244: cf 93 push r28
|
|
246: df 93 push r29
|
|
248: cd b7 in r28, 0x3d ; 61
|
|
24a: dd 27 eor r29, r29
|
|
24c: c0 54 subi r28, 0x40 ; 64
|
|
24e: cd bf out 0x3d, r28 ; 61
|
|
DDRD = 0x00;
|
|
250: 11 ba out 0x11, r1 ; 17
|
|
|
|
TCNT1 = 63974; // for 1 sec at 16 MHz
|
|
252: 86 ee ldi r24, 0xE6 ; 230
|
|
254: 99 ef ldi r25, 0xF9 ; 249
|
|
256: 9d bd out 0x2d, r25 ; 45
|
|
258: 8c bd out 0x2c, r24 ; 44
|
|
|
|
TCCR1A = 0x00;
|
|
25a: 1f bc out 0x2f, r1 ; 47
|
|
TCCR1B = (1<<CS10) | (1<<CS12);; // Timer mode with 1024 prescaler
|
|
25c: 85 e0 ldi r24, 0x05 ; 5
|
|
25e: 8e bd out 0x2e, r24 ; 46
|
|
TIMSK = (1 << TOIE1) ; // Enable timer1 overflow interrupt(TOIE1)
|
|
260: 80 e8 ldi r24, 0x80 ; 128
|
|
262: 89 bf out 0x39, r24 ; 57
|
|
sei(); // Enable global interrupts by setting global interrupt enable bit in SREG
|
|
264: 78 94 sei
|
|
else if(button_clicked(butt3)){
|
|
counter += 3;
|
|
}
|
|
|
|
|
|
t1[0] = counter + 48;
|
|
266: 0f 2e mov r0, r31
|
|
268: f2 e6 ldi r31, 0x62 ; 98
|
|
26a: ef 2e mov r14, r31
|
|
26c: f0 e0 ldi r31, 0x00 ; 0
|
|
26e: ff 2e mov r15, r31
|
|
270: f0 2d mov r31, r0
|
|
272: 06 eb ldi r16, 0xB6 ; 182
|
|
274: 10 e0 ldi r17, 0x00 ; 0
|
|
lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ',' ','t','i','m','e',' ',' ',' ',' ',' ',' '});
|
|
update_display = 0;
|
|
}
|
|
|
|
if(button_clicked(butt1)){
|
|
clock_new_state = CLOCK_ALARM;
|
|
276: 68 94 set
|
|
278: dd 24 eor r13, r13
|
|
27a: d1 f8 bld r13, 1
|
|
sei(); // Enable global interrupts by setting global interrupt enable bit in SREG
|
|
|
|
/* Replace with your application code */
|
|
while (1)
|
|
{
|
|
if(clock_state != clock_new_state){
|
|
27c: 90 91 b9 00 lds r25, 0x00B9 ; 0x8000b9 <clock_state>
|
|
280: 80 91 b8 00 lds r24, 0x00B8 ; 0x8000b8 <clock_new_state>
|
|
284: 98 17 cp r25, r24
|
|
286: 99 f0 breq .+38 ; 0x2ae <main+0x6a>
|
|
clock_state = clock_new_state;
|
|
288: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <clock_state>
|
|
clock_state_changed = 1;
|
|
28c: 21 e0 ldi r18, 0x01 ; 1
|
|
28e: 30 e0 ldi r19, 0x00 ; 0
|
|
290: 30 93 b5 00 sts 0x00B5, r19 ; 0x8000b5 <__data_end+0x1>
|
|
294: 20 93 b4 00 sts 0x00B4, r18 ; 0x8000b4 <__data_end>
|
|
update_display = 1;
|
|
298: 30 93 61 00 sts 0x0061, r19 ; 0x800061 <__data_start+0x1>
|
|
29c: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__data_start>
|
|
else {
|
|
clock_state_changed = 0;
|
|
}
|
|
|
|
|
|
switch(clock_state){
|
|
2a0: 81 30 cpi r24, 0x01 ; 1
|
|
2a2: f1 f0 breq .+60 ; 0x2e0 <main+0x9c>
|
|
2a4: 78 f0 brcs .+30 ; 0x2c4 <main+0x80>
|
|
2a6: 82 30 cpi r24, 0x02 ; 2
|
|
2a8: 09 f4 brne .+2 ; 0x2ac <main+0x68>
|
|
2aa: 6d c0 rjmp .+218 ; 0x386 <main+0x142>
|
|
2ac: e7 cf rjmp .-50 ; 0x27c <main+0x38>
|
|
clock_state = clock_new_state;
|
|
clock_state_changed = 1;
|
|
update_display = 1;
|
|
}
|
|
else {
|
|
clock_state_changed = 0;
|
|
2ae: 10 92 b5 00 sts 0x00B5, r1 ; 0x8000b5 <__data_end+0x1>
|
|
2b2: 10 92 b4 00 sts 0x00B4, r1 ; 0x8000b4 <__data_end>
|
|
}
|
|
|
|
|
|
switch(clock_state){
|
|
2b6: 91 30 cpi r25, 0x01 ; 1
|
|
2b8: 69 f0 breq .+26 ; 0x2d4 <main+0x90>
|
|
2ba: 20 f0 brcs .+8 ; 0x2c4 <main+0x80>
|
|
2bc: 92 30 cpi r25, 0x02 ; 2
|
|
2be: 09 f4 brne .+2 ; 0x2c2 <main+0x7e>
|
|
2c0: 62 c0 rjmp .+196 ; 0x386 <main+0x142>
|
|
2c2: dc cf rjmp .-72 ; 0x27c <main+0x38>
|
|
case CLOCK_INIT:
|
|
//do some init stuff...
|
|
lcd_init();
|
|
2c4: 12 df rcall .-476 ; 0xea <lcd_init>
|
|
lcd_5ms();
|
|
2c6: cb de rcall .-618 ; 0x5e <lcd_5ms>
|
|
lcd_instruct(lcd_DISPLAY_CLEAR);
|
|
2c8: 81 e0 ldi r24, 0x01 ; 1
|
|
2ca: 0a df rcall .-492 ; 0xe0 <lcd_instruct>
|
|
//INIT done -> change to IDLE
|
|
clock_new_state = CLOCK_IDLE;
|
|
2cc: 81 e0 ldi r24, 0x01 ; 1
|
|
2ce: 80 93 b8 00 sts 0x00B8, r24 ; 0x8000b8 <clock_new_state>
|
|
|
|
break;
|
|
2d2: d4 cf rjmp .-88 ; 0x27c <main+0x38>
|
|
case CLOCK_IDLE:
|
|
//IDLE MODE
|
|
|
|
//print the IDLE Screen
|
|
|
|
if(update_display){
|
|
2d4: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__data_start>
|
|
2d8: 90 91 61 00 lds r25, 0x0061 ; 0x800061 <__data_start+0x1>
|
|
2dc: 89 2b or r24, r25
|
|
2de: 41 f1 breq .+80 ; 0x330 <main+0xec>
|
|
lcd_5ms();
|
|
2e0: be de rcall .-644 ; 0x5e <lcd_5ms>
|
|
lcd_write_text(0,0,(uint8_t []){'_','_','_','_','_','_','t','i','m','e','_','_','_','_','_','_'});
|
|
2e2: 80 e1 ldi r24, 0x10 ; 16
|
|
2e4: e3 e7 ldi r30, 0x73 ; 115
|
|
2e6: f0 e0 ldi r31, 0x00 ; 0
|
|
2e8: de 01 movw r26, r28
|
|
2ea: d1 96 adiw r26, 0x31 ; 49
|
|
2ec: 01 90 ld r0, Z+
|
|
2ee: 0d 92 st X+, r0
|
|
2f0: 8a 95 dec r24
|
|
2f2: e1 f7 brne .-8 ; 0x2ec <main+0xa8>
|
|
2f4: ae 01 movw r20, r28
|
|
2f6: 4f 5c subi r20, 0xCF ; 207
|
|
2f8: 5f 4f sbci r21, 0xFF ; 255
|
|
2fa: 60 e0 ldi r22, 0x00 ; 0
|
|
2fc: 70 e0 ldi r23, 0x00 ; 0
|
|
2fe: 80 e0 ldi r24, 0x00 ; 0
|
|
300: 90 e0 ldi r25, 0x00 ; 0
|
|
302: 3d df rcall .-390 ; 0x17e <lcd_write_text>
|
|
lcd_5ms();
|
|
304: ac de rcall .-680 ; 0x5e <lcd_5ms>
|
|
lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ',' ','t','i','m','e',' ',' ',' ',' ',' ',' '});
|
|
306: 80 e1 ldi r24, 0x10 ; 16
|
|
308: e3 e8 ldi r30, 0x83 ; 131
|
|
30a: f0 e0 ldi r31, 0x00 ; 0
|
|
30c: de 01 movw r26, r28
|
|
30e: 91 96 adiw r26, 0x21 ; 33
|
|
310: 01 90 ld r0, Z+
|
|
312: 0d 92 st X+, r0
|
|
314: 8a 95 dec r24
|
|
316: e1 f7 brne .-8 ; 0x310 <main+0xcc>
|
|
318: ae 01 movw r20, r28
|
|
31a: 4f 5d subi r20, 0xDF ; 223
|
|
31c: 5f 4f sbci r21, 0xFF ; 255
|
|
31e: 60 e0 ldi r22, 0x00 ; 0
|
|
320: 70 e0 ldi r23, 0x00 ; 0
|
|
322: 81 e0 ldi r24, 0x01 ; 1
|
|
324: 90 e0 ldi r25, 0x00 ; 0
|
|
326: 2b df rcall .-426 ; 0x17e <lcd_write_text>
|
|
update_display = 0;
|
|
328: 10 92 61 00 sts 0x0061, r1 ; 0x800061 <__data_start+0x1>
|
|
32c: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__data_start>
|
|
}
|
|
|
|
if(button_clicked(butt1)){
|
|
330: 80 e0 ldi r24, 0x00 ; 0
|
|
332: 90 e0 ldi r25, 0x00 ; 0
|
|
334: 50 df rcall .-352 ; 0x1d6 <button_clicked>
|
|
336: 89 2b or r24, r25
|
|
338: 19 f0 breq .+6 ; 0x340 <main+0xfc>
|
|
clock_new_state = CLOCK_ALARM;
|
|
33a: d0 92 b8 00 sts 0x00B8, r13 ; 0x8000b8 <clock_new_state>
|
|
33e: 1d c0 rjmp .+58 ; 0x37a <main+0x136>
|
|
}
|
|
else if(button_clicked(butt2)){
|
|
340: 81 e0 ldi r24, 0x01 ; 1
|
|
342: 90 e0 ldi r25, 0x00 ; 0
|
|
344: 48 df rcall .-368 ; 0x1d6 <button_clicked>
|
|
346: 89 2b or r24, r25
|
|
348: 51 f0 breq .+20 ; 0x35e <main+0x11a>
|
|
counter += 2;
|
|
34a: 80 91 b6 00 lds r24, 0x00B6 ; 0x8000b6 <counter>
|
|
34e: 90 91 b7 00 lds r25, 0x00B7 ; 0x8000b7 <counter+0x1>
|
|
352: 02 96 adiw r24, 0x02 ; 2
|
|
354: 90 93 b7 00 sts 0x00B7, r25 ; 0x8000b7 <counter+0x1>
|
|
358: 80 93 b6 00 sts 0x00B6, r24 ; 0x8000b6 <counter>
|
|
35c: 0e c0 rjmp .+28 ; 0x37a <main+0x136>
|
|
}
|
|
else if(button_clicked(butt3)){
|
|
35e: 82 e0 ldi r24, 0x02 ; 2
|
|
360: 90 e0 ldi r25, 0x00 ; 0
|
|
362: 39 df rcall .-398 ; 0x1d6 <button_clicked>
|
|
364: 89 2b or r24, r25
|
|
366: 49 f0 breq .+18 ; 0x37a <main+0x136>
|
|
counter += 3;
|
|
368: 80 91 b6 00 lds r24, 0x00B6 ; 0x8000b6 <counter>
|
|
36c: 90 91 b7 00 lds r25, 0x00B7 ; 0x8000b7 <counter+0x1>
|
|
370: 03 96 adiw r24, 0x03 ; 3
|
|
372: 90 93 b7 00 sts 0x00B7, r25 ; 0x8000b7 <counter+0x1>
|
|
376: 80 93 b6 00 sts 0x00B6, r24 ; 0x8000b6 <counter>
|
|
}
|
|
|
|
|
|
t1[0] = counter + 48;
|
|
37a: f8 01 movw r30, r16
|
|
37c: 80 81 ld r24, Z
|
|
37e: 80 5d subi r24, 0xD0 ; 208
|
|
380: f7 01 movw r30, r14
|
|
382: 80 83 st Z, r24
|
|
|
|
break;
|
|
384: 7b cf rjmp .-266 ; 0x27c <main+0x38>
|
|
|
|
case CLOCK_ALARM:
|
|
//ALARM setup Mode
|
|
//print the ALARM screen
|
|
if(update_display){
|
|
386: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__data_start>
|
|
38a: 90 91 61 00 lds r25, 0x0061 ; 0x800061 <__data_start+0x1>
|
|
38e: 89 2b or r24, r25
|
|
390: 09 f4 brne .+2 ; 0x394 <main+0x150>
|
|
392: 74 cf rjmp .-280 ; 0x27c <main+0x38>
|
|
lcd_write_text(0,0,(uint8_t []){' ',' ','[','a','l','a','r','m',' ','t','i','m','e',']',' ',' '});
|
|
394: 80 e1 ldi r24, 0x10 ; 16
|
|
396: e3 e9 ldi r30, 0x93 ; 147
|
|
398: f0 e0 ldi r31, 0x00 ; 0
|
|
39a: de 01 movw r26, r28
|
|
39c: 51 96 adiw r26, 0x11 ; 17
|
|
39e: 01 90 ld r0, Z+
|
|
3a0: 0d 92 st X+, r0
|
|
3a2: 8a 95 dec r24
|
|
3a4: e1 f7 brne .-8 ; 0x39e <main+0x15a>
|
|
3a6: ae 01 movw r20, r28
|
|
3a8: 4f 5e subi r20, 0xEF ; 239
|
|
3aa: 5f 4f sbci r21, 0xFF ; 255
|
|
3ac: 60 e0 ldi r22, 0x00 ; 0
|
|
3ae: 70 e0 ldi r23, 0x00 ; 0
|
|
3b0: 80 e0 ldi r24, 0x00 ; 0
|
|
3b2: 90 e0 ldi r25, 0x00 ; 0
|
|
3b4: e4 de rcall .-568 ; 0x17e <lcd_write_text>
|
|
lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ','a','l','a','r','m',' ','>',' ',' ',' ',' '});
|
|
3b6: 80 e1 ldi r24, 0x10 ; 16
|
|
3b8: e3 ea ldi r30, 0xA3 ; 163
|
|
3ba: f0 e0 ldi r31, 0x00 ; 0
|
|
3bc: de 01 movw r26, r28
|
|
3be: 11 96 adiw r26, 0x01 ; 1
|
|
3c0: 01 90 ld r0, Z+
|
|
3c2: 0d 92 st X+, r0
|
|
3c4: 8a 95 dec r24
|
|
3c6: e1 f7 brne .-8 ; 0x3c0 <main+0x17c>
|
|
3c8: ae 01 movw r20, r28
|
|
3ca: 4f 5f subi r20, 0xFF ; 255
|
|
3cc: 5f 4f sbci r21, 0xFF ; 255
|
|
3ce: 60 e0 ldi r22, 0x00 ; 0
|
|
3d0: 70 e0 ldi r23, 0x00 ; 0
|
|
3d2: 81 e0 ldi r24, 0x01 ; 1
|
|
3d4: 90 e0 ldi r25, 0x00 ; 0
|
|
3d6: d3 de rcall .-602 ; 0x17e <lcd_write_text>
|
|
update_display = 0;
|
|
3d8: 10 92 61 00 sts 0x0061, r1 ; 0x800061 <__data_start+0x1>
|
|
3dc: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__data_start>
|
|
3e0: 4d cf rjmp .-358 ; 0x27c <main+0x38>
|
|
|
|
000003e2 <_exit>:
|
|
3e2: f8 94 cli
|
|
|
|
000003e4 <__stop_program>:
|
|
3e4: ff cf rjmp .-2 ; 0x3e4 <__stop_program>
|