123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598 |
- optiboot_atmega168.elf: file format elf32-avr
- Sections:
- Idx Name Size VMA LMA File off Algn
- 0 .text 000001f0 00003e00 00003e00 00000074 2**1
- CONTENTS, ALLOC, LOAD, READONLY, CODE
- 1 .version 00000002 00003ffe 00003ffe 00000264 2**0
- CONTENTS, ALLOC, LOAD, DATA
- 2 .debug_aranges 00000028 00000000 00000000 00000266 2**0
- CONTENTS, READONLY, DEBUGGING
- 3 .debug_pubnames 00000074 00000000 00000000 0000028e 2**0
- CONTENTS, READONLY, DEBUGGING
- 4 .debug_info 000003db 00000000 00000000 00000302 2**0
- CONTENTS, READONLY, DEBUGGING
- 5 .debug_abbrev 000001ea 00000000 00000000 000006dd 2**0
- CONTENTS, READONLY, DEBUGGING
- 6 .debug_line 00000423 00000000 00000000 000008c7 2**0
- CONTENTS, READONLY, DEBUGGING
- 7 .debug_frame 00000080 00000000 00000000 00000cec 2**2
- CONTENTS, READONLY, DEBUGGING
- 8 .debug_str 00000172 00000000 00000000 00000d6c 2**0
- CONTENTS, READONLY, DEBUGGING
- 9 .debug_loc 000002d7 00000000 00000000 00000ede 2**0
- CONTENTS, READONLY, DEBUGGING
- 10 .debug_ranges 000000b8 00000000 00000000 000011b5 2**0
- CONTENTS, READONLY, DEBUGGING
- Disassembly of section .text:
- 00003e00 <main>:
- #define wdtVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+6))
- #endif
- /* main program starts here */
- int main(void) {
- 3e00: 11 24 eor r1, r1
- #if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__)
- SP=RAMEND; // This is done by hardware reset
- #endif
- // Adaboot no-wait mod
- ch = MCUSR;
- 3e02: 84 b7 in r24, 0x34 ; 52
- MCUSR = 0;
- 3e04: 14 be out 0x34, r1 ; 52
- if (!(ch & _BV(EXTRF))) appStart(ch);
- 3e06: 81 fd sbrc r24, 1
- 3e08: 01 c0 rjmp .+2 ; 0x3e0c <main+0xc>
- 3e0a: ec d0 rcall .+472 ; 0x3fe4 <appStart>
- #if LED_START_FLASHES > 0
- // Set up Timer 1 for timeout counter
- TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
- 3e0c: 85 e0 ldi r24, 0x05 ; 5
- 3e0e: 80 93 81 00 sts 0x0081, r24
- UCSRA = _BV(U2X); //Double speed mode USART
- UCSRB = _BV(RXEN) | _BV(TXEN); // enable Rx & Tx
- UCSRC = _BV(URSEL) | _BV(UCSZ1) | _BV(UCSZ0); // config USART; 8N1
- UBRRL = (uint8_t)( (F_CPU + BAUD_RATE * 4L) / (BAUD_RATE * 8L) - 1 );
- #else
- UART_SRA = _BV(U2X0); //Double speed mode USART0
- 3e12: 82 e0 ldi r24, 0x02 ; 2
- 3e14: 80 93 c0 00 sts 0x00C0, r24
- UART_SRB = _BV(RXEN0) | _BV(TXEN0);
- 3e18: 88 e1 ldi r24, 0x18 ; 24
- 3e1a: 80 93 c1 00 sts 0x00C1, r24
- UART_SRC = _BV(UCSZ00) | _BV(UCSZ01);
- 3e1e: 86 e0 ldi r24, 0x06 ; 6
- 3e20: 80 93 c2 00 sts 0x00C2, r24
- UART_SRL = (uint8_t)( (F_CPU + BAUD_RATE * 4L) / (BAUD_RATE * 8L) - 1 );
- 3e24: 88 e0 ldi r24, 0x08 ; 8
- 3e26: 80 93 c4 00 sts 0x00C4, r24
- #endif
- #endif
- // Set up watchdog to trigger after 500ms
- watchdogConfig(WATCHDOG_1S);
- 3e2a: 8e e0 ldi r24, 0x0E ; 14
- 3e2c: c5 d0 rcall .+394 ; 0x3fb8 <watchdogConfig>
- #if (LED_START_FLASHES > 0) || defined(LED_DATA_FLASH)
- /* Set LED pin as output */
- LED_DDR |= _BV(LED);
- 3e2e: 25 9a sbi 0x04, 5 ; 4
- 3e30: 86 e0 ldi r24, 0x06 ; 6
- }
- #if LED_START_FLASHES > 0
- void flash_led(uint8_t count) {
- do {
- TCNT1 = -(F_CPU/(1024*16));
- 3e32: 28 e1 ldi r18, 0x18 ; 24
- 3e34: 3e ef ldi r19, 0xFE ; 254
- TIFR1 = _BV(TOV1);
- 3e36: 91 e0 ldi r25, 0x01 ; 1
- }
- #if LED_START_FLASHES > 0
- void flash_led(uint8_t count) {
- do {
- TCNT1 = -(F_CPU/(1024*16));
- 3e38: 30 93 85 00 sts 0x0085, r19
- 3e3c: 20 93 84 00 sts 0x0084, r18
- TIFR1 = _BV(TOV1);
- 3e40: 96 bb out 0x16, r25 ; 22
- while(!(TIFR1 & _BV(TOV1)));
- 3e42: b0 9b sbis 0x16, 0 ; 22
- 3e44: fe cf rjmp .-4 ; 0x3e42 <main+0x42>
- #if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__)
- LED_PORT ^= _BV(LED);
- #else
- LED_PIN |= _BV(LED);
- 3e46: 1d 9a sbi 0x03, 5 ; 3
- }
- #endif
- // Watchdog functions. These are only safe with interrupts turned off.
- void watchdogReset() {
- __asm__ __volatile__ (
- 3e48: a8 95 wdr
- LED_PORT ^= _BV(LED);
- #else
- LED_PIN |= _BV(LED);
- #endif
- watchdogReset();
- } while (--count);
- 3e4a: 81 50 subi r24, 0x01 ; 1
- 3e4c: a9 f7 brne .-22 ; 0x3e38 <main+0x38>
- 3e4e: aa 24 eor r10, r10
- 3e50: bb 24 eor r11, r11
- * Start the page erase and wait for it to finish. There
- * used to be code to do this while receiving the data over
- * the serial link, but the performance improvement was slight,
- * and we needed the space back.
- */
- __boot_page_erase_short((uint16_t)(void*)address);
- 3e52: 33 e0 ldi r19, 0x03 ; 3
- 3e54: 83 2e mov r8, r19
- */
- do {
- uint16_t a;
- a = *bufPtr++;
- a |= (*bufPtr++) << 8;
- __boot_page_fill_short((uint16_t)(void*)addrPtr,a);
- 3e56: 77 24 eor r7, r7
- 3e58: 73 94 inc r7
- } while (len -= 2);
- /*
- * Actually Write the buffer to flash (and wait for it to finish.)
- */
- __boot_page_write_short((uint16_t)(void*)address);
- 3e5a: 25 e0 ldi r18, 0x05 ; 5
- 3e5c: 92 2e mov r9, r18
- boot_spm_busy_wait();
- #if defined(RWWSRE)
- // Reenable read access to flash
- boot_rww_enable();
- 3e5e: 91 e1 ldi r25, 0x11 ; 17
- 3e60: c9 2e mov r12, r25
- #endif
- /* Forever loop: exits by causing WDT reset */
- for (;;) {
- /* get character from UART */
- ch = getch();
- 3e62: 9e d0 rcall .+316 ; 0x3fa0 <getch>
- if(ch == STK_GET_PARAMETER) {
- 3e64: 81 34 cpi r24, 0x41 ; 65
- 3e66: 59 f4 brne .+22 ; 0x3e7e <main+0x7e>
- unsigned char which = getch();
- 3e68: 9b d0 rcall .+310 ; 0x3fa0 <getch>
- 3e6a: 18 2f mov r17, r24
- verifySpace();
- 3e6c: ab d0 rcall .+342 ; 0x3fc4 <verifySpace>
- if (which == 0x82) {
- 3e6e: 12 38 cpi r17, 0x82 ; 130
- 3e70: 21 f1 breq .+72 ; 0x3eba <main+0xba>
- /*
- * Send optiboot version as "minor SW version"
- */
- putch(OPTIBOOT_MINVER);
- } else if (which == 0x81) {
- 3e72: 11 38 cpi r17, 0x81 ; 129
- 3e74: 09 f4 brne .+2 ; 0x3e78 <main+0x78>
- 3e76: 82 c0 rjmp .+260 ; 0x3f7c <main+0x17c>
- } else {
- /*
- * GET PARAMETER returns a generic 0x03 reply for
- * other parameters - enough to keep Avrdude happy
- */
- putch(0x03);
- 3e78: 83 e0 ldi r24, 0x03 ; 3
- 3e7a: 8a d0 rcall .+276 ; 0x3f90 <putch>
- 3e7c: 86 c0 rjmp .+268 ; 0x3f8a <main+0x18a>
- }
- }
- else if(ch == STK_SET_DEVICE) {
- 3e7e: 82 34 cpi r24, 0x42 ; 66
- 3e80: 11 f4 brne .+4 ; 0x3e86 <main+0x86>
- // SET DEVICE is ignored
- getNch(20);
- 3e82: 84 e1 ldi r24, 0x14 ; 20
- 3e84: 03 c0 rjmp .+6 ; 0x3e8c <main+0x8c>
- }
- else if(ch == STK_SET_DEVICE_EXT) {
- 3e86: 85 34 cpi r24, 0x45 ; 69
- 3e88: 19 f4 brne .+6 ; 0x3e90 <main+0x90>
- // SET DEVICE EXT is ignored
- getNch(5);
- 3e8a: 85 e0 ldi r24, 0x05 ; 5
- 3e8c: a3 d0 rcall .+326 ; 0x3fd4 <getNch>
- 3e8e: 7d c0 rjmp .+250 ; 0x3f8a <main+0x18a>
- }
- else if(ch == STK_LOAD_ADDRESS) {
- 3e90: 85 35 cpi r24, 0x55 ; 85
- 3e92: 79 f4 brne .+30 ; 0x3eb2 <main+0xb2>
- // LOAD ADDRESS
- uint16_t newAddress;
- newAddress = getch();
- 3e94: 85 d0 rcall .+266 ; 0x3fa0 <getch>
- newAddress = (newAddress & 0xff) | (getch() << 8);
- 3e96: e8 2e mov r14, r24
- 3e98: ff 24 eor r15, r15
- 3e9a: 82 d0 rcall .+260 ; 0x3fa0 <getch>
- 3e9c: 08 2f mov r16, r24
- 3e9e: 10 e0 ldi r17, 0x00 ; 0
- 3ea0: 10 2f mov r17, r16
- 3ea2: 00 27 eor r16, r16
- 3ea4: 0e 29 or r16, r14
- 3ea6: 1f 29 or r17, r15
- #ifdef RAMPZ
- // Transfer top bit to RAMPZ
- RAMPZ = (newAddress & 0x8000) ? 1 : 0;
- #endif
- newAddress += newAddress; // Convert from word address to byte address
- 3ea8: 00 0f add r16, r16
- 3eaa: 11 1f adc r17, r17
- address = newAddress;
- verifySpace();
- 3eac: 8b d0 rcall .+278 ; 0x3fc4 <verifySpace>
- 3eae: 58 01 movw r10, r16
- 3eb0: 6c c0 rjmp .+216 ; 0x3f8a <main+0x18a>
- }
- else if(ch == STK_UNIVERSAL) {
- 3eb2: 86 35 cpi r24, 0x56 ; 86
- 3eb4: 21 f4 brne .+8 ; 0x3ebe <main+0xbe>
- // UNIVERSAL command is ignored
- getNch(4);
- 3eb6: 84 e0 ldi r24, 0x04 ; 4
- 3eb8: 8d d0 rcall .+282 ; 0x3fd4 <getNch>
- putch(0x00);
- 3eba: 80 e0 ldi r24, 0x00 ; 0
- 3ebc: de cf rjmp .-68 ; 0x3e7a <main+0x7a>
- }
- /* Write memory, length is big endian and is in bytes */
- else if(ch == STK_PROG_PAGE) {
- 3ebe: 84 36 cpi r24, 0x64 ; 100
- 3ec0: 09 f0 breq .+2 ; 0x3ec4 <main+0xc4>
- 3ec2: 41 c0 rjmp .+130 ; 0x3f46 <main+0x146>
- // PROGRAM PAGE - we support flash programming only, not EEPROM
- uint8_t desttype;
- uint8_t *bufPtr;
- uint16_t savelength;
- length = getch()<<8; /* getlen() */
- 3ec4: 6d d0 rcall .+218 ; 0x3fa0 <getch>
- 3ec6: 90 e0 ldi r25, 0x00 ; 0
- 3ec8: 18 2f mov r17, r24
- 3eca: 00 27 eor r16, r16
- length |= getch();
- 3ecc: 69 d0 rcall .+210 ; 0x3fa0 <getch>
- 3ece: 90 e0 ldi r25, 0x00 ; 0
- 3ed0: 08 2b or r16, r24
- 3ed2: 19 2b or r17, r25
- savelength = length;
- desttype = getch();
- 3ed4: 65 d0 rcall .+202 ; 0x3fa0 <getch>
- 3ed6: d8 2e mov r13, r24
- 3ed8: e8 01 movw r28, r16
- 3eda: e1 2c mov r14, r1
- 3edc: f1 e0 ldi r31, 0x01 ; 1
- 3ede: ff 2e mov r15, r31
- // read a page worth of contents
- bufPtr = buff;
- do *bufPtr++ = getch();
- 3ee0: 5f d0 rcall .+190 ; 0x3fa0 <getch>
- 3ee2: f7 01 movw r30, r14
- 3ee4: 81 93 st Z+, r24
- 3ee6: 7f 01 movw r14, r30
- while (--length);
- 3ee8: 21 97 sbiw r28, 0x01 ; 1
- 3eea: d1 f7 brne .-12 ; 0x3ee0 <main+0xe0>
- // Read command terminator, start reply
- verifySpace();
- 3eec: 6b d0 rcall .+214 ; 0x3fc4 <verifySpace>
- * void writebuffer(memtype, buffer, address, length)
- */
- static inline void writebuffer(int8_t memtype, uint8_t *mybuff,
- uint16_t address, uint16_t len)
- {
- switch (memtype) {
- 3eee: f5 e4 ldi r31, 0x45 ; 69
- 3ef0: df 16 cp r13, r31
- 3ef2: 09 f4 brne .+2 ; 0x3ef6 <main+0xf6>
- 3ef4: ff cf rjmp .-2 ; 0x3ef4 <main+0xf4>
- * Start the page erase and wait for it to finish. There
- * used to be code to do this while receiving the data over
- * the serial link, but the performance improvement was slight,
- * and we needed the space back.
- */
- __boot_page_erase_short((uint16_t)(void*)address);
- 3ef6: f5 01 movw r30, r10
- 3ef8: 87 be out 0x37, r8 ; 55
- 3efa: e8 95 spm
- boot_spm_busy_wait();
- 3efc: 07 b6 in r0, 0x37 ; 55
- 3efe: 00 fc sbrc r0, 0
- 3f00: fd cf rjmp .-6 ; 0x3efc <main+0xfc>
- 3f02: b5 01 movw r22, r10
- 3f04: a8 01 movw r20, r16
- 3f06: a0 e0 ldi r26, 0x00 ; 0
- 3f08: b1 e0 ldi r27, 0x01 ; 1
- /*
- * Copy data from the buffer into the flash write buffer.
- */
- do {
- uint16_t a;
- a = *bufPtr++;
- 3f0a: 2c 91 ld r18, X
- 3f0c: 30 e0 ldi r19, 0x00 ; 0
- a |= (*bufPtr++) << 8;
- 3f0e: 11 96 adiw r26, 0x01 ; 1
- 3f10: 8c 91 ld r24, X
- 3f12: 11 97 sbiw r26, 0x01 ; 1
- 3f14: 90 e0 ldi r25, 0x00 ; 0
- 3f16: 98 2f mov r25, r24
- 3f18: 88 27 eor r24, r24
- 3f1a: 82 2b or r24, r18
- 3f1c: 93 2b or r25, r19
- #define wdtVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+6))
- #endif
- /* main program starts here */
- int main(void) {
- 3f1e: 12 96 adiw r26, 0x02 ; 2
- */
- do {
- uint16_t a;
- a = *bufPtr++;
- a |= (*bufPtr++) << 8;
- __boot_page_fill_short((uint16_t)(void*)addrPtr,a);
- 3f20: fb 01 movw r30, r22
- 3f22: 0c 01 movw r0, r24
- 3f24: 77 be out 0x37, r7 ; 55
- 3f26: e8 95 spm
- 3f28: 11 24 eor r1, r1
- addrPtr += 2;
- 3f2a: 6e 5f subi r22, 0xFE ; 254
- 3f2c: 7f 4f sbci r23, 0xFF ; 255
- } while (len -= 2);
- 3f2e: 42 50 subi r20, 0x02 ; 2
- 3f30: 50 40 sbci r21, 0x00 ; 0
- 3f32: 59 f7 brne .-42 ; 0x3f0a <main+0x10a>
- /*
- * Actually Write the buffer to flash (and wait for it to finish.)
- */
- __boot_page_write_short((uint16_t)(void*)address);
- 3f34: f5 01 movw r30, r10
- 3f36: 97 be out 0x37, r9 ; 55
- 3f38: e8 95 spm
- boot_spm_busy_wait();
- 3f3a: 07 b6 in r0, 0x37 ; 55
- 3f3c: 00 fc sbrc r0, 0
- 3f3e: fd cf rjmp .-6 ; 0x3f3a <main+0x13a>
- #if defined(RWWSRE)
- // Reenable read access to flash
- boot_rww_enable();
- 3f40: c7 be out 0x37, r12 ; 55
- 3f42: e8 95 spm
- 3f44: 22 c0 rjmp .+68 ; 0x3f8a <main+0x18a>
- writebuffer(desttype, buff, address, savelength);
- }
- /* Read memory block mode, length is big endian. */
- else if(ch == STK_READ_PAGE) {
- 3f46: 84 37 cpi r24, 0x74 ; 116
- 3f48: 91 f4 brne .+36 ; 0x3f6e <main+0x16e>
- uint8_t desttype;
- length = getch()<<8; /* getlen() */
- 3f4a: 2a d0 rcall .+84 ; 0x3fa0 <getch>
- 3f4c: 90 e0 ldi r25, 0x00 ; 0
- 3f4e: d8 2f mov r29, r24
- 3f50: cc 27 eor r28, r28
- length |= getch();
- 3f52: 26 d0 rcall .+76 ; 0x3fa0 <getch>
- 3f54: 90 e0 ldi r25, 0x00 ; 0
- 3f56: c8 2b or r28, r24
- 3f58: d9 2b or r29, r25
- desttype = getch();
- 3f5a: 22 d0 rcall .+68 ; 0x3fa0 <getch>
- verifySpace();
- 3f5c: 33 d0 rcall .+102 ; 0x3fc4 <verifySpace>
- 3f5e: 85 01 movw r16, r10
- __asm__ ("elpm %0,Z+\n" : "=r" (ch), "=z" (address): "1" (address));
- #else
- // read a Flash byte and increment the address
- __asm__ ("lpm %0,Z+\n" : "=r" (ch), "=z" (address): "1" (address));
- #endif
- putch(ch);
- 3f60: f8 01 movw r30, r16
- 3f62: 85 91 lpm r24, Z+
- 3f64: 8f 01 movw r16, r30
- 3f66: 14 d0 rcall .+40 ; 0x3f90 <putch>
- } while (--length);
- 3f68: 21 97 sbiw r28, 0x01 ; 1
- 3f6a: d1 f7 brne .-12 ; 0x3f60 <main+0x160>
- 3f6c: 0e c0 rjmp .+28 ; 0x3f8a <main+0x18a>
-
- read_mem(desttype, address, length);
- }
- /* Get device signature bytes */
- else if(ch == STK_READ_SIGN) {
- 3f6e: 85 37 cpi r24, 0x75 ; 117
- 3f70: 39 f4 brne .+14 ; 0x3f80 <main+0x180>
- // READ SIGN - return what Avrdude wants to hear
- verifySpace();
- 3f72: 28 d0 rcall .+80 ; 0x3fc4 <verifySpace>
- putch(SIGNATURE_0);
- 3f74: 8e e1 ldi r24, 0x1E ; 30
- 3f76: 0c d0 rcall .+24 ; 0x3f90 <putch>
- putch(SIGNATURE_1);
- 3f78: 84 e9 ldi r24, 0x94 ; 148
- 3f7a: 0a d0 rcall .+20 ; 0x3f90 <putch>
- putch(SIGNATURE_2);
- 3f7c: 86 e0 ldi r24, 0x06 ; 6
- 3f7e: 7d cf rjmp .-262 ; 0x3e7a <main+0x7a>
- }
- else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
- 3f80: 81 35 cpi r24, 0x51 ; 81
- 3f82: 11 f4 brne .+4 ; 0x3f88 <main+0x188>
- // Adaboot no-wait mod
- watchdogConfig(WATCHDOG_16MS);
- 3f84: 88 e0 ldi r24, 0x08 ; 8
- 3f86: 18 d0 rcall .+48 ; 0x3fb8 <watchdogConfig>
- verifySpace();
- }
- else {
- // This covers the response to commands like STK_ENTER_PROGMODE
- verifySpace();
- 3f88: 1d d0 rcall .+58 ; 0x3fc4 <verifySpace>
- }
- putch(STK_OK);
- 3f8a: 80 e1 ldi r24, 0x10 ; 16
- 3f8c: 01 d0 rcall .+2 ; 0x3f90 <putch>
- 3f8e: 69 cf rjmp .-302 ; 0x3e62 <main+0x62>
- 00003f90 <putch>:
- }
- }
- void putch(char ch) {
- 3f90: 98 2f mov r25, r24
- #ifndef SOFT_UART
- while (!(UART_SRA & _BV(UDRE0)));
- 3f92: 80 91 c0 00 lds r24, 0x00C0
- 3f96: 85 ff sbrs r24, 5
- 3f98: fc cf rjmp .-8 ; 0x3f92 <putch+0x2>
- UART_UDR = ch;
- 3f9a: 90 93 c6 00 sts 0x00C6, r25
- [uartBit] "I" (UART_TX_BIT)
- :
- "r25"
- );
- #endif
- }
- 3f9e: 08 95 ret
- 00003fa0 <getch>:
- [uartBit] "I" (UART_RX_BIT)
- :
- "r25"
- );
- #else
- while(!(UART_SRA & _BV(RXC0)))
- 3fa0: 80 91 c0 00 lds r24, 0x00C0
- 3fa4: 87 ff sbrs r24, 7
- 3fa6: fc cf rjmp .-8 ; 0x3fa0 <getch>
- ;
- if (!(UART_SRA & _BV(FE0))) {
- 3fa8: 80 91 c0 00 lds r24, 0x00C0
- 3fac: 84 fd sbrc r24, 4
- 3fae: 01 c0 rjmp .+2 ; 0x3fb2 <getch+0x12>
- }
- #endif
- // Watchdog functions. These are only safe with interrupts turned off.
- void watchdogReset() {
- __asm__ __volatile__ (
- 3fb0: a8 95 wdr
- * don't care that an invalid char is returned...)
- */
- watchdogReset();
- }
-
- ch = UART_UDR;
- 3fb2: 80 91 c6 00 lds r24, 0x00C6
- LED_PIN |= _BV(LED);
- #endif
- #endif
- return ch;
- }
- 3fb6: 08 95 ret
- 00003fb8 <watchdogConfig>:
- "wdr\n"
- );
- }
- void watchdogConfig(uint8_t x) {
- WDTCSR = _BV(WDCE) | _BV(WDE);
- 3fb8: e0 e6 ldi r30, 0x60 ; 96
- 3fba: f0 e0 ldi r31, 0x00 ; 0
- 3fbc: 98 e1 ldi r25, 0x18 ; 24
- 3fbe: 90 83 st Z, r25
- WDTCSR = x;
- 3fc0: 80 83 st Z, r24
- }
- 3fc2: 08 95 ret
- 00003fc4 <verifySpace>:
- do getch(); while (--count);
- verifySpace();
- }
- void verifySpace() {
- if (getch() != CRC_EOP) {
- 3fc4: ed df rcall .-38 ; 0x3fa0 <getch>
- 3fc6: 80 32 cpi r24, 0x20 ; 32
- 3fc8: 19 f0 breq .+6 ; 0x3fd0 <verifySpace+0xc>
- watchdogConfig(WATCHDOG_16MS); // shorten WD timeout
- 3fca: 88 e0 ldi r24, 0x08 ; 8
- 3fcc: f5 df rcall .-22 ; 0x3fb8 <watchdogConfig>
- 3fce: ff cf rjmp .-2 ; 0x3fce <verifySpace+0xa>
- while (1) // and busy-loop so that WD causes
- ; // a reset and app start.
- }
- putch(STK_INSYNC);
- 3fd0: 84 e1 ldi r24, 0x14 ; 20
- }
- 3fd2: de cf rjmp .-68 ; 0x3f90 <putch>
- 00003fd4 <getNch>:
- ::[count] "M" (UART_B_VALUE)
- );
- }
- #endif
- void getNch(uint8_t count) {
- 3fd4: 1f 93 push r17
- 3fd6: 18 2f mov r17, r24
- do getch(); while (--count);
- 3fd8: e3 df rcall .-58 ; 0x3fa0 <getch>
- 3fda: 11 50 subi r17, 0x01 ; 1
- 3fdc: e9 f7 brne .-6 ; 0x3fd8 <getNch+0x4>
- verifySpace();
- 3fde: f2 df rcall .-28 ; 0x3fc4 <verifySpace>
- }
- 3fe0: 1f 91 pop r17
- 3fe2: 08 95 ret
- 00003fe4 <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));
- 3fe4: 28 2e mov r2, r24
- watchdogConfig(WATCHDOG_OFF);
- 3fe6: 80 e0 ldi r24, 0x00 ; 0
- 3fe8: e7 df rcall .-50 ; 0x3fb8 <watchdogConfig>
- __asm__ __volatile__ (
- 3fea: ee 27 eor r30, r30
- 3fec: ff 27 eor r31, r31
- 3fee: 09 94 ijmp
|