main.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn 0 .data 0000009c 00800100 00002538 000025ac 2**0 CONTENTS, ALLOC, LOAD, DATA 1 .text 00002538 00000000 00000000 00000074 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .bss 0000038d 0080019c 000025d4 00002648 2**0 ALLOC 3 .stab 00001c98 00000000 00000000 00002648 2**2 CONTENTS, READONLY, DEBUGGING 4 .stabstr 000002dc 00000000 00000000 000042e0 2**0 CONTENTS, READONLY, DEBUGGING 5 .debug_aranges 00000140 00000000 00000000 000045bc 2**0 CONTENTS, READONLY, DEBUGGING 6 .debug_pubnames 0000066c 00000000 00000000 000046fc 2**0 CONTENTS, READONLY, DEBUGGING 7 .debug_info 000030e2 00000000 00000000 00004d68 2**0 CONTENTS, READONLY, DEBUGGING 8 .debug_abbrev 00000f26 00000000 00000000 00007e4a 2**0 CONTENTS, READONLY, DEBUGGING 9 .debug_line 0000238c 00000000 00000000 00008d70 2**0 CONTENTS, READONLY, DEBUGGING 10 .debug_frame 000003a0 00000000 00000000 0000b0fc 2**2 CONTENTS, READONLY, DEBUGGING 11 .debug_str 00001477 00000000 00000000 0000b49c 2**0 CONTENTS, READONLY, DEBUGGING 12 .debug_loc 00001334 00000000 00000000 0000c913 2**0 CONTENTS, READONLY, DEBUGGING 13 .debug_ranges 00000018 00000000 00000000 0000dc47 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 7c 00 jmp 0xf8 ; 0xf8 <__ctors_end> 4: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 8: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 10: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 14: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 18: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 1c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 20: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 24: 0c 94 d8 0e jmp 0x1db0 ; 0x1db0 <__vector_9> 28: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 2c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 30: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 34: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 38: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 3c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 40: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 44: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 48: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 4c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 50: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 54: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 58: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 5c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 60: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 64: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 68: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 6c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 70: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 74: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 78: 0c 94 41 04 jmp 0x882 ; 0x882 <__vector_30> 7c: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 80: 0c 94 04 04 jmp 0x808 ; 0x808 <__vector_32> 84: 0c 94 e5 04 jmp 0x9ca ; 0x9ca <__vector_33> 88: 0c 94 9b 00 jmp 0x136 ; 0x136 <__bad_interrupt> 8c: 26 0f add r18, r22 8e: 34 0f add r19, r20 90: 55 0f add r21, r21 92: 65 0f add r22, r21 94: 70 0f add r23, r16 96: 84 0f add r24, r20 98: 90 0f add r25, r16 9a: b1 0f add r27, r17 9c: bc 0f add r27, r28 9e: c9 0f add r28, r25 a0: e6 0f add r30, r22 a2: 03 10 cpse r0, r3 a4: 48 0f add r20, r24 a6: f3 0f add r31, r19 a8: 12 10 cpse r1, r2 aa: 27 10 cpse r2, r7 ac: 3f 10 cpse r3, r15 ae: 4a 10 cpse r4, r10 b0: 6d 10 cpse r6, r13 b2: 78 10 cpse r7, r8 b4: 83 10 cpse r8, r3 b6: 8f 10 cpse r8, r15 b8: 9c 10 cpse r9, r12 ba: 9e 10 cpse r9, r14 bc: aa 10 cpse r10, r10 be: b6 10 cpse r11, r6 000000c0 : c0: 0f 14 14 1f 14 14 17 00 01 0e 13 15 19 0e 10 00 ................ d0: 04 0a 04 0e 11 1f 11 00 00 00 1a 05 0f 14 0f 00 ................ e0: 00 02 0e 15 15 0e 08 00 04 0a 0e 01 0f 11 0f 00 ................ f0: 0c 12 12 0c 00 00 00 00 ........ 000000f8 <__ctors_end>: f8: 11 24 eor r1, r1 fa: 1f be out 0x3f, r1 ; 63 fc: cf ef ldi r28, 0xFF ; 255 fe: d0 e1 ldi r29, 0x10 ; 16 100: de bf out 0x3e, r29 ; 62 102: cd bf out 0x3d, r28 ; 61 00000104 <__do_copy_data>: 104: 11 e0 ldi r17, 0x01 ; 1 106: a0 e0 ldi r26, 0x00 ; 0 108: b1 e0 ldi r27, 0x01 ; 1 10a: e8 e3 ldi r30, 0x38 ; 56 10c: f5 e2 ldi r31, 0x25 ; 37 10e: 00 e0 ldi r16, 0x00 ; 0 110: 0b bf out 0x3b, r16 ; 59 112: 02 c0 rjmp .+4 ; 0x118 <__do_copy_data+0x14> 114: 07 90 elpm r0, Z+ 116: 0d 92 st X+, r0 118: ac 39 cpi r26, 0x9C ; 156 11a: b1 07 cpc r27, r17 11c: d9 f7 brne .-10 ; 0x114 <__do_copy_data+0x10> 0000011e <__do_clear_bss>: 11e: 15 e0 ldi r17, 0x05 ; 5 120: ac e9 ldi r26, 0x9C ; 156 122: b1 e0 ldi r27, 0x01 ; 1 124: 01 c0 rjmp .+2 ; 0x128 <.do_clear_bss_start> 00000126 <.do_clear_bss_loop>: 126: 1d 92 st X+, r1 00000128 <.do_clear_bss_start>: 128: a9 32 cpi r26, 0x29 ; 41 12a: b1 07 cpc r27, r17 12c: e1 f7 brne .-8 ; 0x126 <.do_clear_bss_loop> 12e: 0e 94 b4 00 call 0x168 ; 0x168
132: 0c 94 9a 12 jmp 0x2534 ; 0x2534 <_exit> 00000136 <__bad_interrupt>: 136: 0c 94 00 00 jmp 0 ; 0x0 <__heap_end> 0000013a <_Z12TurnOffLightPvS_>: uint8_t data = WEIGHT_UPDATE; TWI::Send(COFFEE_WEIGHT,&data,1); } void TurnOffLight(void* u1, void* u2){ PORTF = 0x00; 13a: 10 92 62 00 sts 0x0062, r1 } 13e: 08 95 ret 00000140 <_Z7Delay10PvS_>: } else sei(); } void Delay10(void* u1, void* u2){ 140: ef 92 push r14 142: 0f 93 push r16 144: 1f 93 push r17 TaskManager::AddTask(TestTWI,0,0,TaskManager::MULTI_RUN,1,TaskManager::LOW); 146: 86 e9 ldi r24, 0x96 ; 150 148: e8 2e mov r14, r24 14a: 01 e0 ldi r16, 0x01 ; 1 14c: 10 e0 ldi r17, 0x00 ; 0 14e: 21 e0 ldi r18, 0x01 ; 1 150: 40 e0 ldi r20, 0x00 ; 0 152: 50 e0 ldi r21, 0x00 ; 0 154: 60 e0 ldi r22, 0x00 ; 0 156: 70 e0 ldi r23, 0x00 ; 0 158: 87 e4 ldi r24, 0x47 ; 71 15a: 91 e0 ldi r25, 0x01 ; 1 15c: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> } 160: 1f 91 pop r17 162: 0f 91 pop r16 164: ef 90 pop r14 166: 08 95 ret 00000168
: void TurnOffLight(void* u1, void* u2){ PORTF = 0x00; } int main(void) 168: ef 92 push r14 16a: 0f 93 push r16 16c: 1f 93 push r17 { cli(); 16e: f8 94 cli TaskManager::Init(); 170: 0e 94 6f 09 call 0x12de ; 0x12de <_ZN11TaskManager4InitEv> Clock::Init(); 174: 0e 94 d1 0e call 0x1da2 ; 0x1da2 <_ZN5Clock4InitEv> Display::initDisplay(); 178: 0e 94 fe 0c call 0x19fc ; 0x19fc <_ZN7Display11initDisplayEv> Uart::Init(); 17c: 0e 94 a3 03 call 0x746 ; 0x746 <_ZN4Uart4InitEv> Input::Init(); 180: 0e 94 9c 0a call 0x1538 ; 0x1538 <_ZN5Input4InitEv> extern volatile uint8_t slave_nacks; extern volatile uint16_t num_packs_sent; extern uint8_t slave_addr; void inline SetSlaveAddress(uint8_t addr){slave_addr = addr;} 184: 81 e0 ldi r24, 0x01 ; 1 186: 80 93 08 04 sts 0x0408, r24 TWI::SetSlaveAddress(COFFEE_MAIN); TWI::Init(0,0); 18a: 60 e0 ldi r22, 0x00 ; 0 18c: 70 e0 ldi r23, 0x00 ; 0 18e: 80 e0 ldi r24, 0x00 ; 0 190: 90 e0 ldi r25, 0x00 ; 0 192: 0e 94 c7 04 call 0x98e ; 0x98e <_ZN3TWI4InitEPvS0_> sei(); 196: 78 94 sei DDRF = 0xff; 198: 8f ef ldi r24, 0xFF ; 255 19a: 80 93 61 00 sts 0x0061, r24 PORTF = 0xff; 19e: 80 93 62 00 sts 0x0062, r24 //Add the key-press-routine TaskManager::AddTask(Input::CheckKeyPress,0,0,TaskManager::MULTI_RUN,50,TaskManager::MEDIUM); 1a2: 32 e3 ldi r19, 0x32 ; 50 1a4: e3 2e mov r14, r19 1a6: 02 e3 ldi r16, 0x32 ; 50 1a8: 10 e0 ldi r17, 0x00 ; 0 1aa: 21 e0 ldi r18, 0x01 ; 1 1ac: 40 e0 ldi r20, 0x00 ; 0 1ae: 50 e0 ldi r21, 0x00 ; 0 1b0: 60 e0 ldi r22, 0x00 ; 0 1b2: 70 e0 ldi r23, 0x00 ; 0 1b4: 8e e9 ldi r24, 0x9E ; 158 1b6: 9a e0 ldi r25, 0x0A ; 10 1b8: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> //Add the draw-menu-routine TaskManager::AddTask(Menu::DrawMenu,0,0,TaskManager::MULTI_RUN,500,TaskManager::LOW); 1bc: 26 e9 ldi r18, 0x96 ; 150 1be: e2 2e mov r14, r18 1c0: 04 ef ldi r16, 0xF4 ; 244 1c2: 11 e0 ldi r17, 0x01 ; 1 1c4: 21 e0 ldi r18, 0x01 ; 1 1c6: 40 e0 ldi r20, 0x00 ; 0 1c8: 50 e0 ldi r21, 0x00 ; 0 1ca: 60 e0 ldi r22, 0x00 ; 0 1cc: 70 e0 ldi r23, 0x00 ; 0 1ce: 84 e8 ldi r24, 0x84 ; 132 1d0: 99 e0 ldi r25, 0x09 ; 9 1d2: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> TaskManager::AddTask(Coffee::UpdateCoffeeTime,0,0,TaskManager::MULTI_RUN,10000,TaskManager::LOW); 1d6: 00 e1 ldi r16, 0x10 ; 16 1d8: 17 e2 ldi r17, 0x27 ; 39 1da: 21 e0 ldi r18, 0x01 ; 1 1dc: 40 e0 ldi r20, 0x00 ; 0 1de: 50 e0 ldi r21, 0x00 ; 0 1e0: 60 e0 ldi r22, 0x00 ; 0 1e2: 70 e0 ldi r23, 0x00 ; 0 1e4: 87 e7 ldi r24, 0x77 ; 119 1e6: 9e e0 ldi r25, 0x0E ; 14 1e8: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> TaskManager::AddTask(Coffee::PostponeReset,0,0,TaskManager::MULTI_RUN,50000,TaskManager::MEDIUM); 1ec: 92 e3 ldi r25, 0x32 ; 50 1ee: e9 2e mov r14, r25 1f0: 00 e5 ldi r16, 0x50 ; 80 1f2: 13 ec ldi r17, 0xC3 ; 195 1f4: 21 e0 ldi r18, 0x01 ; 1 1f6: 40 e0 ldi r20, 0x00 ; 0 1f8: 50 e0 ldi r21, 0x00 ; 0 1fa: 60 e0 ldi r22, 0x00 ; 0 1fc: 70 e0 ldi r23, 0x00 ; 0 1fe: 81 e5 ldi r24, 0x51 ; 81 200: 9e e0 ldi r25, 0x0E ; 14 202: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> TaskManager::AddTask(Coffee::ResetWEB,0,0,TaskManager::SINGLE_RUN,15000,TaskManager::MEDIUM); 206: 08 e9 ldi r16, 0x98 ; 152 208: 1a e3 ldi r17, 0x3A ; 58 20a: 20 e0 ldi r18, 0x00 ; 0 20c: 40 e0 ldi r20, 0x00 ; 0 20e: 50 e0 ldi r21, 0x00 ; 0 210: 60 e0 ldi r22, 0x00 ; 0 212: 70 e0 ldi r23, 0x00 ; 0 214: 80 ec ldi r24, 0xC0 ; 192 216: 9e e0 ldi r25, 0x0E ; 14 218: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> //TaskManager::AddTask(TurnOffLight,0,0,TaskManager::SINGLE_RUN,3333,TaskManager::MEDIUM); //TaskManager::AddTask(TestServo,0,0,TaskManager::MULTI_RUN,200,TaskManager::MEDIUM); for(;;){ TaskManager::ExecuteNextTask(); 21c: 0e 94 16 08 call 0x102c ; 0x102c <_ZN11TaskManager15ExecuteNextTaskEv> 220: fd cf rjmp .-6 ; 0x21c 00000222 <_Z12UpdateWeightPvS_>: void Delay10(void* u1, void* u2){ TaskManager::AddTask(TestTWI,0,0,TaskManager::MULTI_RUN,1,TaskManager::LOW); } void UpdateWeight(void* u1, void* u2){ 222: df 93 push r29 224: cf 93 push r28 226: 0f 92 push r0 228: cd b7 in r28, 0x3d ; 61 22a: de b7 in r29, 0x3e ; 62 uint8_t data = WEIGHT_UPDATE; 22c: 80 e4 ldi r24, 0x40 ; 64 22e: 89 83 std Y+1, r24 ; 0x01 TWI::Send(COFFEE_WEIGHT,&data,1); 230: 41 e0 ldi r20, 0x01 ; 1 232: be 01 movw r22, r28 234: 6f 5f subi r22, 0xFF ; 255 236: 7f 4f sbci r23, 0xFF ; 255 238: 88 e0 ldi r24, 0x08 ; 8 23a: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> } 23e: 0f 90 pop r0 240: cf 91 pop r28 242: df 91 pop r29 244: 08 95 ret 00000246 <_Z10PowerCheckPvS_>: //Menu::twi_packs = 0xff; } void PowerCheck(void* u1, void* u2){ static uint8_t onoff = 0x00; cli(); 246: f8 94 cli if(Coffee::power_stat.end_time<=Clock::ticks){ 248: 20 91 23 05 lds r18, 0x0523 24c: 30 91 24 05 lds r19, 0x0524 250: 40 91 25 05 lds r20, 0x0525 254: 50 91 26 05 lds r21, 0x0526 258: 80 91 0c 05 lds r24, 0x050C 25c: 90 91 0d 05 lds r25, 0x050D 260: a0 91 0e 05 lds r26, 0x050E 264: b0 91 0f 05 lds r27, 0x050F 268: 28 17 cp r18, r24 26a: 39 07 cpc r19, r25 26c: 4a 07 cpc r20, r26 26e: 5b 07 cpc r21, r27 270: 60 f0 brcs .+24 ; 0x28a <_Z10PowerCheckPvS_+0x44> sei(); 272: 78 94 sei TWI::Send(COFFEE_POWER,&onoff,1); 274: 41 e0 ldi r20, 0x01 ; 1 276: 6e e9 ldi r22, 0x9E ; 158 278: 71 e0 ldi r23, 0x01 ; 1 27a: 82 e0 ldi r24, 0x02 ; 2 27c: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> TaskManager::DeleteTask(PowerCheck); 280: 83 e2 ldi r24, 0x23 ; 35 282: 91 e0 ldi r25, 0x01 ; 1 284: 0e 94 51 09 call 0x12a2 ; 0x12a2 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E> 288: 08 95 ret } else sei(); 28a: 78 94 sei 28c: 08 95 ret 0000028e <_Z7TestTWIPvS_>: } PORTF = PINF ^ 0xff; } void TestTWI(void* u1, void* u2){ 28e: df 93 push r29 290: cf 93 push r28 292: cd b7 in r28, 0x3d ; 61 294: de b7 in r29, 0x3e ; 62 296: 60 97 sbiw r28, 0x10 ; 16 298: 0f b6 in r0, 0x3f ; 63 29a: f8 94 cli 29c: de bf out 0x3e, r29 ; 62 29e: 0f be out 0x3f, r0 ; 63 2a0: cd bf out 0x3d, r28 ; 61 uint8_t byte[16]; byte[0] = COFFEE_MAIN; 2a2: 81 e0 ldi r24, 0x01 ; 1 2a4: 89 83 std Y+1, r24 ; 0x01 if(TWI::Send(COFFEE_WATER1,byte,2)==0) 2a6: 42 e0 ldi r20, 0x02 ; 2 2a8: be 01 movw r22, r28 2aa: 6f 5f subi r22, 0xFF ; 255 2ac: 7f 4f sbci r23, 0xFF ; 255 2ae: 8d e0 ldi r24, 0x0D ; 13 2b0: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> 2b4: 88 23 and r24, r24 2b6: 21 f4 brne .+8 ; 0x2c0 <_Z7TestTWIPvS_+0x32> TaskManager::DeleteTask(TestTWI); 2b8: 87 e4 ldi r24, 0x47 ; 71 2ba: 91 e0 ldi r25, 0x01 ; 1 2bc: 0e 94 51 09 call 0x12a2 ; 0x12a2 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E> } 2c0: 60 96 adiw r28, 0x10 ; 16 2c2: 0f b6 in r0, 0x3f ; 63 2c4: f8 94 cli 2c6: de bf out 0x3e, r29 ; 62 2c8: 0f be out 0x3f, r0 ; 63 2ca: cd bf out 0x3d, r28 ; 61 2cc: cf 91 pop r28 2ce: df 91 pop r29 2d0: 08 95 ret 000002d2 <_Z11Twi_ReceivePvS_>: void Twi_Receive(void* data_ptr, void* unused){ struct TWI::TWI_Packet* pack = (TWI::TWI_Packet*)data_ptr; 2d2: fc 01 movw r30, r24 PORTF = PINF ^ 0xff; 2d4: 80 b1 in r24, 0x00 ; 0 2d6: 80 95 com r24 2d8: 80 93 62 00 sts 0x0062, r24 if(pack->check!=TWI::GOOD) 2dc: 83 89 ldd r24, Z+19 ; 0x13 2de: 82 30 cpi r24, 0x02 ; 2 2e0: 09 f0 breq .+2 ; 0x2e4 <_Z11Twi_ReceivePvS_+0x12> 2e2: 69 c0 rjmp .+210 ; 0x3b6 <_Z11Twi_ReceivePvS_+0xe4> return; twi_packs_rec++; 2e4: 80 91 9c 01 lds r24, 0x019C 2e8: 90 91 9d 01 lds r25, 0x019D 2ec: 01 96 adiw r24, 0x01 ; 1 2ee: 90 93 9d 01 sts 0x019D, r25 2f2: 80 93 9c 01 sts 0x019C, r24 switch(pack->packet[0]){ 2f6: 82 81 ldd r24, Z+2 ; 0x02 2f8: 8f 30 cpi r24, 0x0F ; 15 2fa: 09 f4 brne .+2 ; 0x2fe <_Z11Twi_ReceivePvS_+0x2c> 2fc: 53 c0 rjmp .+166 ; 0x3a4 <_Z11Twi_ReceivePvS_+0xd2> 2fe: 80 31 cpi r24, 0x10 ; 16 300: 30 f4 brcc .+12 ; 0x30e <_Z11Twi_ReceivePvS_+0x3c> 302: 83 30 cpi r24, 0x03 ; 3 304: 81 f0 breq .+32 ; 0x326 <_Z11Twi_ReceivePvS_+0x54> 306: 84 30 cpi r24, 0x04 ; 4 308: 09 f0 breq .+2 ; 0x30c <_Z11Twi_ReceivePvS_+0x3a> 30a: 55 c0 rjmp .+170 ; 0x3b6 <_Z11Twi_ReceivePvS_+0xe4> 30c: 08 c0 rjmp .+16 ; 0x31e <_Z11Twi_ReceivePvS_+0x4c> 30e: 80 35 cpi r24, 0x50 ; 80 310: 19 f1 breq .+70 ; 0x358 <_Z11Twi_ReceivePvS_+0x86> 312: 85 3a cpi r24, 0xA5 ; 165 314: e1 f1 breq .+120 ; 0x38e <_Z11Twi_ReceivePvS_+0xbc> 316: 80 34 cpi r24, 0x40 ; 64 318: 09 f0 breq .+2 ; 0x31c <_Z11Twi_ReceivePvS_+0x4a> 31a: 4d c0 rjmp .+154 ; 0x3b6 <_Z11Twi_ReceivePvS_+0xe4> 31c: 08 c0 rjmp .+16 ; 0x32e <_Z11Twi_ReceivePvS_+0x5c> case COFFEE_MOTOR2: Coffee::motor_filter_status = (Coffee::Motor_Status)pack->packet[1]; 31e: 83 81 ldd r24, Z+3 ; 0x03 320: 80 93 10 05 sts 0x0510, r24 324: 2d c0 rjmp .+90 ; 0x380 <_Z11Twi_ReceivePvS_+0xae> TaskManager::PostponeTask(CoffeeLogic::MakeCoffee,0); break; case COFFEE_MOTOR1: Coffee::motor_arm_status = (Coffee::Motor_Status)pack->packet[1]; 326: 83 81 ldd r24, Z+3 ; 0x03 328: 80 93 11 05 sts 0x0511, r24 32c: 29 c0 rjmp .+82 ; 0x380 <_Z11Twi_ReceivePvS_+0xae> TaskManager::PostponeTask(CoffeeLogic::MakeCoffee,0); break; case WEIGHT_UPDATE: Coffee::current_weight.coffee = (pack->packet[1]<<8) + pack->packet[2]; 32e: 23 81 ldd r18, Z+3 ; 0x03 330: 34 81 ldd r19, Z+4 ; 0x04 332: 92 2f mov r25, r18 334: 80 e0 ldi r24, 0x00 ; 0 336: 83 0f add r24, r19 338: 91 1d adc r25, r1 33a: 90 93 19 05 sts 0x0519, r25 33e: 80 93 18 05 sts 0x0518, r24 Coffee::current_weight.water = (pack->packet[3]<<8) + pack->packet[4]; 342: 25 81 ldd r18, Z+5 ; 0x05 344: 36 81 ldd r19, Z+6 ; 0x06 346: 92 2f mov r25, r18 348: 80 e0 ldi r24, 0x00 ; 0 34a: 83 0f add r24, r19 34c: 91 1d adc r25, r1 34e: 90 93 17 05 sts 0x0517, r25 352: 80 93 16 05 sts 0x0516, r24 356: 08 95 ret break; case CURRENT_UPDATE: Coffee::vacuum_current[1] = (uint16_t)(pack->packet[7]<<8) + (uint16_t)pack->packet[8]; 358: 21 85 ldd r18, Z+9 ; 0x09 35a: 32 85 ldd r19, Z+10 ; 0x0a 35c: 92 2f mov r25, r18 35e: 80 e0 ldi r24, 0x00 ; 0 360: 83 0f add r24, r19 362: 91 1d adc r25, r1 364: 90 93 1f 05 sts 0x051F, r25 368: 80 93 1e 05 sts 0x051E, r24 Coffee::vacuum_current[0] = (uint16_t)(pack->packet[3]<<8) + (uint16_t)pack->packet[4]; 36c: 25 81 ldd r18, Z+5 ; 0x05 36e: 36 81 ldd r19, Z+6 ; 0x06 370: 92 2f mov r25, r18 372: 80 e0 ldi r24, 0x00 ; 0 374: 83 0f add r24, r19 376: 91 1d adc r25, r1 378: 90 93 1d 05 sts 0x051D, r25 37c: 80 93 1c 05 sts 0x051C, r24 TaskManager::PostponeTask(CoffeeLogic::MakeCoffee,0); 380: 60 e0 ldi r22, 0x00 ; 0 382: 70 e0 ldi r23, 0x00 ; 0 384: 8d ef ldi r24, 0xFD ; 253 386: 9e e0 ldi r25, 0x0E ; 14 388: 0e 94 a8 08 call 0x1150 ; 0x1150 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej> 38c: 08 95 ret break; case 0xa5: Coffee::garbage_arm_period = (pack->packet[2]<<8) + pack->packet[1]; 38e: 84 81 ldd r24, Z+4 ; 0x04 390: 93 81 ldd r25, Z+3 ; 0x03 392: 38 2f mov r19, r24 394: 20 e0 ldi r18, 0x00 ; 0 396: 29 0f add r18, r25 398: 31 1d adc r19, r1 39a: 30 93 21 05 sts 0x0521, r19 39e: 20 93 20 05 sts 0x0520, r18 3a2: 08 95 ret break; case COFFEE_GARBAGE://Garbage arm status Coffee::garbage_arm = (Coffee::Motor_Status)pack->packet[1]; 3a4: 83 81 ldd r24, Z+3 ; 0x03 3a6: 80 93 22 05 sts 0x0522, r24 TaskManager::PostponeTask(CoffeeLogic::MakeCoffee,5000); 3aa: 68 e8 ldi r22, 0x88 ; 136 3ac: 73 e1 ldi r23, 0x13 ; 19 3ae: 8d ef ldi r24, 0xFD ; 253 3b0: 9e e0 ldi r25, 0x0E ; 14 3b2: 0e 94 a8 08 call 0x1150 ; 0x1150 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej> 3b6: 08 95 ret 000003b8 <_Z12Uart_ReceivePvS_>: uint16_t twi_packs_rec = 0; void PowerCheck(void* u1, void* u2); void TestTWI(void* u1, void* u2); void Uart_Receive(void* buffer_ptr, void* buffer_size){ 3b8: ef 92 push r14 3ba: ff 92 push r15 3bc: 0f 93 push r16 3be: 1f 93 push r17 3c0: df 93 push r29 3c2: cf 93 push r28 3c4: 00 d0 rcall .+0 ; 0x3c6 <_Z12Uart_ReceivePvS_+0xe> 3c6: 0f 92 push r0 3c8: cd b7 in r28, 0x3d ; 61 3ca: de b7 in r29, 0x3e ; 62 3cc: 9c 01 movw r18, r24 uint8_t* p = (uint8_t*)buffer_ptr; 3ce: 8c 01 movw r16, r24 static uint8_t out_arr[16]; //uint8_t size = *((uint8_t*)buffer_size); if(p[0]==WEB_HIT) 3d0: fc 01 movw r30, r24 3d2: 90 81 ld r25, Z 3d4: 92 31 cpi r25, 0x12 ; 18 3d6: 31 f4 brne .+12 ; 0x3e4 <_Z12Uart_ReceivePvS_+0x2c> Coffee::cur_webstatus.hit_count++; 3d8: 80 91 07 05 lds r24, 0x0507 3dc: 8f 5f subi r24, 0xFF ; 255 3de: 80 93 07 05 sts 0x0507, r24 3e2: a3 c1 rjmp .+838 ; 0x72a <_Z12Uart_ReceivePvS_+0x372> else if(p[0]==WEB_STAT){ 3e4: 91 31 cpi r25, 0x11 ; 17 3e6: a1 f4 brne .+40 ; 0x410 <_Z12Uart_ReceivePvS_+0x58> 3e8: d9 01 movw r26, r18 3ea: 26 ef ldi r18, 0xF6 ; 246 3ec: 34 e0 ldi r19, 0x04 ; 4 //Copy the new status for(uint8_t i = 1; i < 17; i++){ Coffee::cur_webstatus.cur_status[i-1] = p[i]; 3ee: fd 01 movw r30, r26 3f0: 81 81 ldd r24, Z+1 ; 0x01 3f2: f9 01 movw r30, r18 3f4: 80 83 st Z, r24 if(p[i]==0) 3f6: fd 01 movw r30, r26 3f8: 81 81 ldd r24, Z+1 ; 0x01 3fa: 88 23 and r24, r24 3fc: 09 f4 brne .+2 ; 0x400 <_Z12Uart_ReceivePvS_+0x48> 3fe: 95 c1 rjmp .+810 ; 0x72a <_Z12Uart_ReceivePvS_+0x372> break; 400: 11 96 adiw r26, 0x01 ; 1 402: 2f 5f subi r18, 0xFF ; 255 404: 3f 4f sbci r19, 0xFF ; 255 //uint8_t size = *((uint8_t*)buffer_size); if(p[0]==WEB_HIT) Coffee::cur_webstatus.hit_count++; else if(p[0]==WEB_STAT){ //Copy the new status for(uint8_t i = 1; i < 17; i++){ 406: f5 e0 ldi r31, 0x05 ; 5 408: 26 30 cpi r18, 0x06 ; 6 40a: 3f 07 cpc r19, r31 40c: 81 f7 brne .-32 ; 0x3ee <_Z12Uart_ReceivePvS_+0x36> 40e: 8d c1 rjmp .+794 ; 0x72a <_Z12Uart_ReceivePvS_+0x372> Coffee::cur_webstatus.cur_status[i-1] = p[i]; if(p[i]==0) break; } } else if(p[0]==UART_WRITE){//Expecting an answer back 410: 91 30 cpi r25, 0x01 ; 1 412: 09 f0 breq .+2 ; 0x416 <_Z12Uart_ReceivePvS_+0x5e> 414: 8a c1 rjmp .+788 ; 0x72a <_Z12Uart_ReceivePvS_+0x372> if(p[1]==WEB_HIT){//Return the number of hits, so far on the web page 416: f9 01 movw r30, r18 418: f1 80 ldd r15, Z+1 ; 0x01 41a: f2 e1 ldi r31, 0x12 ; 18 41c: ff 16 cp r15, r31 41e: 39 f4 brne .+14 ; 0x42e <_Z12Uart_ReceivePvS_+0x76> out_arr[0] = UART_WRITE; 420: 90 93 9f 01 sts 0x019F, r25 out_arr[1] = WEB_HIT; 424: f0 92 a0 01 sts 0x01A0, r15 out_arr[2] = Coffee::cur_webstatus.hit_count; 428: 80 91 07 05 lds r24, 0x0507 42c: ca c0 rjmp .+404 ; 0x5c2 <_Z12Uart_ReceivePvS_+0x20a> Uart::Send(out_arr,3); } else if(p[1]==COFFEE_START){ 42e: 88 e8 ldi r24, 0x88 ; 136 430: f8 16 cp r15, r24 432: c1 f4 brne .+48 ; 0x464 <_Z12Uart_ReceivePvS_+0xac> TaskManager::DeleteTask(CoffeeLogic::MakeCoffee); 434: 8d ef ldi r24, 0xFD ; 253 436: 9e e0 ldi r25, 0x0E ; 14 438: 0e 94 51 09 call 0x12a2 ; 0x12a2 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E> TaskManager::AddTask(CoffeeLogic::MakeCoffee,0,0,TaskManager::MULTI_RUN,60000,TaskManager::MEDIUM); 43c: 62 e3 ldi r22, 0x32 ; 50 43e: e6 2e mov r14, r22 440: 00 e6 ldi r16, 0x60 ; 96 442: 1a ee ldi r17, 0xEA ; 234 444: 21 e0 ldi r18, 0x01 ; 1 446: 40 e0 ldi r20, 0x00 ; 0 448: 50 e0 ldi r21, 0x00 ; 0 44a: 60 e0 ldi r22, 0x00 ; 0 44c: 70 e0 ldi r23, 0x00 ; 0 44e: 8d ef ldi r24, 0xFD ; 253 450: 9e e0 ldi r25, 0x0E ; 14 452: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> TaskManager::PostponeTask(CoffeeLogic::MakeCoffee,0); 456: 60 e0 ldi r22, 0x00 ; 0 458: 70 e0 ldi r23, 0x00 ; 0 45a: 8d ef ldi r24, 0xFD ; 253 45c: 9e e0 ldi r25, 0x0E ; 14 45e: 0e 94 a8 08 call 0x1150 ; 0x1150 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej> 462: 63 c1 rjmp .+710 ; 0x72a <_Z12Uart_ReceivePvS_+0x372> } else if(p[1]==TWI_STAT){ 464: e0 ea ldi r30, 0xA0 ; 160 466: fe 16 cp r15, r30 468: 09 f0 breq .+2 ; 0x46c <_Z12Uart_ReceivePvS_+0xb4> 46a: 45 c0 rjmp .+138 ; 0x4f6 <_Z12Uart_ReceivePvS_+0x13e> out_arr[0] = UART_WRITE; 46c: 90 93 9f 01 sts 0x019F, r25 out_arr[1] = TWI_STAT; 470: f0 92 a0 01 sts 0x01A0, r15 out_arr[2] = TWI::numRetries; 474: 80 91 03 04 lds r24, 0x0403 478: 80 93 a1 01 sts 0x01A1, r24 out_arr[3] = TWI::current_mode; 47c: 80 91 d9 03 lds r24, 0x03D9 480: 80 93 a2 01 sts 0x01A2, r24 if(TWI::current_mode==TWI::MSTR_ERR_SLAVE_NACK) 484: 80 91 d9 03 lds r24, 0x03D9 488: 88 31 cpi r24, 0x18 ; 24 48a: 19 f4 brne .+6 ; 0x492 <_Z12Uart_ReceivePvS_+0xda> out_arr[4] = TWI::out_packet.address_r_w; 48c: 80 91 ee 03 lds r24, 0x03EE 490: 02 c0 rjmp .+4 ; 0x496 <_Z12Uart_ReceivePvS_+0xde> else out_arr[4] = TWI::lost_arbs; 492: 80 91 06 04 lds r24, 0x0406 496: 80 93 a3 01 sts 0x01A3, r24 out_arr[5] = (uint8_t)(TWI::num_packs_sent>>8); 49a: 80 91 04 04 lds r24, 0x0404 49e: 90 91 05 04 lds r25, 0x0405 4a2: 90 93 a4 01 sts 0x01A4, r25 out_arr[6] = (uint8_t)TWI::num_packs_sent; 4a6: 80 91 04 04 lds r24, 0x0404 4aa: 90 91 05 04 lds r25, 0x0405 4ae: 80 93 a5 01 sts 0x01A5, r24 out_arr[7] = (uint8_t)(twi_packs_rec>>8); 4b2: 90 91 9c 01 lds r25, 0x019C 4b6: 80 91 9d 01 lds r24, 0x019D 4ba: 80 93 a6 01 sts 0x01A6, r24 out_arr[8] = (uint8_t)twi_packs_rec; 4be: 90 93 a7 01 sts 0x01A7, r25 out_arr[9] = TWI::slave_nacks; 4c2: 80 91 07 04 lds r24, 0x0407 4c6: 80 93 a8 01 sts 0x01A8, r24 out_arr[10] = _ADDRESS(TWI::out_packet.address_r_w); 4ca: 80 91 ee 03 lds r24, 0x03EE 4ce: 90 e0 ldi r25, 0x00 ; 0 4d0: 95 95 asr r25 4d2: 87 95 ror r24 4d4: 80 93 a9 01 sts 0x01A9, r24 out_arr[11] = TWI::out_packet.packet_length; 4d8: 80 91 ef 03 lds r24, 0x03EF 4dc: 80 93 aa 01 sts 0x01AA, r24 out_arr[12] = TWI::in_packet.packet[0]; 4e0: 80 91 dc 03 lds r24, 0x03DC 4e4: 80 93 ab 01 sts 0x01AB, r24 out_arr[13] = TWI::in_packet.packet_length; 4e8: 80 91 db 03 lds r24, 0x03DB 4ec: 80 93 ac 01 sts 0x01AC, r24 Uart::Send(out_arr,14); 4f0: 6e e0 ldi r22, 0x0E ; 14 4f2: 70 e0 ldi r23, 0x00 ; 0 4f4: 16 c1 rjmp .+556 ; 0x722 <_Z12Uart_ReceivePvS_+0x36a> } else if(p[1]==COFFEE_UPTIME){ 4f6: f3 e1 ldi r31, 0x13 ; 19 4f8: ff 16 cp r15, r31 4fa: b9 f4 brne .+46 ; 0x52a <_Z12Uart_ReceivePvS_+0x172> out_arr[0] = UART_WRITE; 4fc: 90 93 9f 01 sts 0x019F, r25 out_arr[1] = COFFEE_UPTIME; 500: f0 92 a0 01 sts 0x01A0, r15 cli(); 504: f8 94 cli out_arr[2] = ((uint8_t*)(&Clock::ticks))[3]; 506: 80 91 26 05 lds r24, 0x0526 50a: 80 93 a1 01 sts 0x01A1, r24 out_arr[3] = ((uint8_t*)(&Clock::ticks))[2]; 50e: 80 91 25 05 lds r24, 0x0525 512: 80 93 a2 01 sts 0x01A2, r24 out_arr[4] = ((uint8_t*)(&Clock::ticks))[1]; 516: 80 91 24 05 lds r24, 0x0524 51a: 80 93 a3 01 sts 0x01A3, r24 out_arr[5] = ((uint8_t*)(&Clock::ticks))[0]; 51e: 80 91 23 05 lds r24, 0x0523 522: 80 93 a4 01 sts 0x01A4, r24 sei(); 526: 78 94 sei 528: 9f c0 rjmp .+318 ; 0x668 <_Z12Uart_ReceivePvS_+0x2b0> Uart::Send(out_arr,6); } else if(p[1]==COFFEE_END_TIME){ 52a: 84 e1 ldi r24, 0x14 ; 20 52c: f8 16 cp r15, r24 52e: a9 f4 brne .+42 ; 0x55a <_Z12Uart_ReceivePvS_+0x1a2> out_arr[0] = UART_WRITE; 530: 90 93 9f 01 sts 0x019F, r25 out_arr[1] = COFFEE_END_TIME; 534: f0 92 a0 01 sts 0x01A0, r15 out_arr[2] = ((uint8_t*)(&Coffee::power_stat.end_time))[3]; 538: 80 91 0f 05 lds r24, 0x050F 53c: 80 93 a1 01 sts 0x01A1, r24 out_arr[3] = ((uint8_t*)(&Coffee::power_stat.end_time))[2]; 540: 80 91 0e 05 lds r24, 0x050E 544: 80 93 a2 01 sts 0x01A2, r24 out_arr[4] = ((uint8_t*)(&Coffee::power_stat.end_time))[1]; 548: 80 91 0d 05 lds r24, 0x050D 54c: 80 93 a3 01 sts 0x01A3, r24 out_arr[5] = ((uint8_t*)(&Coffee::power_stat.end_time))[0]; 550: 80 91 0c 05 lds r24, 0x050C 554: 80 93 a4 01 sts 0x01A4, r24 558: 87 c0 rjmp .+270 ; 0x668 <_Z12Uart_ReceivePvS_+0x2b0> Uart::Send(out_arr,6); } //else if(p[1]== else if(p[1]==RESET_NOW){ 55a: e0 e3 ldi r30, 0x30 ; 48 55c: fe 16 cp r15, r30 55e: 79 f4 brne .+30 ; 0x57e <_Z12Uart_ReceivePvS_+0x1c6> uint8_t cmd[2] = {RESET_NOW,0xff}; 560: f9 82 std Y+1, r15 ; 0x01 562: 8f ef ldi r24, 0xFF ; 255 564: 8a 83 std Y+2, r24 ; 0x02 TWI::Send(COFFEE_RESET,cmd,2);//Reset it at once 566: 42 e0 ldi r20, 0x02 ; 2 568: be 01 movw r22, r28 56a: 6f 5f subi r22, 0xFF ; 255 56c: 7f 4f sbci r23, 0xFF ; 255 56e: 87 e0 ldi r24, 0x07 ; 7 570: 9b 83 std Y+3, r25 ; 0x03 572: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> out_arr[0] = UART_WRITE; 576: 9b 81 ldd r25, Y+3 ; 0x03 578: 90 93 9f 01 sts 0x019F, r25 57c: c3 c0 rjmp .+390 ; 0x704 <_Z12Uart_ReceivePvS_+0x34c> out_arr[1] = RESET_NOW;//Send 'ok' back Uart::Send(out_arr,2); } else if(p[1]==MOTOR_STATUS_UPDATE){ 57e: f1 e2 ldi r31, 0x21 ; 33 580: ff 16 cp r15, r31 582: 71 f4 brne .+28 ; 0x5a0 <_Z12Uart_ReceivePvS_+0x1e8> Coffee::RunMotor(&p[2],&p[3]); 584: 0d 5f subi r16, 0xFD ; 253 586: 1f 4f sbci r17, 0xFF ; 255 588: b8 01 movw r22, r16 58a: c8 01 movw r24, r16 58c: 01 97 sbiw r24, 0x01 ; 1 58e: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> out_arr[0] = UART_WRITE; 592: 81 e0 ldi r24, 0x01 ; 1 594: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = MOTOR_STATUS_UPDATE;//'ok' 598: 81 e2 ldi r24, 0x21 ; 33 59a: 80 93 a0 01 sts 0x01A0, r24 59e: b4 c0 rjmp .+360 ; 0x708 <_Z12Uart_ReceivePvS_+0x350> Uart::Send(out_arr,2); } else if(p[1]==MOTOR_STATUS_GET){ 5a0: 83 e2 ldi r24, 0x23 ; 35 5a2: f8 16 cp r15, r24 5a4: 89 f4 brne .+34 ; 0x5c8 <_Z12Uart_ReceivePvS_+0x210> out_arr[0] = UART_WRITE; 5a6: 81 e0 ldi r24, 0x01 ; 1 5a8: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = MOTOR_STATUS_GET; 5ac: f0 92 a0 01 sts 0x01A0, r15 if(p[2]==0) 5b0: f9 01 movw r30, r18 5b2: 82 81 ldd r24, Z+2 ; 0x02 5b4: 88 23 and r24, r24 5b6: 19 f4 brne .+6 ; 0x5be <_Z12Uart_ReceivePvS_+0x206> out_arr[2] = (uint8_t)Coffee::motor_arm_status; 5b8: 80 91 11 05 lds r24, 0x0511 5bc: 02 c0 rjmp .+4 ; 0x5c2 <_Z12Uart_ReceivePvS_+0x20a> else out_arr[2] = (uint8_t)Coffee::motor_filter_status; 5be: 80 91 10 05 lds r24, 0x0510 5c2: 80 93 a1 01 sts 0x01A1, r24 5c6: ab c0 rjmp .+342 ; 0x71e <_Z12Uart_ReceivePvS_+0x366> Uart::Send(out_arr,3); } else if(p[1]==SERVO_SET){ 5c8: f2 e2 ldi r31, 0x22 ; 34 5ca: ff 16 cp r15, r31 5cc: 41 f4 brne .+16 ; 0x5de <_Z12Uart_ReceivePvS_+0x226> Coffee::SetServo(&p[2],&p[3]); 5ce: 0d 5f subi r16, 0xFD ; 253 5d0: 1f 4f sbci r17, 0xFF ; 255 5d2: b8 01 movw r22, r16 5d4: c8 01 movw r24, r16 5d6: 01 97 sbiw r24, 0x01 ; 1 5d8: 0e 94 54 0d call 0x1aa8 ; 0x1aa8 <_ZN6Coffee8SetServoEPvS0_> 5dc: 90 c0 rjmp .+288 ; 0x6fe <_Z12Uart_ReceivePvS_+0x346> out_arr[0] = UART_WRITE; out_arr[1] = SERVO_SET;//'ok' Uart::Send(out_arr,2); } else if(p[1]==0x90){//Reset command, so that we can reset the device and enter bootloader mode 5de: 80 e9 ldi r24, 0x90 ; 144 5e0: f8 16 cp r15, r24 5e2: a9 f4 brne .+42 ; 0x60e <_Z12Uart_ReceivePvS_+0x256> cli(); 5e4: f8 94 cli TIMSK = 0; 5e6: 17 be out 0x37, r1 ; 55 TCCR2 = 0; 5e8: 15 bc out 0x25, r1 ; 37 TCCR1B = 0; 5ea: 1e bc out 0x2e, r1 ; 46 TCCR1A = 0; 5ec: 1f bc out 0x2f, r1 ; 47 Coffee::PostponeReset(0,0);//Postpone it a last time befor entering this mode 5ee: 60 e0 ldi r22, 0x00 ; 0 5f0: 70 e0 ldi r23, 0x00 ; 0 5f2: 80 e0 ldi r24, 0x00 ; 0 5f4: 90 e0 ldi r25, 0x00 ; 0 5f6: 0e 94 51 0e call 0x1ca2 ; 0x1ca2 <_ZN6Coffee13PostponeResetEPvS0_> wdt_enable(WDTO_500MS); 5fa: 2d e0 ldi r18, 0x0D ; 13 5fc: 88 e1 ldi r24, 0x18 ; 24 5fe: 90 e0 ldi r25, 0x00 ; 0 600: 0f b6 in r0, 0x3f ; 63 602: f8 94 cli 604: a8 95 wdr 606: 81 bd out 0x21, r24 ; 33 608: 0f be out 0x3f, r0 ; 63 60a: 21 bd out 0x21, r18 ; 33 60c: ff cf rjmp .-2 ; 0x60c <_Z12Uart_ReceivePvS_+0x254> for(;;) ; } else if(p[1]==WEIGHT_UPDATE){ 60e: e0 e4 ldi r30, 0x40 ; 64 610: fe 16 cp r15, r30 612: 91 f4 brne .+36 ; 0x638 <_Z12Uart_ReceivePvS_+0x280> out_arr[0] = UART_WRITE; 614: 81 e0 ldi r24, 0x01 ; 1 616: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = WEIGHT_UPDATE; 61a: f0 92 a0 01 sts 0x01A0, r15 out_arr[2] = (uint8_t)(Coffee::current_weight.coffee>>8); 61e: 90 91 18 05 lds r25, 0x0518 622: 80 91 19 05 lds r24, 0x0519 626: 80 93 a1 01 sts 0x01A1, r24 out_arr[3] = (uint8_t)Coffee::current_weight.coffee; 62a: 90 93 a2 01 sts 0x01A2, r25 out_arr[4] = (uint8_t)(Coffee::current_weight.water>>8); 62e: 90 91 16 05 lds r25, 0x0516 632: 80 91 17 05 lds r24, 0x0517 636: 14 c0 rjmp .+40 ; 0x660 <_Z12Uart_ReceivePvS_+0x2a8> out_arr[5] = (uint8_t)Coffee::current_weight.water; Uart::Send(out_arr,6); } else if(p[1]==CURRENT_UPDATE){ 638: f0 e5 ldi r31, 0x50 ; 80 63a: ff 16 cp r15, r31 63c: c1 f4 brne .+48 ; 0x66e <_Z12Uart_ReceivePvS_+0x2b6> out_arr[0] = UART_WRITE; 63e: 81 e0 ldi r24, 0x01 ; 1 640: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = CURRENT_UPDATE; 644: f0 92 a0 01 sts 0x01A0, r15 out_arr[2] = (uint8_t)(Coffee::vacuum_current[0]>>8); 648: 90 91 1c 05 lds r25, 0x051C 64c: 80 91 1d 05 lds r24, 0x051D 650: 80 93 a1 01 sts 0x01A1, r24 out_arr[3] = (uint8_t)Coffee::vacuum_current[0]; 654: 90 93 a2 01 sts 0x01A2, r25 out_arr[4] = (uint8_t)(Coffee::vacuum_current[1]>>8); 658: 90 91 1e 05 lds r25, 0x051E 65c: 80 91 1f 05 lds r24, 0x051F 660: 80 93 a3 01 sts 0x01A3, r24 out_arr[5] = (uint8_t)Coffee::vacuum_current[1]; 664: 90 93 a4 01 sts 0x01A4, r25 Uart::Send(out_arr,6); 668: 66 e0 ldi r22, 0x06 ; 6 66a: 70 e0 ldi r23, 0x00 ; 0 66c: 5a c0 rjmp .+180 ; 0x722 <_Z12Uart_ReceivePvS_+0x36a> } else if(p[1]==VACUUM_UPDATE){ 66e: 81 e5 ldi r24, 0x51 ; 81 670: f8 16 cp r15, r24 672: 41 f4 brne .+16 ; 0x684 <_Z12Uart_ReceivePvS_+0x2cc> Coffee::SetVacuum(&p[2],&p[3]); 674: 0d 5f subi r16, 0xFD ; 253 676: 1f 4f sbci r17, 0xFF ; 255 678: b8 01 movw r22, r16 67a: c8 01 movw r24, r16 67c: 01 97 sbiw r24, 0x01 ; 1 67e: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> 682: 3d c0 rjmp .+122 ; 0x6fe <_Z12Uart_ReceivePvS_+0x346> out_arr[0] = UART_WRITE; out_arr[1] = VACUUM_UPDATE; Uart::Send(out_arr,2); } else if(p[1]==VACUUM_GET){ 684: e2 e5 ldi r30, 0x52 ; 82 686: fe 16 cp r15, r30 688: a1 f4 brne .+40 ; 0x6b2 <_Z12Uart_ReceivePvS_+0x2fa> out_arr[0] = UART_WRITE; 68a: 81 e0 ldi r24, 0x01 ; 1 68c: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = VACUUM_GET; 690: f0 92 a0 01 sts 0x01A0, r15 out_arr[2] = p[2];//Index 694: f9 01 movw r30, r18 696: 82 81 ldd r24, Z+2 ; 0x02 698: 80 93 a1 01 sts 0x01A1, r24 out_arr[3] = Coffee::cur_vacuum_pw[p[2]]; 69c: 62 81 ldd r22, Z+2 ; 0x02 69e: e6 2f mov r30, r22 6a0: f0 e0 ldi r31, 0x00 ; 0 6a2: e6 5e subi r30, 0xE6 ; 230 6a4: fa 4f sbci r31, 0xFA ; 250 6a6: 80 81 ld r24, Z 6a8: 80 93 a2 01 sts 0x01A2, r24 Uart::Send(out_arr,4); 6ac: 64 e0 ldi r22, 0x04 ; 4 6ae: 70 e0 ldi r23, 0x00 ; 0 6b0: 38 c0 rjmp .+112 ; 0x722 <_Z12Uart_ReceivePvS_+0x36a> } else if(p[1]==WATER_CONTROL){ 6b2: f0 e7 ldi r31, 0x70 ; 112 6b4: ff 16 cp r15, r31 6b6: 99 f4 brne .+38 ; 0x6de <_Z12Uart_ReceivePvS_+0x326> out_arr[0] = UART_WRITE; 6b8: 81 e0 ldi r24, 0x01 ; 1 6ba: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = WATER_CONTROL; 6be: f0 92 a0 01 sts 0x01A0, r15 Uart::Send(out_arr,2);//Ok 6c2: 62 e0 ldi r22, 0x02 ; 2 6c4: 70 e0 ldi r23, 0x00 ; 0 6c6: 8f e9 ldi r24, 0x9F ; 159 6c8: 91 e0 ldi r25, 0x01 ; 1 6ca: 0e 94 b4 03 call 0x768 ; 0x768 <_ZN4Uart4SendEPhj> Coffee::WaterRun((void*)p[2],(void*)COFFEE_WATER1);//on or off 6ce: 6d e0 ldi r22, 0x0D ; 13 6d0: 70 e0 ldi r23, 0x00 ; 0 6d2: f8 01 movw r30, r16 6d4: 82 81 ldd r24, Z+2 ; 0x02 6d6: 90 e0 ldi r25, 0x00 ; 0 6d8: 0e 94 15 0e call 0x1c2a ; 0x1c2a <_ZN6Coffee8WaterRunEPvS0_> 6dc: 26 c0 rjmp .+76 ; 0x72a <_Z12Uart_ReceivePvS_+0x372> } else if(p[1]==DEBUG_SEND_PACK){ 6de: f0 e6 ldi r31, 0x60 ; 96 6e0: ff 16 cp r15, r31 6e2: a9 f4 brne .+42 ; 0x70e <_Z12Uart_ReceivePvS_+0x356> uint8_t byte[16]; byte[0] = COFFEE_MAIN; //TWI::Send(0x20,byte,16); TaskManager::AddTask(TestTWI,0,0,TaskManager::MULTI_RUN,1,TaskManager::LOW); 6e4: 46 e9 ldi r20, 0x96 ; 150 6e6: e4 2e mov r14, r20 6e8: 01 e0 ldi r16, 0x01 ; 1 6ea: 10 e0 ldi r17, 0x00 ; 0 6ec: 21 e0 ldi r18, 0x01 ; 1 6ee: 40 e0 ldi r20, 0x00 ; 0 6f0: 50 e0 ldi r21, 0x00 ; 0 6f2: 60 e0 ldi r22, 0x00 ; 0 6f4: 70 e0 ldi r23, 0x00 ; 0 6f6: 87 e4 ldi r24, 0x47 ; 71 6f8: 91 e0 ldi r25, 0x01 ; 1 6fa: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> out_arr[0] = UART_WRITE; 6fe: 81 e0 ldi r24, 0x01 ; 1 700: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = DEBUG_SEND_PACK; 704: f0 92 a0 01 sts 0x01A0, r15 Uart::Send(out_arr,2); 708: 62 e0 ldi r22, 0x02 ; 2 70a: 70 e0 ldi r23, 0x00 ; 0 70c: 0a c0 rjmp .+20 ; 0x722 <_Z12Uart_ReceivePvS_+0x36a> } else{ out_arr[0] = UART_WRITE; 70e: 81 e0 ldi r24, 0x01 ; 1 710: 80 93 9f 01 sts 0x019F, r24 out_arr[1] = 0xff; 714: 8f ef ldi r24, 0xFF ; 255 716: 80 93 a0 01 sts 0x01A0, r24 out_arr[2] = 0x00; 71a: 10 92 a1 01 sts 0x01A1, r1 Uart::Send(out_arr,3); 71e: 63 e0 ldi r22, 0x03 ; 3 720: 70 e0 ldi r23, 0x00 ; 0 722: 8f e9 ldi r24, 0x9F ; 159 724: 91 e0 ldi r25, 0x01 ; 1 726: 0e 94 b4 03 call 0x768 ; 0x768 <_ZN4Uart4SendEPhj> } } PORTF = PINF ^ 0xff; 72a: 80 b1 in r24, 0x00 ; 0 72c: 80 95 com r24 72e: 80 93 62 00 sts 0x0062, r24 } 732: 0f 90 pop r0 734: 0f 90 pop r0 736: 0f 90 pop r0 738: cf 91 pop r28 73a: df 91 pop r29 73c: 1f 91 pop r17 73e: 0f 91 pop r16 740: ff 90 pop r15 742: ef 90 pop r14 744: 08 95 ret 00000746 <_ZN4Uart4InitEv>: /* Uart-initialasing */ void Init(void){ #define BAUD 250000 #include //Set up UART1 with 1 stop-bit, 0 parity UBRR1H = UBRRH_VALUE;//0 746: 10 92 98 00 sts 0x0098, r1 UBRR1L = UBRRL_VALUE;// 51->9600 ved 8mHz 74a: 83 e0 ldi r24, 0x03 ; 3 74c: 80 93 99 00 sts 0x0099, r24 #if USE_2X UCSR1A |= (1 << U2X); #else UCSR1A &= ~(1 << U2X); 750: eb e9 ldi r30, 0x9B ; 155 752: f0 e0 ldi r31, 0x00 ; 0 754: 80 81 ld r24, Z 756: 8d 7f andi r24, 0xFD ; 253 758: 80 83 st Z, r24 #endif //Setup both the receiver and the transmitter UCSR1B = (1<: /* Uart-sending, send a buffer of a given length */ void Send(uint8_t* data,uint16_t size){ 768: ac 01 movw r20, r24 uint16_t i; while(!(UCSR1A & (1< ; UDR1 = (uint8_t)(size>>8); 772: 70 93 9c 00 sts 0x009C, r23 buffer_out[0] = (uint8_t)size; 776: 60 93 c3 02 sts 0x02C3, r22 buffer_out_ptr = 0; 77a: 10 92 d2 03 sts 0x03D2, r1 77e: 10 92 d1 03 sts 0x03D1, r1 buffer_out_size = size+1; 782: 6f 5f subi r22, 0xFF ; 255 784: 7f 4f sbci r23, 0xFF ; 255 786: 70 93 d6 03 sts 0x03D6, r23 78a: 60 93 d5 03 sts 0x03D5, r22 78e: 61 50 subi r22, 0x01 ; 1 790: 70 40 sbci r23, 0x00 ; 0 buffer_out_use = 1; 792: 81 e0 ldi r24, 0x01 ; 1 794: 90 e0 ldi r25, 0x00 ; 0 796: 90 93 d4 03 sts 0x03D4, r25 79a: 80 93 d3 03 sts 0x03D3, r24 79e: da 01 movw r26, r20 7a0: 20 e0 ldi r18, 0x00 ; 0 7a2: 30 e0 ldi r19, 0x00 ; 0 7a4: 07 c0 rjmp .+14 ; 0x7b4 <_ZN4Uart4SendEPhj+0x4c> for(i = 0; i < size;i++) //Copy it into the send buffer buffer_out[i+1] = data[i]; 7a6: 2f 5f subi r18, 0xFF ; 255 7a8: 3f 4f sbci r19, 0xFF ; 255 7aa: 8d 91 ld r24, X+ 7ac: f9 01 movw r30, r18 7ae: ed 53 subi r30, 0x3D ; 61 7b0: fd 4f sbci r31, 0xFD ; 253 7b2: 80 83 st Z, r24 buffer_out[0] = (uint8_t)size; buffer_out_ptr = 0; buffer_out_size = size+1; buffer_out_use = 1; for(i = 0; i < size;i++) //Copy it into the send buffer 7b4: 26 17 cp r18, r22 7b6: 37 07 cpc r19, r23 7b8: b0 f3 brcs .-20 ; 0x7a6 <_ZN4Uart4SendEPhj+0x3e> buffer_out[i+1] = data[i]; } 7ba: 08 95 ret 000007bc <_ZN4Uart12Receive_haltEPh>: uint16_t Receive_halt(uint8_t* data){ 7bc: bc 01 movw r22, r24 uint16_t a,size; while(!(UCSR1A & (1< ; size = (uint16_t)UDR1<<8; 7c6: 30 91 9c 00 lds r19, 0x009C while(!(UCSR1A & (1< ; size += (uint16_t)UDR1; 7d2: 20 91 9c 00 lds r18, 0x009C uint16_t Receive_halt(uint8_t* data){ uint16_t a,size; while(!(UCSR1A & (1< for(a=0;a ; data[a] = UDR1; 7ee: 80 91 9c 00 lds r24, 0x009C 7f2: fb 01 movw r30, r22 7f4: e2 0f add r30, r18 7f6: f3 1f adc r31, r19 7f8: 80 83 st Z, r24 size = (uint16_t)UDR1<<8; while(!(UCSR1A & (1< while(!(UCSR1A & (1<: /* Transmit interrupt, gets called whenever a byte has been transmitted. Check if we are done sending the packet */ ISR(USART1_TX_vect){ 808: 1f 92 push r1 80a: 0f 92 push r0 80c: 0f b6 in r0, 0x3f ; 63 80e: 0f 92 push r0 810: 0b b6 in r0, 0x3b ; 59 812: 0f 92 push r0 814: 11 24 eor r1, r1 816: 2f 93 push r18 818: 3f 93 push r19 81a: 8f 93 push r24 81c: 9f 93 push r25 81e: ef 93 push r30 820: ff 93 push r31 if(Uart::buffer_out_ptr UDR1 = Uart::buffer_out[Uart::buffer_out_ptr++]; 838: 80 91 d1 03 lds r24, 0x03D1 83c: 90 91 d2 03 lds r25, 0x03D2 840: fc 01 movw r30, r24 842: ed 53 subi r30, 0x3D ; 61 844: fd 4f sbci r31, 0xFD ; 253 846: 20 81 ld r18, Z 848: 20 93 9c 00 sts 0x009C, r18 84c: 01 96 adiw r24, 0x01 ; 1 84e: 90 93 d2 03 sts 0x03D2, r25 852: 80 93 d1 03 sts 0x03D1, r24 856: 08 c0 rjmp .+16 ; 0x868 <__vector_32+0x60> else{ //We are done with the packet, reset the pointer and the status-byte Uart::buffer_out_ptr = 0; 858: 10 92 d2 03 sts 0x03D2, r1 85c: 10 92 d1 03 sts 0x03D1, r1 Uart::buffer_out_use = 0; 860: 10 92 d4 03 sts 0x03D4, r1 864: 10 92 d3 03 sts 0x03D3, r1 } } 868: ff 91 pop r31 86a: ef 91 pop r30 86c: 9f 91 pop r25 86e: 8f 91 pop r24 870: 3f 91 pop r19 872: 2f 91 pop r18 874: 0f 90 pop r0 876: 0b be out 0x3b, r0 ; 59 878: 0f 90 pop r0 87a: 0f be out 0x3f, r0 ; 63 87c: 0f 90 pop r0 87e: 1f 90 pop r1 880: 18 95 reti 00000882 <__vector_30>: /* Receive interrupt, gets called when a byte has been received. Poll the main loop if a packet has been received */ ISR(USART1_RX_vect){ 882: 1f 92 push r1 884: 0f 92 push r0 886: 0f b6 in r0, 0x3f ; 63 888: 0f 92 push r0 88a: 0b b6 in r0, 0x3b ; 59 88c: 0f 92 push r0 88e: 11 24 eor r1, r1 890: ef 92 push r14 892: 0f 93 push r16 894: 1f 93 push r17 896: 2f 93 push r18 898: 3f 93 push r19 89a: 4f 93 push r20 89c: 5f 93 push r21 89e: 6f 93 push r22 8a0: 7f 93 push r23 8a2: 8f 93 push r24 8a4: 9f 93 push r25 8a6: af 93 push r26 8a8: bf 93 push r27 8aa: ef 93 push r30 8ac: ff 93 push r31 if(Uart::buffer_in_use==0){ 8ae: 80 91 c1 02 lds r24, 0x02C1 8b2: 90 91 c2 02 lds r25, 0x02C2 8b6: 89 2b or r24, r25 8b8: 99 f4 brne .+38 ; 0x8e0 <__vector_30+0x5e> Uart::buffer_in_use = 1; 8ba: 81 e0 ldi r24, 0x01 ; 1 8bc: 90 e0 ldi r25, 0x00 ; 0 8be: 90 93 c2 02 sts 0x02C2, r25 8c2: 80 93 c1 02 sts 0x02C1, r24 Uart::buffer_in_size = ((uint16_t)UDR1)<<8; 8c6: 20 91 9c 00 lds r18, 0x009C 8ca: 92 2f mov r25, r18 8cc: 80 e0 ldi r24, 0x00 ; 0 8ce: 90 93 c0 02 sts 0x02C0, r25 8d2: 80 93 bf 02 sts 0x02BF, r24 Uart::buffer_in_ptr = 0; 8d6: 10 92 be 02 sts 0x02BE, r1 8da: 10 92 bd 02 sts 0x02BD, r1 8de: 41 c0 rjmp .+130 ; 0x962 <__vector_30+0xe0> } else{ if(Uart::buffer_in_ptr==0){ 8e0: 80 91 bd 02 lds r24, 0x02BD 8e4: 90 91 be 02 lds r25, 0x02BE 8e8: 89 2b or r24, r25 8ea: 69 f4 brne .+26 ; 0x906 <__vector_30+0x84> Uart::buffer_in_size += (uint16_t) UDR1; 8ec: 80 91 bf 02 lds r24, 0x02BF 8f0: 90 91 c0 02 lds r25, 0x02C0 8f4: 20 91 9c 00 lds r18, 0x009C 8f8: 82 0f add r24, r18 8fa: 91 1d adc r25, r1 8fc: 90 93 c0 02 sts 0x02C0, r25 900: 80 93 bf 02 sts 0x02BF, r24 904: 25 c0 rjmp .+74 ; 0x950 <__vector_30+0xce> Uart::buffer_in_ptr++; } else{ Uart::buffer_in[Uart::buffer_in_ptr-1] = UDR1; //Receive the byte 906: e0 91 bd 02 lds r30, 0x02BD 90a: f0 91 be 02 lds r31, 0x02BE 90e: 80 91 9c 00 lds r24, 0x009C 912: e2 55 subi r30, 0x52 ; 82 914: fe 4f sbci r31, 0xFE ; 254 916: 80 83 st Z, r24 if(Uart::buffer_in_ptr>=Uart::buffer_in_size){//Check if it is the last in the packet 918: 20 91 bd 02 lds r18, 0x02BD 91c: 30 91 be 02 lds r19, 0x02BE 920: 80 91 bf 02 lds r24, 0x02BF 924: 90 91 c0 02 lds r25, 0x02C0 928: 28 17 cp r18, r24 92a: 39 07 cpc r19, r25 92c: 88 f0 brcs .+34 ; 0x950 <__vector_30+0xce> Uart::buffer_in_use = 0; 92e: 10 92 c2 02 sts 0x02C2, r1 932: 10 92 c1 02 sts 0x02C1, r1 //Process the received UART-packet TaskManager::AddTaskInt(Uart_Receive,(void*)Uart::buffer_in,(void*)&Uart::buffer_in_size,TaskManager::SINGLE_RUN,0,TaskManager::HIGH); 936: ee 24 eor r14, r14 938: 00 e0 ldi r16, 0x00 ; 0 93a: 10 e0 ldi r17, 0x00 ; 0 93c: 20 e0 ldi r18, 0x00 ; 0 93e: 4f eb ldi r20, 0xBF ; 191 940: 52 e0 ldi r21, 0x02 ; 2 942: 6f ea ldi r22, 0xAF ; 175 944: 71 e0 ldi r23, 0x01 ; 1 946: 8c ed ldi r24, 0xDC ; 220 948: 91 e0 ldi r25, 0x01 ; 1 94a: 0e 94 94 07 call 0xf28 ; 0xf28 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> 94e: 09 c0 rjmp .+18 ; 0x962 <__vector_30+0xe0> } else Uart::buffer_in_ptr++; 950: 80 91 bd 02 lds r24, 0x02BD 954: 90 91 be 02 lds r25, 0x02BE 958: 01 96 adiw r24, 0x01 ; 1 95a: 90 93 be 02 sts 0x02BE, r25 95e: 80 93 bd 02 sts 0x02BD, r24 } } } 962: ff 91 pop r31 964: ef 91 pop r30 966: bf 91 pop r27 968: af 91 pop r26 96a: 9f 91 pop r25 96c: 8f 91 pop r24 96e: 7f 91 pop r23 970: 6f 91 pop r22 972: 5f 91 pop r21 974: 4f 91 pop r20 976: 3f 91 pop r19 978: 2f 91 pop r18 97a: 1f 91 pop r17 97c: 0f 91 pop r16 97e: ef 90 pop r14 980: 0f 90 pop r0 982: 0b be out 0x3b, r0 ; 59 984: 0f 90 pop r0 986: 0f be out 0x3f, r0 ; 63 988: 0f 90 pop r0 98a: 1f 90 pop r1 98c: 18 95 reti 0000098e <_ZN3TWI4InitEPvS0_>: uint8_t slave_addr; void Init(void* unused1, void* unused2){ //Setup the TWI as a slave receiver TWAR = (slave_addr<<1) | 0x01; 98e: 80 91 08 04 lds r24, 0x0408 992: 88 0f add r24, r24 994: 81 60 ori r24, 0x01 ; 1 996: 80 93 72 00 sts 0x0072, r24 TWBR = 64; 99a: 80 e4 ldi r24, 0x40 ; 64 99c: 80 93 70 00 sts 0x0070, r24 TWSR &= ~((1<: TaskManager::AddTask(Init,0,0,TaskManager::SINGLE_RUN,TWI_TIMEOUT,TaskManager::MEDIUM); } }; ISR(TWI_vect){ 9ca: 1f 92 push r1 9cc: 0f 92 push r0 9ce: 0f b6 in r0, 0x3f ; 63 9d0: 0f 92 push r0 9d2: 0b b6 in r0, 0x3b ; 59 9d4: 0f 92 push r0 9d6: 11 24 eor r1, r1 9d8: ef 92 push r14 9da: 0f 93 push r16 9dc: 1f 93 push r17 9de: 2f 93 push r18 9e0: 3f 93 push r19 9e2: 4f 93 push r20 9e4: 5f 93 push r21 9e6: 6f 93 push r22 9e8: 7f 93 push r23 9ea: 8f 93 push r24 9ec: 9f 93 push r25 9ee: af 93 push r26 9f0: bf 93 push r27 9f2: ef 93 push r30 9f4: ff 93 push r31 if((TWI::current_mode&(TWI::SLAVE | TWI::SLAVE_ACK | TWI::SLAVE_DATA))!=0){//slave 9f6: 80 91 d9 03 lds r24, 0x03D9 9fa: 81 7c andi r24, 0xC1 ; 193 9fc: 09 f4 brne .+2 ; 0xa00 <__vector_33+0x36> 9fe: b4 c0 rjmp .+360 ; 0xb68 <__vector_33+0x19e> switch(TW_STATUS){ a00: 80 91 71 00 lds r24, 0x0071 a04: 90 e0 ldi r25, 0x00 ; 0 a06: 88 7f andi r24, 0xF8 ; 248 a08: 90 70 andi r25, 0x00 ; 0 a0a: 80 38 cpi r24, 0x80 ; 128 a0c: 91 05 cpc r25, r1 a0e: 61 f1 breq .+88 ; 0xa68 <__vector_33+0x9e> a10: 81 38 cpi r24, 0x81 ; 129 a12: 91 05 cpc r25, r1 a14: ac f4 brge .+42 ; 0xa40 <__vector_33+0x76> a16: 88 36 cpi r24, 0x68 ; 104 a18: 91 05 cpc r25, r1 a1a: 09 f4 brne .+2 ; 0xa1e <__vector_33+0x54> a1c: 7b c0 rjmp .+246 ; 0xb14 <__vector_33+0x14a> a1e: 89 36 cpi r24, 0x69 ; 105 a20: 91 05 cpc r25, r1 a22: 2c f4 brge .+10 ; 0xa2e <__vector_33+0x64> a24: 80 36 cpi r24, 0x60 ; 96 a26: 91 05 cpc r25, r1 a28: 09 f0 breq .+2 ; 0xa2c <__vector_33+0x62> a2a: 9c c0 rjmp .+312 ; 0xb64 <__vector_33+0x19a> a2c: 89 c0 rjmp .+274 ; 0xb40 <__vector_33+0x176> a2e: 80 37 cpi r24, 0x70 ; 112 a30: 91 05 cpc r25, r1 a32: 09 f4 brne .+2 ; 0xa36 <__vector_33+0x6c> a34: 85 c0 rjmp .+266 ; 0xb40 <__vector_33+0x176> a36: 88 37 cpi r24, 0x78 ; 120 a38: 91 05 cpc r25, r1 a3a: 09 f0 breq .+2 ; 0xa3e <__vector_33+0x74> a3c: 93 c0 rjmp .+294 ; 0xb64 <__vector_33+0x19a> a3e: 6a c0 rjmp .+212 ; 0xb14 <__vector_33+0x14a> a40: 80 39 cpi r24, 0x90 ; 144 a42: 91 05 cpc r25, r1 a44: 89 f0 breq .+34 ; 0xa68 <__vector_33+0x9e> a46: 81 39 cpi r24, 0x91 ; 145 a48: 91 05 cpc r25, r1 a4a: 2c f4 brge .+10 ; 0xa56 <__vector_33+0x8c> a4c: 88 38 cpi r24, 0x88 ; 136 a4e: 91 05 cpc r25, r1 a50: 09 f0 breq .+2 ; 0xa54 <__vector_33+0x8a> a52: 88 c0 rjmp .+272 ; 0xb64 <__vector_33+0x19a> a54: 82 c0 rjmp .+260 ; 0xb5a <__vector_33+0x190> a56: 88 39 cpi r24, 0x98 ; 152 a58: 91 05 cpc r25, r1 a5a: 09 f4 brne .+2 ; 0xa5e <__vector_33+0x94> a5c: 7e c0 rjmp .+252 ; 0xb5a <__vector_33+0x190> a5e: 80 3a cpi r24, 0xA0 ; 160 a60: 91 05 cpc r25, r1 a62: 09 f0 breq .+2 ; 0xa66 <__vector_33+0x9c> a64: 7f c0 rjmp .+254 ; 0xb64 <__vector_33+0x19a> a66: 7c c0 rjmp .+248 ; 0xb60 <__vector_33+0x196> case TW_SR_GCALL_DATA_ACK: case TW_SR_DATA_ACK: if(TWI::current_mode==TWI::SLAVE_ACK){ a68: 80 91 d9 03 lds r24, 0x03D9 a6c: 80 34 cpi r24, 0x40 ; 64 a6e: 69 f4 brne .+26 ; 0xa8a <__vector_33+0xc0> TWI::in_packet.packet_length = TWDR; a70: 80 91 73 00 lds r24, 0x0073 a74: 80 93 db 03 sts 0x03DB, r24 TWI::tmp_crc = 0xff; a78: 8f ef ldi r24, 0xFF ; 255 a7a: 80 93 02 04 sts 0x0402, r24 TWI::current_mode = TWI::SLAVE_DATA; a7e: 80 e8 ldi r24, 0x80 ; 128 a80: 80 93 d9 03 sts 0x03D9, r24 TWI::in_cur_data_ptr = 0; a84: 10 92 d8 03 sts 0x03D8, r1 a88: 6b c0 rjmp .+214 ; 0xb60 <__vector_33+0x196> } else if(TWI::current_mode==TWI::SLAVE_DATA){ a8a: 80 91 d9 03 lds r24, 0x03D9 a8e: 80 38 cpi r24, 0x80 ; 128 a90: 09 f0 breq .+2 ; 0xa94 <__vector_33+0xca> a92: 66 c0 rjmp .+204 ; 0xb60 <__vector_33+0x196> if(TWI::in_cur_data_ptr TWI::in_packet.packet[TWI::in_cur_data_ptr++] = TWDR; aa0: 80 91 d8 03 lds r24, 0x03D8 aa4: e8 2f mov r30, r24 aa6: f0 e0 ldi r31, 0x00 ; 0 aa8: 90 91 73 00 lds r25, 0x0073 aac: e6 52 subi r30, 0x26 ; 38 aae: fc 4f sbci r31, 0xFC ; 252 ab0: 92 83 std Z+2, r25 ; 0x02 ab2: 8f 5f subi r24, 0xFF ; 255 ab4: 80 93 d8 03 sts 0x03D8, r24 TWI::tmp_crc ^= TWDR; ab8: 90 91 02 04 lds r25, 0x0402 abc: 80 91 73 00 lds r24, 0x0073 ac0: 89 27 eor r24, r25 ac2: 80 93 02 04 sts 0x0402, r24 ac6: 4c c0 rjmp .+152 ; 0xb60 <__vector_33+0x196> } else if(TWI::in_cur_data_ptr==TWI_MAX_PACKET_LENGTH){//Check CRC and add callback-task ac8: 80 91 d8 03 lds r24, 0x03D8 acc: 80 31 cpi r24, 0x10 ; 16 ace: e1 f4 brne .+56 ; 0xb08 <__vector_33+0x13e> TWI::in_packet.crc = TWDR; ad0: 80 91 73 00 lds r24, 0x0073 ad4: 80 93 ec 03 sts 0x03EC, r24 if(TWI::tmp_crc!=TWI::in_packet.crc) ad8: 90 91 02 04 lds r25, 0x0402 adc: 80 91 ec 03 lds r24, 0x03EC ae0: 98 17 cp r25, r24 ae2: 11 f0 breq .+4 ; 0xae8 <__vector_33+0x11e> TWI::in_packet.check = TWI::ERROR; ae4: 81 e0 ldi r24, 0x01 ; 1 ae6: 01 c0 rjmp .+2 ; 0xaea <__vector_33+0x120> else TWI::in_packet.check = TWI::GOOD; ae8: 82 e0 ldi r24, 0x02 ; 2 aea: 80 93 ed 03 sts 0x03ED, r24 TaskManager::AddTaskInt(Twi_Receive,(void*)&TWI::in_packet,0,TaskManager::SINGLE_RUN,0,TaskManager::HIGH); aee: ee 24 eor r14, r14 af0: 00 e0 ldi r16, 0x00 ; 0 af2: 10 e0 ldi r17, 0x00 ; 0 af4: 20 e0 ldi r18, 0x00 ; 0 af6: 40 e0 ldi r20, 0x00 ; 0 af8: 50 e0 ldi r21, 0x00 ; 0 afa: 6a ed ldi r22, 0xDA ; 218 afc: 73 e0 ldi r23, 0x03 ; 3 afe: 89 e6 ldi r24, 0x69 ; 105 b00: 91 e0 ldi r25, 0x01 ; 1 b02: 0e 94 94 07 call 0xf28 ; 0xf28 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> b06: 29 c0 rjmp .+82 ; 0xb5a <__vector_33+0x190> TWI::current_mode = TWI::SLAVE; } else TWI::in_cur_data_ptr++; b08: 80 91 d8 03 lds r24, 0x03D8 b0c: 8f 5f subi r24, 0xFF ; 255 b0e: 80 93 d8 03 sts 0x03D8, r24 b12: 26 c0 rjmp .+76 ; 0xb60 <__vector_33+0x196> } TWCR = (1< TaskManager::AddTaskInt(TWI::ReSend,0,0,TaskManager::SINGLE_RUN,TWI_RESEND_DELAY,TaskManager::MEDIUM); b26: 22 e3 ldi r18, 0x32 ; 50 b28: e2 2e mov r14, r18 b2a: 02 e3 ldi r16, 0x32 ; 50 b2c: 10 e0 ldi r17, 0x00 ; 0 b2e: 20 e0 ldi r18, 0x00 ; 0 b30: 40 e0 ldi r20, 0x00 ; 0 b32: 50 e0 ldi r21, 0x00 ; 0 b34: 60 e0 ldi r22, 0x00 ; 0 b36: 70 e0 ldi r23, 0x00 ; 0 b38: 8b e8 ldi r24, 0x8B ; 139 b3a: 96 e0 ldi r25, 0x06 ; 6 b3c: 0e 94 94 07 call 0xf28 ; 0xf28 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> case TW_SR_GCALL_ACK: case TW_SR_SLA_ACK: TWI::in_packet.address_r_w = TWDR; b40: 80 91 73 00 lds r24, 0x0073 b44: 80 93 da 03 sts 0x03DA, r24 TWI::in_packet.check = TWI::UNCHECKED; b48: 10 92 ed 03 sts 0x03ED, r1 TWI::in_cur_data_ptr = 0; b4c: 10 92 d8 03 sts 0x03D8, r1 TWCR = (1< TWCR = (1< break; default: TWCR = (1< } } else{ switch(TW_STATUS){ b68: 80 91 71 00 lds r24, 0x0071 b6c: 90 e0 ldi r25, 0x00 ; 0 b6e: 88 7f andi r24, 0xF8 ; 248 b70: 90 70 andi r25, 0x00 ; 0 b72: 80 32 cpi r24, 0x20 ; 32 b74: 91 05 cpc r25, r1 b76: 09 f4 brne .+2 ; 0xb7a <__vector_33+0x1b0> b78: 90 c0 rjmp .+288 ; 0xc9a <__vector_33+0x2d0> b7a: 81 32 cpi r24, 0x21 ; 33 b7c: 91 05 cpc r25, r1 b7e: 54 f4 brge .+20 ; 0xb94 <__vector_33+0x1ca> b80: 80 31 cpi r24, 0x10 ; 16 b82: 91 05 cpc r25, r1 b84: 99 f0 breq .+38 ; 0xbac <__vector_33+0x1e2> b86: 88 31 cpi r24, 0x18 ; 24 b88: 91 05 cpc r25, r1 b8a: c9 f0 breq .+50 ; 0xbbe <__vector_33+0x1f4> b8c: 08 97 sbiw r24, 0x08 ; 8 b8e: 09 f0 breq .+2 ; 0xb92 <__vector_33+0x1c8> b90: a6 c0 rjmp .+332 ; 0xcde <__vector_33+0x314> b92: 0c c0 rjmp .+24 ; 0xbac <__vector_33+0x1e2> b94: 80 33 cpi r24, 0x30 ; 48 b96: 91 05 cpc r25, r1 b98: 09 f4 brne .+2 ; 0xb9c <__vector_33+0x1d2> b9a: 57 c0 rjmp .+174 ; 0xc4a <__vector_33+0x280> b9c: 88 33 cpi r24, 0x38 ; 56 b9e: 91 05 cpc r25, r1 ba0: 09 f4 brne .+2 ; 0xba4 <__vector_33+0x1da> ba2: 59 c0 rjmp .+178 ; 0xc56 <__vector_33+0x28c> ba4: 88 97 sbiw r24, 0x28 ; 40 ba6: 09 f0 breq .+2 ; 0xbaa <__vector_33+0x1e0> ba8: 9a c0 rjmp .+308 ; 0xcde <__vector_33+0x314> baa: 10 c0 rjmp .+32 ; 0xbcc <__vector_33+0x202> case TW_REP_START://Maybe include this? case TW_START: //Successfully sent start-condition //Send the address of the slave to receive TWDR = TWI::out_packet.address_r_w; bac: 80 91 ee 03 lds r24, 0x03EE bb0: 80 93 73 00 sts 0x0073, r24 TWCR = (1< break; case TW_MT_SLA_ACK: TWI::out_cur_data_ptr = 0; bbe: 10 92 d7 03 sts 0x03D7, r1 TWDR = TWI::out_packet.packet_length; bc2: 80 91 ef 03 lds r24, 0x03EF bc6: 80 93 73 00 sts 0x0073, r24 bca: 38 c0 rjmp .+112 ; 0xc3c <__vector_33+0x272> TWCR = (1< TWCR = (1< c02: 73 c0 rjmp .+230 ; 0xcea <__vector_33+0x320> //TWI::current_mode =TWI::SLAVE; } else if(TWI::out_cur_data_ptr>=TWI::out_packet.packet_length){ c04: 90 91 d7 03 lds r25, 0x03D7 c08: 80 91 ef 03 lds r24, 0x03EF c0c: 98 17 cp r25, r24 c0e: 50 f0 brcs .+20 ; 0xc24 <__vector_33+0x25a> //Send the crc TWDR = TWI::out_packet.crc; c10: 80 91 00 04 lds r24, 0x0400 c14: 80 93 73 00 sts 0x0073, r24 TWI::out_cur_data_ptr++; c18: 80 91 d7 03 lds r24, 0x03D7 c1c: 8f 5f subi r24, 0xFF ; 255 c1e: 80 93 d7 03 sts 0x03D7, r24 c22: 0c c0 rjmp .+24 ; 0xc3c <__vector_33+0x272> TWCR = (1< } break; case TW_MT_DATA_NACK: TWI::lost_arbs++; c4a: 80 91 06 04 lds r24, 0x0406 c4e: 8f 5f subi r24, 0xFF ; 255 c50: 80 93 06 04 sts 0x0406, r24 c54: 27 c0 rjmp .+78 ; 0xca4 <__vector_33+0x2da> else TWI::current_mode = TWI::MSTR_ERR_MAX_RETRIES; TWCR = (1< //And then add the task for our postpone sending if(TWI::numRetries TaskManager::AddTaskInt(TWI::ReSend,0,0,TaskManager::SINGLE_RUN,TWI_RESEND_DELAY,TaskManager::MEDIUM); c74: 92 e3 ldi r25, 0x32 ; 50 c76: e9 2e mov r14, r25 c78: 02 e3 ldi r16, 0x32 ; 50 c7a: 10 e0 ldi r17, 0x00 ; 0 c7c: 20 e0 ldi r18, 0x00 ; 0 c7e: 40 e0 ldi r20, 0x00 ; 0 c80: 50 e0 ldi r21, 0x00 ; 0 c82: 60 e0 ldi r22, 0x00 ; 0 c84: 70 e0 ldi r23, 0x00 ; 0 c86: 8b e8 ldi r24, 0x8B ; 139 c88: 96 e0 ldi r25, 0x06 ; 6 c8a: 0e 94 94 07 call 0xf28 ; 0xf28 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> c8e: 03 c0 rjmp .+6 ; 0xc96 <__vector_33+0x2cc> else TWI::current_mode = TWI::MSTR_ERR_MAX_RETRIES; c90: 88 e2 ldi r24, 0x28 ; 40 c92: 80 93 d9 03 sts 0x03D9, r24 TWCR = (1< break; case TW_MT_SLA_NACK: TWI::slave_nacks++; c9a: 80 91 07 04 lds r24, 0x0407 c9e: 8f 5f subi r24, 0xFF ; 255 ca0: 80 93 07 04 sts 0x0407, r24 //After 0ms reinstantiate the TWI as a slave TaskManager::PostponeTaskInt(TWI::Init,0); ca4: 60 e0 ldi r22, 0x00 ; 0 ca6: 70 e0 ldi r23, 0x00 ; 0 ca8: 87 ec ldi r24, 0xC7 ; 199 caa: 94 e0 ldi r25, 0x04 ; 4 cac: 0e 94 e6 08 call 0x11cc ; 0x11cc <_ZN11TaskManager15PostponeTaskIntEPFvPvS0_Ej> //And then add the task for our postpone sending if(TWI::numRetries TaskManager::AddTaskInt(TWI::ReSend,0,0,TaskManager::SINGLE_RUN,TWI_RESEND_DELAY,TaskManager::MEDIUM); cb8: 82 e3 ldi r24, 0x32 ; 50 cba: e8 2e mov r14, r24 cbc: 02 e3 ldi r16, 0x32 ; 50 cbe: 10 e0 ldi r17, 0x00 ; 0 cc0: 20 e0 ldi r18, 0x00 ; 0 cc2: 40 e0 ldi r20, 0x00 ; 0 cc4: 50 e0 ldi r21, 0x00 ; 0 cc6: 60 e0 ldi r22, 0x00 ; 0 cc8: 70 e0 ldi r23, 0x00 ; 0 cca: 8b e8 ldi r24, 0x8B ; 139 ccc: 96 e0 ldi r25, 0x06 ; 6 cce: 0e 94 94 07 call 0xf28 ; 0xf28 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> cd2: 03 c0 rjmp .+6 ; 0xcda <__vector_33+0x310> else TWI::current_mode = TWI::MSTR_ERR_MAX_RETRIES; cd4: 88 e2 ldi r24, 0x28 ; 40 cd6: 80 93 d9 03 sts 0x03D9, r24 TWCR = (1< break; default: TWI::current_mode = TWI::MSTR_ERR; cde: 84 e0 ldi r24, 0x04 ; 4 ce0: 80 93 d9 03 sts 0x03D9, r24 TWCR = (1<: //Add the slave init function as well TaskManager::AddTask(Init,0,0,TaskManager::SINGLE_RUN,TWI_TIMEOUT,TaskManager::MEDIUM); return 0; } void ReSend(void* u1, void* u2){ d16: ef 92 push r14 d18: 0f 93 push r16 d1a: 1f 93 push r17 if(current_mode!=SLAVE){ d1c: 80 91 d9 03 lds r24, 0x03D9 d20: 81 30 cpi r24, 0x01 ; 1 d22: 61 f0 breq .+24 ; 0xd3c <_ZN3TWI6ReSendEPvS0_+0x26> TaskManager::AddTask(TWI::ReSend,0,0,TaskManager::SINGLE_RUN,TWI_RESEND_DELAY_SHORT,TaskManager::MEDIUM); d24: 42 e3 ldi r20, 0x32 ; 50 d26: e4 2e mov r14, r20 d28: 05 e0 ldi r16, 0x05 ; 5 d2a: 10 e0 ldi r17, 0x00 ; 0 d2c: 20 e0 ldi r18, 0x00 ; 0 d2e: 40 e0 ldi r20, 0x00 ; 0 d30: 50 e0 ldi r21, 0x00 ; 0 d32: 60 e0 ldi r22, 0x00 ; 0 d34: 70 e0 ldi r23, 0x00 ; 0 d36: 8b e8 ldi r24, 0x8B ; 139 d38: 96 e0 ldi r25, 0x06 ; 6 d3a: 18 c0 rjmp .+48 ; 0xd6c <_ZN3TWI6ReSendEPvS0_+0x56> return; } out_cur_data_ptr = 0; d3c: 10 92 d7 03 sts 0x03D7, r1 //Send the start condition TWCR = (1< } d70: 1f 91 pop r17 d72: 0f 91 pop r16 d74: ef 90 pop r14 d76: 08 95 ret 00000d78 <_ZN3TWI4SendEhPhh>: tmp_crc = 0xff; in_packet.check = UNCHECKED; } uint8_t Send(uint8_t address, uint8_t* pckt, uint8_t pckt_length){ d78: ef 92 push r14 d7a: 0f 93 push r16 d7c: 1f 93 push r17 d7e: 58 2f mov r21, r24 if((numRetries!=0)&&(numRetries!=TWI_RETRIES)) d80: 80 91 03 04 lds r24, 0x0403 d84: 88 23 and r24, r24 d86: 09 f4 brne .+2 ; 0xd8a <_ZN3TWI4SendEhPhh+0x12> d88: 41 c0 rjmp .+130 ; 0xe0c <_ZN3TWI4SendEhPhh+0x94> d8a: 80 91 03 04 lds r24, 0x0403 d8e: 8a 30 cpi r24, 0x0A ; 10 d90: e9 f1 breq .+122 ; 0xe0c <_ZN3TWI4SendEhPhh+0x94> d92: 81 e0 ldi r24, 0x01 ; 1 d94: 37 c0 rjmp .+110 ; 0xe04 <_ZN3TWI4SendEhPhh+0x8c> return 1; if(current_mode!=SLAVE) return 2; out_packet.crc = 0xff; d96: 8f ef ldi r24, 0xFF ; 255 d98: 80 93 00 04 sts 0x0400, r24 d9c: db 01 movw r26, r22 d9e: 20 e0 ldi r18, 0x00 ; 0 da0: 30 e0 ldi r19, 0x00 ; 0 da2: 0d c0 rjmp .+26 ; 0xdbe <_ZN3TWI4SendEhPhh+0x46> //Copy the bytes into the buffer, and calculate the crc checksum for(uint8_t i = 0; i < pckt_length; i++){ out_packet.packet[i] = pckt[i]; da4: 8c 91 ld r24, X da6: f9 01 movw r30, r18 da8: e2 51 subi r30, 0x12 ; 18 daa: fc 4f sbci r31, 0xFC ; 252 dac: 82 83 std Z+2, r24 ; 0x02 out_packet.crc ^= pckt[i]; dae: 80 91 00 04 lds r24, 0x0400 db2: 9d 91 ld r25, X+ db4: 89 27 eor r24, r25 db6: 80 93 00 04 sts 0x0400, r24 dba: 2f 5f subi r18, 0xFF ; 255 dbc: 3f 4f sbci r19, 0xFF ; 255 if(current_mode!=SLAVE) return 2; out_packet.crc = 0xff; //Copy the bytes into the buffer, and calculate the crc checksum for(uint8_t i = 0; i < pckt_length; i++){ dbe: 24 17 cp r18, r20 dc0: 88 f3 brcs .-30 ; 0xda4 <_ZN3TWI4SendEhPhh+0x2c> out_packet.packet[i] = pckt[i]; out_packet.crc ^= pckt[i]; } numRetries = 1; dc2: 81 e0 ldi r24, 0x01 ; 1 dc4: 80 93 03 04 sts 0x0403, r24 out_packet.address_r_w = (address << 1) & 0xfe; //'Write' dc8: 85 2f mov r24, r21 dca: 90 e0 ldi r25, 0x00 ; 0 dcc: 88 0f add r24, r24 dce: 99 1f adc r25, r25 dd0: 80 93 ee 03 sts 0x03EE, r24 out_packet.packet_length = pckt_length; dd4: 40 93 ef 03 sts 0x03EF, r20 out_cur_data_ptr = 0; dd8: 10 92 d7 03 sts 0x03D7, r1 //Send the start condition TWCR = (1< e02: 80 e0 ldi r24, 0x00 ; 0 return 0; } e04: 1f 91 pop r17 e06: 0f 91 pop r16 e08: ef 90 pop r14 e0a: 08 95 ret uint8_t Send(uint8_t address, uint8_t* pckt, uint8_t pckt_length){ if((numRetries!=0)&&(numRetries!=TWI_RETRIES)) return 1; if(current_mode!=SLAVE) e0c: 80 91 d9 03 lds r24, 0x03D9 e10: 81 30 cpi r24, 0x01 ; 1 e12: 09 f2 breq .-126 ; 0xd96 <_ZN3TWI4SendEhPhh+0x1e> e14: 82 e0 ldi r24, 0x02 ; 2 e16: f6 cf rjmp .-20 ; 0xe04 <_ZN3TWI4SendEhPhh+0x8c> 00000e18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE>: //Local variables volatile uint8_t cur_done; volatile uint8_t counter; void AddTask(void (*function)(void*,void*), void* arg0, void* arg1,TASK_TYPE type,uint16_t interval,PRIORITY pri){ e18: cf 92 push r12 e1a: df 92 push r13 e1c: ef 92 push r14 e1e: ff 92 push r15 e20: 0f 93 push r16 e22: 1f 93 push r17 e24: cf 93 push r28 e26: df 93 push r29 e28: 6c 01 movw r12, r24 e2a: f2 2e mov r15, r18 e2c: 9e 2d mov r25, r14 e2e: 20 e0 ldi r18, 0x00 ; 0 e30: 30 e0 ldi r19, 0x00 ; 0 e32: a2 2f mov r26, r18 uint8_t index = 0; //Find the first free spot in the task-queue for(index=0; index e40: e7 5f subi r30, 0xF7 ; 247 e42: fb 4f sbci r31, 0xFB ; 251 e44: 86 85 ldd r24, Z+14 ; 0x0e e46: 88 23 and r24, r24 e48: 31 f0 breq .+12 ; 0xe56 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x3e> break; e4a: af 5f subi r26, 0xFF ; 255 e4c: 2f 5f subi r18, 0xFF ; 255 e4e: 3f 4f sbci r19, 0xFF ; 255 void AddTask(void (*function)(void*,void*), void* arg0, void* arg1,TASK_TYPE type,uint16_t interval,PRIORITY pri){ uint8_t index = 0; //Find the first free spot in the task-queue for(index=0; index if(!tasks[index].active) break; //Fill in all of the parameters of a task tasks[index].function = function; e56: ca 2f mov r28, r26 e58: d0 e0 ldi r29, 0x00 ; 0 e5a: de 01 movw r26, r28 e5c: 24 e0 ldi r18, 0x04 ; 4 e5e: aa 0f add r26, r26 e60: bb 1f adc r27, r27 e62: 2a 95 dec r18 e64: e1 f7 brne .-8 ; 0xe5e <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x46> e66: a7 5f subi r26, 0xF7 ; 247 e68: bb 4f sbci r27, 0xFB ; 251 e6a: 11 96 adiw r26, 0x01 ; 1 e6c: dc 92 st X, r13 e6e: ce 92 st -X, r12 tasks[index].arg0 = arg0; e70: fe 01 movw r30, r28 e72: 84 e0 ldi r24, 0x04 ; 4 e74: ee 0f add r30, r30 e76: ff 1f adc r31, r31 e78: 8a 95 dec r24 e7a: e1 f7 brne .-8 ; 0xe74 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x5c> e7c: e5 5f subi r30, 0xF5 ; 245 e7e: fb 4f sbci r31, 0xFB ; 251 e80: 71 83 std Z+1, r23 ; 0x01 e82: 60 83 st Z, r22 tasks[index].arg1 = arg1; e84: fe 01 movw r30, r28 e86: 64 e0 ldi r22, 0x04 ; 4 e88: ee 0f add r30, r30 e8a: ff 1f adc r31, r31 e8c: 6a 95 dec r22 e8e: e1 f7 brne .-8 ; 0xe88 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x70> e90: e3 5f subi r30, 0xF3 ; 243 e92: fb 4f sbci r31, 0xFB ; 251 e94: 51 83 std Z+1, r21 ; 0x01 e96: 40 83 st Z, r20 tasks[index].type = type; e98: fd 01 movw r30, r26 e9a: f6 82 std Z+6, r15 ; 0x06 if(pri==HIGH) e9c: 99 23 and r25, r25 e9e: 11 f4 brne .+4 ; 0xea4 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x8c> tasks[index].pri_level = 0; ea0: 17 86 std Z+15, r1 ; 0x0f ea2: 07 c0 rjmp .+14 ; 0xeb2 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x9a> else if(pri==MEDIUM) ea4: 92 33 cpi r25, 0x32 ; 50 ea6: 11 f4 brne .+4 ; 0xeac <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x94> tasks[index].pri_level = 1; ea8: 81 e0 ldi r24, 0x01 ; 1 eaa: 01 c0 rjmp .+2 ; 0xeae <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x96> else tasks[index].pri_level = 2; eac: 82 e0 ldi r24, 0x02 ; 2 eae: fd 01 movw r30, r26 eb0: 87 87 std Z+15, r24 ; 0x0f tasks[index].priority = pri + cur_priority[tasks[index].pri_level]++; eb2: 34 e0 ldi r19, 0x04 ; 4 eb4: cc 0f add r28, r28 eb6: dd 1f adc r29, r29 eb8: 3a 95 dec r19 eba: e1 f7 brne .-8 ; 0xeb4 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x9c> ebc: de 01 movw r26, r28 ebe: a7 5f subi r26, 0xF7 ; 247 ec0: bb 4f sbci r27, 0xFB ; 251 ec2: fd 01 movw r30, r26 ec4: 87 85 ldd r24, Z+15 ; 0x0f ec6: 28 2f mov r18, r24 ec8: 30 e0 ldi r19, 0x00 ; 0 eca: 27 53 subi r18, 0x37 ; 55 ecc: 3b 4f sbci r19, 0xFB ; 251 ece: f9 01 movw r30, r18 ed0: 80 81 ld r24, Z ed2: 98 0f add r25, r24 ed4: fd 01 movw r30, r26 ed6: 95 87 std Z+13, r25 ; 0x0d ed8: 8f 5f subi r24, 0xFF ; 255 eda: f9 01 movw r30, r18 edc: 80 83 st Z, r24 tasks[index].interval = interval; ede: fd 01 movw r30, r26 ee0: 10 87 std Z+8, r17 ; 0x08 ee2: 07 83 std Z+7, r16 ; 0x07 tasks[index].active = true; ee4: 81 e0 ldi r24, 0x01 ; 1 ee6: 86 87 std Z+14, r24 ; 0x0e //Calculate when the task is to be run cli(); ee8: f8 94 cli tasks[index].next_run = Clock::ticks + (uint32_t)interval; eea: 20 91 23 05 lds r18, 0x0523 eee: 30 91 24 05 lds r19, 0x0524 ef2: 40 91 25 05 lds r20, 0x0525 ef6: 50 91 26 05 lds r21, 0x0526 efa: c8 01 movw r24, r16 efc: a0 e0 ldi r26, 0x00 ; 0 efe: b0 e0 ldi r27, 0x00 ; 0 f00: 82 0f add r24, r18 f02: 93 1f adc r25, r19 f04: a4 1f adc r26, r20 f06: b5 1f adc r27, r21 f08: c7 5f subi r28, 0xF7 ; 247 f0a: db 4f sbci r29, 0xFB ; 251 f0c: 89 87 std Y+9, r24 ; 0x09 f0e: 9a 87 std Y+10, r25 ; 0x0a f10: ab 87 std Y+11, r26 ; 0x0b f12: bc 87 std Y+12, r27 ; 0x0c sei(); f14: 78 94 sei } f16: df 91 pop r29 f18: cf 91 pop r28 f1a: 1f 91 pop r17 f1c: 0f 91 pop r16 f1e: ff 90 pop r15 f20: ef 90 pop r14 f22: df 90 pop r13 f24: cf 90 pop r12 f26: 08 95 ret 00000f28 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE>: void AddTaskInt(void (*function)(void*,void*), void* arg0, void* arg1,TASK_TYPE type,uint16_t interval,PRIORITY pri){ f28: cf 92 push r12 f2a: df 92 push r13 f2c: ef 92 push r14 f2e: ff 92 push r15 f30: 0f 93 push r16 f32: 1f 93 push r17 f34: cf 93 push r28 f36: df 93 push r29 f38: ec 01 movw r28, r24 f3a: 6b 01 movw r12, r22 f3c: f2 2e mov r15, r18 f3e: 9e 2d mov r25, r14 f40: 20 e0 ldi r18, 0x00 ; 0 f42: 30 e0 ldi r19, 0x00 ; 0 f44: e2 2e mov r14, r18 uint8_t index = 0; //Find the first free spot in the task-queue for(index=0; index f52: e7 5f subi r30, 0xF7 ; 247 f54: fb 4f sbci r31, 0xFB ; 251 f56: 86 85 ldd r24, Z+14 ; 0x0e f58: 88 23 and r24, r24 f5a: 31 f0 breq .+12 ; 0xf68 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x40> break; f5c: e3 94 inc r14 f5e: 2f 5f subi r18, 0xFF ; 255 f60: 3f 4f sbci r19, 0xFF ; 255 } void AddTaskInt(void (*function)(void*,void*), void* arg0, void* arg1,TASK_TYPE type,uint16_t interval,PRIORITY pri){ uint8_t index = 0; //Find the first free spot in the task-queue for(index=0; index if(!tasks[index].active) break; //Fill in all of the parameters of a task tasks[index].function = function; f68: 6e 2d mov r22, r14 f6a: 70 e0 ldi r23, 0x00 ; 0 f6c: db 01 movw r26, r22 f6e: e4 e0 ldi r30, 0x04 ; 4 f70: aa 0f add r26, r26 f72: bb 1f adc r27, r27 f74: ea 95 dec r30 f76: e1 f7 brne .-8 ; 0xf70 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x48> f78: a7 5f subi r26, 0xF7 ; 247 f7a: bb 4f sbci r27, 0xFB ; 251 f7c: 11 96 adiw r26, 0x01 ; 1 f7e: dc 93 st X, r29 f80: ce 93 st -X, r28 tasks[index].arg0 = arg0; f82: fb 01 movw r30, r22 f84: 34 e0 ldi r19, 0x04 ; 4 f86: ee 0f add r30, r30 f88: ff 1f adc r31, r31 f8a: 3a 95 dec r19 f8c: e1 f7 brne .-8 ; 0xf86 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x5e> f8e: e5 5f subi r30, 0xF5 ; 245 f90: fb 4f sbci r31, 0xFB ; 251 f92: d1 82 std Z+1, r13 ; 0x01 f94: c0 82 st Z, r12 tasks[index].arg1 = arg1; f96: fb 01 movw r30, r22 f98: 24 e0 ldi r18, 0x04 ; 4 f9a: ee 0f add r30, r30 f9c: ff 1f adc r31, r31 f9e: 2a 95 dec r18 fa0: e1 f7 brne .-8 ; 0xf9a <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x72> fa2: e3 5f subi r30, 0xF3 ; 243 fa4: fb 4f sbci r31, 0xFB ; 251 fa6: 51 83 std Z+1, r21 ; 0x01 fa8: 40 83 st Z, r20 tasks[index].type = type; faa: ed 01 movw r28, r26 fac: fe 82 std Y+6, r15 ; 0x06 if(pri==HIGH) fae: 99 23 and r25, r25 fb0: 11 f4 brne .+4 ; 0xfb6 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x8e> tasks[index].pri_level = 0; fb2: 1f 86 std Y+15, r1 ; 0x0f fb4: 09 c0 rjmp .+18 ; 0xfc8 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0xa0> else if(pri==MEDIUM) fb6: 92 33 cpi r25, 0x32 ; 50 fb8: 21 f4 brne .+8 ; 0xfc2 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0x9a> tasks[index].pri_level = 1; fba: 81 e0 ldi r24, 0x01 ; 1 fbc: fd 01 movw r30, r26 fbe: 87 87 std Z+15, r24 ; 0x0f fc0: 03 c0 rjmp .+6 ; 0xfc8 <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0xa0> else tasks[index].pri_level = 2; fc2: 82 e0 ldi r24, 0x02 ; 2 fc4: ed 01 movw r28, r26 fc6: 8f 87 std Y+15, r24 ; 0x0f tasks[index].priority = pri + cur_priority[tasks[index].pri_level]++; fc8: 84 e0 ldi r24, 0x04 ; 4 fca: 66 0f add r22, r22 fcc: 77 1f adc r23, r23 fce: 8a 95 dec r24 fd0: e1 f7 brne .-8 ; 0xfca <_ZN11TaskManager10AddTaskIntEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE+0xa2> fd2: 67 5f subi r22, 0xF7 ; 247 fd4: 7b 4f sbci r23, 0xFB ; 251 fd6: eb 01 movw r28, r22 fd8: ef 85 ldd r30, Y+15 ; 0x0f fda: f0 e0 ldi r31, 0x00 ; 0 fdc: e7 53 subi r30, 0x37 ; 55 fde: fb 4f sbci r31, 0xFB ; 251 fe0: 80 81 ld r24, Z fe2: 98 0f add r25, r24 fe4: 9d 87 std Y+13, r25 ; 0x0d fe6: 8f 5f subi r24, 0xFF ; 255 fe8: 80 83 st Z, r24 tasks[index].interval = interval; fea: 18 87 std Y+8, r17 ; 0x08 fec: 0f 83 std Y+7, r16 ; 0x07 tasks[index].active = true; fee: 81 e0 ldi r24, 0x01 ; 1 ff0: 8e 87 std Y+14, r24 ; 0x0e //Calculate when the task is to be run tasks[index].next_run = Clock::ticks + (uint32_t)interval; ff2: 20 91 23 05 lds r18, 0x0523 ff6: 30 91 24 05 lds r19, 0x0524 ffa: 40 91 25 05 lds r20, 0x0525 ffe: 50 91 26 05 lds r21, 0x0526 1002: c8 01 movw r24, r16 1004: a0 e0 ldi r26, 0x00 ; 0 1006: b0 e0 ldi r27, 0x00 ; 0 1008: 82 0f add r24, r18 100a: 93 1f adc r25, r19 100c: a4 1f adc r26, r20 100e: b5 1f adc r27, r21 1010: fb 01 movw r30, r22 1012: 81 87 std Z+9, r24 ; 0x09 1014: 92 87 std Z+10, r25 ; 0x0a 1016: a3 87 std Z+11, r26 ; 0x0b 1018: b4 87 std Z+12, r27 ; 0x0c } 101a: df 91 pop r29 101c: cf 91 pop r28 101e: 1f 91 pop r17 1020: 0f 91 pop r16 1022: ff 90 pop r15 1024: ef 90 pop r14 1026: df 90 pop r13 1028: cf 90 pop r12 102a: 08 95 ret 0000102c <_ZN11TaskManager15ExecuteNextTaskEv>: uint8_t ExecuteNextTask(void){ 102c: cf 93 push r28 102e: df 93 push r29 }; inline uint32_t getTicks(void){ uint32_t t; cli(); 1030: f8 94 cli t = Clock::ticks; 1032: 40 91 23 05 lds r20, 0x0523 1036: 50 91 24 05 lds r21, 0x0524 103a: 60 91 25 05 lds r22, 0x0525 103e: 70 91 26 05 lds r23, 0x0526 sei(); 1042: 78 94 sei int8_t index = -1; uint8_t i; uint8_t leastpri = 0xff; uint32_t curt = getTicks(); cur_tasks = 0; 1044: 10 92 cc 04 sts 0x04CC, r1 counter++; 1048: 80 91 cf 04 lds r24, 0x04CF 104c: 8f 5f subi r24, 0xFF ; 255 104e: 80 93 cf 04 sts 0x04CF, r24 if(counter==200){ 1052: 80 91 cf 04 lds r24, 0x04CF 1056: 88 3c cpi r24, 0xC8 ; 200 1058: 49 f4 brne .+18 ; 0x106c <_ZN11TaskManager15ExecuteNextTaskEv+0x40> cpu_usage = cur_done / 2; 105a: 80 91 ce 04 lds r24, 0x04CE 105e: 86 95 lsr r24 1060: 80 93 cd 04 sts 0x04CD, r24 cur_done = 0; 1064: 10 92 ce 04 sts 0x04CE, r1 counter = 0; 1068: 10 92 cf 04 sts 0x04CF, r1 106c: ef ef ldi r30, 0xFF ; 255 106e: ff ef ldi r31, 0xFF ; 255 1070: 20 e0 ldi r18, 0x00 ; 0 1072: 30 e0 ldi r19, 0x00 ; 0 } //Find the next task needed to be run. Pick out the one with the least priority(those added first gets executed first) for(i=0; i 1080: c7 5f subi r28, 0xF7 ; 247 1082: db 4f sbci r29, 0xFB ; 251 1084: 8e 85 ldd r24, Y+14 ; 0x0e 1086: 88 23 and r24, r24 1088: 99 f0 breq .+38 ; 0x10b0 <_ZN11TaskManager15ExecuteNextTaskEv+0x84> cur_tasks++; 108a: 80 91 cc 04 lds r24, 0x04CC 108e: 8f 5f subi r24, 0xFF ; 255 1090: 80 93 cc 04 sts 0x04CC, r24 if(tasks[i].next_run<=curt){ 1094: 89 85 ldd r24, Y+9 ; 0x09 1096: 9a 85 ldd r25, Y+10 ; 0x0a 1098: ab 85 ldd r26, Y+11 ; 0x0b 109a: bc 85 ldd r27, Y+12 ; 0x0c 109c: 48 17 cp r20, r24 109e: 59 07 cpc r21, r25 10a0: 6a 07 cpc r22, r26 10a2: 7b 07 cpc r23, r27 10a4: 28 f0 brcs .+10 ; 0x10b0 <_ZN11TaskManager15ExecuteNextTaskEv+0x84> if(tasks[i].priority leastpri = tasks[i].priority; 10ac: fd 85 ldd r31, Y+13 ; 0x0d 10ae: e2 2f mov r30, r18 10b0: 2f 5f subi r18, 0xFF ; 255 10b2: 3f 4f sbci r19, 0xFF ; 255 cpu_usage = cur_done / 2; cur_done = 0; counter = 0; } //Find the next task needed to be run. Pick out the one with the least priority(those added first gets executed first) for(i=0; i } } } } //If there are any tasks that need to be done if(index!=-1){ 10ba: ef 3f cpi r30, 0xFF ; 255 10bc: 09 f4 brne .+2 ; 0x10c0 <_ZN11TaskManager15ExecuteNextTaskEv+0x94> 10be: 44 c0 rjmp .+136 ; 0x1148 <__stack+0x49> cur_done++; 10c0: 80 91 ce 04 lds r24, 0x04CE 10c4: 8f 5f subi r24, 0xFF ; 255 10c6: 80 93 ce 04 sts 0x04CE, r24 //Execute it tasks[index].function(tasks[index].arg0,tasks[index].arg1); 10ca: ff 27 eor r31, r31 10cc: e7 fd sbrc r30, 7 10ce: f0 95 com r31 10d0: 94 e0 ldi r25, 0x04 ; 4 10d2: ee 0f add r30, r30 10d4: ff 1f adc r31, r31 10d6: 9a 95 dec r25 10d8: e1 f7 brne .-8 ; 0x10d2 <_ZN11TaskManager15ExecuteNextTaskEv+0xa6> 10da: ef 01 movw r28, r30 10dc: c7 5f subi r28, 0xF7 ; 247 10de: db 4f sbci r29, 0xFB ; 251 10e0: 28 81 ld r18, Y 10e2: 39 81 ldd r19, Y+1 ; 0x01 10e4: df 01 movw r26, r30 10e6: a3 5f subi r26, 0xF3 ; 243 10e8: bb 4f sbci r27, 0xFB ; 251 10ea: 6d 91 ld r22, X+ 10ec: 7c 91 ld r23, X 10ee: e5 5f subi r30, 0xF5 ; 245 10f0: fb 4f sbci r31, 0xFB ; 251 10f2: 80 81 ld r24, Z 10f4: 91 81 ldd r25, Z+1 ; 0x01 10f6: f9 01 movw r30, r18 10f8: 09 95 icall if(tasks[index].type==SINGLE_RUN){//Delete it from the task-queue 10fa: 8e 81 ldd r24, Y+6 ; 0x06 10fc: 88 23 and r24, r24 10fe: 49 f4 brne .+18 ; 0x1112 <__stack+0x13> tasks[index].active = false; 1100: 1e 86 std Y+14, r1 ; 0x0e //Decrement the current top priority cur_priority[tasks[index].pri_level]--; 1102: ef 85 ldd r30, Y+15 ; 0x0f 1104: f0 e0 ldi r31, 0x00 ; 0 1106: e7 53 subi r30, 0x37 ; 55 1108: fb 4f sbci r31, 0xFB ; 251 110a: 80 81 ld r24, Z 110c: 81 50 subi r24, 0x01 ; 1 110e: 80 83 st Z, r24 1110: 1b c0 rjmp .+54 ; 0x1148 <__stack+0x49> } else if(tasks[index].type==MULTI_DISREGARD_NEXT){//If multirun, single postponed, don't update the interval but make it multirun again 1112: 8e 81 ldd r24, Y+6 ; 0x06 1114: 83 30 cpi r24, 0x03 ; 3 1116: 11 f4 brne .+4 ; 0x111c <__stack+0x1d> tasks[index].type = MULTI_RUN; 1118: 81 e0 ldi r24, 0x01 ; 1 111a: 04 c0 rjmp .+8 ; 0x1124 <__stack+0x25> } else if(tasks[index].type==MULTI_DISREGARD_NEXT_INT){//Need two states to do this 111c: 8e 81 ldd r24, Y+6 ; 0x06 111e: 82 30 cpi r24, 0x02 ; 2 1120: 19 f4 brne .+6 ; 0x1128 <__stack+0x29> tasks[index].type = MULTI_DISREGARD_NEXT; 1122: 83 e0 ldi r24, 0x03 ; 3 1124: 8e 83 std Y+6, r24 ; 0x06 1126: 10 c0 rjmp .+32 ; 0x1148 <__stack+0x49> } else//Find the next time to run the task tasks[index].next_run += tasks[index].interval; 1128: 29 85 ldd r18, Y+9 ; 0x09 112a: 3a 85 ldd r19, Y+10 ; 0x0a 112c: 4b 85 ldd r20, Y+11 ; 0x0b 112e: 5c 85 ldd r21, Y+12 ; 0x0c 1130: 8f 81 ldd r24, Y+7 ; 0x07 1132: 98 85 ldd r25, Y+8 ; 0x08 1134: a0 e0 ldi r26, 0x00 ; 0 1136: b0 e0 ldi r27, 0x00 ; 0 1138: 82 0f add r24, r18 113a: 93 1f adc r25, r19 113c: a4 1f adc r26, r20 113e: b5 1f adc r27, r21 1140: 89 87 std Y+9, r24 ; 0x09 1142: 9a 87 std Y+10, r25 ; 0x0a 1144: ab 87 std Y+11, r26 ; 0x0b 1146: bc 87 std Y+12, r27 ; 0x0c } return 1; } 1148: 81 e0 ldi r24, 0x01 ; 1 114a: df 91 pop r29 114c: cf 91 pop r28 114e: 08 95 ret 00001150 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej>: /*Postpone a given task for a number of milliseconds after this call gets executed*/ /*Postpone(Function,0) will actually force the function to be executed at once*/ void PostponeTask(void (*function)(void*,void*), uint16_t interval){ 1150: cf 93 push r28 1152: df 93 push r29 1154: 9c 01 movw r18, r24 1156: e0 e0 ldi r30, 0x00 ; 0 1158: f0 e0 ldi r31, 0x00 ; 0 int8_t i; for(i = 0; i < MAX_TASKS; i++){ if((tasks[i].function==function)&&(tasks[i].active==true)){ 115a: df 01 movw r26, r30 115c: 44 e0 ldi r20, 0x04 ; 4 115e: aa 0f add r26, r26 1160: bb 1f adc r27, r27 1162: 4a 95 dec r20 1164: e1 f7 brne .-8 ; 0x115e <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0xe> 1166: a7 5f subi r26, 0xF7 ; 247 1168: bb 4f sbci r27, 0xFB ; 251 116a: 8d 91 ld r24, X+ 116c: 9c 91 ld r25, X 116e: 11 97 sbiw r26, 0x01 ; 1 1170: 82 17 cp r24, r18 1172: 93 07 cpc r25, r19 1174: 21 f5 brne .+72 ; 0x11be <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0x6e> 1176: ed 01 movw r28, r26 1178: 8e 85 ldd r24, Y+14 ; 0x0e 117a: 88 23 and r24, r24 117c: 01 f1 breq .+64 ; 0x11be <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0x6e> if(tasks[i].type!=TaskManager::MULTI_DISREGARD_NEXT){//Can't postpone an already postponed task 117e: 8e 81 ldd r24, Y+6 ; 0x06 1180: 83 30 cpi r24, 0x03 ; 3 1182: 09 f1 breq .+66 ; 0x11c6 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0x76> cli(); 1184: f8 94 cli tasks[i].next_run = Clock::ticks + (uint32_t)interval; 1186: 20 91 23 05 lds r18, 0x0523 118a: 30 91 24 05 lds r19, 0x0524 118e: 40 91 25 05 lds r20, 0x0525 1192: 50 91 26 05 lds r21, 0x0526 1196: cb 01 movw r24, r22 1198: a0 e0 ldi r26, 0x00 ; 0 119a: b0 e0 ldi r27, 0x00 ; 0 119c: 82 0f add r24, r18 119e: 93 1f adc r25, r19 11a0: a4 1f adc r26, r20 11a2: b5 1f adc r27, r21 11a4: 24 e0 ldi r18, 0x04 ; 4 11a6: ee 0f add r30, r30 11a8: ff 1f adc r31, r31 11aa: 2a 95 dec r18 11ac: e1 f7 brne .-8 ; 0x11a6 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0x56> 11ae: e7 5f subi r30, 0xF7 ; 247 11b0: fb 4f sbci r31, 0xFB ; 251 11b2: 81 87 std Z+9, r24 ; 0x09 11b4: 92 87 std Z+10, r25 ; 0x0a 11b6: a3 87 std Z+11, r26 ; 0x0b 11b8: b4 87 std Z+12, r27 ; 0x0c sei(); 11ba: 78 94 sei 11bc: 04 c0 rjmp .+8 ; 0x11c6 <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0x76> 11be: 31 96 adiw r30, 0x01 ; 1 /*Postpone a given task for a number of milliseconds after this call gets executed*/ /*Postpone(Function,0) will actually force the function to be executed at once*/ void PostponeTask(void (*function)(void*,void*), uint16_t interval){ int8_t i; for(i = 0; i < MAX_TASKS; i++){ 11c0: ec 30 cpi r30, 0x0C ; 12 11c2: f1 05 cpc r31, r1 11c4: 51 f6 brne .-108 ; 0x115a <_ZN11TaskManager12PostponeTaskEPFvPvS0_Ej+0xa> sei(); } return; } } } 11c6: df 91 pop r29 11c8: cf 91 pop r28 11ca: 08 95 ret 000011cc <_ZN11TaskManager15PostponeTaskIntEPFvPvS0_Ej>: /*Postpone a given task for a number of milliseconds after this call gets executed*/ /*This is the interrupt version(to be called from within*) of the function*/ /*Postpone(Function,0) will actually force the function to be executed at once*/ void PostponeTaskInt(void (*function)(void*,void*), uint16_t interval){ 11cc: ac 01 movw r20, r24 11ce: 20 e0 ldi r18, 0x00 ; 0 11d0: 30 e0 ldi r19, 0x00 ; 0 int8_t i; for(i = 0; i < MAX_TASKS; i++){ if((tasks[i].function==function)&&(tasks[i].active==true)){ 11d2: f9 01 movw r30, r18 11d4: a4 e0 ldi r26, 0x04 ; 4 11d6: ee 0f add r30, r30 11d8: ff 1f adc r31, r31 11da: aa 95 dec r26 11dc: e1 f7 brne .-8 ; 0x11d6 <_ZN11TaskManager15PostponeTaskIntEPFvPvS0_Ej+0xa> 11de: e7 5f subi r30, 0xF7 ; 247 11e0: fb 4f sbci r31, 0xFB ; 251 11e2: 80 81 ld r24, Z 11e4: 91 81 ldd r25, Z+1 ; 0x01 11e6: 84 17 cp r24, r20 11e8: 95 07 cpc r25, r21 11ea: b9 f4 brne .+46 ; 0x121a <_ZN11TaskManager15PostponeTaskIntEPFvPvS0_Ej+0x4e> 11ec: 86 85 ldd r24, Z+14 ; 0x0e 11ee: 88 23 and r24, r24 11f0: a1 f0 breq .+40 ; 0x121a <_ZN11TaskManager15PostponeTaskIntEPFvPvS0_Ej+0x4e> tasks[i].next_run = Clock::ticks + (uint32_t)interval; 11f2: 20 91 23 05 lds r18, 0x0523 11f6: 30 91 24 05 lds r19, 0x0524 11fa: 40 91 25 05 lds r20, 0x0525 11fe: 50 91 26 05 lds r21, 0x0526 1202: cb 01 movw r24, r22 1204: a0 e0 ldi r26, 0x00 ; 0 1206: b0 e0 ldi r27, 0x00 ; 0 1208: 82 0f add r24, r18 120a: 93 1f adc r25, r19 120c: a4 1f adc r26, r20 120e: b5 1f adc r27, r21 1210: 81 87 std Z+9, r24 ; 0x09 1212: 92 87 std Z+10, r25 ; 0x0a 1214: a3 87 std Z+11, r26 ; 0x0b 1216: b4 87 std Z+12, r27 ; 0x0c 1218: 08 95 ret 121a: 2f 5f subi r18, 0xFF ; 255 121c: 3f 4f sbci r19, 0xFF ; 255 /*Postpone a given task for a number of milliseconds after this call gets executed*/ /*This is the interrupt version(to be called from within*) of the function*/ /*Postpone(Function,0) will actually force the function to be executed at once*/ void PostponeTaskInt(void (*function)(void*,void*), uint16_t interval){ int8_t i; for(i = 0; i < MAX_TASKS; i++){ 121e: 2c 30 cpi r18, 0x0C ; 12 1220: 31 05 cpc r19, r1 1222: b9 f6 brne .-82 ; 0x11d2 <_ZN11TaskManager15PostponeTaskIntEPFvPvS0_Ej+0x6> 1224: 08 95 ret 00001226 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej>: } /*Postpone a given task for a number of milliseconds after this call gets executed*/ /*This will however only work correct when called from INSIDE a MultiRun*/ /*Postpone(Function,0) will actually force the function to be executed at once*/ void PostponeMultiTask(void (*function)(void*,void*), uint16_t interval){ 1226: cf 93 push r28 1228: df 93 push r29 122a: 9c 01 movw r18, r24 122c: c0 e0 ldi r28, 0x00 ; 0 122e: d0 e0 ldi r29, 0x00 ; 0 int8_t i; for(i = 0; i < MAX_TASKS; i++){ if((tasks[i].function==function)&&(tasks[i].active==true)){ 1230: fe 01 movw r30, r28 1232: 44 e0 ldi r20, 0x04 ; 4 1234: ee 0f add r30, r30 1236: ff 1f adc r31, r31 1238: 4a 95 dec r20 123a: e1 f7 brne .-8 ; 0x1234 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej+0xe> 123c: e7 5f subi r30, 0xF7 ; 247 123e: fb 4f sbci r31, 0xFB ; 251 1240: 80 81 ld r24, Z 1242: 91 81 ldd r25, Z+1 ; 0x01 1244: 82 17 cp r24, r18 1246: 93 07 cpc r25, r19 1248: 29 f5 brne .+74 ; 0x1294 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej+0x6e> 124a: 86 85 ldd r24, Z+14 ; 0x0e 124c: 88 23 and r24, r24 124e: 11 f1 breq .+68 ; 0x1294 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej+0x6e> cli(); 1250: f8 94 cli tasks[i].next_run = Clock::ticks + (uint32_t)interval; 1252: 20 91 23 05 lds r18, 0x0523 1256: 30 91 24 05 lds r19, 0x0524 125a: 40 91 25 05 lds r20, 0x0525 125e: 50 91 26 05 lds r21, 0x0526 1262: cb 01 movw r24, r22 1264: a0 e0 ldi r26, 0x00 ; 0 1266: b0 e0 ldi r27, 0x00 ; 0 1268: 82 0f add r24, r18 126a: 93 1f adc r25, r19 126c: a4 1f adc r26, r20 126e: b5 1f adc r27, r21 1270: 24 e0 ldi r18, 0x04 ; 4 1272: cc 0f add r28, r28 1274: dd 1f adc r29, r29 1276: 2a 95 dec r18 1278: e1 f7 brne .-8 ; 0x1272 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej+0x4c> 127a: fe 01 movw r30, r28 127c: e7 5f subi r30, 0xF7 ; 247 127e: fb 4f sbci r31, 0xFB ; 251 1280: 81 87 std Z+9, r24 ; 0x09 1282: 92 87 std Z+10, r25 ; 0x0a 1284: a3 87 std Z+11, r26 ; 0x0b 1286: b4 87 std Z+12, r27 ; 0x0c sei(); 1288: 78 94 sei tasks[i].type = MULTI_DISREGARD_NEXT_INT; 128a: c7 5f subi r28, 0xF7 ; 247 128c: db 4f sbci r29, 0xFB ; 251 128e: 82 e0 ldi r24, 0x02 ; 2 1290: 8e 83 std Y+6, r24 ; 0x06 1292: 04 c0 rjmp .+8 ; 0x129c <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej+0x76> 1294: 21 96 adiw r28, 0x01 ; 1 /*Postpone a given task for a number of milliseconds after this call gets executed*/ /*This will however only work correct when called from INSIDE a MultiRun*/ /*Postpone(Function,0) will actually force the function to be executed at once*/ void PostponeMultiTask(void (*function)(void*,void*), uint16_t interval){ int8_t i; for(i = 0; i < MAX_TASKS; i++){ 1296: cc 30 cpi r28, 0x0C ; 12 1298: d1 05 cpc r29, r1 129a: 51 f6 brne .-108 ; 0x1230 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej+0xa> sei(); tasks[i].type = MULTI_DISREGARD_NEXT_INT; return; } } } 129c: df 91 pop r29 129e: cf 91 pop r28 12a0: 08 95 ret 000012a2 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E>: /* Delete a task */ void DeleteTask(void (*function)(void*,void*)){ 12a2: ac 01 movw r20, r24 12a4: 20 e0 ldi r18, 0x00 ; 0 12a6: 30 e0 ldi r19, 0x00 ; 0 uint8_t i; for(i = 0; i < MAX_TASKS; i++){ if(tasks[i].function==function){ 12a8: f9 01 movw r30, r18 12aa: 64 e0 ldi r22, 0x04 ; 4 12ac: ee 0f add r30, r30 12ae: ff 1f adc r31, r31 12b0: 6a 95 dec r22 12b2: e1 f7 brne .-8 ; 0x12ac <_ZN11TaskManager10DeleteTaskEPFvPvS0_E+0xa> 12b4: e7 5f subi r30, 0xF7 ; 247 12b6: fb 4f sbci r31, 0xFB ; 251 12b8: 80 81 ld r24, Z 12ba: 91 81 ldd r25, Z+1 ; 0x01 12bc: 84 17 cp r24, r20 12be: 95 07 cpc r25, r21 12c0: 41 f4 brne .+16 ; 0x12d2 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E+0x30> tasks[i].active = false; 12c2: 16 86 std Z+14, r1 ; 0x0e //Decrement the current top priority cur_priority[tasks[i].pri_level]--; 12c4: e7 85 ldd r30, Z+15 ; 0x0f 12c6: f0 e0 ldi r31, 0x00 ; 0 12c8: e7 53 subi r30, 0x37 ; 55 12ca: fb 4f sbci r31, 0xFB ; 251 12cc: 80 81 ld r24, Z 12ce: 81 50 subi r24, 0x01 ; 1 12d0: 80 83 st Z, r24 12d2: 2f 5f subi r18, 0xFF ; 255 12d4: 3f 4f sbci r19, 0xFF ; 255 } /* Delete a task */ void DeleteTask(void (*function)(void*,void*)){ uint8_t i; for(i = 0; i < MAX_TASKS; i++){ 12d6: 2c 30 cpi r18, 0x0C ; 12 12d8: 31 05 cpc r19, r1 12da: 31 f7 brne .-52 ; 0x12a8 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E+0x6> //Decrement the current top priority cur_priority[tasks[i].pri_level]--; //return; Cannot be here to get rid of all tasks at the same function? } } } 12dc: 08 95 ret 000012de <_ZN11TaskManager4InitEv>: /* Initialize the TaskManager */ void Init(void){ 12de: 80 e0 ldi r24, 0x00 ; 0 12e0: 90 e0 ldi r25, 0x00 ; 0 uint8_t i; for(i = 0; i < MAX_TASKS; i++) tasks[i].active = false; 12e2: fc 01 movw r30, r24 12e4: 74 e0 ldi r23, 0x04 ; 4 12e6: ee 0f add r30, r30 12e8: ff 1f adc r31, r31 12ea: 7a 95 dec r23 12ec: e1 f7 brne .-8 ; 0x12e6 <_ZN11TaskManager4InitEv+0x8> 12ee: e7 5f subi r30, 0xF7 ; 247 12f0: fb 4f sbci r31, 0xFB ; 251 12f2: 16 86 std Z+14, r1 ; 0x0e 12f4: 01 96 adiw r24, 0x01 ; 1 } /* Initialize the TaskManager */ void Init(void){ uint8_t i; for(i = 0; i < MAX_TASKS; i++) 12f6: 8c 30 cpi r24, 0x0C ; 12 12f8: 91 05 cpc r25, r1 12fa: 99 f7 brne .-26 ; 0x12e2 <_ZN11TaskManager4InitEv+0x4> tasks[i].active = false; } 12fc: 08 95 ret 000012fe <_ZN7DisplayL12dispSetDDRAMEc>: static inline void sendDisplayData(char data){ sendDisplay(data, 1); } static inline void sendDisplayInstruksjon(char instr){ sendDisplay(instr, 0); 12fe: 60 e0 ldi r22, 0x00 ; 0 1300: 80 68 ori r24, 0x80 ; 128 1302: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> } static inline void dispSetDDRAM(char nyAddresse){ nyAddresse |= 0x80; sendDisplayInstruksjon(nyAddresse); } 1306: 08 95 ret 00001308 <_ZN4Menu8DrawMenuEPvS0_>: static inline void sendDisplayData(char data){ sendDisplay(data, 1); } static inline void sendDisplayInstruksjon(char instr){ sendDisplay(instr, 0); 1308: 60 e0 ldi r22, 0x00 ; 0 130a: 81 e0 ldi r24, 0x01 ; 1 130c: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> uint8_t cur_menu = 0; void DrawMenu(void* unused1, void* unused2){ Display::dispClear(); Display::dispSetDDRAM(0x00);//First line 1310: 80 e0 ldi r24, 0x00 ; 0 1312: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> //Draw the menu-interface on the display switch(cur_menu){ 1316: 80 91 e1 04 lds r24, 0x04E1 131a: 84 30 cpi r24, 0x04 ; 4 131c: 09 f4 brne .+2 ; 0x1320 <_ZN4Menu8DrawMenuEPvS0_+0x18> 131e: 90 c0 rjmp .+288 ; 0x1440 <_ZN4Menu8DrawMenuEPvS0_+0x138> 1320: 85 30 cpi r24, 0x05 ; 5 1322: 58 f4 brcc .+22 ; 0x133a <_ZN4Menu8DrawMenuEPvS0_+0x32> 1324: 81 30 cpi r24, 0x01 ; 1 1326: 51 f1 breq .+84 ; 0x137c <_ZN4Menu8DrawMenuEPvS0_+0x74> 1328: 81 30 cpi r24, 0x01 ; 1 132a: d0 f0 brcs .+52 ; 0x1360 <_ZN4Menu8DrawMenuEPvS0_+0x58> 132c: 82 30 cpi r24, 0x02 ; 2 132e: 09 f4 brne .+2 ; 0x1332 <_ZN4Menu8DrawMenuEPvS0_+0x2a> 1330: 5b c0 rjmp .+182 ; 0x13e8 <_ZN4Menu8DrawMenuEPvS0_+0xe0> 1332: 83 30 cpi r24, 0x03 ; 3 1334: 09 f0 breq .+2 ; 0x1338 <_ZN4Menu8DrawMenuEPvS0_+0x30> 1336: ff c0 rjmp .+510 ; 0x1536 <_ZN4Menu8DrawMenuEPvS0_+0x22e> 1338: 79 c0 rjmp .+242 ; 0x142c <_ZN4Menu8DrawMenuEPvS0_+0x124> 133a: 87 30 cpi r24, 0x07 ; 7 133c: 09 f4 brne .+2 ; 0x1340 <_ZN4Menu8DrawMenuEPvS0_+0x38> 133e: bd c0 rjmp .+378 ; 0x14ba <_ZN4Menu8DrawMenuEPvS0_+0x1b2> 1340: 88 30 cpi r24, 0x08 ; 8 1342: 38 f4 brcc .+14 ; 0x1352 <_ZN4Menu8DrawMenuEPvS0_+0x4a> 1344: 85 30 cpi r24, 0x05 ; 5 1346: 09 f4 brne .+2 ; 0x134a <_ZN4Menu8DrawMenuEPvS0_+0x42> 1348: 85 c0 rjmp .+266 ; 0x1454 <_ZN4Menu8DrawMenuEPvS0_+0x14c> 134a: 86 30 cpi r24, 0x06 ; 6 134c: 09 f0 breq .+2 ; 0x1350 <_ZN4Menu8DrawMenuEPvS0_+0x48> 134e: f3 c0 rjmp .+486 ; 0x1536 <_ZN4Menu8DrawMenuEPvS0_+0x22e> 1350: 99 c0 rjmp .+306 ; 0x1484 <_ZN4Menu8DrawMenuEPvS0_+0x17c> 1352: 88 30 cpi r24, 0x08 ; 8 1354: 09 f4 brne .+2 ; 0x1358 <_ZN4Menu8DrawMenuEPvS0_+0x50> 1356: cc c0 rjmp .+408 ; 0x14f0 <_ZN4Menu8DrawMenuEPvS0_+0x1e8> 1358: 89 30 cpi r24, 0x09 ; 9 135a: 09 f0 breq .+2 ; 0x135e <_ZN4Menu8DrawMenuEPvS0_+0x56> 135c: ec c0 rjmp .+472 ; 0x1536 <_ZN4Menu8DrawMenuEPvS0_+0x22e> 135e: d5 c0 rjmp .+426 ; 0x150a <_ZN4Menu8DrawMenuEPvS0_+0x202> case 0: Display::sendDispRamString(Coffee::cur_webstatus.cur_status); 1360: 86 ef ldi r24, 0xF6 ; 246 1362: 94 e0 ldi r25, 0x04 ; 4 1364: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::dispSetDDRAM(0x40); 1368: 80 e4 ldi r24, 0x40 ; 64 136a: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispRamString((char*)"Hits:"); 136e: 80 e0 ldi r24, 0x00 ; 0 1370: 91 e0 ldi r25, 0x01 ; 1 1372: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::cur_webstatus.hit_count); 1376: 60 91 07 05 lds r22, 0x0507 137a: 34 c0 rjmp .+104 ; 0x13e4 <_ZN4Menu8DrawMenuEPvS0_+0xdc> break; case 1: Display::sendDispRamString((char*)"Twi stat:"); 137c: 86 e0 ldi r24, 0x06 ; 6 137e: 91 e0 ldi r25, 0x01 ; 1 1380: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> if(TWI::current_mode==TWI::MSTR_ERR_SLAVE_NACK){ 1384: 80 91 d9 03 lds r24, 0x03D9 1388: 88 31 cpi r24, 0x18 ; 24 138a: 89 f4 brne .+34 ; 0x13ae <_ZN4Menu8DrawMenuEPvS0_+0xa6> Display::dispSetDDRAM(0x40); 138c: 80 e4 ldi r24, 0x40 ; 64 138e: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispInt((int32_t)_ADDRESS(TWI::out_packet.address_r_w)); 1392: 60 91 ee 03 lds r22, 0x03EE 1396: 70 e0 ldi r23, 0x00 ; 0 1398: 75 95 asr r23 139a: 67 95 ror r22 139c: 88 27 eor r24, r24 139e: 77 fd sbrc r23, 7 13a0: 80 95 com r24 13a2: 98 2f mov r25, r24 13a4: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::sendDispRamString((char*)" NACK"); 13a8: 80 e1 ldi r24, 0x10 ; 16 13aa: 91 e0 ldi r25, 0x01 ; 1 13ac: 3c c0 rjmp .+120 ; 0x1426 <_ZN4Menu8DrawMenuEPvS0_+0x11e> } else{ //Display::dispSetDDRAM(0x0b); Display::sendDispInt((int32_t)TWI::current_mode); 13ae: 60 91 d9 03 lds r22, 0x03D9 13b2: 70 e0 ldi r23, 0x00 ; 0 13b4: 80 e0 ldi r24, 0x00 ; 0 13b6: 90 e0 ldi r25, 0x00 ; 0 13b8: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::sendDispRamString((char*)"/"); 13bc: 86 e1 ldi r24, 0x16 ; 22 13be: 91 e0 ldi r25, 0x01 ; 1 13c0: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)TWI::lost_arbs); 13c4: 60 91 06 04 lds r22, 0x0406 13c8: 70 e0 ldi r23, 0x00 ; 0 13ca: 80 e0 ldi r24, 0x00 ; 0 13cc: 90 e0 ldi r25, 0x00 ; 0 13ce: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::dispSetDDRAM(0x40); 13d2: 80 e4 ldi r24, 0x40 ; 64 13d4: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispRamString((char*)"Num retries:"); 13d8: 88 e1 ldi r24, 0x18 ; 24 13da: 91 e0 ldi r25, 0x01 ; 1 13dc: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)TWI::numRetries); 13e0: 60 91 03 04 lds r22, 0x0403 13e4: 70 e0 ldi r23, 0x00 ; 0 13e6: 8c c0 rjmp .+280 ; 0x1500 <_ZN4Menu8DrawMenuEPvS0_+0x1f8> } break; case 2: Display::sendDispRamString((char*)"OS info:"); 13e8: 85 e2 ldi r24, 0x25 ; 37 13ea: 91 e0 ldi r25, 0x01 ; 1 13ec: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)TaskManager::cur_tasks); 13f0: 60 91 cc 04 lds r22, 0x04CC 13f4: 70 e0 ldi r23, 0x00 ; 0 13f6: 80 e0 ldi r24, 0x00 ; 0 13f8: 90 e0 ldi r25, 0x00 ; 0 13fa: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::sendDispRamString((char*)"/12"); 13fe: 8e e2 ldi r24, 0x2E ; 46 1400: 91 e0 ldi r25, 0x01 ; 1 1402: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::dispSetDDRAM(0x40); 1406: 80 e4 ldi r24, 0x40 ; 64 1408: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispRamString((char*)"CPU usage:"); 140c: 82 e3 ldi r24, 0x32 ; 50 140e: 91 e0 ldi r25, 0x01 ; 1 1410: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)TaskManager::cpu_usage); 1414: 60 91 cd 04 lds r22, 0x04CD 1418: 70 e0 ldi r23, 0x00 ; 0 141a: 80 e0 ldi r24, 0x00 ; 0 141c: 90 e0 ldi r25, 0x00 ; 0 141e: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::sendDispRamString((char*)"%"); 1422: 8d e3 ldi r24, 0x3D ; 61 1424: 91 e0 ldi r25, 0x01 ; 1 1426: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> 142a: 08 95 ret break; case 3: Display::sendDispRamString((char*)"Filter motor:"); 142c: 8f e3 ldi r24, 0x3F ; 63 142e: 91 e0 ldi r25, 0x01 ; 1 1430: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::dispSetDDRAM(0x40); 1434: 80 e4 ldi r24, 0x40 ; 64 1436: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispInt((int32_t)Coffee::motor_filter_status); 143a: 60 91 10 05 lds r22, 0x0510 143e: d2 cf rjmp .-92 ; 0x13e4 <_ZN4Menu8DrawMenuEPvS0_+0xdc> break; case 4: Display::sendDispRamString((char*)"Arm motor:"); 1440: 8d e4 ldi r24, 0x4D ; 77 1442: 91 e0 ldi r25, 0x01 ; 1 1444: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::dispSetDDRAM(0x40); 1448: 80 e4 ldi r24, 0x40 ; 64 144a: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispInt((int32_t)Coffee::motor_arm_status); 144e: 60 91 11 05 lds r22, 0x0511 1452: c8 cf rjmp .-112 ; 0x13e4 <_ZN4Menu8DrawMenuEPvS0_+0xdc> break; case 5: Display::sendDispRamString((char*)"Coffee:"); 1454: 88 e5 ldi r24, 0x58 ; 88 1456: 91 e0 ldi r25, 0x01 ; 1 1458: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::current_weight.coffee); 145c: 60 91 18 05 lds r22, 0x0518 1460: 70 91 19 05 lds r23, 0x0519 1464: 80 e0 ldi r24, 0x00 ; 0 1466: 90 e0 ldi r25, 0x00 ; 0 1468: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::dispSetDDRAM(0x40); 146c: 80 e4 ldi r24, 0x40 ; 64 146e: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispRamString((char*)"Water:"); 1472: 80 e6 ldi r24, 0x60 ; 96 1474: 91 e0 ldi r25, 0x01 ; 1 1476: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::current_weight.water); 147a: 60 91 16 05 lds r22, 0x0516 147e: 70 91 17 05 lds r23, 0x0517 1482: 3e c0 rjmp .+124 ; 0x1500 <_ZN4Menu8DrawMenuEPvS0_+0x1f8> break; case 6: Display::sendDispRamString((char*)"Vacuum 1:"); 1484: 87 e6 ldi r24, 0x67 ; 103 1486: 91 e0 ldi r25, 0x01 ; 1 1488: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::cur_vacuum_pw[0]); 148c: 60 91 1a 05 lds r22, 0x051A 1490: 70 e0 ldi r23, 0x00 ; 0 1492: 80 e0 ldi r24, 0x00 ; 0 1494: 90 e0 ldi r25, 0x00 ; 0 1496: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::sendDispRamString((char*)"%"); 149a: 8d e3 ldi r24, 0x3D ; 61 149c: 91 e0 ldi r25, 0x01 ; 1 149e: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::dispSetDDRAM(0x40); 14a2: 80 e4 ldi r24, 0x40 ; 64 14a4: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispRamString((char*)"Current: "); 14a8: 81 e7 ldi r24, 0x71 ; 113 14aa: 91 e0 ldi r25, 0x01 ; 1 14ac: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::vacuum_current[0]); 14b0: 60 91 1c 05 lds r22, 0x051C 14b4: 70 91 1d 05 lds r23, 0x051D 14b8: 23 c0 rjmp .+70 ; 0x1500 <_ZN4Menu8DrawMenuEPvS0_+0x1f8> break; case 7: Display::sendDispRamString((char*)"Vacuum 2:"); 14ba: 8b e7 ldi r24, 0x7B ; 123 14bc: 91 e0 ldi r25, 0x01 ; 1 14be: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::cur_vacuum_pw[1]); 14c2: 60 91 1b 05 lds r22, 0x051B 14c6: 70 e0 ldi r23, 0x00 ; 0 14c8: 80 e0 ldi r24, 0x00 ; 0 14ca: 90 e0 ldi r25, 0x00 ; 0 14cc: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::sendDispRamString((char*)"%"); 14d0: 8d e3 ldi r24, 0x3D ; 61 14d2: 91 e0 ldi r25, 0x01 ; 1 14d4: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::dispSetDDRAM(0x40); 14d8: 80 e4 ldi r24, 0x40 ; 64 14da: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispRamString((char*)"Current: "); 14de: 81 e7 ldi r24, 0x71 ; 113 14e0: 91 e0 ldi r25, 0x01 ; 1 14e2: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::vacuum_current[1]); 14e6: 60 91 1e 05 lds r22, 0x051E 14ea: 70 91 1f 05 lds r23, 0x051F 14ee: 08 c0 rjmp .+16 ; 0x1500 <_ZN4Menu8DrawMenuEPvS0_+0x1f8> break; case 8: Display::sendDispRamString((char*)"Servo3:"); 14f0: 85 e8 ldi r24, 0x85 ; 133 14f2: 91 e0 ldi r25, 0x01 ; 1 14f4: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::servo_pos); 14f8: 60 91 99 01 lds r22, 0x0199 14fc: 70 91 9a 01 lds r23, 0x019A 1500: 80 e0 ldi r24, 0x00 ; 0 1502: 90 e0 ldi r25, 0x00 ; 0 1504: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> 1508: 08 95 ret break; case 9: Display::sendDispRamString((char*)"Arm period:"); 150a: 8d e8 ldi r24, 0x8D ; 141 150c: 91 e0 ldi r25, 0x01 ; 1 150e: 0e 94 df 0c call 0x19be ; 0x19be <_ZN7Display17sendDispRamStringEPc> Display::sendDispInt((int32_t)Coffee::garbage_arm_period); 1512: 60 91 20 05 lds r22, 0x0520 1516: 70 91 21 05 lds r23, 0x0521 151a: 80 e0 ldi r24, 0x00 ; 0 151c: 90 e0 ldi r25, 0x00 ; 0 151e: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> Display::dispSetDDRAM(0x40); 1522: 80 e4 ldi r24, 0x40 ; 64 1524: 0e 94 7f 09 call 0x12fe ; 0x12fe <_ZN7DisplayL12dispSetDDRAMEc> Display::sendDispInt((int32_t)Coffee::garbage_arm); 1528: 60 91 22 05 lds r22, 0x0522 152c: 70 e0 ldi r23, 0x00 ; 0 152e: 80 e0 ldi r24, 0x00 ; 0 1530: 90 e0 ldi r25, 0x00 ; 0 1532: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> 1536: 08 95 ret 00001538 <_ZN5Input4InitEv>: State lastState[5]; uint8_t key_events[5]; void Init(void){ DDRA = 0x00;//Or similar 1538: 1a ba out 0x1a, r1 ; 26 } 153a: 08 95 ret 0000153c <_ZN5Input13CheckKeyPressEPvS0_>: void CheckKeyPress(void* unused,void* unused2){ 153c: ef 92 push r14 153e: 0f 93 push r16 1540: 1f 93 push r17 1542: cf 93 push r28 1544: df 93 push r29 1546: a2 ee ldi r26, 0xE2 ; 226 1548: b4 e0 ldi r27, 0x04 ; 4 154a: cc ee ldi r28, 0xEC ; 236 154c: d4 e0 ldi r29, 0x04 ; 4 154e: 50 e0 ldi r21, 0x00 ; 0 1550: 20 e0 ldi r18, 0x00 ; 0 1552: 30 e0 ldi r19, 0x00 ; 0 keyState[i] = Idle; else{ keyState[i] = Pushed; if(lastState[i]==Idle){ diff = 1; key_events[i] = 1; 1554: 61 e0 ldi r22, 0x01 ; 1 void CheckKeyPress(void* unused,void* unused2){ uint8_t i; uint8_t diff = 0; for(i = 0; i < 5; i++){ lastState[i] = keyState[i]; 1556: 4c 91 ld r20, X 1558: f9 01 movw r30, r18 155a: e9 51 subi r30, 0x19 ; 25 155c: fb 4f sbci r31, 0xFB ; 251 155e: 40 83 st Z, r20 key_events[i] = 0; 1560: 18 82 st Y, r1 if(((INPUT_PIN>>i)&0x01)==0x01) 1562: 89 b3 in r24, 0x19 ; 25 1564: 90 e0 ldi r25, 0x00 ; 0 1566: 02 2e mov r0, r18 1568: 02 c0 rjmp .+4 ; 0x156e <_ZN5Input13CheckKeyPressEPvS0_+0x32> 156a: 95 95 asr r25 156c: 87 95 ror r24 156e: 0a 94 dec r0 1570: e2 f7 brpl .-8 ; 0x156a <_ZN5Input13CheckKeyPressEPvS0_+0x2e> 1572: 80 ff sbrs r24, 0 1574: 02 c0 rjmp .+4 ; 0x157a <_ZN5Input13CheckKeyPressEPvS0_+0x3e> keyState[i] = Idle; 1576: 6c 93 st X, r22 1578: 05 c0 rjmp .+10 ; 0x1584 <_ZN5Input13CheckKeyPressEPvS0_+0x48> else{ keyState[i] = Pushed; 157a: 1c 92 st X, r1 if(lastState[i]==Idle){ 157c: 41 30 cpi r20, 0x01 ; 1 157e: 11 f4 brne .+4 ; 0x1584 <_ZN5Input13CheckKeyPressEPvS0_+0x48> diff = 1; key_events[i] = 1; 1580: 48 83 st Y, r20 1582: 51 e0 ldi r21, 0x01 ; 1 1584: 2f 5f subi r18, 0xFF ; 255 1586: 3f 4f sbci r19, 0xFF ; 255 1588: 11 96 adiw r26, 0x01 ; 1 158a: 21 96 adiw r28, 0x01 ; 1 } void CheckKeyPress(void* unused,void* unused2){ uint8_t i; uint8_t diff = 0; for(i = 0; i < 5; i++){ 158c: 25 30 cpi r18, 0x05 ; 5 158e: 31 05 cpc r19, r1 1590: 11 f7 brne .-60 ; 0x1556 <_ZN5Input13CheckKeyPressEPvS0_+0x1a> diff = 1; key_events[i] = 1; } } } if(diff==1){ 1592: 51 30 cpi r21, 0x01 ; 1 1594: 61 f4 brne .+24 ; 0x15ae <_ZN5Input13CheckKeyPressEPvS0_+0x72> //Set this to high priority so that presse will be processed before the next time this function gets called TaskManager::AddTask(ProcessKeys,(void*)0,(void*)0,TaskManager::SINGLE_RUN,0,TaskManager::HIGH); 1596: ee 24 eor r14, r14 1598: 00 e0 ldi r16, 0x00 ; 0 159a: 10 e0 ldi r17, 0x00 ; 0 159c: 20 e0 ldi r18, 0x00 ; 0 159e: 40 e0 ldi r20, 0x00 ; 0 15a0: 50 e0 ldi r21, 0x00 ; 0 15a2: 60 e0 ldi r22, 0x00 ; 0 15a4: 70 e0 ldi r23, 0x00 ; 0 15a6: 8d ed ldi r24, 0xDD ; 221 15a8: 9a e0 ldi r25, 0x0A ; 10 15aa: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> } } 15ae: df 91 pop r29 15b0: cf 91 pop r28 15b2: 1f 91 pop r17 15b4: 0f 91 pop r16 15b6: ef 90 pop r14 15b8: 08 95 ret 000015ba <_ZN5Input11ProcessKeysEPvS0_>: void ProcessKeys(void* unused,void* unused2){ 15ba: ef 92 push r14 15bc: 0f 93 push r16 15be: 1f 93 push r17 15c0: df 93 push r29 15c2: cf 93 push r28 15c4: 00 d0 rcall .+0 ; 0x15c6 <_ZN5Input11ProcessKeysEPvS0_+0xc> 15c6: 0f 92 push r0 15c8: cd b7 in r28, 0x3d ; 61 15ca: de b7 in r29, 0x3e ; 62 Coffee::Motor_Status ms; uint8_t t; //Process the keys pressed if(key_events[KEY_CENTER]==1){ 15cc: 80 91 ee 04 lds r24, 0x04EE 15d0: 81 30 cpi r24, 0x01 ; 1 15d2: 09 f0 breq .+2 ; 0x15d6 <_ZN5Input11ProcessKeysEPvS0_+0x1c> 15d4: 4a c0 rjmp .+148 ; 0x166a <_ZN5Input11ProcessKeysEPvS0_+0xb0> if(Menu::cur_menu==3){//Filter 15d6: 80 91 e1 04 lds r24, 0x04E1 15da: 83 30 cpi r24, 0x03 ; 3 15dc: 51 f4 brne .+20 ; 0x15f2 <_ZN5Input11ProcessKeysEPvS0_+0x38> ms = Coffee::motor_filter_status; ms = (Coffee::Motor_Status)(((uint8_t)ms)+1); 15de: 80 91 10 05 lds r24, 0x0510 15e2: 8f 5f subi r24, 0xFF ; 255 15e4: 89 83 std Y+1, r24 ; 0x01 if(((uint8_t)ms)>=5) 15e6: 85 30 cpi r24, 0x05 ; 5 15e8: 08 f0 brcs .+2 ; 0x15ec <_ZN5Input11ProcessKeysEPvS0_+0x32> ms = Coffee::MOTOR_STOP; 15ea: 19 82 std Y+1, r1 ; 0x01 t = 1; 15ec: 81 e0 ldi r24, 0x01 ; 1 15ee: 8a 83 std Y+2, r24 ; 0x02 15f0: 0a c0 rjmp .+20 ; 0x1606 <_ZN5Input11ProcessKeysEPvS0_+0x4c> Coffee::RunMotor(&t,&ms); } else if(Menu::cur_menu==4){ 15f2: 84 30 cpi r24, 0x04 ; 4 15f4: 81 f4 brne .+32 ; 0x1616 <_ZN5Input11ProcessKeysEPvS0_+0x5c> ms = Coffee::motor_arm_status; ms = (Coffee::Motor_Status)(((uint8_t)ms)+1); 15f6: 80 91 11 05 lds r24, 0x0511 15fa: 8f 5f subi r24, 0xFF ; 255 15fc: 89 83 std Y+1, r24 ; 0x01 if(((uint8_t)ms)>=5) 15fe: 85 30 cpi r24, 0x05 ; 5 1600: 08 f0 brcs .+2 ; 0x1604 <_ZN5Input11ProcessKeysEPvS0_+0x4a> ms = Coffee::MOTOR_STOP; 1602: 19 82 std Y+1, r1 ; 0x01 t = 0; 1604: 1a 82 std Y+2, r1 ; 0x02 Coffee::RunMotor(&t,&ms); 1606: be 01 movw r22, r28 1608: 6f 5f subi r22, 0xFF ; 255 160a: 7f 4f sbci r23, 0xFF ; 255 160c: ce 01 movw r24, r28 160e: 02 96 adiw r24, 0x02 ; 2 1610: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> 1614: be c0 rjmp .+380 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> } else if(Menu::cur_menu==0){ 1616: 88 23 and r24, r24 1618: 69 f4 brne .+26 ; 0x1634 <_ZN5Input11ProcessKeysEPvS0_+0x7a> //Reset the network TaskManager::AddTask(Coffee::ResetWEB,0,0,TaskManager::SINGLE_RUN,0,TaskManager::HIGH); 161a: ee 24 eor r14, r14 161c: 00 e0 ldi r16, 0x00 ; 0 161e: 10 e0 ldi r17, 0x00 ; 0 1620: 20 e0 ldi r18, 0x00 ; 0 1622: 40 e0 ldi r20, 0x00 ; 0 1624: 50 e0 ldi r21, 0x00 ; 0 1626: 60 e0 ldi r22, 0x00 ; 0 1628: 70 e0 ldi r23, 0x00 ; 0 162a: 80 ec ldi r24, 0xC0 ; 192 162c: 9e e0 ldi r25, 0x0E ; 14 162e: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> 1632: af c0 rjmp .+350 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> } else if(Menu::cur_menu==5){ 1634: 85 30 cpi r24, 0x05 ; 5 1636: 41 f4 brne .+16 ; 0x1648 <_ZN5Input11ProcessKeysEPvS0_+0x8e> uint8_t data = WEIGHT_UPDATE; 1638: 80 e4 ldi r24, 0x40 ; 64 163a: 8b 83 std Y+3, r24 ; 0x03 TWI::Send(COFFEE_WEIGHT,&data,1); 163c: 41 e0 ldi r20, 0x01 ; 1 163e: be 01 movw r22, r28 1640: 6d 5f subi r22, 0xFD ; 253 1642: 7f 4f sbci r23, 0xFF ; 255 1644: 88 e0 ldi r24, 0x08 ; 8 1646: 0e c0 rjmp .+28 ; 0x1664 <_ZN5Input11ProcessKeysEPvS0_+0xaa> } else if(Menu::cur_menu==6){ 1648: 86 30 cpi r24, 0x06 ; 6 164a: 11 f4 brne .+4 ; 0x1650 <_ZN5Input11ProcessKeysEPvS0_+0x96> uint8_t cmd = CURRENT_START; 164c: 8f e0 ldi r24, 0x0F ; 15 164e: 04 c0 rjmp .+8 ; 0x1658 <_ZN5Input11ProcessKeysEPvS0_+0x9e> TWI::Send(COFFEE_CURRENT,&cmd,1); } else if(Menu::cur_menu==7){ 1650: 87 30 cpi r24, 0x07 ; 7 1652: 09 f0 breq .+2 ; 0x1656 <_ZN5Input11ProcessKeysEPvS0_+0x9c> 1654: 9e c0 rjmp .+316 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> uint8_t cmd = CURRENT_STOP; 1656: 80 ef ldi r24, 0xF0 ; 240 1658: 8b 83 std Y+3, r24 ; 0x03 TWI::Send(COFFEE_CURRENT,&cmd,1); 165a: 41 e0 ldi r20, 0x01 ; 1 165c: be 01 movw r22, r28 165e: 6d 5f subi r22, 0xFD ; 253 1660: 7f 4f sbci r23, 0xFF ; 255 1662: 8c e0 ldi r24, 0x0C ; 12 1664: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> 1668: 94 c0 rjmp .+296 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> } } else if(key_events[KEY_LEFT]==1){ 166a: 80 91 ed 04 lds r24, 0x04ED 166e: 81 30 cpi r24, 0x01 ; 1 1670: 51 f4 brne .+20 ; 0x1686 <_ZN5Input11ProcessKeysEPvS0_+0xcc> if(Menu::cur_menu==0) 1672: 80 91 e1 04 lds r24, 0x04E1 1676: 88 23 and r24, r24 1678: 11 f4 brne .+4 ; 0x167e <_ZN5Input11ProcessKeysEPvS0_+0xc4> Menu::cur_menu = NUM_MENU_ITEMS-1; 167a: 89 e0 ldi r24, 0x09 ; 9 167c: 01 c0 rjmp .+2 ; 0x1680 <_ZN5Input11ProcessKeysEPvS0_+0xc6> else Menu::cur_menu--; 167e: 81 50 subi r24, 0x01 ; 1 1680: 80 93 e1 04 sts 0x04E1, r24 1684: 86 c0 rjmp .+268 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> } else if(key_events[KEY_RIGHT]==1){ 1686: 80 91 f0 04 lds r24, 0x04F0 168a: 81 30 cpi r24, 0x01 ; 1 168c: 49 f4 brne .+18 ; 0x16a0 <_ZN5Input11ProcessKeysEPvS0_+0xe6> if(Menu::cur_menu==(NUM_MENU_ITEMS-1)) 168e: 80 91 e1 04 lds r24, 0x04E1 1692: 89 30 cpi r24, 0x09 ; 9 1694: 19 f4 brne .+6 ; 0x169c <_ZN5Input11ProcessKeysEPvS0_+0xe2> Menu::cur_menu = 0; 1696: 10 92 e1 04 sts 0x04E1, r1 169a: 7b c0 rjmp .+246 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> else Menu::cur_menu++; 169c: 8f 5f subi r24, 0xFF ; 255 169e: f0 cf rjmp .-32 ; 0x1680 <_ZN5Input11ProcessKeysEPvS0_+0xc6> } else if(key_events[KEY_UP]==1){ 16a0: 80 91 ec 04 lds r24, 0x04EC 16a4: 81 30 cpi r24, 0x01 ; 1 16a6: 79 f5 brne .+94 ; 0x1706 <_ZN5Input11ProcessKeysEPvS0_+0x14c> if(Menu::cur_menu==6){ 16a8: 80 91 e1 04 lds r24, 0x04E1 16ac: 86 30 cpi r24, 0x06 ; 6 16ae: 59 f4 brne .+22 ; 0x16c6 <_ZN5Input11ProcessKeysEPvS0_+0x10c> Coffee::cur_vacuum_pw[0]+=5; 16b0: 80 91 1a 05 lds r24, 0x051A 16b4: 8b 5f subi r24, 0xFB ; 251 16b6: 80 93 1a 05 sts 0x051A, r24 if(Coffee::cur_vacuum_pw[0]>=100) 16ba: 84 36 cpi r24, 0x64 ; 100 16bc: b0 f1 brcs .+108 ; 0x172a <_ZN5Input11ProcessKeysEPvS0_+0x170> Coffee::cur_vacuum_pw[0] = 100; 16be: 84 e6 ldi r24, 0x64 ; 100 16c0: 80 93 1a 05 sts 0x051A, r24 16c4: 32 c0 rjmp .+100 ; 0x172a <_ZN5Input11ProcessKeysEPvS0_+0x170> t = 0; Coffee::SetVacuum(&t,&Coffee::cur_vacuum_pw[0]); } else if(Menu::cur_menu==7){ 16c6: 87 30 cpi r24, 0x07 ; 7 16c8: 59 f4 brne .+22 ; 0x16e0 <_ZN5Input11ProcessKeysEPvS0_+0x126> Coffee::cur_vacuum_pw[1]+=5; 16ca: 80 91 1b 05 lds r24, 0x051B 16ce: 8b 5f subi r24, 0xFB ; 251 16d0: 80 93 1b 05 sts 0x051B, r24 if(Coffee::cur_vacuum_pw[1]>100) 16d4: 85 36 cpi r24, 0x65 ; 101 16d6: c0 f1 brcs .+112 ; 0x1748 <_ZN5Input11ProcessKeysEPvS0_+0x18e> Coffee::cur_vacuum_pw[1] = 100; 16d8: 84 e6 ldi r24, 0x64 ; 100 16da: 80 93 1b 05 sts 0x051B, r24 16de: 34 c0 rjmp .+104 ; 0x1748 <_ZN5Input11ProcessKeysEPvS0_+0x18e> t = 1; Coffee::SetVacuum(&t,&Coffee::cur_vacuum_pw[1]); } else if(Menu::cur_menu==8){ 16e0: 88 30 cpi r24, 0x08 ; 8 16e2: 09 f0 breq .+2 ; 0x16e6 <_ZN5Input11ProcessKeysEPvS0_+0x12c> 16e4: 56 c0 rjmp .+172 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> Coffee::servo_pos+=50; 16e6: 80 91 99 01 lds r24, 0x0199 16ea: 90 91 9a 01 lds r25, 0x019A 16ee: c2 96 adiw r24, 0x32 ; 50 16f0: 90 93 9a 01 sts 0x019A, r25 16f4: 80 93 99 01 sts 0x0199, r24 if(Coffee::servo_pos>1700) 16f8: 85 5a subi r24, 0xA5 ; 165 16fa: 96 40 sbci r25, 0x06 ; 6 16fc: 08 f4 brcc .+2 ; 0x1700 <_ZN5Input11ProcessKeysEPvS0_+0x146> 16fe: 41 c0 rjmp .+130 ; 0x1782 <_ZN5Input11ProcessKeysEPvS0_+0x1c8> Coffee::servo_pos = 1700; 1700: 84 ea ldi r24, 0xA4 ; 164 1702: 96 e0 ldi r25, 0x06 ; 6 1704: 3a c0 rjmp .+116 ; 0x177a <_ZN5Input11ProcessKeysEPvS0_+0x1c0> t = 3; Coffee::SetServo(&t,&Coffee::servo_pos); } } else if(key_events[KEY_DOWN]==1){ 1706: 80 91 ef 04 lds r24, 0x04EF 170a: 81 30 cpi r24, 0x01 ; 1 170c: 09 f0 breq .+2 ; 0x1710 <_ZN5Input11ProcessKeysEPvS0_+0x156> 170e: 41 c0 rjmp .+130 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> if(Menu::cur_menu==6){ 1710: 80 91 e1 04 lds r24, 0x04E1 1714: 86 30 cpi r24, 0x06 ; 6 1716: 69 f4 brne .+26 ; 0x1732 <_ZN5Input11ProcessKeysEPvS0_+0x178> Coffee::cur_vacuum_pw[0]-=5; 1718: 80 91 1a 05 lds r24, 0x051A 171c: 85 50 subi r24, 0x05 ; 5 171e: 80 93 1a 05 sts 0x051A, r24 if(Coffee::cur_vacuum_pw[0]>=100) 1722: 84 36 cpi r24, 0x64 ; 100 1724: 10 f0 brcs .+4 ; 0x172a <_ZN5Input11ProcessKeysEPvS0_+0x170> Coffee::cur_vacuum_pw[0] = 0; 1726: 10 92 1a 05 sts 0x051A, r1 t = 0; 172a: 1a 82 std Y+2, r1 ; 0x02 Coffee::SetVacuum(&t,&Coffee::cur_vacuum_pw[0]); 172c: 6a e1 ldi r22, 0x1A ; 26 172e: 75 e0 ldi r23, 0x05 ; 5 1730: 0f c0 rjmp .+30 ; 0x1750 <_ZN5Input11ProcessKeysEPvS0_+0x196> } else if(Menu::cur_menu==7){ 1732: 87 30 cpi r24, 0x07 ; 7 1734: 91 f4 brne .+36 ; 0x175a <_ZN5Input11ProcessKeysEPvS0_+0x1a0> Coffee::cur_vacuum_pw[1]-=5; 1736: 80 91 1b 05 lds r24, 0x051B 173a: 85 50 subi r24, 0x05 ; 5 173c: 80 93 1b 05 sts 0x051B, r24 if(Coffee::cur_vacuum_pw[1]>=100) 1740: 84 36 cpi r24, 0x64 ; 100 1742: 10 f0 brcs .+4 ; 0x1748 <_ZN5Input11ProcessKeysEPvS0_+0x18e> Coffee::cur_vacuum_pw[1] = 0; 1744: 10 92 1b 05 sts 0x051B, r1 t = 1; 1748: 81 e0 ldi r24, 0x01 ; 1 174a: 8a 83 std Y+2, r24 ; 0x02 Coffee::SetVacuum(&t,&Coffee::cur_vacuum_pw[1]); 174c: 6b e1 ldi r22, 0x1B ; 27 174e: 75 e0 ldi r23, 0x05 ; 5 1750: ce 01 movw r24, r28 1752: 02 96 adiw r24, 0x02 ; 2 1754: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> 1758: 1c c0 rjmp .+56 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> } else if(Menu::cur_menu==8){ 175a: 88 30 cpi r24, 0x08 ; 8 175c: d1 f4 brne .+52 ; 0x1792 <_ZN5Input11ProcessKeysEPvS0_+0x1d8> Coffee::servo_pos-=50; 175e: 80 91 99 01 lds r24, 0x0199 1762: 90 91 9a 01 lds r25, 0x019A 1766: c2 97 sbiw r24, 0x32 ; 50 1768: 90 93 9a 01 sts 0x019A, r25 176c: 80 93 99 01 sts 0x0199, r24 if(Coffee::servo_pos<700) 1770: 8c 5b subi r24, 0xBC ; 188 1772: 92 40 sbci r25, 0x02 ; 2 1774: 30 f4 brcc .+12 ; 0x1782 <_ZN5Input11ProcessKeysEPvS0_+0x1c8> Coffee::servo_pos = 700; 1776: 8c eb ldi r24, 0xBC ; 188 1778: 92 e0 ldi r25, 0x02 ; 2 177a: 90 93 9a 01 sts 0x019A, r25 177e: 80 93 99 01 sts 0x0199, r24 t = 3; 1782: 83 e0 ldi r24, 0x03 ; 3 1784: 8a 83 std Y+2, r24 ; 0x02 Coffee::SetServo(&t,&Coffee::servo_pos); 1786: 69 e9 ldi r22, 0x99 ; 153 1788: 71 e0 ldi r23, 0x01 ; 1 178a: ce 01 movw r24, r28 178c: 02 96 adiw r24, 0x02 ; 2 178e: 0e 94 54 0d call 0x1aa8 ; 0x1aa8 <_ZN6Coffee8SetServoEPvS0_> } } //Force a redraw TaskManager::AddTask(Menu::DrawMenu,(void*)0,(void*)0,TaskManager::SINGLE_RUN,0,TaskManager::MEDIUM); 1792: 82 e3 ldi r24, 0x32 ; 50 1794: e8 2e mov r14, r24 1796: 00 e0 ldi r16, 0x00 ; 0 1798: 10 e0 ldi r17, 0x00 ; 0 179a: 20 e0 ldi r18, 0x00 ; 0 179c: 40 e0 ldi r20, 0x00 ; 0 179e: 50 e0 ldi r21, 0x00 ; 0 17a0: 60 e0 ldi r22, 0x00 ; 0 17a2: 70 e0 ldi r23, 0x00 ; 0 17a4: 84 e8 ldi r24, 0x84 ; 132 17a6: 99 e0 ldi r25, 0x09 ; 9 17a8: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> } 17ac: 0f 90 pop r0 17ae: 0f 90 pop r0 17b0: 0f 90 pop r0 17b2: cf 91 pop r28 17b4: df 91 pop r29 17b6: 1f 91 pop r17 17b8: 0f 91 pop r16 17ba: ef 90 pop r14 17bc: 08 95 ret 000017be <_ZN7Display11hentDisplayEv>: char hentDisplay(void){ //Setter dataporter til innganger, og styresignalene til utganger. DISPLAY_DDR = (1< } if(p & (1<: } //RS=1 sender data, RS=0 sender instruksjon (LSB bestemmer). T-flagget brukes i funkjonen void sendDisplay(uint8_t data, const uint8_t RS){ 17f8: 0f 93 push r16 17fa: 1f 93 push r17 17fc: cf 93 push r28 17fe: df 93 push r29 1800: 18 2f mov r17, r24 1802: 06 2f mov r16, r22 DISPLAY_PORT = 0; 1804: 15 ba out 0x15, r1 ; 21 if(displayStatus==0)//drit i alt hvis displayet ikke er tilkoblet 1806: 80 91 f1 04 lds r24, 0x04F1 180a: 88 23 and r24, r24 180c: 61 f1 breq .+88 ; 0x1866 <_ZN7Display11sendDisplayEhh+0x6e> return; int teller = 0; asm volatile("clt" "\n\t"::); 180e: e8 94 clt 1810: c0 e0 ldi r28, 0x00 ; 0 1812: d0 e0 ldi r29, 0x00 ; 0 while( (hentDisplay() & 0x80) && ((++teller) < 1000) ){ 1814: 0e 94 df 0b call 0x17be ; 0x17be <_ZN7Display11hentDisplayEv> 1818: 87 ff sbrs r24, 7 181a: 21 c0 rjmp .+66 ; 0x185e <_ZN7Display11sendDisplayEhh+0x66> 181c: 21 96 adiw r28, 0x01 ; 1 181e: 83 e0 ldi r24, 0x03 ; 3 1820: c8 3e cpi r28, 0xE8 ; 232 1822: d8 07 cpc r29, r24 1824: b9 f7 brne .-18 ; 0x1814 <_ZN7Display11sendDisplayEhh+0x1c> } if (!(teller<1000)){ displayStatus = 0; 1826: 10 92 f1 04 sts 0x04F1, r1 //OSAddTask(initDisplay, (void*)0, 200); } //Skal altså sende... DISPLAY_DDR = (1< 185c: 04 c0 rjmp .+8 ; 0x1866 <_ZN7Display11sendDisplayEhh+0x6e> int teller = 0; asm volatile("clt" "\n\t"::); while( (hentDisplay() & 0x80) && ((++teller) < 1000) ){ } if (!(teller<1000)){ 185e: c8 5e subi r28, 0xE8 ; 232 1860: d3 40 sbci r29, 0x03 ; 3 1862: 1c f3 brlt .-58 ; 0x182a <_ZN7Display11sendDisplayEhh+0x32> 1864: e0 cf rjmp .-64 ; 0x1826 <_ZN7Display11sendDisplayEhh+0x2e> DISPLAY_PORT = utByte; //Resetter EN-pinne } } 1866: df 91 pop r29 1868: cf 91 pop r28 186a: 1f 91 pop r17 186c: 0f 91 pop r16 186e: 08 95 ret 00001870 <_ZN7Display11sendDispIntEl>: sendDisplayData(*tegn++); } void sendDispInt(int32_t tall){ 1870: 9f 92 push r9 1872: af 92 push r10 1874: bf 92 push r11 1876: cf 92 push r12 1878: df 92 push r13 187a: ef 92 push r14 187c: ff 92 push r15 187e: 0f 93 push r16 1880: 1f 93 push r17 1882: cf 93 push r28 1884: df 93 push r29 1886: 7b 01 movw r14, r22 1888: 8c 01 movw r16, r24 if (tall < 0){ 188a: 97 ff sbrs r25, 7 188c: 0b c0 rjmp .+22 ; 0x18a4 <_ZN7Display11sendDispIntEl+0x34> tall = - tall; 188e: 10 95 com r17 1890: 00 95 com r16 1892: f0 94 com r15 1894: e0 94 com r14 1896: e1 1c adc r14, r1 1898: f1 1c adc r15, r1 189a: 01 1d adc r16, r1 189c: 11 1d adc r17, r1 void sendDispProgString(char* progAddresse); void sendDispInt(int32_t tall); void sendDispFloat(float tall, uint16_t decimalMultiplier); static inline void sendDisplayData(char data){ sendDisplay(data, 1); 189e: 61 e0 ldi r22, 0x01 ; 1 18a0: 8d e2 ldi r24, 0x2D ; 45 18a2: 07 c0 rjmp .+14 ; 0x18b2 <_ZN7Display11sendDispIntEl+0x42> sendDisplayData('-'); } if(tall == 0){ 18a4: 61 15 cp r22, r1 18a6: 71 05 cpc r23, r1 18a8: 81 05 cpc r24, r1 18aa: 91 05 cpc r25, r1 18ac: 21 f4 brne .+8 ; 0x18b6 <_ZN7Display11sendDispIntEl+0x46> 18ae: 61 e0 ldi r22, 0x01 ; 1 18b0: 80 e3 ldi r24, 0x30 ; 48 18b2: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> 18b6: a1 2c mov r10, r1 18b8: 8a ec ldi r24, 0xCA ; 202 18ba: b8 2e mov r11, r24 18bc: 8a e9 ldi r24, 0x9A ; 154 18be: c8 2e mov r12, r24 18c0: 8b e3 ldi r24, 0x3B ; 59 18c2: d8 2e mov r13, r24 18c4: 99 24 eor r9, r9 18c6: ca e0 ldi r28, 0x0A ; 10 18c8: d0 e0 ldi r29, 0x00 ; 0 } int32_t divisor = 1000000000; uint8_t startet = 0; while(divisor != 0){ uint8_t sendes = ((uint8_t) (tall/divisor)); 18ca: c8 01 movw r24, r16 18cc: b7 01 movw r22, r14 18ce: a6 01 movw r20, r12 18d0: 95 01 movw r18, r10 18d2: 0e 94 7f 12 call 0x24fe ; 0x24fe <__divmodsi4> if((startet != 0) || (sendes != 0)){ 18d6: 99 20 and r9, r9 18d8: 11 f4 brne .+4 ; 0x18de <_ZN7Display11sendDispIntEl+0x6e> 18da: 22 23 and r18, r18 18dc: 91 f0 breq .+36 ; 0x1902 <_ZN7Display11sendDispIntEl+0x92> 18de: 61 e0 ldi r22, 0x01 ; 1 18e0: 82 2f mov r24, r18 18e2: 80 5d subi r24, 0xD0 ; 208 18e4: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> sendDisplayData(sendes+'0'); startet = 0xFF; tall = tall%divisor; 18e8: c8 01 movw r24, r16 18ea: b7 01 movw r22, r14 18ec: a6 01 movw r20, r12 18ee: 95 01 movw r18, r10 18f0: 0e 94 7f 12 call 0x24fe ; 0x24fe <__divmodsi4> 18f4: ac 01 movw r20, r24 18f6: cb 01 movw r24, r22 18f8: da 01 movw r26, r20 18fa: 7c 01 movw r14, r24 18fc: 8d 01 movw r16, r26 18fe: 99 24 eor r9, r9 1900: 9a 94 dec r9 } divisor = divisor/10; 1902: c6 01 movw r24, r12 1904: b5 01 movw r22, r10 1906: 2a e0 ldi r18, 0x0A ; 10 1908: 30 e0 ldi r19, 0x00 ; 0 190a: 40 e0 ldi r20, 0x00 ; 0 190c: 50 e0 ldi r21, 0x00 ; 0 190e: 0e 94 7f 12 call 0x24fe ; 0x24fe <__divmodsi4> 1912: c9 01 movw r24, r18 1914: da 01 movw r26, r20 1916: 5c 01 movw r10, r24 1918: 6d 01 movw r12, r26 191a: 21 97 sbiw r28, 0x01 ; 1 sendDisplayData('0'); } int32_t divisor = 1000000000; uint8_t startet = 0; while(divisor != 0){ 191c: b1 f6 brne .-84 ; 0x18ca <_ZN7Display11sendDispIntEl+0x5a> startet = 0xFF; tall = tall%divisor; } divisor = divisor/10; } } 191e: df 91 pop r29 1920: cf 91 pop r28 1922: 1f 91 pop r17 1924: 0f 91 pop r16 1926: ff 90 pop r15 1928: ef 90 pop r14 192a: df 90 pop r13 192c: cf 90 pop r12 192e: bf 90 pop r11 1930: af 90 pop r10 1932: 9f 90 pop r9 1934: 08 95 ret 00001936 <_ZN7Display13sendDispFloatEfj>: void sendDispFloat(const float tall, const uint16_t decimalMultiplier){ 1936: af 92 push r10 1938: bf 92 push r11 193a: cf 92 push r12 193c: df 92 push r13 193e: ef 92 push r14 1940: ff 92 push r15 1942: 0f 93 push r16 1944: 1f 93 push r17 1946: 7b 01 movw r14, r22 1948: 8c 01 movw r16, r24 194a: 5a 01 movw r10, r20 int32_t vises = (int32_t) (tall*decimalMultiplier); 194c: cc 24 eor r12, r12 194e: dd 24 eor r13, r13 1950: c6 01 movw r24, r12 1952: b5 01 movw r22, r10 1954: 0e 94 6c 11 call 0x22d8 ; 0x22d8 <__floatunsisf> 1958: 9b 01 movw r18, r22 195a: ac 01 movw r20, r24 195c: c8 01 movw r24, r16 195e: b7 01 movw r22, r14 1960: 0e 94 fa 11 call 0x23f4 ; 0x23f4 <__mulsf3> 1964: 0e 94 3b 11 call 0x2276 ; 0x2276 <__fixsfsi> 1968: 7b 01 movw r14, r22 196a: 8c 01 movw r16, r24 sendDispInt(vises/decimalMultiplier); 196c: c8 01 movw r24, r16 196e: a6 01 movw r20, r12 1970: 95 01 movw r18, r10 1972: 0e 94 7f 12 call 0x24fe ; 0x24fe <__divmodsi4> 1976: ca 01 movw r24, r20 1978: b9 01 movw r22, r18 197a: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> 197e: 61 e0 ldi r22, 0x01 ; 1 1980: 8e e2 ldi r24, 0x2E ; 46 1982: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> sendDisplayData('.'); sendDispInt( (fabs(vises%decimalMultiplier))+0.5 ); 1986: b7 01 movw r22, r14 1988: c8 01 movw r24, r16 198a: a6 01 movw r20, r12 198c: 95 01 movw r18, r10 198e: 0e 94 7f 12 call 0x24fe ; 0x24fe <__divmodsi4> 1992: 0e 94 6e 11 call 0x22dc ; 0x22dc <__floatsisf> 1996: 9f 77 andi r25, 0x7F ; 127 1998: 20 e0 ldi r18, 0x00 ; 0 199a: 30 e0 ldi r19, 0x00 ; 0 199c: 40 e0 ldi r20, 0x00 ; 0 199e: 5f e3 ldi r21, 0x3F ; 63 19a0: 0e 94 d7 10 call 0x21ae ; 0x21ae <__addsf3> 19a4: 0e 94 3b 11 call 0x2276 ; 0x2276 <__fixsfsi> 19a8: 0e 94 38 0c call 0x1870 ; 0x1870 <_ZN7Display11sendDispIntEl> } 19ac: 1f 91 pop r17 19ae: 0f 91 pop r16 19b0: ff 90 pop r15 19b2: ef 90 pop r14 19b4: df 90 pop r13 19b6: cf 90 pop r12 19b8: bf 90 pop r11 19ba: af 90 pop r10 19bc: 08 95 ret 000019be <_ZN7Display17sendDispRamStringEPc>: sendDisplayData(tegn); tegn = pgm_read_byte(progAddresse++); } } void sendDispRamString(char* progAddresse){ 19be: cf 93 push r28 19c0: df 93 push r29 19c2: ec 01 movw r28, r24 19c4: 04 c0 rjmp .+8 ; 0x19ce <_ZN7Display17sendDispRamStringEPc+0x10> char* tegn = progAddresse; while(*tegn != 0) sendDisplayData(*tegn++); 19c6: 21 96 adiw r28, 0x01 ; 1 19c8: 61 e0 ldi r22, 0x01 ; 1 19ca: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> } } void sendDispRamString(char* progAddresse){ char* tegn = progAddresse; while(*tegn != 0) 19ce: 88 81 ld r24, Y 19d0: 88 23 and r24, r24 19d2: c9 f7 brne .-14 ; 0x19c6 <_ZN7Display17sendDispRamStringEPc+0x8> sendDisplayData(*tegn++); } 19d4: df 91 pop r29 19d6: cf 91 pop r28 19d8: 08 95 ret 000019da <_ZN7Display18sendDispProgStringEPc>: namespace Display{ uint8_t displayStatus; //0->ikke tilkoblet, 1->tilkoblet void sendDispProgString(char* progAddresse){ 19da: cf 93 push r28 19dc: df 93 push r29 char tegn = pgm_read_byte(progAddresse++); 19de: fc 01 movw r30, r24 19e0: ec 01 movw r28, r24 19e2: 84 91 lpm r24, Z 19e4: 05 c0 rjmp .+10 ; 0x19f0 <_ZN7Display18sendDispProgStringEPc+0x16> 19e6: 61 e0 ldi r22, 0x01 ; 1 19e8: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> while(tegn != 0){ sendDisplayData(tegn); tegn = pgm_read_byte(progAddresse++); 19ec: fe 01 movw r30, r28 19ee: 84 91 lpm r24, Z 19f0: 21 96 adiw r28, 0x01 ; 1 uint8_t displayStatus; //0->ikke tilkoblet, 1->tilkoblet void sendDispProgString(char* progAddresse){ char tegn = pgm_read_byte(progAddresse++); while(tegn != 0){ 19f2: 88 23 and r24, r24 19f4: c1 f7 brne .-16 ; 0x19e6 <_ZN7Display18sendDispProgStringEPc+0xc> sendDisplayData(tegn); tegn = pgm_read_byte(progAddresse++); } } 19f6: df 91 pop r29 19f8: cf 91 pop r28 19fa: 08 95 ret 000019fc <_ZN7Display11initDisplayEv>: return ret; } uint8_t initDisplay(void){ 19fc: 0f 93 push r16 19fe: 1f 93 push r17 displayStatus = 1; 1a00: 81 e0 ldi r24, 0x01 ; 1 1a02: 80 93 f1 04 sts 0x04F1, r24 DISPLAY_DDR = (1< 1a1c: 41 fb bst r20, 1 1a1e: 83 f9 bld r24, 3 DISPLAY_PORT = pinne; 1a20: 85 bb out 0x15, r24 ; 21 asm volatile("nop" ::); 1a22: 00 00 nop DISPLAY_PORT |= (1<>1){ 1a30: 46 95 lsr r20 1a32: 21 50 subi r18, 0x01 ; 1 1a34: 30 40 sbci r19, 0x00 ; 0 1a36: 79 f7 brne .-34 ; 0x1a16 <_ZN7Display11initDisplayEv+0x1a> } static inline void sendDisplayInstruksjon(char instr){ sendDisplay(instr, 0); 1a38: 60 e0 ldi r22, 0x00 ; 0 1a3a: 88 e2 ldi r24, 0x28 ; 40 1a3c: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> } sendDisplayInstruksjon(0x28); if(displayStatus == 0){ 1a40: 80 91 f1 04 lds r24, 0x04F1 1a44: 88 23 and r24, r24 1a46: 19 f1 breq .+70 ; 0x1a8e <_ZN7Display11initDisplayEv+0x92> 1a48: 60 e0 ldi r22, 0x00 ; 0 1a4a: 86 e0 ldi r24, 0x06 ; 6 1a4c: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> sendDisplayInstruksjon(0x0c); sendDisplayInstruksjon(0x48); //setter CG-ram-adresse uint16_t adr = reinterpret_cast(egneKaraktera); 1a50: 60 e0 ldi r22, 0x00 ; 0 1a52: 82 e0 ldi r24, 0x02 ; 2 1a54: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> 1a58: 60 e0 ldi r22, 0x00 ; 0 1a5a: 8c e0 ldi r24, 0x0C ; 12 1a5c: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> 1a60: 60 e0 ldi r22, 0x00 ; 0 1a62: 88 e4 ldi r24, 0x48 ; 72 1a64: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> 1a68: e0 ec ldi r30, 0xC0 ; 192 1a6a: f0 e0 ldi r31, 0x00 ; 0 1a6c: 08 c0 rjmp .+16 ; 0x1a7e <_ZN7Display11initDisplayEv+0x82> uint16_t size = adr + sizeof(egneKaraktera); while(adr < size ){ sendDisplayData(pgm_read_byte(adr++)); 1a6e: 8f 01 movw r16, r30 1a70: 0f 5f subi r16, 0xFF ; 255 1a72: 1f 4f sbci r17, 0xFF ; 255 1a74: 84 91 lpm r24, Z void sendDispProgString(char* progAddresse); void sendDispInt(int32_t tall); void sendDispFloat(float tall, uint16_t decimalMultiplier); static inline void sendDisplayData(char data){ sendDisplay(data, 1); 1a76: 61 e0 ldi r22, 0x01 ; 1 1a78: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> 1a7c: f8 01 movw r30, r16 sendDisplayInstruksjon(0x48); //setter CG-ram-adresse uint16_t adr = reinterpret_cast(egneKaraktera); uint16_t size = adr + sizeof(egneKaraktera); while(adr < size ){ 1a7e: 80 e0 ldi r24, 0x00 ; 0 1a80: e8 3f cpi r30, 0xF8 ; 248 1a82: f8 07 cpc r31, r24 1a84: a0 f3 brcs .-24 ; 0x1a6e <_ZN7Display11initDisplayEv+0x72> } static inline void sendDisplayInstruksjon(char instr){ sendDisplay(instr, 0); 1a86: 60 e0 ldi r22, 0x00 ; 0 1a88: 80 e8 ldi r24, 0x80 ; 128 1a8a: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> sendDisplayData(pgm_read_byte(adr++)); } dispSetDDRAM(0); return 0; } 1a8e: 80 e0 ldi r24, 0x00 ; 0 1a90: 1f 91 pop r17 1a92: 0f 91 pop r16 1a94: 08 95 ret 00001a96 <_ZN7Display15checkDispStatusEPv>: } static inline char hentDisplayAddresse(void){ asm volatile("clt"::); 1a96: e8 94 clt return hentDisplay(); 1a98: 0e 94 df 0b call 0x17be ; 0x17be <_ZN7Display11hentDisplayEv> static inline void sendDisplayData(char data){ sendDisplay(data, 1); } static inline void sendDisplayInstruksjon(char instr){ sendDisplay(instr, 0); 1a9c: 60 e0 ldi r22, 0x00 ; 0 1a9e: 80 68 ori r24, 0x80 ; 128 1aa0: 0e 94 fc 0b call 0x17f8 ; 0x17f8 <_ZN7Display11sendDisplayEhh> } else { //OSAddTask(initDisplay, (void*)0, 300); //Skal prøve å koble til displayet } return 0; } 1aa4: 80 e0 ldi r24, 0x00 ; 0 1aa6: 08 95 ret 00001aa8 <_ZN6Coffee8SetServoEPvS0_>: data[1] = dty; cur_vacuum_pw[(chnl&0x01)] = dty; TWI::Send(COFFEE_VACUUM,data,2); } void SetServo(void* servo, void* position){ 1aa8: df 93 push r29 1aaa: cf 93 push r28 1aac: 00 d0 rcall .+0 ; 0x1aae <_ZN6Coffee8SetServoEPvS0_+0x6> 1aae: cd b7 in r28, 0x3d ; 61 1ab0: de b7 in r29, 0x3e ; 62 1ab2: fc 01 movw r30, r24 uint8_t servo_num = *((uint8_t*)servo); 1ab4: 40 81 ld r20, Z uint8_t* pos2 = (uint8_t*)position; 1ab6: fb 01 movw r30, r22 uint8_t pos[2]; uint8_t data[2]; pos[0] = pos2[1]; pos[1] = pos2[0]; 1ab8: 30 81 ld r19, Z data[0] = pos[0] & 0x0f; data[0] |= (((servo_num%2)<<4)&(1<<4)); 1aba: 84 2f mov r24, r20 1abc: 90 e0 ldi r25, 0x00 ; 0 1abe: 81 70 andi r24, 0x01 ; 1 1ac0: 90 70 andi r25, 0x00 ; 0 1ac2: 24 e0 ldi r18, 0x04 ; 4 1ac4: 88 0f add r24, r24 1ac6: 99 1f adc r25, r25 1ac8: 2a 95 dec r18 1aca: e1 f7 brne .-8 ; 0x1ac4 <_ZN6Coffee8SetServoEPvS0_+0x1c> 1acc: 80 71 andi r24, 0x10 ; 16 1ace: 21 81 ldd r18, Z+1 ; 0x01 1ad0: 2f 70 andi r18, 0x0F ; 15 1ad2: 82 2b or r24, r18 1ad4: 89 83 std Y+1, r24 ; 0x01 data[1] = pos[1]; 1ad6: 3a 83 std Y+2, r19 ; 0x02 if(servo_num<2) 1ad8: 42 30 cpi r20, 0x02 ; 2 1ada: 30 f4 brcc .+12 ; 0x1ae8 <_ZN6Coffee8SetServoEPvS0_+0x40> TWI::Send(COFFEE_MOTOR1,data,2); 1adc: 42 e0 ldi r20, 0x02 ; 2 1ade: be 01 movw r22, r28 1ae0: 6f 5f subi r22, 0xFF ; 255 1ae2: 7f 4f sbci r23, 0xFF ; 255 1ae4: 83 e0 ldi r24, 0x03 ; 3 1ae6: 07 c0 rjmp .+14 ; 0x1af6 <_ZN6Coffee8SetServoEPvS0_+0x4e> else if(servo_num<4) 1ae8: 44 30 cpi r20, 0x04 ; 4 1aea: 38 f4 brcc .+14 ; 0x1afa <_ZN6Coffee8SetServoEPvS0_+0x52> TWI::Send(COFFEE_MOTOR2,data,2); 1aec: 42 e0 ldi r20, 0x02 ; 2 1aee: be 01 movw r22, r28 1af0: 6f 5f subi r22, 0xFF ; 255 1af2: 7f 4f sbci r23, 0xFF ; 255 1af4: 84 e0 ldi r24, 0x04 ; 4 1af6: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> } 1afa: 0f 90 pop r0 1afc: 0f 90 pop r0 1afe: cf 91 pop r28 1b00: df 91 pop r29 1b02: 08 95 ret 00001b04 <_ZN6Coffee9SetVacuumEPvS0_>: Coffee::garbage_arm = (Motor_Status)data[1]; TWI::Send(COFFEE_GARBAGE,data,2); } } void SetVacuum(void* channel, void* duty){ 1b04: df 93 push r29 1b06: cf 93 push r28 1b08: 00 d0 rcall .+0 ; 0x1b0a <_ZN6Coffee9SetVacuumEPvS0_+0x6> 1b0a: cd b7 in r28, 0x3d ; 61 1b0c: de b7 in r29, 0x3e ; 62 1b0e: fc 01 movw r30, r24 1b10: db 01 movw r26, r22 uint8_t chnl = *((uint8_t*)channel); 1b12: e0 81 ld r30, Z uint8_t dty = *((uint8_t*)duty); 1b14: 9c 91 ld r25, X uint8_t data[2]; data[0] = chnl&0x01; 1b16: 8e 2f mov r24, r30 1b18: 81 70 andi r24, 0x01 ; 1 1b1a: 89 83 std Y+1, r24 ; 0x01 1b1c: 95 36 cpi r25, 0x65 ; 101 1b1e: 08 f0 brcs .+2 ; 0x1b22 <_ZN6Coffee9SetVacuumEPvS0_+0x1e> 1b20: 94 e6 ldi r25, 0x64 ; 100 if(dty>100) dty = 100; data[1] = dty; 1b22: 9a 83 std Y+2, r25 ; 0x02 cur_vacuum_pw[(chnl&0x01)] = dty; 1b24: f0 e0 ldi r31, 0x00 ; 0 1b26: e1 70 andi r30, 0x01 ; 1 1b28: f0 70 andi r31, 0x00 ; 0 1b2a: e6 5e subi r30, 0xE6 ; 230 1b2c: fa 4f sbci r31, 0xFA ; 250 1b2e: 90 83 st Z, r25 TWI::Send(COFFEE_VACUUM,data,2); 1b30: 42 e0 ldi r20, 0x02 ; 2 1b32: be 01 movw r22, r28 1b34: 6f 5f subi r22, 0xFF ; 255 1b36: 7f 4f sbci r23, 0xFF ; 255 1b38: 86 e0 ldi r24, 0x06 ; 6 1b3a: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> } 1b3e: 0f 90 pop r0 1b40: 0f 90 pop r0 1b42: cf 91 pop r28 1b44: df 91 pop r29 1b46: 08 95 ret 00001b48 <_ZN6Coffee8RunMotorEPvS0_>: } uint8_t at[3] = {COFFEE_TIME_SINCE,((uint8_t*)(&minutes_since))[0],((uint8_t*)(&minutes_since))[1]}; Uart::Send(at,3); } void RunMotor(void* motor, void* direction){ 1b48: df 93 push r29 1b4a: cf 93 push r28 1b4c: 00 d0 rcall .+0 ; 0x1b4e <_ZN6Coffee8RunMotorEPvS0_+0x6> 1b4e: 00 d0 rcall .+0 ; 0x1b50 <_ZN6Coffee8RunMotorEPvS0_+0x8> 1b50: cd b7 in r28, 0x3d ; 61 1b52: de b7 in r29, 0x3e ; 62 1b54: fc 01 movw r30, r24 uint8_t data[4]; uint8_t addr = *((uint8_t*)motor); 1b56: e0 81 ld r30, Z Motor_Status* dir = (Motor_Status*)direction; 1b58: db 01 movw r26, r22 data[0] = (uint8_t)((*dir)==MOTOR_RUN1); 1b5a: 90 e0 ldi r25, 0x00 ; 0 1b5c: 8c 91 ld r24, X 1b5e: 83 30 cpi r24, 0x03 ; 3 1b60: 09 f4 brne .+2 ; 0x1b64 <_ZN6Coffee8RunMotorEPvS0_+0x1c> 1b62: 91 e0 ldi r25, 0x01 ; 1 1b64: 99 83 std Y+1, r25 ; 0x01 data[0] |= (1<<((uint8_t)(((*dir)==MOTOR_RUN1)||((*dir)==MOTOR_RUN2))));//Set whetever the motor is running or not 1b66: 8c 91 ld r24, X 1b68: 83 50 subi r24, 0x03 ; 3 1b6a: 82 30 cpi r24, 0x02 ; 2 1b6c: 10 f0 brcs .+4 ; 0x1b72 <_ZN6Coffee8RunMotorEPvS0_+0x2a> 1b6e: 81 e0 ldi r24, 0x01 ; 1 1b70: 01 c0 rjmp .+2 ; 0x1b74 <_ZN6Coffee8RunMotorEPvS0_+0x2c> 1b72: 82 e0 ldi r24, 0x02 ; 2 1b74: 98 2b or r25, r24 1b76: 99 83 std Y+1, r25 ; 0x01 data[1] = 0; 1b78: 1a 82 std Y+2, r1 ; 0x02 data[2] = 30; 1b7a: 8e e1 ldi r24, 0x1E ; 30 1b7c: 8b 83 std Y+3, r24 ; 0x03 if(addr==0){ 1b7e: ee 23 and r30, r30 1b80: 59 f4 brne .+22 ; 0x1b98 <_ZN6Coffee8RunMotorEPvS0_+0x50> data[0] |= (1<<7); 1b82: 90 68 ori r25, 0x80 ; 128 1b84: 99 83 std Y+1, r25 ; 0x01 Coffee::motor_arm_status = (*dir); 1b86: 8c 91 ld r24, X 1b88: 80 93 11 05 sts 0x0511, r24 TWI::Send(COFFEE_MOTOR1,data,3); 1b8c: 43 e0 ldi r20, 0x03 ; 3 1b8e: be 01 movw r22, r28 1b90: 6f 5f subi r22, 0xFF ; 255 1b92: 7f 4f sbci r23, 0xFF ; 255 1b94: 83 e0 ldi r24, 0x03 ; 3 1b96: 40 c0 rjmp .+128 ; 0x1c18 <_ZN6Coffee8RunMotorEPvS0_+0xd0> } else if(addr==1){ 1b98: e1 30 cpi r30, 0x01 ; 1 1b9a: 59 f4 brne .+22 ; 0x1bb2 <_ZN6Coffee8RunMotorEPvS0_+0x6a> data[0] |= (1<<7); 1b9c: 90 68 ori r25, 0x80 ; 128 1b9e: 99 83 std Y+1, r25 ; 0x01 Coffee::motor_filter_status = (*dir); 1ba0: 8c 91 ld r24, X 1ba2: 80 93 10 05 sts 0x0510, r24 TWI::Send(COFFEE_MOTOR2,data,3); 1ba6: 43 e0 ldi r20, 0x03 ; 3 1ba8: be 01 movw r22, r28 1baa: 6f 5f subi r22, 0xFF ; 255 1bac: 7f 4f sbci r23, 0xFF ; 255 1bae: 84 e0 ldi r24, 0x04 ; 4 1bb0: 33 c0 rjmp .+102 ; 0x1c18 <_ZN6Coffee8RunMotorEPvS0_+0xd0> } else if((addr==2)||(addr==3)){ 1bb2: 8e 2f mov r24, r30 1bb4: 82 50 subi r24, 0x02 ; 2 1bb6: 82 30 cpi r24, 0x02 ; 2 1bb8: 78 f4 brcc .+30 ; 0x1bd8 <_ZN6Coffee8RunMotorEPvS0_+0x90> if(addr==3) 1bba: e3 30 cpi r30, 0x03 ; 3 1bbc: 11 f4 brne .+4 ; 0x1bc2 <_ZN6Coffee8RunMotorEPvS0_+0x7a> data[0] |= (1<<7); 1bbe: 90 68 ori r25, 0x80 ; 128 1bc0: 99 83 std Y+1, r25 ; 0x01 Coffee::motors[addr-2] = (*dir); 1bc2: f0 e0 ldi r31, 0x00 ; 0 1bc4: e0 5f subi r30, 0xF0 ; 240 1bc6: fa 4f sbci r31, 0xFA ; 250 1bc8: 8c 91 ld r24, X 1bca: 80 83 st Z, r24 TWI::Send(COFFEE_MOTOR3,data,3); 1bcc: 43 e0 ldi r20, 0x03 ; 3 1bce: be 01 movw r22, r28 1bd0: 6f 5f subi r22, 0xFF ; 255 1bd2: 7f 4f sbci r23, 0xFF ; 255 1bd4: 89 e0 ldi r24, 0x09 ; 9 1bd6: 20 c0 rjmp .+64 ; 0x1c18 <_ZN6Coffee8RunMotorEPvS0_+0xd0> } else if((addr==4)||(addr==5)){ 1bd8: 8e 2f mov r24, r30 1bda: 84 50 subi r24, 0x04 ; 4 1bdc: 82 30 cpi r24, 0x02 ; 2 1bde: 78 f4 brcc .+30 ; 0x1bfe <_ZN6Coffee8RunMotorEPvS0_+0xb6> if(addr==5) 1be0: e5 30 cpi r30, 0x05 ; 5 1be2: 11 f4 brne .+4 ; 0x1be8 <_ZN6Coffee8RunMotorEPvS0_+0xa0> data[0] |= (1<<7); 1be4: 90 68 ori r25, 0x80 ; 128 1be6: 99 83 std Y+1, r25 ; 0x01 Coffee::motors[addr-2] = (*dir); 1be8: f0 e0 ldi r31, 0x00 ; 0 1bea: e0 5f subi r30, 0xF0 ; 240 1bec: fa 4f sbci r31, 0xFA ; 250 1bee: 8c 91 ld r24, X 1bf0: 80 83 st Z, r24 TWI::Send(COFFEE_MOTOR4,data,3); 1bf2: 43 e0 ldi r20, 0x03 ; 3 1bf4: be 01 movw r22, r28 1bf6: 6f 5f subi r22, 0xFF ; 255 1bf8: 7f 4f sbci r23, 0xFF ; 255 1bfa: 8a e0 ldi r24, 0x0A ; 10 1bfc: 0d c0 rjmp .+26 ; 0x1c18 <_ZN6Coffee8RunMotorEPvS0_+0xd0> } else if(addr==6){ 1bfe: e6 30 cpi r30, 0x06 ; 6 1c00: 69 f4 brne .+26 ; 0x1c1c <_ZN6Coffee8RunMotorEPvS0_+0xd4> data[0] = COFFEE_GARBAGE; 1c02: 8f e0 ldi r24, 0x0F ; 15 1c04: 89 83 std Y+1, r24 ; 0x01 data[1] = (*dir); 1c06: 8c 91 ld r24, X 1c08: 8a 83 std Y+2, r24 ; 0x02 Coffee::garbage_arm = (Motor_Status)data[1]; 1c0a: 80 93 22 05 sts 0x0522, r24 TWI::Send(COFFEE_GARBAGE,data,2); 1c0e: 42 e0 ldi r20, 0x02 ; 2 1c10: be 01 movw r22, r28 1c12: 6f 5f subi r22, 0xFF ; 255 1c14: 7f 4f sbci r23, 0xFF ; 255 1c16: 8f e0 ldi r24, 0x0F ; 15 1c18: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> } } 1c1c: 0f 90 pop r0 1c1e: 0f 90 pop r0 1c20: 0f 90 pop r0 1c22: 0f 90 pop r0 1c24: cf 91 pop r28 1c26: df 91 pop r29 1c28: 08 95 ret 00001c2a <_ZN6Coffee8WaterRunEPvS0_>: //Usage like: //WaterRun((void*)1,(void*)COFFEE_WATER1) for on //and //WaterRun(0,(void*)COFFEE_WATER1) for off void WaterRun(void* onoff, void* addr){ 1c2a: cf 92 push r12 1c2c: df 92 push r13 1c2e: ef 92 push r14 1c30: 0f 93 push r16 1c32: 1f 93 push r17 1c34: df 93 push r29 1c36: cf 93 push r28 1c38: 00 d0 rcall .+0 ; 0x1c3a <_ZN6Coffee8WaterRunEPvS0_+0x10> 1c3a: cd b7 in r28, 0x3d ; 61 1c3c: de b7 in r29, 0x3e ; 62 1c3e: 6c 01 movw r12, r24 1c40: 8b 01 movw r16, r22 uint8_t cmd[2]; cmd[0] = 1; 1c42: 81 e0 ldi r24, 0x01 ; 1 1c44: 89 83 std Y+1, r24 ; 0x01 if(((uint16_t)onoff)==1){//On 1c46: 91 e0 ldi r25, 0x01 ; 1 1c48: c9 16 cp r12, r25 1c4a: d1 04 cpc r13, r1 1c4c: 11 f4 brne .+4 ; 0x1c52 <_ZN6Coffee8WaterRunEPvS0_+0x28> //if((((uint16_t)addr)==COFFEE_WATER1)) // TaskManager::AddTask(Coffee::WaterRun,0,(void*)COFFEE_WATER1,TaskManager::SINGLE_RUN,MAX_WATER_RUN_TIME,TaskManager::HIGH);//Force it off after a timeout cmd[1] = 1; 1c4e: 8a 83 std Y+2, r24 ; 0x02 1c50: 08 c0 rjmp .+16 ; 0x1c62 <_ZN6Coffee8WaterRunEPvS0_+0x38> TWI::Send((uint8_t)((uint16_t)addr),cmd,2); } else{//Off if((((uint16_t)addr)==COFFEE_WATER1))//Delete task (doesn't matter if its not there... 1c52: 6d 30 cpi r22, 0x0D ; 13 1c54: 71 05 cpc r23, r1 1c56: 21 f4 brne .+8 ; 0x1c60 <_ZN6Coffee8WaterRunEPvS0_+0x36> TaskManager::DeleteTask(WaterRun); 1c58: 85 e1 ldi r24, 0x15 ; 21 1c5a: 9e e0 ldi r25, 0x0E ; 14 1c5c: 0e 94 51 09 call 0x12a2 ; 0x12a2 <_ZN11TaskManager10DeleteTaskEPFvPvS0_E> cmd[1] = 0; 1c60: 1a 82 std Y+2, r1 ; 0x02 TWI::Send((uint8_t)((uint16_t)addr),cmd,2); 1c62: 42 e0 ldi r20, 0x02 ; 2 1c64: be 01 movw r22, r28 1c66: 6f 5f subi r22, 0xFF ; 255 1c68: 7f 4f sbci r23, 0xFF ; 255 1c6a: 80 2f mov r24, r16 1c6c: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> } if(((uint16_t)addr)==COFFEE_WATER1)//Enable the other card as well 1c70: 0d 30 cpi r16, 0x0D ; 13 1c72: 11 05 cpc r17, r1 1c74: 61 f4 brne .+24 ; 0x1c8e <_ZN6Coffee8WaterRunEPvS0_+0x64> TaskManager::AddTask(Coffee::WaterRun,onoff,(void*)COFFEE_WATER2,TaskManager::SINGLE_RUN,100,TaskManager::MEDIUM);//Twi respond time 1c76: 32 e3 ldi r19, 0x32 ; 50 1c78: e3 2e mov r14, r19 1c7a: 04 e6 ldi r16, 0x64 ; 100 1c7c: 10 e0 ldi r17, 0x00 ; 0 1c7e: 20 e0 ldi r18, 0x00 ; 0 1c80: 4e e0 ldi r20, 0x0E ; 14 1c82: 50 e0 ldi r21, 0x00 ; 0 1c84: b6 01 movw r22, r12 1c86: 85 e1 ldi r24, 0x15 ; 21 1c88: 9e e0 ldi r25, 0x0E ; 14 1c8a: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> } 1c8e: 0f 90 pop r0 1c90: 0f 90 pop r0 1c92: cf 91 pop r28 1c94: df 91 pop r29 1c96: 1f 91 pop r17 1c98: 0f 91 pop r16 1c9a: ef 90 pop r14 1c9c: df 90 pop r13 1c9e: cf 90 pop r12 1ca0: 08 95 ret 00001ca2 <_ZN6Coffee13PostponeResetEPvS0_>: TWI::Send(COFFEE_MOTOR1,data,2); else if(servo_num<4) TWI::Send(COFFEE_MOTOR2,data,2); } void PostponeReset(void* u1, void* u2){ 1ca2: ef 92 push r14 1ca4: 0f 93 push r16 1ca6: 1f 93 push r17 1ca8: df 93 push r29 1caa: cf 93 push r28 1cac: 0f 92 push r0 1cae: cd b7 in r28, 0x3d ; 61 1cb0: de b7 in r29, 0x3e ; 62 uint8_t cmd = POSTPONE_RESET; 1cb2: 81 e3 ldi r24, 0x31 ; 49 1cb4: 89 83 std Y+1, r24 ; 0x01 if(TWI::Send(COFFEE_RESET,&cmd,1)!=0)//If not correctly sent 1cb6: 41 e0 ldi r20, 0x01 ; 1 1cb8: be 01 movw r22, r28 1cba: 6f 5f subi r22, 0xFF ; 255 1cbc: 7f 4f sbci r23, 0xFF ; 255 1cbe: 87 e0 ldi r24, 0x07 ; 7 1cc0: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> 1cc4: 88 23 and r24, r24 1cc6: 61 f0 breq .+24 ; 0x1ce0 <_ZN6Coffee13PostponeResetEPvS0_+0x3e> TaskManager::AddTask(Coffee::PostponeReset,0,0,TaskManager::SINGLE_RUN,500,TaskManager::HIGH);//Force it to try 500ms later 1cc8: ee 24 eor r14, r14 1cca: 04 ef ldi r16, 0xF4 ; 244 1ccc: 11 e0 ldi r17, 0x01 ; 1 1cce: 20 e0 ldi r18, 0x00 ; 0 1cd0: 40 e0 ldi r20, 0x00 ; 0 1cd2: 50 e0 ldi r21, 0x00 ; 0 1cd4: 60 e0 ldi r22, 0x00 ; 0 1cd6: 70 e0 ldi r23, 0x00 ; 0 1cd8: 81 e5 ldi r24, 0x51 ; 81 1cda: 9e e0 ldi r25, 0x0E ; 14 1cdc: 0e 94 0c 07 call 0xe18 ; 0xe18 <_ZN11TaskManager7AddTaskEPFvPvS0_ES0_S0_NS_9TASK_TYPEEjNS_8PRIORITYE> } 1ce0: 0f 90 pop r0 1ce2: cf 91 pop r28 1ce4: df 91 pop r29 1ce6: 1f 91 pop r17 1ce8: 0f 91 pop r16 1cea: ef 90 pop r14 1cec: 08 95 ret 00001cee <_ZN6Coffee16UpdateCoffeeTimeEPvS0_>: void ResetWEB(void* unused1, void* unused2){ uint8_t cmd = 0x34; Uart::Send(&cmd,1); } void UpdateCoffeeTime(void* u1, void* u2){ 1cee: df 93 push r29 1cf0: cf 93 push r28 1cf2: 00 d0 rcall .+0 ; 0x1cf4 <_ZN6Coffee16UpdateCoffeeTimeEPvS0_+0x6> 1cf4: 00 d0 rcall .+0 ; 0x1cf6 <_ZN6Coffee16UpdateCoffeeTimeEPvS0_+0x8> 1cf6: 0f 92 push r0 1cf8: cd b7 in r28, 0x3d ; 61 1cfa: de b7 in r29, 0x3e ; 62 uint32_t tmp; uint16_t minutes_since; if(power_stat.end_time!=0){ 1cfc: 20 91 0c 05 lds r18, 0x050C 1d00: 30 91 0d 05 lds r19, 0x050D 1d04: 40 91 0e 05 lds r20, 0x050E 1d08: 50 91 0f 05 lds r21, 0x050F 1d0c: 21 15 cp r18, r1 1d0e: 31 05 cpc r19, r1 1d10: 41 05 cpc r20, r1 1d12: 51 05 cpc r21, r1 1d14: b9 f0 breq .+46 ; 0x1d44 <_ZN6Coffee16UpdateCoffeeTimeEPvS0_+0x56> cli(); 1d16: f8 94 cli tmp = Clock::ticks - power_stat.end_time; 1d18: 60 91 23 05 lds r22, 0x0523 1d1c: 70 91 24 05 lds r23, 0x0524 1d20: 80 91 25 05 lds r24, 0x0525 1d24: 90 91 26 05 lds r25, 0x0526 1d28: 62 1b sub r22, r18 1d2a: 73 0b sbc r23, r19 1d2c: 84 0b sbc r24, r20 1d2e: 95 0b sbc r25, r21 sei(); 1d30: 78 94 sei tmp /= 60000; minutes_since = (uint16_t)tmp; 1d32: 20 e6 ldi r18, 0x60 ; 96 1d34: 3a ee ldi r19, 0xEA ; 234 1d36: 40 e0 ldi r20, 0x00 ; 0 1d38: 50 e0 ldi r21, 0x00 ; 0 1d3a: 0e 94 5d 12 call 0x24ba ; 0x24ba <__udivmodsi4> 1d3e: 3a 83 std Y+2, r19 ; 0x02 1d40: 29 83 std Y+1, r18 ; 0x01 1d42: 04 c0 rjmp .+8 ; 0x1d4c <_ZN6Coffee16UpdateCoffeeTimeEPvS0_+0x5e> } else{ minutes_since = 0xffff; 1d44: 8f ef ldi r24, 0xFF ; 255 1d46: 9f ef ldi r25, 0xFF ; 255 1d48: 9a 83 std Y+2, r25 ; 0x02 1d4a: 89 83 std Y+1, r24 ; 0x01 } uint8_t at[3] = {COFFEE_TIME_SINCE,((uint8_t*)(&minutes_since))[0],((uint8_t*)(&minutes_since))[1]}; 1d4c: fe 01 movw r30, r28 1d4e: 33 96 adiw r30, 0x03 ; 3 1d50: 83 e0 ldi r24, 0x03 ; 3 1d52: df 01 movw r26, r30 1d54: 1d 92 st X+, r1 1d56: 8a 95 dec r24 1d58: e9 f7 brne .-6 ; 0x1d54 <_ZN6Coffee16UpdateCoffeeTimeEPvS0_+0x66> 1d5a: 85 e1 ldi r24, 0x15 ; 21 1d5c: 8b 83 std Y+3, r24 ; 0x03 1d5e: 89 81 ldd r24, Y+1 ; 0x01 1d60: 8c 83 std Y+4, r24 ; 0x04 1d62: 8a 81 ldd r24, Y+2 ; 0x02 1d64: 8d 83 std Y+5, r24 ; 0x05 Uart::Send(at,3); 1d66: 63 e0 ldi r22, 0x03 ; 3 1d68: 70 e0 ldi r23, 0x00 ; 0 1d6a: cf 01 movw r24, r30 1d6c: 0e 94 b4 03 call 0x768 ; 0x768 <_ZN4Uart4SendEPhj> } 1d70: 0f 90 pop r0 1d72: 0f 90 pop r0 1d74: 0f 90 pop r0 1d76: 0f 90 pop r0 1d78: 0f 90 pop r0 1d7a: cf 91 pop r28 1d7c: df 91 pop r29 1d7e: 08 95 ret 00001d80 <_ZN6Coffee8ResetWEBEPvS0_>: uint16_t vacuum_current[2] = {0,0}; uint16_t garbage_arm_period = 0; Motor_Status garbage_arm = MOTOR_STOP; void ResetWEB(void* unused1, void* unused2){ 1d80: df 93 push r29 1d82: cf 93 push r28 1d84: 0f 92 push r0 1d86: cd b7 in r28, 0x3d ; 61 1d88: de b7 in r29, 0x3e ; 62 uint8_t cmd = 0x34; 1d8a: 84 e3 ldi r24, 0x34 ; 52 1d8c: 89 83 std Y+1, r24 ; 0x01 Uart::Send(&cmd,1); 1d8e: 61 e0 ldi r22, 0x01 ; 1 1d90: 70 e0 ldi r23, 0x00 ; 0 1d92: ce 01 movw r24, r28 1d94: 01 96 adiw r24, 0x01 ; 1 1d96: 0e 94 b4 03 call 0x768 ; 0x768 <_ZN4Uart4SendEPhj> } 1d9a: 0f 90 pop r0 1d9c: cf 91 pop r28 1d9e: df 91 pop r29 1da0: 08 95 ret 00001da2 <_ZN5Clock4InitEv>: /* Number of ticks since the device restarted */ volatile uint32_t ticks = 0; /* Initialise our main-clock */ void Init(void){ //Clear on compare match, top=OCR1, prescaler at 1/64 TCCR2 = (1<: /* The main clocks interrupt. Basicly, just increment the number of ticks one tick= 1ms */ ISR(TIMER2_COMP_vect){ 1db0: 1f 92 push r1 1db2: 0f 92 push r0 1db4: 0f b6 in r0, 0x3f ; 63 1db6: 0f 92 push r0 1db8: 11 24 eor r1, r1 1dba: 8f 93 push r24 1dbc: 9f 93 push r25 1dbe: af 93 push r26 1dc0: bf 93 push r27 Clock::ticks++; 1dc2: 80 91 23 05 lds r24, 0x0523 1dc6: 90 91 24 05 lds r25, 0x0524 1dca: a0 91 25 05 lds r26, 0x0525 1dce: b0 91 26 05 lds r27, 0x0526 1dd2: 01 96 adiw r24, 0x01 ; 1 1dd4: a1 1d adc r26, r1 1dd6: b1 1d adc r27, r1 1dd8: 80 93 23 05 sts 0x0523, r24 1ddc: 90 93 24 05 sts 0x0524, r25 1de0: a0 93 25 05 sts 0x0525, r26 1de4: b0 93 26 05 sts 0x0526, r27 } 1de8: bf 91 pop r27 1dea: af 91 pop r26 1dec: 9f 91 pop r25 1dee: 8f 91 pop r24 1df0: 0f 90 pop r0 1df2: 0f be out 0x3f, r0 ; 63 1df4: 0f 90 pop r0 1df6: 1f 90 pop r1 1df8: 18 95 reti 00001dfa <_ZN11CoffeeLogic10MakeCoffeeEPvS0_>: uint8_t sec_muls = 0; //TaskManager::Task next_task; void MakeCoffee(void* u1, void* u2){ 1dfa: 1f 93 push r17 1dfc: df 93 push r29 1dfe: cf 93 push r28 1e00: cd b7 in r28, 0x3d ; 61 1e02: de b7 in r29, 0x3e ; 62 1e04: 28 97 sbiw r28, 0x08 ; 8 1e06: 0f b6 in r0, 0x3f ; 63 1e08: f8 94 cli 1e0a: de bf out 0x3e, r29 ; 62 1e0c: 0f be out 0x3f, r0 ; 63 1e0e: cd bf out 0x3d, r28 ; 61 uint8_t motor = 1; 1e10: 21 e0 ldi r18, 0x01 ; 1 1e12: 29 83 std Y+1, r18 ; 0x01 Coffee::Motor_Status temp = Coffee::MOTOR_RUN2; 1e14: 84 e0 ldi r24, 0x04 ; 4 1e16: 8a 83 std Y+2, r24 ; 0x02 uint8_t servo = 1; 1e18: 2b 83 std Y+3, r18 ; 0x03 uint16_t pos = SERVO1_CLEAR; 1e1a: 88 e9 ldi r24, 0x98 ; 152 1e1c: 98 e0 ldi r25, 0x08 ; 8 1e1e: 98 87 std Y+8, r25 ; 0x08 1e20: 8f 83 std Y+7, r24 ; 0x07 uint8_t channel = 1; 1e22: 2c 83 std Y+4, r18 ; 0x04 uint8_t duty = VACUUM_PICKUP_VAL; 1e24: 82 e3 ldi r24, 0x32 ; 50 1e26: 8d 83 std Y+5, r24 ; 0x05 uint8_t cmd = CURRENT_START; 1e28: 8f e0 ldi r24, 0x0F ; 15 1e2a: 8e 83 std Y+6, r24 ; 0x06 switch(current_stat){ 1e2c: 80 91 27 05 lds r24, 0x0527 1e30: e8 2f mov r30, r24 1e32: f0 e0 ldi r31, 0x00 ; 0 1e34: ea 31 cpi r30, 0x1A ; 26 1e36: f1 05 cpc r31, r1 1e38: 08 f0 brcs .+2 ; 0x1e3c <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x42> 1e3a: ae c1 rjmp .+860 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> 1e3c: ea 5b subi r30, 0xBA ; 186 1e3e: ff 4f sbci r31, 0xFF ; 255 1e40: ee 0f add r30, r30 1e42: ff 1f adc r31, r31 1e44: 05 90 lpm r0, Z+ 1e46: f4 91 lpm r31, Z 1e48: e0 2d mov r30, r0 1e4a: 09 94 ijmp case COFFEE_IDLE: motor = 1; 1e4c: 11 e0 ldi r17, 0x01 ; 1 1e4e: 19 83 std Y+1, r17 ; 0x01 temp =Coffee::MOTOR_RUN2; 1e50: 84 e0 ldi r24, 0x04 ; 4 1e52: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1e54: be 01 movw r22, r28 1e56: 6e 5f subi r22, 0xFE ; 254 1e58: 7f 4f sbci r23, 0xFF ; 255 1e5a: ce 01 movw r24, r28 1e5c: 01 96 adiw r24, 0x01 ; 1 1e5e: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_MOTOR1RUN2; 1e62: 10 93 27 05 sts 0x0527, r17 1e66: 98 c1 rjmp .+816 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> break; case COFFEE_MOTOR1RUN2: servo = 1; 1e68: 81 e0 ldi r24, 0x01 ; 1 1e6a: 8b 83 std Y+3, r24 ; 0x03 pos = SERVO1_CLEAR; if(Coffee::motor_filter_status==Coffee::MOTOR_END1){//Check if it has reached the end 1e6c: 80 91 10 05 lds r24, 0x0510 1e70: 82 30 cpi r24, 0x02 ; 2 1e72: 09 f0 breq .+2 ; 0x1e76 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x7c> 1e74: 91 c1 rjmp .+802 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> Coffee::RunMotor((void*)&motor,(void*)&temp); current_stat = COFFEE_MOTOR1RUN2; break; case COFFEE_MOTOR1RUN2: servo = 1; pos = SERVO1_CLEAR; 1e76: 88 e9 ldi r24, 0x98 ; 152 1e78: 98 e0 ldi r25, 0x08 ; 8 1e7a: 98 87 std Y+8, r25 ; 0x08 1e7c: 8f 83 std Y+7, r24 ; 0x07 if(Coffee::motor_filter_status==Coffee::MOTOR_END1){//Check if it has reached the end Coffee::SetServo((void*)&servo,(void*)&pos); 1e7e: be 01 movw r22, r28 1e80: 69 5f subi r22, 0xF9 ; 249 1e82: 7f 4f sbci r23, 0xFF ; 255 1e84: ce 01 movw r24, r28 1e86: 03 96 adiw r24, 0x03 ; 3 1e88: 0e 94 54 0d call 0x1aa8 ; 0x1aa8 <_ZN6Coffee8SetServoEPvS0_> current_stat = COFFEE_BEANS; 1e8c: 8c e0 ldi r24, 0x0C ; 12 1e8e: 7c c1 rjmp .+760 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation } break; case COFFEE_BEANS: motor = 5; 1e90: 85 e0 ldi r24, 0x05 ; 5 1e92: 89 83 std Y+1, r24 ; 0x01 temp =Coffee::MOTOR_RUN1; 1e94: 83 e0 ldi r24, 0x03 ; 3 1e96: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1e98: be 01 movw r22, r28 1e9a: 6e 5f subi r22, 0xFE ; 254 1e9c: 7f 4f sbci r23, 0xFF ; 255 1e9e: ce 01 movw r24, r28 1ea0: 01 96 adiw r24, 0x01 ; 1 1ea2: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_SERVO1_SET_AWAY1; 1ea6: 82 e0 ldi r24, 0x02 ; 2 1ea8: 6f c1 rjmp .+734 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_SERVO1_SET_AWAY1: servo = 3; 1eaa: 13 e0 ldi r17, 0x03 ; 3 1eac: 1b 83 std Y+3, r17 ; 0x03 pos = SERVO3_FILTER_GET; 1eae: 88 e5 ldi r24, 0x58 ; 88 1eb0: 92 e0 ldi r25, 0x02 ; 2 1eb2: 98 87 std Y+8, r25 ; 0x08 1eb4: 8f 83 std Y+7, r24 ; 0x07 Coffee::SetServo((void*)&servo,(void*)&pos); 1eb6: be 01 movw r22, r28 1eb8: 69 5f subi r22, 0xF9 ; 249 1eba: 7f 4f sbci r23, 0xFF ; 255 1ebc: ce 01 movw r24, r28 1ebe: 03 96 adiw r24, 0x03 ; 3 1ec0: 0e 94 54 0d call 0x1aa8 ; 0x1aa8 <_ZN6Coffee8SetServoEPvS0_> current_stat = COFFEE_SERVO3_SET_DOWN1; 1ec4: 10 93 27 05 sts 0x0527, r17 1ec8: 61 c1 rjmp .+706 ; 0x218c <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x392> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_SERVO3_SET_DOWN1: motor = 0; 1eca: 19 82 std Y+1, r1 ; 0x01 temp = Coffee::MOTOR_RUN1; 1ecc: 83 e0 ldi r24, 0x03 ; 3 1ece: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1ed0: be 01 movw r22, r28 1ed2: 6e 5f subi r22, 0xFE ; 254 1ed4: 7f 4f sbci r23, 0xFF ; 255 1ed6: ce 01 movw r24, r28 1ed8: 01 96 adiw r24, 0x01 ; 1 1eda: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> 1ede: 1e c0 rjmp .+60 ; 0x1f1c <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x122> //Coffee::garbage_arm = Coffee::MOTOR_END1; current_stat = COFFEE_MOTOR0RUN1; //TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_MOTOR0RUN1://Arm throw out if(Coffee::motor_arm_status==Coffee::MOTOR_END2){//Check that is has reached the end 1ee0: 80 91 11 05 lds r24, 0x0511 1ee4: 81 30 cpi r24, 0x01 ; 1 1ee6: 09 f0 breq .+2 ; 0x1eea <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0xf0> 1ee8: 57 c1 rjmp .+686 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> motor = 6; 1eea: 86 e0 ldi r24, 0x06 ; 6 1eec: 89 83 std Y+1, r24 ; 0x01 temp = Coffee::MOTOR_RUN2; 1eee: 84 e0 ldi r24, 0x04 ; 4 1ef0: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1ef2: be 01 movw r22, r28 1ef4: 6e 5f subi r22, 0xFE ; 254 1ef6: 7f 4f sbci r23, 0xFF ; 255 1ef8: ce 01 movw r24, r28 1efa: 01 96 adiw r24, 0x01 ; 1 1efc: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_ARM_OUT; 1f00: 85 e0 ldi r24, 0x05 ; 5 1f02: 80 93 27 05 sts 0x0527, r24 1f06: 2a c0 rjmp .+84 ; 0x1f5c <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x162> TaskManager::PostponeMultiTask(MakeCoffee,ARM_TIMEOUT);//Wait 100ms before next operation } break; case COFFEE_ARM_OUT: if(Coffee::garbage_arm==Coffee::MOTOR_END2){ 1f08: 80 91 22 05 lds r24, 0x0522 1f0c: 81 30 cpi r24, 0x01 ; 1 1f0e: c9 f0 breq .+50 ; 0x1f42 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x148> Coffee::RunMotor((void*)&motor,(void*)&temp); current_stat = COFFEE_ARM_IN; TaskManager::PostponeMultiTask(MakeCoffee,ARM_TIMEOUT);//Wait 100ms before next operation } else{//########################################New else-clause TaskManager::PostponeMultiTask(MakeCoffee,ARM_TIMEOUT);//Wait 100ms before next operation 1f10: 60 e1 ldi r22, 0x10 ; 16 1f12: 77 e2 ldi r23, 0x27 ; 39 1f14: 8d ef ldi r24, 0xFD ; 253 1f16: 9e e0 ldi r25, 0x0E ; 14 1f18: 0e 94 13 09 call 0x1226 ; 0x1226 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej> current_stat = COFFEE_MOTOR0RUN1;//Go back and try again 1f1c: 84 e0 ldi r24, 0x04 ; 4 1f1e: 3e c0 rjmp .+124 ; 0x1f9c <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x1a2> } break; case COFFEE_ARM_IN: if(Coffee::garbage_arm==Coffee::MOTOR_END1){ 1f20: 80 91 22 05 lds r24, 0x0522 1f24: 82 30 cpi r24, 0x02 ; 2 1f26: 69 f4 brne .+26 ; 0x1f42 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x148> channel = 1; 1f28: 81 e0 ldi r24, 0x01 ; 1 1f2a: 8c 83 std Y+4, r24 ; 0x04 duty = VACUUM_PICKUP_VAL; 1f2c: 82 e3 ldi r24, 0x32 ; 50 1f2e: 8d 83 std Y+5, r24 ; 0x05 Coffee::SetVacuum((void*)&channel,(void*)&duty); 1f30: be 01 movw r22, r28 1f32: 6b 5f subi r22, 0xFB ; 251 1f34: 7f 4f sbci r23, 0xFF ; 255 1f36: ce 01 movw r24, r28 1f38: 04 96 adiw r24, 0x04 ; 4 1f3a: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> current_stat = COFFEE_VACUUM120; 1f3e: 87 e0 ldi r24, 0x07 ; 7 1f40: 23 c1 rjmp .+582 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation } else{//########################################New else-clause, try again if not completely down motor = 6; 1f42: 16 e0 ldi r17, 0x06 ; 6 1f44: 19 83 std Y+1, r17 ; 0x01 temp = Coffee::MOTOR_RUN1; 1f46: 83 e0 ldi r24, 0x03 ; 3 1f48: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1f4a: be 01 movw r22, r28 1f4c: 6e 5f subi r22, 0xFE ; 254 1f4e: 7f 4f sbci r23, 0xFF ; 255 1f50: ce 01 movw r24, r28 1f52: 01 96 adiw r24, 0x01 ; 1 1f54: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_ARM_IN; 1f58: 10 93 27 05 sts 0x0527, r17 TaskManager::PostponeMultiTask(MakeCoffee,ARM_TIMEOUT);//Wait 100ms before next operation 1f5c: 60 e1 ldi r22, 0x10 ; 16 1f5e: 77 e2 ldi r23, 0x27 ; 39 1f60: 17 c1 rjmp .+558 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> } break; case COFFEE_VACUUM120: cmd = CURRENT_START; 1f62: 8f e0 ldi r24, 0x0F ; 15 1f64: 8e 83 std Y+6, r24 ; 0x06 TWI::Send(COFFEE_CURRENT,&cmd,1); 1f66: 41 e0 ldi r20, 0x01 ; 1 1f68: be 01 movw r22, r28 1f6a: 6a 5f subi r22, 0xFA ; 250 1f6c: 7f 4f sbci r23, 0xFF ; 255 1f6e: 8c e0 ldi r24, 0x0C ; 12 1f70: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> current_stat = COFFEE_MOTOR1RUN1CURRENT; 1f74: 88 e0 ldi r24, 0x08 ; 8 1f76: 08 c1 rjmp .+528 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Force it to wait a certain period before going to next state break; case COFFEE_MOTOR1RUN1CURRENT: motor = 1; 1f78: 81 e0 ldi r24, 0x01 ; 1 1f7a: 89 83 std Y+1, r24 ; 0x01 temp = Coffee::MOTOR_RUN1; 1f7c: 83 e0 ldi r24, 0x03 ; 3 1f7e: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1f80: be 01 movw r22, r28 1f82: 6e 5f subi r22, 0xFE ; 254 1f84: 7f 4f sbci r23, 0xFF ; 255 1f86: ce 01 movw r24, r28 1f88: 01 96 adiw r24, 0x01 ; 1 1f8a: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_PICKUP; 1f8e: 89 e0 ldi r24, 0x09 ; 9 1f90: 59 c0 rjmp .+178 ; 0x2044 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x24a> TaskManager::PostponeMultiTask(MakeCoffee,CURRENT_UPDATE_INITIAL_WAIT);//Wait 100ms before next operation break; case COFFEE_PICKUP: if(Coffee::motor_filter_status==Coffee::MOTOR_END2){//Unable to go on 1f92: 80 91 10 05 lds r24, 0x0510 1f96: 81 30 cpi r24, 0x01 ; 1 1f98: 21 f4 brne .+8 ; 0x1fa2 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x1a8> current_stat = COFFEE_ERR_FILTER_EMPTY; 1f9a: 8b e1 ldi r24, 0x1B ; 27 1f9c: 80 93 27 05 sts 0x0527, r24 1fa0: fb c0 rjmp .+502 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> } else if(Coffee::vacuum_current[1]<=VACUUM_PICKED_UP_CURRENT){//Proceed in the state-machine 1fa2: 80 91 1e 05 lds r24, 0x051E 1fa6: 90 91 1f 05 lds r25, 0x051F 1faa: 84 3c cpi r24, 0xC4 ; 196 1fac: 91 05 cpc r25, r1 1fae: 08 f0 brcs .+2 ; 0x1fb2 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x1b8> 1fb0: f3 c0 rjmp .+486 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> motor = 1; 1fb2: 81 e0 ldi r24, 0x01 ; 1 1fb4: 89 83 std Y+1, r24 ; 0x01 temp =Coffee::MOTOR_RUN2; 1fb6: 84 e0 ldi r24, 0x04 ; 4 1fb8: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1fba: be 01 movw r22, r28 1fbc: 6e 5f subi r22, 0xFE ; 254 1fbe: 7f 4f sbci r23, 0xFF ; 255 1fc0: ce 01 movw r24, r28 1fc2: 01 96 adiw r24, 0x01 ; 1 1fc4: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_MOTOR1RUN2D; 1fc8: 8a e0 ldi r24, 0x0A ; 10 1fca: 3c c0 rjmp .+120 ; 0x2044 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x24a> TaskManager::PostponeMultiTask(MakeCoffee,FILTER_GET_DOWN_VAL);//Wait 100ms before next operation } break; case COFFEE_MOTOR1RUN2D: channel = 1; 1fcc: 81 e0 ldi r24, 0x01 ; 1 1fce: 8c 83 std Y+4, r24 ; 0x04 duty = 50;//VACUUM_FULL_VAL; 1fd0: 82 e3 ldi r24, 0x32 ; 50 1fd2: 8d 83 std Y+5, r24 ; 0x05 Coffee::SetVacuum((void*)&channel,(void*)&duty); 1fd4: be 01 movw r22, r28 1fd6: 6b 5f subi r22, 0xFB ; 251 1fd8: 7f 4f sbci r23, 0xFF ; 255 1fda: ce 01 movw r24, r28 1fdc: 04 96 adiw r24, 0x04 ; 4 1fde: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> current_stat = COFFEE_VACUUM1FULL; 1fe2: 8d e0 ldi r24, 0x0D ; 13 1fe4: d1 c0 rjmp .+418 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_VACUUM1FULL: motor = 0; 1fe6: 19 82 std Y+1, r1 ; 0x01 temp = Coffee::MOTOR_RUN2; 1fe8: 84 e0 ldi r24, 0x04 ; 4 1fea: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 1fec: be 01 movw r22, r28 1fee: 6e 5f subi r22, 0xFE ; 254 1ff0: 7f 4f sbci r23, 0xFF ; 255 1ff2: ce 01 movw r24, r28 1ff4: 01 96 adiw r24, 0x01 ; 1 1ff6: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_MOTOR0RUN2; 1ffa: 8b e0 ldi r24, 0x0B ; 11 1ffc: 80 93 27 05 sts 0x0527, r24 TaskManager::PostponeMultiTask(MakeCoffee,SERVO_UPRIGHT_WAIT_TIME);//Wait 100ms before next operation 2000: 68 e8 ldi r22, 0x88 ; 136 2002: 73 e1 ldi r23, 0x13 ; 19 2004: c5 c0 rjmp .+394 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> break; case COFFEE_MOTOR0RUN2: servo = 3; 2006: 83 e0 ldi r24, 0x03 ; 3 2008: 8b 83 std Y+3, r24 ; 0x03 pos = SERVO3_FILTER_UPRIGHT; 200a: 8c ed ldi r24, 0xDC ; 220 200c: 95 e0 ldi r25, 0x05 ; 5 200e: 98 87 std Y+8, r25 ; 0x08 2010: 8f 83 std Y+7, r24 ; 0x07 Coffee::SetServo((void*)&servo,(void*)&pos); 2012: be 01 movw r22, r28 2014: 69 5f subi r22, 0xF9 ; 249 2016: 7f 4f sbci r23, 0xFF ; 255 2018: ce 01 movw r24, r28 201a: 03 96 adiw r24, 0x03 ; 3 201c: 0e 94 54 0d call 0x1aa8 ; 0x1aa8 <_ZN6Coffee8SetServoEPvS0_> current_stat = COFFEE_SERVO3SETUP; 2020: 8e e0 ldi r24, 0x0E ; 14 2022: b2 c0 rjmp .+356 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_SERVO3SETUP: channel = 0; duty = VACUUM_FULL_VAL; if(Coffee::motor_arm_status==Coffee::MOTOR_END1){ 2024: 80 91 11 05 lds r24, 0x0511 2028: 82 30 cpi r24, 0x02 ; 2 202a: 09 f0 breq .+2 ; 0x202e <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x234> 202c: b5 c0 rjmp .+362 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> current_stat = COFFEE_SERVO3SETUP; TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_SERVO3SETUP: channel = 0; duty = VACUUM_FULL_VAL; 202e: 84 e6 ldi r24, 0x64 ; 100 2030: 8d 83 std Y+5, r24 ; 0x05 Coffee::SetServo((void*)&servo,(void*)&pos); current_stat = COFFEE_SERVO3SETUP; TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_SERVO3SETUP: channel = 0; 2032: 1c 82 std Y+4, r1 ; 0x04 duty = VACUUM_FULL_VAL; if(Coffee::motor_arm_status==Coffee::MOTOR_END1){ Coffee::SetVacuum((void*)&channel,(void*)&duty); 2034: be 01 movw r22, r28 2036: 6b 5f subi r22, 0xFB ; 251 2038: 7f 4f sbci r23, 0xFF ; 255 203a: ce 01 movw r24, r28 203c: 04 96 adiw r24, 0x04 ; 4 203e: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> current_stat = COFFEE_VACUUM0FULL; 2042: 8f e0 ldi r24, 0x0F ; 15 2044: 80 93 27 05 sts 0x0527, r24 TaskManager::PostponeMultiTask(MakeCoffee,CURRENT_UPDATE_INITIAL_WAIT);//Wait 100ms before next operation 2048: 68 eb ldi r22, 0xB8 ; 184 204a: 7b e0 ldi r23, 0x0B ; 11 204c: a1 c0 rjmp .+322 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> } break; case COFFEE_VACUUM0FULL: if(Coffee::vacuum_current[0]<=VACUUM_FULL_PICK_UP){//Proceed in the state machine 204e: 80 91 1c 05 lds r24, 0x051C 2052: 90 91 1d 05 lds r25, 0x051D 2056: 8f 55 subi r24, 0x5F ; 95 2058: 91 40 sbci r25, 0x01 ; 1 205a: 08 f0 brcs .+2 ; 0x205e <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x264> 205c: 9d c0 rjmp .+314 ; 0x2198 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x39e> motor = 0; 205e: 19 82 std Y+1, r1 ; 0x01 temp = Coffee::MOTOR_RUN1; 2060: 83 e0 ldi r24, 0x03 ; 3 2062: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 2064: be 01 movw r22, r28 2066: 6e 5f subi r22, 0xFE ; 254 2068: 7f 4f sbci r23, 0xFF ; 255 206a: ce 01 movw r24, r28 206c: 01 96 adiw r24, 0x01 ; 1 206e: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_FILTER_OPEN; 2072: 80 e1 ldi r24, 0x10 ; 16 2074: 80 93 27 05 sts 0x0527, r24 TaskManager::PostponeMultiTask(MakeCoffee,FILTER_OPEN_TIME);//Wait 100ms before next operation 2078: 68 e9 ldi r22, 0x98 ; 152 207a: 7a e3 ldi r23, 0x3A ; 58 207c: 89 c0 rjmp .+274 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> //{//End //current_stat = COFFEE_ERR_FILTER_LOST; //} break; case COFFEE_FILTER_OPEN: motor = 0; 207e: 19 82 std Y+1, r1 ; 0x01 temp = Coffee::MOTOR_STOP; 2080: 1a 82 std Y+2, r1 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 2082: be 01 movw r22, r28 2084: 6e 5f subi r22, 0xFE ; 254 2086: 7f 4f sbci r23, 0xFF ; 255 2088: ce 01 movw r24, r28 208a: 01 96 adiw r24, 0x01 ; 1 208c: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_START_GRIND; 2090: 81 e1 ldi r24, 0x11 ; 17 2092: 7a c0 rjmp .+244 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_START_GRIND: motor = 4; 2094: 94 e0 ldi r25, 0x04 ; 4 2096: 99 83 std Y+1, r25 ; 0x01 if(sec_muls temp = Coffee::MOTOR_RUN2; 20ac: 9a 83 std Y+2, r25 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 20ae: c9 01 movw r24, r18 20b0: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_START_GRIND; 20b4: 81 e1 ldi r24, 0x11 ; 17 20b6: 80 93 27 05 sts 0x0527, r24 sec_muls++; 20ba: 80 91 28 05 lds r24, 0x0528 20be: 8f 5f subi r24, 0xFF ; 255 20c0: 80 93 28 05 sts 0x0528, r24 TaskManager::PostponeMultiTask(MakeCoffee,SEC_MULTIPLY*1000);//Wait a set multiple of seconds 20c4: 60 e3 ldi r22, 0x30 ; 48 20c6: 75 e7 ldi r23, 0x75 ; 117 20c8: 63 c0 rjmp .+198 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> } else{ sec_muls = 0; 20ca: 10 92 28 05 sts 0x0528, r1 temp = Coffee::MOTOR_STOP; 20ce: 1a 82 std Y+2, r1 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 20d0: c9 01 movw r24, r18 20d2: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_END_CURRENT; 20d6: 82 e1 ldi r24, 0x12 ; 18 20d8: 57 c0 rjmp .+174 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation } break; case COFFEE_END_CURRENT: cmd = CURRENT_STOP; 20da: 80 ef ldi r24, 0xF0 ; 240 20dc: 8e 83 std Y+6, r24 ; 0x06 TWI::Send(COFFEE_CURRENT,&cmd,1); 20de: 41 e0 ldi r20, 0x01 ; 1 20e0: be 01 movw r22, r28 20e2: 6a 5f subi r22, 0xFA ; 250 20e4: 7f 4f sbci r23, 0xFF ; 255 20e6: 8c e0 ldi r24, 0x0C ; 12 20e8: 0e 94 bc 06 call 0xd78 ; 0xd78 <_ZN3TWI4SendEhPhh> current_stat = COFFEE_DROP_VACUUM0; 20ec: 83 e1 ldi r24, 0x13 ; 19 20ee: 4c c0 rjmp .+152 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Force it to wait a certain period before going to next state break; case COFFEE_DROP_VACUUM0: channel = 0; 20f0: 1c 82 std Y+4, r1 ; 0x04 duty = 0; 20f2: 1d 82 std Y+5, r1 ; 0x05 Coffee::SetVacuum((void*)&channel,(void*)&duty); 20f4: be 01 movw r22, r28 20f6: 6b 5f subi r22, 0xFB ; 251 20f8: 7f 4f sbci r23, 0xFF ; 255 20fa: ce 01 movw r24, r28 20fc: 04 96 adiw r24, 0x04 ; 4 20fe: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> current_stat = COFFEE_DROP_VACUUM1; 2102: 84 e1 ldi r24, 0x14 ; 20 2104: 41 c0 rjmp .+130 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_DROP_VACUUM1: channel = 1; 2106: 81 e0 ldi r24, 0x01 ; 1 2108: 8c 83 std Y+4, r24 ; 0x04 duty = 0; 210a: 1d 82 std Y+5, r1 ; 0x05 Coffee::SetVacuum((void*)&channel,(void*)&duty); 210c: be 01 movw r22, r28 210e: 6b 5f subi r22, 0xFB ; 251 2110: 7f 4f sbci r23, 0xFF ; 255 2112: ce 01 movw r24, r28 2114: 04 96 adiw r24, 0x04 ; 4 2116: 0e 94 82 0d call 0x1b04 ; 0x1b04 <_ZN6Coffee9SetVacuumEPvS0_> current_stat = COFFEE_MOTOR0RUN12; 211a: 85 e1 ldi r24, 0x15 ; 21 211c: 35 c0 rjmp .+106 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_MOTOR0RUN12: motor = 1; 211e: 81 e0 ldi r24, 0x01 ; 1 2120: 89 83 std Y+1, r24 ; 0x01 temp =Coffee::MOTOR_RUN2; 2122: 84 e0 ldi r24, 0x04 ; 4 2124: 8a 83 std Y+2, r24 ; 0x02 Coffee::RunMotor((void*)&motor,(void*)&temp); 2126: be 01 movw r22, r28 2128: 6e 5f subi r22, 0xFE ; 254 212a: 7f 4f sbci r23, 0xFF ; 255 212c: ce 01 movw r24, r28 212e: 01 96 adiw r24, 0x01 ; 1 2130: 0e 94 a4 0d call 0x1b48 ; 0x1b48 <_ZN6Coffee8RunMotorEPvS0_> current_stat = COFFEE_WEIGHT_ON; 2134: 86 e1 ldi r24, 0x16 ; 22 2136: 28 c0 rjmp .+80 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_WEIGHT_ON://Turn on the periodically weight-updates //yet to be implemented current_stat = COFFEE_WATERFILL; 2138: 87 e1 ldi r24, 0x17 ; 23 213a: 26 c0 rjmp .+76 ; 0x2188 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x38e> TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation break; case COFFEE_WATERFILL: //Coffee::WaterRun((void*)p[2],(void*)COFFEE_WATER1);//on or off Coffee::WaterRun((void*)1,(void*)COFFEE_WATER1); 213c: 6d e0 ldi r22, 0x0D ; 13 213e: 70 e0 ldi r23, 0x00 ; 0 2140: 81 e0 ldi r24, 0x01 ; 1 2142: 90 e0 ldi r25, 0x00 ; 0 2144: 0e 94 15 0e call 0x1c2a ; 0x1c2a <_ZN6Coffee8WaterRunEPvS0_> current_stat = COFFEE_WATERDONE; 2148: 88 e1 ldi r24, 0x18 ; 24 214a: 80 93 27 05 sts 0x0527, r24 TaskManager::PostponeMultiTask(MakeCoffee,WATER_TIMEOUT);//Wait maximum timeout value 214e: 60 e2 ldi r22, 0x20 ; 32 2150: 7e e4 ldi r23, 0x4E ; 78 2152: 1e c0 rjmp .+60 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> break; case COFFEE_WATERDONE: Coffee::WaterRun((void*)0,(void*)COFFEE_WATER1); 2154: 6d e0 ldi r22, 0x0D ; 13 2156: 70 e0 ldi r23, 0x00 ; 0 2158: 80 e0 ldi r24, 0x00 ; 0 215a: 90 e0 ldi r25, 0x00 ; 0 215c: 0e 94 15 0e call 0x1c2a ; 0x1c2a <_ZN6Coffee8WaterRunEPvS0_> current_stat = COFFEE_SERVO1OVER; 2160: 89 e1 ldi r24, 0x19 ; 25 2162: 80 93 27 05 sts 0x0527, r24 TaskManager::PostponeMultiTask(MakeCoffee,TWO_SECONDS);//Wait a couple of seconds before moving on 2166: 60 ed ldi r22, 0xD0 ; 208 2168: 77 e0 ldi r23, 0x07 ; 7 216a: 12 c0 rjmp .+36 ; 0x2190 <_ZN11CoffeeLogic10MakeCoffeeEPvS0_+0x396> break; case COFFEE_SERVO1OVER: servo = 1; 216c: 81 e0 ldi r24, 0x01 ; 1 216e: 8b 83 std Y+3, r24 ; 0x03 pos = SERVO1_COOK; 2170: 8c ed ldi r24, 0xDC ; 220 2172: 95 e0 ldi r25, 0x05 ; 5 2174: 98 87 std Y+8, r25 ; 0x08 2176: 8f 83 std Y+7, r24 ; 0x07 Coffee::SetServo((void*)&servo,(void*)&pos); 2178: be 01 movw r22, r28 217a: 69 5f subi r22, 0xF9 ; 249 217c: 7f 4f sbci r23, 0xFF ; 255 217e: ce 01 movw r24, r28 2180: 03 96 adiw r24, 0x03 ; 3 2182: 0e 94 54 0d call 0x1aa8 ; 0x1aa8 <_ZN6Coffee8SetServoEPvS0_> current_stat = COFFEE_START_COOK; 2186: 8a e1 ldi r24, 0x1A ; 26 2188: 80 93 27 05 sts 0x0527, r24 TaskManager::PostponeMultiTask(MakeCoffee,TWI_WAIT_INTERVAL);//Wait 100ms before next operation 218c: 68 ec ldi r22, 0xC8 ; 200 218e: 70 e0 ldi r23, 0x00 ; 0 2190: 8d ef ldi r24, 0xFD ; 253 2192: 9e e0 ldi r25, 0x0E ; 14 2194: 0e 94 13 09 call 0x1226 ; 0x1226 <_ZN11TaskManager17PostponeMultiTaskEPFvPvS0_Ej> break; default: //Some kind of error has occured ; } } 2198: 28 96 adiw r28, 0x08 ; 8 219a: 0f b6 in r0, 0x3f ; 63 219c: f8 94 cli 219e: de bf out 0x3e, r29 ; 62 21a0: 0f be out 0x3f, r0 ; 63 21a2: cd bf out 0x3d, r28 ; 61 21a4: cf 91 pop r28 21a6: df 91 pop r29 21a8: 1f 91 pop r17 21aa: 08 95 ret 000021ac <__subsf3>: 21ac: 50 58 subi r21, 0x80 ; 128 000021ae <__addsf3>: 21ae: bb 27 eor r27, r27 21b0: aa 27 eor r26, r26 21b2: 0e d0 rcall .+28 ; 0x21d0 <__addsf3x> 21b4: e5 c0 rjmp .+458 ; 0x2380 <__fp_round> 21b6: d6 d0 rcall .+428 ; 0x2364 <__fp_pscA> 21b8: 30 f0 brcs .+12 ; 0x21c6 <__addsf3+0x18> 21ba: db d0 rcall .+438 ; 0x2372 <__fp_pscB> 21bc: 20 f0 brcs .+8 ; 0x21c6 <__addsf3+0x18> 21be: 31 f4 brne .+12 ; 0x21cc <__addsf3+0x1e> 21c0: 9f 3f cpi r25, 0xFF ; 255 21c2: 11 f4 brne .+4 ; 0x21c8 <__addsf3+0x1a> 21c4: 1e f4 brtc .+6 ; 0x21cc <__addsf3+0x1e> 21c6: cb c0 rjmp .+406 ; 0x235e <__fp_nan> 21c8: 0e f4 brtc .+2 ; 0x21cc <__addsf3+0x1e> 21ca: e0 95 com r30 21cc: e7 fb bst r30, 7 21ce: c1 c0 rjmp .+386 ; 0x2352 <__fp_inf> 000021d0 <__addsf3x>: 21d0: e9 2f mov r30, r25 21d2: e7 d0 rcall .+462 ; 0x23a2 <__fp_split3> 21d4: 80 f3 brcs .-32 ; 0x21b6 <__addsf3+0x8> 21d6: ba 17 cp r27, r26 21d8: 62 07 cpc r22, r18 21da: 73 07 cpc r23, r19 21dc: 84 07 cpc r24, r20 21de: 95 07 cpc r25, r21 21e0: 18 f0 brcs .+6 ; 0x21e8 <__addsf3x+0x18> 21e2: 71 f4 brne .+28 ; 0x2200 <__addsf3x+0x30> 21e4: 9e f5 brtc .+102 ; 0x224c <__addsf3x+0x7c> 21e6: ff c0 rjmp .+510 ; 0x23e6 <__fp_zero> 21e8: 0e f4 brtc .+2 ; 0x21ec <__addsf3x+0x1c> 21ea: e0 95 com r30 21ec: 0b 2e mov r0, r27 21ee: ba 2f mov r27, r26 21f0: a0 2d mov r26, r0 21f2: 0b 01 movw r0, r22 21f4: b9 01 movw r22, r18 21f6: 90 01 movw r18, r0 21f8: 0c 01 movw r0, r24 21fa: ca 01 movw r24, r20 21fc: a0 01 movw r20, r0 21fe: 11 24 eor r1, r1 2200: ff 27 eor r31, r31 2202: 59 1b sub r21, r25 2204: 99 f0 breq .+38 ; 0x222c <__addsf3x+0x5c> 2206: 59 3f cpi r21, 0xF9 ; 249 2208: 50 f4 brcc .+20 ; 0x221e <__addsf3x+0x4e> 220a: 50 3e cpi r21, 0xE0 ; 224 220c: 68 f1 brcs .+90 ; 0x2268 <__addsf3x+0x98> 220e: 1a 16 cp r1, r26 2210: f0 40 sbci r31, 0x00 ; 0 2212: a2 2f mov r26, r18 2214: 23 2f mov r18, r19 2216: 34 2f mov r19, r20 2218: 44 27 eor r20, r20 221a: 58 5f subi r21, 0xF8 ; 248 221c: f3 cf rjmp .-26 ; 0x2204 <__addsf3x+0x34> 221e: 46 95 lsr r20 2220: 37 95 ror r19 2222: 27 95 ror r18 2224: a7 95 ror r26 2226: f0 40 sbci r31, 0x00 ; 0 2228: 53 95 inc r21 222a: c9 f7 brne .-14 ; 0x221e <__addsf3x+0x4e> 222c: 7e f4 brtc .+30 ; 0x224c <__addsf3x+0x7c> 222e: 1f 16 cp r1, r31 2230: ba 0b sbc r27, r26 2232: 62 0b sbc r22, r18 2234: 73 0b sbc r23, r19 2236: 84 0b sbc r24, r20 2238: ba f0 brmi .+46 ; 0x2268 <__addsf3x+0x98> 223a: 91 50 subi r25, 0x01 ; 1 223c: a1 f0 breq .+40 ; 0x2266 <__addsf3x+0x96> 223e: ff 0f add r31, r31 2240: bb 1f adc r27, r27 2242: 66 1f adc r22, r22 2244: 77 1f adc r23, r23 2246: 88 1f adc r24, r24 2248: c2 f7 brpl .-16 ; 0x223a <__addsf3x+0x6a> 224a: 0e c0 rjmp .+28 ; 0x2268 <__addsf3x+0x98> 224c: ba 0f add r27, r26 224e: 62 1f adc r22, r18 2250: 73 1f adc r23, r19 2252: 84 1f adc r24, r20 2254: 48 f4 brcc .+18 ; 0x2268 <__addsf3x+0x98> 2256: 87 95 ror r24 2258: 77 95 ror r23 225a: 67 95 ror r22 225c: b7 95 ror r27 225e: f7 95 ror r31 2260: 9e 3f cpi r25, 0xFE ; 254 2262: 08 f0 brcs .+2 ; 0x2266 <__addsf3x+0x96> 2264: b3 cf rjmp .-154 ; 0x21cc <__addsf3+0x1e> 2266: 93 95 inc r25 2268: 88 0f add r24, r24 226a: 08 f0 brcs .+2 ; 0x226e <__addsf3x+0x9e> 226c: 99 27 eor r25, r25 226e: ee 0f add r30, r30 2270: 97 95 ror r25 2272: 87 95 ror r24 2274: 08 95 ret 00002276 <__fixsfsi>: 2276: 04 d0 rcall .+8 ; 0x2280 <__fixunssfsi> 2278: 68 94 set 227a: b1 11 cpse r27, r1 227c: b5 c0 rjmp .+362 ; 0x23e8 <__fp_szero> 227e: 08 95 ret 00002280 <__fixunssfsi>: 2280: 98 d0 rcall .+304 ; 0x23b2 <__fp_splitA> 2282: 88 f0 brcs .+34 ; 0x22a6 <__fixunssfsi+0x26> 2284: 9f 57 subi r25, 0x7F ; 127 2286: 90 f0 brcs .+36 ; 0x22ac <__fixunssfsi+0x2c> 2288: b9 2f mov r27, r25 228a: 99 27 eor r25, r25 228c: b7 51 subi r27, 0x17 ; 23 228e: a0 f0 brcs .+40 ; 0x22b8 <__fixunssfsi+0x38> 2290: d1 f0 breq .+52 ; 0x22c6 <__fixunssfsi+0x46> 2292: 66 0f add r22, r22 2294: 77 1f adc r23, r23 2296: 88 1f adc r24, r24 2298: 99 1f adc r25, r25 229a: 1a f0 brmi .+6 ; 0x22a2 <__fixunssfsi+0x22> 229c: ba 95 dec r27 229e: c9 f7 brne .-14 ; 0x2292 <__fixunssfsi+0x12> 22a0: 12 c0 rjmp .+36 ; 0x22c6 <__fixunssfsi+0x46> 22a2: b1 30 cpi r27, 0x01 ; 1 22a4: 81 f0 breq .+32 ; 0x22c6 <__fixunssfsi+0x46> 22a6: 9f d0 rcall .+318 ; 0x23e6 <__fp_zero> 22a8: b1 e0 ldi r27, 0x01 ; 1 22aa: 08 95 ret 22ac: 9c c0 rjmp .+312 ; 0x23e6 <__fp_zero> 22ae: 67 2f mov r22, r23 22b0: 78 2f mov r23, r24 22b2: 88 27 eor r24, r24 22b4: b8 5f subi r27, 0xF8 ; 248 22b6: 39 f0 breq .+14 ; 0x22c6 <__fixunssfsi+0x46> 22b8: b9 3f cpi r27, 0xF9 ; 249 22ba: cc f3 brlt .-14 ; 0x22ae <__fixunssfsi+0x2e> 22bc: 86 95 lsr r24 22be: 77 95 ror r23 22c0: 67 95 ror r22 22c2: b3 95 inc r27 22c4: d9 f7 brne .-10 ; 0x22bc <__fixunssfsi+0x3c> 22c6: 3e f4 brtc .+14 ; 0x22d6 <__fixunssfsi+0x56> 22c8: 90 95 com r25 22ca: 80 95 com r24 22cc: 70 95 com r23 22ce: 61 95 neg r22 22d0: 7f 4f sbci r23, 0xFF ; 255 22d2: 8f 4f sbci r24, 0xFF ; 255 22d4: 9f 4f sbci r25, 0xFF ; 255 22d6: 08 95 ret 000022d8 <__floatunsisf>: 22d8: e8 94 clt 22da: 09 c0 rjmp .+18 ; 0x22ee <__floatsisf+0x12> 000022dc <__floatsisf>: 22dc: 97 fb bst r25, 7 22de: 3e f4 brtc .+14 ; 0x22ee <__floatsisf+0x12> 22e0: 90 95 com r25 22e2: 80 95 com r24 22e4: 70 95 com r23 22e6: 61 95 neg r22 22e8: 7f 4f sbci r23, 0xFF ; 255 22ea: 8f 4f sbci r24, 0xFF ; 255 22ec: 9f 4f sbci r25, 0xFF ; 255 22ee: 99 23 and r25, r25 22f0: a9 f0 breq .+42 ; 0x231c <__floatsisf+0x40> 22f2: f9 2f mov r31, r25 22f4: 96 e9 ldi r25, 0x96 ; 150 22f6: bb 27 eor r27, r27 22f8: 93 95 inc r25 22fa: f6 95 lsr r31 22fc: 87 95 ror r24 22fe: 77 95 ror r23 2300: 67 95 ror r22 2302: b7 95 ror r27 2304: f1 11 cpse r31, r1 2306: f8 cf rjmp .-16 ; 0x22f8 <__floatsisf+0x1c> 2308: fa f4 brpl .+62 ; 0x2348 <__floatsisf+0x6c> 230a: bb 0f add r27, r27 230c: 11 f4 brne .+4 ; 0x2312 <__floatsisf+0x36> 230e: 60 ff sbrs r22, 0 2310: 1b c0 rjmp .+54 ; 0x2348 <__floatsisf+0x6c> 2312: 6f 5f subi r22, 0xFF ; 255 2314: 7f 4f sbci r23, 0xFF ; 255 2316: 8f 4f sbci r24, 0xFF ; 255 2318: 9f 4f sbci r25, 0xFF ; 255 231a: 16 c0 rjmp .+44 ; 0x2348 <__floatsisf+0x6c> 231c: 88 23 and r24, r24 231e: 11 f0 breq .+4 ; 0x2324 <__floatsisf+0x48> 2320: 96 e9 ldi r25, 0x96 ; 150 2322: 11 c0 rjmp .+34 ; 0x2346 <__floatsisf+0x6a> 2324: 77 23 and r23, r23 2326: 21 f0 breq .+8 ; 0x2330 <__floatsisf+0x54> 2328: 9e e8 ldi r25, 0x8E ; 142 232a: 87 2f mov r24, r23 232c: 76 2f mov r23, r22 232e: 05 c0 rjmp .+10 ; 0x233a <__floatsisf+0x5e> 2330: 66 23 and r22, r22 2332: 71 f0 breq .+28 ; 0x2350 <__floatsisf+0x74> 2334: 96 e8 ldi r25, 0x86 ; 134 2336: 86 2f mov r24, r22 2338: 70 e0 ldi r23, 0x00 ; 0 233a: 60 e0 ldi r22, 0x00 ; 0 233c: 2a f0 brmi .+10 ; 0x2348 <__floatsisf+0x6c> 233e: 9a 95 dec r25 2340: 66 0f add r22, r22 2342: 77 1f adc r23, r23 2344: 88 1f adc r24, r24 2346: da f7 brpl .-10 ; 0x233e <__floatsisf+0x62> 2348: 88 0f add r24, r24 234a: 96 95 lsr r25 234c: 87 95 ror r24 234e: 97 f9 bld r25, 7 2350: 08 95 ret 00002352 <__fp_inf>: 2352: 97 f9 bld r25, 7 2354: 9f 67 ori r25, 0x7F ; 127 2356: 80 e8 ldi r24, 0x80 ; 128 2358: 70 e0 ldi r23, 0x00 ; 0 235a: 60 e0 ldi r22, 0x00 ; 0 235c: 08 95 ret 0000235e <__fp_nan>: 235e: 9f ef ldi r25, 0xFF ; 255 2360: 80 ec ldi r24, 0xC0 ; 192 2362: 08 95 ret 00002364 <__fp_pscA>: 2364: 00 24 eor r0, r0 2366: 0a 94 dec r0 2368: 16 16 cp r1, r22 236a: 17 06 cpc r1, r23 236c: 18 06 cpc r1, r24 236e: 09 06 cpc r0, r25 2370: 08 95 ret 00002372 <__fp_pscB>: 2372: 00 24 eor r0, r0 2374: 0a 94 dec r0 2376: 12 16 cp r1, r18 2378: 13 06 cpc r1, r19 237a: 14 06 cpc r1, r20 237c: 05 06 cpc r0, r21 237e: 08 95 ret 00002380 <__fp_round>: 2380: 09 2e mov r0, r25 2382: 03 94 inc r0 2384: 00 0c add r0, r0 2386: 11 f4 brne .+4 ; 0x238c <__fp_round+0xc> 2388: 88 23 and r24, r24 238a: 52 f0 brmi .+20 ; 0x23a0 <__fp_round+0x20> 238c: bb 0f add r27, r27 238e: 40 f4 brcc .+16 ; 0x23a0 <__fp_round+0x20> 2390: bf 2b or r27, r31 2392: 11 f4 brne .+4 ; 0x2398 <__fp_round+0x18> 2394: 60 ff sbrs r22, 0 2396: 04 c0 rjmp .+8 ; 0x23a0 <__fp_round+0x20> 2398: 6f 5f subi r22, 0xFF ; 255 239a: 7f 4f sbci r23, 0xFF ; 255 239c: 8f 4f sbci r24, 0xFF ; 255 239e: 9f 4f sbci r25, 0xFF ; 255 23a0: 08 95 ret 000023a2 <__fp_split3>: 23a2: 57 fd sbrc r21, 7 23a4: 90 58 subi r25, 0x80 ; 128 23a6: 44 0f add r20, r20 23a8: 55 1f adc r21, r21 23aa: 59 f0 breq .+22 ; 0x23c2 <__fp_splitA+0x10> 23ac: 5f 3f cpi r21, 0xFF ; 255 23ae: 71 f0 breq .+28 ; 0x23cc <__fp_splitA+0x1a> 23b0: 47 95 ror r20 000023b2 <__fp_splitA>: 23b2: 88 0f add r24, r24 23b4: 97 fb bst r25, 7 23b6: 99 1f adc r25, r25 23b8: 61 f0 breq .+24 ; 0x23d2 <__fp_splitA+0x20> 23ba: 9f 3f cpi r25, 0xFF ; 255 23bc: 79 f0 breq .+30 ; 0x23dc <__fp_splitA+0x2a> 23be: 87 95 ror r24 23c0: 08 95 ret 23c2: 12 16 cp r1, r18 23c4: 13 06 cpc r1, r19 23c6: 14 06 cpc r1, r20 23c8: 55 1f adc r21, r21 23ca: f2 cf rjmp .-28 ; 0x23b0 <__fp_split3+0xe> 23cc: 46 95 lsr r20 23ce: f1 df rcall .-30 ; 0x23b2 <__fp_splitA> 23d0: 08 c0 rjmp .+16 ; 0x23e2 <__fp_splitA+0x30> 23d2: 16 16 cp r1, r22 23d4: 17 06 cpc r1, r23 23d6: 18 06 cpc r1, r24 23d8: 99 1f adc r25, r25 23da: f1 cf rjmp .-30 ; 0x23be <__fp_splitA+0xc> 23dc: 86 95 lsr r24 23de: 71 05 cpc r23, r1 23e0: 61 05 cpc r22, r1 23e2: 08 94 sec 23e4: 08 95 ret 000023e6 <__fp_zero>: 23e6: e8 94 clt 000023e8 <__fp_szero>: 23e8: bb 27 eor r27, r27 23ea: 66 27 eor r22, r22 23ec: 77 27 eor r23, r23 23ee: cb 01 movw r24, r22 23f0: 97 f9 bld r25, 7 23f2: 08 95 ret 000023f4 <__mulsf3>: 23f4: 0b d0 rcall .+22 ; 0x240c <__mulsf3x> 23f6: c4 cf rjmp .-120 ; 0x2380 <__fp_round> 23f8: b5 df rcall .-150 ; 0x2364 <__fp_pscA> 23fa: 28 f0 brcs .+10 ; 0x2406 <__mulsf3+0x12> 23fc: ba df rcall .-140 ; 0x2372 <__fp_pscB> 23fe: 18 f0 brcs .+6 ; 0x2406 <__mulsf3+0x12> 2400: 95 23 and r25, r21 2402: 09 f0 breq .+2 ; 0x2406 <__mulsf3+0x12> 2404: a6 cf rjmp .-180 ; 0x2352 <__fp_inf> 2406: ab cf rjmp .-170 ; 0x235e <__fp_nan> 2408: 11 24 eor r1, r1 240a: ee cf rjmp .-36 ; 0x23e8 <__fp_szero> 0000240c <__mulsf3x>: 240c: ca df rcall .-108 ; 0x23a2 <__fp_split3> 240e: a0 f3 brcs .-24 ; 0x23f8 <__mulsf3+0x4> 00002410 <__mulsf3_pse>: 2410: 95 9f mul r25, r21 2412: d1 f3 breq .-12 ; 0x2408 <__mulsf3+0x14> 2414: 95 0f add r25, r21 2416: 50 e0 ldi r21, 0x00 ; 0 2418: 55 1f adc r21, r21 241a: 62 9f mul r22, r18 241c: f0 01 movw r30, r0 241e: 72 9f mul r23, r18 2420: bb 27 eor r27, r27 2422: f0 0d add r31, r0 2424: b1 1d adc r27, r1 2426: 63 9f mul r22, r19 2428: aa 27 eor r26, r26 242a: f0 0d add r31, r0 242c: b1 1d adc r27, r1 242e: aa 1f adc r26, r26 2430: 64 9f mul r22, r20 2432: 66 27 eor r22, r22 2434: b0 0d add r27, r0 2436: a1 1d adc r26, r1 2438: 66 1f adc r22, r22 243a: 82 9f mul r24, r18 243c: 22 27 eor r18, r18 243e: b0 0d add r27, r0 2440: a1 1d adc r26, r1 2442: 62 1f adc r22, r18 2444: 73 9f mul r23, r19 2446: b0 0d add r27, r0 2448: a1 1d adc r26, r1 244a: 62 1f adc r22, r18 244c: 83 9f mul r24, r19 244e: a0 0d add r26, r0 2450: 61 1d adc r22, r1 2452: 22 1f adc r18, r18 2454: 74 9f mul r23, r20 2456: 33 27 eor r19, r19 2458: a0 0d add r26, r0 245a: 61 1d adc r22, r1 245c: 23 1f adc r18, r19 245e: 84 9f mul r24, r20 2460: 60 0d add r22, r0 2462: 21 1d adc r18, r1 2464: 82 2f mov r24, r18 2466: 76 2f mov r23, r22 2468: 6a 2f mov r22, r26 246a: 11 24 eor r1, r1 246c: 9f 57 subi r25, 0x7F ; 127 246e: 50 40 sbci r21, 0x00 ; 0 2470: 8a f0 brmi .+34 ; 0x2494 <__mulsf3_pse+0x84> 2472: e1 f0 breq .+56 ; 0x24ac <__mulsf3_pse+0x9c> 2474: 88 23 and r24, r24 2476: 4a f0 brmi .+18 ; 0x248a <__mulsf3_pse+0x7a> 2478: ee 0f add r30, r30 247a: ff 1f adc r31, r31 247c: bb 1f adc r27, r27 247e: 66 1f adc r22, r22 2480: 77 1f adc r23, r23 2482: 88 1f adc r24, r24 2484: 91 50 subi r25, 0x01 ; 1 2486: 50 40 sbci r21, 0x00 ; 0 2488: a9 f7 brne .-22 ; 0x2474 <__mulsf3_pse+0x64> 248a: 9e 3f cpi r25, 0xFE ; 254 248c: 51 05 cpc r21, r1 248e: 70 f0 brcs .+28 ; 0x24ac <__mulsf3_pse+0x9c> 2490: 60 cf rjmp .-320 ; 0x2352 <__fp_inf> 2492: aa cf rjmp .-172 ; 0x23e8 <__fp_szero> 2494: 5f 3f cpi r21, 0xFF ; 255 2496: ec f3 brlt .-6 ; 0x2492 <__mulsf3_pse+0x82> 2498: 98 3e cpi r25, 0xE8 ; 232 249a: dc f3 brlt .-10 ; 0x2492 <__mulsf3_pse+0x82> 249c: 86 95 lsr r24 249e: 77 95 ror r23 24a0: 67 95 ror r22 24a2: b7 95 ror r27 24a4: f7 95 ror r31 24a6: e7 95 ror r30 24a8: 9f 5f subi r25, 0xFF ; 255 24aa: c1 f7 brne .-16 ; 0x249c <__mulsf3_pse+0x8c> 24ac: fe 2b or r31, r30 24ae: 88 0f add r24, r24 24b0: 91 1d adc r25, r1 24b2: 96 95 lsr r25 24b4: 87 95 ror r24 24b6: 97 f9 bld r25, 7 24b8: 08 95 ret 000024ba <__udivmodsi4>: 24ba: a1 e2 ldi r26, 0x21 ; 33 24bc: 1a 2e mov r1, r26 24be: aa 1b sub r26, r26 24c0: bb 1b sub r27, r27 24c2: fd 01 movw r30, r26 24c4: 0d c0 rjmp .+26 ; 0x24e0 <__udivmodsi4_ep> 000024c6 <__udivmodsi4_loop>: 24c6: aa 1f adc r26, r26 24c8: bb 1f adc r27, r27 24ca: ee 1f adc r30, r30 24cc: ff 1f adc r31, r31 24ce: a2 17 cp r26, r18 24d0: b3 07 cpc r27, r19 24d2: e4 07 cpc r30, r20 24d4: f5 07 cpc r31, r21 24d6: 20 f0 brcs .+8 ; 0x24e0 <__udivmodsi4_ep> 24d8: a2 1b sub r26, r18 24da: b3 0b sbc r27, r19 24dc: e4 0b sbc r30, r20 24de: f5 0b sbc r31, r21 000024e0 <__udivmodsi4_ep>: 24e0: 66 1f adc r22, r22 24e2: 77 1f adc r23, r23 24e4: 88 1f adc r24, r24 24e6: 99 1f adc r25, r25 24e8: 1a 94 dec r1 24ea: 69 f7 brne .-38 ; 0x24c6 <__udivmodsi4_loop> 24ec: 60 95 com r22 24ee: 70 95 com r23 24f0: 80 95 com r24 24f2: 90 95 com r25 24f4: 9b 01 movw r18, r22 24f6: ac 01 movw r20, r24 24f8: bd 01 movw r22, r26 24fa: cf 01 movw r24, r30 24fc: 08 95 ret 000024fe <__divmodsi4>: 24fe: 97 fb bst r25, 7 2500: 09 2e mov r0, r25 2502: 05 26 eor r0, r21 2504: 0e d0 rcall .+28 ; 0x2522 <__divmodsi4_neg1> 2506: 57 fd sbrc r21, 7 2508: 04 d0 rcall .+8 ; 0x2512 <__divmodsi4_neg2> 250a: d7 df rcall .-82 ; 0x24ba <__udivmodsi4> 250c: 0a d0 rcall .+20 ; 0x2522 <__divmodsi4_neg1> 250e: 00 1c adc r0, r0 2510: 38 f4 brcc .+14 ; 0x2520 <__divmodsi4_exit> 00002512 <__divmodsi4_neg2>: 2512: 50 95 com r21 2514: 40 95 com r20 2516: 30 95 com r19 2518: 21 95 neg r18 251a: 3f 4f sbci r19, 0xFF ; 255 251c: 4f 4f sbci r20, 0xFF ; 255 251e: 5f 4f sbci r21, 0xFF ; 255 00002520 <__divmodsi4_exit>: 2520: 08 95 ret 00002522 <__divmodsi4_neg1>: 2522: f6 f7 brtc .-4 ; 0x2520 <__divmodsi4_exit> 2524: 90 95 com r25 2526: 80 95 com r24 2528: 70 95 com r23 252a: 61 95 neg r22 252c: 7f 4f sbci r23, 0xFF ; 255 252e: 8f 4f sbci r24, 0xFF ; 255 2530: 9f 4f sbci r25, 0xFF ; 255 2532: 08 95 ret 00002534 <_exit>: 2534: f8 94 cli 00002536 <__stop_program>: 2536: ff cf rjmp .-2 ; 0x2536 <__stop_program>