|
@@ -3,27 +3,27 @@ optiboot_atmega328_pro_8MHz.elf: file format elf32-avr
|
|
|
|
|
|
Sections:
|
|
|
Idx Name Size VMA LMA File off Algn
|
|
|
- 0 .text 000001e4 00007e00 00007e00 00000054 2**1
|
|
|
+ 0 .text 000001e6 00007e00 00007e00 00000054 2**1
|
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
|
- 1 .version 00000002 00007ffe 00007ffe 00000238 2**0
|
|
|
+ 1 .version 00000002 00007ffe 00007ffe 0000023a 2**0
|
|
|
CONTENTS, READONLY
|
|
|
- 2 .debug_aranges 00000028 00000000 00000000 0000023a 2**0
|
|
|
+ 2 .debug_aranges 00000028 00000000 00000000 0000023c 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 3 .debug_pubnames 0000005f 00000000 00000000 00000262 2**0
|
|
|
+ 3 .debug_pubnames 0000005f 00000000 00000000 00000264 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 4 .debug_info 0000027e 00000000 00000000 000002c1 2**0
|
|
|
+ 4 .debug_info 00000294 00000000 00000000 000002c3 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 5 .debug_abbrev 0000016b 00000000 00000000 0000053f 2**0
|
|
|
+ 5 .debug_abbrev 0000016b 00000000 00000000 00000557 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 6 .debug_line 00000468 00000000 00000000 000006aa 2**0
|
|
|
+ 6 .debug_line 00000470 00000000 00000000 000006c2 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 7 .debug_frame 00000080 00000000 00000000 00000b14 2**2
|
|
|
+ 7 .debug_frame 00000080 00000000 00000000 00000b34 2**2
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 8 .debug_str 00000128 00000000 00000000 00000b94 2**0
|
|
|
+ 8 .debug_str 00000131 00000000 00000000 00000bb4 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 9 .debug_loc 00000253 00000000 00000000 00000cbc 2**0
|
|
|
+ 9 .debug_loc 00000266 00000000 00000000 00000ce5 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
- 10 .debug_ranges 00000078 00000000 00000000 00000f0f 2**0
|
|
|
+ 10 .debug_ranges 00000078 00000000 00000000 00000f4b 2**0
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
|
|
|
Disassembly of section .text:
|
|
@@ -45,7 +45,7 @@ int main(void) {
|
|
|
7e02: 84 b7 in r24, 0x34 ; 52
|
|
|
MCUSR = 0;
|
|
|
7e04: 14 be out 0x34, r1 ; 52
|
|
|
- if (!(ch & _BV(EXTRF))) appStart();
|
|
|
+ if (!(ch & _BV(EXTRF))) appStart(ch);
|
|
|
7e06: 81 ff sbrs r24, 1
|
|
|
7e08: e8 d0 rcall .+464 ; 0x7fda <appStart>
|
|
|
|
|
@@ -568,15 +568,18 @@ void getNch(uint8_t count) {
|
|
|
7fd8: 08 95 ret
|
|
|
|
|
|
00007fda <appStart>:
|
|
|
- WDTCSR = _BV(WDCE) | _BV(WDE);
|
|
|
- WDTCSR = x;
|
|
|
-}
|
|
|
|
|
|
-void appStart() {
|
|
|
+void appStart(uint8_t rstFlags) {
|
|
|
+ // save the reset flags in the designated register
|
|
|
+ // This can be saved in a main program by putting code in .init0 (which
|
|
|
+ // executes before normal c init code) to save R2 to a global variable.
|
|
|
+ __asm__ __volatile__ ("mov r2, %0\n" :: "r" (rstFlags));
|
|
|
+ 7fda: 28 2e mov r2, r24
|
|
|
+
|
|
|
watchdogConfig(WATCHDOG_OFF);
|
|
|
- 7fda: 80 e0 ldi r24, 0x00 ; 0
|
|
|
- 7fdc: e8 df rcall .-48 ; 0x7fae <watchdogConfig>
|
|
|
+ 7fdc: 80 e0 ldi r24, 0x00 ; 0
|
|
|
+ 7fde: e7 df rcall .-50 ; 0x7fae <watchdogConfig>
|
|
|
__asm__ __volatile__ (
|
|
|
- 7fde: ee 27 eor r30, r30
|
|
|
- 7fe0: ff 27 eor r31, r31
|
|
|
- 7fe2: 09 94 ijmp
|
|
|
+ 7fe0: ee 27 eor r30, r30
|
|
|
+ 7fe2: ff 27 eor r31, r31
|
|
|
+ 7fe4: 09 94 ijmp
|