2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
optiboot_luminet.elf: file format elf32-avr
|
|
|
|
|
|
|
|
Sections:
|
|
|
|
Idx Name Size VMA LMA File off Algn
|
2011-06-13 19:07:07 -07:00
|
|
|
0 .text 00000242 00001d00 00001d00 00000054 2**1
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
2011-06-13 19:07:07 -07:00
|
|
|
1 .version 00000002 00001efe 00001efe 00000296 2**0
|
2011-06-11 03:17:38 -07:00
|
|
|
CONTENTS, READONLY
|
2011-06-13 19:07:07 -07:00
|
|
|
2 .debug_aranges 00000028 00000000 00000000 00000298 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
3 .debug_pubnames 0000006d 00000000 00000000 000002c0 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
4 .debug_info 000002a2 00000000 00000000 0000032d 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
5 .debug_abbrev 0000016f 00000000 00000000 000005cf 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
6 .debug_line 0000049d 00000000 00000000 0000073e 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
7 .debug_frame 00000090 00000000 00000000 00000bdc 2**2
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
8 .debug_str 00000158 00000000 00000000 00000c6c 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
9 .debug_loc 00000268 00000000 00000000 00000dc4 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
2011-06-13 19:07:07 -07:00
|
|
|
10 .debug_ranges 00000080 00000000 00000000 0000102c 2**0
|
2010-09-22 09:04:33 -04:00
|
|
|
CONTENTS, READONLY, DEBUGGING
|
|
|
|
|
|
|
|
Disassembly of section .text:
|
|
|
|
|
2011-06-11 03:17:38 -07:00
|
|
|
00001d00 <main>:
|
2011-06-10 16:17:13 -07:00
|
|
|
#define rstVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+4))
|
|
|
|
#define wdtVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+6))
|
2010-09-22 09:04:33 -04:00
|
|
|
#endif
|
2011-06-10 16:17:13 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
/* main program starts here */
|
|
|
|
int main(void) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d00: 11 24 eor r1, r1
|
2011-06-10 16:17:13 -07:00
|
|
|
#ifdef __AVR_ATmega8__
|
|
|
|
SP=RAMEND; // This is done by hardware reset
|
2010-09-22 09:04:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Adaboot no-wait mod
|
|
|
|
ch = MCUSR;
|
2011-06-11 03:17:38 -07:00
|
|
|
1d02: 84 b7 in r24, 0x34 ; 52
|
2010-09-22 09:04:33 -04:00
|
|
|
MCUSR = 0;
|
2011-06-11 03:17:38 -07:00
|
|
|
1d04: 14 be out 0x34, r1 ; 52
|
2010-09-22 09:04:33 -04:00
|
|
|
if (!(ch & _BV(EXTRF))) appStart();
|
2011-06-11 03:17:38 -07:00
|
|
|
1d06: 81 ff sbrs r24, 1
|
2011-06-13 19:07:07 -07:00
|
|
|
1d08: 17 d1 rcall .+558 ; 0x1f38 <appStart>
|
2011-06-10 16:17:13 -07:00
|
|
|
|
|
|
|
#if LED_START_FLASHES > 0
|
|
|
|
// Set up Timer 1 for timeout counter
|
|
|
|
TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
|
2011-06-11 03:17:38 -07:00
|
|
|
1d0a: 85 e0 ldi r24, 0x05 ; 5
|
|
|
|
1d0c: 8e bd out 0x2e, r24 ; 46
|
2011-06-10 16:17:13 -07:00
|
|
|
UBRR0L = (uint8_t)( (F_CPU + BAUD_RATE * 4L) / (BAUD_RATE * 8L) - 1 );
|
|
|
|
#endif
|
|
|
|
#endif
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
// Set up watchdog to trigger after 500ms
|
2011-06-10 16:17:13 -07:00
|
|
|
watchdogConfig(WATCHDOG_1S);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d0e: 8e e0 ldi r24, 0x0E ; 14
|
2011-06-13 19:07:07 -07:00
|
|
|
1d10: ff d0 rcall .+510 ; 0x1f10 <watchdogConfig>
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
/* Set LED pin as output */
|
|
|
|
LED_DDR |= _BV(LED);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d12: d4 9a sbi 0x1a, 4 ; 26
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
#ifdef SOFT_UART
|
|
|
|
/* Set TX pin as output */
|
|
|
|
UART_DDR |= _BV(UART_TX_BIT);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d14: d2 9a sbi 0x1a, 2 ; 26
|
|
|
|
1d16: 86 e0 ldi r24, 0x06 ; 6
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#if LED_START_FLASHES > 0
|
|
|
|
void flash_led(uint8_t count) {
|
|
|
|
do {
|
|
|
|
TCNT1 = -(F_CPU/(1024*16));
|
2011-06-11 03:17:38 -07:00
|
|
|
1d18: 23 ec ldi r18, 0xC3 ; 195
|
|
|
|
1d1a: 3f ef ldi r19, 0xFF ; 255
|
2010-09-22 09:04:33 -04:00
|
|
|
TIFR1 = _BV(TOV1);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d1c: 91 e0 ldi r25, 0x01 ; 1
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#if LED_START_FLASHES > 0
|
|
|
|
void flash_led(uint8_t count) {
|
|
|
|
do {
|
|
|
|
TCNT1 = -(F_CPU/(1024*16));
|
2011-06-11 03:17:38 -07:00
|
|
|
1d1e: 3d bd out 0x2d, r19 ; 45
|
|
|
|
1d20: 2c bd out 0x2c, r18 ; 44
|
2010-09-22 09:04:33 -04:00
|
|
|
TIFR1 = _BV(TOV1);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d22: 9b b9 out 0x0b, r25 ; 11
|
2010-09-22 09:04:33 -04:00
|
|
|
while(!(TIFR1 & _BV(TOV1)));
|
2011-06-11 03:17:38 -07:00
|
|
|
1d24: 58 9b sbis 0x0b, 0 ; 11
|
|
|
|
1d26: fe cf rjmp .-4 ; 0x1d24 <main+0x24>
|
2011-06-10 16:17:13 -07:00
|
|
|
#ifdef __AVR_ATmega8__
|
|
|
|
LED_PORT ^= _BV(LED);
|
|
|
|
#else
|
2010-09-22 09:04:33 -04:00
|
|
|
LED_PIN |= _BV(LED);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d28: cc 9a sbi 0x19, 4 ; 25
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
2011-06-10 23:02:25 -07:00
|
|
|
#endif
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
// Watchdog functions. These are only safe with interrupts turned off.
|
|
|
|
void watchdogReset() {
|
|
|
|
__asm__ __volatile__ (
|
2011-06-11 03:17:38 -07:00
|
|
|
1d2a: a8 95 wdr
|
2011-06-10 16:17:13 -07:00
|
|
|
LED_PORT ^= _BV(LED);
|
|
|
|
#else
|
2010-09-22 09:04:33 -04:00
|
|
|
LED_PIN |= _BV(LED);
|
2011-06-10 16:17:13 -07:00
|
|
|
#endif
|
2010-09-22 09:04:33 -04:00
|
|
|
watchdogReset();
|
|
|
|
} while (--count);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d2c: 81 50 subi r24, 0x01 ; 1
|
|
|
|
1d2e: b9 f7 brne .-18 ; 0x1d1e <main+0x1e>
|
2010-09-22 09:04:33 -04:00
|
|
|
/* get character from UART */
|
|
|
|
ch = getch();
|
|
|
|
|
|
|
|
if(ch == STK_GET_PARAMETER) {
|
|
|
|
// GET PARAMETER returns a generic 0x03 reply - enough to keep Avrdude happy
|
|
|
|
getNch(1);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d30: bb 24 eor r11, r11
|
|
|
|
1d32: b3 94 inc r11
|
2011-06-10 16:17:13 -07:00
|
|
|
__boot_page_fill_short((uint16_t)(void*)addrPtr,a);
|
2010-09-22 09:04:33 -04:00
|
|
|
addrPtr += 2;
|
|
|
|
} while (--ch);
|
2011-06-10 17:47:47 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
// Write from programming buffer
|
2011-06-10 16:17:13 -07:00
|
|
|
__boot_page_write_short((uint16_t)(void*)address);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d34: 25 e0 ldi r18, 0x05 ; 5
|
|
|
|
1d36: a2 2e mov r10, r18
|
2010-09-22 09:04:33 -04:00
|
|
|
vect -= 4; // Instruction is a relative jump (rjmp), so recalculate.
|
2011-06-10 16:17:13 -07:00
|
|
|
buff[8] = vect & 0xff;
|
|
|
|
buff[9] = vect >> 8;
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
// Add jump to bootloader at RESET vector
|
|
|
|
buff[0] = 0x7f;
|
2011-06-11 03:17:38 -07:00
|
|
|
1d38: 9f e7 ldi r25, 0x7F ; 127
|
|
|
|
1d3a: d9 2e mov r13, r25
|
2010-09-22 09:04:33 -04:00
|
|
|
buff[1] = 0xce; // rjmp 0x1d00 instruction
|
2011-06-11 03:17:38 -07:00
|
|
|
1d3c: 8e ec ldi r24, 0xCE ; 206
|
|
|
|
1d3e: c8 2e mov r12, r24
|
2010-09-22 09:04:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Forever loop */
|
|
|
|
for (;;) {
|
|
|
|
/* get character from UART */
|
|
|
|
ch = getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1d40: d4 d0 rcall .+424 ; 0x1eea <getch>
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
if(ch == STK_GET_PARAMETER) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d42: 81 34 cpi r24, 0x41 ; 65
|
|
|
|
1d44: 21 f4 brne .+8 ; 0x1d4e <main+0x4e>
|
2010-09-22 09:04:33 -04:00
|
|
|
// GET PARAMETER returns a generic 0x03 reply - enough to keep Avrdude happy
|
|
|
|
getNch(1);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d46: 81 e0 ldi r24, 0x01 ; 1
|
2011-06-13 19:07:07 -07:00
|
|
|
1d48: ef d0 rcall .+478 ; 0x1f28 <getNch>
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(0x03);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d4a: 83 e0 ldi r24, 0x03 ; 3
|
|
|
|
1d4c: b5 c0 rjmp .+362 ; 0x1eb8 <main+0x1b8>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
else if(ch == STK_SET_DEVICE) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d4e: 82 34 cpi r24, 0x42 ; 66
|
|
|
|
1d50: 11 f4 brne .+4 ; 0x1d56 <main+0x56>
|
2010-09-22 09:04:33 -04:00
|
|
|
// SET DEVICE is ignored
|
|
|
|
getNch(20);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d52: 84 e1 ldi r24, 0x14 ; 20
|
|
|
|
1d54: 03 c0 rjmp .+6 ; 0x1d5c <main+0x5c>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
else if(ch == STK_SET_DEVICE_EXT) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d56: 85 34 cpi r24, 0x45 ; 69
|
|
|
|
1d58: 19 f4 brne .+6 ; 0x1d60 <main+0x60>
|
2010-09-22 09:04:33 -04:00
|
|
|
// SET DEVICE EXT is ignored
|
|
|
|
getNch(5);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d5a: 85 e0 ldi r24, 0x05 ; 5
|
2011-06-13 19:07:07 -07:00
|
|
|
1d5c: e5 d0 rcall .+458 ; 0x1f28 <getNch>
|
2011-06-11 03:17:38 -07:00
|
|
|
1d5e: b3 c0 rjmp .+358 ; 0x1ec6 <main+0x1c6>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
else if(ch == STK_LOAD_ADDRESS) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d60: 85 35 cpi r24, 0x55 ; 85
|
|
|
|
1d62: 69 f4 brne .+26 ; 0x1d7e <main+0x7e>
|
2010-09-22 09:04:33 -04:00
|
|
|
// LOAD ADDRESS
|
2011-06-10 16:17:13 -07:00
|
|
|
uint16_t newAddress;
|
|
|
|
newAddress = getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1d64: c2 d0 rcall .+388 ; 0x1eea <getch>
|
2011-06-10 16:17:13 -07:00
|
|
|
newAddress = (newAddress & 0xff) | (getch() << 8);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d66: e8 2e mov r14, r24
|
|
|
|
1d68: ff 24 eor r15, r15
|
|
|
|
1d6a: bf d0 rcall .+382 ; 0x1eea <getch>
|
|
|
|
1d6c: 08 2f mov r16, r24
|
|
|
|
1d6e: 10 e0 ldi r17, 0x00 ; 0
|
|
|
|
1d70: 10 2f mov r17, r16
|
|
|
|
1d72: 00 27 eor r16, r16
|
|
|
|
1d74: 0e 29 or r16, r14
|
|
|
|
1d76: 1f 29 or r17, r15
|
2011-06-10 16:17:13 -07:00
|
|
|
#ifdef RAMPZ
|
|
|
|
// Transfer top bit to RAMPZ
|
|
|
|
RAMPZ = (newAddress & 0x8000) ? 1 : 0;
|
|
|
|
#endif
|
|
|
|
newAddress += newAddress; // Convert from word address to byte address
|
2011-06-11 03:17:38 -07:00
|
|
|
1d78: 00 0f add r16, r16
|
|
|
|
1d7a: 11 1f adc r17, r17
|
|
|
|
1d7c: a3 c0 rjmp .+326 ; 0x1ec4 <main+0x1c4>
|
2011-06-10 16:17:13 -07:00
|
|
|
address = newAddress;
|
2010-09-22 09:04:33 -04:00
|
|
|
verifySpace();
|
|
|
|
}
|
|
|
|
else if(ch == STK_UNIVERSAL) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d7e: 86 35 cpi r24, 0x56 ; 86
|
|
|
|
1d80: 21 f4 brne .+8 ; 0x1d8a <main+0x8a>
|
2010-09-22 09:04:33 -04:00
|
|
|
// UNIVERSAL command is ignored
|
|
|
|
getNch(4);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d82: 84 e0 ldi r24, 0x04 ; 4
|
2011-06-13 19:07:07 -07:00
|
|
|
1d84: d1 d0 rcall .+418 ; 0x1f28 <getNch>
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(0x00);
|
2011-06-11 03:17:38 -07:00
|
|
|
1d86: 80 e0 ldi r24, 0x00 ; 0
|
|
|
|
1d88: 97 c0 rjmp .+302 ; 0x1eb8 <main+0x1b8>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
2011-06-10 16:17:13 -07:00
|
|
|
/* Write memory, length is big endian and is in bytes */
|
2010-09-22 09:04:33 -04:00
|
|
|
else if(ch == STK_PROG_PAGE) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1d8a: 84 36 cpi r24, 0x64 ; 100
|
|
|
|
1d8c: 09 f0 breq .+2 ; 0x1d90 <main+0x90>
|
|
|
|
1d8e: 60 c0 rjmp .+192 ; 0x1e50 <main+0x150>
|
2010-09-22 09:04:33 -04:00
|
|
|
// PROGRAM PAGE - we support flash programming only, not EEPROM
|
|
|
|
uint8_t *bufPtr;
|
|
|
|
uint16_t addrPtr;
|
|
|
|
|
2011-06-10 23:02:25 -07:00
|
|
|
getch(); /* getlen() */
|
2011-06-11 03:17:38 -07:00
|
|
|
1d90: ac d0 rcall .+344 ; 0x1eea <getch>
|
2011-06-10 23:02:25 -07:00
|
|
|
length = getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1d92: ab d0 rcall .+342 ; 0x1eea <getch>
|
|
|
|
1d94: f8 2e mov r15, r24
|
2011-06-10 23:02:25 -07:00
|
|
|
getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1d96: a9 d0 rcall .+338 ; 0x1eea <getch>
|
|
|
|
1d98: c0 e0 ldi r28, 0x00 ; 0
|
|
|
|
1d9a: d1 e0 ldi r29, 0x01 ; 1
|
2011-06-10 16:17:13 -07:00
|
|
|
// If we are in RWW section, immediately start page erase
|
|
|
|
if (address < NRWWSTART) __boot_page_erase_short((uint16_t)(void*)address);
|
2011-06-10 17:47:47 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
// While that is going on, read in page contents
|
|
|
|
bufPtr = buff;
|
|
|
|
do *bufPtr++ = getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1d9c: a6 d0 rcall .+332 ; 0x1eea <getch>
|
|
|
|
1d9e: 89 93 st Y+, r24
|
2010-09-22 09:04:33 -04:00
|
|
|
while (--length);
|
2011-06-11 03:17:38 -07:00
|
|
|
1da0: fc 16 cp r15, r28
|
|
|
|
1da2: e1 f7 brne .-8 ; 0x1d9c <main+0x9c>
|
2011-06-10 16:17:13 -07:00
|
|
|
|
|
|
|
// If we are in NRWW section, page erase has to be delayed until now.
|
|
|
|
// Todo: Take RAMPZ into account
|
|
|
|
if (address >= NRWWSTART) __boot_page_erase_short((uint16_t)(void*)address);
|
2011-06-11 03:17:38 -07:00
|
|
|
1da4: 83 e0 ldi r24, 0x03 ; 3
|
|
|
|
1da6: f8 01 movw r30, r16
|
|
|
|
1da8: 87 bf out 0x37, r24 ; 55
|
|
|
|
1daa: e8 95 spm
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
// Read command terminator, start reply
|
|
|
|
verifySpace();
|
2011-06-13 19:07:07 -07:00
|
|
|
1dac: b5 d0 rcall .+362 ; 0x1f18 <verifySpace>
|
2011-06-10 17:47:47 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
// If only a partial page is to be programmed, the erase might not be complete.
|
|
|
|
// So check that here
|
|
|
|
boot_spm_busy_wait();
|
2011-06-11 03:17:38 -07:00
|
|
|
1dae: 07 b6 in r0, 0x37 ; 55
|
|
|
|
1db0: 00 fc sbrc r0, 0
|
|
|
|
1db2: fd cf rjmp .-6 ; 0x1dae <main+0xae>
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
#ifdef VIRTUAL_BOOT_PARTITION
|
|
|
|
if ((uint16_t)(void*)address == 0) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1db4: 01 15 cp r16, r1
|
|
|
|
1db6: 11 05 cpc r17, r1
|
|
|
|
1db8: 11 f0 breq .+4 ; 0x1dbe <main+0xbe>
|
|
|
|
1dba: a8 01 movw r20, r16
|
|
|
|
1dbc: 2a c0 rjmp .+84 ; 0x1e12 <main+0x112>
|
2010-09-22 09:04:33 -04:00
|
|
|
// This is the reset vector page. We need to live-patch the code so the
|
|
|
|
// bootloader runs.
|
|
|
|
//
|
|
|
|
// Move RESET vector to WDT vector
|
|
|
|
uint16_t vect = buff[0] | (buff[1]<<8);
|
2011-06-11 03:17:38 -07:00
|
|
|
1dbe: 80 91 00 01 lds r24, 0x0100
|
|
|
|
1dc2: 20 91 01 01 lds r18, 0x0101
|
|
|
|
1dc6: 30 e0 ldi r19, 0x00 ; 0
|
|
|
|
1dc8: 32 2f mov r19, r18
|
|
|
|
1dca: 22 27 eor r18, r18
|
|
|
|
1dcc: 90 e0 ldi r25, 0x00 ; 0
|
|
|
|
1dce: 28 2b or r18, r24
|
|
|
|
1dd0: 39 2b or r19, r25
|
2010-09-22 09:04:33 -04:00
|
|
|
rstVect = vect;
|
2011-06-11 03:17:38 -07:00
|
|
|
1dd2: 30 93 85 01 sts 0x0185, r19
|
|
|
|
1dd6: 20 93 84 01 sts 0x0184, r18
|
2011-06-10 16:17:13 -07:00
|
|
|
wdtVect = buff[8] | (buff[9]<<8);
|
2011-06-11 03:17:38 -07:00
|
|
|
1dda: 40 91 08 01 lds r20, 0x0108
|
|
|
|
1dde: 80 91 09 01 lds r24, 0x0109
|
|
|
|
1de2: 90 e0 ldi r25, 0x00 ; 0
|
|
|
|
1de4: 98 2f mov r25, r24
|
|
|
|
1de6: 88 27 eor r24, r24
|
|
|
|
1de8: 50 e0 ldi r21, 0x00 ; 0
|
|
|
|
1dea: 84 2b or r24, r20
|
|
|
|
1dec: 95 2b or r25, r21
|
|
|
|
1dee: 90 93 87 01 sts 0x0187, r25
|
|
|
|
1df2: 80 93 86 01 sts 0x0186, r24
|
2010-09-22 09:04:33 -04:00
|
|
|
vect -= 4; // Instruction is a relative jump (rjmp), so recalculate.
|
2011-06-11 03:17:38 -07:00
|
|
|
1df6: 24 50 subi r18, 0x04 ; 4
|
|
|
|
1df8: 30 40 sbci r19, 0x00 ; 0
|
2011-06-10 16:17:13 -07:00
|
|
|
buff[8] = vect & 0xff;
|
2011-06-11 03:17:38 -07:00
|
|
|
1dfa: 20 93 08 01 sts 0x0108, r18
|
2011-06-10 16:17:13 -07:00
|
|
|
buff[9] = vect >> 8;
|
2011-06-11 03:17:38 -07:00
|
|
|
1dfe: 23 2f mov r18, r19
|
|
|
|
1e00: 33 27 eor r19, r19
|
|
|
|
1e02: 20 93 09 01 sts 0x0109, r18
|
2010-09-22 09:04:33 -04:00
|
|
|
|
|
|
|
// Add jump to bootloader at RESET vector
|
|
|
|
buff[0] = 0x7f;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e06: d0 92 00 01 sts 0x0100, r13
|
2010-09-22 09:04:33 -04:00
|
|
|
buff[1] = 0xce; // rjmp 0x1d00 instruction
|
2011-06-11 03:17:38 -07:00
|
|
|
1e0a: c0 92 01 01 sts 0x0101, r12
|
|
|
|
1e0e: 40 e0 ldi r20, 0x00 ; 0
|
|
|
|
1e10: 50 e0 ldi r21, 0x00 ; 0
|
|
|
|
1e12: a0 e0 ldi r26, 0x00 ; 0
|
|
|
|
1e14: b1 e0 ldi r27, 0x01 ; 1
|
2010-09-22 09:04:33 -04:00
|
|
|
bufPtr = buff;
|
|
|
|
addrPtr = (uint16_t)(void*)address;
|
|
|
|
ch = SPM_PAGESIZE / 2;
|
|
|
|
do {
|
|
|
|
uint16_t a;
|
|
|
|
a = *bufPtr++;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e16: 2c 91 ld r18, X
|
|
|
|
1e18: 30 e0 ldi r19, 0x00 ; 0
|
2010-09-22 09:04:33 -04:00
|
|
|
a |= (*bufPtr++) << 8;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e1a: 11 96 adiw r26, 0x01 ; 1
|
|
|
|
1e1c: 8c 91 ld r24, X
|
|
|
|
1e1e: 11 97 sbiw r26, 0x01 ; 1
|
|
|
|
1e20: 90 e0 ldi r25, 0x00 ; 0
|
|
|
|
1e22: 98 2f mov r25, r24
|
|
|
|
1e24: 88 27 eor r24, r24
|
|
|
|
1e26: 82 2b or r24, r18
|
|
|
|
1e28: 93 2b or r25, r19
|
2011-06-10 16:17:13 -07:00
|
|
|
#define rstVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+4))
|
|
|
|
#define wdtVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+6))
|
2010-09-22 09:04:33 -04:00
|
|
|
#endif
|
2011-06-10 16:17:13 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
/* main program starts here */
|
|
|
|
int main(void) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1e2a: 12 96 adiw r26, 0x02 ; 2
|
2010-09-22 09:04:33 -04:00
|
|
|
ch = SPM_PAGESIZE / 2;
|
|
|
|
do {
|
|
|
|
uint16_t a;
|
|
|
|
a = *bufPtr++;
|
|
|
|
a |= (*bufPtr++) << 8;
|
2011-06-10 16:17:13 -07:00
|
|
|
__boot_page_fill_short((uint16_t)(void*)addrPtr,a);
|
2011-06-11 03:17:38 -07:00
|
|
|
1e2c: fa 01 movw r30, r20
|
|
|
|
1e2e: 0c 01 movw r0, r24
|
|
|
|
1e30: b7 be out 0x37, r11 ; 55
|
|
|
|
1e32: e8 95 spm
|
|
|
|
1e34: 11 24 eor r1, r1
|
2010-09-22 09:04:33 -04:00
|
|
|
addrPtr += 2;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e36: 4e 5f subi r20, 0xFE ; 254
|
|
|
|
1e38: 5f 4f sbci r21, 0xFF ; 255
|
2010-09-22 09:04:33 -04:00
|
|
|
} while (--ch);
|
2011-06-11 03:17:38 -07:00
|
|
|
1e3a: f1 e0 ldi r31, 0x01 ; 1
|
|
|
|
1e3c: a0 34 cpi r26, 0x40 ; 64
|
|
|
|
1e3e: bf 07 cpc r27, r31
|
|
|
|
1e40: 51 f7 brne .-44 ; 0x1e16 <main+0x116>
|
2011-06-10 17:47:47 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
// Write from programming buffer
|
2011-06-10 16:17:13 -07:00
|
|
|
__boot_page_write_short((uint16_t)(void*)address);
|
2011-06-11 03:17:38 -07:00
|
|
|
1e42: f8 01 movw r30, r16
|
|
|
|
1e44: a7 be out 0x37, r10 ; 55
|
|
|
|
1e46: e8 95 spm
|
2010-09-22 09:04:33 -04:00
|
|
|
boot_spm_busy_wait();
|
2011-06-11 03:17:38 -07:00
|
|
|
1e48: 07 b6 in r0, 0x37 ; 55
|
|
|
|
1e4a: 00 fc sbrc r0, 0
|
|
|
|
1e4c: fd cf rjmp .-6 ; 0x1e48 <main+0x148>
|
|
|
|
1e4e: 3b c0 rjmp .+118 ; 0x1ec6 <main+0x1c6>
|
2010-09-22 09:04:33 -04:00
|
|
|
boot_rww_enable();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
/* Read memory block mode, length is big endian. */
|
|
|
|
else if(ch == STK_READ_PAGE) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1e50: 84 37 cpi r24, 0x74 ; 116
|
|
|
|
1e52: 51 f5 brne .+84 ; 0x1ea8 <main+0x1a8>
|
2010-09-22 09:04:33 -04:00
|
|
|
// READ PAGE - we only read flash
|
2011-06-10 23:02:25 -07:00
|
|
|
getch(); /* getlen() */
|
2011-06-11 03:17:38 -07:00
|
|
|
1e54: 4a d0 rcall .+148 ; 0x1eea <getch>
|
2011-06-10 23:02:25 -07:00
|
|
|
length = getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1e56: 49 d0 rcall .+146 ; 0x1eea <getch>
|
|
|
|
1e58: f8 2e mov r15, r24
|
2011-06-10 23:02:25 -07:00
|
|
|
getch();
|
2011-06-11 03:17:38 -07:00
|
|
|
1e5a: 47 d0 rcall .+142 ; 0x1eea <getch>
|
2011-06-10 23:02:25 -07:00
|
|
|
|
2010-09-22 09:04:33 -04:00
|
|
|
verifySpace();
|
2011-06-13 19:07:07 -07:00
|
|
|
1e5c: 5d d0 rcall .+186 ; 0x1f18 <verifySpace>
|
2011-06-11 03:17:38 -07:00
|
|
|
1e5e: e8 01 movw r28, r16
|
|
|
|
1e60: ef 2c mov r14, r15
|
2010-09-22 09:04:33 -04:00
|
|
|
#ifdef VIRTUAL_BOOT_PARTITION
|
|
|
|
do {
|
|
|
|
// Undo vector patch in bottom page so verify passes
|
|
|
|
if (address == 0) ch=rstVect & 0xff;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e62: 20 97 sbiw r28, 0x00 ; 0
|
|
|
|
1e64: 19 f4 brne .+6 ; 0x1e6c <main+0x16c>
|
|
|
|
1e66: 80 91 84 01 lds r24, 0x0184
|
|
|
|
1e6a: 14 c0 rjmp .+40 ; 0x1e94 <main+0x194>
|
2010-09-22 09:04:33 -04:00
|
|
|
else if (address == 1) ch=rstVect >> 8;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e6c: c1 30 cpi r28, 0x01 ; 1
|
|
|
|
1e6e: d1 05 cpc r29, r1
|
|
|
|
1e70: 19 f4 brne .+6 ; 0x1e78 <main+0x178>
|
|
|
|
1e72: 80 91 85 01 lds r24, 0x0185
|
|
|
|
1e76: 0e c0 rjmp .+28 ; 0x1e94 <main+0x194>
|
2011-06-10 16:17:13 -07:00
|
|
|
else if (address == 8) ch=wdtVect & 0xff;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e78: c8 30 cpi r28, 0x08 ; 8
|
|
|
|
1e7a: d1 05 cpc r29, r1
|
|
|
|
1e7c: 19 f4 brne .+6 ; 0x1e84 <main+0x184>
|
|
|
|
1e7e: 80 91 86 01 lds r24, 0x0186
|
|
|
|
1e82: 08 c0 rjmp .+16 ; 0x1e94 <main+0x194>
|
2011-06-10 16:17:13 -07:00
|
|
|
else if (address == 9) ch=wdtVect >> 8;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e84: c9 30 cpi r28, 0x09 ; 9
|
|
|
|
1e86: d1 05 cpc r29, r1
|
|
|
|
1e88: 19 f4 brne .+6 ; 0x1e90 <main+0x190>
|
|
|
|
1e8a: 80 91 87 01 lds r24, 0x0187
|
|
|
|
1e8e: 02 c0 rjmp .+4 ; 0x1e94 <main+0x194>
|
2010-09-22 09:04:33 -04:00
|
|
|
else ch = pgm_read_byte_near(address);
|
2011-06-11 03:17:38 -07:00
|
|
|
1e90: fe 01 movw r30, r28
|
|
|
|
1e92: 84 91 lpm r24, Z+
|
2010-09-22 09:04:33 -04:00
|
|
|
address++;
|
2011-06-11 03:17:38 -07:00
|
|
|
1e94: 21 96 adiw r28, 0x01 ; 1
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(ch);
|
2011-06-11 03:17:38 -07:00
|
|
|
1e96: 1a d0 rcall .+52 ; 0x1ecc <putch>
|
2010-09-22 09:04:33 -04:00
|
|
|
} while (--length);
|
2011-06-11 03:17:38 -07:00
|
|
|
1e98: ea 94 dec r14
|
|
|
|
1e9a: 19 f7 brne .-58 ; 0x1e62 <main+0x162>
|
2011-06-10 23:02:25 -07:00
|
|
|
#define rstVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+4))
|
|
|
|
#define wdtVect (*(uint16_t*)(RAMSTART+SPM_PAGESIZE*2+6))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* main program starts here */
|
|
|
|
int main(void) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1e9c: 0f 5f subi r16, 0xFF ; 255
|
|
|
|
1e9e: 1f 4f sbci r17, 0xFF ; 255
|
|
|
|
1ea0: fa 94 dec r15
|
|
|
|
1ea2: 0f 0d add r16, r15
|
|
|
|
1ea4: 11 1d adc r17, r1
|
|
|
|
1ea6: 0f c0 rjmp .+30 ; 0x1ec6 <main+0x1c6>
|
2011-06-10 16:17:13 -07:00
|
|
|
#endif
|
2010-09-22 09:04:33 -04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get device signature bytes */
|
|
|
|
else if(ch == STK_READ_SIGN) {
|
2011-06-11 03:17:38 -07:00
|
|
|
1ea8: 85 37 cpi r24, 0x75 ; 117
|
|
|
|
1eaa: 41 f4 brne .+16 ; 0x1ebc <main+0x1bc>
|
2010-09-22 09:04:33 -04:00
|
|
|
// READ SIGN - return what Avrdude wants to hear
|
|
|
|
verifySpace();
|
2011-06-13 19:07:07 -07:00
|
|
|
1eac: 35 d0 rcall .+106 ; 0x1f18 <verifySpace>
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(SIGNATURE_0);
|
2011-06-11 03:17:38 -07:00
|
|
|
1eae: 8e e1 ldi r24, 0x1E ; 30
|
|
|
|
1eb0: 0d d0 rcall .+26 ; 0x1ecc <putch>
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(SIGNATURE_1);
|
2011-06-11 03:17:38 -07:00
|
|
|
1eb2: 83 e9 ldi r24, 0x93 ; 147
|
|
|
|
1eb4: 0b d0 rcall .+22 ; 0x1ecc <putch>
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(SIGNATURE_2);
|
2011-06-11 03:17:38 -07:00
|
|
|
1eb6: 8c e0 ldi r24, 0x0C ; 12
|
|
|
|
1eb8: 09 d0 rcall .+18 ; 0x1ecc <putch>
|
|
|
|
1eba: 05 c0 rjmp .+10 ; 0x1ec6 <main+0x1c6>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
else if (ch == 'Q') {
|
2011-06-11 03:17:38 -07:00
|
|
|
1ebc: 81 35 cpi r24, 0x51 ; 81
|
|
|
|
1ebe: 11 f4 brne .+4 ; 0x1ec4 <main+0x1c4>
|
2010-09-22 09:04:33 -04:00
|
|
|
// Adaboot no-wait mod
|
|
|
|
watchdogConfig(WATCHDOG_16MS);
|
2011-06-11 03:17:38 -07:00
|
|
|
1ec0: 88 e0 ldi r24, 0x08 ; 8
|
2011-06-13 19:07:07 -07:00
|
|
|
1ec2: 26 d0 rcall .+76 ; 0x1f10 <watchdogConfig>
|
2010-09-22 09:04:33 -04:00
|
|
|
verifySpace();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// This covers the response to commands like STK_ENTER_PROGMODE
|
|
|
|
verifySpace();
|
2011-06-13 19:07:07 -07:00
|
|
|
1ec4: 29 d0 rcall .+82 ; 0x1f18 <verifySpace>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
|
|
|
putch(STK_OK);
|
2011-06-11 03:17:38 -07:00
|
|
|
1ec6: 80 e1 ldi r24, 0x10 ; 16
|
|
|
|
1ec8: 01 d0 rcall .+2 ; 0x1ecc <putch>
|
|
|
|
1eca: 3a cf rjmp .-396 ; 0x1d40 <main+0x40>
|
2010-09-22 09:04:33 -04:00
|
|
|
|
2011-06-11 03:17:38 -07:00
|
|
|
00001ecc <putch>:
|
2010-09-22 09:04:33 -04:00
|
|
|
void putch(char ch) {
|
|
|
|
#ifndef SOFT_UART
|
|
|
|
while (!(UCSR0A & _BV(UDRE0)));
|
|
|
|
UDR0 = ch;
|
|
|
|
#else
|
|
|
|
__asm__ __volatile__ (
|
2011-06-11 03:17:38 -07:00
|
|
|
1ecc: 2a e0 ldi r18, 0x0A ; 10
|
|
|
|
1ece: 30 e0 ldi r19, 0x00 ; 0
|
|
|
|
1ed0: 80 95 com r24
|
|
|
|
1ed2: 08 94 sec
|
|
|
|
1ed4: 10 f4 brcc .+4 ; 0x1eda <putch+0xe>
|
|
|
|
1ed6: da 98 cbi 0x1b, 2 ; 27
|
|
|
|
1ed8: 02 c0 rjmp .+4 ; 0x1ede <putch+0x12>
|
|
|
|
1eda: da 9a sbi 0x1b, 2 ; 27
|
|
|
|
1edc: 00 00 nop
|
2011-06-13 19:07:07 -07:00
|
|
|
1ede: 14 d0 rcall .+40 ; 0x1f08 <uartDelay>
|
|
|
|
1ee0: 13 d0 rcall .+38 ; 0x1f08 <uartDelay>
|
2011-06-11 03:17:38 -07:00
|
|
|
1ee2: 86 95 lsr r24
|
|
|
|
1ee4: 2a 95 dec r18
|
|
|
|
1ee6: b1 f7 brne .-20 ; 0x1ed4 <putch+0x8>
|
2010-09-22 09:04:33 -04:00
|
|
|
[uartBit] "I" (UART_TX_BIT)
|
|
|
|
:
|
|
|
|
"r25"
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
}
|
2011-06-11 03:17:38 -07:00
|
|
|
1ee8: 08 95 ret
|
2010-09-22 09:04:33 -04:00
|
|
|
|
2011-06-11 03:17:38 -07:00
|
|
|
00001eea <getch>:
|
2010-09-22 09:04:33 -04:00
|
|
|
LED_PIN |= _BV(LED);
|
2011-06-10 16:17:13 -07:00
|
|
|
#endif
|
2010-09-22 09:04:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return ch;
|
|
|
|
}
|
2011-06-13 19:07:07 -07:00
|
|
|
1eea: 29 e0 ldi r18, 0x09 ; 9
|
|
|
|
1eec: 30 e0 ldi r19, 0x00 ; 0
|
|
|
|
1eee: cb 99 sbic 0x19, 3 ; 25
|
|
|
|
1ef0: fe cf rjmp .-4 ; 0x1eee <getch+0x4>
|
|
|
|
1ef2: 0a d0 rcall .+20 ; 0x1f08 <uartDelay>
|
|
|
|
1ef4: 09 d0 rcall .+18 ; 0x1f08 <uartDelay>
|
|
|
|
1ef6: 08 d0 rcall .+16 ; 0x1f08 <uartDelay>
|
|
|
|
1ef8: 88 94 clc
|
|
|
|
1efa: cb 99 sbic 0x19, 3 ; 25
|
|
|
|
1efc: 08 94 sec
|
|
|
|
1efe: 2a 95 dec r18
|
|
|
|
1f00: 11 f0 breq .+4 ; 0x1f06 <optiboot_version+0x8>
|
|
|
|
1f02: 87 95 ror r24
|
|
|
|
1f04: f7 cf rjmp .-18 ; 0x1ef4 <getch+0xa>
|
|
|
|
1f06: 08 95 ret
|
|
|
|
|
|
|
|
00001f08 <uartDelay>:
|
2010-09-22 09:04:33 -04:00
|
|
|
#if UART_B_VALUE > 255
|
|
|
|
#error Baud rate too slow for soft UART
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void uartDelay() {
|
|
|
|
__asm__ __volatile__ (
|
2011-06-13 19:07:07 -07:00
|
|
|
1f08: 9e e0 ldi r25, 0x0E ; 14
|
|
|
|
1f0a: 9a 95 dec r25
|
|
|
|
1f0c: f1 f7 brne .-4 ; 0x1f0a <uartDelay+0x2>
|
|
|
|
1f0e: 08 95 ret
|
2010-09-22 09:04:33 -04:00
|
|
|
|
2011-06-13 19:07:07 -07:00
|
|
|
00001f10 <watchdogConfig>:
|
2010-09-22 09:04:33 -04:00
|
|
|
"wdr\n"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
void watchdogConfig(uint8_t x) {
|
|
|
|
WDTCSR = _BV(WDCE) | _BV(WDE);
|
2011-06-13 19:07:07 -07:00
|
|
|
1f10: 98 e1 ldi r25, 0x18 ; 24
|
|
|
|
1f12: 91 bd out 0x21, r25 ; 33
|
2010-09-22 09:04:33 -04:00
|
|
|
WDTCSR = x;
|
2011-06-13 19:07:07 -07:00
|
|
|
1f14: 81 bd out 0x21, r24 ; 33
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
2011-06-13 19:07:07 -07:00
|
|
|
1f16: 08 95 ret
|
2010-09-22 09:04:33 -04:00
|
|
|
|
2011-06-13 19:07:07 -07:00
|
|
|
00001f18 <verifySpace>:
|
2010-09-22 09:04:33 -04:00
|
|
|
do getch(); while (--count);
|
|
|
|
verifySpace();
|
|
|
|
}
|
|
|
|
|
|
|
|
void verifySpace() {
|
2011-06-10 23:02:25 -07:00
|
|
|
if (getch() != CRC_EOP) {
|
2011-06-13 19:07:07 -07:00
|
|
|
1f18: e8 df rcall .-48 ; 0x1eea <getch>
|
|
|
|
1f1a: 80 32 cpi r24, 0x20 ; 32
|
|
|
|
1f1c: 19 f0 breq .+6 ; 0x1f24 <verifySpace+0xc>
|
2011-06-10 23:02:25 -07:00
|
|
|
watchdogConfig(WATCHDOG_16MS); // shorten WD timeout
|
2011-06-13 19:07:07 -07:00
|
|
|
1f1e: 88 e0 ldi r24, 0x08 ; 8
|
|
|
|
1f20: f7 df rcall .-18 ; 0x1f10 <watchdogConfig>
|
|
|
|
1f22: ff cf rjmp .-2 ; 0x1f22 <verifySpace+0xa>
|
2011-06-10 23:02:25 -07:00
|
|
|
while (1) // and busy-loop so that WD causes
|
|
|
|
; // a reset and app start.
|
|
|
|
}
|
2010-09-22 09:04:33 -04:00
|
|
|
putch(STK_INSYNC);
|
2011-06-13 19:07:07 -07:00
|
|
|
1f24: 84 e1 ldi r24, 0x14 ; 20
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
2011-06-13 19:07:07 -07:00
|
|
|
1f26: d2 cf rjmp .-92 ; 0x1ecc <putch>
|
2011-06-10 16:17:13 -07:00
|
|
|
|
2011-06-13 19:07:07 -07:00
|
|
|
00001f28 <getNch>:
|
2010-09-22 09:04:33 -04:00
|
|
|
::[count] "M" (UART_B_VALUE)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void getNch(uint8_t count) {
|
2011-06-13 19:07:07 -07:00
|
|
|
1f28: 1f 93 push r17
|
|
|
|
1f2a: 18 2f mov r17, r24
|
2010-09-22 09:04:33 -04:00
|
|
|
do getch(); while (--count);
|
2011-06-13 19:07:07 -07:00
|
|
|
1f2c: de df rcall .-68 ; 0x1eea <getch>
|
|
|
|
1f2e: 11 50 subi r17, 0x01 ; 1
|
|
|
|
1f30: e9 f7 brne .-6 ; 0x1f2c <getNch+0x4>
|
2010-09-22 09:04:33 -04:00
|
|
|
verifySpace();
|
2011-06-13 19:07:07 -07:00
|
|
|
1f32: f2 df rcall .-28 ; 0x1f18 <verifySpace>
|
2010-09-22 09:04:33 -04:00
|
|
|
}
|
2011-06-13 19:07:07 -07:00
|
|
|
1f34: 1f 91 pop r17
|
|
|
|
1f36: 08 95 ret
|
2011-06-10 23:02:25 -07:00
|
|
|
|
2011-06-13 19:07:07 -07:00
|
|
|
00001f38 <appStart>:
|
2011-06-10 23:02:25 -07:00
|
|
|
WDTCSR = _BV(WDCE) | _BV(WDE);
|
|
|
|
WDTCSR = x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void appStart() {
|
|
|
|
watchdogConfig(WATCHDOG_OFF);
|
2011-06-13 19:07:07 -07:00
|
|
|
1f38: 80 e0 ldi r24, 0x00 ; 0
|
|
|
|
1f3a: ea df rcall .-44 ; 0x1f10 <watchdogConfig>
|
2011-06-10 23:02:25 -07:00
|
|
|
__asm__ __volatile__ (
|
2011-06-13 19:07:07 -07:00
|
|
|
1f3c: e4 e0 ldi r30, 0x04 ; 4
|
|
|
|
1f3e: ff 27 eor r31, r31
|
|
|
|
1f40: 09 94 ijmp
|