2 serial_lcd_cpp.elf: file format elf32-avr
5 Idx Name Size VMA LMA File off Algn
6 0 .text 000002f2 00000000 00000000 00000094 2**1
7 CONTENTS, ALLOC, LOAD, READONLY, CODE
8 1 .data 0000000c 00800060 000002f2 00000386 2**0
9 CONTENTS, ALLOC, LOAD, DATA
10 2 .bss 00000032 0080006c 0080006c 00000392 2**0
12 3 .stab 0000069c 00000000 00000000 00000394 2**2
13 CONTENTS, READONLY, DEBUGGING
14 4 .stabstr 00000082 00000000 00000000 00000a30 2**0
15 CONTENTS, READONLY, DEBUGGING
16 5 .debug_aranges 00000020 00000000 00000000 00000ab2 2**0
17 CONTENTS, READONLY, DEBUGGING
18 6 .debug_pubnames 00000115 00000000 00000000 00000ad2 2**0
19 CONTENTS, READONLY, DEBUGGING
20 7 .debug_info 00000fd4 00000000 00000000 00000be7 2**0
21 CONTENTS, READONLY, DEBUGGING
22 8 .debug_abbrev 0000040f 00000000 00000000 00001bbb 2**0
23 CONTENTS, READONLY, DEBUGGING
24 9 .debug_line 000006dc 00000000 00000000 00001fca 2**0
25 CONTENTS, READONLY, DEBUGGING
26 10 .debug_frame 00000080 00000000 00000000 000026a8 2**2
27 CONTENTS, READONLY, DEBUGGING
28 11 .debug_str 00000772 00000000 00000000 00002728 2**0
29 CONTENTS, READONLY, DEBUGGING
30 12 .debug_loc 000001e8 00000000 00000000 00002e9a 2**0
31 CONTENTS, READONLY, DEBUGGING
32 13 .debug_ranges 00000048 00000000 00000000 00003082 2**0
33 CONTENTS, READONLY, DEBUGGING
35 Disassembly of section .text:
38 0: 12 c0 rjmp .+36 ; 0x26 <__ctors_end>
39 2: 2a c0 rjmp .+84 ; 0x58 <__bad_interrupt>
40 4: 29 c0 rjmp .+82 ; 0x58 <__bad_interrupt>
41 6: 28 c0 rjmp .+80 ; 0x58 <__bad_interrupt>
42 8: 27 c0 rjmp .+78 ; 0x58 <__bad_interrupt>
43 a: 26 c0 rjmp .+76 ; 0x58 <__bad_interrupt>
44 c: 25 c0 rjmp .+74 ; 0x58 <__bad_interrupt>
45 e: 24 c1 rjmp .+584 ; 0x258 <__vector_7>
46 10: 23 c0 rjmp .+70 ; 0x58 <__bad_interrupt>
47 12: 22 c0 rjmp .+68 ; 0x58 <__bad_interrupt>
48 14: 21 c0 rjmp .+66 ; 0x58 <__bad_interrupt>
49 16: 20 c0 rjmp .+64 ; 0x58 <__bad_interrupt>
50 18: 1f c0 rjmp .+62 ; 0x58 <__bad_interrupt>
51 1a: 3c c1 rjmp .+632 ; 0x294 <__vector_13>
52 1c: 1d c0 rjmp .+58 ; 0x58 <__bad_interrupt>
53 1e: 1c c0 rjmp .+56 ; 0x58 <__bad_interrupt>
54 20: 1b c0 rjmp .+54 ; 0x58 <__bad_interrupt>
55 22: 1a c0 rjmp .+52 ; 0x58 <__bad_interrupt>
56 24: 19 c0 rjmp .+50 ; 0x58 <__bad_interrupt>
58 00000026 <__ctors_end>:
60 28: 1f be out 0x3f, r1 ; 63
61 2a: cf ed ldi r28, 0xDF ; 223
62 2c: cd bf out 0x3d, r28 ; 61
64 0000002e <__do_copy_data>:
65 2e: 10 e0 ldi r17, 0x00 ; 0
66 30: a0 e6 ldi r26, 0x60 ; 96
67 32: b0 e0 ldi r27, 0x00 ; 0
68 34: e2 ef ldi r30, 0xF2 ; 242
69 36: f2 e0 ldi r31, 0x02 ; 2
70 38: 02 c0 rjmp .+4 ; 0x3e <.do_copy_data_start>
72 0000003a <.do_copy_data_loop>:
76 0000003e <.do_copy_data_start>:
77 3e: ac 36 cpi r26, 0x6C ; 108
78 40: b1 07 cpc r27, r17
79 42: d9 f7 brne .-10 ; 0x3a <.do_copy_data_loop>
81 00000044 <__do_clear_bss>:
82 44: 10 e0 ldi r17, 0x00 ; 0
83 46: ac e6 ldi r26, 0x6C ; 108
84 48: b0 e0 ldi r27, 0x00 ; 0
85 4a: 01 c0 rjmp .+2 ; 0x4e <.do_clear_bss_start>
87 0000004c <.do_clear_bss_loop>:
90 0000004e <.do_clear_bss_start>:
91 4e: ae 39 cpi r26, 0x9E ; 158
92 50: b1 07 cpc r27, r17
93 52: e1 f7 brne .-8 ; 0x4c <.do_clear_bss_loop>
94 54: 3c d0 rcall .+120 ; 0xce <main>
95 56: 4b c1 rjmp .+662 ; 0x2ee <_exit>
97 00000058 <__bad_interrupt>:
98 58: d3 cf rjmp .-90 ; 0x0 <__vectors>
100 0000005a <_ZN4Uart10waitRxCharEv>:
102 #define UART_UBRR(baud) ((F_CPU+(8*(unsigned long) (baud)))/ (16*((unsigned long) (baud))) - 1)
103 const prog_uint8_t Uart::BaudLookupTable[] =
104 {UART_UBRR(115200), UART_UBRR(38400), UART_UBRR(19200), UART_UBRR(9600)};
106 unsigned char Uart::waitRxChar (void) {
107 5a: fc 01 movw r30, r24
108 // waits for next RX character, then return it
111 tail = sUartRxTail; // explicitly set order of volatile variable access
112 5c: 86 2d mov r24, r6
113 {UART_UBRR(115200), UART_UBRR(38400), UART_UBRR(19200), UART_UBRR(9600)};
115 unsigned char Uart::waitRxChar (void) {
116 // waits for next RX character, then return it
119 5e: 95 2d mov r25, r5
120 WDTCSR &= ~(1<<WDCE);
124 INLINE_FUNC_DECLARE(static void reset(void)) {
127 {UART_UBRR(115200), UART_UBRR(38400), UART_UBRR(19200), UART_UBRR(9600)};
129 unsigned char Uart::waitRxChar (void) {
130 // waits for next RX character, then return it
133 62: 98 17 cp r25, r24
134 64: e9 f3 breq .-6 ; 0x60 <_ZN4Uart10waitRxCharEv+0x6>
135 // CTS inactive if byte fills buffer after we remove current byte
139 // increment tail position
140 if (tail == UART_RX_BUFFER_SIZE-1)
141 66: 8f 32 cpi r24, 0x2F ; 47
142 68: 11 f4 brne .+4 ; 0x6e <_ZN4Uart10waitRxCharEv+0x14>
145 6c: 01 c0 rjmp .+2 ; 0x70 <_ZN4Uart10waitRxCharEv+0x16>
150 CTS_PORT |= (1<<CTS_PIN); // Ensure CTS is active since just removed a byte
151 sei(); // Allow UART ISR to read character and change potentially change CTS
154 return m_UartRxBuf[sUartRxTail];
155 70: e6 0d add r30, r6
156 72: f1 1d adc r31, r1
161 00000078 <_ZN3Lcd8busyWaitEv>:
162 LCD_CONTROL_PORT &= ~(1<<LCD_E);
165 unsigned char Lcd::busyWait (void) {
166 unsigned char LCDStatus;
167 LCD_DATA_DIR = 0x00; // Set LCD data port to inputs
168 78: 17 ba out 0x17, r1 ; 23
169 LCD_CONTROL_PORT |= (1<<LCD_RW);
170 7a: 94 9a sbi 0x12, 4 ; 18
173 WDTCSR &= ~(1<<WDCE);
177 INLINE_FUNC_DECLARE(static void reset(void)) {
180 LCD_DATA_DIR = 0x00; // Set LCD data port to inputs
181 LCD_CONTROL_PORT |= (1<<LCD_RW);
185 LCD_CONTROL_PORT |= (1<<LCD_E);
186 80: 96 9a sbi 0x12, 6 ; 18
188 #define ENABLE_WAIT() __delay_cycles(4);
190 #elif defined(__GNUC__)
191 static __inline__ void _NOP1 (void) { __asm__ volatile ( "nop " "\n\t" ); }
192 static __inline__ void _NOP2 (void) { __asm__ volatile ( "rjmp 1f" "\n\t" "1:" "\n\t" ); }
193 82: 00 c0 rjmp .+0 ; 0x84 <_ZN3Lcd8busyWaitEv+0xc>
195 LCDStatus = LCD_DATA_PIN_REG;
196 84: 00 c0 rjmp .+0 ; 0x86 <_ZN3Lcd8busyWaitEv+0xe>
197 86: 96 b3 in r25, 0x16 ; 22
198 LCD_CONTROL_PORT &= ~(1<<LCD_E);
199 88: 96 98 cbi 0x12, 6 ; 18
200 unsigned char Lcd::busyWait (void) {
201 unsigned char LCDStatus;
202 LCD_DATA_DIR = 0x00; // Set LCD data port to inputs
203 LCD_CONTROL_PORT |= (1<<LCD_RW);
206 8a: 97 fd sbrc r25, 7
207 8c: f8 cf rjmp .-16 ; 0x7e <_ZN3Lcd8busyWaitEv+0x6>
208 LCD_CONTROL_PORT |= (1<<LCD_E);
210 LCDStatus = LCD_DATA_PIN_REG;
211 LCD_CONTROL_PORT &= ~(1<<LCD_E);
212 } while (LCDStatus & (1<<LCD_BUSY));
213 LCD_CONTROL_PORT &= ~(1<<LCD_RW);
214 8e: 94 98 cbi 0x12, 4 ; 18
215 LCD_DATA_DIR = 0xFF; // Set LCD data port to default output state
216 90: 8f ef ldi r24, 0xFF ; 255
217 92: 87 bb out 0x17, r24 ; 23
220 94: 89 2f mov r24, r25
223 00000098 <_ZN3Lcd7putCharEh>:
224 LCD_CONTROL_PORT &= ~(1<<LCD_E);
226 LCD_CONTROL_PORT |= (1<<LCD_RS);
229 void Lcd::putChar (unsigned char c) {
231 9a: 16 2f mov r17, r22
232 LCD_CONTROL_PORT &= ~(1<<LCD_RS);
233 9c: 95 98 cbi 0x12, 5 ; 18
235 9e: ec df rcall .-40 ; 0x78 <_ZN3Lcd8busyWaitEv>
236 LCD_CONTROL_PORT |= (1<<LCD_RS);
237 a0: 95 9a sbi 0x12, 5 ; 18
239 a2: 18 bb out 0x18, r17 ; 24
242 LCD_CONTROL_PORT |= (1<<LCD_E);
243 a6: 96 9a sbi 0x12, 6 ; 18
244 a8: 00 c0 rjmp .+0 ; 0xaa <_ZN3Lcd7putCharEh+0x12>
246 LCD_CONTROL_PORT &= ~(1<<LCD_E);
247 aa: 00 c0 rjmp .+0 ; 0xac <_ZN3Lcd7putCharEh+0x14>
248 ac: 96 98 cbi 0x12, 6 ; 18
253 000000b2 <_ZN3Lcd6putCmdEh>:
259 void Lcd::putCmd (unsigned char Cmd) {
261 b4: 16 2f mov r17, r22
262 LCD_CONTROL_PORT &= ~(1<<LCD_RS);
263 b6: 95 98 cbi 0x12, 5 ; 18
265 b8: df df rcall .-66 ; 0x78 <_ZN3Lcd8busyWaitEv>
267 ba: 18 bb out 0x18, r17 ; 24
270 LCD_CONTROL_PORT |= (1<<LCD_E);
271 be: 96 9a sbi 0x12, 6 ; 18
272 c0: 00 c0 rjmp .+0 ; 0xc2 <_ZN3Lcd6putCmdEh+0x10>
274 LCD_CONTROL_PORT &= ~(1<<LCD_E);
275 c2: 00 c0 rjmp .+0 ; 0xc4 <_ZN3Lcd6putCmdEh+0x12>
276 c4: 96 98 cbi 0x12, 6 ; 18
279 LCD_CONTROL_PORT |= (1<<LCD_RS);
280 c8: 95 9a sbi 0x12, 5 ; 18
291 MCUSR = 0; // clear all reset flags
292 ce: 14 be out 0x34, r1 ; 52
293 WDTCSR &= ~(1<<WDCE);
297 INLINE_FUNC_DECLARE(static void reset(void)) {
303 INLINE_FUNC_DECLARE(static void init(void)) {
305 WDTCSR |= (1<<WDCE)|(1<<WDE); // start timed sequence (keep old prescaler)
306 d2: 81 b5 in r24, 0x21 ; 33
307 d4: 88 61 ori r24, 0x18 ; 24
308 d6: 81 bd out 0x21, r24 ; 33
309 WDTCSR = (1<<WDE)|(1<<WDP3)|(1<<WDP0); // 1024K cycles, 8.0sec
310 d8: 89 e2 ldi r24, 0x29 ; 41
311 da: 81 bd out 0x21, r24 ; 33
316 INLINE_FUNC_DECLARE(static void initIdleMode(void)) {
317 MCUCR &= ~((1<<SM1)|(1<<SM0)); // use idle sleep mode
318 dc: 85 b7 in r24, 0x35 ; 53
319 de: 8f 7a andi r24, 0xAF ; 175
320 e0: 85 bf out 0x35, r24 ; 53
323 INLINE_FUNC_DECLARE(void init(void)) {
324 // setup PWM to run at 1.25ms per interrupt.
325 // This allows 8 levels of brightness at minimum of 100Hz flicker rate.
326 TCCR0A = (1<<WGM01); // CTC mode
327 e2: 82 e0 ldi r24, 0x02 ; 2
328 e4: 80 bf out 0x30, r24 ; 48
329 TCCR0B = 0; // timer off
330 e6: 13 be out 0x33, r1 ; 51
331 OCR0A = 72; // 1.25ms with CLK/256 prescaler @ 14.7456MHz
332 e8: 88 e4 ldi r24, 0x48 ; 72
333 ea: 86 bf out 0x36, r24 ; 54
334 TIMSK = (1<<OCIE0A); // Turn on timer0 COMPA intr (all other timer intr off)
335 ec: 81 e0 ldi r24, 0x01 ; 1
336 ee: 89 bf out 0x39, r24 ; 57
337 #if USE_LED_PWM_IO_MEMBERS
338 *m_LedPortPtr &= ~(1<<m_LedPin); // Ensure LED is off during initialization
339 *m_LedDirPtr |= (1<<m_LedPin); // Ensure LED is output port
341 LED_PORT &= ~(1<<LED_PIN); // Ensure LED is off during initialization
342 f0: 91 98 cbi 0x12, 1 ; 18
343 LED_DIR |= (1<<LED_PIN); // Ensure LED is output port
344 f2: 89 9a sbi 0x11, 1 ; 17
346 BIT_led_on = 0; // note that LED is off
347 f4: a0 98 cbi 0x14, 0 ; 20
348 ledPwmPattern = 0xFF; // maximum brightness
349 f6: 9f ef ldi r25, 0xFF ; 255
350 f8: 93 bb out 0x13, r25 ; 19
351 static const unsigned char m_DATA_8 = 0x30;
354 INLINE_FUNC_DECLARE(void init(void)) {
355 // Set BAUD_J2:BAUD_J1 PULL-UPS active
356 LCD_CONTROL_PORT = (1<<BAUD_J2) | (1<<BAUD_J1);
357 fa: 8c e0 ldi r24, 0x0C ; 12
358 fc: 82 bb out 0x12, r24 ; 18
359 // Set LCD_control BAUD_J2:BAUD_J1 to inputs
360 LCD_CONTROL_DIR = 0xF2;
361 fe: 82 ef ldi r24, 0xF2 ; 242
362 100: 81 bb out 0x11, r24 ; 17
364 "1: sbiw %0,1" "\n\t"
369 102: e0 e0 ldi r30, 0x00 ; 0
370 104: f8 ed ldi r31, 0xD8 ; 216
371 106: 31 97 sbiw r30, 0x01 ; 1
372 108: f1 f7 brne .-4 ; 0x106 <__stack+0x27>
376 LCD_CONTROL_PORT |= (1<<LCD_RS); // Set LCD_RS HIGH
377 10a: 95 9a sbi 0x12, 5 ; 18
379 // Initialize the AVR controller I/O
380 LCD_DATA_DIR = 0xFF; // Set LCD_DATA_PORT as all outputs
381 10c: 97 bb out 0x17, r25 ; 23
382 LCD_DATA_PORT = 0x00; // Set LCD_DATA_PORT to logic low
383 10e: 18 ba out 0x18, r1 ; 24
385 // Initialize the LCD controller
386 LCD_CONTROL_PORT &= ~(1<<LCD_RS);
387 110: 95 98 cbi 0x12, 5 ; 18
390 112: 8d e6 ldi r24, 0x6D ; 109
391 114: 90 e0 ldi r25, 0x00 ; 0
392 116: 60 e3 ldi r22, 0x30 ; 48
393 118: bf df rcall .-130 ; 0x98 <_ZN3Lcd7putCharEh>
394 11a: 8a e0 ldi r24, 0x0A ; 10
395 11c: 9b e3 ldi r25, 0x3B ; 59
396 11e: 01 97 sbiw r24, 0x01 ; 1
397 120: f1 f7 brne .-4 ; 0x11e <__stack+0x3f>
398 Delay::millisec(4.1);
401 122: 8d e6 ldi r24, 0x6D ; 109
402 124: 90 e0 ldi r25, 0x00 ; 0
403 126: 60 e3 ldi r22, 0x30 ; 48
404 128: b7 df rcall .-146 ; 0x98 <_ZN3Lcd7putCharEh>
405 12a: 80 e7 ldi r24, 0x70 ; 112
406 12c: 91 e0 ldi r25, 0x01 ; 1
407 12e: 01 97 sbiw r24, 0x01 ; 1
408 130: f1 f7 brne .-4 ; 0x12e <__stack+0x4f>
409 Delay::microsec(100);
412 132: 8d e6 ldi r24, 0x6D ; 109
413 134: 90 e0 ldi r25, 0x00 ; 0
414 136: 60 e3 ldi r22, 0x30 ; 48
415 138: af df rcall .-162 ; 0x98 <_ZN3Lcd7putCharEh>
416 LCD_CONTROL_PORT |= (1<<LCD_RS);
417 13a: 95 9a sbi 0x12, 5 ; 18
419 // The display will be out into 8 bit data mode here
420 putCmd (m_LINE_8x4); // Set 8 bit data, 4 display lines
421 13c: 8d e6 ldi r24, 0x6D ; 109
422 13e: 90 e0 ldi r25, 0x00 ; 0
423 140: 68 e3 ldi r22, 0x38 ; 56
424 142: b7 df rcall .-146 ; 0xb2 <_ZN3Lcd6putCmdEh>
425 putCmd (m_PWR_ON); // Power up the display
426 144: 8d e6 ldi r24, 0x6D ; 109
427 146: 90 e0 ldi r25, 0x00 ; 0
428 148: 6c e0 ldi r22, 0x0C ; 12
429 14a: b3 df rcall .-154 ; 0xb2 <_ZN3Lcd6putCmdEh>
430 putCmd (m_CLR_DSP); // Power up the display
431 14c: 8d e6 ldi r24, 0x6D ; 109
432 14e: 90 e0 ldi r25, 0x00 ; 0
433 150: 61 e0 ldi r22, 0x01 ; 1
434 152: af df rcall .-162 ; 0xb2 <_ZN3Lcd6putCmdEh>
438 INLINE_FUNC_DECLARE(void init(void)) {
440 UCSRB = 0; // Disable while setting baud rate
441 154: 1a b8 out 0x0a, r1 ; 10
443 156: 1b b8 out 0x0b, r1 ; 11
444 UCSRC = (1<<UCSZ1) | (1<<UCSZ0); // 8 bit data
445 158: 86 e0 ldi r24, 0x06 ; 6
446 15a: 83 b9 out 0x03, r24 ; 3
448 INLINE_FUNC_DECLARE(static unsigned char baud()) {
449 unsigned char BaudSelectJumpersValue;
451 // Get BAUD rate jumper settings
452 BaudSelectJumpersValue = BAUD_PIN_REG;
453 15c: e0 b3 in r30, 0x10 ; 16
454 BaudSelectJumpersValue &= (1<<BAUD_J2) | (1<<BAUD_J1);
455 // BAUD_J2 = PD.3, BAUD_J1 = PD.2
456 // This is two bits too far to the left and the array index will
457 // increment by 4, instead of 1.
458 // Shift BAUD_J2 & BAUD_J1 right by two bit positions for proper array indexing
459 BaudSelectJumpersValue = (BaudSelectJumpersValue >> BAUD_J1);
460 15e: ec 70 andi r30, 0x0C ; 12
462 return PGM_READ_BYTE (&BaudLookupTable[BaudSelectJumpersValue]);
465 164: f0 e0 ldi r31, 0x00 ; 0
466 166: e8 59 subi r30, 0x98 ; 152
467 168: ff 4f sbci r31, 0xFF ; 255
468 16a: e4 91 lpm r30, Z+
469 INLINE_FUNC_DECLARE(void init(void)) {
471 UCSRB = 0; // Disable while setting baud rate
473 UCSRC = (1<<UCSZ1) | (1<<UCSZ0); // 8 bit data
475 16c: e9 b9 out 0x09, r30 ; 9
476 UBRRH = 0; // Set baud rate hi
477 16e: 12 b8 out 0x02, r1 ; 2
478 UCSRB = (1<<RXEN)|(1<<RXCIE); // RXEN = Enable
479 170: 80 e9 ldi r24, 0x90 ; 144
480 172: 8a b9 out 0x0a, r24 ; 10
482 // Init circular buffer pointers
484 174: 55 24 eor r5, r5
486 176: 66 24 eor r6, r6
490 gUart.init(); // Initialize the AVR USART
495 INLINE_FUNC_DECLARE(void stop(void)) {
498 INLINE_FUNC_DECLARE(void start(void)) {
500 17a: 14 e0 ldi r17, 0x04 ; 4
504 INLINE_FUNC_DECLARE(unsigned char charAvail(void)) {
505 unsigned char tail = sUartRxTail; // explicitly set order of volatile access
506 return (tail != sUartRxHead) ? 1 : 0;
508 17e: 09 f4 brne .+2 ; 0x182 <__stack+0xa3>
509 180: 4e c0 rjmp .+156 ; 0x21e <__stack+0x13f>
510 gUart.init(); // Initialize the AVR USART
514 if (gUart.charAvail()) {
515 SerialCommandProcessor::processChar (gUart.waitRxChar());
516 182: 8e e6 ldi r24, 0x6E ; 110
517 184: 90 e0 ldi r25, 0x00 ; 0
518 186: 69 df rcall .-302 ; 0x5a <_ZN4Uart10waitRxCharEv>
519 188: 68 2f mov r22, r24
522 INLINE_FUNC_DECLARE(static void processChar(unsigned char ch)) {
523 // avoid use of switch statement as ImageCraft and GCC produce signifcantly
524 // more code for a switch statement than a sequence of if/else if
525 if (ch == m_LED_SW_OFF) {
526 18a: 8d 3f cpi r24, 0xFD ; 253
527 18c: 21 f4 brne .+8 ; 0x196 <__stack+0xb7>
529 INLINE_FUNC_DECLARE(void lampOff(void)) {
530 #if USE_LED_PWM_IO_MEMBERS
531 *m_LedPortPtr &= ~(1<<m_LedPin);;
533 LED_PORT &= ~(1<<LED_PIN);;
534 18e: 91 98 cbi 0x12, 1 ; 18
538 INLINE_FUNC_DECLARE(void switchOff(void)) {
541 190: a0 98 cbi 0x14, 0 ; 20
542 BIT_led_on = 0; // note that LED is off
543 ledPwmPattern = 0xFF; // maximum brightness
546 INLINE_FUNC_DECLARE(void stop(void)) {
548 192: 13 be out 0x33, r1 ; 51
549 194: f3 cf rjmp .-26 ; 0x17c <__stack+0x9d>
550 INLINE_FUNC_DECLARE(static void processChar(unsigned char ch)) {
551 // avoid use of switch statement as ImageCraft and GCC produce signifcantly
552 // more code for a switch statement than a sequence of if/else if
553 if (ch == m_LED_SW_OFF) {
555 } else if (ch == m_LED_SW_ON) {
556 196: 8c 3f cpi r24, 0xFC ; 252
557 198: 29 f4 brne .+10 ; 0x1a4 <__stack+0xc5>
562 INLINE_FUNC_DECLARE(void switchOn(void)) {
564 19a: a0 9a sbi 0x14, 0 ; 20
565 if (ledPwmPattern == 0xFF) { // maximum brightness, no need for PWM
566 19c: 83 b3 in r24, 0x13 ; 19
567 19e: 8f 3f cpi r24, 0xFF ; 255
568 1a0: 71 f5 brne .+92 ; 0x1fe <__stack+0x11f>
569 1a2: 28 c0 rjmp .+80 ; 0x1f4 <__stack+0x115>
570 // more code for a switch statement than a sequence of if/else if
571 if (ch == m_LED_SW_OFF) {
573 } else if (ch == m_LED_SW_ON) {
575 } else if (ch == m_LED_SET_BRIGHTNESS) {
576 1a4: 8b 3f cpi r24, 0xFB ; 251
577 1a6: 69 f5 brne .+90 ; 0x202 <__stack+0x123>
578 // read next byte which will be brightness
579 gLed.setBrightness(gUart.waitRxChar());
580 1a8: 8e e6 ldi r24, 0x6E ; 110
581 1aa: 90 e0 ldi r25, 0x00 ; 0
582 1ac: 56 df rcall .-340 ; 0x5a <_ZN4Uart10waitRxCharEv>
587 INLINE_FUNC_DECLARE(void setBrightness(unsigned char brightness)) {
588 if (brightness == 0) { // turn backlight off for 0 brightness
589 1ae: 88 23 and r24, r24
590 1b0: 39 f4 brne .+14 ; 0x1c0 <__stack+0xe1>
592 1b2: a0 9b sbis 0x14, 0 ; 20
593 1b4: e3 cf rjmp .-58 ; 0x17c <__stack+0x9d>
594 BIT_led_on = 0; // note that LED is off
595 ledPwmPattern = 0xFF; // maximum brightness
598 INLINE_FUNC_DECLARE(void stop(void)) {
600 1b6: 13 be out 0x33, r1 ; 51
602 INLINE_FUNC_DECLARE(void setBrightness(unsigned char brightness)) {
603 if (brightness == 0) { // turn backlight off for 0 brightness
607 1b8: 13 ba out 0x13, r1 ; 19
609 1ba: 77 24 eor r7, r7
611 INLINE_FUNC_DECLARE(void lampOff(void)) {
612 #if USE_LED_PWM_IO_MEMBERS
613 *m_LedPortPtr &= ~(1<<m_LedPin);;
615 LED_PORT &= ~(1<<LED_PIN);;
616 1bc: 91 98 cbi 0x12, 1 ; 18
617 1be: de cf rjmp .-68 ; 0x17c <__stack+0x9d>
623 unsigned char ledPwmPos = (brightness * (LED_BRIGHTNESS_LEVELS-1) + 127) >> 8;
624 1c0: 90 e0 ldi r25, 0x00 ; 0
625 1c2: 67 e0 ldi r22, 0x07 ; 7
626 1c4: 70 e0 ldi r23, 0x00 ; 0
627 1c6: 81 d0 rcall .+258 ; 0x2ca <__mulhi3>
628 1c8: 81 58 subi r24, 0x81 ; 129
629 1ca: 9f 4f sbci r25, 0xFF ; 255
630 1cc: 89 2f mov r24, r25
631 1ce: 99 0f add r25, r25
632 1d0: 99 0b sbc r25, r25
633 1d2: 98 2f mov r25, r24
634 1d4: 88 30 cpi r24, 0x08 ; 8
635 1d6: 08 f0 brcs .+2 ; 0x1da <__stack+0xfb>
636 1d8: 97 e0 ldi r25, 0x07 ; 7
637 LED_PORT &= ~(1<<LED_PIN);;
641 INLINE_FUNC_DECLARE(unsigned char pwmPattern(unsigned char pos)) {
642 return PGM_READ_BYTE (&ledPwmPatterns[pos]);
643 1da: e9 2f mov r30, r25
644 1dc: f0 e0 ldi r31, 0x00 ; 0
645 1de: e0 5a subi r30, 0xA0 ; 160
646 1e0: ff 4f sbci r31, 0xFF ; 255
647 1e2: e4 91 lpm r30, Z+
649 unsigned char ledPwmPos = (brightness * (LED_BRIGHTNESS_LEVELS-1) + 127) >> 8;
650 // Below is probably not required, but ensures we don't exceed array
651 if (ledPwmPos > LED_BRIGHTNESS_LEVELS - 1)
652 ledPwmPos = LED_BRIGHTNESS_LEVELS - 1;
653 ledPwmPattern = pwmPattern(ledPwmPos);
654 1e4: e3 bb out 0x13, r30 ; 19
656 1e6: 44 24 eor r4, r4
657 ledPwmCycling = ledPwmPattern;
658 1e8: 83 b3 in r24, 0x13 ; 19
659 1ea: 78 2e mov r7, r24
660 if (ledPwmPos >= LED_BRIGHTNESS_LEVELS-1) { // maximum brightness
661 1ec: 97 30 cpi r25, 0x07 ; 7
662 1ee: 29 f4 brne .+10 ; 0x1fa <__stack+0x11b>
663 // don't need PWM to continuously on
665 1f0: a0 9b sbis 0x14, 0 ; 20
666 1f2: c4 cf rjmp .-120 ; 0x17c <__stack+0x9d>
667 BIT_led_on = 0; // note that LED is off
668 ledPwmPattern = 0xFF; // maximum brightness
671 INLINE_FUNC_DECLARE(void stop(void)) {
673 1f4: 13 be out 0x33, r1 ; 51
675 INLINE_FUNC_DECLARE(void lampOn(void)) {
676 #if USE_LED_PWM_IO_MEMBERS
677 *m_LedPortPtr |= (1<<m_LedPin);
679 LED_PORT |= (1<<LED_PIN);
680 1f6: 91 9a sbi 0x12, 1 ; 18
681 1f8: c1 cf rjmp .-126 ; 0x17c <__stack+0x9d>
688 1fa: a0 9b sbis 0x14, 0 ; 20
689 1fc: bf cf rjmp .-130 ; 0x17c <__stack+0x9d>
691 INLINE_FUNC_DECLARE(void stop(void)) {
694 INLINE_FUNC_DECLARE(void start(void)) {
696 1fe: 13 bf out 0x33, r17 ; 51
697 200: bd cf rjmp .-134 ; 0x17c <__stack+0x9d>
698 } else if (ch == m_LED_SW_ON) {
700 } else if (ch == m_LED_SET_BRIGHTNESS) {
701 // read next byte which will be brightness
702 gLed.setBrightness(gUart.waitRxChar());
703 } else if (ch == m_REG_MODE) {
704 202: 8e 3f cpi r24, 0xFE ; 254
705 204: 41 f4 brne .+16 ; 0x216 <__stack+0x137>
706 gLcd.putCmd (gUart.waitRxChar()); // Send LCD command character
707 206: 8e e6 ldi r24, 0x6E ; 110
708 208: 90 e0 ldi r25, 0x00 ; 0
709 20a: 27 df rcall .-434 ; 0x5a <_ZN4Uart10waitRxCharEv>
710 20c: 68 2f mov r22, r24
711 20e: 8d e6 ldi r24, 0x6D ; 109
712 210: 90 e0 ldi r25, 0x00 ; 0
713 212: 4f df rcall .-354 ; 0xb2 <_ZN3Lcd6putCmdEh>
714 214: b3 cf rjmp .-154 ; 0x17c <__stack+0x9d>
716 gLcd.putChar (ch); // Send LCD data character
717 216: 8d e6 ldi r24, 0x6D ; 109
718 218: 90 e0 ldi r25, 0x00 ; 0
719 21a: 3e df rcall .-388 ; 0x98 <_ZN3Lcd7putCharEh>
720 21c: af cf rjmp .-162 ; 0x17c <__stack+0x9d>
722 WDTCSR |= (1<<WDCE)|(1<<WDE); // start timed sequence (keep old prescaler)
723 WDTCSR = (1<<WDE)|(1<<WDP3)|(1<<WDP0); // 1024K cycles, 8.0sec
725 INLINE_FUNC_DECLARE(static void off(void)) {
728 WDTCSR &= ~(1<<WDCE);
732 INLINE_FUNC_DECLARE(static void reset(void)) {
735 WDTCSR = (1<<WDE)|(1<<WDP3)|(1<<WDP0); // 1024K cycles, 8.0sec
737 INLINE_FUNC_DECLARE(static void off(void)) {
740 MCUSR &= ~(1<<WDRF); // clear any watchdog interrupt flags
741 222: 84 b7 in r24, 0x34 ; 52
742 224: 87 7f andi r24, 0xF7 ; 247
743 226: 84 bf out 0x34, r24 ; 52
744 WDTCSR |= (1<<WDCE)|(1<<WDE); // start timed sequence (keep old prescaler)
745 228: 81 b5 in r24, 0x21 ; 33
746 22a: 88 61 ori r24, 0x18 ; 24
747 22c: 81 bd out 0x21, r24 ; 33
748 WDTCSR &= ~(1<<WDE); // watchdog timer off
749 22e: 81 b5 in r24, 0x21 ; 33
750 230: 87 7f andi r24, 0xF7 ; 247
751 232: 81 bd out 0x21, r24 ; 33
755 INLINE_FUNC_DECLARE(static void initIdleMode(void)) {
756 MCUCR &= ~((1<<SM1)|(1<<SM0)); // use idle sleep mode
758 INLINE_FUNC_DECLARE(static void enterSleep()) {
760 236: 85 b7 in r24, 0x35 ; 53
761 238: 80 62 ori r24, 0x20 ; 32
762 23a: 85 bf out 0x35, r24 ; 53
766 23e: 85 b7 in r24, 0x35 ; 53
767 240: 8f 7d andi r24, 0xDF ; 223
768 242: 85 bf out 0x35, r24 ; 53
769 WDTCSR &= ~(1<<WDE); // watchdog timer off
773 INLINE_FUNC_DECLARE(static void on(void)) {
776 WDTCSR &= ~(1<<WDCE);
780 INLINE_FUNC_DECLARE(static void reset(void)) {
785 INLINE_FUNC_DECLARE(static void on(void)) {
788 WDTCSR |= (1<<WDCE)|(1<<WDE); // start timed sequence (keep old prescaler)
789 248: 81 b5 in r24, 0x21 ; 33
790 24a: 88 61 ori r24, 0x18 ; 24
791 24c: 81 bd out 0x21, r24 ; 33
792 WDTCSR &= ~(1<<WDCE);
793 24e: 81 b5 in r24, 0x21 ; 33
794 250: 8f 7e andi r24, 0xEF ; 239
795 252: 81 bd out 0x21, r24 ; 33
798 256: 92 cf rjmp .-220 ; 0x17c <__stack+0x9d>
800 00000258 <__vector_7>:
801 LCD_DATA_DIR = 0xFF; // Set LCD data port to default output state
809 25c: 0f b6 in r0, 0x3f ; 63
811 260: 11 24 eor r1, r1
816 gUart.storeChar(UDR);
817 268: 8c b1 in r24, 0x0c ; 12
821 INLINE_FUNC_DECLARE(unsigned char storeChar(unsigned char rx)) {
822 // Calculate next buffer position.
823 unsigned char tmphead = sUartRxHead;
824 26a: e5 2d mov r30, r5
825 if (tmphead == UART_RX_BUFFER_SIZE-1)
826 26c: ef 32 cpi r30, 0x2F ; 47
827 26e: 11 f4 brne .+4 ; 0x274 <__vector_7+0x1c>
828 270: e0 e0 ldi r30, 0x00 ; 0
829 272: 01 c0 rjmp .+2 ; 0x276 <__vector_7+0x1e>
833 274: ef 5f subi r30, 0xFF ; 255
835 // store in buffer if there is room
836 if (tmphead != sUartRxTail) {
837 276: e6 15 cp r30, r6
838 278: 29 f0 breq .+10 ; 0x284 <__vector_7+0x2c>
839 sUartRxHead = tmphead; // Store new index.
840 27a: 5e 2e mov r5, r30
841 m_UartRxBuf[tmphead] = rx;
842 27c: f0 e0 ldi r31, 0x00 ; 0
843 27e: e2 59 subi r30, 0x92 ; 146
844 280: ff 4f sbci r31, 0xFF ; 255
850 gUart.storeChar(UDR);
856 28c: 0f be out 0x3f, r0 ; 63
861 00000294 <__vector_13>:
863 ISR(TIMER0_COMPA_vect)
866 298: 0f b6 in r0, 0x3f ; 63
868 29c: 11 24 eor r1, r1
871 sei(); // Okay to allow USART interrupts while controlling LED PWM
877 INLINE_FUNC_DECLARE(void cyclePwm(void)) {
878 if (ledPwmCycling & 0x01) { // Set current LED state based on cycling variable
879 2a2: 70 fe sbrs r7, 0
880 2a4: 02 c0 rjmp .+4 ; 0x2aa <__vector_13+0x16>
882 INLINE_FUNC_DECLARE(void lampOn(void)) {
883 #if USE_LED_PWM_IO_MEMBERS
884 *m_LedPortPtr |= (1<<m_LedPin);
886 LED_PORT |= (1<<LED_PIN);
887 2a6: 91 9a sbi 0x12, 1 ; 18
888 2a8: 01 c0 rjmp .+2 ; 0x2ac <__vector_13+0x18>
890 INLINE_FUNC_DECLARE(void lampOff(void)) {
891 #if USE_LED_PWM_IO_MEMBERS
892 *m_LedPortPtr &= ~(1<<m_LedPin);;
894 LED_PORT &= ~(1<<LED_PIN);;
895 2aa: 91 98 cbi 0x12, 1 ; 18
900 // Update cycling variable for next interrupt
901 if (ledPwmCount >= LED_BRIGHTNESS_LEVELS-1) {
902 2ac: 86 e0 ldi r24, 0x06 ; 6
903 2ae: 84 15 cp r24, r4
904 2b0: 20 f4 brcc .+8 ; 0x2ba <__vector_13+0x26>
906 2b2: 44 24 eor r4, r4
907 ledPwmCycling = ledPwmPattern;
908 2b4: 83 b3 in r24, 0x13 ; 19
909 2b6: 78 2e mov r7, r24
910 2b8: 02 c0 rjmp .+4 ; 0x2be <__vector_13+0x2a>
916 ISR(TIMER0_COMPA_vect)
918 sei(); // Okay to allow USART interrupts while controlling LED PWM
924 2c2: 0f be out 0x3f, r0 ; 63
930 2ca: 55 27 eor r21, r21
931 2cc: 00 24 eor r0, r0
933 000002ce <__mulhi3_loop>:
934 2ce: 80 ff sbrs r24, 0
935 2d0: 02 c0 rjmp .+4 ; 0x2d6 <__mulhi3_skip1>
936 2d2: 06 0e add r0, r22
937 2d4: 57 1f adc r21, r23
939 000002d6 <__mulhi3_skip1>:
940 2d6: 66 0f add r22, r22
941 2d8: 77 1f adc r23, r23
942 2da: 61 15 cp r22, r1
943 2dc: 71 05 cpc r23, r1
944 2de: 21 f0 breq .+8 ; 0x2e8 <__mulhi3_exit>
947 2e4: 00 97 sbiw r24, 0x00 ; 0
948 2e6: 99 f7 brne .-26 ; 0x2ce <__mulhi3_loop>
950 000002e8 <__mulhi3_exit>:
951 2e8: 95 2f mov r25, r21
952 2ea: 80 2d mov r24, r0
958 000002f0 <__stop_program>:
959 2f0: ff cf rjmp .-2 ; 0x2f0 <__stop_program>