diff --git a/Firmware/Chameleon-Mini/Button.c b/Firmware/Chameleon-Mini/Button.c index 1b5b0b4..8daafd0 100644 --- a/Firmware/Chameleon-Mini/Button.c +++ b/Firmware/Chameleon-Mini/Button.c @@ -57,6 +57,7 @@ #include "Random.h" #include "Common.h" #include "Settings.h" +#include "Memory.h" static const char PROGMEM ButtonActionTable[][32] = { @@ -66,7 +67,9 @@ static const char PROGMEM ButtonActionTable[][32] = [BUTTON_ACTION_UID_RIGHT_INCREMENT] = "UID_RIGHT_INCREMENT", [BUTTON_ACTION_UID_LEFT_DECREMENT] = "UID_LEFT_DECREMENT", [BUTTON_ACTION_UID_RIGHT_DECREMENT] = "UID_RIGHT_DECREMENT", - [BUTTON_ACTION_CYCLE_SETTINGS] = "CYCLE_SETTINGS" + [BUTTON_ACTION_CYCLE_SETTINGS] = "CYCLE_SETTINGS", + [BUTTON_ACTION_STORE_MEM] = "STORE_MEM", + [BUTTON_ACTION_RECALL_MEM] = "RECALL_MEM", }; void ButtonInit(void) @@ -167,6 +170,10 @@ void ButtonTick(void) ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { SettingsCycle(); + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + MemoryStore(); + } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { + MemoryRecall(); } } } @@ -202,7 +209,14 @@ void ButtonGetActionList(char* ListOut, uint16_t BufferSize) void ButtonSetActionById(ButtonActionEnum Action) { +#ifndef BUTTON_SETTING_GLOBAL GlobalSettings.ActiveSettingPtr->ButtonAction = Action; +#else + /* Write button action to all settings when using global settings */ + for (uint8_t i=0; i: - 0: 33 c3 rjmp .+1638 ; 0x668 <__ctors_end> + 0: 53 c3 rjmp .+1702 ; 0x6a8 <__ctors_end> 2: 00 00 nop - 4: 4d c3 rjmp .+1690 ; 0x6a0 <__bad_interrupt> + 4: 6d c3 rjmp .+1754 ; 0x6e0 <__bad_interrupt> 6: 00 00 nop - 8: 4b c3 rjmp .+1686 ; 0x6a0 <__bad_interrupt> + 8: 6b c3 rjmp .+1750 ; 0x6e0 <__bad_interrupt> a: 00 00 nop - c: 49 c3 rjmp .+1682 ; 0x6a0 <__bad_interrupt> + c: 69 c3 rjmp .+1746 ; 0x6e0 <__bad_interrupt> e: 00 00 nop - 10: 47 c3 rjmp .+1678 ; 0x6a0 <__bad_interrupt> + 10: 67 c3 rjmp .+1742 ; 0x6e0 <__bad_interrupt> 12: 00 00 nop - 14: 45 c3 rjmp .+1674 ; 0x6a0 <__bad_interrupt> + 14: 65 c3 rjmp .+1738 ; 0x6e0 <__bad_interrupt> 16: 00 00 nop - 18: 43 c3 rjmp .+1670 ; 0x6a0 <__bad_interrupt> + 18: 63 c3 rjmp .+1734 ; 0x6e0 <__bad_interrupt> 1a: 00 00 nop - 1c: 41 c3 rjmp .+1666 ; 0x6a0 <__bad_interrupt> + 1c: 61 c3 rjmp .+1730 ; 0x6e0 <__bad_interrupt> 1e: 00 00 nop - 20: 3f c3 rjmp .+1662 ; 0x6a0 <__bad_interrupt> + 20: 5f c3 rjmp .+1726 ; 0x6e0 <__bad_interrupt> 22: 00 00 nop - 24: 3d c3 rjmp .+1658 ; 0x6a0 <__bad_interrupt> + 24: 5d c3 rjmp .+1722 ; 0x6e0 <__bad_interrupt> 26: 00 00 nop - 28: 3b c3 rjmp .+1654 ; 0x6a0 <__bad_interrupt> + 28: 5b c3 rjmp .+1718 ; 0x6e0 <__bad_interrupt> 2a: 00 00 nop - 2c: 39 c3 rjmp .+1650 ; 0x6a0 <__bad_interrupt> + 2c: 59 c3 rjmp .+1714 ; 0x6e0 <__bad_interrupt> 2e: 00 00 nop - 30: 37 c3 rjmp .+1646 ; 0x6a0 <__bad_interrupt> + 30: 57 c3 rjmp .+1710 ; 0x6e0 <__bad_interrupt> 32: 00 00 nop - 34: 35 c3 rjmp .+1642 ; 0x6a0 <__bad_interrupt> + 34: 55 c3 rjmp .+1706 ; 0x6e0 <__bad_interrupt> 36: 00 00 nop - 38: 33 c3 rjmp .+1638 ; 0x6a0 <__bad_interrupt> + 38: 53 c3 rjmp .+1702 ; 0x6e0 <__bad_interrupt> 3a: 00 00 nop - 3c: 31 c3 rjmp .+1634 ; 0x6a0 <__bad_interrupt> + 3c: 51 c3 rjmp .+1698 ; 0x6e0 <__bad_interrupt> 3e: 00 00 nop - 40: 2f c3 rjmp .+1630 ; 0x6a0 <__bad_interrupt> + 40: 4f c3 rjmp .+1694 ; 0x6e0 <__bad_interrupt> 42: 00 00 nop - 44: 2d c3 rjmp .+1626 ; 0x6a0 <__bad_interrupt> + 44: 4d c3 rjmp .+1690 ; 0x6e0 <__bad_interrupt> 46: 00 00 nop - 48: 2b c3 rjmp .+1622 ; 0x6a0 <__bad_interrupt> + 48: 4b c3 rjmp .+1686 ; 0x6e0 <__bad_interrupt> 4a: 00 00 nop - 4c: 29 c3 rjmp .+1618 ; 0x6a0 <__bad_interrupt> + 4c: 49 c3 rjmp .+1682 ; 0x6e0 <__bad_interrupt> 4e: 00 00 nop - 50: 27 c3 rjmp .+1614 ; 0x6a0 <__bad_interrupt> + 50: 47 c3 rjmp .+1678 ; 0x6e0 <__bad_interrupt> 52: 00 00 nop - 54: 25 c3 rjmp .+1610 ; 0x6a0 <__bad_interrupt> + 54: 45 c3 rjmp .+1674 ; 0x6e0 <__bad_interrupt> 56: 00 00 nop - 58: 0c 94 b7 10 jmp 0x216e ; 0x216e <__vector_22> - 5c: 21 c3 rjmp .+1602 ; 0x6a0 <__bad_interrupt> + 58: 0c 94 80 12 jmp 0x2500 ; 0x2500 <__vector_22> + 5c: 41 c3 rjmp .+1666 ; 0x6e0 <__bad_interrupt> 5e: 00 00 nop - 60: 1f c3 rjmp .+1598 ; 0x6a0 <__bad_interrupt> + 60: 3f c3 rjmp .+1662 ; 0x6e0 <__bad_interrupt> 62: 00 00 nop - 64: 1d c3 rjmp .+1594 ; 0x6a0 <__bad_interrupt> + 64: 3d c3 rjmp .+1658 ; 0x6e0 <__bad_interrupt> 66: 00 00 nop - 68: 1b c3 rjmp .+1590 ; 0x6a0 <__bad_interrupt> + 68: 3b c3 rjmp .+1654 ; 0x6e0 <__bad_interrupt> 6a: 00 00 nop - 6c: 19 c3 rjmp .+1586 ; 0x6a0 <__bad_interrupt> + 6c: 39 c3 rjmp .+1650 ; 0x6e0 <__bad_interrupt> 6e: 00 00 nop - 70: 17 c3 rjmp .+1582 ; 0x6a0 <__bad_interrupt> + 70: 37 c3 rjmp .+1646 ; 0x6e0 <__bad_interrupt> 72: 00 00 nop - 74: 15 c3 rjmp .+1578 ; 0x6a0 <__bad_interrupt> + 74: 35 c3 rjmp .+1642 ; 0x6e0 <__bad_interrupt> 76: 00 00 nop - 78: 13 c3 rjmp .+1574 ; 0x6a0 <__bad_interrupt> + 78: 33 c3 rjmp .+1638 ; 0x6e0 <__bad_interrupt> 7a: 00 00 nop - 7c: 11 c3 rjmp .+1570 ; 0x6a0 <__bad_interrupt> + 7c: 31 c3 rjmp .+1634 ; 0x6e0 <__bad_interrupt> 7e: 00 00 nop - 80: 0f c3 rjmp .+1566 ; 0x6a0 <__bad_interrupt> + 80: 2f c3 rjmp .+1630 ; 0x6e0 <__bad_interrupt> 82: 00 00 nop - 84: 0d c3 rjmp .+1562 ; 0x6a0 <__bad_interrupt> + 84: 2d c3 rjmp .+1626 ; 0x6e0 <__bad_interrupt> 86: 00 00 nop - 88: 0c 94 73 10 jmp 0x20e6 ; 0x20e6 <__vector_34> - 8c: 09 c3 rjmp .+1554 ; 0x6a0 <__bad_interrupt> + 88: 0c 94 3c 12 jmp 0x2478 ; 0x2478 <__vector_34> + 8c: 29 c3 rjmp .+1618 ; 0x6e0 <__bad_interrupt> 8e: 00 00 nop - 90: 07 c3 rjmp .+1550 ; 0x6a0 <__bad_interrupt> + 90: 27 c3 rjmp .+1614 ; 0x6e0 <__bad_interrupt> 92: 00 00 nop - 94: 05 c3 rjmp .+1546 ; 0x6a0 <__bad_interrupt> + 94: 25 c3 rjmp .+1610 ; 0x6e0 <__bad_interrupt> 96: 00 00 nop - 98: 03 c3 rjmp .+1542 ; 0x6a0 <__bad_interrupt> + 98: 23 c3 rjmp .+1606 ; 0x6e0 <__bad_interrupt> 9a: 00 00 nop - 9c: 01 c3 rjmp .+1538 ; 0x6a0 <__bad_interrupt> + 9c: 21 c3 rjmp .+1602 ; 0x6e0 <__bad_interrupt> 9e: 00 00 nop - a0: ff c2 rjmp .+1534 ; 0x6a0 <__bad_interrupt> + a0: 1f c3 rjmp .+1598 ; 0x6e0 <__bad_interrupt> a2: 00 00 nop - a4: fd c2 rjmp .+1530 ; 0x6a0 <__bad_interrupt> + a4: 1d c3 rjmp .+1594 ; 0x6e0 <__bad_interrupt> a6: 00 00 nop - a8: fb c2 rjmp .+1526 ; 0x6a0 <__bad_interrupt> + a8: 1b c3 rjmp .+1590 ; 0x6e0 <__bad_interrupt> aa: 00 00 nop - ac: f9 c2 rjmp .+1522 ; 0x6a0 <__bad_interrupt> + ac: 19 c3 rjmp .+1586 ; 0x6e0 <__bad_interrupt> ae: 00 00 nop - b0: f7 c2 rjmp .+1518 ; 0x6a0 <__bad_interrupt> + b0: 17 c3 rjmp .+1582 ; 0x6e0 <__bad_interrupt> b2: 00 00 nop - b4: f5 c2 rjmp .+1514 ; 0x6a0 <__bad_interrupt> + b4: 15 c3 rjmp .+1578 ; 0x6e0 <__bad_interrupt> b6: 00 00 nop - b8: f3 c2 rjmp .+1510 ; 0x6a0 <__bad_interrupt> + b8: 13 c3 rjmp .+1574 ; 0x6e0 <__bad_interrupt> ba: 00 00 nop - bc: f1 c2 rjmp .+1506 ; 0x6a0 <__bad_interrupt> + bc: 11 c3 rjmp .+1570 ; 0x6e0 <__bad_interrupt> be: 00 00 nop - c0: ef c2 rjmp .+1502 ; 0x6a0 <__bad_interrupt> + c0: 0f c3 rjmp .+1566 ; 0x6e0 <__bad_interrupt> c2: 00 00 nop - c4: ed c2 rjmp .+1498 ; 0x6a0 <__bad_interrupt> + c4: 0d c3 rjmp .+1562 ; 0x6e0 <__bad_interrupt> c6: 00 00 nop - c8: eb c2 rjmp .+1494 ; 0x6a0 <__bad_interrupt> + c8: 0b c3 rjmp .+1558 ; 0x6e0 <__bad_interrupt> ca: 00 00 nop - cc: e9 c2 rjmp .+1490 ; 0x6a0 <__bad_interrupt> + cc: 09 c3 rjmp .+1554 ; 0x6e0 <__bad_interrupt> ce: 00 00 nop - d0: e7 c2 rjmp .+1486 ; 0x6a0 <__bad_interrupt> + d0: 07 c3 rjmp .+1550 ; 0x6e0 <__bad_interrupt> d2: 00 00 nop - d4: e5 c2 rjmp .+1482 ; 0x6a0 <__bad_interrupt> + d4: 05 c3 rjmp .+1546 ; 0x6e0 <__bad_interrupt> d6: 00 00 nop - d8: e3 c2 rjmp .+1478 ; 0x6a0 <__bad_interrupt> + d8: 03 c3 rjmp .+1542 ; 0x6e0 <__bad_interrupt> da: 00 00 nop - dc: e1 c2 rjmp .+1474 ; 0x6a0 <__bad_interrupt> + dc: 01 c3 rjmp .+1538 ; 0x6e0 <__bad_interrupt> de: 00 00 nop - e0: df c2 rjmp .+1470 ; 0x6a0 <__bad_interrupt> + e0: ff c2 rjmp .+1534 ; 0x6e0 <__bad_interrupt> e2: 00 00 nop - e4: dd c2 rjmp .+1466 ; 0x6a0 <__bad_interrupt> + e4: fd c2 rjmp .+1530 ; 0x6e0 <__bad_interrupt> e6: 00 00 nop - e8: db c2 rjmp .+1462 ; 0x6a0 <__bad_interrupt> + e8: fb c2 rjmp .+1526 ; 0x6e0 <__bad_interrupt> ea: 00 00 nop - ec: d9 c2 rjmp .+1458 ; 0x6a0 <__bad_interrupt> + ec: f9 c2 rjmp .+1522 ; 0x6e0 <__bad_interrupt> ee: 00 00 nop - f0: d7 c2 rjmp .+1454 ; 0x6a0 <__bad_interrupt> + f0: f7 c2 rjmp .+1518 ; 0x6e0 <__bad_interrupt> f2: 00 00 nop - f4: d5 c2 rjmp .+1450 ; 0x6a0 <__bad_interrupt> + f4: f5 c2 rjmp .+1514 ; 0x6e0 <__bad_interrupt> f6: 00 00 nop - f8: d3 c2 rjmp .+1446 ; 0x6a0 <__bad_interrupt> + f8: f3 c2 rjmp .+1510 ; 0x6e0 <__bad_interrupt> fa: 00 00 nop - fc: d1 c2 rjmp .+1442 ; 0x6a0 <__bad_interrupt> + fc: f1 c2 rjmp .+1506 ; 0x6e0 <__bad_interrupt> fe: 00 00 nop - 100: cf c2 rjmp .+1438 ; 0x6a0 <__bad_interrupt> + 100: ef c2 rjmp .+1502 ; 0x6e0 <__bad_interrupt> 102: 00 00 nop - 104: cd c2 rjmp .+1434 ; 0x6a0 <__bad_interrupt> + 104: ed c2 rjmp .+1498 ; 0x6e0 <__bad_interrupt> 106: 00 00 nop - 108: cb c2 rjmp .+1430 ; 0x6a0 <__bad_interrupt> + 108: eb c2 rjmp .+1494 ; 0x6e0 <__bad_interrupt> 10a: 00 00 nop - 10c: c9 c2 rjmp .+1426 ; 0x6a0 <__bad_interrupt> + 10c: e9 c2 rjmp .+1490 ; 0x6e0 <__bad_interrupt> 10e: 00 00 nop - 110: c7 c2 rjmp .+1422 ; 0x6a0 <__bad_interrupt> + 110: e7 c2 rjmp .+1486 ; 0x6e0 <__bad_interrupt> 112: 00 00 nop - 114: c5 c2 rjmp .+1418 ; 0x6a0 <__bad_interrupt> + 114: e5 c2 rjmp .+1482 ; 0x6e0 <__bad_interrupt> 116: 00 00 nop - 118: c3 c2 rjmp .+1414 ; 0x6a0 <__bad_interrupt> + 118: e3 c2 rjmp .+1478 ; 0x6e0 <__bad_interrupt> 11a: 00 00 nop - 11c: c1 c2 rjmp .+1410 ; 0x6a0 <__bad_interrupt> + 11c: e1 c2 rjmp .+1474 ; 0x6e0 <__bad_interrupt> 11e: 00 00 nop - 120: bf c2 rjmp .+1406 ; 0x6a0 <__bad_interrupt> + 120: df c2 rjmp .+1470 ; 0x6e0 <__bad_interrupt> 122: 00 00 nop - 124: bd c2 rjmp .+1402 ; 0x6a0 <__bad_interrupt> + 124: dd c2 rjmp .+1466 ; 0x6e0 <__bad_interrupt> 126: 00 00 nop - 128: bb c2 rjmp .+1398 ; 0x6a0 <__bad_interrupt> + 128: db c2 rjmp .+1462 ; 0x6e0 <__bad_interrupt> 12a: 00 00 nop - 12c: b9 c2 rjmp .+1394 ; 0x6a0 <__bad_interrupt> + 12c: d9 c2 rjmp .+1458 ; 0x6e0 <__bad_interrupt> 12e: 00 00 nop - 130: b7 c2 rjmp .+1390 ; 0x6a0 <__bad_interrupt> + 130: d7 c2 rjmp .+1454 ; 0x6e0 <__bad_interrupt> 132: 00 00 nop - 134: b5 c2 rjmp .+1386 ; 0x6a0 <__bad_interrupt> + 134: d5 c2 rjmp .+1450 ; 0x6e0 <__bad_interrupt> 136: 00 00 nop - 138: b3 c2 rjmp .+1382 ; 0x6a0 <__bad_interrupt> + 138: d3 c2 rjmp .+1446 ; 0x6e0 <__bad_interrupt> 13a: 00 00 nop - 13c: b1 c2 rjmp .+1378 ; 0x6a0 <__bad_interrupt> + 13c: d1 c2 rjmp .+1442 ; 0x6e0 <__bad_interrupt> 13e: 00 00 nop - 140: af c2 rjmp .+1374 ; 0x6a0 <__bad_interrupt> + 140: cf c2 rjmp .+1438 ; 0x6e0 <__bad_interrupt> 142: 00 00 nop - 144: ad c2 rjmp .+1370 ; 0x6a0 <__bad_interrupt> + 144: cd c2 rjmp .+1434 ; 0x6e0 <__bad_interrupt> 146: 00 00 nop - 148: ab c2 rjmp .+1366 ; 0x6a0 <__bad_interrupt> + 148: cb c2 rjmp .+1430 ; 0x6e0 <__bad_interrupt> 14a: 00 00 nop - 14c: 0c 94 5b 11 jmp 0x22b6 ; 0x22b6 <__vector_83> - 150: a7 c2 rjmp .+1358 ; 0x6a0 <__bad_interrupt> + 14c: 0c 94 24 13 jmp 0x2648 ; 0x2648 <__vector_83> + 150: c7 c2 rjmp .+1422 ; 0x6e0 <__bad_interrupt> 152: 00 00 nop - 154: a5 c2 rjmp .+1354 ; 0x6a0 <__bad_interrupt> + 154: c5 c2 rjmp .+1418 ; 0x6e0 <__bad_interrupt> 156: 00 00 nop - 158: a3 c2 rjmp .+1350 ; 0x6a0 <__bad_interrupt> + 158: c3 c2 rjmp .+1414 ; 0x6e0 <__bad_interrupt> 15a: 00 00 nop - 15c: a1 c2 rjmp .+1346 ; 0x6a0 <__bad_interrupt> + 15c: c1 c2 rjmp .+1410 ; 0x6e0 <__bad_interrupt> 15e: 00 00 nop - 160: 9f c2 rjmp .+1342 ; 0x6a0 <__bad_interrupt> + 160: bf c2 rjmp .+1406 ; 0x6e0 <__bad_interrupt> 162: 00 00 nop - 164: 9d c2 rjmp .+1338 ; 0x6a0 <__bad_interrupt> + 164: bd c2 rjmp .+1402 ; 0x6e0 <__bad_interrupt> 166: 00 00 nop - 168: 9b c2 rjmp .+1334 ; 0x6a0 <__bad_interrupt> + 168: bb c2 rjmp .+1398 ; 0x6e0 <__bad_interrupt> 16a: 00 00 nop - 16c: 99 c2 rjmp .+1330 ; 0x6a0 <__bad_interrupt> + 16c: b9 c2 rjmp .+1394 ; 0x6e0 <__bad_interrupt> 16e: 00 00 nop - 170: 97 c2 rjmp .+1326 ; 0x6a0 <__bad_interrupt> + 170: b7 c2 rjmp .+1390 ; 0x6e0 <__bad_interrupt> 172: 00 00 nop - 174: 95 c2 rjmp .+1322 ; 0x6a0 <__bad_interrupt> + 174: b5 c2 rjmp .+1386 ; 0x6e0 <__bad_interrupt> 176: 00 00 nop - 178: 93 c2 rjmp .+1318 ; 0x6a0 <__bad_interrupt> + 178: b3 c2 rjmp .+1382 ; 0x6e0 <__bad_interrupt> 17a: 00 00 nop - 17c: 91 c2 rjmp .+1314 ; 0x6a0 <__bad_interrupt> + 17c: b1 c2 rjmp .+1378 ; 0x6e0 <__bad_interrupt> 17e: 00 00 nop - 180: 8f c2 rjmp .+1310 ; 0x6a0 <__bad_interrupt> + 180: af c2 rjmp .+1374 ; 0x6e0 <__bad_interrupt> 182: 00 00 nop - 184: 8d c2 rjmp .+1306 ; 0x6a0 <__bad_interrupt> + 184: ad c2 rjmp .+1370 ; 0x6e0 <__bad_interrupt> 186: 00 00 nop - 188: 8b c2 rjmp .+1302 ; 0x6a0 <__bad_interrupt> + 188: ab c2 rjmp .+1366 ; 0x6e0 <__bad_interrupt> 18a: 00 00 nop - 18c: 89 c2 rjmp .+1298 ; 0x6a0 <__bad_interrupt> + 18c: a9 c2 rjmp .+1362 ; 0x6e0 <__bad_interrupt> 18e: 00 00 nop - 190: 87 c2 rjmp .+1294 ; 0x6a0 <__bad_interrupt> + 190: a7 c2 rjmp .+1358 ; 0x6e0 <__bad_interrupt> 192: 00 00 nop - 194: 85 c2 rjmp .+1290 ; 0x6a0 <__bad_interrupt> + 194: a5 c2 rjmp .+1354 ; 0x6e0 <__bad_interrupt> 196: 00 00 nop - 198: 83 c2 rjmp .+1286 ; 0x6a0 <__bad_interrupt> + 198: a3 c2 rjmp .+1350 ; 0x6e0 <__bad_interrupt> 19a: 00 00 nop - 19c: 81 c2 rjmp .+1282 ; 0x6a0 <__bad_interrupt> + 19c: a1 c2 rjmp .+1346 ; 0x6e0 <__bad_interrupt> 19e: 00 00 nop - 1a0: 7f c2 rjmp .+1278 ; 0x6a0 <__bad_interrupt> + 1a0: 9f c2 rjmp .+1342 ; 0x6e0 <__bad_interrupt> 1a2: 00 00 nop - 1a4: 7d c2 rjmp .+1274 ; 0x6a0 <__bad_interrupt> + 1a4: 9d c2 rjmp .+1338 ; 0x6e0 <__bad_interrupt> 1a6: 00 00 nop - 1a8: 7b c2 rjmp .+1270 ; 0x6a0 <__bad_interrupt> + 1a8: 9b c2 rjmp .+1334 ; 0x6e0 <__bad_interrupt> 1aa: 00 00 nop - 1ac: 79 c2 rjmp .+1266 ; 0x6a0 <__bad_interrupt> + 1ac: 99 c2 rjmp .+1330 ; 0x6e0 <__bad_interrupt> 1ae: 00 00 nop - 1b0: 77 c2 rjmp .+1262 ; 0x6a0 <__bad_interrupt> + 1b0: 97 c2 rjmp .+1326 ; 0x6e0 <__bad_interrupt> 1b2: 00 00 nop - 1b4: 75 c2 rjmp .+1258 ; 0x6a0 <__bad_interrupt> + 1b4: 95 c2 rjmp .+1322 ; 0x6e0 <__bad_interrupt> 1b6: 00 00 nop - 1b8: 73 c2 rjmp .+1254 ; 0x6a0 <__bad_interrupt> + 1b8: 93 c2 rjmp .+1318 ; 0x6e0 <__bad_interrupt> 1ba: 00 00 nop - 1bc: 71 c2 rjmp .+1250 ; 0x6a0 <__bad_interrupt> + 1bc: 91 c2 rjmp .+1314 ; 0x6e0 <__bad_interrupt> 1be: 00 00 nop - 1c0: 6f c2 rjmp .+1246 ; 0x6a0 <__bad_interrupt> + 1c0: 8f c2 rjmp .+1310 ; 0x6e0 <__bad_interrupt> 1c2: 00 00 nop - 1c4: 6d c2 rjmp .+1242 ; 0x6a0 <__bad_interrupt> + 1c4: 8d c2 rjmp .+1306 ; 0x6e0 <__bad_interrupt> 1c6: 00 00 nop - 1c8: 6b c2 rjmp .+1238 ; 0x6a0 <__bad_interrupt> + 1c8: 8b c2 rjmp .+1302 ; 0x6e0 <__bad_interrupt> 1ca: 00 00 nop - 1cc: 69 c2 rjmp .+1234 ; 0x6a0 <__bad_interrupt> + 1cc: 89 c2 rjmp .+1298 ; 0x6e0 <__bad_interrupt> 1ce: 00 00 nop - 1d0: 67 c2 rjmp .+1230 ; 0x6a0 <__bad_interrupt> + 1d0: 87 c2 rjmp .+1294 ; 0x6e0 <__bad_interrupt> 1d2: 00 00 nop - 1d4: 65 c2 rjmp .+1226 ; 0x6a0 <__bad_interrupt> + 1d4: 85 c2 rjmp .+1290 ; 0x6e0 <__bad_interrupt> 1d6: 00 00 nop - 1d8: 63 c2 rjmp .+1222 ; 0x6a0 <__bad_interrupt> + 1d8: 83 c2 rjmp .+1286 ; 0x6e0 <__bad_interrupt> 1da: 00 00 nop - 1dc: 61 c2 rjmp .+1218 ; 0x6a0 <__bad_interrupt> + 1dc: 81 c2 rjmp .+1282 ; 0x6e0 <__bad_interrupt> 1de: 00 00 nop - 1e0: 5f c2 rjmp .+1214 ; 0x6a0 <__bad_interrupt> + 1e0: 7f c2 rjmp .+1278 ; 0x6e0 <__bad_interrupt> 1e2: 00 00 nop - 1e4: 5d c2 rjmp .+1210 ; 0x6a0 <__bad_interrupt> + 1e4: 7d c2 rjmp .+1274 ; 0x6e0 <__bad_interrupt> 1e6: 00 00 nop - 1e8: 5b c2 rjmp .+1206 ; 0x6a0 <__bad_interrupt> + 1e8: 7b c2 rjmp .+1270 ; 0x6e0 <__bad_interrupt> 1ea: 00 00 nop - 1ec: 59 c2 rjmp .+1202 ; 0x6a0 <__bad_interrupt> + 1ec: 79 c2 rjmp .+1266 ; 0x6e0 <__bad_interrupt> 1ee: 00 00 nop - 1f0: 57 c2 rjmp .+1198 ; 0x6a0 <__bad_interrupt> + 1f0: 77 c2 rjmp .+1262 ; 0x6e0 <__bad_interrupt> 1f2: 00 00 nop - 1f4: 0c 94 1b 21 jmp 0x4236 ; 0x4236 <__vector_125> - 1f8: 53 c2 rjmp .+1190 ; 0x6a0 <__bad_interrupt> + 1f4: 0c 94 e4 22 jmp 0x45c8 ; 0x45c8 <__vector_125> + 1f8: 73 c2 rjmp .+1254 ; 0x6e0 <__bad_interrupt> 1fa: 00 00 nop 000001fc : @@ -311,12 +311,12 @@ Disassembly of section .text: 00000288 : 288: 00 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 .NONE........... - 298: 00 40 04 41 04 42 04 43 04 44 04 45 04 48 04 49 .@.A.B.C.D.E.H.I + 298: 00 64 04 65 04 66 04 67 04 68 04 69 04 6c 04 6d .d.e.f.g.h.i.l.m 2a8: 04 00 00 00 01 01 4d 46 5f 43 4c 41 53 53 49 43 ......MF_CLASSIC - 2b8: 5f 31 4b 00 00 00 4c 12 83 12 01 13 1b 13 1f 13 _1K...L......... - 2c8: 20 13 9d 17 a3 17 00 04 04 00 02 4d 46 5f 43 4c ..........MF_CL - 2d8: 41 53 53 49 43 5f 34 4b 00 00 00 4c 12 83 12 0e ASSIC_4K...L.... - 2e8: 13 1b 13 1f 13 20 13 9d 17 a3 17 00 10 04 00 ..... ......... + 2b8: 5f 31 4b 00 00 00 15 14 4c 14 ca 14 e4 14 e8 14 _1K.....L....... + 2c8: e9 14 66 19 6c 19 00 04 04 00 02 4d 46 5f 43 4c ..f.l......MF_CL + 2d8: 41 53 53 49 43 5f 34 4b 00 00 00 15 14 4c 14 d7 ASSIC_4K.....L.. + 2e8: 14 e4 14 e8 14 e9 14 66 19 6c 19 00 10 04 00 .......f.l..... 000002f7 : 2f7: 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 00 NONE............ @@ -333,1695 +333,1653 @@ Disassembly of section .text: 3a7: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. 3b7: 43 59 43 4c 45 5f 53 45 54 54 49 4e 47 53 00 00 CYCLE_SETTINGS.. 3c7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 3d7: 53 54 4f 52 45 5f 4d 45 4d 00 00 00 00 00 00 00 STORE_MEM....... + 3e7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 3f7: 52 45 43 41 4c 4c 5f 4d 45 4d 00 00 00 00 00 00 RECALL_MEM...... + 407: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -000003d7 <__c.6287>: - 3d7: 43 68 61 6d 65 6c 65 6f 6e 2d 4d 69 6e 69 20 25 Chameleon-Mini % - 3e7: 53 20 75 73 69 6e 67 20 4c 55 46 41 20 25 53 20 S using LUFA %S - 3f7: 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 41 56 compiled with AV - 407: 52 2d 47 43 43 20 25 53 00 R-GCC %S. +00000417 <__c.6293>: + 417: 43 68 61 6d 65 6c 65 6f 6e 2d 4d 69 6e 69 20 25 Chameleon-Mini % + 427: 53 20 75 73 69 6e 67 20 4c 55 46 41 20 25 53 20 S using LUFA %S + 437: 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 41 56 compiled with AV + 447: 52 2d 47 43 43 20 25 53 00 R-GCC %S. -00000410 <__c.6289>: - 410: 31 34 30 35 31 31 00 140511. +00000450 <__c.6295>: + 450: 31 34 30 35 31 31 00 140511. -00000417 <__c.6291>: - 417: 31 33 30 39 30 31 00 130901. +00000457 <__c.6297>: + 457: 31 33 30 39 30 31 00 130901. -0000041e <__c.6293>: - 41e: 34 2e 37 2e 32 00 4.7.2. +0000045e <__c.6299>: + 45e: 34 2e 37 2e 32 00 4.7.2. -00000424 <__c.6298>: - 424: 25 73 00 %s. +00000464 <__c.6304>: + 464: 25 73 00 %s. -00000427 <__c.6316>: - 427: 52 41 4e 44 4f 4d 00 RANDOM. +00000467 <__c.6322>: + 467: 52 41 4e 44 4f 4d 00 RANDOM. -0000042e <__c.6343>: - 42e: 25 75 00 %u. +0000046e <__c.6349>: + 46e: 25 75 00 %u. -00000431 <__c.6348>: - 431: 25 75 00 %u. +00000471 <__c.6354>: + 471: 25 75 00 %u. -00000434 <__c.6387>: - 434: 25 35 75 20 6d 56 00 %5u mV. +00000474 <__c.6393>: + 474: 25 35 75 20 6d 56 00 %5u mV. -0000043b : - 43b: 56 45 52 53 49 4f 4e 00 00 00 00 00 00 00 00 00 VERSION......... - 44b: 00 00 00 00 3a 0b 43 4f 4e 46 49 47 00 00 00 00 ....:.CONFIG.... - 45b: 00 00 00 00 00 00 76 0b 6e 0b 58 0b 55 49 44 00 ......v.n.X.UID. - 46b: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a1 0b ................ - 47b: 7b 0b 52 45 41 44 4f 4e 4c 59 00 00 00 00 00 00 {.READONLY...... - 48b: 00 00 00 00 0a 0c f8 0b 55 50 4c 4f 41 44 00 00 ........UPLOAD.. - 49b: 00 00 00 00 00 00 00 00 1e 0c 00 00 00 00 44 4f ..............DO - 4ab: 57 4e 4c 4f 41 44 00 00 00 00 00 00 00 00 23 0c WNLOAD........#. - 4bb: 00 00 00 00 52 45 53 45 54 00 00 00 00 00 00 00 ....RESET....... - 4cb: 00 00 00 00 28 0c 00 00 00 00 55 50 47 52 41 44 ....(.....UPGRAD - 4db: 45 00 00 00 00 00 00 00 00 00 33 0c 00 00 00 00 E.........3..... - 4eb: 4d 45 4d 53 49 5a 45 00 00 00 00 00 00 00 00 00 MEMSIZE......... - 4fb: 00 00 00 00 3e 0c 55 49 44 53 49 5a 45 00 00 00 ....>.UIDSIZE... - 50b: 00 00 00 00 00 00 00 00 00 00 56 0c 42 55 54 54 ..........V.BUTT - 51b: 4f 4e 00 00 00 00 00 00 00 00 00 00 6c 0c 76 0c ON..........l.v. - 52b: 71 0c 53 45 54 54 49 4e 47 00 00 00 00 00 00 00 q.SETTING....... - 53b: 00 00 00 00 83 0c 7e 0c 43 4c 45 41 52 00 00 00 ......~.CLEAR... - 54b: 00 00 00 00 00 00 00 00 8b 0c 00 00 00 00 48 45 ..............HE - 55b: 4c 50 00 00 00 00 00 00 00 00 00 00 00 00 8e 0c LP.............. - 56b: 00 00 00 00 52 53 53 49 00 00 00 00 00 00 00 00 ....RSSI........ - 57b: 00 00 00 00 00 00 00 00 da 0c 00 00 00 00 00 00 ................ - 58b: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ +0000047b : + 47b: 56 45 52 53 49 4f 4e 00 00 00 00 00 00 00 00 00 VERSION......... + 48b: 00 00 00 00 fd 0c 43 4f 4e 46 49 47 00 00 00 00 ......CONFIG.... + 49b: 00 00 00 00 00 00 3a 0d 31 0d 1b 0d 55 49 44 00 ......:.1...UID. + 4ab: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 67 0d ..............g. + 4bb: 40 0d 52 45 41 44 4f 4e 4c 59 00 00 00 00 00 00 @.READONLY...... + 4cb: 00 00 00 00 d2 0d c0 0d 55 50 4c 4f 41 44 00 00 ........UPLOAD.. + 4db: 00 00 00 00 00 00 00 00 e6 0d 00 00 00 00 44 4f ..............DO + 4eb: 57 4e 4c 4f 41 44 00 00 00 00 00 00 00 00 eb 0d WNLOAD.......... + 4fb: 00 00 00 00 52 45 53 45 54 00 00 00 00 00 00 00 ....RESET....... + 50b: 00 00 00 00 f0 0d 00 00 00 00 55 50 47 52 41 44 ..........UPGRAD + 51b: 45 00 00 00 00 00 00 00 00 00 fb 0d 00 00 00 00 E............... + 52b: 4d 45 4d 53 49 5a 45 00 00 00 00 00 00 00 00 00 MEMSIZE......... + 53b: 00 00 00 00 06 0e 55 49 44 53 49 5a 45 00 00 00 ......UIDSIZE... + 54b: 00 00 00 00 00 00 00 00 00 00 1e 0e 42 55 54 54 ............BUTT + 55b: 4f 4e 00 00 00 00 00 00 00 00 00 00 34 0e 3e 0e ON..........4.>. + 56b: 39 0e 53 45 54 54 49 4e 47 00 00 00 00 00 00 00 9.SETTING....... + 57b: 00 00 00 00 4b 0e 46 0e 43 4c 45 41 52 00 00 00 ....K.F.CLEAR... + 58b: 00 00 00 00 00 00 00 00 53 0e 00 00 00 00 48 45 ........S.....HE + 59b: 4c 50 00 00 00 00 00 00 00 00 00 00 00 00 57 0e LP............W. + 5ab: 00 00 00 00 52 53 53 49 00 00 00 00 00 00 00 00 ....RSSI........ + 5bb: 00 00 00 00 00 00 00 00 a3 0e 00 00 00 00 00 00 ................ + 5cb: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0000059b <__c.6083>: - 59b: 0d 0a 00 ... +000005db <__c.6083>: + 5db: 0d 0a 00 ... -0000059e <__c.6085>: - 59e: 0d 0a 00 ... +000005de <__c.6085>: + 5de: 0d 0a 00 ... -000005a1 : - 5a1: 64 31 30 30 3a 4f 4b 00 00 00 00 00 00 00 00 00 d100:OK......... - 5b1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 5c1: 00 65 31 30 31 3a 4f 4b 20 57 49 54 48 20 54 45 .e101:OK WITH TE - 5d1: 58 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XT.............. - 5e1: 00 00 6e 31 31 30 3a 57 41 49 54 49 4e 47 20 46 ..n110:WAITING F - 5f1: 4f 52 20 58 4d 4f 44 45 4d 00 00 00 00 00 00 00 OR XMODEM....... - 601: 00 00 00 c8 32 30 30 3a 55 4e 4b 4e 4f 57 4e 20 ....200:UNKNOWN - 611: 43 4f 4d 4d 41 4e 44 00 00 00 00 00 00 00 00 00 COMMAND......... - 621: 00 00 00 00 c9 32 30 31 3a 49 4e 56 41 4c 49 44 .....201:INVALID - 631: 20 43 4f 4d 4d 41 4e 44 20 55 53 41 47 45 00 00 COMMAND USAGE.. - 641: 00 00 00 00 00 ca 32 30 32 3a 49 4e 56 41 4c 49 ......202:INVALI - 651: 44 20 50 41 52 41 4d 45 54 45 52 00 00 00 00 00 D PARAMETER..... - 661: 00 00 00 00 00 00 00 ....... +000005e1 : + 5e1: 64 31 30 30 3a 4f 4b 00 00 00 00 00 00 00 00 00 d100:OK......... + 5f1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 601: 00 65 31 30 31 3a 4f 4b 20 57 49 54 48 20 54 45 .e101:OK WITH TE + 611: 58 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XT.............. + 621: 00 00 6e 31 31 30 3a 57 41 49 54 49 4e 47 20 46 ..n110:WAITING F + 631: 4f 52 20 58 4d 4f 44 45 4d 00 00 00 00 00 00 00 OR XMODEM....... + 641: 00 00 00 c8 32 30 30 3a 55 4e 4b 4e 4f 57 4e 20 ....200:UNKNOWN + 651: 43 4f 4d 4d 41 4e 44 00 00 00 00 00 00 00 00 00 COMMAND......... + 661: 00 00 00 00 c9 32 30 31 3a 49 4e 56 41 4c 49 44 .....201:INVALID + 671: 20 43 4f 4d 4d 41 4e 44 20 55 53 41 47 45 00 00 COMMAND USAGE.. + 681: 00 00 00 00 00 ca 32 30 32 3a 49 4e 56 41 4c 49 ......202:INVALI + 691: 44 20 50 41 52 41 4d 45 54 45 52 00 00 00 00 00 D PARAMETER..... + 6a1: 00 00 00 00 00 00 00 ....... -00000668 <__ctors_end>: - 668: 11 24 eor r1, r1 - 66a: 1f be out 0x3f, r1 ; 63 - 66c: cf ef ldi r28, 0xFF ; 255 - 66e: df e2 ldi r29, 0x2F ; 47 - 670: de bf out 0x3e, r29 ; 62 - 672: cd bf out 0x3d, r28 ; 61 +000006a8 <__ctors_end>: + 6a8: 11 24 eor r1, r1 + 6aa: 1f be out 0x3f, r1 ; 63 + 6ac: cf ef ldi r28, 0xFF ; 255 + 6ae: df e2 ldi r29, 0x2F ; 47 + 6b0: de bf out 0x3e, r29 ; 62 + 6b2: cd bf out 0x3d, r28 ; 61 -00000674 <__do_copy_data>: - 674: 10 e2 ldi r17, 0x20 ; 32 - 676: a0 e0 ldi r26, 0x00 ; 0 - 678: b0 e2 ldi r27, 0x20 ; 32 - 67a: e0 ef ldi r30, 0xF0 ; 240 - 67c: fe e4 ldi r31, 0x4E ; 78 - 67e: 02 c0 rjmp .+4 ; 0x684 <__do_copy_data+0x10> - 680: 05 90 lpm r0, Z+ - 682: 0d 92 st X+, r0 - 684: a2 39 cpi r26, 0x92 ; 146 - 686: b1 07 cpc r27, r17 - 688: d9 f7 brne .-10 ; 0x680 <__do_copy_data+0xc> +000006b4 <__do_copy_data>: + 6b4: 10 e2 ldi r17, 0x20 ; 32 + 6b6: a0 e0 ldi r26, 0x00 ; 0 + 6b8: b0 e2 ldi r27, 0x20 ; 32 + 6ba: e2 e8 ldi r30, 0x82 ; 130 + 6bc: f2 e5 ldi r31, 0x52 ; 82 + 6be: 02 c0 rjmp .+4 ; 0x6c4 <__do_copy_data+0x10> + 6c0: 05 90 lpm r0, Z+ + 6c2: 0d 92 st X+, r0 + 6c4: a2 39 cpi r26, 0x92 ; 146 + 6c6: b1 07 cpc r27, r17 + 6c8: d9 f7 brne .-10 ; 0x6c0 <__do_copy_data+0xc> -0000068a <__do_clear_bss>: - 68a: 26 e2 ldi r18, 0x26 ; 38 - 68c: a2 e9 ldi r26, 0x92 ; 146 - 68e: b0 e2 ldi r27, 0x20 ; 32 - 690: 01 c0 rjmp .+2 ; 0x694 <.do_clear_bss_start> +000006ca <__do_clear_bss>: + 6ca: 2a e2 ldi r18, 0x2A ; 42 + 6cc: a2 e9 ldi r26, 0x92 ; 146 + 6ce: b0 e2 ldi r27, 0x20 ; 32 + 6d0: 01 c0 rjmp .+2 ; 0x6d4 <.do_clear_bss_start> -00000692 <.do_clear_bss_loop>: - 692: 1d 92 st X+, r1 +000006d2 <.do_clear_bss_loop>: + 6d2: 1d 92 st X+, r1 -00000694 <.do_clear_bss_start>: - 694: ad 39 cpi r26, 0x9D ; 157 - 696: b2 07 cpc r27, r18 - 698: e1 f7 brne .-8 ; 0x692 <.do_clear_bss_loop> - 69a: 03 d0 rcall .+6 ; 0x6a2
- 69c: 0c 94 76 27 jmp 0x4eec ; 0x4eec <_exit> +000006d4 <.do_clear_bss_start>: + 6d4: ad 39 cpi r26, 0x9D ; 157 + 6d6: b2 07 cpc r27, r18 + 6d8: e1 f7 brne .-8 ; 0x6d2 <.do_clear_bss_loop> + 6da: 03 d0 rcall .+6 ; 0x6e2
+ 6dc: 0c 94 3f 29 jmp 0x527e ; 0x527e <_exit> -000006a0 <__bad_interrupt>: - 6a0: 78 c0 rjmp .+240 ; 0x792 <__vector_default> +000006e0 <__bad_interrupt>: + 6e0: 7c c0 rjmp .+248 ; 0x7da <__vector_default> -000006a2
: +000006e2
: #include "Chameleon-Mini.h" int main(void) { SystemInit(); - 6a2: 7d d0 rcall .+250 ; 0x79e + 6e2: 81 d0 rcall .+258 ; 0x7e6 SettingsLoad(); - 6a4: ae d6 rcall .+3420 ; 0x1402 + 6e4: 0e 94 bb 0b call 0x1776 ; 0x1776 extern uint8_t LEDPulseMask; static inline void LEDInit(void) { LED_PORT.DIRSET = LED_MASK; - 6a6: 80 e3 ldi r24, 0x30 ; 48 - 6a8: 80 93 01 06 sts 0x0601, r24 + 6e8: 80 e3 ldi r24, 0x30 ; 48 + 6ea: 80 93 01 06 sts 0x0601, r24 LEDInit(); MemoryInit(); - 6ac: 27 d2 rcall .+1102 ; 0xafc + 6ee: d9 d2 rcall .+1458 ; 0xca2 ConfigurationInit(); - 6ae: 0d d1 rcall .+538 ; 0x8ca + 6f0: 10 d1 rcall .+544 ; 0x912 TerminalInit(); - 6b0: 6d d7 rcall .+3802 ; 0x158c + 6f2: 0e 94 87 0c call 0x190e ; 0x190e RandomInit(); - 6b2: 81 d1 rcall .+770 ; 0x9b6 + 6f6: 83 d1 rcall .+774 ; 0x9fe ButtonInit(); - 6b4: 35 d5 rcall .+2666 ; 0x1120 + 6f8: b1 d6 rcall .+3426 ; 0x145c #define ANTENNA_LEVEL_DENOMINATOR (ANTENNA_LEVEL_SCALE) static inline void AntennaLevelInit(void) { ADCA.CTRLA = ADC_ENABLE_bm; - 6b6: 81 e0 ldi r24, 0x01 ; 1 - 6b8: 80 93 00 02 sts 0x0200, r24 + 6fa: 81 e0 ldi r24, 0x01 ; 1 + 6fc: 80 93 00 02 sts 0x0200, r24 ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc; - 6bc: 10 92 01 02 sts 0x0201, r1 + 700: 10 92 01 02 sts 0x0201, r1 ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm; - 6c0: 92 e0 ldi r25, 0x02 ; 2 - 6c2: 90 93 02 02 sts 0x0202, r25 + 704: 92 e0 ldi r25, 0x02 ; 2 + 706: 90 93 02 02 sts 0x0202, r25 ADCA.PRESCALER = ADC_PRESCALER_DIV32_gc; - 6c6: 93 e0 ldi r25, 0x03 ; 3 - 6c8: 90 93 04 02 sts 0x0204, r25 + 70a: 93 e0 ldi r25, 0x03 ; 3 + 70c: 90 93 04 02 sts 0x0204, r25 ADCA.CH0.CTRL = ADC_CH_INPUTMODE_SINGLEENDED_gc; - 6cc: 80 93 20 02 sts 0x0220, r24 + 710: 80 93 20 02 sts 0x0220, r24 ADCA.CH0.MUXCTRL = ADC_CH_MUXPOS_PIN7_gc; - 6d0: 88 e3 ldi r24, 0x38 ; 56 - 6d2: 80 93 21 02 sts 0x0221, r24 + 714: 88 e3 ldi r24, 0x38 ; 56 + 716: 80 93 21 02 sts 0x0221, r24 AntennaLevelInit(); SystemInterruptInit(); - 6d6: ce d0 rcall .+412 ; 0x874 + 71a: d0 d0 rcall .+416 ; 0x8bc } INLINE bool SystemTick100ms(void) { if (TCE0.INTFLAGS & TC0_OVFIF_bm) { TCE0.INTFLAGS = TC0_OVFIF_bm; - 6d8: c1 e0 ldi r28, 0x01 ; 1 + 71c: c1 e0 ldi r28, 0x01 ; 1 while(1) { TerminalTask(); - 6da: 5d d7 rcall .+3770 ; 0x1596 + 71e: 0e 94 8c 0c call 0x1918 ; 0x1918 INLINE void CodecInit(void) { ActiveConfiguration.CodecInitFunc(); } INLINE void CodecTask(void) { ActiveConfiguration.CodecTaskFunc(); - 6dc: e0 91 eb 20 lds r30, 0x20EB - 6e0: f0 91 ec 20 lds r31, 0x20EC - 6e4: 09 95 icall + 722: e0 91 eb 24 lds r30, 0x24EB + 726: f0 91 ec 24 lds r31, 0x24EC + 72a: 09 95 icall INLINE void ApplicationInit(void) { ActiveConfiguration.ApplicationInitFunc(); } INLINE void ApplicationTask(void) { ActiveConfiguration.ApplicationTaskFunc(); - 6e6: e0 91 f1 20 lds r30, 0x20F1 - 6ea: f0 91 f2 20 lds r31, 0x20F2 - 6ee: 09 95 icall + 72c: e0 91 f1 24 lds r30, 0x24F1 + 730: f0 91 f2 24 lds r31, 0x24F2 + 734: 09 95 icall return RTC.CNT; } INLINE bool SystemTick100ms(void) { if (TCE0.INTFLAGS & TC0_OVFIF_bm) { - 6f0: 80 91 0c 0a lds r24, 0x0A0C - 6f4: 80 ff sbrs r24, 0 - 6f6: f1 cf rjmp .-30 ; 0x6da + 736: 80 91 0c 0a lds r24, 0x0A0C + 73a: 80 ff sbrs r24, 0 + 73c: f0 cf rjmp .-32 ; 0x71e TCE0.INTFLAGS = TC0_OVFIF_bm; - 6f8: c0 93 0c 0a sts 0x0A0C, r28 + 73e: c0 93 0c 0a sts 0x0A0C, r28 CodecTask(); ApplicationTask(); if (SystemTick100ms()) { RandomTick(); - 6fc: 6f d1 rcall .+734 ; 0x9dc + 742: 70 d1 rcall .+736 ; 0xa24 TerminalTick(); - 6fe: 6a d7 rcall .+3796 ; 0x15d4 + 744: 0e 94 ab 0c call 0x1956 ; 0x1956 ButtonTick(); - 700: 16 d5 rcall .+2604 ; 0x112e + 748: 90 d6 rcall .+3360 ; 0x146a LED_PORT.OUTSET = Mask; } static inline void LEDTick(void) { LED_PORT.OUTCLR = LEDPulseMask; - 702: 80 91 93 20 lds r24, 0x2093 - 706: 80 93 06 06 sts 0x0606, r24 + 74a: 80 91 93 24 lds r24, 0x2493 + 74e: 80 93 06 06 sts 0x0606, r24 LEDPulseMask = 0; - 70a: 10 92 93 20 sts 0x2093, r1 - 70e: e5 cf rjmp .-54 ; 0x6da + 752: 10 92 93 24 sts 0x2493, r1 + 756: e3 cf rjmp .-58 ; 0x71e -00000710 : +00000758 : break; } *DescriptorAddress = Address; return Size; } - 710: 29 2f mov r18, r25 - 712: 33 27 eor r19, r19 + 758: 29 2f mov r18, r25 + 75a: 33 27 eor r19, r19 const uint8_t DescriptorNumber = (wValue & 0xFF); const void* Address = NULL; uint16_t Size = NO_DESCRIPTOR; switch (DescriptorType) - 714: 22 30 cpi r18, 0x02 ; 2 - 716: 31 05 cpc r19, r1 - 718: 39 f1 breq .+78 ; 0x768 - 71a: 23 30 cpi r18, 0x03 ; 3 - 71c: 31 05 cpc r19, r1 - 71e: a9 f0 breq .+42 ; 0x74a - 720: 21 30 cpi r18, 0x01 ; 1 - 722: 31 05 cpc r19, r1 - 724: 49 f0 breq .+18 ; 0x738 + 75c: 22 30 cpi r18, 0x02 ; 2 + 75e: 31 05 cpc r19, r1 + 760: 39 f1 breq .+78 ; 0x7b0 + 762: 23 30 cpi r18, 0x03 ; 3 + 764: 31 05 cpc r19, r1 + 766: a9 f0 breq .+42 ; 0x792 + 768: 21 30 cpi r18, 0x01 ; 1 + 76a: 31 05 cpc r19, r1 + 76c: 49 f0 breq .+18 ; 0x780 { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); const void* Address = NULL; uint16_t Size = NO_DESCRIPTOR; - 726: 20 e0 ldi r18, 0x00 ; 0 - 728: 30 e0 ldi r19, 0x00 ; 0 + 76e: 20 e0 ldi r18, 0x00 ; 0 + 770: 30 e0 ldi r19, 0x00 ; 0 const void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); const void* Address = NULL; - 72a: 80 e0 ldi r24, 0x00 ; 0 - 72c: 90 e0 ldi r25, 0x00 ; 0 + 772: 80 e0 ldi r24, 0x00 ; 0 + 774: 90 e0 ldi r25, 0x00 ; 0 } break; } *DescriptorAddress = Address; - 72e: fa 01 movw r30, r20 - 730: 80 83 st Z, r24 - 732: 91 83 std Z+1, r25 ; 0x01 + 776: fa 01 movw r30, r20 + 778: 80 83 st Z, r24 + 77a: 91 83 std Z+1, r25 ; 0x01 return Size; } - 734: c9 01 movw r24, r18 - 736: 08 95 ret + 77c: c9 01 movw r24, r18 + 77e: 08 95 ret switch (DescriptorType) { case DTYPE_Device: Address = &DeviceDescriptor; Size = sizeof(USB_Descriptor_Device_t); - 738: 22 e1 ldi r18, 0x12 ; 18 - 73a: 30 e0 ldi r19, 0x00 ; 0 + 780: 22 e1 ldi r18, 0x12 ; 18 + 782: 30 e0 ldi r19, 0x00 ; 0 uint16_t Size = NO_DESCRIPTOR; switch (DescriptorType) { case DTYPE_Device: Address = &DeviceDescriptor; - 73c: 86 e7 ldi r24, 0x76 ; 118 - 73e: 92 e0 ldi r25, 0x02 ; 2 + 784: 86 e7 ldi r24, 0x76 ; 118 + 786: 92 e0 ldi r25, 0x02 ; 2 } break; } *DescriptorAddress = Address; - 740: fa 01 movw r30, r20 - 742: 80 83 st Z, r24 - 744: 91 83 std Z+1, r25 ; 0x01 + 788: fa 01 movw r30, r20 + 78a: 80 83 st Z, r24 + 78c: 91 83 std Z+1, r25 ; 0x01 return Size; } - 746: c9 01 movw r24, r18 - 748: 08 95 ret - 74a: 99 27 eor r25, r25 + 78e: c9 01 movw r24, r18 + 790: 08 95 ret + 792: 99 27 eor r25, r25 case DTYPE_Configuration: Address = &ConfigurationDescriptor; Size = sizeof(USB_Descriptor_Configuration_t); break; case DTYPE_String: switch (DescriptorNumber) - 74c: 81 30 cpi r24, 0x01 ; 1 - 74e: 91 05 cpc r25, r1 - 750: a1 f0 breq .+40 ; 0x77a - 752: 82 30 cpi r24, 0x02 ; 2 - 754: 91 05 cpc r25, r1 - 756: b9 f0 breq .+46 ; 0x786 - 758: 89 2b or r24, r25 - 75a: 29 f7 brne .-54 ; 0x726 + 794: 81 30 cpi r24, 0x01 ; 1 + 796: 91 05 cpc r25, r1 + 798: a1 f0 breq .+40 ; 0x7c2 + 79a: 82 30 cpi r24, 0x02 ; 2 + 79c: 91 05 cpc r25, r1 + 79e: b9 f0 breq .+46 ; 0x7ce + 7a0: 89 2b or r24, r25 + 7a2: 29 f7 brne .-54 ; 0x76e { case 0x00: Address = &LanguageString; Size = pgm_read_byte(&LanguageString.Header.Size); - 75c: e4 e3 ldi r30, 0x34 ; 52 - 75e: f2 e0 ldi r31, 0x02 ; 2 - 760: 24 91 lpm r18, Z - 762: 30 e0 ldi r19, 0x00 ; 0 + 7a4: e4 e3 ldi r30, 0x34 ; 52 + 7a6: f2 e0 ldi r31, 0x02 ; 2 + 7a8: 24 91 lpm r18, Z + 7aa: 30 e0 ldi r19, 0x00 ; 0 break; case DTYPE_String: switch (DescriptorNumber) { case 0x00: Address = &LanguageString; - 764: cf 01 movw r24, r30 + 7ac: cf 01 movw r24, r30 Size = pgm_read_byte(&LanguageString.Header.Size); break; - 766: e3 cf rjmp .-58 ; 0x72e + 7ae: e3 cf rjmp .-58 ; 0x776 Address = &DeviceDescriptor; Size = sizeof(USB_Descriptor_Device_t); break; case DTYPE_Configuration: Address = &ConfigurationDescriptor; Size = sizeof(USB_Descriptor_Configuration_t); - 768: 2e e3 ldi r18, 0x3E ; 62 - 76a: 30 e0 ldi r19, 0x00 ; 0 + 7b0: 2e e3 ldi r18, 0x3E ; 62 + 7b2: 30 e0 ldi r19, 0x00 ; 0 case DTYPE_Device: Address = &DeviceDescriptor; Size = sizeof(USB_Descriptor_Device_t); break; case DTYPE_Configuration: Address = &ConfigurationDescriptor; - 76c: 88 e3 ldi r24, 0x38 ; 56 - 76e: 92 e0 ldi r25, 0x02 ; 2 + 7b4: 88 e3 ldi r24, 0x38 ; 56 + 7b6: 92 e0 ldi r25, 0x02 ; 2 } break; } *DescriptorAddress = Address; - 770: fa 01 movw r30, r20 - 772: 80 83 st Z, r24 - 774: 91 83 std Z+1, r25 ; 0x01 + 7b8: fa 01 movw r30, r20 + 7ba: 80 83 st Z, r24 + 7bc: 91 83 std Z+1, r25 ; 0x01 return Size; } - 776: c9 01 movw r24, r18 - 778: 08 95 ret + 7be: c9 01 movw r24, r18 + 7c0: 08 95 ret Address = &LanguageString; Size = pgm_read_byte(&LanguageString.Header.Size); break; case 0x01: Address = &ManufacturerString; Size = pgm_read_byte(&ManufacturerString.Header.Size); - 77a: ea e1 ldi r30, 0x1A ; 26 - 77c: f2 e0 ldi r31, 0x02 ; 2 - 77e: 24 91 lpm r18, Z - 780: 30 e0 ldi r19, 0x00 ; 0 + 7c2: ea e1 ldi r30, 0x1A ; 26 + 7c4: f2 e0 ldi r31, 0x02 ; 2 + 7c6: 24 91 lpm r18, Z + 7c8: 30 e0 ldi r19, 0x00 ; 0 case 0x00: Address = &LanguageString; Size = pgm_read_byte(&LanguageString.Header.Size); break; case 0x01: Address = &ManufacturerString; - 782: cf 01 movw r24, r30 + 7ca: cf 01 movw r24, r30 Size = pgm_read_byte(&ManufacturerString.Header.Size); break; - 784: d4 cf rjmp .-88 ; 0x72e + 7cc: d4 cf rjmp .-88 ; 0x776 case 0x02: Address = &ProductString; Size = pgm_read_byte(&ProductString.Header.Size); - 786: ec ef ldi r30, 0xFC ; 252 - 788: f1 e0 ldi r31, 0x01 ; 1 - 78a: 24 91 lpm r18, Z - 78c: 30 e0 ldi r19, 0x00 ; 0 + 7ce: ec ef ldi r30, 0xFC ; 252 + 7d0: f1 e0 ldi r31, 0x01 ; 1 + 7d2: 24 91 lpm r18, Z + 7d4: 30 e0 ldi r19, 0x00 ; 0 case 0x01: Address = &ManufacturerString; Size = pgm_read_byte(&ManufacturerString.Header.Size); break; case 0x02: Address = &ProductString; - 78e: cf 01 movw r24, r30 + 7d6: cf 01 movw r24, r30 Size = pgm_read_byte(&ProductString.Header.Size); break; - 790: ce cf rjmp .-100 ; 0x72e + 7d8: ce cf rjmp .-100 ; 0x776 -00000792 <__vector_default>: +000007da <__vector_default>: #include "System.h" #include "LED.h" ISR(BADISR_vect) { - 792: 1f 92 push r1 - 794: 0f 92 push r0 - 796: 0f b6 in r0, 0x3f ; 63 - 798: 0f 92 push r0 - 79a: 11 24 eor r1, r1 - 79c: ff cf rjmp .-2 ; 0x79c <__vector_default+0xa> + 7da: 1f 92 push r1 + 7dc: 0f 92 push r0 + 7de: 0f b6 in r0, 0x3f ; 63 + 7e0: 0f 92 push r0 + 7e2: 11 24 eor r1, r1 + 7e4: ff cf rjmp .-2 ; 0x7e4 <__vector_default+0xa> -0000079e : +000007e6 : while(1); } void SystemInit(void) { if (RST.STATUS & RST_WDRF_bm) { - 79e: 80 91 78 00 lds r24, 0x0078 - 7a2: 83 ff sbrs r24, 3 - 7a4: 0a c0 rjmp .+20 ; 0x7ba + 7e6: 80 91 78 00 lds r24, 0x0078 + 7ea: 83 ff sbrs r24, 3 + 7ec: 0a c0 rjmp .+20 ; 0x802 /* On Watchdog reset clear WDRF bit, disable watchdog * and jump into bootloader */ RST.STATUS = RST_WDRF_bm; - 7a6: 88 e0 ldi r24, 0x08 ; 8 - 7a8: 80 93 78 00 sts 0x0078, r24 + 7ee: 88 e0 ldi r24, 0x08 ; 8 + 7f0: 80 93 78 00 sts 0x0078, r24 CCP = CCP_IOREG_gc; - 7ac: 88 ed ldi r24, 0xD8 ; 216 - 7ae: 84 bf out 0x34, r24 ; 52 + 7f4: 88 ed ldi r24, 0xD8 ; 216 + 7f6: 84 bf out 0x34, r24 ; 52 WDT.CTRL = WDT_CEN_bm; - 7b0: 81 e0 ldi r24, 0x01 ; 1 - 7b2: 80 93 80 00 sts 0x0080, r24 + 7f8: 81 e0 ldi r24, 0x01 ; 1 + 7fa: 80 93 80 00 sts 0x0080, r24 asm volatile ("jmp %0"::"i" (BOOT_SECTION_START + 0x1FC)); - 7b6: fd 95 fe c0 jmp 0x7f81fc ; 0x7f81fc <__data_load_end+0x7f327a> + 7fe: fd 95 fe c0 jmp 0x7f81fc ; 0x7f81fc <__data_load_end+0x7f2ee8> } /* 32MHz system clock using internal RC and 32K DFLL*/ OSC.CTRL |= OSC_RC32MEN_bm | OSC_RC32KEN_bm; - 7ba: 80 91 50 00 lds r24, 0x0050 - 7be: 86 60 ori r24, 0x06 ; 6 - 7c0: 80 93 50 00 sts 0x0050, r24 + 802: 80 91 50 00 lds r24, 0x0050 + 806: 86 60 ori r24, 0x06 ; 6 + 808: 80 93 50 00 sts 0x0050, r24 while(!(OSC.STATUS & OSC_RC32MRDY_bm)) - 7c4: 80 91 51 00 lds r24, 0x0051 - 7c8: 81 ff sbrs r24, 1 - 7ca: fc cf rjmp .-8 ; 0x7c4 + 80c: 80 91 51 00 lds r24, 0x0051 + 810: 81 ff sbrs r24, 1 + 812: fc cf rjmp .-8 ; 0x80c ; while(!(OSC.STATUS & OSC_RC32KRDY_bm)) - 7cc: 80 91 51 00 lds r24, 0x0051 - 7d0: 82 ff sbrs r24, 2 - 7d2: fc cf rjmp .-8 ; 0x7cc + 814: 80 91 51 00 lds r24, 0x0051 + 818: 82 ff sbrs r24, 2 + 81a: fc cf rjmp .-8 ; 0x814 ; OSC.DFLLCTRL = OSC_RC32MCREF_RC32K_gc; - 7d4: 10 92 56 00 sts 0x0056, r1 + 81c: 10 92 56 00 sts 0x0056, r1 DFLLRC32M.CTRL = DFLL_ENABLE_bm; - 7d8: 21 e0 ldi r18, 0x01 ; 1 - 7da: 20 93 60 00 sts 0x0060, r18 + 820: 21 e0 ldi r18, 0x01 ; 1 + 822: 20 93 60 00 sts 0x0060, r18 CCP = CCP_IOREG_gc; - 7de: 88 ed ldi r24, 0xD8 ; 216 - 7e0: 84 bf out 0x34, r24 ; 52 + 826: 88 ed ldi r24, 0xD8 ; 216 + 828: 84 bf out 0x34, r24 ; 52 CLK.CTRL = CLK_SCLKSEL_RC32M_gc; - 7e2: 20 93 40 00 sts 0x0040, r18 + 82a: 20 93 40 00 sts 0x0040, r18 /* Use TCE0 as system tick */ TCE0.PER = F_CPU / 256 / SYSTEM_TICK_FREQ - 1; - 7e6: 83 ed ldi r24, 0xD3 ; 211 - 7e8: 90 e3 ldi r25, 0x30 ; 48 - 7ea: 80 93 26 0a sts 0x0A26, r24 - 7ee: 90 93 27 0a sts 0x0A27, r25 + 82e: 83 ed ldi r24, 0xD3 ; 211 + 830: 90 e3 ldi r25, 0x30 ; 48 + 832: 80 93 26 0a sts 0x0A26, r24 + 836: 90 93 27 0a sts 0x0A27, r25 TCE0.CTRLA = TC_CLKSEL_DIV256_gc; - 7f2: 86 e0 ldi r24, 0x06 ; 6 - 7f4: 80 93 00 0a sts 0x0A00, r24 + 83a: 86 e0 ldi r24, 0x06 ; 6 + 83c: 80 93 00 0a sts 0x0A00, r24 /* Enable RTC with roughly 1kHz clock */ CLK.RTCCTRL = CLK_RTCSRC_ULP_gc | CLK_RTCEN_bm; - 7f8: 20 93 43 00 sts 0x0043, r18 + 840: 20 93 43 00 sts 0x0043, r18 RTC.CTRL = RTC_PRESCALER_DIV1_gc; - 7fc: 20 93 00 04 sts 0x0400, r18 + 844: 20 93 00 04 sts 0x0400, r18 /* Enable EEPROM data memory mapping */ NVM.CTRLB |= NVM_EEMAPEN_bm; - 800: 80 91 cc 01 lds r24, 0x01CC - 804: 88 60 ori r24, 0x08 ; 8 - 806: 80 93 cc 01 sts 0x01CC, r24 - 80a: 08 95 ret + 848: 80 91 cc 01 lds r24, 0x01CC + 84c: 88 60 ori r24, 0x08 ; 8 + 84e: 80 93 cc 01 sts 0x01CC, r24 + 852: 08 95 ret -0000080c : +00000854 : } void SystemReset(void) { CCP = CCP_IOREG_gc; - 80c: 88 ed ldi r24, 0xD8 ; 216 - 80e: 84 bf out 0x34, r24 ; 52 + 854: 88 ed ldi r24, 0xD8 ; 216 + 856: 84 bf out 0x34, r24 ; 52 RST.CTRL = RST_SWRST_bm; - 810: 81 e0 ldi r24, 0x01 ; 1 - 812: e8 e7 ldi r30, 0x78 ; 120 - 814: f0 e0 ldi r31, 0x00 ; 0 - 816: 81 83 std Z+1, r24 ; 0x01 - 818: 08 95 ret + 858: 81 e0 ldi r24, 0x01 ; 1 + 85a: e8 e7 ldi r30, 0x78 ; 120 + 85c: f0 e0 ldi r31, 0x00 ; 0 + 85e: 81 83 std Z+1, r24 ; 0x01 + 860: 08 95 ret -0000081a : +00000862 : } void SystemEnterBootloader(void) { /* Use Watchdog timer to reset into bootloader. */ CCP = CCP_IOREG_gc; - 81a: 88 ed ldi r24, 0xD8 ; 216 - 81c: 84 bf out 0x34, r24 ; 52 + 862: 88 ed ldi r24, 0xD8 ; 216 + 864: 84 bf out 0x34, r24 ; 52 WDT.CTRL = WDT_PER_500CLK_gc | WDT_ENABLE_bm | WDT_CEN_bm; - 81e: 8b e1 ldi r24, 0x1B ; 27 - 820: 80 93 80 00 sts 0x0080, r24 - 824: 08 95 ret + 866: 8b e1 ldi r24, 0x1B ; 27 + 868: 80 93 80 00 sts 0x0080, r24 + 86c: 08 95 ret -00000826 : +0000086e : void SystemStartUSBClock(void) { /* 48MHz USB Clock using 12MHz XTAL */ OSC.XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; - 826: 8b ec ldi r24, 0xCB ; 203 - 828: 80 93 52 00 sts 0x0052, r24 + 86e: 8b ec ldi r24, 0xCB ; 203 + 870: 80 93 52 00 sts 0x0052, r24 OSC.CTRL |= OSC_XOSCEN_bm; - 82c: 80 91 50 00 lds r24, 0x0050 - 830: 88 60 ori r24, 0x08 ; 8 - 832: 80 93 50 00 sts 0x0050, r24 + 874: 80 91 50 00 lds r24, 0x0050 + 878: 88 60 ori r24, 0x08 ; 8 + 87a: 80 93 50 00 sts 0x0050, r24 while(!(OSC.STATUS & OSC_XOSCRDY_bm)) - 836: 80 91 51 00 lds r24, 0x0051 - 83a: 83 ff sbrs r24, 3 - 83c: fc cf rjmp .-8 ; 0x836 + 87e: 80 91 51 00 lds r24, 0x0051 + 882: 83 ff sbrs r24, 3 + 884: fc cf rjmp .-8 ; 0x87e ; OSC.PLLCTRL = OSC_PLLSRC_XOSC_gc | (4 << OSC_PLLFAC_gp); - 83e: 84 ec ldi r24, 0xC4 ; 196 - 840: 80 93 55 00 sts 0x0055, r24 + 886: 84 ec ldi r24, 0xC4 ; 196 + 888: 80 93 55 00 sts 0x0055, r24 OSC.CTRL |= OSC_PLLEN_bm; - 844: 80 91 50 00 lds r24, 0x0050 - 848: 80 61 ori r24, 0x10 ; 16 - 84a: 80 93 50 00 sts 0x0050, r24 + 88c: 80 91 50 00 lds r24, 0x0050 + 890: 80 61 ori r24, 0x10 ; 16 + 892: 80 93 50 00 sts 0x0050, r24 while(!(OSC.STATUS & OSC_PLLRDY_bm)) - 84e: 80 91 51 00 lds r24, 0x0051 - 852: 84 ff sbrs r24, 4 - 854: fc cf rjmp .-8 ; 0x84e + 896: 80 91 51 00 lds r24, 0x0051 + 89a: 84 ff sbrs r24, 4 + 89c: fc cf rjmp .-8 ; 0x896 ; } - 856: 08 95 ret + 89e: 08 95 ret -00000858 : +000008a0 : void SystemStopUSBClock(void) { /* Disable USB Clock to minimize power consumption */ CLK.USBCTRL &= ~CLK_USBSEN_bm; - 858: e0 e4 ldi r30, 0x40 ; 64 - 85a: f0 e0 ldi r31, 0x00 ; 0 - 85c: 84 81 ldd r24, Z+4 ; 0x04 - 85e: 8e 7f andi r24, 0xFE ; 254 - 860: 84 83 std Z+4, r24 ; 0x04 + 8a0: e0 e4 ldi r30, 0x40 ; 64 + 8a2: f0 e0 ldi r31, 0x00 ; 0 + 8a4: 84 81 ldd r24, Z+4 ; 0x04 + 8a6: 8e 7f andi r24, 0xFE ; 254 + 8a8: 84 83 std Z+4, r24 ; 0x04 OSC.CTRL &= ~OSC_PLLEN_bm; - 862: e0 e5 ldi r30, 0x50 ; 80 - 864: f0 e0 ldi r31, 0x00 ; 0 - 866: 80 81 ld r24, Z - 868: 8f 7e andi r24, 0xEF ; 239 - 86a: 80 83 st Z, r24 + 8aa: e0 e5 ldi r30, 0x50 ; 80 + 8ac: f0 e0 ldi r31, 0x00 ; 0 + 8ae: 80 81 ld r24, Z + 8b0: 8f 7e andi r24, 0xEF ; 239 + 8b2: 80 83 st Z, r24 OSC.CTRL &= ~OSC_XOSCEN_bm; - 86c: 80 81 ld r24, Z - 86e: 87 7f andi r24, 0xF7 ; 247 - 870: 80 83 st Z, r24 - 872: 08 95 ret + 8b4: 80 81 ld r24, Z + 8b6: 87 7f andi r24, 0xF7 ; 247 + 8b8: 80 83 st Z, r24 + 8ba: 08 95 ret -00000874 : +000008bc : } void SystemInterruptInit(void) { /* Enable all interrupt levels */ PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; - 874: 87 e0 ldi r24, 0x07 ; 7 - 876: e0 ea ldi r30, 0xA0 ; 160 - 878: f0 e0 ldi r31, 0x00 ; 0 - 87a: 82 83 std Z+2, r24 ; 0x02 + 8bc: 87 e0 ldi r24, 0x07 ; 7 + 8be: e0 ea ldi r30, 0xA0 ; 160 + 8c0: f0 e0 ldi r31, 0x00 ; 0 + 8c2: 82 83 std Z+2, r24 ; 0x02 sei(); - 87c: 78 94 sei - 87e: 08 95 ret + 8c4: 78 94 sei + 8c6: 08 95 ret -00000880 : +000008c8 : /* Include all Codecs and Applications */ #include "Codec/Codec.h" #include "Application/Application.h" static void CodecInitDummy(void) { } - 880: 08 95 ret + 8c8: 08 95 ret -00000882 : +000008ca : static void CodecTaskDummy(void) { } - 882: 08 95 ret + 8ca: 08 95 ret -00000884 : +000008cc : static void ApplicationInitDummy(void) {} - 884: 08 95 ret + 8cc: 08 95 ret -00000886 : +000008ce : static void ApplicationResetDummy(void) {} - 886: 08 95 ret + 8ce: 08 95 ret -00000888 : +000008d0 : static void ApplicationTaskDummy(void) {} - 888: 08 95 ret + 8d0: 08 95 ret -0000088a : +000008d2 : static uint16_t ApplicationProcessDummy(uint8_t* ByteBuffer, uint16_t ByteCount) { return 0; } - 88a: 80 e0 ldi r24, 0x00 ; 0 - 88c: 90 e0 ldi r25, 0x00 ; 0 - 88e: 08 95 ret + 8d2: 80 e0 ldi r24, 0x00 ; 0 + 8d4: 90 e0 ldi r25, 0x00 ; 0 + 8d6: 08 95 ret -00000890 : +000008d8 : static void ApplicationGetUidDummy(ConfigurationUidType Uid) { } - 890: 08 95 ret + 8d8: 08 95 ret -00000892 : +000008da : static void ApplicationSetUidDummy(ConfigurationUidType Uid) { } - 892: 08 95 ret + 8da: 08 95 ret -00000894 : +000008dc : ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); } void ConfigurationSetById( ConfigurationEnum Configuration ) { GlobalSettings.ActiveSettingPtr->Configuration = Configuration; - 894: e0 91 fe 20 lds r30, 0x20FE - 898: f0 91 ff 20 lds r31, 0x20FF - 89c: 81 83 std Z+1, r24 ; 0x01 + 8dc: e0 91 fe 24 lds r30, 0x24FE + 8e0: f0 91 ff 24 lds r31, 0x24FF + 8e4: 81 83 std Z+1, r24 ; 0x01 /* Copy struct from PROGMEM to RAM */ memcpy_P(&ActiveConfiguration, &ConfigurationTable[Configuration], sizeof(ConfigurationType)); - 89e: 95 e2 ldi r25, 0x25 ; 37 - 8a0: 89 9f mul r24, r25 - 8a2: b0 01 movw r22, r0 - 8a4: 11 24 eor r1, r1 - 8a6: 68 57 subi r22, 0x78 ; 120 - 8a8: 7d 4f sbci r23, 0xFD ; 253 + 8e6: 95 e2 ldi r25, 0x25 ; 37 + 8e8: 89 9f mul r24, r25 + 8ea: b0 01 movw r22, r0 + 8ec: 11 24 eor r1, r1 + 8ee: 68 57 subi r22, 0x78 ; 120 + 8f0: 7d 4f sbci r23, 0xFD ; 253 void ConfigurationSetById( ConfigurationEnum Configuration ) { GlobalSettings.ActiveSettingPtr->Configuration = Configuration; /* Copy struct from PROGMEM to RAM */ memcpy_P(&ActiveConfiguration, - 8aa: 45 e2 ldi r20, 0x25 ; 37 - 8ac: 50 e0 ldi r21, 0x00 ; 0 - 8ae: 88 ed ldi r24, 0xD8 ; 216 - 8b0: 90 e2 ldi r25, 0x20 ; 32 - 8b2: 0e 94 0d 24 call 0x481a ; 0x481a + 8f2: 45 e2 ldi r20, 0x25 ; 37 + 8f4: 50 e0 ldi r21, 0x00 ; 0 + 8f6: 88 ed ldi r24, 0xD8 ; 216 + 8f8: 94 e2 ldi r25, 0x24 ; 36 + 8fa: 0e 94 d6 25 call 0x4bac ; 0x4bac /* Applications */ #include "MifareClassic.h" /* Function wrappers */ INLINE void ApplicationInit(void) { ActiveConfiguration.ApplicationInitFunc(); - 8b6: e0 91 ed 20 lds r30, 0x20ED - 8ba: f0 91 ee 20 lds r31, 0x20EE - 8be: 09 95 icall + 8fe: e0 91 ed 24 lds r30, 0x24ED + 902: f0 91 ee 24 lds r31, 0x24EE + 906: 09 95 icall #define CODEC_CARRIER_FREQ 13560000 extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE]; INLINE void CodecInit(void) { ActiveConfiguration.CodecInitFunc(); - 8c0: e0 91 e9 20 lds r30, 0x20E9 - 8c4: f0 91 ea 20 lds r31, 0x20EA - 8c8: 09 94 ijmp + 908: e0 91 e9 24 lds r30, 0x24E9 + 90c: f0 91 ea 24 lds r31, 0x24EA + 910: 09 94 ijmp -000008ca : +00000912 : ConfigurationType ActiveConfiguration; void ConfigurationInit(void) { ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); - 8ca: e0 91 fe 20 lds r30, 0x20FE - 8ce: f0 91 ff 20 lds r31, 0x20FF - 8d2: 81 81 ldd r24, Z+1 ; 0x01 - 8d4: df cf rjmp .-66 ; 0x894 + 912: e0 91 fe 24 lds r30, 0x24FE + 916: f0 91 ff 24 lds r31, 0x24FF + 91a: 81 81 ldd r24, Z+1 ; 0x01 + 91c: df cf rjmp .-66 ; 0x8dc -000008d6 : +0000091e : ApplicationInit(); CodecInit(); } bool ConfigurationSetByName(const char* ConfigurationName) { - 8d6: 0f 93 push r16 - 8d8: 1f 93 push r17 - 8da: cf 93 push r28 - 8dc: df 93 push r29 - 8de: 20 e0 ldi r18, 0x00 ; 0 - 8e0: 30 e0 ldi r19, 0x00 ; 0 + 91e: 0f 93 push r16 + 920: 1f 93 push r17 + 922: cf 93 push r28 + 924: df 93 push r29 + 926: 20 e0 ldi r18, 0x00 ; 0 + 928: 30 e0 ldi r19, 0x00 ; 0 uint8_t i; /* Loop through table trying to find the configuration */ for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; - 8e2: 15 e2 ldi r17, 0x25 ; 37 + 92a: 15 e2 ldi r17, 0x25 ; 37 ApplicationInit(); CodecInit(); } bool ConfigurationSetByName(const char* ConfigurationName) - 8e4: ac 01 movw r20, r24 - 8e6: 4f 5f subi r20, 0xFF ; 255 - 8e8: 5f 4f sbci r21, 0xFF ; 255 - 8ea: 02 2f mov r16, r18 + 92c: ac 01 movw r20, r24 + 92e: 4f 5f subi r20, 0xFF ; 255 + 930: 5f 4f sbci r21, 0xFF ; 255 + 932: 02 2f mov r16, r18 { uint8_t i; /* Loop through table trying to find the configuration */ for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; - 8ec: 12 9f mul r17, r18 - 8ee: f0 01 movw r30, r0 - 8f0: 13 9f mul r17, r19 - 8f2: f0 0d add r31, r0 - 8f4: 11 24 eor r1, r1 - 8f6: e7 57 subi r30, 0x77 ; 119 - 8f8: fd 4f sbci r31, 0xFD ; 253 + 934: 12 9f mul r17, r18 + 936: f0 01 movw r30, r0 + 938: 13 9f mul r17, r19 + 93a: f0 0d add r31, r0 + 93c: 11 24 eor r1, r1 + 93e: e7 57 subi r30, 0x77 ; 119 + 940: fd 4f sbci r31, 0xFD ; 253 const char* pRequestedConfigName = ConfigurationName; bool StringMismatch = false; char c = pgm_read_byte(pTableConfigName); - 8fa: 64 91 lpm r22, Z + 942: 64 91 lpm r22, Z /* Try to keep running until both strings end at the same point */ while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - 8fc: 61 11 cpse r22, r1 - 8fe: 0f c0 rjmp .+30 ; 0x91e + 944: 61 11 cpse r22, r1 + 946: 0f c0 rjmp .+30 ; 0x966 uint8_t i; /* Loop through table trying to find the configuration */ for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; const char* pRequestedConfigName = ConfigurationName; - 900: ec 01 movw r28, r24 + 948: ec 01 movw r28, r24 bool StringMismatch = false; char c = pgm_read_byte(pTableConfigName); /* Try to keep running until both strings end at the same point */ while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - 902: 68 81 ld r22, Y - 904: 66 23 and r22, r22 - 906: 01 f1 breq .+64 ; 0x948 - 908: 2f 5f subi r18, 0xFF ; 255 - 90a: 3f 4f sbci r19, 0xFF ; 255 + 94a: 68 81 ld r22, Y + 94c: 66 23 and r22, r22 + 94e: 01 f1 breq .+64 ; 0x990 + 950: 2f 5f subi r18, 0xFF ; 255 + 952: 3f 4f sbci r19, 0xFF ; 255 bool ConfigurationSetByName(const char* ConfigurationName) { uint8_t i; /* Loop through table trying to find the configuration */ for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { - 90c: 23 30 cpi r18, 0x03 ; 3 - 90e: 31 05 cpc r19, r1 - 910: 61 f7 brne .-40 ; 0x8ea + 954: 23 30 cpi r18, 0x03 ; 3 + 956: 31 05 cpc r19, r1 + 958: 61 f7 brne .-40 ; 0x932 ConfigurationSetById(i); return true; } } return false; - 912: 80 e0 ldi r24, 0x00 ; 0 + 95a: 80 e0 ldi r24, 0x00 ; 0 } - 914: df 91 pop r29 - 916: cf 91 pop r28 - 918: 1f 91 pop r17 - 91a: 0f 91 pop r16 - 91c: 08 95 ret + 95c: df 91 pop r29 + 95e: cf 91 pop r28 + 960: 1f 91 pop r17 + 962: 0f 91 pop r16 + 964: 08 95 ret bool StringMismatch = false; char c = pgm_read_byte(pTableConfigName); /* Try to keep running until both strings end at the same point */ while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { if ( (c == '\0') || (*pRequestedConfigName == '\0') ) { - 91e: dc 01 movw r26, r24 - 920: 7c 91 ld r23, X - 922: 77 23 and r23, r23 - 924: 89 f3 breq .-30 ; 0x908 + 966: dc 01 movw r26, r24 + 968: 7c 91 ld r23, X + 96a: 77 23 and r23, r23 + 96c: 89 f3 breq .-30 ; 0x950 /* One String ended before the other did -> unequal length */ StringMismatch = true; break; } if (c != *pRequestedConfigName) { - 926: 67 13 cpse r22, r23 - 928: ef cf rjmp .-34 ; 0x908 + 96e: 67 13 cpse r22, r23 + 970: ef cf rjmp .-34 ; 0x950 ApplicationInit(); CodecInit(); } bool ConfigurationSetByName(const char* ConfigurationName) - 92a: da 01 movw r26, r20 - 92c: 05 c0 rjmp .+10 ; 0x938 + 972: da 01 movw r26, r20 + 974: 05 c0 rjmp .+10 ; 0x980 bool StringMismatch = false; char c = pgm_read_byte(pTableConfigName); /* Try to keep running until both strings end at the same point */ while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { if ( (c == '\0') || (*pRequestedConfigName == '\0') ) { - 92e: 7d 91 ld r23, X+ - 930: 77 23 and r23, r23 - 932: 51 f3 breq .-44 ; 0x908 + 976: 7d 91 ld r23, X+ + 978: 77 23 and r23, r23 + 97a: 51 f3 breq .-44 ; 0x950 /* One String ended before the other did -> unequal length */ StringMismatch = true; break; } if (c != *pRequestedConfigName) { - 934: 76 13 cpse r23, r22 - 936: e8 cf rjmp .-48 ; 0x908 + 97c: 76 13 cpse r23, r22 + 97e: e8 cf rjmp .-48 ; 0x950 StringMismatch = true; break; } /* Proceed to next character */ pTableConfigName++; - 938: 31 96 adiw r30, 0x01 ; 1 + 980: 31 96 adiw r30, 0x01 ; 1 pRequestedConfigName++; - 93a: ed 01 movw r28, r26 + 982: ed 01 movw r28, r26 c = pgm_read_byte(pTableConfigName); - 93c: 64 91 lpm r22, Z + 984: 64 91 lpm r22, Z const char* pRequestedConfigName = ConfigurationName; bool StringMismatch = false; char c = pgm_read_byte(pTableConfigName); /* Try to keep running until both strings end at the same point */ while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - 93e: 61 11 cpse r22, r1 - 940: f6 cf rjmp .-20 ; 0x92e - 942: 68 81 ld r22, Y - 944: 61 11 cpse r22, r1 - 946: e0 cf rjmp .-64 ; 0x908 + 986: 61 11 cpse r22, r1 + 988: f6 cf rjmp .-20 ; 0x976 + 98a: 68 81 ld r22, Y + 98c: 61 11 cpse r22, r1 + 98e: e0 cf rjmp .-64 ; 0x950 c = pgm_read_byte(pTableConfigName); } if (!StringMismatch) { /* Configuration found */ ConfigurationSetById(i); - 948: 80 2f mov r24, r16 - 94a: a4 df rcall .-184 ; 0x894 + 990: 80 2f mov r24, r16 + 992: a4 df rcall .-184 ; 0x8dc return true; - 94c: 81 e0 ldi r24, 0x01 ; 1 + 994: 81 e0 ldi r24, 0x01 ; 1 } } return false; } - 94e: df 91 pop r29 - 950: cf 91 pop r28 - 952: 1f 91 pop r17 - 954: 0f 91 pop r16 - 956: 08 95 ret + 996: df 91 pop r29 + 998: cf 91 pop r28 + 99a: 1f 91 pop r17 + 99c: 0f 91 pop r16 + 99e: 08 95 ret -00000958 : +000009a0 : void ConfigurationGetList(char* ConfigListOut, uint16_t ByteCount) { - 958: cf 93 push r28 - 95a: df 93 push r29 - 95c: ec 01 movw r28, r24 + 9a0: cf 93 push r28 + 9a2: df 93 push r29 + 9a4: ec 01 movw r28, r24 uint8_t i; /* Account for '\0' */ ByteCount--; - 95e: 61 50 subi r22, 0x01 ; 1 - 960: 71 09 sbc r23, r1 - 962: 80 e0 ldi r24, 0x00 ; 0 - 964: 90 e0 ldi r25, 0x00 ; 0 + 9a6: 61 50 subi r22, 0x01 ; 1 + 9a8: 71 09 sbc r23, r1 + 9aa: 80 e0 ldi r24, 0x00 ; 0 + 9ac: 90 e0 ldi r25, 0x00 ; 0 for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { - 978: 24 91 lpm r18, Z - 97a: 22 23 and r18, r18 - 97c: 81 f0 breq .+32 ; 0x99e - 97e: 61 31 cpi r22, 0x11 ; 17 - 980: 71 05 cpc r23, r1 - 982: 68 f0 brcs .+26 ; 0x99e - 984: de 01 movw r26, r28 - 986: 03 c0 rjmp .+6 ; 0x98e - 988: 60 31 cpi r22, 0x10 ; 16 - 98a: 71 05 cpc r23, r1 - 98c: 41 f0 breq .+16 ; 0x99e + 9c0: 24 91 lpm r18, Z + 9c2: 22 23 and r18, r18 + 9c4: 81 f0 breq .+32 ; 0x9e6 + 9c6: 61 31 cpi r22, 0x11 ; 17 + 9c8: 71 05 cpc r23, r1 + 9ca: 68 f0 brcs .+26 ; 0x9e6 + 9cc: de 01 movw r26, r28 + 9ce: 03 c0 rjmp .+6 ; 0x9d6 + 9d0: 60 31 cpi r22, 0x10 ; 16 + 9d2: 71 05 cpc r23, r1 + 9d4: 41 f0 breq .+16 ; 0x9e6 /* While not end-of-string and enough buffer to * put a complete configuration name */ *ConfigListOut++ = c; - 98e: 2d 93 st X+, r18 - 990: ed 01 movw r28, r26 + 9d6: 2d 93 st X+, r18 + 9d8: ed 01 movw r28, r26 ConfigName++; - 992: 31 96 adiw r30, 0x01 ; 1 + 9da: 31 96 adiw r30, 0x01 ; 1 ByteCount--; - 994: 61 50 subi r22, 0x01 ; 1 - 996: 71 09 sbc r23, r1 + 9dc: 61 50 subi r22, 0x01 ; 1 + 9de: 71 09 sbc r23, r1 for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { - 998: 24 91 lpm r18, Z - 99a: 21 11 cpse r18, r1 - 99c: f5 cf rjmp .-22 ; 0x988 + 9e0: 24 91 lpm r18, Z + 9e2: 21 11 cpse r18, r1 + 9e4: f5 cf rjmp .-22 ; 0x9d0 *ConfigListOut++ = c; ConfigName++; ByteCount--; } if ( i < (CONFIG_COUNT - 1) ) { - 99e: 82 30 cpi r24, 0x02 ; 2 - 9a0: 91 05 cpc r25, r1 - 9a2: 21 f4 brne .+8 ; 0x9ac + 9e6: 82 30 cpi r24, 0x02 ; 2 + 9e8: 91 05 cpc r25, r1 + 9ea: 21 f4 brne .+8 ; 0x9f4 *ConfigListOut++ = ','; ByteCount--; } } *ConfigListOut = '\0'; - 9a4: 18 82 st Y, r1 + 9ec: 18 82 st Y, r1 } - 9a6: df 91 pop r29 - 9a8: cf 91 pop r28 - 9aa: 08 95 ret + 9ee: df 91 pop r29 + 9f0: cf 91 pop r28 + 9f2: 08 95 ret ByteCount--; } if ( i < (CONFIG_COUNT - 1) ) { /* No comma on last configuration */ *ConfigListOut++ = ','; - 9ac: 49 93 st Y+, r20 + 9f4: 49 93 st Y+, r20 ByteCount--; - 9ae: 61 50 subi r22, 0x01 ; 1 - 9b0: 71 09 sbc r23, r1 - 9b2: 01 96 adiw r24, 0x01 ; 1 - 9b4: da cf rjmp .-76 ; 0x96a + 9f6: 61 50 subi r22, 0x01 ; 1 + 9f8: 71 09 sbc r23, r1 + 9fa: 01 96 adiw r24, 0x01 ; 1 + 9fc: da cf rjmp .-76 ; 0x9b2 -000009b6 : +000009fe : #include "Random.h" #include void RandomInit(void) { - 9b6: 08 95 ret + 9fe: 08 95 ret -000009b8 : +00000a00 : } uint8_t RandomGetByte(void) { return rand() & 0xFF; - 9b8: 0c 94 ff 23 jmp 0x47fe ; 0x47fe + a00: 0c 94 c8 25 jmp 0x4b90 ; 0x4b90 } - 9bc: 08 95 ret + a04: 08 95 ret -000009be : +00000a06 : void RandomGetBuffer(void* Buffer, uint8_t ByteCount) { - 9be: 1f 93 push r17 - 9c0: cf 93 push r28 - 9c2: df 93 push r29 - 9c4: 16 2f mov r17, r22 + a06: 1f 93 push r17 + a08: cf 93 push r28 + a0a: df 93 push r29 + a0c: 16 2f mov r17, r22 uint8_t* BufferPtr = (uint8_t*) Buffer; while(ByteCount--) { - 9c6: 66 23 and r22, r22 - 9c8: 29 f0 breq .+10 ; 0x9d4 - 9ca: ec 01 movw r28, r24 + a0e: 66 23 and r22, r22 + a10: 29 f0 breq .+10 ; 0xa1c + a12: ec 01 movw r28, r24 *BufferPtr++ = RandomGetByte(); - 9cc: f5 df rcall .-22 ; 0x9b8 - 9ce: 89 93 st Y+, r24 - 9d0: 11 50 subi r17, 0x01 ; 1 + a14: f5 df rcall .-22 ; 0xa00 + a16: 89 93 st Y+, r24 + a18: 11 50 subi r17, 0x01 ; 1 void RandomGetBuffer(void* Buffer, uint8_t ByteCount) { uint8_t* BufferPtr = (uint8_t*) Buffer; while(ByteCount--) { - 9d2: e1 f7 brne .-8 ; 0x9cc + a1a: e1 f7 brne .-8 ; 0xa14 *BufferPtr++ = RandomGetByte(); } } - 9d4: df 91 pop r29 - 9d6: cf 91 pop r28 - 9d8: 1f 91 pop r17 - 9da: 08 95 ret + a1c: df 91 pop r29 + a1e: cf 91 pop r28 + a20: 1f 91 pop r17 + a22: 08 95 ret -000009dc : +00000a24 : void RandomTick(void) { rand(); - 9dc: 0e 94 ff 23 call 0x47fe ; 0x47fe + a24: 0e 94 c8 25 call 0x4b90 ; 0x4b90 rand(); - 9e0: 0e 94 ff 23 call 0x47fe ; 0x47fe + a28: 0e 94 c8 25 call 0x4b90 ; 0x4b90 rand(); - 9e4: 0e 94 ff 23 call 0x47fe ; 0x47fe + a2c: 0e 94 c8 25 call 0x4b90 ; 0x4b90 rand(); - 9e8: 0c 94 ff 23 jmp 0x47fe ; 0x47fe + a30: 0c 94 c8 25 jmp 0x4b90 ; 0x4b90 -000009ec : +00000a34 : */ #include "Common.h" uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) { - 9ec: cf 93 push r28 - 9ee: df 93 push r29 - 9f0: dc 01 movw r26, r24 + a34: cf 93 push r28 + a36: df 93 push r29 + a38: dc 01 movw r26, r24 uint8_t* ByteBuffer = (uint8_t*) Buffer; uint16_t CharCount = 0; /* Account for '\0' at the end */ MaxChars--; - 9f2: 61 50 subi r22, 0x01 ; 1 - 9f4: 71 09 sbc r23, r1 + a3a: 61 50 subi r22, 0x01 ; 1 + a3c: 71 09 sbc r23, r1 while( (ByteCount > 0) && (MaxChars >= 2) ) { - 9f6: 21 15 cp r18, r1 - 9f8: 31 05 cpc r19, r1 - 9fa: 99 f1 breq .+102 ; 0xa62 - 9fc: 62 30 cpi r22, 0x02 ; 2 - 9fe: 71 05 cpc r23, r1 - a00: 80 f1 brcs .+96 ; 0xa62 - a02: fa 01 movw r30, r20 + a3e: 21 15 cp r18, r1 + a40: 31 05 cpc r19, r1 + a42: 99 f1 breq .+102 ; 0xaaa + a44: 62 30 cpi r22, 0x02 ; 2 + a46: 71 05 cpc r23, r1 + a48: 80 f1 brcs .+96 ; 0xaaa + a4a: fa 01 movw r30, r20 * policies, either expressed or implied, of the ORIGINAL AUTHORS. */ #include "Common.h" uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) - a04: 24 0f add r18, r20 - a06: 35 1f adc r19, r21 - a08: 21 50 subi r18, 0x01 ; 1 - a0a: 31 09 sbc r19, r1 + a4c: 24 0f add r18, r20 + a4e: 35 1f adc r19, r21 + a50: 21 50 subi r18, 0x01 ; 1 + a52: 31 09 sbc r19, r1 { uint8_t* ByteBuffer = (uint8_t*) Buffer; uint16_t CharCount = 0; - a0c: 40 e0 ldi r20, 0x00 ; 0 - a0e: 50 e0 ldi r21, 0x00 ; 0 - a10: 17 c0 rjmp .+46 ; 0xa40 + a54: 40 e0 ldi r20, 0x00 ; 0 + a56: 50 e0 ldi r21, 0x00 ; 0 + a58: 17 c0 rjmp .+46 ; 0xa88 MaxChars--; while( (ByteCount > 0) && (MaxChars >= 2) ) { uint8_t Byte = *ByteBuffer; HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); - a12: d0 5d subi r29, 0xD0 ; 208 - a14: dc 93 st X, r29 + a5a: d0 5d subi r29, 0xD0 ; 208 + a5c: dc 93 st X, r29 HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); - a16: cf 70 andi r28, 0x0F ; 15 - a18: 8c 2f mov r24, r28 - a1a: 90 e0 ldi r25, 0x00 ; 0 - a1c: 0a 97 sbiw r24, 0x0a ; 10 - a1e: fc f4 brge .+62 ; 0xa5e - a20: c0 5d subi r28, 0xD0 ; 208 - a22: 11 96 adiw r26, 0x01 ; 1 - a24: cc 93 st X, r28 - a26: 11 97 sbiw r26, 0x01 ; 1 + a5e: cf 70 andi r28, 0x0F ; 15 + a60: 8c 2f mov r24, r28 + a62: 90 e0 ldi r25, 0x00 ; 0 + a64: 0a 97 sbiw r24, 0x0a ; 10 + a66: fc f4 brge .+62 ; 0xaa6 + a68: c0 5d subi r28, 0xD0 ; 208 + a6a: 11 96 adiw r26, 0x01 ; 1 + a6c: cc 93 st X, r28 + a6e: 11 97 sbiw r26, 0x01 ; 1 HexOut += 2; - a28: 12 96 adiw r26, 0x02 ; 2 + a70: 12 96 adiw r26, 0x02 ; 2 MaxChars -= 2; - a2a: 62 50 subi r22, 0x02 ; 2 - a2c: 71 09 sbc r23, r1 + a72: 62 50 subi r22, 0x02 ; 2 + a74: 71 09 sbc r23, r1 CharCount += 2; - a2e: 4e 5f subi r20, 0xFE ; 254 - a30: 5f 4f sbci r21, 0xFF ; 255 + a76: 4e 5f subi r20, 0xFE ; 254 + a78: 5f 4f sbci r21, 0xFF ; 255 uint16_t CharCount = 0; /* Account for '\0' at the end */ MaxChars--; while( (ByteCount > 0) && (MaxChars >= 2) ) { - a32: e2 17 cp r30, r18 - a34: f3 07 cpc r31, r19 - a36: b9 f0 breq .+46 ; 0xa66 - a38: 31 96 adiw r30, 0x01 ; 1 - a3a: 62 30 cpi r22, 0x02 ; 2 - a3c: 71 05 cpc r23, r1 - a3e: 98 f0 brcs .+38 ; 0xa66 + a7a: e2 17 cp r30, r18 + a7c: f3 07 cpc r31, r19 + a7e: b9 f0 breq .+46 ; 0xaae + a80: 31 96 adiw r30, 0x01 ; 1 + a82: 62 30 cpi r22, 0x02 ; 2 + a84: 71 05 cpc r23, r1 + a86: 98 f0 brcs .+38 ; 0xaae uint8_t Byte = *ByteBuffer; - a40: c0 81 ld r28, Z + a88: c0 81 ld r28, Z HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); - a42: dc 2f mov r29, r28 - a44: d2 95 swap r29 - a46: df 70 andi r29, 0x0F ; 15 - a48: 8d 2f mov r24, r29 - a4a: 90 e0 ldi r25, 0x00 ; 0 - a4c: 0a 97 sbiw r24, 0x0a ; 10 - a4e: 0c f3 brlt .-62 ; 0xa12 - a50: d9 5c subi r29, 0xC9 ; 201 - a52: dc 93 st X, r29 + a8a: dc 2f mov r29, r28 + a8c: d2 95 swap r29 + a8e: df 70 andi r29, 0x0F ; 15 + a90: 8d 2f mov r24, r29 + a92: 90 e0 ldi r25, 0x00 ; 0 + a94: 0a 97 sbiw r24, 0x0a ; 10 + a96: 0c f3 brlt .-62 ; 0xa5a + a98: d9 5c subi r29, 0xC9 ; 201 + a9a: dc 93 st X, r29 HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); - a54: cf 70 andi r28, 0x0F ; 15 - a56: 8c 2f mov r24, r28 - a58: 90 e0 ldi r25, 0x00 ; 0 - a5a: 0a 97 sbiw r24, 0x0a ; 10 - a5c: 0c f3 brlt .-62 ; 0xa20 - a5e: c9 5c subi r28, 0xC9 ; 201 - a60: e0 cf rjmp .-64 ; 0xa22 + a9c: cf 70 andi r28, 0x0F ; 15 + a9e: 8c 2f mov r24, r28 + aa0: 90 e0 ldi r25, 0x00 ; 0 + aa2: 0a 97 sbiw r24, 0x0a ; 10 + aa4: 0c f3 brlt .-62 ; 0xa68 + aa6: c9 5c subi r28, 0xC9 ; 201 + aa8: e0 cf rjmp .-64 ; 0xa6a #include "Common.h" uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) { uint8_t* ByteBuffer = (uint8_t*) Buffer; uint16_t CharCount = 0; - a62: 40 e0 ldi r20, 0x00 ; 0 - a64: 50 e0 ldi r21, 0x00 ; 0 + aaa: 40 e0 ldi r20, 0x00 ; 0 + aac: 50 e0 ldi r21, 0x00 ; 0 CharCount += 2; ByteBuffer++; ByteCount -= 1; } *HexOut = '\0'; - a66: 1c 92 st X, r1 + aae: 1c 92 st X, r1 return CharCount; } - a68: ca 01 movw r24, r20 - a6a: df 91 pop r29 - a6c: cf 91 pop r28 - a6e: 08 95 ret + ab0: ca 01 movw r24, r20 + ab2: df 91 pop r29 + ab4: cf 91 pop r28 + ab6: 08 95 ret -00000a70 : +00000ab8 : uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) { - a70: fa 01 movw r30, r20 + ab8: fa 01 movw r30, r20 uint8_t* ByteBuffer = (uint8_t*) Buffer; uint16_t ByteCount = 0; while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - a72: 40 81 ld r20, Z - a74: 44 23 and r20, r20 - a76: f1 f1 breq .+124 ; 0xaf4 - a78: 51 81 ldd r21, Z+1 ; 0x01 - a7a: 55 23 and r21, r21 - a7c: d9 f1 breq .+118 ; 0xaf4 - a7e: 61 15 cp r22, r1 - a80: 71 05 cpc r23, r1 - a82: c1 f1 breq .+112 ; 0xaf4 - a84: dc 01 movw r26, r24 - a86: 20 e0 ldi r18, 0x00 ; 0 - a88: 30 e0 ldi r19, 0x00 ; 0 - a8a: 13 c0 rjmp .+38 ; 0xab2 + aba: 40 81 ld r20, Z + abc: 44 23 and r20, r20 + abe: f1 f1 breq .+124 ; 0xb3c + ac0: 51 81 ldd r21, Z+1 ; 0x01 + ac2: 55 23 and r21, r21 + ac4: d9 f1 breq .+118 ; 0xb3c + ac6: 61 15 cp r22, r1 + ac8: 71 05 cpc r23, r1 + aca: c1 f1 breq .+112 ; 0xb3c + acc: dc 01 movw r26, r24 + ace: 20 e0 ldi r18, 0x00 ; 0 + ad0: 30 e0 ldi r19, 0x00 ; 0 + ad2: 13 c0 rjmp .+38 ; 0xafa if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { uint8_t Byte = 0; Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; - a8c: 42 95 swap r20 - a8e: 40 7f andi r20, 0xF0 ; 240 - Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; - a90: 51 34 cpi r21, 0x41 ; 65 - a92: 28 f5 brcc .+74 ; 0xade - a94: 58 2f mov r21, r24 - a96: 45 2b or r20, r21 - - *ByteBuffer = Byte; - a98: 4d 93 st X+, r20 - - ByteBuffer++; - MaxBytes--; - ByteCount++; - a9a: 2f 5f subi r18, 0xFF ; 255 - a9c: 3f 4f sbci r19, 0xFF ; 255 - HexIn += 2; - a9e: 32 96 adiw r30, 0x02 ; 2 -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - aa0: 40 81 ld r20, Z - aa2: 44 23 and r20, r20 - aa4: 29 f1 breq .+74 ; 0xaf0 - aa6: 51 81 ldd r21, Z+1 ; 0x01 - aa8: 55 23 and r21, r21 - aaa: 21 f1 breq .+72 ; 0xaf4 - aac: 62 17 cp r22, r18 - aae: 73 07 cpc r23, r19 - ab0: f9 f0 breq .+62 ; 0xaf0 - if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { - ab2: 84 2f mov r24, r20 - ab4: 80 53 subi r24, 0x30 ; 48 - ab6: 8a 30 cpi r24, 0x0A ; 10 - ab8: 18 f0 brcs .+6 ; 0xac0 - aba: 81 51 subi r24, 0x11 ; 17 - abc: 86 30 cpi r24, 0x06 ; 6 - abe: d0 f4 brcc .+52 ; 0xaf4 - ac0: 85 2f mov r24, r21 - ac2: 80 53 subi r24, 0x30 ; 48 - ac4: 8a 30 cpi r24, 0x0A ; 10 - ac6: 20 f0 brcs .+8 ; 0xad0 - ac8: 95 2f mov r25, r21 - aca: 91 54 subi r25, 0x41 ; 65 - acc: 96 30 cpi r25, 0x06 ; 6 - ace: 90 f4 brcc .+36 ; 0xaf4 - uint8_t Byte = 0; - - Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; - ad0: 41 34 cpi r20, 0x41 ; 65 - ad2: e0 f2 brcs .-72 ; 0xa8c ad4: 42 95 swap r20 ad6: 40 7f andi r20, 0xF0 ; 240 - ad8: 40 57 subi r20, 0x70 ; 112 Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; - ada: 51 34 cpi r21, 0x41 ; 65 - adc: d8 f2 brcs .-74 ; 0xa94 - ade: 57 53 subi r21, 0x37 ; 55 - ae0: 45 2b or r20, r21 + ad8: 51 34 cpi r21, 0x41 ; 65 + ada: 28 f5 brcc .+74 ; 0xb26 + adc: 58 2f mov r21, r24 + ade: 45 2b or r20, r21 *ByteBuffer = Byte; - ae2: 4d 93 st X+, r20 + ae0: 4d 93 st X+, r20 ByteBuffer++; MaxBytes--; ByteCount++; - ae4: 2f 5f subi r18, 0xFF ; 255 - ae6: 3f 4f sbci r19, 0xFF ; 255 + ae2: 2f 5f subi r18, 0xFF ; 255 + ae4: 3f 4f sbci r19, 0xFF ; 255 HexIn += 2; - ae8: 32 96 adiw r30, 0x02 ; 2 + ae6: 32 96 adiw r30, 0x02 ; 2 uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) { uint8_t* ByteBuffer = (uint8_t*) Buffer; uint16_t ByteCount = 0; while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - aea: 40 81 ld r20, Z - aec: 41 11 cpse r20, r1 - aee: db cf rjmp .-74 ; 0xaa6 + ae8: 40 81 ld r20, Z + aea: 44 23 and r20, r20 + aec: 29 f1 breq .+74 ; 0xb38 + aee: 51 81 ldd r21, Z+1 ; 0x01 + af0: 55 23 and r21, r21 + af2: 21 f1 breq .+72 ; 0xb3c + af4: 62 17 cp r22, r18 + af6: 73 07 cpc r23, r19 + af8: f9 f0 breq .+62 ; 0xb38 + if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { + afa: 84 2f mov r24, r20 + afc: 80 53 subi r24, 0x30 ; 48 + afe: 8a 30 cpi r24, 0x0A ; 10 + b00: 18 f0 brcs .+6 ; 0xb08 + b02: 81 51 subi r24, 0x11 ; 17 + b04: 86 30 cpi r24, 0x06 ; 6 + b06: d0 f4 brcc .+52 ; 0xb3c + b08: 85 2f mov r24, r21 + b0a: 80 53 subi r24, 0x30 ; 48 + b0c: 8a 30 cpi r24, 0x0A ; 10 + b0e: 20 f0 brcs .+8 ; 0xb18 + b10: 95 2f mov r25, r21 + b12: 91 54 subi r25, 0x41 ; 65 + b14: 96 30 cpi r25, 0x06 ; 6 + b16: 90 f4 brcc .+36 ; 0xb3c + uint8_t Byte = 0; + + Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; + b18: 41 34 cpi r20, 0x41 ; 65 + b1a: e0 f2 brcs .-72 ; 0xad4 + b1c: 42 95 swap r20 + b1e: 40 7f andi r20, 0xF0 ; 240 + b20: 40 57 subi r20, 0x70 ; 112 + Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; + b22: 51 34 cpi r21, 0x41 ; 65 + b24: d8 f2 brcs .-74 ; 0xadc + b26: 57 53 subi r21, 0x37 ; 55 + b28: 45 2b or r20, r21 + + *ByteBuffer = Byte; + b2a: 4d 93 st X+, r20 + + ByteBuffer++; + MaxBytes--; + ByteCount++; + b2c: 2f 5f subi r18, 0xFF ; 255 + b2e: 3f 4f sbci r19, 0xFF ; 255 + HexIn += 2; + b30: 32 96 adiw r30, 0x02 ; 2 +uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t ByteCount = 0; + + while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { + b32: 40 81 ld r20, Z + b34: 41 11 cpse r20, r1 + b36: db cf rjmp .-74 ; 0xaee /* Odd number of characters */ return 0; } return ByteCount; } - af0: c9 01 movw r24, r18 - af2: 08 95 ret + b38: c9 01 movw r24, r18 + b3a: 08 95 ret } } if ( (HexIn[0] != '\0') && (HexIn[1] == '\0') ) { /* Odd number of characters */ return 0; - af4: 20 e0 ldi r18, 0x00 ; 0 - af6: 30 e0 ldi r19, 0x00 ; 0 + b3c: 20 e0 ldi r18, 0x00 ; 0 + b3e: 30 e0 ldi r19, 0x00 ; 0 } return ByteCount; } - af8: c9 01 movw r24, r18 - afa: 08 95 ret + b40: c9 01 movw r24, r18 + b42: 08 95 ret -00000afc : - SPITransferByte( 0 ); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +00000b44 : + MemoryRecall(); } -void MemoryInit(void) -{ - afc: cf 93 push r28 - afe: df 93 push r29 - b00: 00 d0 rcall .+0 ; 0xb02 - b02: 00 d0 rcall .+0 ; 0xb04 - b04: cd b7 in r28, 0x3d ; 61 - b06: de b7 in r29, 0x3e ; 62 - /* Configure MEMORY_FLASH_USART for SPI master mode 0 with maximum clock frequency */ - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - b08: 80 e1 ldi r24, 0x10 ; 16 - b0a: 80 93 65 06 sts 0x0665, r24 - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_SCK; - b0e: 92 e0 ldi r25, 0x02 ; 2 - b10: 90 93 66 06 sts 0x0666, r25 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_MOSI; - b14: 98 e0 ldi r25, 0x08 ; 8 - b16: 90 93 65 06 sts 0x0665, r25 - - MEMORY_FLASH_PORT.DIRSET = MEMORY_FLASH_SCK | MEMORY_FLASH_MOSI | MEMORY_FLASH_CS; - b1a: 9a e1 ldi r25, 0x1A ; 26 - b1c: 90 93 61 06 sts 0x0661, r25 - - MEMORY_FLASH_USART.BAUDCTRLA = 0; - b20: 10 92 a6 09 sts 0x09A6, r1 - MEMORY_FLASH_USART.BAUDCTRLB = 0; - b24: 10 92 a7 09 sts 0x09A7, r1 - MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; - b28: 90 ec ldi r25, 0xC0 ; 192 - b2a: 90 93 a5 09 sts 0x09A5, r25 - MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; - b2e: 98 e1 ldi r25, 0x18 ; 24 - b30: 90 93 a4 09 sts 0x09A4, r25 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - b34: 80 93 66 06 sts 0x0666, r24 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - b38: 87 ed ldi r24, 0xD7 ; 215 - b3a: 80 93 a0 09 sts 0x09A0, r24 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - b3e: 80 91 a1 09 lds r24, 0x09A1 - b42: 86 ff sbrs r24, 6 - b44: fc cf rjmp .-8 ; 0xb3e - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - b46: 80 e4 ldi r24, 0x40 ; 64 - b48: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - b4c: 80 91 a0 09 lds r24, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - b50: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - b54: 80 91 a1 09 lds r24, 0x09A1 - b58: 86 ff sbrs r24, 6 - b5a: fc cf rjmp .-8 ; 0xb54 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - b5c: 80 e4 ldi r24, 0x40 ; 64 - b5e: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - b62: 80 91 a0 09 lds r24, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - b66: 90 e1 ldi r25, 0x10 ; 16 - b68: 90 93 65 06 sts 0x0665, r25 - MEMORY_FLASH_USART.BAUDCTRLB = 0; - MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; - MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; - - - if ( !(FlashReadStatusRegister() & FLASH_STATUS_REG_PAGESIZE_BIT) ) { - b6c: 80 fd sbrc r24, 0 - b6e: 3e c0 rjmp .+124 ; 0xbec - return !(FlashReadStatusRegister() & FLASH_STATUS_REG_READY_BIT); -} - -INLINE void FlashConfigurePageSize(void) -{ - uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; - b70: 8d e3 ldi r24, 0x3D ; 61 - b72: 89 83 std Y+1, r24 ; 0x01 - b74: 8a e2 ldi r24, 0x2A ; 42 - b76: 8a 83 std Y+2, r24 ; 0x02 - b78: 80 e8 ldi r24, 0x80 ; 128 - b7a: 8b 83 std Y+3, r24 ; 0x03 - b7c: 86 ea ldi r24, 0xA6 ; 166 - b7e: 8c 83 std Y+4, r24 ; 0x04 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - b80: 20 e1 ldi r18, 0x10 ; 16 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - b82: 37 ed ldi r19, 0xD7 ; 215 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - b84: 90 e4 ldi r25, 0x40 ; 64 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - b86: 20 93 66 06 sts 0x0666, r18 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - b8a: 30 93 a0 09 sts 0x09A0, r19 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - b8e: 80 91 a1 09 lds r24, 0x09A1 - b92: 86 ff sbrs r24, 6 - b94: fc cf rjmp .-8 ; 0xb8e - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - b96: 90 93 a1 09 sts 0x09A1, r25 - - return MEMORY_FLASH_USART.DATA; - b9a: 80 91 a0 09 lds r24, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - b9e: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ba2: 80 91 a1 09 lds r24, 0x09A1 - ba6: 86 ff sbrs r24, 6 - ba8: fc cf rjmp .-8 ; 0xba2 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - baa: 90 93 a1 09 sts 0x09A1, r25 - - return MEMORY_FLASH_USART.DATA; - bae: 80 91 a0 09 lds r24, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - bb2: 20 93 65 06 sts 0x0665, r18 - -INLINE void FlashConfigurePageSize(void) -{ - uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; - - while(FlashIsBusy()); - bb6: 87 ff sbrs r24, 7 - bb8: e6 cf rjmp .-52 ; 0xb86 - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - bba: 80 e1 ldi r24, 0x10 ; 16 - bbc: 80 93 66 06 sts 0x0666, r24 - } -} - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - bc0: fe 01 movw r30, r28 - bc2: 31 96 adiw r30, 0x01 ; 1 - bc4: ce 01 movw r24, r28 - bc6: 05 96 adiw r24, 0x05 ; 5 - - while(ByteCount-- > 0) { - MEMORY_FLASH_USART.DATA = *ByteBuffer++; - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - bc8: 30 e4 ldi r19, 0x40 ; 64 -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - MEMORY_FLASH_USART.DATA = *ByteBuffer++; - bca: 21 91 ld r18, Z+ - bcc: 20 93 a0 09 sts 0x09A0, r18 - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - bd0: 20 91 a1 09 lds r18, 0x09A1 - bd4: 26 ff sbrs r18, 6 - bd6: fc cf rjmp .-8 ; 0xbd0 - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - bd8: 30 93 a1 09 sts 0x09A1, r19 - MEMORY_FLASH_USART.DATA; /* Flush Buffer */ - bdc: 20 91 a0 09 lds r18, 0x09A0 - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - be0: e8 17 cp r30, r24 - be2: f9 07 cpc r31, r25 - be4: 91 f7 brne .-28 ; 0xbca - - while(FlashIsBusy()); - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPIWriteBlock(Sequence, sizeof(Sequence)); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - be6: 80 e1 ldi r24, 0x10 ; 16 - be8: 80 93 65 06 sts 0x0665, r24 - - if ( !(FlashReadStatusRegister() & FLASH_STATUS_REG_PAGESIZE_BIT) ) { - /* Configure for 256 byte Dataflash if not already done. */ - FlashConfigurePageSize(); - } -} - bec: 24 96 adiw r28, 0x04 ; 4 - bee: cd bf out 0x3d, r28 ; 61 - bf0: de bf out 0x3e, r29 ; 62 - bf2: df 91 pop r29 - bf4: cf 91 pop r28 - bf6: 08 95 ret - -00000bf8 : - void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) { - bf8: cf 92 push r12 - bfa: df 92 push r13 - bfc: ef 92 push r14 - bfe: ff 92 push r15 - c00: 0f 93 push r16 - c02: 1f 93 push r17 - c04: fc 01 movw r30, r24 - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - c06: 00 91 fd 20 lds r16, 0x20FD - c0a: 10 e0 ldi r17, 0x00 ; 0 - c0c: 20 e0 ldi r18, 0x00 ; 0 - c0e: 30 e0 ldi r19, 0x00 ; 0 - c10: 98 01 movw r18, r16 - c12: 11 27 eor r17, r17 - c14: 00 27 eor r16, r16 - c16: 06 0f add r16, r22 - c18: 17 1f adc r17, r23 - c1a: 21 1d adc r18, r1 - c1c: 31 1d adc r19, r1 + uint8_t* SrcPtr = &Memory[Address]; + b44: fb 01 movw r30, r22 + b46: ee 56 subi r30, 0x6E ; 110 + b48: ff 4d sbci r31, 0xDF ; 223 + uint8_t* DstPtr = (uint8_t*) Buffer; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + b4a: a0 e0 ldi r26, 0x00 ; 0 + b4c: b4 e0 ldi r27, 0x04 ; 4 + b4e: a6 1b sub r26, r22 + b50: b7 0b sbc r27, r23 + b52: 9a 01 movw r18, r20 + b54: a4 17 cp r26, r20 + b56: b5 07 cpc r27, r21 + b58: 08 f4 brcc .+2 ; 0xb5c + b5a: 9d 01 movw r18, r26 + + while(ByteCount--) { + b5c: 21 15 cp r18, r1 + b5e: 31 05 cpc r19, r1 + b60: 41 f0 breq .+16 ; 0xb72 + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); +} + +void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) + b62: 2e 0f add r18, r30 + b64: 3f 1f adc r19, r31 +{ + uint8_t* SrcPtr = &Memory[Address]; + uint8_t* DstPtr = (uint8_t*) Buffer; + b66: dc 01 movw r26, r24 + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + b68: 81 91 ld r24, Z+ + b6a: 8d 93 st X+, r24 + uint8_t* DstPtr = (uint8_t*) Buffer; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + b6c: e2 17 cp r30, r18 + b6e: f3 07 cpc r31, r19 + b70: d9 f7 brne .-10 ; 0xb68 + b72: 08 95 ret + +00000b74 : +} + +void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) +{ + uint8_t* SrcPtr = (uint8_t*) Buffer; + uint8_t* DstPtr = &Memory[Address]; + b74: db 01 movw r26, r22 + b76: ae 56 subi r26, 0x6E ; 110 + b78: bf 4d sbci r27, 0xDF ; 223 + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + b7a: e0 e0 ldi r30, 0x00 ; 0 + b7c: f4 e0 ldi r31, 0x04 ; 4 + b7e: e6 1b sub r30, r22 + b80: f7 0b sbc r31, r23 + b82: 9a 01 movw r18, r20 + b84: e4 17 cp r30, r20 + b86: f5 07 cpc r31, r21 + b88: 08 f4 brcc .+2 ; 0xb8c + b8a: 9f 01 movw r18, r30 + + while(ByteCount--) { + b8c: 21 15 cp r18, r1 + b8e: 31 05 cpc r19, r1 + b90: 49 f0 breq .+18 ; 0xba4 + b92: fc 01 movw r30, r24 + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + } +} + +void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) + b94: c9 01 movw r24, r18 + b96: 8e 0f add r24, r30 + b98: 9f 1f adc r25, r31 + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + b9a: 21 91 ld r18, Z+ + b9c: 2d 93 st X+, r18 + uint8_t* DstPtr = &Memory[Address]; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + b9e: e8 17 cp r30, r24 + ba0: f9 07 cpc r31, r25 + ba2: d9 f7 brne .-10 ; 0xb9a + ba4: 08 95 ret + +00000ba6 : + *DstPtr++ = *SrcPtr++; + } +} + +void MemoryClear(void) +{ + ba6: e2 e9 ldi r30, 0x92 ; 146 + ba8: f0 e2 ldi r31, 0x20 ; 32 + for (uint16_t i=0; i + Memory[i] = 0; + } +} + bb4: 08 95 ret + +00000bb6 : + +void MemoryRecall(void) +{ + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + bb6: 80 91 fd 24 lds r24, 0x24FD + bba: 90 e0 ldi r25, 0x00 ; 0 + bbc: a0 e0 ldi r26, 0x00 ; 0 + bbe: b0 e0 ldi r27, 0x00 ; 0 + bc0: 4a e0 ldi r20, 0x0A ; 10 + bc2: 88 0f add r24, r24 + bc4: 99 1f adc r25, r25 + bc6: aa 1f adc r26, r26 + bc8: bb 1f adc r27, r27 + bca: 4a 95 dec r20 + bcc: d1 f7 brne .-12 ; 0xbc2 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - c1e: 60 e1 ldi r22, 0x10 ; 16 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + bce: 40 e1 ldi r20, 0x10 ; 16 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - c20: 77 ed ldi r23, 0xD7 ; 215 + bd0: 57 ed ldi r21, 0xD7 ; 215 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c22: 90 e4 ldi r25, 0x40 ; 64 + bd2: 30 e4 ldi r19, 0x40 ; 64 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - c24: 60 93 66 06 sts 0x0666, r22 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + bd4: 40 93 66 06 sts 0x0666, r20 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - c28: 70 93 a0 09 sts 0x09A0, r23 + bd8: 50 93 a0 09 sts 0x09A0, r21 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c2c: 80 91 a1 09 lds r24, 0x09A1 - c30: 86 ff sbrs r24, 6 - c32: fc cf rjmp .-8 ; 0xc2c + bdc: 20 91 a1 09 lds r18, 0x09A1 + be0: 26 ff sbrs r18, 6 + be2: fc cf rjmp .-8 ; 0xbdc MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c34: 90 93 a1 09 sts 0x09A1, r25 + be4: 30 93 a1 09 sts 0x09A1, r19 return MEMORY_FLASH_USART.DATA; - c38: 80 91 a0 09 lds r24, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + be8: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - c3c: 10 92 a0 09 sts 0x09A0, r1 + bec: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c40: 80 91 a1 09 lds r24, 0x09A1 - c44: 86 ff sbrs r24, 6 - c46: fc cf rjmp .-8 ; 0xc40 + bf0: 20 91 a1 09 lds r18, 0x09A1 + bf4: 26 ff sbrs r18, 6 + bf6: fc cf rjmp .-8 ; 0xbf0 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c48: 90 93 a1 09 sts 0x09A1, r25 + bf8: 30 93 a1 09 sts 0x09A1, r19 return MEMORY_FLASH_USART.DATA; - c4c: 80 91 a0 09 lds r24, 0x09A0 + bfc: 20 91 a0 09 lds r18, 0x09A0 uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_STATUS_REG_READ); Register = SPITransferByte(0); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - c50: 60 93 65 06 sts 0x0665, r22 + c00: 40 93 65 06 sts 0x0665, r20 MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } INLINE void FlashRead(void* Buffer, uint32_t Address, uint16_t ByteCount) { while(FlashIsBusy()); - c54: 87 ff sbrs r24, 7 - c56: e6 cf rjmp .-52 ; 0xc24 + c04: 27 ff sbrs r18, 7 + c06: e6 cf rjmp .-52 ; 0xbd4 MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - c58: 80 e1 ldi r24, 0x10 ; 16 - c5a: 80 93 66 06 sts 0x0666, r24 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + c08: 20 e1 ldi r18, 0x10 ; 16 + c0a: 20 93 66 06 sts 0x0666, r18 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - c5e: 83 e0 ldi r24, 0x03 ; 3 - c60: 80 93 a0 09 sts 0x09A0, r24 + c0e: 23 e0 ldi r18, 0x03 ; 3 + c10: 20 93 a0 09 sts 0x09A0, r18 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + c14: 20 91 a1 09 lds r18, 0x09A1 + c18: 26 ff sbrs r18, 6 + c1a: fc cf rjmp .-8 ; 0xc14 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + c1c: 20 e4 ldi r18, 0x40 ; 64 + c1e: 20 93 a1 09 sts 0x09A1, r18 + + return MEMORY_FLASH_USART.DATA; + c22: 20 91 a0 09 lds r18, 0x09A0 +{ + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(0x03); + SPITransferByte( (Address >> 16) & 0xFF ); + c26: ad 01 movw r20, r26 + c28: 66 27 eor r22, r22 + c2a: 77 27 eor r23, r23 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + c2c: 40 93 a0 09 sts 0x09A0, r20 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + c30: 20 91 a1 09 lds r18, 0x09A1 + c34: 26 ff sbrs r18, 6 + c36: fc cf rjmp .-8 ; 0xc30 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + c38: 20 e4 ldi r18, 0x40 ; 64 + c3a: 20 93 a1 09 sts 0x09A1, r18 + + return MEMORY_FLASH_USART.DATA; + c3e: 20 91 a0 09 lds r18, 0x09A0 + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(0x03); + SPITransferByte( (Address >> 16) & 0xFF ); + SPITransferByte( (Address >> 8) & 0xFF ); + c42: 89 2f mov r24, r25 + c44: 9a 2f mov r25, r26 + c46: ab 2f mov r26, r27 + c48: bb 27 eor r27, r27 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + c4a: 80 93 a0 09 sts 0x09A0, r24 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + c4e: 80 91 a1 09 lds r24, 0x09A1 + c52: 86 ff sbrs r24, 6 + c54: fc cf rjmp .-8 ; 0xc4e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + c56: 80 e4 ldi r24, 0x40 ; 64 + c58: 80 93 a1 09 sts 0x09A1, r24 + + return MEMORY_FLASH_USART.DATA; + c5c: 80 91 a0 09 lds r24, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + c60: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); c64: 80 91 a1 09 lds r24, 0x09A1 c68: 86 ff sbrs r24, 6 - c6a: fc cf rjmp .-8 ; 0xc64 + c6a: fc cf rjmp .-8 ; 0xc64 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; c6c: 80 e4 ldi r24, 0x40 ; 64 @@ -2029,11331 +1987,11469 @@ INLINE uint8_t SPITransferByte(uint8_t Data) return MEMORY_FLASH_USART.DATA; c72: 80 91 a0 09 lds r24, 0x09A0 -{ - while(FlashIsBusy()); - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(0x03); - SPITransferByte( (Address >> 16) & 0xFF ); - c76: 69 01 movw r12, r18 - c78: ee 24 eor r14, r14 - c7a: ff 24 eor r15, r15 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c7c: c0 92 a0 09 sts 0x09A0, r12 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c80: 80 91 a1 09 lds r24, 0x09A1 - c84: 86 ff sbrs r24, 6 - c86: fc cf rjmp .-8 ; 0xc80 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c88: 80 e4 ldi r24, 0x40 ; 64 - c8a: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - c8e: 80 91 a0 09 lds r24, 0x09A0 - while(FlashIsBusy()); - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(0x03); - SPITransferByte( (Address >> 16) & 0xFF ); - SPITransferByte( (Address >> 8) & 0xFF ); - c92: c1 2e mov r12, r17 - c94: d2 2e mov r13, r18 - c96: e3 2e mov r14, r19 - c98: ff 24 eor r15, r15 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c9a: c0 92 a0 09 sts 0x09A0, r12 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c9e: 80 91 a1 09 lds r24, 0x09A1 - ca2: 86 ff sbrs r24, 6 - ca4: fc cf rjmp .-8 ; 0xc9e - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ca6: 80 e4 ldi r24, 0x40 ; 64 - ca8: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - cac: 80 91 a0 09 lds r24, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - cb0: 00 93 a0 09 sts 0x09A0, r16 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - cb4: 80 91 a1 09 lds r24, 0x09A1 - cb8: 86 ff sbrs r24, 6 - cba: fc cf rjmp .-8 ; 0xcb4 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - cbc: 80 e4 ldi r24, 0x40 ; 64 - cbe: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - cc2: 80 91 a0 09 lds r24, 0x09A0 - -INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - cc6: 41 15 cp r20, r1 - cc8: 51 05 cpc r21, r1 - cca: 89 f0 breq .+34 ; 0xcee - /* Configure for 256 byte Dataflash if not already done. */ - FlashConfigurePageSize(); - } } -void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) - ccc: 4e 0f add r20, r30 - cce: 5f 1f adc r21, r31 +INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) +{ uint8_t* ByteBuffer = (uint8_t*) Buffer; + c76: e2 e9 ldi r30, 0x92 ; 146 + c78: f0 e2 ldi r31, 0x20 ; 32 while(ByteCount-- > 0) { MEMORY_FLASH_USART.DATA = 0; while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - cd0: 90 e4 ldi r25, 0x40 ; 64 + c7a: 90 e4 ldi r25, 0x40 ; 64 INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) { uint8_t* ByteBuffer = (uint8_t*) Buffer; while(ByteCount-- > 0) { MEMORY_FLASH_USART.DATA = 0; - cd2: 10 92 a0 09 sts 0x09A0, r1 + c7c: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - cd6: 80 91 a1 09 lds r24, 0x09A1 - cda: 86 ff sbrs r24, 6 - cdc: fc cf rjmp .-8 ; 0xcd6 + c80: 80 91 a1 09 lds r24, 0x09A1 + c84: 86 ff sbrs r24, 6 + c86: fc cf rjmp .-8 ; 0xc80 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - cde: 90 93 a1 09 sts 0x09A1, r25 + c88: 90 93 a1 09 sts 0x09A1, r25 *ByteBuffer++ = MEMORY_FLASH_USART.DATA; - ce2: 80 91 a0 09 lds r24, 0x09A0 - ce6: 81 93 st Z+, r24 + c8c: 80 91 a0 09 lds r24, 0x09A0 + c90: 81 93 st Z+, r24 INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) { uint8_t* ByteBuffer = (uint8_t*) Buffer; while(ByteCount-- > 0) { - ce8: e4 17 cp r30, r20 - cea: f5 07 cpc r31, r21 - cec: 91 f7 brne .-28 ; 0xcd2 + c92: 84 e2 ldi r24, 0x24 ; 36 + c94: e2 39 cpi r30, 0x92 ; 146 + c96: f8 07 cpc r31, r24 + c98: 89 f7 brne .-30 ; 0xc7c SPITransferByte(0x03); SPITransferByte( (Address >> 16) & 0xFF ); SPITransferByte( (Address >> 8) & 0xFF ); SPITransferByte( (Address >> 0) & 0xFF ); SPIReadBlock(Buffer, ByteCount); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - cee: 80 e1 ldi r24, 0x10 ; 16 - cf0: 80 93 65 06 sts 0x0665, r24 + c9a: 80 e1 ldi r24, 0x10 ; 16 + c9c: 80 93 65 06 sts 0x0665, r24 + ca0: 08 95 ret -void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) -{ - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - FlashRead(Buffer, FlashAddress, ByteCount); -} - cf4: 1f 91 pop r17 - cf6: 0f 91 pop r16 - cf8: ff 90 pop r15 - cfa: ef 90 pop r14 - cfc: df 90 pop r13 - cfe: cf 90 pop r12 - d00: 08 95 ret - -00000d02 : - -void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) -{ - d02: 4f 92 push r4 - d04: 5f 92 push r5 - d06: 6f 92 push r6 - d08: 7f 92 push r7 - d0a: 8f 92 push r8 - d0c: 9f 92 push r9 - d0e: af 92 push r10 - d10: bf 92 push r11 - d12: cf 92 push r12 - d14: df 92 push r13 - d16: ef 92 push r14 - d18: ff 92 push r15 - d1a: 0f 93 push r16 - d1c: 1f 93 push r17 - d1e: cf 93 push r28 - d20: df 93 push r29 - d22: 9c 01 movw r18, r24 - d24: fa 01 movw r30, r20 - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - d26: 80 91 fd 20 lds r24, 0x20FD - d2a: 90 e0 ldi r25, 0x00 ; 0 - d2c: a0 e0 ldi r26, 0x00 ; 0 - d2e: b0 e0 ldi r27, 0x00 ; 0 - d30: dc 01 movw r26, r24 - d32: 99 27 eor r25, r25 - d34: 88 27 eor r24, r24 - d36: 86 0f add r24, r22 - d38: 97 1f adc r25, r23 - d3a: a1 1d adc r26, r1 - d3c: b1 1d adc r27, r1 +00000ca2 : + SPITransferByte( 0 ); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +void MemoryInit(void) { - while(ByteCount > 0) { - d3e: 30 97 sbiw r30, 0x00 ; 0 - d40: 09 f4 brne .+2 ; 0xd44 - d42: 11 c1 rjmp .+546 ; 0xf66 - uint16_t PageAddress = Address / MEMORY_PAGE_SIZE; - uint8_t ByteAddress = Address % MEMORY_PAGE_SIZE; - uint16_t PageBytes = MIN(MEMORY_PAGE_SIZE - ByteAddress, ByteCount); - d44: e1 2c mov r14, r1 - d46: ff 24 eor r15, r15 - d48: f3 94 inc r15 + ca2: cf 93 push r28 + ca4: df 93 push r29 + ca6: 00 d0 rcall .+0 ; 0xca8 + ca8: 00 d0 rcall .+0 ; 0xcaa + caa: cd b7 in r28, 0x3d ; 61 + cac: de b7 in r29, 0x3e ; 62 + /* Configure MEMORY_FLASH_USART for SPI master mode 0 with maximum clock frequency */ + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + cae: 80 e1 ldi r24, 0x10 ; 16 + cb0: 80 93 65 06 sts 0x0665, r24 + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_SCK; + cb4: 92 e0 ldi r25, 0x02 ; 2 + cb6: 90 93 66 06 sts 0x0666, r25 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_MOSI; + cba: 98 e0 ldi r25, 0x08 ; 8 + cbc: 90 93 65 06 sts 0x0665, r25 + + MEMORY_FLASH_PORT.DIRSET = MEMORY_FLASH_SCK | MEMORY_FLASH_MOSI | MEMORY_FLASH_CS; + cc0: 9a e1 ldi r25, 0x1A ; 26 + cc2: 90 93 61 06 sts 0x0661, r25 + + MEMORY_FLASH_USART.BAUDCTRLA = 0; + cc6: 10 92 a6 09 sts 0x09A6, r1 + MEMORY_FLASH_USART.BAUDCTRLB = 0; + cca: 10 92 a7 09 sts 0x09A7, r1 + MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; + cce: 90 ec ldi r25, 0xC0 ; 192 + cd0: 90 93 a5 09 sts 0x09A5, r25 + MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; + cd4: 98 e1 ldi r25, 0x18 ; 24 + cd6: 90 93 a4 09 sts 0x09A4, r25 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - d4a: 10 e1 ldi r17, 0x10 ; 16 - d4c: c1 2e mov r12, r17 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + cda: 80 93 66 06 sts 0x0666, r24 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - d4e: 07 ed ldi r16, 0xD7 ; 215 - d50: b0 2e mov r11, r16 + cde: 87 ed ldi r24, 0xD7 ; 215 + ce0: 80 93 a0 09 sts 0x09A0, r24 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + ce4: 80 91 a1 09 lds r24, 0x09A1 + ce8: 86 ff sbrs r24, 6 + cea: fc cf rjmp .-8 ; 0xce4 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - d52: 40 e4 ldi r20, 0x40 ; 64 - d54: d4 2e mov r13, r20 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - d56: 50 e1 ldi r21, 0x10 ; 16 - d58: a5 2e mov r10, r21 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - d5a: 67 ed ldi r22, 0xD7 ; 215 - d5c: 96 2e mov r9, r22 - d5e: 73 e5 ldi r23, 0x53 ; 83 - d60: 47 2e mov r4, r23 - d62: c4 e8 ldi r28, 0x84 ; 132 - d64: 5c 2e mov r5, r28 - d66: d3 e8 ldi r29, 0x83 ; 131 - d68: 6d 2e mov r6, r29 -} - -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - uint16_t PageAddress = Address / MEMORY_PAGE_SIZE; - d6a: 49 2f mov r20, r25 - d6c: 5a 2f mov r21, r26 - d6e: 6b 2f mov r22, r27 - d70: 77 27 eor r23, r23 - d72: 85 2e mov r8, r21 - uint8_t ByteAddress = Address % MEMORY_PAGE_SIZE; - d74: d8 2f mov r29, r24 - uint16_t PageBytes = MIN(MEMORY_PAGE_SIZE - ByteAddress, ByteCount); - d76: 87 01 movw r16, r14 - d78: 08 1b sub r16, r24 - d7a: 11 09 sbc r17, r1 - d7c: e0 17 cp r30, r16 - d7e: f1 07 cpc r31, r17 - d80: 08 f4 brcc .+2 ; 0xd84 - d82: 8f 01 movw r16, r30 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - d84: a0 92 66 06 sts 0x0666, r10 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - d88: 90 92 a0 09 sts 0x09A0, r9 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - d8c: c0 91 a1 09 lds r28, 0x09A1 - d90: c6 ff sbrs r28, 6 - d92: fc cf rjmp .-8 ; 0xd8c - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - d94: d0 92 a1 09 sts 0x09A1, r13 + cec: 80 e4 ldi r24, 0x40 ; 64 + cee: 80 93 a1 09 sts 0x09A1, r24 return MEMORY_FLASH_USART.DATA; - d98: c0 91 a0 09 lds r28, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + cf2: 80 91 a0 09 lds r24, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - d9c: 10 92 a0 09 sts 0x09A0, r1 + cf6: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - da0: c0 91 a1 09 lds r28, 0x09A1 - da4: c6 ff sbrs r28, 6 - da6: fc cf rjmp .-8 ; 0xda0 + cfa: 80 91 a1 09 lds r24, 0x09A1 + cfe: 86 ff sbrs r24, 6 + d00: fc cf rjmp .-8 ; 0xcfa MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - da8: d0 92 a1 09 sts 0x09A1, r13 + d02: 80 e4 ldi r24, 0x40 ; 64 + d04: 80 93 a1 09 sts 0x09A1, r24 return MEMORY_FLASH_USART.DATA; - dac: c0 91 a0 09 lds r28, 0x09A0 + d08: 80 91 a0 09 lds r24, 0x09A0 uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_STATUS_REG_READ); Register = SPITransferByte(0); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - db0: c0 92 65 06 sts 0x0665, r12 + d0c: 90 e1 ldi r25, 0x10 ; 16 + d0e: 90 93 65 06 sts 0x0665, r25 + MEMORY_FLASH_USART.BAUDCTRLB = 0; + MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; + MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; + + + if ( !(FlashReadStatusRegister() & FLASH_STATUS_REG_PAGESIZE_BIT) ) { + d12: 80 fd sbrc r24, 0 + d14: 3e c0 rjmp .+124 ; 0xd92 + return !(FlashReadStatusRegister() & FLASH_STATUS_REG_READY_BIT); +} + +INLINE void FlashConfigurePageSize(void) +{ + uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; + d16: 8d e3 ldi r24, 0x3D ; 61 + d18: 89 83 std Y+1, r24 ; 0x01 + d1a: 8a e2 ldi r24, 0x2A ; 42 + d1c: 8a 83 std Y+2, r24 ; 0x02 + d1e: 80 e8 ldi r24, 0x80 ; 128 + d20: 8b 83 std Y+3, r24 ; 0x03 + d22: 86 ea ldi r24, 0xA6 ; 166 + d24: 8c 83 std Y+4, r24 ; 0x04 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + d26: 20 e1 ldi r18, 0x10 ; 16 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + d28: 37 ed ldi r19, 0xD7 ; 215 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + d2a: 90 e4 ldi r25, 0x40 ; 64 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + d2c: 20 93 66 06 sts 0x0666, r18 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + d30: 30 93 a0 09 sts 0x09A0, r19 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + d34: 80 91 a1 09 lds r24, 0x09A1 + d38: 86 ff sbrs r24, 6 + d3a: fc cf rjmp .-8 ; 0xd34 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + d3c: 90 93 a1 09 sts 0x09A1, r25 + + return MEMORY_FLASH_USART.DATA; + d40: 80 91 a0 09 lds r24, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + d44: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + d48: 80 91 a1 09 lds r24, 0x09A1 + d4c: 86 ff sbrs r24, 6 + d4e: fc cf rjmp .-8 ; 0xd48 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + d50: 90 93 a1 09 sts 0x09A1, r25 + + return MEMORY_FLASH_USART.DATA; + d54: 80 91 a0 09 lds r24, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + d58: 20 93 65 06 sts 0x0665, r18 + +INLINE void FlashConfigurePageSize(void) +{ + uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; + + while(FlashIsBusy()); + d5c: 87 ff sbrs r24, 7 + d5e: e6 cf rjmp .-52 ; 0xd2c + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + d60: 80 e1 ldi r24, 0x10 ; 16 + d62: 80 93 66 06 sts 0x0666, r24 + } +} + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + d66: fe 01 movw r30, r28 + d68: 31 96 adiw r30, 0x01 ; 1 + d6a: ce 01 movw r24, r28 + d6c: 05 96 adiw r24, 0x05 ; 5 + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + d6e: 30 e4 ldi r19, 0x40 ; 64 +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + d70: 21 91 ld r18, Z+ + d72: 20 93 a0 09 sts 0x09A0, r18 + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + d76: 20 91 a1 09 lds r18, 0x09A1 + d7a: 26 ff sbrs r18, 6 + d7c: fc cf rjmp .-8 ; 0xd76 + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + d7e: 30 93 a1 09 sts 0x09A1, r19 + MEMORY_FLASH_USART.DATA; /* Flush Buffer */ + d82: 20 91 a0 09 lds r18, 0x09A0 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + d86: e8 17 cp r30, r24 + d88: f9 07 cpc r31, r25 + d8a: 91 f7 brne .-28 ; 0xd70 + + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPIWriteBlock(Sequence, sizeof(Sequence)); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + d8c: 80 e1 ldi r24, 0x10 ; 16 + d8e: 80 93 65 06 sts 0x0665, r24 + FlashConfigurePageSize(); + } + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); +} + d92: 24 96 adiw r28, 0x04 ; 4 + d94: cd bf out 0x3d, r28 ; 61 + d96: de bf out 0x3e, r29 ; 62 + d98: df 91 pop r29 + d9a: cf 91 pop r28 + /* Configure for 256 byte Dataflash if not already done. */ + FlashConfigurePageSize(); + } + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); + d9c: 0c cf rjmp .-488 ; 0xbb6 + +00000d9e : + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); +} + +void MemoryStore(void) +{ + d9e: 4f 92 push r4 + da0: 5f 92 push r5 + da2: 6f 92 push r6 + da4: 7f 92 push r7 + da6: 8f 92 push r8 + da8: 9f 92 push r9 + daa: af 92 push r10 + dac: bf 92 push r11 + dae: cf 92 push r12 + db0: df 92 push r13 + db2: ef 92 push r14 + db4: ff 92 push r15 + db6: 0f 93 push r16 + db8: 1f 93 push r17 + dba: cf 93 push r28 + dbc: df 93 push r29 + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + dbe: 80 91 fd 24 lds r24, 0x24FD + dc2: 90 e0 ldi r25, 0x00 ; 0 + dc4: a0 e0 ldi r26, 0x00 ; 0 + dc6: b0 e0 ldi r27, 0x00 ; 0 + dc8: 6a e0 ldi r22, 0x0A ; 10 + dca: 88 0f add r24, r24 + dcc: 99 1f adc r25, r25 + dce: aa 1f adc r26, r26 + dd0: bb 1f adc r27, r27 + dd2: 6a 95 dec r22 + dd4: d1 f7 brne .-12 ; 0xdca + dd6: 00 e0 ldi r16, 0x00 ; 0 + dd8: 14 e0 ldi r17, 0x04 ; 4 +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + dda: e1 2c mov r14, r1 + ddc: ff 24 eor r15, r15 + dde: f3 94 inc r15 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + de0: e0 e1 ldi r30, 0x10 ; 16 + de2: ce 2e mov r12, r30 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + de4: f7 ed ldi r31, 0xD7 ; 215 + de6: bf 2e mov r11, r31 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + de8: c0 e4 ldi r28, 0x40 ; 64 + dea: dc 2e mov r13, r28 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + dec: d0 e1 ldi r29, 0x10 ; 16 + dee: ad 2e mov r10, r29 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + df0: 27 ed ldi r18, 0xD7 ; 215 + df2: 92 2e mov r9, r18 + df4: 33 e5 ldi r19, 0x53 ; 83 + df6: 43 2e mov r4, r19 + df8: 44 e8 ldi r20, 0x84 ; 132 + dfa: 54 2e mov r5, r20 + dfc: 53 e8 ldi r21, 0x83 ; 131 + dfe: 65 2e mov r6, r21 +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + e00: 49 2f mov r20, r25 + e02: 5a 2f mov r21, r26 + e04: 6b 2f mov r22, r27 + e06: 77 27 eor r23, r23 + e08: 85 2e mov r8, r21 + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + e0a: 38 2f mov r19, r24 + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + e0c: e7 01 movw r28, r14 + e0e: c8 1b sub r28, r24 + e10: d1 09 sbc r29, r1 + e12: 0c 17 cp r16, r28 + e14: 1d 07 cpc r17, r29 + e16: 08 f4 brcc .+2 ; 0xe1a + e18: e8 01 movw r28, r16 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + e1a: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + e1e: 90 92 a0 09 sts 0x09A0, r9 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + e22: 20 91 a1 09 lds r18, 0x09A1 + e26: 26 ff sbrs r18, 6 + e28: fc cf rjmp .-8 ; 0xe22 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + e2a: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + e2e: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + e32: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + e36: 20 91 a1 09 lds r18, 0x09A1 + e3a: 26 ff sbrs r18, 6 + e3c: fc cf rjmp .-8 ; 0xe36 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + e3e: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + e42: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + e46: c0 92 65 06 sts 0x0665, r12 MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } INLINE void FlashMemoryToBuffer(uint16_t PageAddress) { while(FlashIsBusy()); - db4: c7 ff sbrs r28, 7 - db6: e6 cf rjmp .-52 ; 0xd84 + e4a: 27 ff sbrs r18, 7 + e4c: e6 cf rjmp .-52 ; 0xe1a MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - db8: a0 92 66 06 sts 0x0666, r10 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + e4e: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - dbc: 40 92 a0 09 sts 0x09A0, r4 + e52: 40 92 a0 09 sts 0x09A0, r4 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - dc0: c0 91 a1 09 lds r28, 0x09A1 - dc4: c6 ff sbrs r28, 6 - dc6: fc cf rjmp .-8 ; 0xdc0 + e56: 20 91 a1 09 lds r18, 0x09A1 + e5a: 26 ff sbrs r18, 6 + e5c: fc cf rjmp .-8 ; 0xe56 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - dc8: d0 92 a1 09 sts 0x09A1, r13 + e5e: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - dcc: c0 91 a0 09 lds r28, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + e62: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - dd0: 80 92 a0 09 sts 0x09A0, r8 + e66: 80 92 a0 09 sts 0x09A0, r8 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - dd4: c0 91 a1 09 lds r28, 0x09A1 - dd8: c6 ff sbrs r28, 6 - dda: fc cf rjmp .-8 ; 0xdd4 + e6a: 20 91 a1 09 lds r18, 0x09A1 + e6e: 26 ff sbrs r18, 6 + e70: fc cf rjmp .-8 ; 0xe6a MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ddc: d0 92 a1 09 sts 0x09A1, r13 + e72: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - de0: c0 91 a0 09 lds r28, 0x09A0 + e76: 20 91 a0 09 lds r18, 0x09A0 while(FlashIsBusy()); MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_MEM_TO_BUF1); SPITransferByte( (PageAddress >> 8) & 0xFF ); SPITransferByte( (PageAddress >> 0) & 0xFF ); - de4: 74 2e mov r7, r20 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + e7a: 74 2e mov r7, r20 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - de6: 40 93 a0 09 sts 0x09A0, r20 + e7c: 40 93 a0 09 sts 0x09A0, r20 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - dea: 40 91 a1 09 lds r20, 0x09A1 - dee: 46 ff sbrs r20, 6 - df0: fc cf rjmp .-8 ; 0xdea + e80: 20 91 a1 09 lds r18, 0x09A1 + e84: 26 ff sbrs r18, 6 + e86: fc cf rjmp .-8 ; 0xe80 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - df2: d0 92 a1 09 sts 0x09A1, r13 + e88: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - df6: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + e8c: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - dfa: 10 92 a0 09 sts 0x09A0, r1 + e90: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - dfe: 40 91 a1 09 lds r20, 0x09A1 - e02: 46 ff sbrs r20, 6 - e04: fc cf rjmp .-8 ; 0xdfe + e94: 20 91 a1 09 lds r18, 0x09A1 + e98: 26 ff sbrs r18, 6 + e9a: fc cf rjmp .-8 ; 0xe94 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e06: d0 92 a1 09 sts 0x09A1, r13 + e9c: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e0a: 40 91 a0 09 lds r20, 0x09A0 + ea0: 20 91 a0 09 lds r18, 0x09A0 MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_MEM_TO_BUF1); SPITransferByte( (PageAddress >> 8) & 0xFF ); SPITransferByte( (PageAddress >> 0) & 0xFF ); SPITransferByte( 0 ); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - e0e: c0 92 65 06 sts 0x0665, r12 + ea4: c0 92 65 06 sts 0x0665, r12 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - e12: c0 92 66 06 sts 0x0666, r12 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + ea8: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - e16: b0 92 a0 09 sts 0x09A0, r11 + eac: b0 92 a0 09 sts 0x09A0, r11 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e1a: 40 91 a1 09 lds r20, 0x09A1 - e1e: 46 ff sbrs r20, 6 - e20: fc cf rjmp .-8 ; 0xe1a + eb0: 20 91 a1 09 lds r18, 0x09A1 + eb4: 26 ff sbrs r18, 6 + eb6: fc cf rjmp .-8 ; 0xeb0 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e22: d0 92 a1 09 sts 0x09A1, r13 + eb8: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e26: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + ebc: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - e2a: 10 92 a0 09 sts 0x09A0, r1 + ec0: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e2e: 40 91 a1 09 lds r20, 0x09A1 - e32: 46 ff sbrs r20, 6 - e34: fc cf rjmp .-8 ; 0xe2e + ec4: 20 91 a1 09 lds r18, 0x09A1 + ec8: 26 ff sbrs r18, 6 + eca: fc cf rjmp .-8 ; 0xec4 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e36: d0 92 a1 09 sts 0x09A1, r13 + ecc: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e3a: 40 91 a0 09 lds r20, 0x09A0 + ed0: 20 91 a0 09 lds r18, 0x09A0 uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_STATUS_REG_READ); Register = SPITransferByte(0); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - e3e: c0 92 65 06 sts 0x0665, r12 + ed4: c0 92 65 06 sts 0x0665, r12 MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } INLINE void FlashWriteBuffer(const void* Buffer, uint8_t Address, uint16_t ByteCount) { while(FlashIsBusy()); - e42: 47 ff sbrs r20, 7 - e44: e6 cf rjmp .-52 ; 0xe12 + ed8: 27 ff sbrs r18, 7 + eda: e6 cf rjmp .-52 ; 0xea8 MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - e46: a0 92 66 06 sts 0x0666, r10 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + edc: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - e4a: 50 92 a0 09 sts 0x09A0, r5 + ee0: 50 92 a0 09 sts 0x09A0, r5 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e4e: 40 91 a1 09 lds r20, 0x09A1 - e52: 46 ff sbrs r20, 6 - e54: fc cf rjmp .-8 ; 0xe4e + ee4: 20 91 a1 09 lds r18, 0x09A1 + ee8: 26 ff sbrs r18, 6 + eea: fc cf rjmp .-8 ; 0xee4 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e56: d0 92 a1 09 sts 0x09A1, r13 + eec: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e5a: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + ef0: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - e5e: 10 92 a0 09 sts 0x09A0, r1 + ef4: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e62: 40 91 a1 09 lds r20, 0x09A1 - e66: 46 ff sbrs r20, 6 - e68: fc cf rjmp .-8 ; 0xe62 + ef8: 20 91 a1 09 lds r18, 0x09A1 + efc: 26 ff sbrs r18, 6 + efe: fc cf rjmp .-8 ; 0xef8 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e6a: d0 92 a1 09 sts 0x09A1, r13 + f00: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e6e: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + f04: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - e72: 10 92 a0 09 sts 0x09A0, r1 + f08: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e76: 40 91 a1 09 lds r20, 0x09A1 - e7a: 46 ff sbrs r20, 6 - e7c: fc cf rjmp .-8 ; 0xe76 + f0c: 20 91 a1 09 lds r18, 0x09A1 + f10: 26 ff sbrs r18, 6 + f12: fc cf rjmp .-8 ; 0xf0c MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e7e: d0 92 a1 09 sts 0x09A1, r13 + f14: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e82: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + f18: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - e86: d0 93 a0 09 sts 0x09A0, r29 + f1c: 30 93 a0 09 sts 0x09A0, r19 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e8a: 40 91 a1 09 lds r20, 0x09A1 - e8e: 46 ff sbrs r20, 6 - e90: fc cf rjmp .-8 ; 0xe8a + f20: 20 91 a1 09 lds r18, 0x09A1 + f24: 26 ff sbrs r18, 6 + f26: fc cf rjmp .-8 ; 0xf20 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e92: d0 92 a1 09 sts 0x09A1, r13 + f28: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - e96: 40 91 a0 09 lds r20, 0x09A0 + f2c: 20 91 a0 09 lds r18, 0x09A0 INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) { uint8_t* ByteBuffer = (uint8_t*) Buffer; while(ByteCount-- > 0) { - e9a: 01 15 cp r16, r1 - e9c: 11 05 cpc r17, r1 - e9e: 91 f0 breq .+36 ; 0xec4 + f30: 20 97 sbiw r28, 0x00 ; 0 + f32: 99 f0 breq .+38 ; 0xf5a { - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - FlashRead(Buffer, FlashAddress, ByteCount); + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); } -void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) - ea0: a9 01 movw r20, r18 - ea2: 40 0f add r20, r16 - ea4: 51 1f adc r21, r17 +void MemoryStore(void) + f34: 9e 01 movw r18, r28 + f36: 2e 56 subi r18, 0x6E ; 110 + f38: 3f 4d sbci r19, 0xDF ; 223 } } INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) { uint8_t* ByteBuffer = (uint8_t*) Buffer; - ea6: e9 01 movw r28, r18 + f3a: e2 e9 ldi r30, 0x92 ; 146 + f3c: f0 e2 ldi r31, 0x20 ; 32 while(ByteCount-- > 0) { MEMORY_FLASH_USART.DATA = *ByteBuffer++; - ea8: 69 91 ld r22, Y+ - eaa: 60 93 a0 09 sts 0x09A0, r22 + f3e: 41 91 ld r20, Z+ + f40: 40 93 a0 09 sts 0x09A0, r20 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - eae: 60 91 a1 09 lds r22, 0x09A1 - eb2: 66 ff sbrs r22, 6 - eb4: fc cf rjmp .-8 ; 0xeae + f44: 40 91 a1 09 lds r20, 0x09A1 + f48: 46 ff sbrs r20, 6 + f4a: fc cf rjmp .-8 ; 0xf44 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - eb6: d0 92 a1 09 sts 0x09A1, r13 + f4c: d0 92 a1 09 sts 0x09A1, r13 MEMORY_FLASH_USART.DATA; /* Flush Buffer */ - eba: 60 91 a0 09 lds r22, 0x09A0 + f50: 40 91 a0 09 lds r20, 0x09A0 INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) { uint8_t* ByteBuffer = (uint8_t*) Buffer; while(ByteCount-- > 0) { - ebe: c4 17 cp r28, r20 - ec0: d5 07 cpc r29, r21 - ec2: 91 f7 brne .-28 ; 0xea8 + f54: e2 17 cp r30, r18 + f56: f3 07 cpc r31, r19 + f58: 91 f7 brne .-28 ; 0xf3e SPITransferByte(FLASH_CMD_BUF1_WRITE); SPITransferByte( 0 ); SPITransferByte( 0 ); SPITransferByte( Address ); SPIWriteBlock(Buffer, ByteCount); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - ec4: c0 92 65 06 sts 0x0665, r12 + f5a: c0 92 65 06 sts 0x0665, r12 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - ec8: c0 92 66 06 sts 0x0666, r12 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + f5e: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - ecc: b0 92 a0 09 sts 0x09A0, r11 + f62: b0 92 a0 09 sts 0x09A0, r11 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ed0: 40 91 a1 09 lds r20, 0x09A1 - ed4: 46 ff sbrs r20, 6 - ed6: fc cf rjmp .-8 ; 0xed0 + f66: 20 91 a1 09 lds r18, 0x09A1 + f6a: 26 ff sbrs r18, 6 + f6c: fc cf rjmp .-8 ; 0xf66 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ed8: d0 92 a1 09 sts 0x09A1, r13 + f6e: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - edc: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + f72: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - ee0: 10 92 a0 09 sts 0x09A0, r1 + f76: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ee4: 40 91 a1 09 lds r20, 0x09A1 - ee8: 46 ff sbrs r20, 6 - eea: fc cf rjmp .-8 ; 0xee4 + f7a: 20 91 a1 09 lds r18, 0x09A1 + f7e: 26 ff sbrs r18, 6 + f80: fc cf rjmp .-8 ; 0xf7a MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - eec: d0 92 a1 09 sts 0x09A1, r13 + f82: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - ef0: 40 91 a0 09 lds r20, 0x09A0 + f86: 20 91 a0 09 lds r18, 0x09A0 uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_STATUS_REG_READ); Register = SPITransferByte(0); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - ef4: c0 92 65 06 sts 0x0665, r12 + f8a: c0 92 65 06 sts 0x0665, r12 MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } INLINE void FlashBufferToMemory(uint16_t PageAddress) { while(FlashIsBusy()); - ef8: 47 ff sbrs r20, 7 - efa: e6 cf rjmp .-52 ; 0xec8 + f8e: 27 ff sbrs r18, 7 + f90: e6 cf rjmp .-52 ; 0xf5e MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - efc: a0 92 66 06 sts 0x0666, r10 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + f92: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - f00: 60 92 a0 09 sts 0x09A0, r6 + f96: 60 92 a0 09 sts 0x09A0, r6 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f04: 40 91 a1 09 lds r20, 0x09A1 - f08: 46 ff sbrs r20, 6 - f0a: fc cf rjmp .-8 ; 0xf04 + f9a: 20 91 a1 09 lds r18, 0x09A1 + f9e: 26 ff sbrs r18, 6 + fa0: fc cf rjmp .-8 ; 0xf9a MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f0c: d0 92 a1 09 sts 0x09A1, r13 + fa2: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - f10: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + fa6: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - f14: 80 92 a0 09 sts 0x09A0, r8 + faa: 80 92 a0 09 sts 0x09A0, r8 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f18: 40 91 a1 09 lds r20, 0x09A1 - f1c: 46 ff sbrs r20, 6 - f1e: fc cf rjmp .-8 ; 0xf18 + fae: 20 91 a1 09 lds r18, 0x09A1 + fb2: 26 ff sbrs r18, 6 + fb4: fc cf rjmp .-8 ; 0xfae MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f20: d0 92 a1 09 sts 0x09A1, r13 + fb6: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - f24: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + fba: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - f28: 70 92 a0 09 sts 0x09A0, r7 + fbe: 70 92 a0 09 sts 0x09A0, r7 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f2c: 40 91 a1 09 lds r20, 0x09A1 - f30: 46 ff sbrs r20, 6 - f32: fc cf rjmp .-8 ; 0xf2c + fc2: 20 91 a1 09 lds r18, 0x09A1 + fc6: 26 ff sbrs r18, 6 + fc8: fc cf rjmp .-8 ; 0xfc2 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f34: d0 92 a1 09 sts 0x09A1, r13 + fca: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - f38: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + fce: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - f3c: 10 92 a0 09 sts 0x09A0, r1 + fd2: 10 92 a0 09 sts 0x09A0, r1 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f40: 40 91 a1 09 lds r20, 0x09A1 - f44: 46 ff sbrs r20, 6 - f46: fc cf rjmp .-8 ; 0xf40 + fd6: 20 91 a1 09 lds r18, 0x09A1 + fda: 26 ff sbrs r18, 6 + fdc: fc cf rjmp .-8 ; 0xfd6 MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f48: d0 92 a1 09 sts 0x09A1, r13 + fde: d0 92 a1 09 sts 0x09A1, r13 return MEMORY_FLASH_USART.DATA; - f4c: 40 91 a0 09 lds r20, 0x09A0 + fe2: 20 91 a0 09 lds r18, 0x09A0 MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_BUF1_TO_MEM_ERASE); SPITransferByte( (PageAddress >> 8) & 0xFF ); SPITransferByte( (PageAddress >> 0) & 0xFF ); SPITransferByte( 0 ); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - f50: c0 92 65 06 sts 0x0665, r12 + fe6: c0 92 65 06 sts 0x0665, r12 FlashMemoryToBuffer(PageAddress); FlashWriteBuffer(Buffer, ByteAddress, PageBytes); FlashBufferToMemory(PageAddress); ByteCount -= PageBytes; - f54: e0 1b sub r30, r16 - f56: f1 0b sbc r31, r17 + fea: 0c 1b sub r16, r28 + fec: 1d 0b sbc r17, r29 Address += PageBytes; - f58: 80 0f add r24, r16 - f5a: 91 1f adc r25, r17 - f5c: a1 1d adc r26, r1 - f5e: b1 1d adc r27, r1 + fee: 8c 0f add r24, r28 + ff0: 9d 1f adc r25, r29 + ff2: a1 1d adc r26, r1 + ff4: b1 1d adc r27, r1 MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) { while(ByteCount > 0) { - f60: 30 97 sbiw r30, 0x00 ; 0 - f62: 09 f0 breq .+2 ; 0xf66 - f64: 02 cf rjmp .-508 ; 0xd6a + ff6: 01 15 cp r16, r1 + ff8: 11 05 cpc r17, r1 + ffa: 09 f0 breq .+2 ; 0xffe + ffc: 01 cf rjmp .-510 ; 0xe00 -void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) +void MemoryStore(void) { - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - FlashWrite(Buffer, FlashAddress, ByteCount); + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); } - f66: df 91 pop r29 - f68: cf 91 pop r28 - f6a: 1f 91 pop r17 - f6c: 0f 91 pop r16 - f6e: ff 90 pop r15 - f70: ef 90 pop r14 - f72: df 90 pop r13 - f74: cf 90 pop r12 - f76: bf 90 pop r11 - f78: af 90 pop r10 - f7a: 9f 90 pop r9 - f7c: 8f 90 pop r8 - f7e: 7f 90 pop r7 - f80: 6f 90 pop r6 - f82: 5f 90 pop r5 - f84: 4f 90 pop r4 - f86: 08 95 ret + ffe: df 91 pop r29 + 1000: cf 91 pop r28 + 1002: 1f 91 pop r17 + 1004: 0f 91 pop r16 + 1006: ff 90 pop r15 + 1008: ef 90 pop r14 + 100a: df 90 pop r13 + 100c: cf 90 pop r12 + 100e: bf 90 pop r11 + 1010: af 90 pop r10 + 1012: 9f 90 pop r9 + 1014: 8f 90 pop r8 + 1016: 7f 90 pop r7 + 1018: 6f 90 pop r6 + 101a: 5f 90 pop r5 + 101c: 4f 90 pop r4 + 101e: 08 95 ret -00000f88 : +00001020 : -void MemoryClear(void) +bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) { - uint32_t PageAddress = ((uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING) / MEMORY_PAGE_SIZE; - f88: 80 91 fd 20 lds r24, 0x20FD - f8c: 90 e0 ldi r25, 0x00 ; 0 - f8e: a0 e0 ldi r26, 0x00 ; 0 - f90: b0 e0 ldi r27, 0x00 ; 0 - f92: ba 2f mov r27, r26 - f94: a9 2f mov r26, r25 - f96: 98 2f mov r25, r24 - f98: 88 27 eor r24, r24 -{ - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - FlashWrite(Buffer, FlashAddress, ByteCount); + 1020: 2f 92 push r2 + 1022: 3f 92 push r3 + 1024: 4f 92 push r4 + 1026: 5f 92 push r5 + 1028: 6f 92 push r6 + 102a: 7f 92 push r7 + 102c: 8f 92 push r8 + 102e: 9f 92 push r9 + 1030: af 92 push r10 + 1032: bf 92 push r11 + 1034: cf 92 push r12 + 1036: df 92 push r13 + 1038: ef 92 push r14 + 103a: ff 92 push r15 + 103c: 0f 93 push r16 + 103e: 1f 93 push r17 + 1040: cf 93 push r28 + 1042: df 93 push r29 + 1044: cd b7 in r28, 0x3d ; 61 + 1046: de b7 in r29, 0x3e ; 62 + 1048: 2e 97 sbiw r28, 0x0e ; 14 + 104a: cd bf out 0x3d, r28 ; 61 + 104c: de bf out 0x3e, r29 ; 62 + 104e: f9 01 movw r30, r18 + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + 1050: 41 15 cp r20, r1 + 1052: 24 e0 ldi r18, 0x04 ; 4 + 1054: 52 07 cpc r21, r18 + 1056: 61 05 cpc r22, r1 + 1058: 71 05 cpc r23, r1 + 105a: 08 f0 brcs .+2 ; 0x105e + 105c: a6 c1 rjmp .+844 ; 0x13aa + /* Prevent writing out of bounds by silently ignoring it */ + return true; + } else { + /* Calculate bytes left in memory and start writing */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + 105e: 00 91 fd 24 lds r16, 0x24FD + 1062: 10 e0 ldi r17, 0x00 ; 0 + 1064: 20 e0 ldi r18, 0x00 ; 0 + 1066: 30 e0 ldi r19, 0x00 ; 0 + 1068: aa e0 ldi r26, 0x0A ; 10 + 106a: 00 0f add r16, r16 + 106c: 11 1f adc r17, r17 + 106e: 22 1f adc r18, r18 + 1070: 33 1f adc r19, r19 + 1072: aa 95 dec r26 + 1074: d1 f7 brne .-12 ; 0x106a + 1076: 04 0f add r16, r20 + 1078: 15 1f adc r17, r21 + 107a: 26 1f adc r18, r22 + 107c: 37 1f adc r19, r23 + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + /* Prevent writing out of bounds by silently ignoring it */ + return true; + } else { + /* Calculate bytes left in memory and start writing */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + 107e: c1 2c mov r12, r1 + 1080: b4 e0 ldi r27, 0x04 ; 4 + 1082: db 2e mov r13, r27 + 1084: e1 2c mov r14, r1 + 1086: f1 2c mov r15, r1 + 1088: c4 1a sub r12, r20 + 108a: d5 0a sbc r13, r21 + 108c: e6 0a sbc r14, r22 + 108e: f7 0a sbc r15, r23 + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 1090: 4f 01 movw r8, r30 + 1092: a1 2c mov r10, r1 + 1094: b1 2c mov r11, r1 + 1096: 8d 82 std Y+5, r8 ; 0x05 + 1098: 9e 82 std Y+6, r9 ; 0x06 + 109a: af 82 std Y+7, r10 ; 0x07 + 109c: b8 86 std Y+8, r11 ; 0x08 + 109e: c8 14 cp r12, r8 + 10a0: d9 04 cpc r13, r9 + 10a2: ea 04 cpc r14, r10 + 10a4: fb 04 cpc r15, r11 + 10a6: 08 f4 brcc .+2 ; 0x10aa + 10a8: 97 c1 rjmp .+814 ; 0x13d8 + 10aa: ad 81 ldd r26, Y+5 ; 0x05 + 10ac: be 81 ldd r27, Y+6 ; 0x06 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } -void MemoryClear(void) - f9a: 9c 01 movw r18, r24 - f9c: 33 95 inc r19 +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + 10ae: 10 97 sbiw r26, 0x00 ; 0 + 10b0: 09 f4 brne .+2 ; 0x10b4 + 10b2: 7b c1 rjmp .+758 ; 0x13aa + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + 10b4: e1 2c mov r14, r1 + 10b6: ff 24 eor r15, r15 + 10b8: f3 94 inc r15 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - f9e: 60 e1 ldi r22, 0x10 ; 16 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + 10ba: e0 e1 ldi r30, 0x10 ; 16 + 10bc: 9e 2e mov r9, r30 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - fa0: 77 ed ldi r23, 0xD7 ; 215 + 10be: f7 ed ldi r31, 0xD7 ; 215 + 10c0: df 2e mov r13, r31 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fa2: 50 e4 ldi r21, 0x40 ; 64 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - fa4: e1 e8 ldi r30, 0x81 ; 129 + 10c2: e0 e4 ldi r30, 0x40 ; 64 + 10c4: ae 2e mov r10, r30 INLINE uint8_t FlashReadStatusRegister(void) { uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - fa6: 60 93 66 06 sts 0x0666, r22 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + 10c6: f0 e1 ldi r31, 0x10 ; 16 + 10c8: cf 2e mov r12, r31 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - faa: 70 93 a0 09 sts 0x09A0, r23 + 10ca: e7 ed ldi r30, 0xD7 ; 215 + 10cc: 7e 2e mov r7, r30 + 10ce: f3 e5 ldi r31, 0x53 ; 83 + 10d0: 6f 2e mov r6, r31 + 10d2: e4 e8 ldi r30, 0x84 ; 132 + 10d4: 8e 2e mov r8, r30 + 10d6: f3 e8 ldi r31, 0x83 ; 131 + 10d8: bf 2e mov r11, r31 + 10da: 09 83 std Y+1, r16 ; 0x01 + 10dc: 1a 83 std Y+2, r17 ; 0x02 + 10de: 2b 83 std Y+3, r18 ; 0x03 + 10e0: 3c 83 std Y+4, r19 ; 0x04 + 10e2: ad 87 std Y+13, r26 ; 0x0d + 10e4: be 87 std Y+14, r27 ; 0x0e + 10e6: 49 87 std Y+9, r20 ; 0x09 + 10e8: 5a 87 std Y+10, r21 ; 0x0a + 10ea: 6b 87 std Y+11, r22 ; 0x0b + 10ec: 7c 87 std Y+12, r23 ; 0x0c +} - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - fae: 40 91 a1 09 lds r20, 0x09A1 - fb2: 46 ff sbrs r20, 6 - fb4: fc cf rjmp .-8 ; 0xfae +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + 10ee: 49 81 ldd r20, Y+1 ; 0x01 + 10f0: 5a 81 ldd r21, Y+2 ; 0x02 + 10f2: 6b 81 ldd r22, Y+3 ; 0x03 + 10f4: 7c 81 ldd r23, Y+4 ; 0x04 + 10f6: 05 2f mov r16, r21 + 10f8: 16 2f mov r17, r22 + 10fa: 27 2f mov r18, r23 + 10fc: 33 27 eor r19, r19 + 10fe: 41 2f mov r20, r17 + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + 1100: e9 81 ldd r30, Y+1 ; 0x01 + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + 1102: b7 01 movw r22, r14 + 1104: 6e 1b sub r22, r30 + 1106: 71 09 sbc r23, r1 + 1108: ad 85 ldd r26, Y+13 ; 0x0d + 110a: be 85 ldd r27, Y+14 ; 0x0e + 110c: a6 17 cp r26, r22 + 110e: b7 07 cpc r27, r23 + 1110: 08 f4 brcc .+2 ; 0x1114 + 1112: bd 01 movw r22, r26 - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fb6: 50 93 a1 09 sts 0x09A1, r21 +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; - return MEMORY_FLASH_USART.DATA; - fba: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1114: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - fbe: 10 92 a0 09 sts 0x09A0, r1 + 1118: 70 92 a0 09 sts 0x09A0, r7 while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - fc2: 40 91 a1 09 lds r20, 0x09A1 - fc6: 46 ff sbrs r20, 6 - fc8: fc cf rjmp .-8 ; 0xfc2 + 111c: 50 91 a1 09 lds r21, 0x09A1 + 1120: 56 ff sbrs r21, 6 + 1122: fc cf rjmp .-8 ; 0x111c MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fca: 50 93 a1 09 sts 0x09A1, r21 + 1124: a0 92 a1 09 sts 0x09A1, r10 return MEMORY_FLASH_USART.DATA; - fce: 40 91 a0 09 lds r20, 0x09A0 + 1128: 50 91 a0 09 lds r21, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 112c: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1130: 50 91 a1 09 lds r21, 0x09A1 + 1134: 56 ff sbrs r21, 6 + 1136: fc cf rjmp .-8 ; 0x1130 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1138: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 113c: 50 91 a0 09 lds r21, 0x09A0 uint8_t Register; MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; SPITransferByte(FLASH_CMD_STATUS_REG_READ); Register = SPITransferByte(0); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - fd2: 60 93 65 06 sts 0x0665, r22 - } + 1140: 90 92 65 06 sts 0x0665, r9 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } -INLINE void FlashClearPage(uint16_t PageAddress) +INLINE void FlashMemoryToBuffer(uint16_t PageAddress) { while(FlashIsBusy()); - fd6: 47 ff sbrs r20, 7 - fd8: e6 cf rjmp .-52 ; 0xfa6 + 1144: 57 ff sbrs r21, 7 + 1146: e6 cf rjmp .-52 ; 0x1114 + 1148: ad 87 std Y+13, r26 ; 0x0d + 114a: be 87 std Y+14, r27 ; 0x0e MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - fda: 60 93 66 06 sts 0x0666, r22 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + 114c: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - fde: e0 93 a0 09 sts 0x09A0, r30 + 1150: 60 92 a0 09 sts 0x09A0, r6 + 1154: ad 85 ldd r26, Y+13 ; 0x0d + 1156: be 85 ldd r27, Y+14 ; 0x0e while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - fe2: 40 91 a1 09 lds r20, 0x09A1 - fe6: 46 ff sbrs r20, 6 - fe8: fc cf rjmp .-8 ; 0xfe2 + 1158: 50 91 a1 09 lds r21, 0x09A1 + 115c: 56 ff sbrs r21, 6 + 115e: fc cf rjmp .-8 ; 0x1158 + 1160: ad 87 std Y+13, r26 ; 0x0d + 1162: be 87 std Y+14, r27 ; 0x0e MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fea: 50 93 a1 09 sts 0x09A1, r21 + 1164: a0 92 a1 09 sts 0x09A1, r10 return MEMORY_FLASH_USART.DATA; - fee: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + 1168: 50 91 a0 09 lds r21, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; - ff2: 90 93 a0 09 sts 0x09A0, r25 + 116c: 40 93 a0 09 sts 0x09A0, r20 + 1170: ad 85 ldd r26, Y+13 ; 0x0d + 1172: be 85 ldd r27, Y+14 ; 0x0e while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ff6: 40 91 a1 09 lds r20, 0x09A1 - ffa: 46 ff sbrs r20, 6 - ffc: fc cf rjmp .-8 ; 0xff6 + 1174: 50 91 a1 09 lds r21, 0x09A1 + 1178: 56 ff sbrs r21, 6 + 117a: fc cf rjmp .-8 ; 0x1174 + 117c: ad 87 std Y+13, r26 ; 0x0d + 117e: be 87 std Y+14, r27 ; 0x0e MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ffe: 50 93 a1 09 sts 0x09A1, r21 + 1180: a0 92 a1 09 sts 0x09A1, r10 return MEMORY_FLASH_USART.DATA; - 1002: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) + 1184: 50 91 a0 09 lds r21, 0x09A0 + while(FlashIsBusy()); -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1006: 80 93 a0 09 sts 0x09A0, r24 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 100a: 40 91 a1 09 lds r20, 0x09A1 - 100e: 46 ff sbrs r20, 6 - 1010: fc cf rjmp .-8 ; 0x100a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1012: 50 93 a1 09 sts 0x09A1, r21 - - return MEMORY_FLASH_USART.DATA; - 1016: 40 91 a0 09 lds r20, 0x09A0 -#define FLASH_STATUS_REG_PROTECT_BIT (1<<1) -#define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 101a: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 101e: 40 91 a1 09 lds r20, 0x09A1 - 1022: 46 ff sbrs r20, 6 - 1024: fc cf rjmp .-8 ; 0x101e - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1026: 50 93 a1 09 sts 0x09A1, r21 - - return MEMORY_FLASH_USART.DATA; - 102a: 40 91 a0 09 lds r20, 0x09A0 MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_PAGE_ERASE); + SPITransferByte(FLASH_CMD_MEM_TO_BUF1); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + 1188: 50 2f mov r21, r16 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 118a: 00 93 a0 09 sts 0x09A0, r16 + 118e: ad 85 ldd r26, Y+13 ; 0x0d + 1190: be 85 ldd r27, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1192: 20 91 a1 09 lds r18, 0x09A1 + 1196: 26 ff sbrs r18, 6 + 1198: fc cf rjmp .-8 ; 0x1192 + 119a: ad 87 std Y+13, r26 ; 0x0d + 119c: be 87 std Y+14, r27 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 119e: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 11a2: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 11a6: 10 92 a0 09 sts 0x09A0, r1 + 11aa: ad 85 ldd r26, Y+13 ; 0x0d + 11ac: be 85 ldd r27, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11ae: 20 91 a1 09 lds r18, 0x09A1 + 11b2: 26 ff sbrs r18, 6 + 11b4: fc cf rjmp .-8 ; 0x11ae + 11b6: ad 87 std Y+13, r26 ; 0x0d + 11b8: be 87 std Y+14, r27 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 11ba: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 11be: 20 91 a0 09 lds r18, 0x09A0 + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_MEM_TO_BUF1); SPITransferByte( (PageAddress >> 8) & 0xFF ); SPITransferByte( (PageAddress >> 0) & 0xFF ); SPITransferByte( 0 ); MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 102e: 60 93 65 06 sts 0x0665, r22 - 1032: 01 96 adiw r24, 0x01 ; 1 -void MemoryClear(void) + 11c2: 90 92 65 06 sts 0x0665, r9 + 11c6: ad 85 ldd r26, Y+13 ; 0x0d + 11c8: be 85 ldd r27, Y+14 ; 0x0e + +INLINE uint8_t FlashReadStatusRegister(void) { - uint32_t PageAddress = ((uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING) / MEMORY_PAGE_SIZE; - uint16_t PageCount = MEMORY_SIZE_PER_SETTING / MEMORY_PAGE_SIZE; + uint8_t Register; - while(PageCount > 0) { - 1034: 82 17 cp r24, r18 - 1036: 93 07 cpc r25, r19 - 1038: 09 f0 breq .+2 ; 0x103c - 103a: b5 cf rjmp .-150 ; 0xfa6 - FlashClearPage(PageAddress); - PageCount--; - PageAddress++; - } + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 11ca: 90 92 66 06 sts 0x0666, r9 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 11ce: d0 92 a0 09 sts 0x09A0, r13 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11d2: 20 91 a1 09 lds r18, 0x09A1 + 11d6: 26 ff sbrs r18, 6 + 11d8: fc cf rjmp .-8 ; 0x11d2 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 11da: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 11de: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 11e2: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11e6: 20 91 a1 09 lds r18, 0x09A1 + 11ea: 26 ff sbrs r18, 6 + 11ec: fc cf rjmp .-8 ; 0x11e6 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 11ee: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 11f2: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 11f6: 90 92 65 06 sts 0x0665, r9 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; } - 103c: 08 95 ret -0000103e : +INLINE void FlashWriteBuffer(const void* Buffer, uint8_t Address, uint16_t ByteCount) +{ + while(FlashIsBusy()); + 11fa: 27 ff sbrs r18, 7 + 11fc: e6 cf rjmp .-52 ; 0x11ca + 11fe: ad 87 std Y+13, r26 ; 0x0d + 1200: be 87 std Y+14, r27 ; 0x0e + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1202: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1206: 80 92 a0 09 sts 0x09A0, r8 + 120a: ad 85 ldd r26, Y+13 ; 0x0d + 120c: be 85 ldd r27, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 120e: 20 91 a1 09 lds r18, 0x09A1 + 1212: 26 ff sbrs r18, 6 + 1214: fc cf rjmp .-8 ; 0x120e + 1216: ad 87 std Y+13, r26 ; 0x0d + 1218: be 87 std Y+14, r27 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 121a: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 121e: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1222: 10 92 a0 09 sts 0x09A0, r1 + 1226: ad 85 ldd r26, Y+13 ; 0x0d + 1228: be 85 ldd r27, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 122a: 20 91 a1 09 lds r18, 0x09A1 + 122e: 26 ff sbrs r18, 6 + 1230: fc cf rjmp .-8 ; 0x122a + 1232: ad 87 std Y+13, r26 ; 0x0d + 1234: be 87 std Y+14, r27 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1236: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 123a: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 123e: 10 92 a0 09 sts 0x09A0, r1 + 1242: ad 85 ldd r26, Y+13 ; 0x0d + 1244: be 85 ldd r27, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1246: 20 91 a1 09 lds r18, 0x09A1 + 124a: 26 ff sbrs r18, 6 + 124c: fc cf rjmp .-8 ; 0x1246 + 124e: ad 87 std Y+13, r26 ; 0x0d + 1250: be 87 std Y+14, r27 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1252: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 1256: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 125a: e0 93 a0 09 sts 0x09A0, r30 + 125e: ed 85 ldd r30, Y+13 ; 0x0d + 1260: fe 85 ldd r31, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1262: 20 91 a1 09 lds r18, 0x09A1 + 1266: 26 ff sbrs r18, 6 + 1268: fc cf rjmp .-8 ; 0x1262 + 126a: ed 87 std Y+13, r30 ; 0x0d + 126c: fe 87 std Y+14, r31 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 126e: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 1272: 20 91 a0 09 lds r18, 0x09A0 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 1276: 61 15 cp r22, r1 + 1278: 71 05 cpc r23, r1 + 127a: b1 f0 breq .+44 ; 0x12a8 +{ + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); +} bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) -{ - 103e: cf 92 push r12 - 1040: df 92 push r13 - 1042: ef 92 push r14 - 1044: ff 92 push r15 - 1046: 0f 93 push r16 - 1048: 1f 93 push r17 - 104a: fc 01 movw r30, r24 - 104c: cb 01 movw r24, r22 - 104e: ba 01 movw r22, r20 - 1050: 69 01 movw r12, r18 - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - 1052: 61 15 cp r22, r1 - 1054: 71 05 cpc r23, r1 - 1056: 21 e0 ldi r18, 0x01 ; 1 - 1058: 82 07 cpc r24, r18 - 105a: 91 05 cpc r25, r1 - 105c: 40 f0 brcs .+16 ; 0x106e - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - MemoryWriteBlock(Buffer, BlockAddress, ByteCount); - return true; - } + 127c: 9c 01 movw r18, r24 + 127e: 26 0f add r18, r22 + 1280: 37 1f adc r19, r23 + } } - 105e: 81 e0 ldi r24, 0x01 ; 1 - 1060: 1f 91 pop r17 - 1062: 0f 91 pop r16 - 1064: ff 90 pop r15 - 1066: ef 90 pop r14 - 1068: df 90 pop r13 - 106a: cf 90 pop r12 - 106c: 08 95 ret - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - /* Prevent writing out of bounds by silently ignoring it */ - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - 106e: 00 e0 ldi r16, 0x00 ; 0 - 1070: 10 e0 ldi r17, 0x00 ; 0 - 1072: 21 e0 ldi r18, 0x01 ; 1 - 1074: 30 e0 ldi r19, 0x00 ; 0 - 1076: 06 1b sub r16, r22 - 1078: 17 0b sbc r17, r23 - 107a: 28 0b sbc r18, r24 - 107c: 39 0b sbc r19, r25 - ByteCount = MIN(ByteCount, BytesLeft); - 107e: e1 2c mov r14, r1 - 1080: f1 2c mov r15, r1 - 1082: 0c 15 cp r16, r12 - 1084: 1d 05 cpc r17, r13 - 1086: 2e 05 cpc r18, r14 - 1088: 3f 05 cpc r19, r15 - 108a: 58 f0 brcs .+22 ; 0x10a2 - MemoryWriteBlock(Buffer, BlockAddress, ByteCount); - 108c: a6 01 movw r20, r12 - 108e: cf 01 movw r24, r30 - 1090: 38 de rcall .-912 ; 0xd02 - return true; - } -} - 1092: 81 e0 ldi r24, 0x01 ; 1 - 1094: 1f 91 pop r17 - 1096: 0f 91 pop r16 - 1098: ff 90 pop r15 - 109a: ef 90 pop r14 - 109c: df 90 pop r13 - 109e: cf 90 pop r12 - 10a0: 08 95 ret - /* Prevent writing out of bounds by silently ignoring it */ - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - 10a2: 68 01 movw r12, r16 - 10a4: 79 01 movw r14, r18 - MemoryWriteBlock(Buffer, BlockAddress, ByteCount); - 10a6: a6 01 movw r20, r12 - 10a8: cf 01 movw r24, r30 - 10aa: 2b de rcall .-938 ; 0xd02 - 10ac: f2 cf rjmp .-28 ; 0x1092 -000010ae : +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + 1282: fc 01 movw r30, r24 + 1284: 0d 85 ldd r16, Y+13 ; 0x0d + 1286: 1e 85 ldd r17, Y+14 ; 0x0e + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + 1288: a1 91 ld r26, Z+ + 128a: a0 93 a0 09 sts 0x09A0, r26 + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 128e: a0 91 a1 09 lds r26, 0x09A1 + 1292: a6 ff sbrs r26, 6 + 1294: fc cf rjmp .-8 ; 0x128e + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1296: a0 92 a1 09 sts 0x09A1, r10 + MEMORY_FLASH_USART.DATA; /* Flush Buffer */ + 129a: a0 91 a0 09 lds r26, 0x09A0 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 129e: e2 17 cp r30, r18 + 12a0: f3 07 cpc r31, r19 + 12a2: 91 f7 brne .-28 ; 0x1288 + 12a4: 0d 87 std Y+13, r16 ; 0x0d + 12a6: 1e 87 std Y+14, r17 ; 0x0e + SPITransferByte(FLASH_CMD_BUF1_WRITE); + SPITransferByte( 0 ); + SPITransferByte( 0 ); + SPITransferByte( Address ); + SPIWriteBlock(Buffer, ByteCount); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 12a8: 90 92 65 06 sts 0x0665, r9 + 12ac: ed 85 ldd r30, Y+13 ; 0x0d + 12ae: fe 85 ldd r31, Y+14 ; 0x0e + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 12b0: 90 92 66 06 sts 0x0666, r9 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 12b4: d0 92 a0 09 sts 0x09A0, r13 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 12b8: 20 91 a1 09 lds r18, 0x09A1 + 12bc: 26 ff sbrs r18, 6 + 12be: fc cf rjmp .-8 ; 0x12b8 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 12c0: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 12c4: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 12c8: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 12cc: 20 91 a1 09 lds r18, 0x09A1 + 12d0: 26 ff sbrs r18, 6 + 12d2: fc cf rjmp .-8 ; 0x12cc + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 12d4: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 12d8: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 12dc: 90 92 65 06 sts 0x0665, r9 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashBufferToMemory(uint16_t PageAddress) +{ + while(FlashIsBusy()); + 12e0: 27 ff sbrs r18, 7 + 12e2: e6 cf rjmp .-52 ; 0x12b0 + 12e4: ed 87 std Y+13, r30 ; 0x0d + 12e6: fe 87 std Y+14, r31 ; 0x0e + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 12e8: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 12ec: b0 92 a0 09 sts 0x09A0, r11 + 12f0: ed 85 ldd r30, Y+13 ; 0x0d + 12f2: fe 85 ldd r31, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 12f4: 20 91 a1 09 lds r18, 0x09A1 + 12f8: 26 ff sbrs r18, 6 + 12fa: fc cf rjmp .-8 ; 0x12f4 + 12fc: ed 87 std Y+13, r30 ; 0x0d + 12fe: fe 87 std Y+14, r31 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1300: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 1304: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1308: 40 93 a0 09 sts 0x09A0, r20 + 130c: ed 85 ldd r30, Y+13 ; 0x0d + 130e: fe 85 ldd r31, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1310: 20 91 a1 09 lds r18, 0x09A1 + 1314: 26 ff sbrs r18, 6 + 1316: fc cf rjmp .-8 ; 0x1310 + 1318: ed 87 std Y+13, r30 ; 0x0d + 131a: fe 87 std Y+14, r31 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 131c: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 1320: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1324: 50 93 a0 09 sts 0x09A0, r21 + 1328: 4d 85 ldd r20, Y+13 ; 0x0d + 132a: 5e 85 ldd r21, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 132c: 20 91 a1 09 lds r18, 0x09A1 + 1330: 26 ff sbrs r18, 6 + 1332: fc cf rjmp .-8 ; 0x132c + 1334: 4d 87 std Y+13, r20 ; 0x0d + 1336: 5e 87 std Y+14, r21 ; 0x0e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1338: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 133c: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1340: 10 92 a0 09 sts 0x09A0, r1 + 1344: 4d 85 ldd r20, Y+13 ; 0x0d + 1346: 5e 85 ldd r21, Y+14 ; 0x0e + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1348: 20 91 a1 09 lds r18, 0x09A1 + 134c: 26 ff sbrs r18, 6 + 134e: fc cf rjmp .-8 ; 0x1348 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1350: a0 92 a1 09 sts 0x09A1, r10 + + return MEMORY_FLASH_USART.DATA; + 1354: 20 91 a0 09 lds r18, 0x09A0 + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_BUF1_TO_MEM_ERASE); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + SPITransferByte( 0 ); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1358: 90 92 65 06 sts 0x0665, r9 + + FlashMemoryToBuffer(PageAddress); + FlashWriteBuffer(Buffer, ByteAddress, PageBytes); + FlashBufferToMemory(PageAddress); + + ByteCount -= PageBytes; + 135c: 46 1b sub r20, r22 + 135e: 57 0b sbc r21, r23 + 1360: 4d 87 std Y+13, r20 ; 0x0d + 1362: 5e 87 std Y+14, r21 ; 0x0e + Address += PageBytes; + 1364: 29 81 ldd r18, Y+1 ; 0x01 + 1366: 3a 81 ldd r19, Y+2 ; 0x02 + 1368: 4b 81 ldd r20, Y+3 ; 0x03 + 136a: 5c 81 ldd r21, Y+4 ; 0x04 + 136c: 26 0f add r18, r22 + 136e: 37 1f adc r19, r23 + 1370: 41 1d adc r20, r1 + 1372: 51 1d adc r21, r1 + 1374: 29 83 std Y+1, r18 ; 0x01 + 1376: 3a 83 std Y+2, r19 ; 0x02 + 1378: 4b 83 std Y+3, r20 ; 0x03 + 137a: 5c 83 std Y+4, r21 ; 0x04 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + 137c: 4d 85 ldd r20, Y+13 ; 0x0d + 137e: 5e 85 ldd r21, Y+14 ; 0x0e + 1380: 45 2b or r20, r21 + 1382: 09 f0 breq .+2 ; 0x1386 + 1384: b4 ce rjmp .-664 ; 0x10ee + 1386: 49 85 ldd r20, Y+9 ; 0x09 + 1388: 5a 85 ldd r21, Y+10 ; 0x0a + 138a: 6b 85 ldd r22, Y+11 ; 0x0b + 138c: 7c 85 ldd r23, Y+12 ; 0x0c + + /* Store into flash */ + FlashWrite(Buffer, FlashAddress, ByteCount); + + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + 138e: da 01 movw r26, r20 + 1390: ae 56 subi r26, 0x6E ; 110 + 1392: bf 4d sbci r27, 0xDF ; 223 + 1394: 9c 01 movw r18, r24 +{ + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); +} + +bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 1396: 8d 81 ldd r24, Y+5 ; 0x05 + 1398: 9e 81 ldd r25, Y+6 ; 0x06 + 139a: 8a 0f add r24, r26 + 139c: 9b 1f adc r25, r27 + 139e: f9 01 movw r30, r18 + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + uint8_t* SrcPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + 13a0: 21 91 ld r18, Z+ + 13a2: 2d 93 st X+, r18 + + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + uint8_t* SrcPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 13a4: a8 17 cp r26, r24 + 13a6: b9 07 cpc r27, r25 + 13a8: d9 f7 brne .-10 ; 0x13a0 + } + return true; } + +} + 13aa: 81 e0 ldi r24, 0x01 ; 1 + 13ac: 2e 96 adiw r28, 0x0e ; 14 + 13ae: cd bf out 0x3d, r28 ; 61 + 13b0: de bf out 0x3e, r29 ; 62 + 13b2: df 91 pop r29 + 13b4: cf 91 pop r28 + 13b6: 1f 91 pop r17 + 13b8: 0f 91 pop r16 + 13ba: ff 90 pop r15 + 13bc: ef 90 pop r14 + 13be: df 90 pop r13 + 13c0: cf 90 pop r12 + 13c2: bf 90 pop r11 + 13c4: af 90 pop r10 + 13c6: 9f 90 pop r9 + 13c8: 8f 90 pop r8 + 13ca: 7f 90 pop r7 + 13cc: 6f 90 pop r6 + 13ce: 5f 90 pop r5 + 13d0: 4f 90 pop r4 + 13d2: 3f 90 pop r3 + 13d4: 2f 90 pop r2 + 13d6: 08 95 ret + return true; + } else { + /* Calculate bytes left in memory and start writing */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 13d8: cd 82 std Y+5, r12 ; 0x05 + 13da: de 82 std Y+6, r13 ; 0x06 + 13dc: ef 82 std Y+7, r14 ; 0x07 + 13de: f8 86 std Y+8, r15 ; 0x08 + 13e0: 64 ce rjmp .-824 ; 0x10aa + +000013e2 : + } + } bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) { - 10ae: cf 92 push r12 - 10b0: df 92 push r13 - 10b2: ef 92 push r14 - 10b4: ff 92 push r15 - 10b6: 0f 93 push r16 - 10b8: 1f 93 push r17 - 10ba: fc 01 movw r30, r24 - 10bc: cb 01 movw r24, r22 - 10be: ba 01 movw r22, r20 - 10c0: 69 01 movw r12, r18 - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - 10c2: 61 15 cp r22, r1 - 10c4: 71 05 cpc r23, r1 - 10c6: 21 e0 ldi r18, 0x01 ; 1 - 10c8: 82 07 cpc r24, r18 - 10ca: 91 05 cpc r25, r1 - 10cc: 40 f0 brcs .+16 ; 0x10de - /* There are bytes out of bounds to be read. Notify that we are done. */ - return false; - 10ce: 80 e0 ldi r24, 0x00 ; 0 - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - MemoryReadBlock(Buffer, BlockAddress, ByteCount); - return true; - } -} - 10d0: 1f 91 pop r17 - 10d2: 0f 91 pop r16 - 10d4: ff 90 pop r15 - 10d6: ef 90 pop r14 - 10d8: df 90 pop r13 - 10da: cf 90 pop r12 - 10dc: 08 95 ret + 13e2: cf 92 push r12 + 13e4: df 92 push r13 + 13e6: ef 92 push r14 + 13e8: ff 92 push r15 + 13ea: 0f 93 push r16 + 13ec: 1f 93 push r17 + 13ee: 69 01 movw r12, r18 if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + 13f0: 41 15 cp r20, r1 + 13f2: 24 e0 ldi r18, 0x04 ; 4 + 13f4: 52 07 cpc r21, r18 + 13f6: 61 05 cpc r22, r1 + 13f8: 71 05 cpc r23, r1 + 13fa: 40 f5 brcc .+80 ; 0x144c /* There are bytes out of bounds to be read. Notify that we are done. */ return false; } else { /* Calculate bytes left in memory and issue reading */ uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - 10de: 00 e0 ldi r16, 0x00 ; 0 - 10e0: 10 e0 ldi r17, 0x00 ; 0 - 10e2: 21 e0 ldi r18, 0x01 ; 1 - 10e4: 30 e0 ldi r19, 0x00 ; 0 - 10e6: 06 1b sub r16, r22 - 10e8: 17 0b sbc r17, r23 - 10ea: 28 0b sbc r18, r24 - 10ec: 39 0b sbc r19, r25 - ByteCount = MIN(ByteCount, BytesLeft); - 10ee: e1 2c mov r14, r1 - 10f0: f1 2c mov r15, r1 - 10f2: 0c 15 cp r16, r12 - 10f4: 1d 05 cpc r17, r13 - 10f6: 2e 05 cpc r18, r14 - 10f8: 3f 05 cpc r19, r15 - 10fa: 58 f0 brcs .+22 ; 0x1112 - MemoryReadBlock(Buffer, BlockAddress, ByteCount); - 10fc: a6 01 movw r20, r12 - 10fe: cf 01 movw r24, r30 - 1100: 7b dd rcall .-1290 ; 0xbf8 - return true; - 1102: 81 e0 ldi r24, 0x01 ; 1 - } -} - 1104: 1f 91 pop r17 - 1106: 0f 91 pop r16 - 1108: ff 90 pop r15 - 110a: ef 90 pop r14 - 110c: df 90 pop r13 - 110e: cf 90 pop r12 - 1110: 08 95 ret - /* There are bytes out of bounds to be read. Notify that we are done. */ - return false; - } else { - /* Calculate bytes left in memory and issue reading */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - 1112: 68 01 movw r12, r16 - 1114: 79 01 movw r14, r18 - MemoryReadBlock(Buffer, BlockAddress, ByteCount); - 1116: a6 01 movw r20, r12 - 1118: cf 01 movw r24, r30 - 111a: 6e dd rcall .-1316 ; 0xbf8 - return true; - 111c: 81 e0 ldi r24, 0x01 ; 1 - 111e: f2 cf rjmp .-28 ; 0x1104 + 13fc: 00 e0 ldi r16, 0x00 ; 0 + 13fe: 14 e0 ldi r17, 0x04 ; 4 + 1400: 20 e0 ldi r18, 0x00 ; 0 + 1402: 30 e0 ldi r19, 0x00 ; 0 + 1404: 04 1b sub r16, r20 + 1406: 15 0b sbc r17, r21 + 1408: 26 0b sbc r18, r22 + 140a: 37 0b sbc r19, r23 + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 140c: e1 2c mov r14, r1 + 140e: f1 2c mov r15, r1 + 1410: 0c 15 cp r16, r12 + 1412: 1d 05 cpc r17, r13 + 1414: 2e 05 cpc r18, r14 + 1416: 3f 05 cpc r19, r15 + 1418: b0 f0 brcs .+44 ; 0x1446 -00001120 : - [BUTTON_ACTION_CYCLE_SETTINGS] = "CYCLE_SETTINGS" + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + uint8_t* SrcPtr = &Memory[BlockAddress]; + 141a: 4e 56 subi r20, 0x6E ; 110 + 141c: 5f 4d sbci r21, 0xDF ; 223 + + while(ByteCount--) { + 141e: c1 14 cp r12, r1 + 1420: d1 04 cpc r13, r1 + 1422: 49 f0 breq .+18 ; 0x1436 + 1424: da 01 movw r26, r20 + return true; + } + +} + +bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 1426: c8 0e add r12, r24 + 1428: d9 1e adc r13, r25 + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + 142a: fc 01 movw r30, r24 + uint8_t* SrcPtr = &Memory[BlockAddress]; + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + 142c: 8d 91 ld r24, X+ + 142e: 81 93 st Z+, r24 + + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + uint8_t* SrcPtr = &Memory[BlockAddress]; + + while(ByteCount--) { + 1430: ec 15 cp r30, r12 + 1432: fd 05 cpc r31, r13 + 1434: d9 f7 brne .-10 ; 0x142c + *DstPtr++ = *SrcPtr++; + } + + return true; + 1436: 81 e0 ldi r24, 0x01 ; 1 + } + 1438: 1f 91 pop r17 + 143a: 0f 91 pop r16 + 143c: ff 90 pop r15 + 143e: ef 90 pop r14 + 1440: df 90 pop r13 + 1442: cf 90 pop r12 + 1444: 08 95 ret + return false; + } else { + /* Calculate bytes left in memory and issue reading */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 1446: 68 01 movw r12, r16 + 1448: 79 01 movw r14, r18 + 144a: e7 cf rjmp .-50 ; 0x141a + +bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) +{ + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + /* There are bytes out of bounds to be read. Notify that we are done. */ + return false; + 144c: 80 e0 ldi r24, 0x00 ; 0 + *DstPtr++ = *SrcPtr++; + } + + return true; + } + 144e: 1f 91 pop r17 + 1450: 0f 91 pop r16 + 1452: ff 90 pop r15 + 1454: ef 90 pop r14 + 1456: df 90 pop r13 + 1458: cf 90 pop r12 + 145a: 08 95 ret + +0000145c : + [BUTTON_ACTION_RECALL_MEM] = "RECALL_MEM", }; void ButtonInit(void) { BUTTON_PORT.DIRCLR = BUTTON_MASK; - 1120: e0 e0 ldi r30, 0x00 ; 0 - 1122: f6 e0 ldi r31, 0x06 ; 6 - 1124: 80 e4 ldi r24, 0x40 ; 64 - 1126: 82 83 std Z+2, r24 ; 0x02 + 145c: e0 e0 ldi r30, 0x00 ; 0 + 145e: f6 e0 ldi r31, 0x06 ; 6 + 1460: 80 e4 ldi r24, 0x40 ; 64 + 1462: 82 83 std Z+2, r24 ; 0x02 BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; - 1128: 88 e1 ldi r24, 0x18 ; 24 - 112a: 86 8b std Z+22, r24 ; 0x16 - 112c: 08 95 ret + 1464: 88 e1 ldi r24, 0x18 ; 24 + 1466: 86 8b std Z+22, r24 ; 0x16 + 1468: 08 95 ret -0000112e : +0000146a : } void ButtonTick(void) { - 112e: ff 92 push r15 - 1130: 0f 93 push r16 - 1132: 1f 93 push r17 - 1134: cf 93 push r28 - 1136: df 93 push r29 - 1138: cd b7 in r28, 0x3d ; 61 - 113a: de b7 in r29, 0x3e ; 62 - 113c: a0 97 sbiw r28, 0x20 ; 32 - 113e: cd bf out 0x3d, r28 ; 61 - 1140: de bf out 0x3e, r29 ; 62 + 146a: ff 92 push r15 + 146c: 0f 93 push r16 + 146e: 1f 93 push r17 + 1470: cf 93 push r28 + 1472: df 93 push r29 + 1474: cd b7 in r28, 0x3d ; 61 + 1476: de b7 in r29, 0x3e ; 62 + 1478: a0 97 sbiw r28, 0x20 ; 32 + 147a: cd bf out 0x3d, r28 ; 61 + 147c: de bf out 0x3e, r29 ; 62 static uint8_t LastButtonState = 0; uint8_t ThisButtonState = ~BUTTON_PORT.IN; - 1142: 80 91 08 06 lds r24, 0x0608 - 1146: 80 95 com r24 + 147e: 80 91 08 06 lds r24, 0x0608 + 1482: 80 95 com r24 uint8_t ThisButtonChange = ThisButtonState ^ LastButtonState; - 1148: 90 91 92 20 lds r25, 0x2092 - 114c: 98 27 eor r25, r24 + 1484: 90 91 92 24 lds r25, 0x2492 + 1488: 98 27 eor r25, r24 uint8_t ThisButtonPress = ThisButtonChange & ThisButtonState; LastButtonState = ThisButtonState; - 114e: 80 93 92 20 sts 0x2092, r24 + 148a: 80 93 92 24 sts 0x2492, r24 void ButtonTick(void) { static uint8_t LastButtonState = 0; uint8_t ThisButtonState = ~BUTTON_PORT.IN; uint8_t ThisButtonChange = ThisButtonState ^ LastButtonState; uint8_t ThisButtonPress = ThisButtonChange & ThisButtonState; - 1152: 80 74 andi r24, 0x40 ; 64 + 148e: 80 74 andi r24, 0x40 ; 64 LastButtonState = ThisButtonState; if ( ThisButtonPress & BUTTON_MASK ) { - 1154: 89 23 and r24, r25 - 1156: a9 f0 breq .+42 ; 0x1182 + 1490: 89 23 and r24, r25 + 1492: d9 f0 breq .+54 ; 0x14ca uint8_t UidBuffer[32]; ButtonActionEnum ButtonAction = GlobalSettings.ActiveSettingPtr->ButtonAction; - 1158: e0 91 fe 20 lds r30, 0x20FE - 115c: f0 91 ff 20 lds r31, 0x20FF - 1160: 80 81 ld r24, Z + 1494: e0 91 fe 24 lds r30, 0x24FE + 1498: f0 91 ff 24 lds r31, 0x24FF + 149c: 80 81 ld r24, Z if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { - 1162: 81 30 cpi r24, 0x01 ; 1 - 1164: b9 f0 breq .+46 ; 0x1194 + 149e: 81 30 cpi r24, 0x01 ; 1 + 14a0: e9 f0 breq .+58 ; 0x14dc for (uint8_t i=0; i + 14a2: 82 30 cpi r24, 0x02 ; 2 + 14a4: a9 f1 breq .+106 ; 0x1510 UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; } } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { - 116a: 83 30 cpi r24, 0x03 ; 3 - 116c: 09 f4 brne .+2 ; 0x1170 - 116e: 4e c0 rjmp .+156 ; 0x120c + 14a6: 83 30 cpi r24, 0x03 ; 3 + 14a8: 09 f4 brne .+2 ; 0x14ac + 14aa: 54 c0 rjmp .+168 ; 0x1554 UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; } } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - 1170: 84 30 cpi r24, 0x04 ; 4 - 1172: 09 f4 brne .+2 ; 0x1176 - 1174: 6f c0 rjmp .+222 ; 0x1254 + 14ac: 84 30 cpi r24, 0x04 ; 4 + 14ae: 09 f4 brne .+2 ; 0x14b2 + 14b0: 77 c0 rjmp .+238 ; 0x15a0 UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; } } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { - 1176: 85 30 cpi r24, 0x05 ; 5 - 1178: 09 f4 brne .+2 ; 0x117c - 117a: 8e c0 rjmp .+284 ; 0x1298 + 14b2: 85 30 cpi r24, 0x05 ; 5 + 14b4: 09 f4 brne .+2 ; 0x14b8 + 14b6: 96 c0 rjmp .+300 ; 0x15e4 UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; } } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { - 117c: 86 30 cpi r24, 0x06 ; 6 - 117e: 09 f4 brne .+2 ; 0x1182 - 1180: 67 c0 rjmp .+206 ; 0x1250 + 14b8: 86 30 cpi r24, 0x06 ; 6 + 14ba: 09 f4 brne .+2 ; 0x14be + 14bc: b5 c0 rjmp .+362 ; 0x1628 SettingsCycle(); + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + 14be: 87 30 cpi r24, 0x07 ; 7 + 14c0: 09 f4 brne .+2 ; 0x14c4 + 14c2: 6a c0 rjmp .+212 ; 0x1598 + MemoryStore(); + } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { + 14c4: 88 30 cpi r24, 0x08 ; 8 + 14c6: 09 f4 brne .+2 ; 0x14ca + 14c8: 69 c0 rjmp .+210 ; 0x159c + MemoryRecall(); } } } - 1182: a0 96 adiw r28, 0x20 ; 32 - 1184: cd bf out 0x3d, r28 ; 61 - 1186: de bf out 0x3e, r29 ; 62 - 1188: df 91 pop r29 - 118a: cf 91 pop r28 - 118c: 1f 91 pop r17 - 118e: 0f 91 pop r16 - 1190: ff 90 pop r15 - 1192: 08 95 ret + 14ca: a0 96 adiw r28, 0x20 ; 32 + 14cc: cd bf out 0x3d, r28 ; 61 + 14ce: de bf out 0x3e, r29 ; 62 + 14d0: df 91 pop r29 + 14d2: cf 91 pop r28 + 14d4: 1f 91 pop r17 + 14d6: 0f 91 pop r16 + 14d8: ff 90 pop r15 + 14da: 08 95 ret if ( ThisButtonPress & BUTTON_MASK ) { uint8_t UidBuffer[32]; ButtonActionEnum ButtonAction = GlobalSettings.ActiveSettingPtr->ButtonAction; if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { for (uint8_t i=0; i - 119c: 9f c0 rjmp .+318 ; 0x12dc - 119e: f1 2c mov r15, r1 - 11a0: 8e 01 movw r16, r28 - 11a2: 0f 5f subi r16, 0xFF ; 255 - 11a4: 1f 4f sbci r17, 0xFF ; 255 + 14dc: 80 91 fb 24 lds r24, 0x24FB + 14e0: 88 23 and r24, r24 + 14e2: 09 f4 brne .+2 ; 0x14e6 + 14e4: a3 c0 rjmp .+326 ; 0x162c + 14e6: f1 2c mov r15, r1 + 14e8: 8e 01 movw r16, r28 + 14ea: 0f 5f subi r16, 0xFF ; 255 + 14ec: 1f 4f sbci r17, 0xFF ; 255 UidBuffer[i] = RandomGetByte(); - 11a6: 08 dc rcall .-2032 ; 0x9b8 - 11a8: f8 01 movw r30, r16 - 11aa: ef 0d add r30, r15 - 11ac: f1 1d adc r31, r1 - 11ae: 80 83 st Z, r24 + 14ee: 88 da rcall .-2800 ; 0xa00 + 14f0: f8 01 movw r30, r16 + 14f2: ef 0d add r30, r15 + 14f4: f1 1d adc r31, r1 + 14f6: 80 83 st Z, r24 if ( ThisButtonPress & BUTTON_MASK ) { uint8_t UidBuffer[32]; ButtonActionEnum ButtonAction = GlobalSettings.ActiveSettingPtr->ButtonAction; if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { for (uint8_t i=0; i + 14f8: f3 94 inc r15 + 14fa: 80 91 fb 24 lds r24, 0x24FB + 14fe: f8 16 cp r15, r24 + 1500: b0 f3 brcs .-20 ; 0x14ee INLINE void ApplicationGetUid(ConfigurationUidType Uid) { ActiveConfiguration.ApplicationGetUidFunc(Uid); } INLINE void ApplicationSetUid(ConfigurationUidType Uid) { ActiveConfiguration.ApplicationSetUidFunc(Uid); - 11ba: e0 91 f7 20 lds r30, 0x20F7 - 11be: f0 91 f8 20 lds r31, 0x20F8 - 11c2: c8 01 movw r24, r16 - 11c4: 09 95 icall - 11c6: dd cf rjmp .-70 ; 0x1182 + 1502: e0 91 f7 24 lds r30, 0x24F7 + 1506: f0 91 f8 24 lds r31, 0x24F8 + 150a: c8 01 movw r24, r16 + 150c: 09 95 icall + 150e: dd cf rjmp .-70 ; 0x14ca INLINE void ApplicationReset(void) { ActiveConfiguration.ApplicationResetFunc(); } INLINE void ApplicationGetUid(ConfigurationUidType Uid) { ActiveConfiguration.ApplicationGetUidFunc(Uid); - 11c8: e0 91 f5 20 lds r30, 0x20F5 - 11cc: f0 91 f6 20 lds r31, 0x20F6 - 11d0: 8e 01 movw r16, r28 - 11d2: 0f 5f subi r16, 0xFF ; 255 - 11d4: 1f 4f sbci r17, 0xFF ; 255 - 11d6: c8 01 movw r24, r16 - 11d8: 09 95 icall + 1510: e0 91 f5 24 lds r30, 0x24F5 + 1514: f0 91 f6 24 lds r31, 0x24F6 + 1518: 8e 01 movw r16, r28 + 151a: 0f 5f subi r16, 0xFF ; 255 + 151c: 1f 4f sbci r17, 0xFF ; 255 + 151e: c8 01 movw r24, r16 + 1520: 09 95 icall } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { ApplicationGetUid(UidBuffer); bool Carry = 1; uint8_t i; for (i=0; i - 11e2: f8 01 movw r30, r16 + 1522: 20 91 fb 24 lds r18, 0x24FB + 1526: 22 23 and r18, r18 + 1528: 61 f3 breq .-40 ; 0x1502 + 152a: f8 01 movw r30, r16 { BUTTON_PORT.DIRCLR = BUTTON_MASK; BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; } void ButtonTick(void) - 11e4: ce 01 movw r24, r28 - 11e6: 02 96 adiw r24, 0x02 ; 2 - 11e8: 21 50 subi r18, 0x01 ; 1 - 11ea: 82 0f add r24, r18 - 11ec: 91 1d adc r25, r1 + 152c: ce 01 movw r24, r28 + 152e: 02 96 adiw r24, 0x02 ; 2 + 1530: 21 50 subi r18, 0x01 ; 1 + 1532: 82 0f add r24, r18 + 1534: 91 1d adc r25, r1 } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { ApplicationGetUid(UidBuffer); bool Carry = 1; - 11ee: 21 e0 ldi r18, 0x01 ; 1 + 1536: 21 e0 ldi r18, 0x01 ; 1 uint8_t i; for (i=0; i + 1538: 22 23 and r18, r18 + 153a: 39 f0 breq .+14 ; 0x154a if (UidBuffer[i] == 0xFF) { - 11f4: 30 81 ld r19, Z - 11f6: 21 e0 ldi r18, 0x01 ; 1 - 11f8: 3f 3f cpi r19, 0xFF ; 255 - 11fa: 09 f0 breq .+2 ; 0x11fe - 11fc: 20 e0 ldi r18, 0x00 ; 0 + 153c: 30 81 ld r19, Z + 153e: 21 e0 ldi r18, 0x01 ; 1 + 1540: 3f 3f cpi r19, 0xFF ; 255 + 1542: 09 f0 breq .+2 ; 0x1546 + 1544: 20 e0 ldi r18, 0x00 ; 0 Carry = 1; } else { Carry = 0; } UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - 11fe: 3f 5f subi r19, 0xFF ; 255 - 1200: 30 83 st Z, r19 - 1202: 31 96 adiw r30, 0x01 ; 1 + 1546: 3f 5f subi r19, 0xFF ; 255 + 1548: 30 83 st Z, r19 + 154a: 31 96 adiw r30, 0x01 ; 1 } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { ApplicationGetUid(UidBuffer); bool Carry = 1; uint8_t i; for (i=0; i - 120a: d7 cf rjmp .-82 ; 0x11ba - 120c: e0 91 f5 20 lds r30, 0x20F5 - 1210: f0 91 f6 20 lds r31, 0x20F6 - 1214: 8e 01 movw r16, r28 - 1216: 0f 5f subi r16, 0xFF ; 255 - 1218: 1f 4f sbci r17, 0xFF ; 255 - 121a: c8 01 movw r24, r16 - 121c: 09 95 icall + 154c: e8 17 cp r30, r24 + 154e: f9 07 cpc r31, r25 + 1550: 99 f7 brne .-26 ; 0x1538 + 1552: d7 cf rjmp .-82 ; 0x1502 + 1554: e0 91 f5 24 lds r30, 0x24F5 + 1558: f0 91 f6 24 lds r31, 0x24F6 + 155c: 8e 01 movw r16, r28 + 155e: 0f 5f subi r16, 0xFF ; 255 + 1560: 1f 4f sbci r17, 0xFF ; 255 + 1562: c8 01 movw r24, r16 + 1564: 09 95 icall ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { ApplicationGetUid(UidBuffer); bool Carry = 1; uint8_t i = ActiveConfiguration.UidSize; - 121e: 20 91 fb 20 lds r18, 0x20FB + 1566: 20 91 fb 24 lds r18, 0x24FB } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { ApplicationGetUid(UidBuffer); bool Carry = 1; - 1222: 31 e0 ldi r19, 0x01 ; 1 + 156a: 31 e0 ldi r19, 0x01 ; 1 uint8_t i = ActiveConfiguration.UidSize; while(i-- > 0) { - 1224: 21 50 subi r18, 0x01 ; 1 - 1226: 48 f2 brcs .-110 ; 0x11ba + 156c: 21 50 subi r18, 0x01 ; 1 + 156e: 48 f2 brcs .-110 ; 0x1502 if (Carry) { - 1228: 33 23 and r19, r19 - 122a: e1 f3 breq .-8 ; 0x1224 + 1570: 33 23 and r19, r19 + 1572: e1 f3 breq .-8 ; 0x156c if (UidBuffer[i] == 0xFF) { - 122c: 82 2f mov r24, r18 - 122e: 90 e0 ldi r25, 0x00 ; 0 - 1230: f8 01 movw r30, r16 - 1232: e8 0f add r30, r24 - 1234: f9 1f adc r31, r25 - 1236: 40 81 ld r20, Z - 1238: 31 e0 ldi r19, 0x01 ; 1 - 123a: 4f 3f cpi r20, 0xFF ; 255 - 123c: 09 f0 breq .+2 ; 0x1240 - 123e: 30 e0 ldi r19, 0x00 ; 0 + 1574: 82 2f mov r24, r18 + 1576: 90 e0 ldi r25, 0x00 ; 0 + 1578: f8 01 movw r30, r16 + 157a: e8 0f add r30, r24 + 157c: f9 1f adc r31, r25 + 157e: 40 81 ld r20, Z + 1580: 31 e0 ldi r19, 0x01 ; 1 + 1582: 4f 3f cpi r20, 0xFF ; 255 + 1584: 09 f0 breq .+2 ; 0x1588 + 1586: 30 e0 ldi r19, 0x00 ; 0 Carry = 1; } else { Carry = 0; } UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - 1240: f8 01 movw r30, r16 - 1242: e8 0f add r30, r24 - 1244: f9 1f adc r31, r25 - 1246: 4f 5f subi r20, 0xFF ; 255 - 1248: 40 83 st Z, r20 + 1588: f8 01 movw r30, r16 + 158a: e8 0f add r30, r24 + 158c: f9 1f adc r31, r25 + 158e: 4f 5f subi r20, 0xFF ; 255 + 1590: 40 83 st Z, r20 } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { ApplicationGetUid(UidBuffer); bool Carry = 1; uint8_t i = ActiveConfiguration.UidSize; while(i-- > 0) { - 124a: 21 50 subi r18, 0x01 ; 1 - 124c: 68 f7 brcc .-38 ; 0x1228 - 124e: b5 cf rjmp .-150 ; 0x11ba + 1592: 21 50 subi r18, 0x01 ; 1 + 1594: 68 f7 brcc .-38 ; 0x1570 + 1596: b5 cf rjmp .-150 ; 0x1502 + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { + SettingsCycle(); + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + MemoryStore(); + 1598: 02 dc rcall .-2044 ; 0xd9e + 159a: 97 cf rjmp .-210 ; 0x14ca + } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { + MemoryRecall(); + 159c: 0c db rcall .-2536 ; 0xbb6 + 159e: 95 cf rjmp .-214 ; 0x14ca + 15a0: e0 91 f5 24 lds r30, 0x24F5 + 15a4: f0 91 f6 24 lds r31, 0x24F6 + 15a8: 8e 01 movw r16, r28 + 15aa: 0f 5f subi r16, 0xFF ; 255 + 15ac: 1f 4f sbci r17, 0xFF ; 255 + 15ae: c8 01 movw r24, r16 + 15b0: 09 95 icall + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i + 15ba: a3 cf rjmp .-186 ; 0x1502 + 15bc: f8 01 movw r30, r16 +{ + BUTTON_PORT.DIRCLR = BUTTON_MASK; + BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; +} + +void ButtonTick(void) + 15be: ce 01 movw r24, r28 + 15c0: 02 96 adiw r24, 0x02 ; 2 + 15c2: 21 50 subi r18, 0x01 ; 1 + 15c4: 82 0f add r24, r18 + 15c6: 91 1d adc r25, r1 + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + 15c8: 21 e0 ldi r18, 0x01 ; 1 + uint8_t i; + + for (i=0; i + if (UidBuffer[i] == 0x00) { + 15ce: 30 81 ld r19, Z + 15d0: 21 e0 ldi r18, 0x01 ; 1 + 15d2: 31 11 cpse r19, r1 + 15d4: 20 e0 ldi r18, 0x00 ; 0 + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + 15d6: 31 50 subi r19, 0x01 ; 1 + 15d8: 30 83 st Z, r19 + 15da: 31 96 adiw r30, 0x01 ; 1 + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i + 15e2: 8f cf rjmp .-226 ; 0x1502 + 15e4: e0 91 f5 24 lds r30, 0x24F5 + 15e8: f0 91 f6 24 lds r31, 0x24F6 + 15ec: 8e 01 movw r16, r28 + 15ee: 0f 5f subi r16, 0xFF ; 255 + 15f0: 1f 4f sbci r17, 0xFF ; 255 + 15f2: c8 01 movw r24, r16 + 15f4: 09 95 icall + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i = ActiveConfiguration.UidSize; + 15f6: 20 91 fb 24 lds r18, 0x24FB + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + 15fa: 31 e0 ldi r19, 0x01 ; 1 + uint8_t i = ActiveConfiguration.UidSize; + + while(i-- > 0) { + 15fc: 21 50 subi r18, 0x01 ; 1 + 15fe: 08 f4 brcc .+2 ; 0x1602 + 1600: 80 cf rjmp .-256 ; 0x1502 + if (Carry) { + 1602: 33 23 and r19, r19 + 1604: d9 f3 breq .-10 ; 0x15fc + if (UidBuffer[i] == 0x00) { + 1606: 82 2f mov r24, r18 + 1608: 90 e0 ldi r25, 0x00 ; 0 + 160a: f8 01 movw r30, r16 + 160c: e8 0f add r30, r24 + 160e: f9 1f adc r31, r25 + 1610: 40 81 ld r20, Z + 1612: 31 e0 ldi r19, 0x01 ; 1 + 1614: 41 11 cpse r20, r1 + 1616: 30 e0 ldi r19, 0x00 ; 0 + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + 1618: f8 01 movw r30, r16 + 161a: e8 0f add r30, r24 + 161c: f9 1f adc r31, r25 + 161e: 41 50 subi r20, 0x01 ; 1 + 1620: 40 83 st Z, r20 + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i = ActiveConfiguration.UidSize; + + while(i-- > 0) { + 1622: 21 50 subi r18, 0x01 ; 1 + 1624: 70 f7 brcc .-36 ; 0x1602 + 1626: 6d cf rjmp .-294 ; 0x1502 } } ApplicationSetUid(UidBuffer); } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { SettingsCycle(); - 1250: f7 d0 rcall .+494 ; 0x1440 - 1252: 97 cf rjmp .-210 ; 0x1182 - 1254: e0 91 f5 20 lds r30, 0x20F5 - 1258: f0 91 f6 20 lds r31, 0x20F6 - 125c: 8e 01 movw r16, r28 - 125e: 0f 5f subi r16, 0xFF ; 255 - 1260: 1f 4f sbci r17, 0xFF ; 255 - 1262: c8 01 movw r24, r16 - 1264: 09 95 icall - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i; + 1628: cc d0 rcall .+408 ; 0x17c2 + 162a: 4f cf rjmp .-354 ; 0x14ca + 162c: 8e 01 movw r16, r28 + 162e: 0f 5f subi r16, 0xFF ; 255 + 1630: 1f 4f sbci r17, 0xFF ; 255 + 1632: 67 cf rjmp .-306 ; 0x1502 - for (i=0; i - 126e: a5 cf rjmp .-182 ; 0x11ba - 1270: f8 01 movw r30, r16 -{ - BUTTON_PORT.DIRCLR = BUTTON_MASK; - BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; -} - -void ButtonTick(void) - 1272: ce 01 movw r24, r28 - 1274: 02 96 adiw r24, 0x02 ; 2 - 1276: 21 50 subi r18, 0x01 ; 1 - 1278: 82 0f add r24, r18 - 127a: 91 1d adc r25, r1 - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - 127c: 21 e0 ldi r18, 0x01 ; 1 - uint8_t i; - - for (i=0; i - if (UidBuffer[i] == 0x00) { - 1282: 30 81 ld r19, Z - 1284: 21 e0 ldi r18, 0x01 ; 1 - 1286: 31 11 cpse r19, r1 - 1288: 20 e0 ldi r18, 0x00 ; 0 - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; - 128a: 31 50 subi r19, 0x01 ; 1 - 128c: 30 83 st Z, r19 - 128e: 31 96 adiw r30, 0x01 ; 1 - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i; - - for (i=0; i - 1296: 91 cf rjmp .-222 ; 0x11ba - 1298: e0 91 f5 20 lds r30, 0x20F5 - 129c: f0 91 f6 20 lds r31, 0x20F6 - 12a0: 8e 01 movw r16, r28 - 12a2: 0f 5f subi r16, 0xFF ; 255 - 12a4: 1f 4f sbci r17, 0xFF ; 255 - 12a6: c8 01 movw r24, r16 - 12a8: 09 95 icall - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i = ActiveConfiguration.UidSize; - 12aa: 20 91 fb 20 lds r18, 0x20FB - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - 12ae: 31 e0 ldi r19, 0x01 ; 1 - uint8_t i = ActiveConfiguration.UidSize; - - while(i-- > 0) { - 12b0: 21 50 subi r18, 0x01 ; 1 - 12b2: 08 f4 brcc .+2 ; 0x12b6 - 12b4: 82 cf rjmp .-252 ; 0x11ba - if (Carry) { - 12b6: 33 23 and r19, r19 - 12b8: d9 f3 breq .-10 ; 0x12b0 - if (UidBuffer[i] == 0x00) { - 12ba: 82 2f mov r24, r18 - 12bc: 90 e0 ldi r25, 0x00 ; 0 - 12be: f8 01 movw r30, r16 - 12c0: e8 0f add r30, r24 - 12c2: f9 1f adc r31, r25 - 12c4: 40 81 ld r20, Z - 12c6: 31 e0 ldi r19, 0x01 ; 1 - 12c8: 41 11 cpse r20, r1 - 12ca: 30 e0 ldi r19, 0x00 ; 0 - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; - 12cc: f8 01 movw r30, r16 - 12ce: e8 0f add r30, r24 - 12d0: f9 1f adc r31, r25 - 12d2: 41 50 subi r20, 0x01 ; 1 - 12d4: 40 83 st Z, r20 - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i = ActiveConfiguration.UidSize; - - while(i-- > 0) { - 12d6: 21 50 subi r18, 0x01 ; 1 - 12d8: 70 f7 brcc .-36 ; 0x12b6 - 12da: 6f cf rjmp .-290 ; 0x11ba - 12dc: 8e 01 movw r16, r28 - 12de: 0f 5f subi r16, 0xFF ; 255 - 12e0: 1f 4f sbci r17, 0xFF ; 255 - 12e2: 6b cf rjmp .-298 ; 0x11ba - -000012e4 : +00001634 : } } } void ButtonGetActionList(char* ListOut, uint16_t BufferSize) { - 12e4: cf 93 push r28 - 12e6: df 93 push r29 - 12e8: ec 01 movw r28, r24 + 1634: cf 93 push r28 + 1636: df 93 push r29 + 1638: ec 01 movw r28, r24 uint8_t i; /* Account for '\0' */ BufferSize--; - 12ea: 61 50 subi r22, 0x01 ; 1 - 12ec: 71 09 sbc r23, r1 - 12ee: 80 e0 ldi r24, 0x00 ; 0 - 12f0: 90 e0 ldi r25, 0x00 ; 0 + 163a: 61 50 subi r22, 0x01 ; 1 + 163c: 71 09 sbc r23, r1 + 163e: 80 e0 ldi r24, 0x00 ; 0 + 1640: 90 e0 ldi r25, 0x00 ; 0 BufferSize--; } if ( i < (BUTTON_ACTION_COUNT - 1) ) { /* No comma on last configuration */ *ListOut++ = ','; - 12f2: 3c e2 ldi r19, 0x2C ; 44 + 1642: 3c e2 ldi r19, 0x2C ; 44 /* Account for '\0' */ BufferSize--; for (i=0; i sizeof(ButtonActionTable[i]) ) { - 130a: 24 91 lpm r18, Z - 130c: 22 23 and r18, r18 - 130e: 81 f0 breq .+32 ; 0x1330 - 1310: 61 32 cpi r22, 0x21 ; 33 - 1312: 71 05 cpc r23, r1 - 1314: 68 f0 brcs .+26 ; 0x1330 - 1316: de 01 movw r26, r28 - 1318: 03 c0 rjmp .+6 ; 0x1320 - 131a: 60 32 cpi r22, 0x20 ; 32 - 131c: 71 05 cpc r23, r1 - 131e: 41 f0 breq .+16 ; 0x1330 + 165a: 24 91 lpm r18, Z + 165c: 22 23 and r18, r18 + 165e: 81 f0 breq .+32 ; 0x1680 + 1660: 61 32 cpi r22, 0x21 ; 33 + 1662: 71 05 cpc r23, r1 + 1664: 68 f0 brcs .+26 ; 0x1680 + 1666: de 01 movw r26, r28 + 1668: 03 c0 rjmp .+6 ; 0x1670 + 166a: 60 32 cpi r22, 0x20 ; 32 + 166c: 71 05 cpc r23, r1 + 166e: 41 f0 breq .+16 ; 0x1680 /* While not end-of-string and enough buffer to * put a complete configuration name */ *ListOut++ = c; - 1320: 2d 93 st X+, r18 - 1322: ed 01 movw r28, r26 + 1670: 2d 93 st X+, r18 + 1672: ed 01 movw r28, r26 ActionName++; - 1324: 31 96 adiw r30, 0x01 ; 1 + 1674: 31 96 adiw r30, 0x01 ; 1 BufferSize--; - 1326: 61 50 subi r22, 0x01 ; 1 - 1328: 71 09 sbc r23, r1 + 1676: 61 50 subi r22, 0x01 ; 1 + 1678: 71 09 sbc r23, r1 for (i=0; i sizeof(ButtonActionTable[i]) ) { - 132a: 24 91 lpm r18, Z - 132c: 21 11 cpse r18, r1 - 132e: f5 cf rjmp .-22 ; 0x131a + 167a: 24 91 lpm r18, Z + 167c: 21 11 cpse r18, r1 + 167e: f5 cf rjmp .-22 ; 0x166a *ListOut++ = c; ActionName++; BufferSize--; } if ( i < (BUTTON_ACTION_COUNT - 1) ) { - 1330: 86 30 cpi r24, 0x06 ; 6 - 1332: 91 05 cpc r25, r1 - 1334: 21 f4 brne .+8 ; 0x133e + 1680: 88 30 cpi r24, 0x08 ; 8 + 1682: 91 05 cpc r25, r1 + 1684: 21 f4 brne .+8 ; 0x168e *ListOut++ = ','; BufferSize--; } } *ListOut = '\0'; - 1336: 18 82 st Y, r1 + 1686: 18 82 st Y, r1 } - 1338: df 91 pop r29 - 133a: cf 91 pop r28 - 133c: 08 95 ret + 1688: df 91 pop r29 + 168a: cf 91 pop r28 + 168c: 08 95 ret BufferSize--; } if ( i < (BUTTON_ACTION_COUNT - 1) ) { /* No comma on last configuration */ *ListOut++ = ','; - 133e: 39 93 st Y+, r19 + 168e: 39 93 st Y+, r19 BufferSize--; - 1340: 61 50 subi r22, 0x01 ; 1 - 1342: 71 09 sbc r23, r1 - 1344: 01 96 adiw r24, 0x01 ; 1 - 1346: d6 cf rjmp .-84 ; 0x12f4 + 1690: 61 50 subi r22, 0x01 ; 1 + 1692: 71 09 sbc r23, r1 + 1694: 01 96 adiw r24, 0x01 ; 1 + 1696: d6 cf rjmp .-84 ; 0x1644 -00001348 : - *ListOut = '\0'; +00001698 : } void ButtonSetActionById(ButtonActionEnum Action) { +#ifndef BUTTON_SETTING_GLOBAL GlobalSettings.ActiveSettingPtr->ButtonAction = Action; - 1348: e0 91 fe 20 lds r30, 0x20FE - 134c: f0 91 ff 20 lds r31, 0x20FF - 1350: 80 83 st Z, r24 - 1352: 08 95 ret + 1698: e0 91 fe 24 lds r30, 0x24FE + 169c: f0 91 ff 24 lds r31, 0x24FF + 16a0: 80 83 st Z, r24 + 16a2: 08 95 ret -00001354 : +000016a4 : + } +#endif } void ButtonGetActionByName(char* ActionOut, uint16_t BufferSize) { - 1354: ab 01 movw r20, r22 + 16a4: ab 01 movw r20, r22 strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonAction], BufferSize); - 1356: e0 91 fe 20 lds r30, 0x20FE - 135a: f0 91 ff 20 lds r31, 0x20FF - 135e: 60 81 ld r22, Z - 1360: 20 e2 ldi r18, 0x20 ; 32 - 1362: 62 9f mul r22, r18 - 1364: b0 01 movw r22, r0 - 1366: 11 24 eor r1, r1 - 1368: 69 50 subi r22, 0x09 ; 9 - 136a: 7d 4f sbci r23, 0xFD ; 253 - 136c: 0c 94 1f 24 jmp 0x483e ; 0x483e + 16a6: e0 91 fe 24 lds r30, 0x24FE + 16aa: f0 91 ff 24 lds r31, 0x24FF + 16ae: 60 81 ld r22, Z + 16b0: 20 e2 ldi r18, 0x20 ; 32 + 16b2: 62 9f mul r22, r18 + 16b4: b0 01 movw r22, r0 + 16b6: 11 24 eor r1, r1 + 16b8: 69 50 subi r22, 0x09 ; 9 + 16ba: 7d 4f sbci r23, 0xFD ; 253 + 16bc: 0c 94 e8 25 jmp 0x4bd0 ; 0x4bd0 -00001370 : +000016c0 : } bool ButtonSetActionByName(const char* Action) { - 1370: cf 93 push r28 - 1372: df 93 push r29 - 1374: ec 01 movw r28, r24 + 16c0: cf 93 push r28 + 16c2: df 93 push r29 + 16c4: ec 01 movw r28, r24 uint8_t i; for (i=0; i - 137e: 89 2b or r24, r25 - 1380: 71 f1 breq .+92 ; 0x13de - 1382: 67 e1 ldi r22, 0x17 ; 23 - 1384: 73 e0 ldi r23, 0x03 ; 3 - 1386: ce 01 movw r24, r28 - 1388: 0e 94 16 24 call 0x482c ; 0x482c - 138c: 89 2b or r24, r25 - 138e: 69 f1 breq .+90 ; 0x13ea - 1390: 67 e3 ldi r22, 0x37 ; 55 - 1392: 73 e0 ldi r23, 0x03 ; 3 - 1394: ce 01 movw r24, r28 - 1396: 0e 94 16 24 call 0x482c ; 0x482c - 139a: 89 2b or r24, r25 - 139c: 41 f1 breq .+80 ; 0x13ee - 139e: 67 e5 ldi r22, 0x57 ; 87 - 13a0: 73 e0 ldi r23, 0x03 ; 3 - 13a2: ce 01 movw r24, r28 - 13a4: 0e 94 16 24 call 0x482c ; 0x482c - 13a8: 89 2b or r24, r25 - 13aa: 19 f1 breq .+70 ; 0x13f2 - 13ac: 67 e7 ldi r22, 0x77 ; 119 - 13ae: 73 e0 ldi r23, 0x03 ; 3 - 13b0: ce 01 movw r24, r28 - 13b2: 0e 94 16 24 call 0x482c ; 0x482c - 13b6: 89 2b or r24, r25 - 13b8: f1 f0 breq .+60 ; 0x13f6 - 13ba: 67 e9 ldi r22, 0x97 ; 151 - 13bc: 73 e0 ldi r23, 0x03 ; 3 - 13be: ce 01 movw r24, r28 - 13c0: 0e 94 16 24 call 0x482c ; 0x482c - 13c4: 89 2b or r24, r25 - 13c6: c9 f0 breq .+50 ; 0x13fa - 13c8: 67 eb ldi r22, 0xB7 ; 183 - 13ca: 73 e0 ldi r23, 0x03 ; 3 - 13cc: ce 01 movw r24, r28 - 13ce: 0e 94 16 24 call 0x482c ; 0x482c - 13d2: 89 2b or r24, r25 - 13d4: a1 f0 breq .+40 ; 0x13fe + 16c6: 67 ef ldi r22, 0xF7 ; 247 + 16c8: 72 e0 ldi r23, 0x02 ; 2 + 16ca: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 16ce: 89 2b or r24, r25 + 16d0: e1 f1 breq .+120 ; 0x174a + 16d2: 67 e1 ldi r22, 0x17 ; 23 + 16d4: 73 e0 ldi r23, 0x03 ; 3 + 16d6: ce 01 movw r24, r28 + 16d8: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 16dc: 89 2b or r24, r25 + 16de: d9 f1 breq .+118 ; 0x1756 + 16e0: 67 e3 ldi r22, 0x37 ; 55 + 16e2: 73 e0 ldi r23, 0x03 ; 3 + 16e4: ce 01 movw r24, r28 + 16e6: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 16ea: 89 2b or r24, r25 + 16ec: b1 f1 breq .+108 ; 0x175a + 16ee: 67 e5 ldi r22, 0x57 ; 87 + 16f0: 73 e0 ldi r23, 0x03 ; 3 + 16f2: ce 01 movw r24, r28 + 16f4: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 16f8: 89 2b or r24, r25 + 16fa: 89 f1 breq .+98 ; 0x175e + 16fc: 67 e7 ldi r22, 0x77 ; 119 + 16fe: 73 e0 ldi r23, 0x03 ; 3 + 1700: ce 01 movw r24, r28 + 1702: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1706: 89 2b or r24, r25 + 1708: 61 f1 breq .+88 ; 0x1762 + 170a: 67 e9 ldi r22, 0x97 ; 151 + 170c: 73 e0 ldi r23, 0x03 ; 3 + 170e: ce 01 movw r24, r28 + 1710: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1714: 89 2b or r24, r25 + 1716: 39 f1 breq .+78 ; 0x1766 + 1718: 67 eb ldi r22, 0xB7 ; 183 + 171a: 73 e0 ldi r23, 0x03 ; 3 + 171c: ce 01 movw r24, r28 + 171e: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1722: 89 2b or r24, r25 + 1724: 11 f1 breq .+68 ; 0x176a + 1726: 67 ed ldi r22, 0xD7 ; 215 + 1728: 73 e0 ldi r23, 0x03 ; 3 + 172a: ce 01 movw r24, r28 + 172c: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1730: 89 2b or r24, r25 + 1732: e9 f0 breq .+58 ; 0x176e + 1734: 67 ef ldi r22, 0xF7 ; 247 + 1736: 73 e0 ldi r23, 0x03 ; 3 + 1738: ce 01 movw r24, r28 + 173a: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 173e: 89 2b or r24, r25 + 1740: c1 f0 breq .+48 ; 0x1772 return true; } } /* Button action not found */ return false; - 13d6: 80 e0 ldi r24, 0x00 ; 0 + 1742: 80 e0 ldi r24, 0x00 ; 0 } - 13d8: df 91 pop r29 - 13da: cf 91 pop r28 - 13dc: 08 95 ret + 1744: df 91 pop r29 + 1746: cf 91 pop r28 + 1748: 08 95 ret bool ButtonSetActionByName(const char* Action) { uint8_t i; for (i=0; i + 174c: a5 df rcall .-182 ; 0x1698 return true; - 13e2: 81 e0 ldi r24, 0x01 ; 1 + 174e: 81 e0 ldi r24, 0x01 ; 1 } } /* Button action not found */ return false; } - 13e4: df 91 pop r29 - 13e6: cf 91 pop r28 - 13e8: 08 95 ret + 1750: df 91 pop r29 + 1752: cf 91 pop r28 + 1754: 08 95 ret bool ButtonSetActionByName(const char* Action) { uint8_t i; for (i=0; i - 13ee: 82 e0 ldi r24, 0x02 ; 2 - 13f0: f7 cf rjmp .-18 ; 0x13e0 - 13f2: 83 e0 ldi r24, 0x03 ; 3 - 13f4: f5 cf rjmp .-22 ; 0x13e0 - 13f6: 84 e0 ldi r24, 0x04 ; 4 - 13f8: f3 cf rjmp .-26 ; 0x13e0 - 13fa: 85 e0 ldi r24, 0x05 ; 5 - 13fc: f1 cf rjmp .-30 ; 0x13e0 + 1756: 81 e0 ldi r24, 0x01 ; 1 + 1758: f9 cf rjmp .-14 ; 0x174c + 175a: 82 e0 ldi r24, 0x02 ; 2 + 175c: f7 cf rjmp .-18 ; 0x174c + 175e: 83 e0 ldi r24, 0x03 ; 3 + 1760: f5 cf rjmp .-22 ; 0x174c + 1762: 84 e0 ldi r24, 0x04 ; 4 + 1764: f3 cf rjmp .-26 ; 0x174c + 1766: 85 e0 ldi r24, 0x05 ; 5 + 1768: f1 cf rjmp .-30 ; 0x174c + 176a: 86 e0 ldi r24, 0x06 ; 6 + 176c: ef cf rjmp .-34 ; 0x174c + 176e: 87 e0 ldi r24, 0x07 ; 7 + 1770: ed cf rjmp .-38 ; 0x174c if (strcmp_P(Action, ButtonActionTable[i]) == 0) { - 13fe: 86 e0 ldi r24, 0x06 ; 6 - 1400: ef cf rjmp .-34 ; 0x13e0 + 1772: 88 e0 ldi r24, 0x08 ; 8 + 1774: eb cf rjmp .-42 ; 0x174c -00001402 : +00001776 : .ButtonAction = DEFAULT_BUTTON_ACTION, } } }; void SettingsLoad(void) { eeprom_read_block(&GlobalSettings, &StoredSettings, sizeof(SettingsType)); - 1402: 43 e1 ldi r20, 0x13 ; 19 - 1404: 50 e0 ldi r21, 0x00 ; 0 - 1406: 60 e0 ldi r22, 0x00 ; 0 - 1408: 70 e0 ldi r23, 0x00 ; 0 - 140a: 8d ef ldi r24, 0xFD ; 253 - 140c: 90 e2 ldi r25, 0x20 ; 32 - 140e: 0c 94 31 26 jmp 0x4c62 ; 0x4c62 <__eerd_block_x32a4u> + 1776: 43 e1 ldi r20, 0x13 ; 19 + 1778: 50 e0 ldi r21, 0x00 ; 0 + 177a: 60 e0 ldi r22, 0x00 ; 0 + 177c: 70 e0 ldi r23, 0x00 ; 0 + 177e: 8d ef ldi r24, 0xFD ; 253 + 1780: 94 e2 ldi r25, 0x24 ; 36 + 1782: 0c 94 fa 27 jmp 0x4ff4 ; 0x4ff4 <__eerd_block_x32a4u> -00001412 : +00001786 : } void SettingsSave(void) { #if ENABLE_EEPROM_SETTINGS eeprom_write_block(&GlobalSettings, &StoredSettings, sizeof(SettingsType)); - 1412: 43 e1 ldi r20, 0x13 ; 19 - 1414: 50 e0 ldi r21, 0x00 ; 0 - 1416: 60 e0 ldi r22, 0x00 ; 0 - 1418: 70 e0 ldi r23, 0x00 ; 0 - 141a: 8d ef ldi r24, 0xFD ; 253 - 141c: 90 e2 ldi r25, 0x20 ; 32 - 141e: 0c 94 3c 26 jmp 0x4c78 ; 0x4c78 <__eewr_block_x32a4u> + 1786: 43 e1 ldi r20, 0x13 ; 19 + 1788: 50 e0 ldi r21, 0x00 ; 0 + 178a: 60 e0 ldi r22, 0x00 ; 0 + 178c: 70 e0 ldi r23, 0x00 ; 0 + 178e: 8d ef ldi r24, 0xFD ; 253 + 1790: 94 e2 ldi r25, 0x24 ; 36 + 1792: 0c 94 05 28 jmp 0x500a ; 0x500a <__eewr_block_x32a4u> -00001422 : +00001796 : + break; } } } void SettingsSetActiveById(uint8_t Setting) { + 1796: cf 93 push r28 + 1798: c8 2f mov r28, r24 if (Setting < SETTINGS_COUNT) { - 1422: 88 30 cpi r24, 0x08 ; 8 - 1424: 08 f0 brcs .+2 ; 0x1428 - 1426: 08 95 ret - GlobalSettings.ActiveSetting = Setting; - 1428: 80 93 fd 20 sts 0x20FD, r24 - GlobalSettings.ActiveSettingPtr = - &GlobalSettings.Settings[GlobalSettings.ActiveSetting]; - 142c: 90 e0 ldi r25, 0x00 ; 0 - 142e: 88 0f add r24, r24 - 1430: 99 1f adc r25, r25 - 1432: 80 50 subi r24, 0x00 ; 0 - 1434: 9f 4d sbci r25, 0xDF ; 223 + 179a: 88 30 cpi r24, 0x08 ; 8 + 179c: 10 f0 brcs .+4 ; 0x17a2 + ConfigurationInit(); + + /* Recall new memory contents */ + MemoryRecall(); + } +} + 179e: cf 91 pop r28 + 17a0: 08 95 ret } void SettingsSetActiveById(uint8_t Setting) { if (Setting < SETTINGS_COUNT) { + /* Store current memory contents permanently */ + MemoryStore(); + 17a2: fd da rcall .-2566 ; 0xd9e + + GlobalSettings.ActiveSetting = Setting; + 17a4: c0 93 fd 24 sts 0x24FD, r28 + GlobalSettings.ActiveSettingPtr = + &GlobalSettings.Settings[GlobalSettings.ActiveSetting]; + 17a8: 8c 2f mov r24, r28 + 17aa: 90 e0 ldi r25, 0x00 ; 0 + 17ac: 88 0f add r24, r24 + 17ae: 99 1f adc r25, r25 + 17b0: 80 50 subi r24, 0x00 ; 0 + 17b2: 9b 4d sbci r25, 0xDB ; 219 + if (Setting < SETTINGS_COUNT) { + /* Store current memory contents permanently */ + MemoryStore(); + GlobalSettings.ActiveSetting = Setting; GlobalSettings.ActiveSettingPtr = - 1436: 80 93 fe 20 sts 0x20FE, r24 - 143a: 90 93 ff 20 sts 0x20FF, r25 + 17b4: 80 93 fe 24 sts 0x24FE, r24 + 17b8: 90 93 ff 24 sts 0x24FF, r25 &GlobalSettings.Settings[GlobalSettings.ActiveSetting]; /* Settings have changed. Progress changes through system */ ConfigurationInit(); - 143e: 45 ca rjmp .-2934 ; 0x8ca + 17bc: aa d8 rcall .-3756 ; 0x912 + + /* Recall new memory contents */ + MemoryRecall(); + } +} + 17be: cf 91 pop r28 -00001440 : + /* Settings have changed. Progress changes through system */ + ConfigurationInit(); + + /* Recall new memory contents */ + MemoryRecall(); + 17c0: fa c9 rjmp .-3084 ; 0xbb6 + +000017c2 : void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 1440: 20 91 fd 20 lds r18, 0x20FD - 1444: 30 e0 ldi r19, 0x00 ; 0 - 1446: 2f 5f subi r18, 0xFF ; 255 - 1448: 3f 4f sbci r19, 0xFF ; 255 - 144a: 27 70 andi r18, 0x07 ; 7 - 144c: 33 27 eor r19, r19 - 144e: 82 2f mov r24, r18 + 17c2: 20 91 fd 24 lds r18, 0x24FD + 17c6: 30 e0 ldi r19, 0x00 ; 0 + 17c8: 2f 5f subi r18, 0xFF ; 255 + 17ca: 3f 4f sbci r19, 0xFF ; 255 + 17cc: 27 70 andi r18, 0x07 ; 7 + 17ce: 33 27 eor r19, r19 + 17d0: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 1450: f9 01 movw r30, r18 - 1452: ee 0f add r30, r30 - 1454: ff 1f adc r31, r31 - 1456: ef 5f subi r30, 0xFF ; 255 - 1458: fe 4d sbci r31, 0xDE ; 222 - 145a: 90 81 ld r25, Z - 145c: 91 11 cpse r25, r1 - 145e: 5c c0 rjmp .+184 ; 0x1518 + 17d2: f9 01 movw r30, r18 + 17d4: ee 0f add r30, r30 + 17d6: ff 1f adc r31, r31 + 17d8: ef 5f subi r30, 0xFF ; 255 + 17da: fa 4d sbci r31, 0xDA ; 218 + 17dc: 90 81 ld r25, Z + 17de: 91 11 cpse r25, r1 + 17e0: 5c c0 rjmp .+184 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 1460: 2f 5f subi r18, 0xFF ; 255 - 1462: 3f 4f sbci r19, 0xFF ; 255 - 1464: 27 70 andi r18, 0x07 ; 7 - 1466: 33 27 eor r19, r19 - 1468: 82 2f mov r24, r18 + 17e2: 2f 5f subi r18, 0xFF ; 255 + 17e4: 3f 4f sbci r19, 0xFF ; 255 + 17e6: 27 70 andi r18, 0x07 ; 7 + 17e8: 33 27 eor r19, r19 + 17ea: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 146a: f9 01 movw r30, r18 - 146c: ee 0f add r30, r30 - 146e: ff 1f adc r31, r31 - 1470: ef 5f subi r30, 0xFF ; 255 - 1472: fe 4d sbci r31, 0xDE ; 222 - 1474: 90 81 ld r25, Z - 1476: 91 11 cpse r25, r1 - 1478: 4f c0 rjmp .+158 ; 0x1518 + 17ec: f9 01 movw r30, r18 + 17ee: ee 0f add r30, r30 + 17f0: ff 1f adc r31, r31 + 17f2: ef 5f subi r30, 0xFF ; 255 + 17f4: fa 4d sbci r31, 0xDA ; 218 + 17f6: 90 81 ld r25, Z + 17f8: 91 11 cpse r25, r1 + 17fa: 4f c0 rjmp .+158 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 147a: 2f 5f subi r18, 0xFF ; 255 - 147c: 3f 4f sbci r19, 0xFF ; 255 - 147e: 27 70 andi r18, 0x07 ; 7 - 1480: 33 27 eor r19, r19 - 1482: 82 2f mov r24, r18 + 17fc: 2f 5f subi r18, 0xFF ; 255 + 17fe: 3f 4f sbci r19, 0xFF ; 255 + 1800: 27 70 andi r18, 0x07 ; 7 + 1802: 33 27 eor r19, r19 + 1804: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 1484: f9 01 movw r30, r18 - 1486: ee 0f add r30, r30 - 1488: ff 1f adc r31, r31 - 148a: ef 5f subi r30, 0xFF ; 255 - 148c: fe 4d sbci r31, 0xDE ; 222 - 148e: 90 81 ld r25, Z - 1490: 91 11 cpse r25, r1 - 1492: 42 c0 rjmp .+132 ; 0x1518 + 1806: f9 01 movw r30, r18 + 1808: ee 0f add r30, r30 + 180a: ff 1f adc r31, r31 + 180c: ef 5f subi r30, 0xFF ; 255 + 180e: fa 4d sbci r31, 0xDA ; 218 + 1810: 90 81 ld r25, Z + 1812: 91 11 cpse r25, r1 + 1814: 42 c0 rjmp .+132 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 1494: 2f 5f subi r18, 0xFF ; 255 - 1496: 3f 4f sbci r19, 0xFF ; 255 - 1498: 27 70 andi r18, 0x07 ; 7 - 149a: 33 27 eor r19, r19 - 149c: 82 2f mov r24, r18 + 1816: 2f 5f subi r18, 0xFF ; 255 + 1818: 3f 4f sbci r19, 0xFF ; 255 + 181a: 27 70 andi r18, 0x07 ; 7 + 181c: 33 27 eor r19, r19 + 181e: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 149e: f9 01 movw r30, r18 - 14a0: ee 0f add r30, r30 - 14a2: ff 1f adc r31, r31 - 14a4: ef 5f subi r30, 0xFF ; 255 - 14a6: fe 4d sbci r31, 0xDE ; 222 - 14a8: 90 81 ld r25, Z - 14aa: 91 11 cpse r25, r1 - 14ac: 35 c0 rjmp .+106 ; 0x1518 + 1820: f9 01 movw r30, r18 + 1822: ee 0f add r30, r30 + 1824: ff 1f adc r31, r31 + 1826: ef 5f subi r30, 0xFF ; 255 + 1828: fa 4d sbci r31, 0xDA ; 218 + 182a: 90 81 ld r25, Z + 182c: 91 11 cpse r25, r1 + 182e: 35 c0 rjmp .+106 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 14ae: 2f 5f subi r18, 0xFF ; 255 - 14b0: 3f 4f sbci r19, 0xFF ; 255 - 14b2: 27 70 andi r18, 0x07 ; 7 - 14b4: 33 27 eor r19, r19 - 14b6: 82 2f mov r24, r18 + 1830: 2f 5f subi r18, 0xFF ; 255 + 1832: 3f 4f sbci r19, 0xFF ; 255 + 1834: 27 70 andi r18, 0x07 ; 7 + 1836: 33 27 eor r19, r19 + 1838: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 14b8: f9 01 movw r30, r18 - 14ba: ee 0f add r30, r30 - 14bc: ff 1f adc r31, r31 - 14be: ef 5f subi r30, 0xFF ; 255 - 14c0: fe 4d sbci r31, 0xDE ; 222 - 14c2: 90 81 ld r25, Z - 14c4: 91 11 cpse r25, r1 - 14c6: 28 c0 rjmp .+80 ; 0x1518 + 183a: f9 01 movw r30, r18 + 183c: ee 0f add r30, r30 + 183e: ff 1f adc r31, r31 + 1840: ef 5f subi r30, 0xFF ; 255 + 1842: fa 4d sbci r31, 0xDA ; 218 + 1844: 90 81 ld r25, Z + 1846: 91 11 cpse r25, r1 + 1848: 28 c0 rjmp .+80 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 14c8: 2f 5f subi r18, 0xFF ; 255 - 14ca: 3f 4f sbci r19, 0xFF ; 255 - 14cc: 27 70 andi r18, 0x07 ; 7 - 14ce: 33 27 eor r19, r19 - 14d0: 82 2f mov r24, r18 + 184a: 2f 5f subi r18, 0xFF ; 255 + 184c: 3f 4f sbci r19, 0xFF ; 255 + 184e: 27 70 andi r18, 0x07 ; 7 + 1850: 33 27 eor r19, r19 + 1852: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 14d2: f9 01 movw r30, r18 - 14d4: ee 0f add r30, r30 - 14d6: ff 1f adc r31, r31 - 14d8: ef 5f subi r30, 0xFF ; 255 - 14da: fe 4d sbci r31, 0xDE ; 222 - 14dc: 90 81 ld r25, Z - 14de: 91 11 cpse r25, r1 - 14e0: 1b c0 rjmp .+54 ; 0x1518 + 1854: f9 01 movw r30, r18 + 1856: ee 0f add r30, r30 + 1858: ff 1f adc r31, r31 + 185a: ef 5f subi r30, 0xFF ; 255 + 185c: fa 4d sbci r31, 0xDA ; 218 + 185e: 90 81 ld r25, Z + 1860: 91 11 cpse r25, r1 + 1862: 1b c0 rjmp .+54 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 14e2: 2f 5f subi r18, 0xFF ; 255 - 14e4: 3f 4f sbci r19, 0xFF ; 255 - 14e6: 27 70 andi r18, 0x07 ; 7 - 14e8: 33 27 eor r19, r19 - 14ea: 82 2f mov r24, r18 + 1864: 2f 5f subi r18, 0xFF ; 255 + 1866: 3f 4f sbci r19, 0xFF ; 255 + 1868: 27 70 andi r18, 0x07 ; 7 + 186a: 33 27 eor r19, r19 + 186c: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 14ec: f9 01 movw r30, r18 - 14ee: ee 0f add r30, r30 - 14f0: ff 1f adc r31, r31 - 14f2: ef 5f subi r30, 0xFF ; 255 - 14f4: fe 4d sbci r31, 0xDE ; 222 - 14f6: 90 81 ld r25, Z - 14f8: 91 11 cpse r25, r1 - 14fa: 0e c0 rjmp .+28 ; 0x1518 + 186e: f9 01 movw r30, r18 + 1870: ee 0f add r30, r30 + 1872: ff 1f adc r31, r31 + 1874: ef 5f subi r30, 0xFF ; 255 + 1876: fa 4d sbci r31, 0xDA ; 218 + 1878: 90 81 ld r25, Z + 187a: 91 11 cpse r25, r1 + 187c: 0e c0 rjmp .+28 ; 0x189a void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; uint8_t Setting = GlobalSettings.ActiveSetting; while (i-- > 0) { Setting = (Setting + 1) % SETTINGS_COUNT; - 14fc: 2f 5f subi r18, 0xFF ; 255 - 14fe: 3f 4f sbci r19, 0xFF ; 255 - 1500: 27 70 andi r18, 0x07 ; 7 - 1502: 33 27 eor r19, r19 - 1504: 82 2f mov r24, r18 + 187e: 2f 5f subi r18, 0xFF ; 255 + 1880: 3f 4f sbci r19, 0xFF ; 255 + 1882: 27 70 andi r18, 0x07 ; 7 + 1884: 33 27 eor r19, r19 + 1886: 82 2f mov r24, r18 if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - 1506: f9 01 movw r30, r18 - 1508: ee 0f add r30, r30 - 150a: ff 1f adc r31, r31 - 150c: ef 5f subi r30, 0xFF ; 255 - 150e: fe 4d sbci r31, 0xDE ; 222 - 1510: 90 81 ld r25, Z - 1512: 91 11 cpse r25, r1 - 1514: 01 c0 rjmp .+2 ; 0x1518 - 1516: 08 95 ret + 1888: f9 01 movw r30, r18 + 188a: ee 0f add r30, r30 + 188c: ff 1f adc r31, r31 + 188e: ef 5f subi r30, 0xFF ; 255 + 1890: fa 4d sbci r31, 0xDA ; 218 + 1892: 90 81 ld r25, Z + 1894: 91 11 cpse r25, r1 + 1896: 01 c0 rjmp .+2 ; 0x189a + 1898: 08 95 ret SettingsSetActiveById(Setting); - 1518: 84 cf rjmp .-248 ; 0x1422 + 189a: 7d cf rjmp .-262 ; 0x1796 -0000151a : +0000189c : } } uint8_t SettingsGetActiveById(void) { return GlobalSettings.ActiveSetting; } - 151a: 80 91 fd 20 lds r24, 0x20FD - 151e: 08 95 ret + 189c: 80 91 fd 24 lds r24, 0x24FD + 18a0: 08 95 ret -00001520 : +000018a2 : void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize) { - 1520: cf 93 push r28 - 1522: df 93 push r29 - 1524: ec 01 movw r28, r24 + 18a2: cf 93 push r28 + 18a4: df 93 push r29 + 18a6: ec 01 movw r28, r24 SettingOut[0] = SettingsGetActiveById() + '0'; - 1526: f9 df rcall .-14 ; 0x151a - 1528: 80 5d subi r24, 0xD0 ; 208 - 152a: 88 83 st Y, r24 + 18a8: f9 df rcall .-14 ; 0x189c + 18aa: 80 5d subi r24, 0xD0 ; 208 + 18ac: 88 83 st Y, r24 SettingOut[1] = '\0'; - 152c: 19 82 std Y+1, r1 ; 0x01 + 18ae: 19 82 std Y+1, r1 ; 0x01 } - 152e: df 91 pop r29 - 1530: cf 91 pop r28 - 1532: 08 95 ret + 18b0: df 91 pop r29 + 18b2: cf 91 pop r28 + 18b4: 08 95 ret -00001534 : +000018b6 : bool SettingsSetActiveByName(const char* Setting) { - 1534: fc 01 movw r30, r24 + 18b6: fc 01 movw r30, r24 uint8_t SettingNr = Setting[0] - '0'; - 1536: 80 81 ld r24, Z + 18b8: 80 81 ld r24, Z if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - 1538: 91 81 ldd r25, Z+1 ; 0x01 - 153a: 91 11 cpse r25, r1 - 153c: 03 c0 rjmp .+6 ; 0x1544 + 18ba: 91 81 ldd r25, Z+1 ; 0x01 + 18bc: 91 11 cpse r25, r1 + 18be: 03 c0 rjmp .+6 ; 0x18c6 SettingOut[0] = SettingsGetActiveById() + '0'; SettingOut[1] = '\0'; } bool SettingsSetActiveByName(const char* Setting) { uint8_t SettingNr = Setting[0] - '0'; - 153e: 80 53 subi r24, 0x30 ; 48 + 18c0: 80 53 subi r24, 0x30 ; 48 if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - 1540: 88 30 cpi r24, 0x08 ; 8 - 1542: 10 f0 brcs .+4 ; 0x1548 + 18c2: 88 30 cpi r24, 0x08 ; 8 + 18c4: 10 f0 brcs .+4 ; 0x18ca SettingsSetActiveById(SettingNr); return true; } else { return false; - 1544: 80 e0 ldi r24, 0x00 ; 0 + 18c6: 80 e0 ldi r24, 0x00 ; 0 } } - 1546: 08 95 ret + 18c8: 08 95 ret bool SettingsSetActiveByName(const char* Setting) { uint8_t SettingNr = Setting[0] - '0'; if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { SettingsSetActiveById(SettingNr); - 1548: 6c df rcall .-296 ; 0x1422 + 18ca: 65 df rcall .-310 ; 0x1796 return true; - 154a: 81 e0 ldi r24, 0x01 ; 1 - 154c: 08 95 ret + 18cc: 81 e0 ldi r24, 0x01 ; 1 + 18ce: 08 95 ret -0000154e : +000018d0 : uint8_t TerminalBuffer[TERMINAL_BUFFER_SIZE]; TerminalStateEnum TerminalState = TERMINAL_UNINITIALIZED; static uint8_t TerminalInitDelay = INIT_DELAY; void TerminalSendString(const char* s) { CDC_Device_SendString(&TerminalHandle, s); - 154e: bc 01 movw r22, r24 - 1550: 80 e0 ldi r24, 0x00 ; 0 - 1552: 90 e2 ldi r25, 0x20 ; 32 - 1554: 0c 94 ad 21 jmp 0x435a ; 0x435a + 18d0: bc 01 movw r22, r24 + 18d2: 80 e0 ldi r24, 0x00 ; 0 + 18d4: 90 e2 ldi r25, 0x20 ; 32 + 18d6: 0c 94 76 23 jmp 0x46ec ; 0x46ec -00001558 : +000018da : } void TerminalSendStringP(const char* s) { - 1558: cf 93 push r28 - 155a: df 93 push r29 + 18da: cf 93 push r28 + 18dc: df 93 push r29 char c; while( (c = pgm_read_byte(s++)) != '\0' ) { - 155c: ec 01 movw r28, r24 - 155e: 21 96 adiw r28, 0x01 ; 1 - 1560: fc 01 movw r30, r24 - 1562: 64 91 lpm r22, Z - 1564: 66 23 and r22, r22 - 1566: 49 f0 breq .+18 ; 0x157a + 18de: ec 01 movw r28, r24 + 18e0: 21 96 adiw r28, 0x01 ; 1 + 18e2: fc 01 movw r30, r24 + 18e4: 64 91 lpm r22, Z + 18e6: 66 23 and r22, r22 + 18e8: 49 f0 breq .+18 ; 0x18fc void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ControlRequest(void); INLINE void TerminalSendChar(char c) { CDC_Device_SendByte(&TerminalHandle, c); } - 1568: 80 e0 ldi r24, 0x00 ; 0 - 156a: 90 e2 ldi r25, 0x20 ; 32 - 156c: 0e 94 00 22 call 0x4400 ; 0x4400 - 1570: fe 01 movw r30, r28 - 1572: 21 96 adiw r28, 0x01 ; 1 - 1574: 64 91 lpm r22, Z - 1576: 61 11 cpse r22, r1 - 1578: f7 cf rjmp .-18 ; 0x1568 + 18ea: 80 e0 ldi r24, 0x00 ; 0 + 18ec: 90 e2 ldi r25, 0x20 ; 32 + 18ee: 0e 94 c9 23 call 0x4792 ; 0x4792 + 18f2: fe 01 movw r30, r28 + 18f4: 21 96 adiw r28, 0x01 ; 1 + 18f6: 64 91 lpm r22, Z + 18f8: 61 11 cpse r22, r1 + 18fa: f7 cf rjmp .-18 ; 0x18ea TerminalSendChar(c); } } - 157a: df 91 pop r29 - 157c: cf 91 pop r28 - 157e: 08 95 ret + 18fc: df 91 pop r29 + 18fe: cf 91 pop r28 + 1900: 08 95 ret -00001580 : +00001902 : #endif void TerminalSendBlock(void* Buffer, uint16_t ByteCount) { - 1580: ab 01 movw r20, r22 + 1902: ab 01 movw r20, r22 CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); - 1582: bc 01 movw r22, r24 - 1584: 80 e0 ldi r24, 0x00 ; 0 - 1586: 90 e2 ldi r25, 0x20 ; 32 - 1588: 0c 94 d6 21 jmp 0x43ac ; 0x43ac + 1904: bc 01 movw r22, r24 + 1906: 80 e0 ldi r24, 0x00 ; 0 + 1908: 90 e2 ldi r25, 0x20 ; 32 + 190a: 0c 94 9f 23 jmp 0x473e ; 0x473e -0000158c : +0000190e : } } void TerminalInit(void) { TERMINAL_VBUS_PORT.DIRCLR = TERMINAL_VBUS_MASK; - 158c: 80 e2 ldi r24, 0x20 ; 32 - 158e: e0 e6 ldi r30, 0x60 ; 96 - 1590: f6 e0 ldi r31, 0x06 ; 6 - 1592: 82 83 std Z+2, r24 ; 0x02 - 1594: 08 95 ret + 190e: 80 e2 ldi r24, 0x20 ; 32 + 1910: e0 e6 ldi r30, 0x60 ; 96 + 1912: f6 e0 ldi r31, 0x06 ; 6 + 1914: 82 83 std Z+2, r24 ; 0x02 + 1916: 08 95 ret -00001596 : +00001918 : } void TerminalTask(void) { - 1596: cf 93 push r28 - 1598: df 93 push r29 + 1918: cf 93 push r28 + 191a: df 93 push r29 CDC_Device_USBTask(&TerminalHandle); - 159a: 80 e0 ldi r24, 0x00 ; 0 - 159c: 90 e2 ldi r25, 0x20 ; 32 - 159e: 0e 94 7f 22 call 0x44fe ; 0x44fe + 191c: 80 e0 ldi r24, 0x00 ; 0 + 191e: 90 e2 ldi r25, 0x20 ; 32 + 1920: 0e 94 48 24 call 0x4890 ; 0x4890 USB_USBTask(); - 15a2: 0e 94 80 1c call 0x3900 ; 0x3900 + 1924: 0e 94 49 1e call 0x3c92 ; 0x3c92 CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); } static void ProcessByte(void) { int16_t Byte = CDC_Device_ReceiveByte(&TerminalHandle); - 15a6: 80 e0 ldi r24, 0x00 ; 0 - 15a8: 90 e2 ldi r25, 0x20 ; 32 - 15aa: 0e 94 9a 22 call 0x4534 ; 0x4534 - 15ae: ec 01 movw r28, r24 + 1928: 80 e0 ldi r24, 0x00 ; 0 + 192a: 90 e2 ldi r25, 0x20 ; 32 + 192c: 0e 94 63 24 call 0x48c6 ; 0x48c6 + 1930: ec 01 movw r28, r24 if (Byte >= 0) { - 15b0: 97 fd sbrc r25, 7 - 15b2: 09 c0 rjmp .+18 ; 0x15c6 + 1932: 97 fd sbrc r25, 7 + 1934: 09 c0 rjmp .+18 ; 0x1948 LED_PORT.OUTTGL = Mask; } static inline void LEDPulse(uint8_t Mask) { LEDPulseMask = Mask; - 15b4: 80 e1 ldi r24, 0x10 ; 16 - 15b6: 80 93 93 20 sts 0x2093, r24 + 1936: 80 e1 ldi r24, 0x10 ; 16 + 1938: 80 93 93 24 sts 0x2493, r24 LED_PORT.OUTSET = Mask; - 15ba: 80 93 05 06 sts 0x0605, r24 + 193c: 80 93 05 06 sts 0x0605, r24 /* Byte received */ LEDPulse(LED_RED); if (XModemProcessByte(Byte)) { - 15be: 8c 2f mov r24, r28 - 15c0: 62 d2 rcall .+1220 ; 0x1a86 - 15c2: 88 23 and r24, r24 - 15c4: 19 f0 breq .+6 ; 0x15cc + 1940: 8c 2f mov r24, r28 + 1942: 6a d2 rcall .+1236 ; 0x1e18 + 1944: 88 23 and r24, r24 + 1946: 19 f0 breq .+6 ; 0x194e { CDC_Device_USBTask(&TerminalHandle); USB_USBTask(); ProcessByte(); } - 15c6: df 91 pop r29 - 15c8: cf 91 pop r28 - 15ca: 08 95 ret + 1948: df 91 pop r29 + 194a: cf 91 pop r28 + 194c: 08 95 ret /* Byte received */ LEDPulse(LED_RED); if (XModemProcessByte(Byte)) { /* XModem handled the byte */ } else if (CommandLineProcessByte(Byte)) { - 15cc: 8c 2f mov r24, r28 + 194e: 8c 2f mov r24, r28 { CDC_Device_USBTask(&TerminalHandle); USB_USBTask(); ProcessByte(); } - 15ce: df 91 pop r29 - 15d0: cf 91 pop r28 + 1950: df 91 pop r29 + 1952: cf 91 pop r28 /* Byte received */ LEDPulse(LED_RED); if (XModemProcessByte(Byte)) { /* XModem handled the byte */ } else if (CommandLineProcessByte(Byte)) { - 15d2: c9 c3 rjmp .+1938 ; 0x1d66 + 1954: d1 c3 rjmp .+1954 ; 0x20f8 -000015d4 : +00001956 : } } static void SenseVBus(void) { switch(TerminalState) { - 15d4: 80 91 94 20 lds r24, 0x2094 - 15d8: 81 30 cpi r24, 0x01 ; 1 - 15da: 01 f1 breq .+64 ; 0x161c - 15dc: 30 f0 brcs .+12 ; 0x15ea - 15de: 82 30 cpi r24, 0x02 ; 2 - 15e0: 59 f1 breq .+86 ; 0x1638 - 15e2: 83 30 cpi r24, 0x03 ; 3 - 15e4: 71 f0 breq .+28 ; 0x1602 + 1956: 80 91 94 24 lds r24, 0x2494 + 195a: 81 30 cpi r24, 0x01 ; 1 + 195c: 09 f1 breq .+66 ; 0x19a0 + 195e: 30 f0 brcs .+12 ; 0x196c + 1960: 82 30 cpi r24, 0x02 ; 2 + 1962: 69 f1 breq .+90 ; 0x19be + 1964: 83 30 cpi r24, 0x03 ; 3 + 1966: 71 f0 breq .+28 ; 0x1984 void TerminalTick(void) { SenseVBus(); XModemTick(); - 15e6: 91 d3 rcall .+1826 ; 0x1d0a + 1968: 99 d3 rcall .+1842 ; 0x209c CommandLineTick(); - 15e8: 5f c5 rjmp .+2750 ; 0x20a8 + 196a: 67 c5 rjmp .+2766 ; 0x243a static void SenseVBus(void) { switch(TerminalState) { case TERMINAL_UNINITIALIZED: if (TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK) { - 15ea: 80 91 68 06 lds r24, 0x0668 - 15ee: 85 ff sbrs r24, 5 - 15f0: fa cf rjmp .-12 ; 0x15e6 + 196c: 80 91 68 06 lds r24, 0x0668 + 1970: 85 ff sbrs r24, 5 + 1972: fa cf rjmp .-12 ; 0x1968 /* Not initialized and VBUS sense high */ TerminalInitDelay = INIT_DELAY; - 15f2: 84 e1 ldi r24, 0x14 ; 20 - 15f4: 80 93 1b 20 sts 0x201B, r24 + 1974: 84 e1 ldi r24, 0x14 ; 20 + 1976: 80 93 1b 20 sts 0x201B, r24 TerminalState = TERMINAL_INITIALIZING; - 15f8: 81 e0 ldi r24, 0x01 ; 1 - 15fa: 80 93 94 20 sts 0x2094, r24 + 197a: 81 e0 ldi r24, 0x01 ; 1 + 197c: 80 93 94 24 sts 0x2494, r24 void TerminalTick(void) { SenseVBus(); XModemTick(); - 15fe: 85 d3 rcall .+1802 ; 0x1d0a + 1980: 8d d3 rcall .+1818 ; 0x209c CommandLineTick(); - 1600: 53 c5 rjmp .+2726 ; 0x20a8 + 1982: 5b c5 rjmp .+2742 ; 0x243a TerminalState = TERMINAL_UNITIALIZING; } break; case TERMINAL_UNITIALIZING: if (--TerminalInitDelay == 0) { - 1602: 80 91 1b 20 lds r24, 0x201B - 1606: 81 50 subi r24, 0x01 ; 1 - 1608: 80 93 1b 20 sts 0x201B, r24 - 160c: 81 11 cpse r24, r1 - 160e: eb cf rjmp .-42 ; 0x15e6 + 1984: 80 91 1b 20 lds r24, 0x201B + 1988: 81 50 subi r24, 0x01 ; 1 + 198a: 80 93 1b 20 sts 0x201B, r24 + 198e: 81 11 cpse r24, r1 + 1990: eb cf rjmp .-42 ; 0x1968 USB_Disable(); - 1610: 0e 94 aa 20 call 0x4154 ; 0x4154 + 1992: 0e 94 73 22 call 0x44e6 ; 0x44e6 SystemStopUSBClock(); - 1614: 21 d9 rcall .-3518 ; 0x858 + 1996: 0e 94 50 04 call 0x8a0 ; 0x8a0 TerminalState = TERMINAL_UNINITIALIZED; - 1616: 10 92 94 20 sts 0x2094, r1 - 161a: e5 cf rjmp .-54 ; 0x15e6 + 199a: 10 92 94 24 sts 0x2494, r1 + 199e: e4 cf rjmp .-56 ; 0x1968 TerminalState = TERMINAL_INITIALIZING; } break; case TERMINAL_INITIALIZING: if (--TerminalInitDelay == 0) { - 161c: 80 91 1b 20 lds r24, 0x201B - 1620: 81 50 subi r24, 0x01 ; 1 - 1622: 80 93 1b 20 sts 0x201B, r24 - 1626: 81 11 cpse r24, r1 - 1628: de cf rjmp .-68 ; 0x15e6 + 19a0: 80 91 1b 20 lds r24, 0x201B + 19a4: 81 50 subi r24, 0x01 ; 1 + 19a6: 80 93 1b 20 sts 0x201B, r24 + 19aa: 81 11 cpse r24, r1 + 19ac: dd cf rjmp .-70 ; 0x1968 SystemStartUSBClock(); - 162a: fd d8 rcall .-3590 ; 0x826 + 19ae: 0e 94 37 04 call 0x86e ; 0x86e USB_Init(); - 162c: 0e 94 e5 20 call 0x41ca ; 0x41ca + 19b2: 0e 94 ae 22 call 0x455c ; 0x455c TerminalState = TERMINAL_INITIALIZED; - 1630: 82 e0 ldi r24, 0x02 ; 2 - 1632: 80 93 94 20 sts 0x2094, r24 - 1636: d7 cf rjmp .-82 ; 0x15e6 + 19b6: 82 e0 ldi r24, 0x02 ; 2 + 19b8: 80 93 94 24 sts 0x2494, r24 + 19bc: d5 cf rjmp .-86 ; 0x1968 } break; case TERMINAL_INITIALIZED: if (!(TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK)) { - 1638: 80 91 68 06 lds r24, 0x0668 - 163c: 85 fd sbrc r24, 5 - 163e: d3 cf rjmp .-90 ; 0x15e6 + 19be: 80 91 68 06 lds r24, 0x0668 + 19c2: 85 fd sbrc r24, 5 + 19c4: d1 cf rjmp .-94 ; 0x1968 /* Initialized and VBUS sense low */ TerminalInitDelay = INIT_DELAY; - 1640: 84 e1 ldi r24, 0x14 ; 20 - 1642: 80 93 1b 20 sts 0x201B, r24 + 19c6: 84 e1 ldi r24, 0x14 ; 20 + 19c8: 80 93 1b 20 sts 0x201B, r24 TerminalState = TERMINAL_UNITIALIZING; - 1646: 83 e0 ldi r24, 0x03 ; 3 - 1648: 80 93 94 20 sts 0x2094, r24 + 19cc: 83 e0 ldi r24, 0x03 ; 3 + 19ce: 80 93 94 24 sts 0x2494, r24 void TerminalTick(void) { SenseVBus(); XModemTick(); - 164c: 5e d3 rcall .+1724 ; 0x1d0a + 19d2: 64 d3 rcall .+1736 ; 0x209c CommandLineTick(); - 164e: 2c c5 rjmp .+2648 ; 0x20a8 + 19d4: 32 c5 rjmp .+2660 ; 0x243a -00001650 : +000019d6 : LED_PORT.DIRSET = LED_MASK; } static inline void LEDSetOn(uint8_t Mask) { LED_PORT.OUTSET = Mask; - 1650: 80 e2 ldi r24, 0x20 ; 32 - 1652: e0 e0 ldi r30, 0x00 ; 0 - 1654: f6 e0 ldi r31, 0x06 ; 6 - 1656: 85 83 std Z+5, r24 ; 0x05 - 1658: 08 95 ret + 19d6: 80 e2 ldi r24, 0x20 ; 32 + 19d8: e0 e0 ldi r30, 0x00 ; 0 + 19da: f6 e0 ldi r31, 0x06 ; 6 + 19dc: 85 83 std Z+5, r24 ; 0x05 + 19de: 08 95 ret -0000165a : +000019e0 : } static inline void LEDSetOff(uint8_t Mask) { LED_PORT.OUTCLR = Mask; - 165a: 80 e2 ldi r24, 0x20 ; 32 - 165c: e0 e0 ldi r30, 0x00 ; 0 - 165e: f6 e0 ldi r31, 0x06 ; 6 - 1660: 86 83 std Z+6, r24 ; 0x06 - 1662: 08 95 ret + 19e0: 80 e2 ldi r24, 0x20 ; 32 + 19e2: e0 e0 ldi r30, 0x00 ; 0 + 19e4: f6 e0 ldi r31, 0x06 ; 6 + 19e6: 86 83 std Z+6, r24 ; 0x06 + 19e8: 08 95 ret -00001664 : +000019ea : /** Event handler for the library USB Configuration Changed event. */ void EVENT_USB_Device_ConfigurationChanged(void) { CDC_Device_ConfigureEndpoints(&TerminalHandle); - 1664: 80 e0 ldi r24, 0x00 ; 0 - 1666: 90 e2 ldi r25, 0x20 ; 32 - 1668: 0c 94 88 21 jmp 0x4310 ; 0x4310 + 19ea: 80 e0 ldi r24, 0x00 ; 0 + 19ec: 90 e2 ldi r25, 0x20 ; 32 + 19ee: 0c 94 51 23 jmp 0x46a2 ; 0x46a2 -0000166c : +000019f2 : } /** Event handler for the library USB Control Request reception event. */ void EVENT_USB_Device_ControlRequest(void) { CDC_Device_ProcessControlRequest(&TerminalHandle); - 166c: 80 e0 ldi r24, 0x00 ; 0 - 166e: 90 e2 ldi r25, 0x20 ; 32 - 1670: 0c 94 fa 22 jmp 0x45f4 ; 0x45f4 + 19f2: 80 e0 ldi r24, 0x00 ; 0 + 19f4: 90 e2 ldi r25, 0x20 ; 32 + 19f6: 0c 94 c3 24 jmp 0x4986 ; 0x4986 -00001674 : +000019fa : extern const PROGMEM CommandEntryType CommandTable[]; CommandStatusIdType CommandGetVersion(char* OutParam) { snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR( - 1674: 2e e1 ldi r18, 0x1E ; 30 - 1676: 34 e0 ldi r19, 0x04 ; 4 - 1678: 3f 93 push r19 - 167a: 2f 93 push r18 - 167c: 27 e1 ldi r18, 0x17 ; 23 - 167e: 34 e0 ldi r19, 0x04 ; 4 - 1680: 3f 93 push r19 - 1682: 2f 93 push r18 - 1684: 20 e1 ldi r18, 0x10 ; 16 - 1686: 34 e0 ldi r19, 0x04 ; 4 - 1688: 3f 93 push r19 - 168a: 2f 93 push r18 - 168c: 27 ed ldi r18, 0xD7 ; 215 - 168e: 33 e0 ldi r19, 0x03 ; 3 - 1690: 3f 93 push r19 - 1692: 2f 93 push r18 - 1694: 21 e0 ldi r18, 0x01 ; 1 - 1696: 2f 93 push r18 - 1698: 1f 92 push r1 - 169a: 9f 93 push r25 - 169c: 8f 93 push r24 - 169e: 0e 94 37 24 call 0x486e ; 0x486e + 19fa: 2e e5 ldi r18, 0x5E ; 94 + 19fc: 34 e0 ldi r19, 0x04 ; 4 + 19fe: 3f 93 push r19 + 1a00: 2f 93 push r18 + 1a02: 27 e5 ldi r18, 0x57 ; 87 + 1a04: 34 e0 ldi r19, 0x04 ; 4 + 1a06: 3f 93 push r19 + 1a08: 2f 93 push r18 + 1a0a: 20 e5 ldi r18, 0x50 ; 80 + 1a0c: 34 e0 ldi r19, 0x04 ; 4 + 1a0e: 3f 93 push r19 + 1a10: 2f 93 push r18 + 1a12: 27 e1 ldi r18, 0x17 ; 23 + 1a14: 34 e0 ldi r19, 0x04 ; 4 + 1a16: 3f 93 push r19 + 1a18: 2f 93 push r18 + 1a1a: 21 e0 ldi r18, 0x01 ; 1 + 1a1c: 2f 93 push r18 + 1a1e: 1f 92 push r1 + 1a20: 9f 93 push r25 + 1a22: 8f 93 push r24 + 1a24: 0e 94 00 26 call 0x4c00 ; 0x4c00 "Chameleon-Mini %S using LUFA %S compiled with AVR-GCC %S" ), PSTR(CHAMELEON_MINI_VERSION_STRING), PSTR(LUFA_VERSION_STRING), PSTR(__VERSION__) ); return COMMAND_INFO_OK_WITH_TEXT_ID; - 16a2: 8d b7 in r24, 0x3d ; 61 - 16a4: 9e b7 in r25, 0x3e ; 62 - 16a6: 0c 96 adiw r24, 0x0c ; 12 - 16a8: 8d bf out 0x3d, r24 ; 61 - 16aa: 9e bf out 0x3e, r25 ; 62 + 1a28: 8d b7 in r24, 0x3d ; 61 + 1a2a: 9e b7 in r25, 0x3e ; 62 + 1a2c: 0c 96 adiw r24, 0x0c ; 12 + 1a2e: 8d bf out 0x3d, r24 ; 61 + 1a30: 9e bf out 0x3e, r25 ; 62 } - 16ac: 85 e6 ldi r24, 0x65 ; 101 - 16ae: 08 95 ret + 1a32: 85 e6 ldi r24, 0x65 ; 101 + 1a34: 08 95 ret -000016b0 : +00001a36 : CommandStatusIdType CommandGetConfig(char* OutParam) { snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, - 16b0: 29 ed ldi r18, 0xD9 ; 217 - 16b2: 30 e2 ldi r19, 0x20 ; 32 - 16b4: 3f 93 push r19 - 16b6: 2f 93 push r18 - 16b8: 24 e2 ldi r18, 0x24 ; 36 - 16ba: 34 e0 ldi r19, 0x04 ; 4 - 16bc: 3f 93 push r19 - 16be: 2f 93 push r18 - 16c0: 21 e0 ldi r18, 0x01 ; 1 - 16c2: 2f 93 push r18 - 16c4: 1f 92 push r1 - 16c6: 9f 93 push r25 - 16c8: 8f 93 push r24 - 16ca: 0e 94 37 24 call 0x486e ; 0x486e + 1a36: 29 ed ldi r18, 0xD9 ; 217 + 1a38: 34 e2 ldi r19, 0x24 ; 36 + 1a3a: 3f 93 push r19 + 1a3c: 2f 93 push r18 + 1a3e: 24 e6 ldi r18, 0x64 ; 100 + 1a40: 34 e0 ldi r19, 0x04 ; 4 + 1a42: 3f 93 push r19 + 1a44: 2f 93 push r18 + 1a46: 21 e0 ldi r18, 0x01 ; 1 + 1a48: 2f 93 push r18 + 1a4a: 1f 92 push r1 + 1a4c: 9f 93 push r25 + 1a4e: 8f 93 push r24 + 1a50: 0e 94 00 26 call 0x4c00 ; 0x4c00 PSTR("%s"), ActiveConfiguration.ConfigurationName); return COMMAND_INFO_OK_WITH_TEXT_ID; - 16ce: 8d b7 in r24, 0x3d ; 61 - 16d0: 9e b7 in r25, 0x3e ; 62 - 16d2: 08 96 adiw r24, 0x08 ; 8 - 16d4: 8d bf out 0x3d, r24 ; 61 - 16d6: 9e bf out 0x3e, r25 ; 62 + 1a54: 8d b7 in r24, 0x3d ; 61 + 1a56: 9e b7 in r25, 0x3e ; 62 + 1a58: 08 96 adiw r24, 0x08 ; 8 + 1a5a: 8d bf out 0x3d, r24 ; 61 + 1a5c: 9e bf out 0x3e, r25 ; 62 } - 16d8: 85 e6 ldi r24, 0x65 ; 101 - 16da: 08 95 ret + 1a5e: 85 e6 ldi r24, 0x65 ; 101 + 1a60: 08 95 ret -000016dc : +00001a62 : CommandStatusIdType CommandSetConfig(const char* InParam) { if (ConfigurationSetByName(InParam)) { - 16dc: fc d8 rcall .-3592 ; 0x8d6 - 16de: 81 11 cpse r24, r1 - 16e0: 02 c0 rjmp .+4 ; 0x16e6 + 1a62: 0e 94 8f 04 call 0x91e ; 0x91e + 1a66: 81 11 cpse r24, r1 + 1a68: 02 c0 rjmp .+4 ; 0x1a6e SettingsSave(); return COMMAND_INFO_OK_ID; } else { return COMMAND_ERR_INVALID_PARAM_ID; - 16e2: 8a ec ldi r24, 0xCA ; 202 + 1a6a: 8a ec ldi r24, 0xCA ; 202 } } - 16e4: 08 95 ret + 1a6c: 08 95 ret } CommandStatusIdType CommandSetConfig(const char* InParam) { if (ConfigurationSetByName(InParam)) { SettingsSave(); - 16e6: 95 de rcall .-726 ; 0x1412 + 1a6e: 8b de rcall .-746 ; 0x1786 return COMMAND_INFO_OK_ID; - 16e8: 84 e6 ldi r24, 0x64 ; 100 - 16ea: 08 95 ret + 1a70: 84 e6 ldi r24, 0x64 ; 100 + 1a72: 08 95 ret -000016ec : +00001a74 : } } CommandStatusIdType CommandExecConfig(char* OutMessage) { ConfigurationGetList(OutMessage, TERMINAL_BUFFER_SIZE); - 16ec: 60 e0 ldi r22, 0x00 ; 0 - 16ee: 71 e0 ldi r23, 0x01 ; 1 - 16f0: 33 d9 rcall .-3482 ; 0x958 + 1a74: 60 e0 ldi r22, 0x00 ; 0 + 1a76: 71 e0 ldi r23, 0x01 ; 1 + 1a78: 0e 94 d0 04 call 0x9a0 ; 0x9a0 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 16f2: 85 e6 ldi r24, 0x65 ; 101 - 16f4: 08 95 ret + 1a7c: 85 e6 ldi r24, 0x65 ; 101 + 1a7e: 08 95 ret -000016f6 : +00001a80 : CommandStatusIdType CommandGetUid(char* OutParam) { - 16f6: 0f 93 push r16 - 16f8: 1f 93 push r17 - 16fa: cf 93 push r28 - 16fc: df 93 push r29 - 16fe: cd b7 in r28, 0x3d ; 61 - 1700: de b7 in r29, 0x3e ; 62 - 1702: a1 97 sbiw r28, 0x21 ; 33 - 1704: cd bf out 0x3d, r28 ; 61 - 1706: de bf out 0x3e, r29 ; 62 - 1708: 8c 01 movw r16, r24 + 1a80: 0f 93 push r16 + 1a82: 1f 93 push r17 + 1a84: cf 93 push r28 + 1a86: df 93 push r29 + 1a88: cd b7 in r28, 0x3d ; 61 + 1a8a: de b7 in r29, 0x3e ; 62 + 1a8c: a1 97 sbiw r28, 0x21 ; 33 + 1a8e: cd bf out 0x3d, r28 ; 61 + 1a90: de bf out 0x3e, r29 ; 62 + 1a92: 8c 01 movw r16, r24 uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; uint16_t UidSize = ActiveConfiguration.UidSize; - 170a: 20 91 fb 20 lds r18, 0x20FB + 1a94: 20 91 fb 24 lds r18, 0x24FB INLINE void ApplicationReset(void) { ActiveConfiguration.ApplicationResetFunc(); } INLINE void ApplicationGetUid(ConfigurationUidType Uid) { ActiveConfiguration.ApplicationGetUidFunc(Uid); - 170e: e0 91 f5 20 lds r30, 0x20F5 - 1712: f0 91 f6 20 lds r31, 0x20F6 - 1716: ce 01 movw r24, r28 - 1718: 01 96 adiw r24, 0x01 ; 1 - 171a: 29 a3 std Y+33, r18 ; 0x21 - 171c: 09 95 icall + 1a98: e0 91 f5 24 lds r30, 0x24F5 + 1a9c: f0 91 f6 24 lds r31, 0x24F6 + 1aa0: ce 01 movw r24, r28 + 1aa2: 01 96 adiw r24, 0x01 ; 1 + 1aa4: 29 a3 std Y+33, r18 ; 0x21 + 1aa6: 09 95 icall ApplicationGetUid(UidBuffer); BufferToHexString(OutParam, TERMINAL_BUFFER_SIZE, - 171e: 29 a1 ldd r18, Y+33 ; 0x21 - 1720: 30 e0 ldi r19, 0x00 ; 0 - 1722: ae 01 movw r20, r28 - 1724: 4f 5f subi r20, 0xFF ; 255 - 1726: 5f 4f sbci r21, 0xFF ; 255 - 1728: 60 e0 ldi r22, 0x00 ; 0 - 172a: 71 e0 ldi r23, 0x01 ; 1 - 172c: c8 01 movw r24, r16 - 172e: 5e d9 rcall .-3396 ; 0x9ec + 1aa8: 29 a1 ldd r18, Y+33 ; 0x21 + 1aaa: 30 e0 ldi r19, 0x00 ; 0 + 1aac: ae 01 movw r20, r28 + 1aae: 4f 5f subi r20, 0xFF ; 255 + 1ab0: 5f 4f sbci r21, 0xFF ; 255 + 1ab2: 60 e0 ldi r22, 0x00 ; 0 + 1ab4: 71 e0 ldi r23, 0x01 ; 1 + 1ab6: c8 01 movw r24, r16 + 1ab8: 0e 94 1a 05 call 0xa34 ; 0xa34 UidBuffer, UidSize); return COMMAND_INFO_OK_WITH_TEXT_ID; } - 1730: 85 e6 ldi r24, 0x65 ; 101 - 1732: a1 96 adiw r28, 0x21 ; 33 - 1734: cd bf out 0x3d, r28 ; 61 - 1736: de bf out 0x3e, r29 ; 62 - 1738: df 91 pop r29 - 173a: cf 91 pop r28 - 173c: 1f 91 pop r17 - 173e: 0f 91 pop r16 - 1740: 08 95 ret + 1abc: 85 e6 ldi r24, 0x65 ; 101 + 1abe: a1 96 adiw r28, 0x21 ; 33 + 1ac0: cd bf out 0x3d, r28 ; 61 + 1ac2: de bf out 0x3e, r29 ; 62 + 1ac4: df 91 pop r29 + 1ac6: cf 91 pop r28 + 1ac8: 1f 91 pop r17 + 1aca: 0f 91 pop r16 + 1acc: 08 95 ret -00001742 : +00001ace : CommandStatusIdType CommandSetUid(const char* InParam) { - 1742: bf 92 push r11 - 1744: cf 92 push r12 - 1746: df 92 push r13 - 1748: ef 92 push r14 - 174a: ff 92 push r15 - 174c: 0f 93 push r16 - 174e: 1f 93 push r17 - 1750: cf 93 push r28 - 1752: df 93 push r29 - 1754: cd b7 in r28, 0x3d ; 61 - 1756: de b7 in r29, 0x3e ; 62 - 1758: a0 97 sbiw r28, 0x20 ; 32 - 175a: cd bf out 0x3d, r28 ; 61 - 175c: de bf out 0x3e, r29 ; 62 - 175e: 8c 01 movw r16, r24 + 1ace: bf 92 push r11 + 1ad0: cf 92 push r12 + 1ad2: df 92 push r13 + 1ad4: ef 92 push r14 + 1ad6: ff 92 push r15 + 1ad8: 0f 93 push r16 + 1ada: 1f 93 push r17 + 1adc: cf 93 push r28 + 1ade: df 93 push r29 + 1ae0: cd b7 in r28, 0x3d ; 61 + 1ae2: de b7 in r29, 0x3e ; 62 + 1ae4: a0 97 sbiw r28, 0x20 ; 32 + 1ae6: cd bf out 0x3d, r28 ; 61 + 1ae8: de bf out 0x3e, r29 ; 62 + 1aea: 8c 01 movw r16, r24 uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; uint16_t UidSize = ActiveConfiguration.UidSize; - 1760: c0 90 fb 20 lds r12, 0x20FB - 1764: d1 2c mov r13, r1 + 1aec: c0 90 fb 24 lds r12, 0x24FB + 1af0: d1 2c mov r13, r1 if (strcmp_P(InParam, PSTR(COMMAND_UID_RANDOM)) == 0) { - 1766: 67 e2 ldi r22, 0x27 ; 39 - 1768: 74 e0 ldi r23, 0x04 ; 4 - 176a: 0e 94 16 24 call 0x482c ; 0x482c - 176e: 89 2b or r24, r25 - 1770: 51 f5 brne .+84 ; 0x17c6 + 1af2: 67 e6 ldi r22, 0x67 ; 103 + 1af4: 74 e0 ldi r23, 0x04 ; 4 + 1af6: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1afa: 89 2b or r24, r25 + 1afc: 59 f5 brne .+86 ; 0x1b54 /* Load with random bytes */ for (uint8_t i=0; i - 1778: b1 2c mov r11, r1 - 177a: ee 24 eor r14, r14 - 177c: e3 94 inc r14 - 177e: f1 2c mov r15, r1 - 1780: ec 0e add r14, r28 - 1782: fd 1e adc r15, r29 - 1784: 00 e0 ldi r16, 0x00 ; 0 - 1786: 10 e0 ldi r17, 0x00 ; 0 + 1afe: c1 14 cp r12, r1 + 1b00: d1 04 cpc r13, r1 + 1b02: c1 f1 breq .+112 ; 0x1b74 + 1b04: b1 2c mov r11, r1 + 1b06: ee 24 eor r14, r14 + 1b08: e3 94 inc r14 + 1b0a: f1 2c mov r15, r1 + 1b0c: ec 0e add r14, r28 + 1b0e: fd 1e adc r15, r29 + 1b10: 00 e0 ldi r16, 0x00 ; 0 + 1b12: 10 e0 ldi r17, 0x00 ; 0 UidBuffer[i] = RandomGetByte(); - 1788: 17 d9 rcall .-3538 ; 0x9b8 - 178a: f7 01 movw r30, r14 - 178c: e0 0f add r30, r16 - 178e: f1 1f adc r31, r17 - 1790: 80 83 st Z, r24 + 1b14: 0e 94 00 05 call 0xa00 ; 0xa00 + 1b18: f7 01 movw r30, r14 + 1b1a: e0 0f add r30, r16 + 1b1c: f1 1f adc r31, r17 + 1b1e: 80 83 st Z, r24 uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; uint16_t UidSize = ActiveConfiguration.UidSize; if (strcmp_P(InParam, PSTR(COMMAND_UID_RANDOM)) == 0) { /* Load with random bytes */ for (uint8_t i=0; i + 1b20: b3 94 inc r11 + 1b22: 0b 2d mov r16, r11 + 1b24: 10 e0 ldi r17, 0x00 ; 0 + 1b26: 0c 15 cp r16, r12 + 1b28: 1d 05 cpc r17, r13 + 1b2a: a0 f3 brcs .-24 ; 0x1b14 } INLINE void ApplicationSetUid(ConfigurationUidType Uid) { ActiveConfiguration.ApplicationSetUidFunc(Uid); - 179e: e0 91 f7 20 lds r30, 0x20F7 - 17a2: f0 91 f8 20 lds r31, 0x20F8 - 17a6: c7 01 movw r24, r14 - 17a8: 09 95 icall + 1b2c: e0 91 f7 24 lds r30, 0x24F7 + 1b30: f0 91 f8 24 lds r31, 0x24F8 + 1b34: c7 01 movw r24, r14 + 1b36: 09 95 icall } } ApplicationSetUid(UidBuffer); return COMMAND_INFO_OK_ID; - 17aa: 84 e6 ldi r24, 0x64 ; 100 + 1b38: 84 e6 ldi r24, 0x64 ; 100 } - 17ac: a0 96 adiw r28, 0x20 ; 32 - 17ae: cd bf out 0x3d, r28 ; 61 - 17b0: de bf out 0x3e, r29 ; 62 - 17b2: df 91 pop r29 - 17b4: cf 91 pop r28 - 17b6: 1f 91 pop r17 - 17b8: 0f 91 pop r16 - 17ba: ff 90 pop r15 - 17bc: ef 90 pop r14 - 17be: df 90 pop r13 - 17c0: cf 90 pop r12 - 17c2: bf 90 pop r11 - 17c4: 08 95 ret + 1b3a: a0 96 adiw r28, 0x20 ; 32 + 1b3c: cd bf out 0x3d, r28 ; 61 + 1b3e: de bf out 0x3e, r29 ; 62 + 1b40: df 91 pop r29 + 1b42: cf 91 pop r28 + 1b44: 1f 91 pop r17 + 1b46: 0f 91 pop r16 + 1b48: ff 90 pop r15 + 1b4a: ef 90 pop r14 + 1b4c: df 90 pop r13 + 1b4e: cf 90 pop r12 + 1b50: bf 90 pop r11 + 1b52: 08 95 ret for (uint8_t i=0; i - 17da: 8c 15 cp r24, r12 - 17dc: 9d 05 cpc r25, r13 - 17de: f9 f2 breq .-66 ; 0x179e + 1b54: a8 01 movw r20, r16 + 1b56: 60 e2 ldi r22, 0x20 ; 32 + 1b58: 70 e0 ldi r23, 0x00 ; 0 + 1b5a: ee 24 eor r14, r14 + 1b5c: e3 94 inc r14 + 1b5e: f1 2c mov r15, r1 + 1b60: ec 0e add r14, r28 + 1b62: fd 1e adc r15, r29 + 1b64: c7 01 movw r24, r14 + 1b66: 0e 94 5c 05 call 0xab8 ; 0xab8 + 1b6a: 8c 15 cp r24, r12 + 1b6c: 9d 05 cpc r25, r13 + 1b6e: f1 f2 breq .-68 ; 0x1b2c /* Malformed input. Abort */ return COMMAND_ERR_INVALID_PARAM_ID; - 17e0: 8a ec ldi r24, 0xCA ; 202 - 17e2: e4 cf rjmp .-56 ; 0x17ac - 17e4: ee 24 eor r14, r14 - 17e6: e3 94 inc r14 - 17e8: f1 2c mov r15, r1 - 17ea: ec 0e add r14, r28 - 17ec: fd 1e adc r15, r29 - 17ee: d7 cf rjmp .-82 ; 0x179e + 1b70: 8a ec ldi r24, 0xCA ; 202 + 1b72: e3 cf rjmp .-58 ; 0x1b3a + 1b74: ee 24 eor r14, r14 + 1b76: e3 94 inc r14 + 1b78: f1 2c mov r15, r1 + 1b7a: ec 0e add r14, r28 + 1b7c: fd 1e adc r15, r29 + 1b7e: d6 cf rjmp .-84 ; 0x1b2c -000017f0 : +00001b80 : return COMMAND_INFO_OK_ID; } CommandStatusIdType CommandGetReadOnly(char* OutParam) { if (ActiveConfiguration.ReadOnly) { - 17f0: 20 91 fc 20 lds r18, 0x20FC - 17f4: 21 11 cpse r18, r1 - 17f6: 07 c0 rjmp .+14 ; 0x1806 + 1b80: 20 91 fc 24 lds r18, 0x24FC + 1b84: 21 11 cpse r18, r1 + 1b86: 07 c0 rjmp .+14 ; 0x1b96 OutParam[0] = COMMAND_CHAR_TRUE; } else { OutParam[0] = COMMAND_CHAR_FALSE; - 17f8: 20 e3 ldi r18, 0x30 ; 48 - 17fa: fc 01 movw r30, r24 - 17fc: 20 83 st Z, r18 + 1b88: 20 e3 ldi r18, 0x30 ; 48 + 1b8a: fc 01 movw r30, r24 + 1b8c: 20 83 st Z, r18 } OutParam[1] = '\0'; - 17fe: fc 01 movw r30, r24 - 1800: 11 82 std Z+1, r1 ; 0x01 + 1b8e: fc 01 movw r30, r24 + 1b90: 11 82 std Z+1, r1 ; 0x01 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 1802: 85 e6 ldi r24, 0x65 ; 101 - 1804: 08 95 ret + 1b92: 85 e6 ldi r24, 0x65 ; 101 + 1b94: 08 95 ret } CommandStatusIdType CommandGetReadOnly(char* OutParam) { if (ActiveConfiguration.ReadOnly) { OutParam[0] = COMMAND_CHAR_TRUE; - 1806: 21 e3 ldi r18, 0x31 ; 49 - 1808: fc 01 movw r30, r24 - 180a: 20 83 st Z, r18 + 1b96: 21 e3 ldi r18, 0x31 ; 49 + 1b98: fc 01 movw r30, r24 + 1b9a: 20 83 st Z, r18 } else { OutParam[0] = COMMAND_CHAR_FALSE; } OutParam[1] = '\0'; - 180c: fc 01 movw r30, r24 - 180e: 11 82 std Z+1, r1 ; 0x01 + 1b9c: fc 01 movw r30, r24 + 1b9e: 11 82 std Z+1, r1 ; 0x01 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 1810: 85 e6 ldi r24, 0x65 ; 101 - 1812: 08 95 ret + 1ba0: 85 e6 ldi r24, 0x65 ; 101 + 1ba2: 08 95 ret -00001814 : +00001ba4 : CommandStatusIdType CommandSetReadOnly(const char* InParam) { if (InParam[1] == '\0') { - 1814: fc 01 movw r30, r24 - 1816: 21 81 ldd r18, Z+1 ; 0x01 - 1818: 21 11 cpse r18, r1 - 181a: 05 c0 rjmp .+10 ; 0x1826 + 1ba4: fc 01 movw r30, r24 + 1ba6: 21 81 ldd r18, Z+1 ; 0x01 + 1ba8: 21 11 cpse r18, r1 + 1baa: 05 c0 rjmp .+10 ; 0x1bb6 if (InParam[0] == COMMAND_CHAR_TRUE) { - 181c: 80 81 ld r24, Z - 181e: 81 33 cpi r24, 0x31 ; 49 - 1820: 41 f0 breq .+16 ; 0x1832 + 1bac: 80 81 ld r24, Z + 1bae: 81 33 cpi r24, 0x31 ; 49 + 1bb0: 41 f0 breq .+16 ; 0x1bc2 ActiveConfiguration.ReadOnly = true; return COMMAND_INFO_OK_ID; } else if (InParam[0] == COMMAND_CHAR_FALSE) { - 1822: 80 33 cpi r24, 0x30 ; 48 - 1824: 11 f0 breq .+4 ; 0x182a + 1bb2: 80 33 cpi r24, 0x30 ; 48 + 1bb4: 11 f0 breq .+4 ; 0x1bba ActiveConfiguration.ReadOnly = false; return COMMAND_INFO_OK_ID; } } return COMMAND_ERR_INVALID_PARAM_ID; - 1826: 8a ec ldi r24, 0xCA ; 202 + 1bb6: 8a ec ldi r24, 0xCA ; 202 } - 1828: 08 95 ret + 1bb8: 08 95 ret if (InParam[1] == '\0') { if (InParam[0] == COMMAND_CHAR_TRUE) { ActiveConfiguration.ReadOnly = true; return COMMAND_INFO_OK_ID; } else if (InParam[0] == COMMAND_CHAR_FALSE) { ActiveConfiguration.ReadOnly = false; - 182a: 10 92 fc 20 sts 0x20FC, r1 + 1bba: 10 92 fc 24 sts 0x24FC, r1 return COMMAND_INFO_OK_ID; - 182e: 84 e6 ldi r24, 0x64 ; 100 - 1830: 08 95 ret + 1bbe: 84 e6 ldi r24, 0x64 ; 100 + 1bc0: 08 95 ret CommandStatusIdType CommandSetReadOnly(const char* InParam) { if (InParam[1] == '\0') { if (InParam[0] == COMMAND_CHAR_TRUE) { ActiveConfiguration.ReadOnly = true; - 1832: 81 e0 ldi r24, 0x01 ; 1 - 1834: 80 93 fc 20 sts 0x20FC, r24 + 1bc2: 81 e0 ldi r24, 0x01 ; 1 + 1bc4: 80 93 fc 24 sts 0x24FC, r24 return COMMAND_INFO_OK_ID; - 1838: 84 e6 ldi r24, 0x64 ; 100 - 183a: 08 95 ret + 1bc8: 84 e6 ldi r24, 0x64 ; 100 + 1bca: 08 95 ret -0000183c : +00001bcc : return COMMAND_ERR_INVALID_PARAM_ID; } CommandStatusIdType CommandExecUpload(char* OutMessage) { XModemReceive(MemoryUploadBlock); - 183c: 8f e1 ldi r24, 0x1F ; 31 - 183e: 98 e0 ldi r25, 0x08 ; 8 - 1840: f7 d0 rcall .+494 ; 0x1a30 + 1bcc: 80 e1 ldi r24, 0x10 ; 16 + 1bce: 98 e0 ldi r25, 0x08 ; 8 + 1bd0: f8 d0 rcall .+496 ; 0x1dc2 return COMMAND_INFO_XMODEM_WAIT_ID; } - 1842: 8e e6 ldi r24, 0x6E ; 110 - 1844: 08 95 ret + 1bd2: 8e e6 ldi r24, 0x6E ; 110 + 1bd4: 08 95 ret -00001846 : +00001bd6 : CommandStatusIdType CommandExecDownload(char* OutMessage) { XModemSend(MemoryDownloadBlock); - 1846: 87 e5 ldi r24, 0x57 ; 87 - 1848: 98 e0 ldi r25, 0x08 ; 8 - 184a: 0a d1 rcall .+532 ; 0x1a60 + 1bd6: 81 ef ldi r24, 0xF1 ; 241 + 1bd8: 99 e0 ldi r25, 0x09 ; 9 + 1bda: 0b d1 rcall .+534 ; 0x1df2 return COMMAND_INFO_XMODEM_WAIT_ID; } - 184c: 8e e6 ldi r24, 0x6E ; 110 - 184e: 08 95 ret + 1bdc: 8e e6 ldi r24, 0x6E ; 110 + 1bde: 08 95 ret -00001850 : +00001be0 : * enumerating the device once attached until \ref USB_Attach() is called. */ static inline void USB_Detach(void) ATTR_ALWAYS_INLINE; static inline void USB_Detach(void) { USB.CTRLB &= ~USB_ATTACH_bm; - 1850: e0 ec ldi r30, 0xC0 ; 192 - 1852: f4 e0 ldi r31, 0x04 ; 4 - 1854: 81 81 ldd r24, Z+1 ; 0x01 - 1856: 8e 7f andi r24, 0xFE ; 254 - 1858: 81 83 std Z+1, r24 ; 0x01 + 1be0: e0 ec ldi r30, 0xC0 ; 192 + 1be2: f4 e0 ldi r31, 0x04 ; 4 + 1be4: 81 81 ldd r24, Z+1 ; 0x01 + 1be6: 8e 7f andi r24, 0xFE ; 254 + 1be8: 81 83 std Z+1, r24 ; 0x01 CommandStatusIdType CommandExecReset(char* OutMessage) { USB_Detach(); USB_Disable(); - 185a: 0e 94 aa 20 call 0x4154 ; 0x4154 + 1bea: 0e 94 73 22 call 0x44e6 ; 0x44e6 SystemReset(); - 185e: 0e 94 06 04 call 0x80c ; 0x80c + 1bee: 0e 94 2a 04 call 0x854 ; 0x854 return COMMAND_INFO_OK_ID; } - 1862: 84 e6 ldi r24, 0x64 ; 100 - 1864: 08 95 ret + 1bf2: 84 e6 ldi r24, 0x64 ; 100 + 1bf4: 08 95 ret -00001866 : - 1866: e0 ec ldi r30, 0xC0 ; 192 - 1868: f4 e0 ldi r31, 0x04 ; 4 - 186a: 81 81 ldd r24, Z+1 ; 0x01 - 186c: 8e 7f andi r24, 0xFE ; 254 - 186e: 81 83 std Z+1, r24 ; 0x01 +00001bf6 : + 1bf6: e0 ec ldi r30, 0xC0 ; 192 + 1bf8: f4 e0 ldi r31, 0x04 ; 4 + 1bfa: 81 81 ldd r24, Z+1 ; 0x01 + 1bfc: 8e 7f andi r24, 0xFE ; 254 + 1bfe: 81 83 std Z+1, r24 ; 0x01 #ifdef SUPPORT_FIRMWARE_UPGRADE CommandStatusIdType CommandExecUpgrade(char* OutMessage) { USB_Detach(); USB_Disable(); - 1870: 0e 94 aa 20 call 0x4154 ; 0x4154 + 1c00: 0e 94 73 22 call 0x44e6 ; 0x44e6 SystemEnterBootloader(); - 1874: 0e 94 0d 04 call 0x81a ; 0x81a + 1c04: 0e 94 31 04 call 0x862 ; 0x862 return COMMAND_INFO_OK_ID; } - 1878: 84 e6 ldi r24, 0x64 ; 100 - 187a: 08 95 ret + 1c08: 84 e6 ldi r24, 0x64 ; 100 + 1c0a: 08 95 ret -0000187c : +00001c0c : #endif CommandStatusIdType CommandGetMemSize(char* OutParam) { snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.MemorySize); - 187c: e9 ef ldi r30, 0xF9 ; 249 - 187e: f0 e2 ldi r31, 0x20 ; 32 - 1880: 21 81 ldd r18, Z+1 ; 0x01 - 1882: 2f 93 push r18 - 1884: 20 81 ld r18, Z - 1886: 2f 93 push r18 - 1888: 2e e2 ldi r18, 0x2E ; 46 - 188a: 34 e0 ldi r19, 0x04 ; 4 - 188c: 3f 93 push r19 - 188e: 2f 93 push r18 - 1890: 21 e0 ldi r18, 0x01 ; 1 - 1892: 2f 93 push r18 - 1894: 1f 92 push r1 - 1896: 9f 93 push r25 - 1898: 8f 93 push r24 - 189a: 0e 94 37 24 call 0x486e ; 0x486e + 1c0c: e9 ef ldi r30, 0xF9 ; 249 + 1c0e: f4 e2 ldi r31, 0x24 ; 36 + 1c10: 21 81 ldd r18, Z+1 ; 0x01 + 1c12: 2f 93 push r18 + 1c14: 20 81 ld r18, Z + 1c16: 2f 93 push r18 + 1c18: 2e e6 ldi r18, 0x6E ; 110 + 1c1a: 34 e0 ldi r19, 0x04 ; 4 + 1c1c: 3f 93 push r19 + 1c1e: 2f 93 push r18 + 1c20: 21 e0 ldi r18, 0x01 ; 1 + 1c22: 2f 93 push r18 + 1c24: 1f 92 push r1 + 1c26: 9f 93 push r25 + 1c28: 8f 93 push r24 + 1c2a: 0e 94 00 26 call 0x4c00 ; 0x4c00 return COMMAND_INFO_OK_WITH_TEXT_ID; - 189e: 8d b7 in r24, 0x3d ; 61 - 18a0: 9e b7 in r25, 0x3e ; 62 - 18a2: 08 96 adiw r24, 0x08 ; 8 - 18a4: 8d bf out 0x3d, r24 ; 61 - 18a6: 9e bf out 0x3e, r25 ; 62 + 1c2e: 8d b7 in r24, 0x3d ; 61 + 1c30: 9e b7 in r25, 0x3e ; 62 + 1c32: 08 96 adiw r24, 0x08 ; 8 + 1c34: 8d bf out 0x3d, r24 ; 61 + 1c36: 9e bf out 0x3e, r25 ; 62 } - 18a8: 85 e6 ldi r24, 0x65 ; 101 - 18aa: 08 95 ret + 1c38: 85 e6 ldi r24, 0x65 ; 101 + 1c3a: 08 95 ret -000018ac : +00001c3c : CommandStatusIdType CommandGetUidSize(char* OutParam) { snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.UidSize); - 18ac: 20 91 fb 20 lds r18, 0x20FB - 18b0: 1f 92 push r1 - 18b2: 2f 93 push r18 - 18b4: 21 e3 ldi r18, 0x31 ; 49 - 18b6: 34 e0 ldi r19, 0x04 ; 4 - 18b8: 3f 93 push r19 - 18ba: 2f 93 push r18 - 18bc: 21 e0 ldi r18, 0x01 ; 1 - 18be: 2f 93 push r18 - 18c0: 1f 92 push r1 - 18c2: 9f 93 push r25 - 18c4: 8f 93 push r24 - 18c6: 0e 94 37 24 call 0x486e ; 0x486e + 1c3c: 20 91 fb 24 lds r18, 0x24FB + 1c40: 1f 92 push r1 + 1c42: 2f 93 push r18 + 1c44: 21 e7 ldi r18, 0x71 ; 113 + 1c46: 34 e0 ldi r19, 0x04 ; 4 + 1c48: 3f 93 push r19 + 1c4a: 2f 93 push r18 + 1c4c: 21 e0 ldi r18, 0x01 ; 1 + 1c4e: 2f 93 push r18 + 1c50: 1f 92 push r1 + 1c52: 9f 93 push r25 + 1c54: 8f 93 push r24 + 1c56: 0e 94 00 26 call 0x4c00 ; 0x4c00 return COMMAND_INFO_OK_WITH_TEXT_ID; - 18ca: 8d b7 in r24, 0x3d ; 61 - 18cc: 9e b7 in r25, 0x3e ; 62 - 18ce: 08 96 adiw r24, 0x08 ; 8 - 18d0: 8d bf out 0x3d, r24 ; 61 - 18d2: 9e bf out 0x3e, r25 ; 62 + 1c5a: 8d b7 in r24, 0x3d ; 61 + 1c5c: 9e b7 in r25, 0x3e ; 62 + 1c5e: 08 96 adiw r24, 0x08 ; 8 + 1c60: 8d bf out 0x3d, r24 ; 61 + 1c62: 9e bf out 0x3e, r25 ; 62 } - 18d4: 85 e6 ldi r24, 0x65 ; 101 - 18d6: 08 95 ret + 1c64: 85 e6 ldi r24, 0x65 ; 101 + 1c66: 08 95 ret -000018d8 : +00001c68 : CommandStatusIdType CommandExecButton(char* OutMessage) { ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); - 18d8: 60 e0 ldi r22, 0x00 ; 0 - 18da: 71 e0 ldi r23, 0x01 ; 1 - 18dc: 03 dd rcall .-1530 ; 0x12e4 + 1c68: 60 e0 ldi r22, 0x00 ; 0 + 1c6a: 71 e0 ldi r23, 0x01 ; 1 + 1c6c: e3 dc rcall .-1594 ; 0x1634 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 18de: 85 e6 ldi r24, 0x65 ; 101 - 18e0: 08 95 ret + 1c6e: 85 e6 ldi r24, 0x65 ; 101 + 1c70: 08 95 ret -000018e2 : +00001c72 : CommandStatusIdType CommandGetButton(char* OutParam) { ButtonGetActionByName(OutParam, TERMINAL_BUFFER_SIZE); - 18e2: 60 e0 ldi r22, 0x00 ; 0 - 18e4: 71 e0 ldi r23, 0x01 ; 1 - 18e6: 36 dd rcall .-1428 ; 0x1354 + 1c72: 60 e0 ldi r22, 0x00 ; 0 + 1c74: 71 e0 ldi r23, 0x01 ; 1 + 1c76: 16 dd rcall .-1492 ; 0x16a4 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 18e8: 85 e6 ldi r24, 0x65 ; 101 - 18ea: 08 95 ret + 1c78: 85 e6 ldi r24, 0x65 ; 101 + 1c7a: 08 95 ret -000018ec : +00001c7c : CommandStatusIdType CommandSetButton(const char* InParam) { if (ButtonSetActionByName(InParam)) { - 18ec: 41 dd rcall .-1406 ; 0x1370 - 18ee: 81 11 cpse r24, r1 - 18f0: 02 c0 rjmp .+4 ; 0x18f6 + 1c7c: 21 dd rcall .-1470 ; 0x16c0 + 1c7e: 81 11 cpse r24, r1 + 1c80: 02 c0 rjmp .+4 ; 0x1c86 SettingsSave(); return COMMAND_INFO_OK_ID; } else { return COMMAND_ERR_INVALID_PARAM_ID; - 18f2: 8a ec ldi r24, 0xCA ; 202 + 1c82: 8a ec ldi r24, 0xCA ; 202 } } - 18f4: 08 95 ret + 1c84: 08 95 ret } CommandStatusIdType CommandSetButton(const char* InParam) { if (ButtonSetActionByName(InParam)) { SettingsSave(); - 18f6: 8d dd rcall .-1254 ; 0x1412 + 1c86: 7f dd rcall .-1282 ; 0x1786 return COMMAND_INFO_OK_ID; - 18f8: 84 e6 ldi r24, 0x64 ; 100 - 18fa: 08 95 ret + 1c88: 84 e6 ldi r24, 0x64 ; 100 + 1c8a: 08 95 ret -000018fc : +00001c8c : } } CommandStatusIdType CommandGetSetting(char* OutParam) { SettingsGetActiveByName(OutParam, TERMINAL_BUFFER_SIZE); - 18fc: 60 e0 ldi r22, 0x00 ; 0 - 18fe: 71 e0 ldi r23, 0x01 ; 1 - 1900: 0f de rcall .-994 ; 0x1520 + 1c8c: 60 e0 ldi r22, 0x00 ; 0 + 1c8e: 71 e0 ldi r23, 0x01 ; 1 + 1c90: 08 de rcall .-1008 ; 0x18a2 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 1902: 85 e6 ldi r24, 0x65 ; 101 - 1904: 08 95 ret + 1c92: 85 e6 ldi r24, 0x65 ; 101 + 1c94: 08 95 ret -00001906 : +00001c96 : CommandStatusIdType CommandSetSetting(const char* InParam) { if (SettingsSetActiveByName(InParam)) { - 1906: 16 de rcall .-980 ; 0x1534 - 1908: 81 11 cpse r24, r1 - 190a: 02 c0 rjmp .+4 ; 0x1910 + 1c96: 0f de rcall .-994 ; 0x18b6 + 1c98: 81 11 cpse r24, r1 + 1c9a: 02 c0 rjmp .+4 ; 0x1ca0 SettingsSave(); return COMMAND_INFO_OK_ID; } else { return COMMAND_ERR_INVALID_PARAM_ID; - 190c: 8a ec ldi r24, 0xCA ; 202 + 1c9c: 8a ec ldi r24, 0xCA ; 202 } } - 190e: 08 95 ret + 1c9e: 08 95 ret } CommandStatusIdType CommandSetSetting(const char* InParam) { if (SettingsSetActiveByName(InParam)) { SettingsSave(); - 1910: 80 dd rcall .-1280 ; 0x1412 + 1ca0: 72 dd rcall .-1308 ; 0x1786 return COMMAND_INFO_OK_ID; - 1912: 84 e6 ldi r24, 0x64 ; 100 - 1914: 08 95 ret + 1ca2: 84 e6 ldi r24, 0x64 ; 100 + 1ca4: 08 95 ret -00001916 : +00001ca6 : } } CommandStatusIdType CommandExecClear(char* OutParam) { MemoryClear(); - 1916: 38 db rcall .-2448 ; 0xf88 + 1ca6: 0e 94 d3 05 call 0xba6 ; 0xba6 return COMMAND_INFO_OK_ID; } - 1918: 84 e6 ldi r24, 0x64 ; 100 - 191a: 08 95 ret + 1caa: 84 e6 ldi r24, 0x64 ; 100 + 1cac: 08 95 ret -0000191c : +00001cae : CommandStatusIdType CommandExecHelp(char* OutMessage) { - 191c: bf 92 push r11 - 191e: cf 92 push r12 - 1920: df 92 push r13 - 1922: ef 92 push r14 - 1924: ff 92 push r15 - 1926: 0f 93 push r16 - 1928: 1f 93 push r17 - 192a: cf 93 push r28 - 192c: df 93 push r29 - 192e: 7c 01 movw r14, r24 + 1cae: bf 92 push r11 + 1cb0: cf 92 push r12 + 1cb2: df 92 push r13 + 1cb4: ef 92 push r14 + 1cb6: ff 92 push r15 + 1cb8: 0f 93 push r16 + 1cba: 1f 93 push r17 + 1cbc: cf 93 push r28 + 1cbe: df 93 push r29 + 1cc0: 7c 01 movw r14, r24 const CommandEntryType* EntryPtr = CommandTable; uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ - 1930: cf ef ldi r28, 0xFF ; 255 - 1932: d0 e0 ldi r29, 0x00 ; 0 + 1cc2: cf ef ldi r28, 0xFF ; 255 + 1cc4: d0 e0 ldi r29, 0x00 ; 0 return COMMAND_INFO_OK_ID; } CommandStatusIdType CommandExecHelp(char* OutMessage) { const CommandEntryType* EntryPtr = CommandTable; - 1934: 3b e3 ldi r19, 0x3B ; 59 - 1936: c3 2e mov r12, r19 - 1938: 34 e0 ldi r19, 0x04 ; 4 - 193a: d3 2e mov r13, r19 + 1cc6: 3b e7 ldi r19, 0x7B ; 123 + 1cc8: c3 2e mov r12, r19 + 1cca: 34 e0 ldi r19, 0x04 ; 4 + 1ccc: d3 2e mov r13, r19 *OutMessage++ = c; CommandName++; ByteCount--; } *OutMessage++ = ','; - 193c: 4c e2 ldi r20, 0x2C ; 44 - 193e: b4 2e mov r11, r20 + 1cce: 4c e2 ldi r20, 0x2C ; 44 + 1cd0: b4 2e mov r11, r20 CommandStatusIdType CommandExecHelp(char* OutMessage) { const CommandEntryType* EntryPtr = CommandTable; uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { - 1940: 86 01 movw r16, r12 - 1942: b6 01 movw r22, r12 - 1944: 80 e9 ldi r24, 0x90 ; 144 - 1946: 90 e2 ldi r25, 0x20 ; 32 - 1948: 0e 94 16 24 call 0x482c ; 0x482c - 194c: 89 2b or r24, r25 - 194e: 21 f1 breq .+72 ; 0x1998 + 1cd2: 86 01 movw r16, r12 + 1cd4: b6 01 movw r22, r12 + 1cd6: 80 e9 ldi r24, 0x90 ; 144 + 1cd8: 90 e2 ldi r25, 0x20 ; 32 + 1cda: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1cde: 89 2b or r24, r25 + 1ce0: 21 f1 breq .+72 ; 0x1d2a const char* CommandName = EntryPtr->Command; char c; while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { - 1950: f6 01 movw r30, r12 - 1952: 84 91 lpm r24, Z - 1954: 88 23 and r24, r24 - 1956: 89 f0 breq .+34 ; 0x197a - 1958: c1 32 cpi r28, 0x21 ; 33 - 195a: d1 05 cpc r29, r1 - 195c: 70 f0 brcs .+28 ; 0x197a - 195e: d7 01 movw r26, r14 - 1960: 03 c0 rjmp .+6 ; 0x1968 - 1962: c0 32 cpi r28, 0x20 ; 32 - 1964: d1 05 cpc r29, r1 - 1966: 49 f0 breq .+18 ; 0x197a + 1ce2: f6 01 movw r30, r12 + 1ce4: 84 91 lpm r24, Z + 1ce6: 88 23 and r24, r24 + 1ce8: 89 f0 breq .+34 ; 0x1d0c + 1cea: c1 32 cpi r28, 0x21 ; 33 + 1cec: d1 05 cpc r29, r1 + 1cee: 70 f0 brcs .+28 ; 0x1d0c + 1cf0: d7 01 movw r26, r14 + 1cf2: 03 c0 rjmp .+6 ; 0x1cfa + 1cf4: c0 32 cpi r28, 0x20 ; 32 + 1cf6: d1 05 cpc r29, r1 + 1cf8: 49 f0 breq .+18 ; 0x1d0c *OutMessage++ = c; - 1968: 8d 93 st X+, r24 - 196a: 7d 01 movw r14, r26 + 1cfa: 8d 93 st X+, r24 + 1cfc: 7d 01 movw r14, r26 CommandName++; - 196c: 0f 5f subi r16, 0xFF ; 255 - 196e: 1f 4f sbci r17, 0xFF ; 255 + 1cfe: 0f 5f subi r16, 0xFF ; 255 + 1d00: 1f 4f sbci r17, 0xFF ; 255 ByteCount--; - 1970: 21 97 sbiw r28, 0x01 ; 1 + 1d02: 21 97 sbiw r28, 0x01 ; 1 while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { const char* CommandName = EntryPtr->Command; char c; while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { - 1972: f8 01 movw r30, r16 - 1974: 84 91 lpm r24, Z - 1976: 81 11 cpse r24, r1 - 1978: f4 cf rjmp .-24 ; 0x1962 + 1d04: f8 01 movw r30, r16 + 1d06: 84 91 lpm r24, Z + 1d08: 81 11 cpse r24, r1 + 1d0a: f4 cf rjmp .-24 ; 0x1cf4 *OutMessage++ = c; CommandName++; ByteCount--; } *OutMessage++ = ','; - 197a: f7 01 movw r30, r14 - 197c: b1 92 st Z+, r11 - 197e: 7f 01 movw r14, r30 + 1d0c: f7 01 movw r30, r14 + 1d0e: b1 92 st Z+, r11 + 1d10: 7f 01 movw r14, r30 ByteCount--; - 1980: 21 97 sbiw r28, 0x01 ; 1 + 1d12: 21 97 sbiw r28, 0x01 ; 1 EntryPtr++; - 1982: f6 e1 ldi r31, 0x16 ; 22 - 1984: cf 0e add r12, r31 - 1986: d1 1c adc r13, r1 + 1d14: f6 e1 ldi r31, 0x16 ; 22 + 1d16: cf 0e add r12, r31 + 1d18: d1 1c adc r13, r1 CommandStatusIdType CommandExecHelp(char* OutMessage) { const CommandEntryType* EntryPtr = CommandTable; uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { - 1988: 86 01 movw r16, r12 - 198a: b6 01 movw r22, r12 - 198c: 80 e9 ldi r24, 0x90 ; 144 - 198e: 90 e2 ldi r25, 0x20 ; 32 - 1990: 0e 94 16 24 call 0x482c ; 0x482c - 1994: 89 2b or r24, r25 - 1996: e1 f6 brne .-72 ; 0x1950 + 1d1a: 86 01 movw r16, r12 + 1d1c: b6 01 movw r22, r12 + 1d1e: 80 e9 ldi r24, 0x90 ; 144 + 1d20: 90 e2 ldi r25, 0x20 ; 32 + 1d22: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 1d26: 89 2b or r24, r25 + 1d28: e1 f6 brne .-72 ; 0x1ce2 ByteCount--; EntryPtr++; } *--OutMessage = '\0'; - 1998: f7 01 movw r30, r14 - 199a: 31 97 sbiw r30, 0x01 ; 1 - 199c: 10 82 st Z, r1 + 1d2a: f7 01 movw r30, r14 + 1d2c: 31 97 sbiw r30, 0x01 ; 1 + 1d2e: 10 82 st Z, r1 return COMMAND_INFO_OK_WITH_TEXT_ID; } - 199e: 85 e6 ldi r24, 0x65 ; 101 - 19a0: df 91 pop r29 - 19a2: cf 91 pop r28 - 19a4: 1f 91 pop r17 - 19a6: 0f 91 pop r16 - 19a8: ff 90 pop r15 - 19aa: ef 90 pop r14 - 19ac: df 90 pop r13 - 19ae: cf 90 pop r12 - 19b0: bf 90 pop r11 - 19b2: 08 95 ret + 1d30: 85 e6 ldi r24, 0x65 ; 101 + 1d32: df 91 pop r29 + 1d34: cf 91 pop r28 + 1d36: 1f 91 pop r17 + 1d38: 0f 91 pop r16 + 1d3a: ff 90 pop r15 + 1d3c: ef 90 pop r14 + 1d3e: df 90 pop r13 + 1d40: cf 90 pop r12 + 1d42: bf 90 pop r11 + 1d44: 08 95 ret -000019b4 : +00001d46 : CommandStatusIdType CommandGetRssi(char* OutParam) { - 19b4: fc 01 movw r30, r24 + 1d46: fc 01 movw r30, r24 } static inline uint16_t AntennaLevelGet(void) { ADCA.CH0.CTRL |= ADC_CH_START_bm; - 19b6: 20 91 20 02 lds r18, 0x0220 - 19ba: 20 68 ori r18, 0x80 ; 128 - 19bc: 20 93 20 02 sts 0x0220, r18 + 1d48: 20 91 20 02 lds r18, 0x0220 + 1d4c: 20 68 ori r18, 0x80 ; 128 + 1d4e: 20 93 20 02 sts 0x0220, r18 while( !(ADCA.CH0.INTFLAGS & ADC_CH_CHIF_bm) ); - 19c0: 20 91 23 02 lds r18, 0x0223 - 19c4: 20 ff sbrs r18, 0 - 19c6: fc cf rjmp .-8 ; 0x19c0 + 1d52: 20 91 23 02 lds r18, 0x0223 + 1d56: 20 ff sbrs r18, 0 + 1d58: fc cf rjmp .-8 ; 0x1d52 ADCA.CH0.INTFLAGS = ADC_CH_CHIF_bm; - 19c8: 81 e0 ldi r24, 0x01 ; 1 - 19ca: 80 93 23 02 sts 0x0223, r24 + 1d5a: 81 e0 ldi r24, 0x01 ; 1 + 1d5c: 80 93 23 02 sts 0x0223, r24 int16_t Result = ADCA.CH0RES - ANTENNA_LEVEL_OFFSET; - 19ce: a0 91 10 02 lds r26, 0x0210 - 19d2: b0 91 11 02 lds r27, 0x0211 + 1d60: a0 91 10 02 lds r26, 0x0210 + 1d64: b0 91 11 02 lds r27, 0x0211 if (Result < 0) Result = 0; return (uint16_t) (((uint32_t) Result * ANTENNA_LEVEL_NUMERATOR) / ANTENNA_LEVEL_DENOMINATOR); - 19d6: ae 5b subi r26, 0xBE ; 190 - 19d8: b1 09 sbc r27, r1 - 19da: b7 fd sbrc r27, 7 - 19dc: 1c c0 rjmp .+56 ; 0x1a16 - 19de: 29 e6 ldi r18, 0x69 ; 105 - 19e0: 37 e5 ldi r19, 0x57 ; 87 - 19e2: 4b e0 ldi r20, 0x0B ; 11 - 19e4: 50 e0 ldi r21, 0x00 ; 0 - 19e6: 0e 94 97 23 call 0x472e ; 0x472e <__mulshisi3> - 19ea: aa 27 eor r26, r26 - 19ec: bb 27 eor r27, r27 + 1d68: ae 5b subi r26, 0xBE ; 190 + 1d6a: b1 09 sbc r27, r1 + 1d6c: b7 fd sbrc r27, 7 + 1d6e: 1c c0 rjmp .+56 ; 0x1da8 + 1d70: 29 e6 ldi r18, 0x69 ; 105 + 1d72: 37 e5 ldi r19, 0x57 ; 87 + 1d74: 4b e0 ldi r20, 0x0B ; 11 + 1d76: 50 e0 ldi r21, 0x00 ; 0 + 1d78: 0e 94 60 25 call 0x4ac0 ; 0x4ac0 <__mulshisi3> + 1d7c: aa 27 eor r26, r26 + 1d7e: bb 27 eor r27, r27 snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, - 19ee: 9f 93 push r25 - 19f0: 8f 93 push r24 - 19f2: 24 e3 ldi r18, 0x34 ; 52 - 19f4: 34 e0 ldi r19, 0x04 ; 4 - 19f6: 3f 93 push r19 - 19f8: 2f 93 push r18 - 19fa: 81 e0 ldi r24, 0x01 ; 1 - 19fc: 8f 93 push r24 - 19fe: 1f 92 push r1 - 1a00: ff 93 push r31 - 1a02: ef 93 push r30 - 1a04: 0e 94 37 24 call 0x486e ; 0x486e + 1d80: 9f 93 push r25 + 1d82: 8f 93 push r24 + 1d84: 24 e7 ldi r18, 0x74 ; 116 + 1d86: 34 e0 ldi r19, 0x04 ; 4 + 1d88: 3f 93 push r19 + 1d8a: 2f 93 push r18 + 1d8c: 81 e0 ldi r24, 0x01 ; 1 + 1d8e: 8f 93 push r24 + 1d90: 1f 92 push r1 + 1d92: ff 93 push r31 + 1d94: ef 93 push r30 + 1d96: 0e 94 00 26 call 0x4c00 ; 0x4c00 PSTR("%5u mV"), AntennaLevelGet()); return COMMAND_INFO_OK_WITH_TEXT_ID; - 1a08: 8d b7 in r24, 0x3d ; 61 - 1a0a: 9e b7 in r25, 0x3e ; 62 - 1a0c: 08 96 adiw r24, 0x08 ; 8 - 1a0e: 8d bf out 0x3d, r24 ; 61 - 1a10: 9e bf out 0x3e, r25 ; 62 + 1d9a: 8d b7 in r24, 0x3d ; 61 + 1d9c: 9e b7 in r25, 0x3e ; 62 + 1d9e: 08 96 adiw r24, 0x08 ; 8 + 1da0: 8d bf out 0x3d, r24 ; 61 + 1da2: 9e bf out 0x3e, r25 ; 62 } - 1a12: 85 e6 ldi r24, 0x65 ; 101 - 1a14: 08 95 ret - 1a16: a0 e0 ldi r26, 0x00 ; 0 - 1a18: b0 e0 ldi r27, 0x00 ; 0 - 1a1a: e1 cf rjmp .-62 ; 0x19de + 1da4: 85 e6 ldi r24, 0x65 ; 101 + 1da6: 08 95 ret + 1da8: a0 e0 ldi r26, 0x00 ; 0 + 1daa: b0 e0 ldi r27, 0x00 ; 0 + 1dac: e1 cf rjmp .-62 ; 0x1d70 -00001a1c : +00001dae : static uint32_t BlockAddress; static XModemCallbackType CallbackFunc; static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { uint8_t Checksum = CHECKSUM_INIT_VALUE; - 1a1c: 80 e0 ldi r24, 0x00 ; 0 + 1dae: 80 e0 ldi r24, 0x00 ; 0 uint8_t* DataPtr = (uint8_t*) Buffer; - 1a1e: e0 e1 ldi r30, 0x10 ; 16 - 1a20: f1 e2 ldi r31, 0x21 ; 33 + 1db0: e0 e1 ldi r30, 0x10 ; 16 + 1db2: f5 e2 ldi r31, 0x25 ; 37 while(ByteCount--) { Checksum += *DataPtr++; - 1a22: 91 91 ld r25, Z+ - 1a24: 89 0f add r24, r25 + 1db4: 91 91 ld r25, Z+ + 1db6: 89 0f add r24, r25 static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { uint8_t Checksum = CHECKSUM_INIT_VALUE; uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { - 1a26: 91 e2 ldi r25, 0x21 ; 33 - 1a28: e0 39 cpi r30, 0x90 ; 144 - 1a2a: f9 07 cpc r31, r25 - 1a2c: d1 f7 brne .-12 ; 0x1a22 + 1db8: 95 e2 ldi r25, 0x25 ; 37 + 1dba: e0 39 cpi r30, 0x90 ; 144 + 1dbc: f9 07 cpc r31, r25 + 1dbe: d1 f7 brne .-12 ; 0x1db4 Checksum += *DataPtr++; } return Checksum; } - 1a2e: 08 95 ret + 1dc0: 08 95 ret -00001a30 : +00001dc2 : void XModemReceive(XModemCallbackType TheCallbackFunc) { State = STATE_RECEIVE_INIT; - 1a30: 21 e0 ldi r18, 0x01 ; 1 - 1a32: 20 93 95 20 sts 0x2095, r18 + 1dc2: 21 e0 ldi r18, 0x01 ; 1 + 1dc4: 20 93 95 24 sts 0x2495, r18 CurrentFrameNumber = FIRST_FRAME_NUMBER; - 1a36: 20 93 96 20 sts 0x2096, r18 + 1dc8: 20 93 96 24 sts 0x2496, r18 RetryCount = RECV_INIT_COUNT; - 1a3a: 24 e1 ldi r18, 0x14 ; 20 - 1a3c: 20 93 97 20 sts 0x2097, r18 + 1dcc: 24 e1 ldi r18, 0x14 ; 20 + 1dce: 20 93 97 24 sts 0x2497, r18 RetryTimeout = RECV_INIT_TIMEOUT; - 1a40: 25 e0 ldi r18, 0x05 ; 5 - 1a42: 20 93 98 20 sts 0x2098, r18 + 1dd2: 25 e0 ldi r18, 0x05 ; 5 + 1dd4: 20 93 98 24 sts 0x2498, r18 BlockAddress = 0; - 1a46: 10 92 99 20 sts 0x2099, r1 - 1a4a: 10 92 9a 20 sts 0x209A, r1 - 1a4e: 10 92 9b 20 sts 0x209B, r1 - 1a52: 10 92 9c 20 sts 0x209C, r1 + 1dd8: 10 92 99 24 sts 0x2499, r1 + 1ddc: 10 92 9a 24 sts 0x249A, r1 + 1de0: 10 92 9b 24 sts 0x249B, r1 + 1de4: 10 92 9c 24 sts 0x249C, r1 CallbackFunc = TheCallbackFunc; - 1a56: 80 93 9d 20 sts 0x209D, r24 - 1a5a: 90 93 9e 20 sts 0x209E, r25 - 1a5e: 08 95 ret + 1de8: 80 93 9d 24 sts 0x249D, r24 + 1dec: 90 93 9e 24 sts 0x249E, r25 + 1df0: 08 95 ret -00001a60 : +00001df2 : } void XModemSend(XModemCallbackType TheCallbackFunc) { State = STATE_SEND_INIT; - 1a60: 27 e0 ldi r18, 0x07 ; 7 - 1a62: 20 93 95 20 sts 0x2095, r18 + 1df2: 27 e0 ldi r18, 0x07 ; 7 + 1df4: 20 93 95 24 sts 0x2495, r18 RetryTimeout = SEND_INIT_TIMEOUT; - 1a66: 24 e6 ldi r18, 0x64 ; 100 - 1a68: 20 93 98 20 sts 0x2098, r18 + 1df8: 24 e6 ldi r18, 0x64 ; 100 + 1dfa: 20 93 98 24 sts 0x2498, r18 BlockAddress = 0; - 1a6c: 10 92 99 20 sts 0x2099, r1 - 1a70: 10 92 9a 20 sts 0x209A, r1 - 1a74: 10 92 9b 20 sts 0x209B, r1 - 1a78: 10 92 9c 20 sts 0x209C, r1 + 1dfe: 10 92 99 24 sts 0x2499, r1 + 1e02: 10 92 9a 24 sts 0x249A, r1 + 1e06: 10 92 9b 24 sts 0x249B, r1 + 1e0a: 10 92 9c 24 sts 0x249C, r1 CallbackFunc = TheCallbackFunc; - 1a7c: 80 93 9d 20 sts 0x209D, r24 - 1a80: 90 93 9e 20 sts 0x209E, r25 - 1a84: 08 95 ret + 1e0e: 80 93 9d 24 sts 0x249D, r24 + 1e12: 90 93 9e 24 sts 0x249E, r25 + 1e16: 08 95 ret -00001a86 : +00001e18 : } bool XModemProcessByte(uint8_t Byte) { - 1a86: cf 93 push r28 - 1a88: c8 2f mov r28, r24 + 1e18: cf 93 push r28 + 1e1a: c8 2f mov r28, r24 switch(State) { - 1a8a: 90 91 95 20 lds r25, 0x2095 - 1a8e: 95 30 cpi r25, 0x05 ; 5 - 1a90: 09 f4 brne .+2 ; 0x1a94 - 1a92: 7f c0 rjmp .+254 ; 0x1b92 - 1a94: e0 f0 brcs .+56 ; 0x1ace - 1a96: 97 30 cpi r25, 0x07 ; 7 - 1a98: 09 f4 brne .+2 ; 0x1a9c - 1a9a: 4a c0 rjmp .+148 ; 0x1b30 - 1a9c: 60 f5 brcc .+88 ; 0x1af6 + 1e1c: 90 91 95 24 lds r25, 0x2495 + 1e20: 95 30 cpi r25, 0x05 ; 5 + 1e22: 09 f4 brne .+2 ; 0x1e26 + 1e24: 7f c0 rjmp .+254 ; 0x1f24 + 1e26: e0 f0 brcs .+56 ; 0x1e60 + 1e28: 97 30 cpi r25, 0x07 ; 7 + 1e2a: 09 f4 brne .+2 ; 0x1e2e + 1e2c: 4a c0 rjmp .+148 ; 0x1ec2 + 1e2e: 60 f5 brcc .+88 ; 0x1e88 } break; case STATE_RECEIVE_PROCESS: if (ReceivedFrameNumber == CurrentFrameNumber) { - 1a9e: 20 91 a2 20 lds r18, 0x20A2 - 1aa2: 80 91 96 20 lds r24, 0x2096 - 1aa6: 28 17 cp r18, r24 - 1aa8: 09 f4 brne .+2 ; 0x1aac - 1aaa: df c0 rjmp .+446 ; 0x1c6a + 1e30: 20 91 a2 24 lds r18, 0x24A2 + 1e34: 80 91 96 24 lds r24, 0x2496 + 1e38: 28 17 cp r18, r24 + 1e3a: 09 f4 brne .+2 ; 0x1e3e + 1e3c: df c0 rjmp .+446 ; 0x1ffc } else { /* Data seems to be damaged */ TerminalSendByte(BYTE_NAK); State = STATE_RECEIVE_WAIT; } } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { - 1aac: 30 e0 ldi r19, 0x00 ; 0 - 1aae: 90 e0 ldi r25, 0x00 ; 0 - 1ab0: 01 97 sbiw r24, 0x01 ; 1 - 1ab2: 28 17 cp r18, r24 - 1ab4: 39 07 cpc r19, r25 - 1ab6: 09 f4 brne .+2 ; 0x1aba - 1ab8: 07 c1 rjmp .+526 ; 0x1cc8 + 1e3e: 30 e0 ldi r19, 0x00 ; 0 + 1e40: 90 e0 ldi r25, 0x00 ; 0 + 1e42: 01 97 sbiw r24, 0x01 ; 1 + 1e44: 28 17 cp r18, r24 + 1e46: 39 07 cpc r19, r25 + 1e48: 09 f4 brne .+2 ; 0x1e4c + 1e4a: 07 c1 rjmp .+526 ; 0x205a INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } - 1aba: 68 e1 ldi r22, 0x18 ; 24 - 1abc: 80 e0 ldi r24, 0x00 ; 0 - 1abe: 90 e2 ldi r25, 0x20 ; 32 - 1ac0: 0e 94 00 22 call 0x4400 ; 0x4400 + 1e4c: 68 e1 ldi r22, 0x18 ; 24 + 1e4e: 80 e0 ldi r24, 0x00 ; 0 + 1e50: 90 e2 ldi r25, 0x20 ; 32 + 1e52: 0e 94 c9 23 call 0x4792 ; 0x4792 TerminalSendByte(BYTE_ACK); State = STATE_RECEIVE_WAIT; } else { /* This frame is completely out of order. Just cancel */ TerminalSendByte(BYTE_CAN); State = STATE_OFF; - 1ac4: 10 92 95 20 sts 0x2095, r1 + 1e56: 10 92 95 24 sts 0x2495, r1 default: return false; break; } return true; - 1ac8: 81 e0 ldi r24, 0x01 ; 1 + 1e5a: 81 e0 ldi r24, 0x01 ; 1 } - 1aca: cf 91 pop r28 - 1acc: 08 95 ret + 1e5c: cf 91 pop r28 + 1e5e: 08 95 ret CallbackFunc = TheCallbackFunc; } bool XModemProcessByte(uint8_t Byte) { switch(State) { - 1ace: 93 30 cpi r25, 0x03 ; 3 - 1ad0: 09 f4 brne .+2 ; 0x1ad4 - 1ad2: 57 c0 rjmp .+174 ; 0x1b82 - 1ad4: b8 f0 brcs .+46 ; 0x1b04 + 1e60: 93 30 cpi r25, 0x03 ; 3 + 1e62: 09 f4 brne .+2 ; 0x1e66 + 1e64: 57 c0 rjmp .+174 ; 0x1f14 + 1e66: b8 f0 brcs .+46 ; 0x1e96 ReceivedFrameNumber = Byte; State = STATE_RECEIVE_FRAMENUM2; break; case STATE_RECEIVE_FRAMENUM2: if (Byte == (255 - ReceivedFrameNumber)) { - 1ad6: 90 e0 ldi r25, 0x00 ; 0 - 1ad8: 40 91 a2 20 lds r20, 0x20A2 - 1adc: 2f ef ldi r18, 0xFF ; 255 - 1ade: 30 e0 ldi r19, 0x00 ; 0 - 1ae0: 24 1b sub r18, r20 - 1ae2: 31 09 sbc r19, r1 - 1ae4: 82 17 cp r24, r18 - 1ae6: 93 07 cpc r25, r19 - 1ae8: 09 f0 breq .+2 ; 0x1aec - 1aea: 6a c0 rjmp .+212 ; 0x1bc0 + 1e68: 90 e0 ldi r25, 0x00 ; 0 + 1e6a: 40 91 a2 24 lds r20, 0x24A2 + 1e6e: 2f ef ldi r18, 0xFF ; 255 + 1e70: 30 e0 ldi r19, 0x00 ; 0 + 1e72: 24 1b sub r18, r20 + 1e74: 31 09 sbc r19, r1 + 1e76: 82 17 cp r24, r18 + 1e78: 93 07 cpc r25, r19 + 1e7a: 09 f0 breq .+2 ; 0x1e7e + 1e7c: 6a c0 rjmp .+212 ; 0x1f52 /* frame-number check passed. */ State = STATE_RECEIVE_DATA; - 1aec: 85 e0 ldi r24, 0x05 ; 5 - 1aee: 80 93 95 20 sts 0x2095, r24 + 1e7e: 85 e0 ldi r24, 0x05 ; 5 + 1e80: 80 93 95 24 sts 0x2495, r24 default: return false; break; } return true; - 1af2: 81 e0 ldi r24, 0x01 ; 1 - 1af4: ea cf rjmp .-44 ; 0x1aca + 1e84: 81 e0 ldi r24, 0x01 ; 1 + 1e86: ea cf rjmp .-44 ; 0x1e5c CallbackFunc = TheCallbackFunc; } bool XModemProcessByte(uint8_t Byte) { switch(State) { - 1af6: 98 30 cpi r25, 0x08 ; 8 - 1af8: f1 f0 breq .+60 ; 0x1b36 - 1afa: 99 30 cpi r25, 0x09 ; 9 - 1afc: a1 f0 breq .+40 ; 0x1b26 + 1e88: 98 30 cpi r25, 0x08 ; 8 + 1e8a: f1 f0 breq .+60 ; 0x1ec8 + 1e8c: 99 30 cpi r25, 0x09 ; 9 + 1e8e: a1 f0 breq .+40 ; 0x1eb8 /* Receive Ack */ State = STATE_OFF; break; default: return false; - 1afe: 80 e0 ldi r24, 0x00 ; 0 + 1e90: 80 e0 ldi r24, 0x00 ; 0 break; } return true; } - 1b00: cf 91 pop r28 - 1b02: 08 95 ret + 1e92: cf 91 pop r28 + 1e94: 08 95 ret CallbackFunc = TheCallbackFunc; } bool XModemProcessByte(uint8_t Byte) { switch(State) { - 1b04: 91 30 cpi r25, 0x01 ; 1 - 1b06: d8 f3 brcs .-10 ; 0x1afe + 1e96: 91 30 cpi r25, 0x01 ; 1 + 1e98: d8 f3 brcs .-10 ; 0x1e90 case STATE_RECEIVE_INIT: case STATE_RECEIVE_WAIT: if (Byte == BYTE_SOH) { - 1b08: 81 30 cpi r24, 0x01 ; 1 - 1b0a: 09 f4 brne .+2 ; 0x1b0e - 1b0c: df c0 rjmp .+446 ; 0x1ccc + 1e9a: 81 30 cpi r24, 0x01 ; 1 + 1e9c: 09 f4 brne .+2 ; 0x1ea0 + 1e9e: df c0 rjmp .+446 ; 0x205e /* Next frame incoming */ BufferIdx = 0; Checksum = CHECKSUM_INIT_VALUE; State = STATE_RECEIVE_FRAMENUM1; } else if (Byte == BYTE_EOT) { - 1b0e: 84 30 cpi r24, 0x04 ; 4 - 1b10: 29 f0 breq .+10 ; 0x1b1c + 1ea0: 84 30 cpi r24, 0x04 ; 4 + 1ea2: 29 f0 breq .+10 ; 0x1eae /* Transmission finished */ TerminalSendByte(BYTE_ACK); State = STATE_OFF; } else if (Byte == BYTE_CAN) { - 1b12: 88 31 cpi r24, 0x18 ; 24 - 1b14: 41 f0 breq .+16 ; 0x1b26 + 1ea4: 88 31 cpi r24, 0x18 ; 24 + 1ea6: 41 f0 breq .+16 ; 0x1eb8 default: return false; break; } return true; - 1b16: 81 e0 ldi r24, 0x01 ; 1 + 1ea8: 81 e0 ldi r24, 0x01 ; 1 } - 1b18: cf 91 pop r28 - 1b1a: 08 95 ret - 1b1c: 66 e0 ldi r22, 0x06 ; 6 - 1b1e: 80 e0 ldi r24, 0x00 ; 0 - 1b20: 90 e2 ldi r25, 0x20 ; 32 - 1b22: 0e 94 00 22 call 0x4400 ; 0x4400 + 1eaa: cf 91 pop r28 + 1eac: 08 95 ret + 1eae: 66 e0 ldi r22, 0x06 ; 6 + 1eb0: 80 e0 ldi r24, 0x00 ; 0 + 1eb2: 90 e2 ldi r25, 0x20 ; 32 + 1eb4: 0e 94 c9 23 call 0x4792 ; 0x4792 case STATE_SEND_WAIT: if (Byte == BYTE_CAN) { /* Cancel */ TerminalSendByte(BYTE_ACK); State = STATE_OFF; - 1b26: 10 92 95 20 sts 0x2095, r1 + 1eb8: 10 92 95 24 sts 0x2495, r1 default: return false; break; } return true; - 1b2a: 81 e0 ldi r24, 0x01 ; 1 + 1ebc: 81 e0 ldi r24, 0x01 ; 1 } - 1b2c: cf 91 pop r28 - 1b2e: 08 95 ret + 1ebe: cf 91 pop r28 + 1ec0: 08 95 ret break; case STATE_SEND_INIT: /* Start sending on NAK */ if (Byte == BYTE_NAK) { - 1b30: 85 31 cpi r24, 0x15 ; 21 - 1b32: 09 f4 brne .+2 ; 0x1b36 - 1b34: 50 c0 rjmp .+160 ; 0x1bd6 + 1ec2: 85 31 cpi r24, 0x15 ; 21 + 1ec4: 09 f4 brne .+2 ; 0x1ec8 + 1ec6: 50 c0 rjmp .+160 ; 0x1f68 } /* Fallthrough */ case STATE_SEND_WAIT: if (Byte == BYTE_CAN) { - 1b36: c8 31 cpi r28, 0x18 ; 24 - 1b38: 89 f3 breq .-30 ; 0x1b1c + 1ec8: c8 31 cpi r28, 0x18 ; 24 + 1eca: 89 f3 breq .-30 ; 0x1eae /* Cancel */ TerminalSendByte(BYTE_ACK); State = STATE_OFF; } else if (Byte == BYTE_ACK) { - 1b3a: c6 30 cpi r28, 0x06 ; 6 - 1b3c: 09 f4 brne .+2 ; 0x1b40 - 1b3e: e1 c0 rjmp .+450 ; 0x1d02 + 1ecc: c6 30 cpi r28, 0x06 ; 6 + 1ece: 09 f4 brne .+2 ; 0x1ed2 + 1ed0: e1 c0 rjmp .+450 ; 0x2094 BlockAddress += XMODEM_BLOCK_SIZE; } else { TerminalSendByte(BYTE_EOT); State = STATE_SEND_EOT; } } else if (Byte == BYTE_NAK){ - 1b40: c5 31 cpi r28, 0x15 ; 21 - 1b42: 49 f7 brne .-46 ; 0x1b16 - 1b44: 61 e0 ldi r22, 0x01 ; 1 - 1b46: 80 e0 ldi r24, 0x00 ; 0 - 1b48: 90 e2 ldi r25, 0x20 ; 32 - 1b4a: 0e 94 00 22 call 0x4400 ; 0x4400 - 1b4e: 60 91 96 20 lds r22, 0x2096 - 1b52: 80 e0 ldi r24, 0x00 ; 0 - 1b54: 90 e2 ldi r25, 0x20 ; 32 - 1b56: 0e 94 00 22 call 0x4400 ; 0x4400 + 1ed2: c5 31 cpi r28, 0x15 ; 21 + 1ed4: 49 f7 brne .-46 ; 0x1ea8 + 1ed6: 61 e0 ldi r22, 0x01 ; 1 + 1ed8: 80 e0 ldi r24, 0x00 ; 0 + 1eda: 90 e2 ldi r25, 0x20 ; 32 + 1edc: 0e 94 c9 23 call 0x4792 ; 0x4792 + 1ee0: 60 91 96 24 lds r22, 0x2496 + 1ee4: 80 e0 ldi r24, 0x00 ; 0 + 1ee6: 90 e2 ldi r25, 0x20 ; 32 + 1ee8: 0e 94 c9 23 call 0x4792 ; 0x4792 /* Resend frame */ TerminalSendByte(BYTE_SOH); TerminalSendByte(CurrentFrameNumber); TerminalSendByte(255 - CurrentFrameNumber); - 1b5a: 60 91 96 20 lds r22, 0x2096 - 1b5e: 60 95 com r22 - 1b60: 80 e0 ldi r24, 0x00 ; 0 - 1b62: 90 e2 ldi r25, 0x20 ; 32 - 1b64: 0e 94 00 22 call 0x4400 ; 0x4400 + 1eec: 60 91 96 24 lds r22, 0x2496 + 1ef0: 60 95 com r22 + 1ef2: 80 e0 ldi r24, 0x00 ; 0 + 1ef4: 90 e2 ldi r25, 0x20 ; 32 + 1ef6: 0e 94 c9 23 call 0x4792 ; 0x4792 TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - 1b68: 60 e8 ldi r22, 0x80 ; 128 - 1b6a: 70 e0 ldi r23, 0x00 ; 0 - 1b6c: 80 e1 ldi r24, 0x10 ; 16 - 1b6e: 91 e2 ldi r25, 0x21 ; 33 - 1b70: 07 dd rcall .-1522 ; 0x1580 + 1efa: 60 e8 ldi r22, 0x80 ; 128 + 1efc: 70 e0 ldi r23, 0x00 ; 0 + 1efe: 80 e1 ldi r24, 0x10 ; 16 + 1f00: 95 e2 ldi r25, 0x25 ; 37 + 1f02: ff dc rcall .-1538 ; 0x1902 TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); - 1b72: 54 df rcall .-344 ; 0x1a1c - 1b74: 68 2f mov r22, r24 - 1b76: 80 e0 ldi r24, 0x00 ; 0 - 1b78: 90 e2 ldi r25, 0x20 ; 32 - 1b7a: 0e 94 00 22 call 0x4400 ; 0x4400 + 1f04: 54 df rcall .-344 ; 0x1dae + 1f06: 68 2f mov r22, r24 + 1f08: 80 e0 ldi r24, 0x00 ; 0 + 1f0a: 90 e2 ldi r25, 0x20 ; 32 + 1f0c: 0e 94 c9 23 call 0x4792 ; 0x4792 default: return false; break; } return true; - 1b7e: 81 e0 ldi r24, 0x01 ; 1 - 1b80: a4 cf rjmp .-184 ; 0x1aca + 1f10: 81 e0 ldi r24, 0x01 ; 1 + 1f12: a4 cf rjmp .-184 ; 0x1e5c break; case STATE_RECEIVE_FRAMENUM1: /* Store frame number */ ReceivedFrameNumber = Byte; - 1b82: 80 93 a2 20 sts 0x20A2, r24 + 1f14: 80 93 a2 24 sts 0x24A2, r24 State = STATE_RECEIVE_FRAMENUM2; - 1b86: 84 e0 ldi r24, 0x04 ; 4 - 1b88: 80 93 95 20 sts 0x2095, r24 + 1f18: 84 e0 ldi r24, 0x04 ; 4 + 1f1a: 80 93 95 24 sts 0x2495, r24 default: return false; break; } return true; - 1b8c: 81 e0 ldi r24, 0x01 ; 1 + 1f1e: 81 e0 ldi r24, 0x01 ; 1 } - 1b8e: cf 91 pop r28 - 1b90: 08 95 ret + 1f20: cf 91 pop r28 + 1f22: 08 95 ret break; case STATE_RECEIVE_DATA: /* Process byte and update checksum */ TerminalBuffer[BufferIdx++] = Byte; - 1b92: 20 91 9f 20 lds r18, 0x209F - 1b96: 30 91 a0 20 lds r19, 0x20A0 - 1b9a: f9 01 movw r30, r18 - 1b9c: e0 5f subi r30, 0xF0 ; 240 - 1b9e: fe 4d sbci r31, 0xDE ; 222 - 1ba0: 80 83 st Z, r24 - 1ba2: c9 01 movw r24, r18 - 1ba4: 01 96 adiw r24, 0x01 ; 1 - 1ba6: 80 93 9f 20 sts 0x209F, r24 - 1baa: 90 93 a0 20 sts 0x20A0, r25 + 1f24: 20 91 9f 24 lds r18, 0x249F + 1f28: 30 91 a0 24 lds r19, 0x24A0 + 1f2c: f9 01 movw r30, r18 + 1f2e: e0 5f subi r30, 0xF0 ; 240 + 1f30: fa 4d sbci r31, 0xDA ; 218 + 1f32: 80 83 st Z, r24 + 1f34: c9 01 movw r24, r18 + 1f36: 01 96 adiw r24, 0x01 ; 1 + 1f38: 80 93 9f 24 sts 0x249F, r24 + 1f3c: 90 93 a0 24 sts 0x24A0, r25 if (BufferIdx == XMODEM_BLOCK_SIZE) { - 1bae: 80 38 cpi r24, 0x80 ; 128 - 1bb0: 91 05 cpc r25, r1 - 1bb2: 09 f0 breq .+2 ; 0x1bb6 - 1bb4: b0 cf rjmp .-160 ; 0x1b16 + 1f40: 80 38 cpi r24, 0x80 ; 128 + 1f42: 91 05 cpc r25, r1 + 1f44: 09 f0 breq .+2 ; 0x1f48 + 1f46: b0 cf rjmp .-160 ; 0x1ea8 /* Block full */ State = STATE_RECEIVE_PROCESS; - 1bb6: 86 e0 ldi r24, 0x06 ; 6 - 1bb8: 80 93 95 20 sts 0x2095, r24 + 1f48: 86 e0 ldi r24, 0x06 ; 6 + 1f4a: 80 93 95 24 sts 0x2495, r24 default: return false; break; } return true; - 1bbc: 81 e0 ldi r24, 0x01 ; 1 - 1bbe: 85 cf rjmp .-246 ; 0x1aca - 1bc0: 65 e1 ldi r22, 0x15 ; 21 - 1bc2: 80 e0 ldi r24, 0x00 ; 0 - 1bc4: 90 e2 ldi r25, 0x20 ; 32 - 1bc6: 0e 94 00 22 call 0x4400 ; 0x4400 + 1f4e: 81 e0 ldi r24, 0x01 ; 1 + 1f50: 85 cf rjmp .-246 ; 0x1e5c + 1f52: 65 e1 ldi r22, 0x15 ; 21 + 1f54: 80 e0 ldi r24, 0x00 ; 0 + 1f56: 90 e2 ldi r25, 0x20 ; 32 + 1f58: 0e 94 c9 23 call 0x4792 ; 0x4792 State = STATE_RECEIVE_WAIT; } } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { /* This is a retransmission */ TerminalSendByte(BYTE_ACK); State = STATE_RECEIVE_WAIT; - 1bca: 82 e0 ldi r24, 0x02 ; 2 - 1bcc: 80 93 95 20 sts 0x2095, r24 + 1f5c: 82 e0 ldi r24, 0x02 ; 2 + 1f5e: 80 93 95 24 sts 0x2495, r24 default: return false; break; } return true; - 1bd0: 81 e0 ldi r24, 0x01 ; 1 + 1f62: 81 e0 ldi r24, 0x01 ; 1 } - 1bd2: cf 91 pop r28 - 1bd4: 08 95 ret + 1f64: cf 91 pop r28 + 1f66: 08 95 ret break; case STATE_SEND_INIT: /* Start sending on NAK */ if (Byte == BYTE_NAK) { - 1bd6: 81 e0 ldi r24, 0x01 ; 1 + 1f68: 81 e0 ldi r24, 0x01 ; 1 /* Cancel */ TerminalSendByte(BYTE_ACK); State = STATE_OFF; } else if (Byte == BYTE_ACK) { /* Acknowledge. Proceed to next frame, get data and calc checksum */ CurrentFrameNumber++; - 1bd8: 80 93 96 20 sts 0x2096, r24 + 1f6a: 80 93 96 24 sts 0x2496, r24 if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { - 1bdc: 40 91 99 20 lds r20, 0x2099 - 1be0: 50 91 9a 20 lds r21, 0x209A - 1be4: 60 91 9b 20 lds r22, 0x209B - 1be8: 70 91 9c 20 lds r23, 0x209C - 1bec: e0 91 9d 20 lds r30, 0x209D - 1bf0: f0 91 9e 20 lds r31, 0x209E - 1bf4: 20 e8 ldi r18, 0x80 ; 128 - 1bf6: 30 e0 ldi r19, 0x00 ; 0 - 1bf8: 80 e1 ldi r24, 0x10 ; 16 - 1bfa: 91 e2 ldi r25, 0x21 ; 33 - 1bfc: 09 95 icall - 1bfe: 88 23 and r24, r24 - 1c00: 09 f4 brne .+2 ; 0x1c04 - 1c02: 6f c0 rjmp .+222 ; 0x1ce2 - 1c04: 61 e0 ldi r22, 0x01 ; 1 - 1c06: 80 e0 ldi r24, 0x00 ; 0 - 1c08: 90 e2 ldi r25, 0x20 ; 32 - 1c0a: 0e 94 00 22 call 0x4400 ; 0x4400 - 1c0e: 60 91 96 20 lds r22, 0x2096 - 1c12: 80 e0 ldi r24, 0x00 ; 0 - 1c14: 90 e2 ldi r25, 0x20 ; 32 - 1c16: 0e 94 00 22 call 0x4400 ; 0x4400 + 1f6e: 40 91 99 24 lds r20, 0x2499 + 1f72: 50 91 9a 24 lds r21, 0x249A + 1f76: 60 91 9b 24 lds r22, 0x249B + 1f7a: 70 91 9c 24 lds r23, 0x249C + 1f7e: e0 91 9d 24 lds r30, 0x249D + 1f82: f0 91 9e 24 lds r31, 0x249E + 1f86: 20 e8 ldi r18, 0x80 ; 128 + 1f88: 30 e0 ldi r19, 0x00 ; 0 + 1f8a: 80 e1 ldi r24, 0x10 ; 16 + 1f8c: 95 e2 ldi r25, 0x25 ; 37 + 1f8e: 09 95 icall + 1f90: 88 23 and r24, r24 + 1f92: 09 f4 brne .+2 ; 0x1f96 + 1f94: 6f c0 rjmp .+222 ; 0x2074 + 1f96: 61 e0 ldi r22, 0x01 ; 1 + 1f98: 80 e0 ldi r24, 0x00 ; 0 + 1f9a: 90 e2 ldi r25, 0x20 ; 32 + 1f9c: 0e 94 c9 23 call 0x4792 ; 0x4792 + 1fa0: 60 91 96 24 lds r22, 0x2496 + 1fa4: 80 e0 ldi r24, 0x00 ; 0 + 1fa6: 90 e2 ldi r25, 0x20 ; 32 + 1fa8: 0e 94 c9 23 call 0x4792 ; 0x4792 TerminalSendByte(BYTE_SOH); TerminalSendByte(CurrentFrameNumber); TerminalSendByte(255 - CurrentFrameNumber); - 1c1a: 60 91 96 20 lds r22, 0x2096 - 1c1e: 60 95 com r22 - 1c20: 80 e0 ldi r24, 0x00 ; 0 - 1c22: 90 e2 ldi r25, 0x20 ; 32 - 1c24: 0e 94 00 22 call 0x4400 ; 0x4400 + 1fac: 60 91 96 24 lds r22, 0x2496 + 1fb0: 60 95 com r22 + 1fb2: 80 e0 ldi r24, 0x00 ; 0 + 1fb4: 90 e2 ldi r25, 0x20 ; 32 + 1fb6: 0e 94 c9 23 call 0x4792 ; 0x4792 TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - 1c28: 60 e8 ldi r22, 0x80 ; 128 - 1c2a: 70 e0 ldi r23, 0x00 ; 0 - 1c2c: 80 e1 ldi r24, 0x10 ; 16 - 1c2e: 91 e2 ldi r25, 0x21 ; 33 - 1c30: a7 dc rcall .-1714 ; 0x1580 + 1fba: 60 e8 ldi r22, 0x80 ; 128 + 1fbc: 70 e0 ldi r23, 0x00 ; 0 + 1fbe: 80 e1 ldi r24, 0x10 ; 16 + 1fc0: 95 e2 ldi r25, 0x25 ; 37 + 1fc2: 9f dc rcall .-1730 ; 0x1902 TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); - 1c32: f4 de rcall .-536 ; 0x1a1c - 1c34: 68 2f mov r22, r24 - 1c36: 80 e0 ldi r24, 0x00 ; 0 - 1c38: 90 e2 ldi r25, 0x20 ; 32 - 1c3a: 0e 94 00 22 call 0x4400 ; 0x4400 + 1fc4: f4 de rcall .-536 ; 0x1dae + 1fc6: 68 2f mov r22, r24 + 1fc8: 80 e0 ldi r24, 0x00 ; 0 + 1fca: 90 e2 ldi r25, 0x20 ; 32 + 1fcc: 0e 94 c9 23 call 0x4792 ; 0x4792 BlockAddress += XMODEM_BLOCK_SIZE; - 1c3e: 80 91 99 20 lds r24, 0x2099 - 1c42: 90 91 9a 20 lds r25, 0x209A - 1c46: a0 91 9b 20 lds r26, 0x209B - 1c4a: b0 91 9c 20 lds r27, 0x209C - 1c4e: 80 58 subi r24, 0x80 ; 128 - 1c50: 9f 4f sbci r25, 0xFF ; 255 - 1c52: af 4f sbci r26, 0xFF ; 255 - 1c54: bf 4f sbci r27, 0xFF ; 255 - 1c56: 80 93 99 20 sts 0x2099, r24 - 1c5a: 90 93 9a 20 sts 0x209A, r25 - 1c5e: a0 93 9b 20 sts 0x209B, r26 - 1c62: b0 93 9c 20 sts 0x209C, r27 + 1fd0: 80 91 99 24 lds r24, 0x2499 + 1fd4: 90 91 9a 24 lds r25, 0x249A + 1fd8: a0 91 9b 24 lds r26, 0x249B + 1fdc: b0 91 9c 24 lds r27, 0x249C + 1fe0: 80 58 subi r24, 0x80 ; 128 + 1fe2: 9f 4f sbci r25, 0xFF ; 255 + 1fe4: af 4f sbci r26, 0xFF ; 255 + 1fe6: bf 4f sbci r27, 0xFF ; 255 + 1fe8: 80 93 99 24 sts 0x2499, r24 + 1fec: 90 93 9a 24 sts 0x249A, r25 + 1ff0: a0 93 9b 24 sts 0x249B, r26 + 1ff4: b0 93 9c 24 sts 0x249C, r27 default: return false; break; } return true; - 1c66: 81 e0 ldi r24, 0x01 ; 1 - 1c68: 57 cf rjmp .-338 ; 0x1b18 + 1ff8: 81 e0 ldi r24, 0x01 ; 1 + 1ffa: 57 cf rjmp .-338 ; 0x1eaa case STATE_RECEIVE_PROCESS: if (ReceivedFrameNumber == CurrentFrameNumber) { /* This is the expected frame. Calculate and verify checksum */ if (CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE) == Byte) { - 1c6a: d8 de rcall .-592 ; 0x1a1c - 1c6c: 8c 13 cpse r24, r28 - 1c6e: a8 cf rjmp .-176 ; 0x1bc0 + 1ffc: d8 de rcall .-592 ; 0x1dae + 1ffe: 8c 13 cpse r24, r28 + 2000: a8 cf rjmp .-176 ; 0x1f52 /* Checksum is valid. Pass received data to callback function */ if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { - 1c70: 40 91 99 20 lds r20, 0x2099 - 1c74: 50 91 9a 20 lds r21, 0x209A - 1c78: 60 91 9b 20 lds r22, 0x209B - 1c7c: 70 91 9c 20 lds r23, 0x209C - 1c80: e0 91 9d 20 lds r30, 0x209D - 1c84: f0 91 9e 20 lds r31, 0x209E - 1c88: 20 e8 ldi r18, 0x80 ; 128 - 1c8a: 30 e0 ldi r19, 0x00 ; 0 - 1c8c: 80 e1 ldi r24, 0x10 ; 16 - 1c8e: 91 e2 ldi r25, 0x21 ; 33 - 1c90: 09 95 icall - 1c92: 88 23 and r24, r24 - 1c94: 81 f1 breq .+96 ; 0x1cf6 + 2002: 40 91 99 24 lds r20, 0x2499 + 2006: 50 91 9a 24 lds r21, 0x249A + 200a: 60 91 9b 24 lds r22, 0x249B + 200e: 70 91 9c 24 lds r23, 0x249C + 2012: e0 91 9d 24 lds r30, 0x249D + 2016: f0 91 9e 24 lds r31, 0x249E + 201a: 20 e8 ldi r18, 0x80 ; 128 + 201c: 30 e0 ldi r19, 0x00 ; 0 + 201e: 80 e1 ldi r24, 0x10 ; 16 + 2020: 95 e2 ldi r25, 0x25 ; 37 + 2022: 09 95 icall + 2024: 88 23 and r24, r24 + 2026: 81 f1 breq .+96 ; 0x2088 /* Proceed to next frame and send ACK */ CurrentFrameNumber++; - 1c96: 80 91 96 20 lds r24, 0x2096 - 1c9a: 8f 5f subi r24, 0xFF ; 255 - 1c9c: 80 93 96 20 sts 0x2096, r24 + 2028: 80 91 96 24 lds r24, 0x2496 + 202c: 8f 5f subi r24, 0xFF ; 255 + 202e: 80 93 96 24 sts 0x2496, r24 BlockAddress += XMODEM_BLOCK_SIZE; - 1ca0: 80 91 99 20 lds r24, 0x2099 - 1ca4: 90 91 9a 20 lds r25, 0x209A - 1ca8: a0 91 9b 20 lds r26, 0x209B - 1cac: b0 91 9c 20 lds r27, 0x209C - 1cb0: 80 58 subi r24, 0x80 ; 128 - 1cb2: 9f 4f sbci r25, 0xFF ; 255 - 1cb4: af 4f sbci r26, 0xFF ; 255 - 1cb6: bf 4f sbci r27, 0xFF ; 255 - 1cb8: 80 93 99 20 sts 0x2099, r24 - 1cbc: 90 93 9a 20 sts 0x209A, r25 - 1cc0: a0 93 9b 20 sts 0x209B, r26 - 1cc4: b0 93 9c 20 sts 0x209C, r27 - 1cc8: 66 e0 ldi r22, 0x06 ; 6 - 1cca: 7b cf rjmp .-266 ; 0x1bc2 + 2032: 80 91 99 24 lds r24, 0x2499 + 2036: 90 91 9a 24 lds r25, 0x249A + 203a: a0 91 9b 24 lds r26, 0x249B + 203e: b0 91 9c 24 lds r27, 0x249C + 2042: 80 58 subi r24, 0x80 ; 128 + 2044: 9f 4f sbci r25, 0xFF ; 255 + 2046: af 4f sbci r26, 0xFF ; 255 + 2048: bf 4f sbci r27, 0xFF ; 255 + 204a: 80 93 99 24 sts 0x2499, r24 + 204e: 90 93 9a 24 sts 0x249A, r25 + 2052: a0 93 9b 24 sts 0x249B, r26 + 2056: b0 93 9c 24 sts 0x249C, r27 + 205a: 66 e0 ldi r22, 0x06 ; 6 + 205c: 7b cf rjmp .-266 ; 0x1f54 switch(State) { case STATE_RECEIVE_INIT: case STATE_RECEIVE_WAIT: if (Byte == BYTE_SOH) { /* Next frame incoming */ BufferIdx = 0; - 1ccc: 10 92 9f 20 sts 0x209F, r1 - 1cd0: 10 92 a0 20 sts 0x20A0, r1 + 205e: 10 92 9f 24 sts 0x249F, r1 + 2062: 10 92 a0 24 sts 0x24A0, r1 Checksum = CHECKSUM_INIT_VALUE; - 1cd4: 10 92 a1 20 sts 0x20A1, r1 + 2066: 10 92 a1 24 sts 0x24A1, r1 State = STATE_RECEIVE_FRAMENUM1; - 1cd8: 83 e0 ldi r24, 0x03 ; 3 - 1cda: 80 93 95 20 sts 0x2095, r24 + 206a: 83 e0 ldi r24, 0x03 ; 3 + 206c: 80 93 95 24 sts 0x2495, r24 default: return false; break; } return true; - 1cde: 81 e0 ldi r24, 0x01 ; 1 - 1ce0: f4 ce rjmp .-536 ; 0x1aca - 1ce2: 64 e0 ldi r22, 0x04 ; 4 - 1ce4: 80 e0 ldi r24, 0x00 ; 0 - 1ce6: 90 e2 ldi r25, 0x20 ; 32 - 1ce8: 0e 94 00 22 call 0x4400 ; 0x4400 + 2070: 81 e0 ldi r24, 0x01 ; 1 + 2072: f4 ce rjmp .-536 ; 0x1e5c + 2074: 64 e0 ldi r22, 0x04 ; 4 + 2076: 80 e0 ldi r24, 0x00 ; 0 + 2078: 90 e2 ldi r25, 0x20 ; 32 + 207a: 0e 94 c9 23 call 0x4792 ; 0x4792 TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); BlockAddress += XMODEM_BLOCK_SIZE; } else { TerminalSendByte(BYTE_EOT); State = STATE_SEND_EOT; - 1cec: 89 e0 ldi r24, 0x09 ; 9 - 1cee: 80 93 95 20 sts 0x2095, r24 + 207e: 89 e0 ldi r24, 0x09 ; 9 + 2080: 80 93 95 24 sts 0x2495, r24 default: return false; break; } return true; - 1cf2: 81 e0 ldi r24, 0x01 ; 1 - 1cf4: ea ce rjmp .-556 ; 0x1aca - 1cf6: 68 e1 ldi r22, 0x18 ; 24 - 1cf8: 80 e0 ldi r24, 0x00 ; 0 - 1cfa: 90 e2 ldi r25, 0x20 ; 32 - 1cfc: 0e 94 00 22 call 0x4400 ; 0x4400 - 1d00: dc ce rjmp .-584 ; 0x1aba - 1d02: 80 91 96 20 lds r24, 0x2096 - 1d06: 8f 5f subi r24, 0xFF ; 255 - 1d08: 67 cf rjmp .-306 ; 0x1bd8 + 2084: 81 e0 ldi r24, 0x01 ; 1 + 2086: ea ce rjmp .-556 ; 0x1e5c + 2088: 68 e1 ldi r22, 0x18 ; 24 + 208a: 80 e0 ldi r24, 0x00 ; 0 + 208c: 90 e2 ldi r25, 0x20 ; 32 + 208e: 0e 94 c9 23 call 0x4792 ; 0x4792 + 2092: dc ce rjmp .-584 ; 0x1e4c + 2094: 80 91 96 24 lds r24, 0x2496 + 2098: 8f 5f subi r24, 0xFF ; 255 + 209a: 67 cf rjmp .-306 ; 0x1f6a -00001d0a : +0000209c : } void XModemTick(void) { /* Timeouts go here */ switch(State) { - 1d0a: 80 91 95 20 lds r24, 0x2095 - 1d0e: 81 30 cpi r24, 0x01 ; 1 - 1d10: 71 f0 breq .+28 ; 0x1d2e - 1d12: 87 30 cpi r24, 0x07 ; 7 - 1d14: 09 f0 breq .+2 ; 0x1d18 - 1d16: 08 95 ret + 209c: 80 91 95 24 lds r24, 0x2495 + 20a0: 81 30 cpi r24, 0x01 ; 1 + 20a2: 71 f0 breq .+28 ; 0x20c0 + 20a4: 87 30 cpi r24, 0x07 ; 7 + 20a6: 09 f0 breq .+2 ; 0x20aa + 20a8: 08 95 ret RetryTimeout = RECV_INIT_TIMEOUT; } break; case STATE_SEND_INIT: if (RetryTimeout-- == 0) { - 1d18: 80 91 98 20 lds r24, 0x2098 - 1d1c: 98 2f mov r25, r24 - 1d1e: 91 50 subi r25, 0x01 ; 1 - 1d20: 90 93 98 20 sts 0x2098, r25 - 1d24: 81 11 cpse r24, r1 - 1d26: f7 cf rjmp .-18 ; 0x1d16 + 20aa: 80 91 98 24 lds r24, 0x2498 + 20ae: 98 2f mov r25, r24 + 20b0: 91 50 subi r25, 0x01 ; 1 + 20b2: 90 93 98 24 sts 0x2498, r25 + 20b6: 81 11 cpse r24, r1 + 20b8: f7 cf rjmp .-18 ; 0x20a8 /* Abort */ State = STATE_OFF; - 1d28: 10 92 95 20 sts 0x2095, r1 - 1d2c: 08 95 ret + 20ba: 10 92 95 24 sts 0x2495, r1 + 20be: 08 95 ret void XModemTick(void) { /* Timeouts go here */ switch(State) { case STATE_RECEIVE_INIT: if (RetryTimeout-- == 0) { - 1d2e: 80 91 98 20 lds r24, 0x2098 - 1d32: 98 2f mov r25, r24 - 1d34: 91 50 subi r25, 0x01 ; 1 - 1d36: 90 93 98 20 sts 0x2098, r25 - 1d3a: 81 11 cpse r24, r1 - 1d3c: ec cf rjmp .-40 ; 0x1d16 + 20c0: 80 91 98 24 lds r24, 0x2498 + 20c4: 98 2f mov r25, r24 + 20c6: 91 50 subi r25, 0x01 ; 1 + 20c8: 90 93 98 24 sts 0x2498, r25 + 20cc: 81 11 cpse r24, r1 + 20ce: ec cf rjmp .-40 ; 0x20a8 if (RetryCount-- > 0) { - 1d3e: 80 91 97 20 lds r24, 0x2097 - 1d42: 98 2f mov r25, r24 - 1d44: 91 50 subi r25, 0x01 ; 1 - 1d46: 90 93 97 20 sts 0x2097, r25 - 1d4a: 81 11 cpse r24, r1 - 1d4c: 06 c0 rjmp .+12 ; 0x1d5a + 20d0: 80 91 97 24 lds r24, 0x2497 + 20d4: 98 2f mov r25, r24 + 20d6: 91 50 subi r25, 0x01 ; 1 + 20d8: 90 93 97 24 sts 0x2497, r25 + 20dc: 81 11 cpse r24, r1 + 20de: 06 c0 rjmp .+12 ; 0x20ec /* Put out communication request */ TerminalSendChar(BYTE_NAK); } else { /* Just shut off after some time. */ State = STATE_OFF; - 1d4e: 10 92 95 20 sts 0x2095, r1 + 20e0: 10 92 95 24 sts 0x2495, r1 } RetryTimeout = RECV_INIT_TIMEOUT; - 1d52: 85 e0 ldi r24, 0x05 ; 5 - 1d54: 80 93 98 20 sts 0x2098, r24 - 1d58: 08 95 ret + 20e4: 85 e0 ldi r24, 0x05 ; 5 + 20e6: 80 93 98 24 sts 0x2498, r24 + 20ea: 08 95 ret void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ControlRequest(void); INLINE void TerminalSendChar(char c) { CDC_Device_SendByte(&TerminalHandle, c); } - 1d5a: 65 e1 ldi r22, 0x15 ; 21 - 1d5c: 80 e0 ldi r24, 0x00 ; 0 - 1d5e: 90 e2 ldi r25, 0x20 ; 32 - 1d60: 0e 94 00 22 call 0x4400 ; 0x4400 - 1d64: f6 cf rjmp .-20 ; 0x1d52 + 20ec: 65 e1 ldi r22, 0x15 ; 21 + 20ee: 80 e0 ldi r24, 0x00 ; 0 + 20f0: 90 e2 ldi r25, 0x20 ; 32 + 20f2: 0e 94 c9 23 call 0x4792 ; 0x4792 + 20f6: f6 cf rjmp .-20 ; 0x20e4 -00001d66 : +000020f8 : void CommandLineInit(void) { BufferIdx = 0; } bool CommandLineProcessByte(uint8_t Byte) { - 1d66: 1f 93 push r17 - 1d68: cf 93 push r28 - 1d6a: df 93 push r29 + 20f8: 1f 93 push r17 + 20fa: cf 93 push r28 + 20fc: df 93 push r29 if (IS_CHARACTER(Byte)){ - 1d6c: 98 2f mov r25, r24 - 1d6e: 91 54 subi r25, 0x41 ; 65 - 1d70: 9a 31 cpi r25, 0x1A ; 26 - 1d72: 20 f0 brcs .+8 ; 0x1d7c - 1d74: 90 52 subi r25, 0x20 ; 32 - 1d76: 9a 31 cpi r25, 0x1A ; 26 - 1d78: b8 f4 brcc .+46 ; 0x1da8 + 20fe: 98 2f mov r25, r24 + 2100: 91 54 subi r25, 0x41 ; 65 + 2102: 9a 31 cpi r25, 0x1A ; 26 + 2104: 20 f0 brcs .+8 ; 0x210e + 2106: 90 52 subi r25, 0x20 ; 32 + 2108: 9a 31 cpi r25, 0x1A ; 26 + 210a: b8 f4 brcc .+46 ; 0x213a /* Store uppercase character */ if (IS_LOWERCASE(Byte)) { Byte = TO_UPPERCASE(Byte); - 1d7a: 80 52 subi r24, 0x20 ; 32 + 210c: 80 52 subi r24, 0x20 ; 32 } /* Prevent buffer overflow and account for '\0' */ if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { - 1d7c: 20 91 a3 20 lds r18, 0x20A3 - 1d80: 30 91 a4 20 lds r19, 0x20A4 - 1d84: 2f 3f cpi r18, 0xFF ; 255 - 1d86: 31 05 cpc r19, r1 - 1d88: 50 f4 brcc .+20 ; 0x1d9e + 210e: 20 91 a3 24 lds r18, 0x24A3 + 2112: 30 91 a4 24 lds r19, 0x24A4 + 2116: 2f 3f cpi r18, 0xFF ; 255 + 2118: 31 05 cpc r19, r1 + 211a: 50 f4 brcc .+20 ; 0x2130 TerminalBuffer[BufferIdx++] = Byte; - 1d8a: f9 01 movw r30, r18 - 1d8c: e0 5f subi r30, 0xF0 ; 240 - 1d8e: fe 4d sbci r31, 0xDE ; 222 - 1d90: 80 83 st Z, r24 - 1d92: 2f 5f subi r18, 0xFF ; 255 - 1d94: 3f 4f sbci r19, 0xFF ; 255 - 1d96: 20 93 a3 20 sts 0x20A3, r18 - 1d9a: 30 93 a4 20 sts 0x20A4, r19 + 211c: f9 01 movw r30, r18 + 211e: e0 5f subi r30, 0xF0 ; 240 + 2120: fa 4d sbci r31, 0xDA ; 218 + 2122: 80 83 st Z, r24 + 2124: 2f 5f subi r18, 0xFF ; 255 + 2126: 3f 4f sbci r19, 0xFF ; 255 + 2128: 20 93 a3 24 sts 0x24A3, r18 + 212c: 30 93 a4 24 sts 0x24A4, r19 } else { /* Ignore other chars */ } return true; } - 1d9e: 81 e0 ldi r24, 0x01 ; 1 - 1da0: df 91 pop r29 - 1da2: cf 91 pop r28 - 1da4: 1f 91 pop r17 - 1da6: 08 95 ret + 2130: 81 e0 ldi r24, 0x01 ; 1 + 2132: df 91 pop r29 + 2134: cf 91 pop r28 + 2136: 1f 91 pop r17 + 2138: 08 95 ret { BufferIdx = 0; } bool CommandLineProcessByte(uint8_t Byte) { if (IS_CHARACTER(Byte)){ - 1da8: 9f 5c subi r25, 0xCF ; 207 - 1daa: 9a 30 cpi r25, 0x0A ; 10 - 1dac: 38 f3 brcs .-50 ; 0x1d7c - 1dae: 8f 35 cpi r24, 0x5F ; 95 - 1db0: 29 f3 breq .-54 ; 0x1d7c - 1db2: 8f 33 cpi r24, 0x3F ; 63 - 1db4: 19 f3 breq .-58 ; 0x1d7c - 1db6: 8d 33 cpi r24, 0x3D ; 61 - 1db8: 09 f3 breq .-62 ; 0x1d7c + 213a: 9f 5c subi r25, 0xCF ; 207 + 213c: 9a 30 cpi r25, 0x0A ; 10 + 213e: 38 f3 brcs .-50 ; 0x210e + 2140: 8f 35 cpi r24, 0x5F ; 95 + 2142: 29 f3 breq .-54 ; 0x210e + 2144: 8f 33 cpi r24, 0x3F ; 63 + 2146: 19 f3 breq .-58 ; 0x210e + 2148: 8d 33 cpi r24, 0x3D ; 61 + 214a: 09 f3 breq .-62 ; 0x210e /* Prevent buffer overflow and account for '\0' */ if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { TerminalBuffer[BufferIdx++] = Byte; } }else if (Byte == '\r') { - 1dba: 8d 30 cpi r24, 0x0D ; 13 - 1dbc: a9 f0 breq .+42 ; 0x1de8 + 214c: 8d 30 cpi r24, 0x0D ; 13 + 214e: a9 f0 breq .+42 ; 0x217a /* Process on \r. Terminate string and decode. */ TerminalBuffer[BufferIdx] = '\0'; BufferIdx = 0; DecodeCommand(); }else if (Byte == '\b') { - 1dbe: 88 30 cpi r24, 0x08 ; 8 - 1dc0: 39 f0 breq .+14 ; 0x1dd0 + 2150: 88 30 cpi r24, 0x08 ; 8 + 2152: 39 f0 breq .+14 ; 0x2162 /* Backspace. Delete last character in buffer. */ if (BufferIdx > 0) { BufferIdx--; } } else if (Byte == 0x1B){ - 1dc2: 8b 31 cpi r24, 0x1B ; 27 - 1dc4: 61 f7 brne .-40 ; 0x1d9e + 2154: 8b 31 cpi r24, 0x1B ; 27 + 2156: 61 f7 brne .-40 ; 0x2130 /* Drop buffer on escape */ BufferIdx = 0; - 1dc6: 10 92 a3 20 sts 0x20A3, r1 - 1dca: 10 92 a4 20 sts 0x20A4, r1 - 1dce: e7 cf rjmp .-50 ; 0x1d9e + 2158: 10 92 a3 24 sts 0x24A3, r1 + 215c: 10 92 a4 24 sts 0x24A4, r1 + 2160: e7 cf rjmp .-50 ; 0x2130 BufferIdx = 0; DecodeCommand(); }else if (Byte == '\b') { /* Backspace. Delete last character in buffer. */ if (BufferIdx > 0) { - 1dd0: 80 91 a3 20 lds r24, 0x20A3 - 1dd4: 90 91 a4 20 lds r25, 0x20A4 - 1dd8: 00 97 sbiw r24, 0x00 ; 0 - 1dda: 09 f3 breq .-62 ; 0x1d9e + 2162: 80 91 a3 24 lds r24, 0x24A3 + 2166: 90 91 a4 24 lds r25, 0x24A4 + 216a: 00 97 sbiw r24, 0x00 ; 0 + 216c: 09 f3 breq .-62 ; 0x2130 BufferIdx--; - 1ddc: 01 97 sbiw r24, 0x01 ; 1 - 1dde: 80 93 a3 20 sts 0x20A3, r24 - 1de2: 90 93 a4 20 sts 0x20A4, r25 - 1de6: db cf rjmp .-74 ; 0x1d9e + 216e: 01 97 sbiw r24, 0x01 ; 1 + 2170: 80 93 a3 24 sts 0x24A3, r24 + 2174: 90 93 a4 24 sts 0x24A4, r25 + 2178: db cf rjmp .-74 ; 0x2130 if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { TerminalBuffer[BufferIdx++] = Byte; } }else if (Byte == '\r') { /* Process on \r. Terminate string and decode. */ TerminalBuffer[BufferIdx] = '\0'; - 1de8: e0 91 a3 20 lds r30, 0x20A3 - 1dec: f0 91 a4 20 lds r31, 0x20A4 - 1df0: e0 5f subi r30, 0xF0 ; 240 - 1df2: fe 4d sbci r31, 0xDE ; 222 - 1df4: 10 82 st Z, r1 + 217a: e0 91 a3 24 lds r30, 0x24A3 + 217e: f0 91 a4 24 lds r31, 0x24A4 + 2182: e0 5f subi r30, 0xF0 ; 240 + 2184: fa 4d sbci r31, 0xDA ; 218 + 2186: 10 82 st Z, r1 BufferIdx = 0; - 1df6: 10 92 a3 20 sts 0x20A3, r1 - 1dfa: 10 92 a4 20 sts 0x20A4, r1 + 2188: 10 92 a3 24 sts 0x24A3, r1 + 218c: 10 92 a4 24 sts 0x24A4, r1 bool CommandFound = false; CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; char* pTerminalBuffer = (char*) TerminalBuffer; /* Do some sanity check first */ if (!IS_COMMAND_DELIMITER(pTerminalBuffer[0])) { - 1dfe: 80 91 10 21 lds r24, 0x2110 - 1e02: 88 23 and r24, r24 - 1e04: 09 f4 brne .+2 ; 0x1e08 - 1e06: a2 c0 rjmp .+324 ; 0x1f4c - 1e08: 8f 33 cpi r24, 0x3F ; 63 - 1e0a: 09 f4 brne .+2 ; 0x1e0e - 1e0c: 9f c0 rjmp .+318 ; 0x1f4c - 1e0e: 8d 33 cpi r24, 0x3D ; 61 - 1e10: 09 f4 brne .+2 ; 0x1e14 - 1e12: 9c c0 rjmp .+312 ; 0x1f4c - 1e14: e1 e1 ldi r30, 0x11 ; 17 - 1e16: f1 e2 ldi r31, 0x21 ; 33 - 1e18: 04 c0 rjmp .+8 ; 0x1e22 + 2190: 80 91 10 25 lds r24, 0x2510 + 2194: 88 23 and r24, r24 + 2196: 09 f4 brne .+2 ; 0x219a + 2198: a2 c0 rjmp .+324 ; 0x22de + 219a: 8f 33 cpi r24, 0x3F ; 63 + 219c: 09 f4 brne .+2 ; 0x21a0 + 219e: 9f c0 rjmp .+318 ; 0x22de + 21a0: 8d 33 cpi r24, 0x3D ; 61 + 21a2: 09 f4 brne .+2 ; 0x21a6 + 21a4: 9c c0 rjmp .+312 ; 0x22de + 21a6: e1 e1 ldi r30, 0x11 ; 17 + 21a8: f5 e2 ldi r31, 0x25 ; 37 + 21aa: 04 c0 rjmp .+8 ; 0x21b4 char* pCommandDelimiter = pTerminalBuffer; char CommandDelimiter = '\0'; /* Search for command delimiter, store it and replace with '\0' */ while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) - 1e1a: 1f 33 cpi r17, 0x3F ; 63 - 1e1c: 31 f0 breq .+12 ; 0x1e2a - 1e1e: 1d 33 cpi r17, 0x3D ; 61 - 1e20: 21 f0 breq .+8 ; 0x1e2a + 21ac: 1f 33 cpi r17, 0x3F ; 63 + 21ae: 31 f0 breq .+12 ; 0x21bc + 21b0: 1d 33 cpi r17, 0x3D ; 61 + 21b2: 21 f0 breq .+8 ; 0x21bc pCommandDelimiter++; - 1e22: ef 01 movw r28, r30 + 21b4: ef 01 movw r28, r30 if (!IS_COMMAND_DELIMITER(pTerminalBuffer[0])) { char* pCommandDelimiter = pTerminalBuffer; char CommandDelimiter = '\0'; /* Search for command delimiter, store it and replace with '\0' */ while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) - 1e24: 11 91 ld r17, Z+ - 1e26: 11 11 cpse r17, r1 - 1e28: f8 cf rjmp .-16 ; 0x1e1a + 21b6: 11 91 ld r17, Z+ + 21b8: 11 11 cpse r17, r1 + 21ba: f8 cf rjmp .-16 ; 0x21ac pCommandDelimiter++; CommandDelimiter = *pCommandDelimiter; *pCommandDelimiter = '\0'; - 1e2a: 18 82 st Y, r1 + 21bc: 18 82 st Y, r1 /* Search in command table */ for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 1e2c: 6b e3 ldi r22, 0x3B ; 59 - 1e2e: 74 e0 ldi r23, 0x04 ; 4 - 1e30: 80 e1 ldi r24, 0x10 ; 16 - 1e32: 91 e2 ldi r25, 0x21 ; 33 - 1e34: 0e 94 16 24 call 0x482c ; 0x482c - 1e38: 89 2b or r24, r25 - 1e3a: 09 f4 brne .+2 ; 0x1e3e - 1e3c: 32 c1 rjmp .+612 ; 0x20a2 - 1e3e: 61 e5 ldi r22, 0x51 ; 81 - 1e40: 74 e0 ldi r23, 0x04 ; 4 - 1e42: 80 e1 ldi r24, 0x10 ; 16 - 1e44: 91 e2 ldi r25, 0x21 ; 33 - 1e46: 0e 94 16 24 call 0x482c ; 0x482c - 1e4a: 89 2b or r24, r25 - 1e4c: 09 f4 brne .+2 ; 0x1e50 - 1e4e: 26 c1 rjmp .+588 ; 0x209c - 1e50: 67 e6 ldi r22, 0x67 ; 103 - 1e52: 74 e0 ldi r23, 0x04 ; 4 - 1e54: 80 e1 ldi r24, 0x10 ; 16 - 1e56: 91 e2 ldi r25, 0x21 ; 33 - 1e58: 0e 94 16 24 call 0x482c ; 0x482c - 1e5c: 89 2b or r24, r25 - 1e5e: 09 f4 brne .+2 ; 0x1e62 - 1e60: 1a c1 rjmp .+564 ; 0x2096 - 1e62: 6d e7 ldi r22, 0x7D ; 125 - 1e64: 74 e0 ldi r23, 0x04 ; 4 - 1e66: 80 e1 ldi r24, 0x10 ; 16 - 1e68: 91 e2 ldi r25, 0x21 ; 33 - 1e6a: 0e 94 16 24 call 0x482c ; 0x482c - 1e6e: 89 2b or r24, r25 - 1e70: 09 f4 brne .+2 ; 0x1e74 - 1e72: 0e c1 rjmp .+540 ; 0x2090 - 1e74: 63 e9 ldi r22, 0x93 ; 147 - 1e76: 74 e0 ldi r23, 0x04 ; 4 - 1e78: 80 e1 ldi r24, 0x10 ; 16 - 1e7a: 91 e2 ldi r25, 0x21 ; 33 - 1e7c: 0e 94 16 24 call 0x482c ; 0x482c - 1e80: 89 2b or r24, r25 - 1e82: 09 f4 brne .+2 ; 0x1e86 - 1e84: 02 c1 rjmp .+516 ; 0x208a - 1e86: 69 ea ldi r22, 0xA9 ; 169 - 1e88: 74 e0 ldi r23, 0x04 ; 4 - 1e8a: 80 e1 ldi r24, 0x10 ; 16 - 1e8c: 91 e2 ldi r25, 0x21 ; 33 - 1e8e: 0e 94 16 24 call 0x482c ; 0x482c - 1e92: 89 2b or r24, r25 - 1e94: 09 f4 brne .+2 ; 0x1e98 - 1e96: f6 c0 rjmp .+492 ; 0x2084 - 1e98: 6f eb ldi r22, 0xBF ; 191 - 1e9a: 74 e0 ldi r23, 0x04 ; 4 - 1e9c: 80 e1 ldi r24, 0x10 ; 16 - 1e9e: 91 e2 ldi r25, 0x21 ; 33 - 1ea0: 0e 94 16 24 call 0x482c ; 0x482c - 1ea4: 89 2b or r24, r25 - 1ea6: 09 f4 brne .+2 ; 0x1eaa - 1ea8: ea c0 rjmp .+468 ; 0x207e - 1eaa: 65 ed ldi r22, 0xD5 ; 213 - 1eac: 74 e0 ldi r23, 0x04 ; 4 - 1eae: 80 e1 ldi r24, 0x10 ; 16 - 1eb0: 91 e2 ldi r25, 0x21 ; 33 - 1eb2: 0e 94 16 24 call 0x482c ; 0x482c - 1eb6: 89 2b or r24, r25 - 1eb8: 09 f4 brne .+2 ; 0x1ebc - 1eba: de c0 rjmp .+444 ; 0x2078 - 1ebc: 6b ee ldi r22, 0xEB ; 235 - 1ebe: 74 e0 ldi r23, 0x04 ; 4 - 1ec0: 80 e1 ldi r24, 0x10 ; 16 - 1ec2: 91 e2 ldi r25, 0x21 ; 33 - 1ec4: 0e 94 16 24 call 0x482c ; 0x482c - 1ec8: 89 2b or r24, r25 - 1eca: 09 f4 brne .+2 ; 0x1ece - 1ecc: d2 c0 rjmp .+420 ; 0x2072 - 1ece: 61 e0 ldi r22, 0x01 ; 1 - 1ed0: 75 e0 ldi r23, 0x05 ; 5 - 1ed2: 80 e1 ldi r24, 0x10 ; 16 - 1ed4: 91 e2 ldi r25, 0x21 ; 33 - 1ed6: 0e 94 16 24 call 0x482c ; 0x482c - 1eda: 89 2b or r24, r25 - 1edc: 09 f4 brne .+2 ; 0x1ee0 - 1ede: c6 c0 rjmp .+396 ; 0x206c - 1ee0: 67 e1 ldi r22, 0x17 ; 23 - 1ee2: 75 e0 ldi r23, 0x05 ; 5 - 1ee4: 80 e1 ldi r24, 0x10 ; 16 - 1ee6: 91 e2 ldi r25, 0x21 ; 33 - 1ee8: 0e 94 16 24 call 0x482c ; 0x482c - 1eec: 89 2b or r24, r25 - 1eee: 09 f4 brne .+2 ; 0x1ef2 - 1ef0: ba c0 rjmp .+372 ; 0x2066 - 1ef2: 6d e2 ldi r22, 0x2D ; 45 - 1ef4: 75 e0 ldi r23, 0x05 ; 5 - 1ef6: 80 e1 ldi r24, 0x10 ; 16 - 1ef8: 91 e2 ldi r25, 0x21 ; 33 - 1efa: 0e 94 16 24 call 0x482c ; 0x482c - 1efe: 89 2b or r24, r25 - 1f00: 09 f4 brne .+2 ; 0x1f04 - 1f02: ae c0 rjmp .+348 ; 0x2060 - 1f04: 63 e4 ldi r22, 0x43 ; 67 - 1f06: 75 e0 ldi r23, 0x05 ; 5 - 1f08: 80 e1 ldi r24, 0x10 ; 16 - 1f0a: 91 e2 ldi r25, 0x21 ; 33 - 1f0c: 0e 94 16 24 call 0x482c ; 0x482c - 1f10: 89 2b or r24, r25 - 1f12: 09 f4 brne .+2 ; 0x1f16 - 1f14: a2 c0 rjmp .+324 ; 0x205a - 1f16: 69 e5 ldi r22, 0x59 ; 89 - 1f18: 75 e0 ldi r23, 0x05 ; 5 - 1f1a: 80 e1 ldi r24, 0x10 ; 16 - 1f1c: 91 e2 ldi r25, 0x21 ; 33 - 1f1e: 0e 94 16 24 call 0x482c ; 0x482c - 1f22: 89 2b or r24, r25 - 1f24: 09 f4 brne .+2 ; 0x1f28 - 1f26: 96 c0 rjmp .+300 ; 0x2054 - 1f28: 6f e6 ldi r22, 0x6F ; 111 - 1f2a: 75 e0 ldi r23, 0x05 ; 5 - 1f2c: 80 e1 ldi r24, 0x10 ; 16 - 1f2e: 91 e2 ldi r25, 0x21 ; 33 - 1f30: 0e 94 16 24 call 0x482c ; 0x482c - 1f34: 89 2b or r24, r25 - 1f36: 09 f4 brne .+2 ; 0x1f3a - 1f38: 8a c0 rjmp .+276 ; 0x204e - 1f3a: 65 e8 ldi r22, 0x85 ; 133 - 1f3c: 75 e0 ldi r23, 0x05 ; 5 - 1f3e: 80 e1 ldi r24, 0x10 ; 16 - 1f40: 91 e2 ldi r25, 0x21 ; 33 - 1f42: 0e 94 16 24 call 0x482c ; 0x482c - 1f46: 89 2b or r24, r25 - 1f48: 09 f4 brne .+2 ; 0x1f4c - 1f4a: 52 c0 rjmp .+164 ; 0x1ff0 + 21be: 6b e7 ldi r22, 0x7B ; 123 + 21c0: 74 e0 ldi r23, 0x04 ; 4 + 21c2: 80 e1 ldi r24, 0x10 ; 16 + 21c4: 95 e2 ldi r25, 0x25 ; 37 + 21c6: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 21ca: 89 2b or r24, r25 + 21cc: 09 f4 brne .+2 ; 0x21d0 + 21ce: 32 c1 rjmp .+612 ; 0x2434 + 21d0: 61 e9 ldi r22, 0x91 ; 145 + 21d2: 74 e0 ldi r23, 0x04 ; 4 + 21d4: 80 e1 ldi r24, 0x10 ; 16 + 21d6: 95 e2 ldi r25, 0x25 ; 37 + 21d8: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 21dc: 89 2b or r24, r25 + 21de: 09 f4 brne .+2 ; 0x21e2 + 21e0: 26 c1 rjmp .+588 ; 0x242e + 21e2: 67 ea ldi r22, 0xA7 ; 167 + 21e4: 74 e0 ldi r23, 0x04 ; 4 + 21e6: 80 e1 ldi r24, 0x10 ; 16 + 21e8: 95 e2 ldi r25, 0x25 ; 37 + 21ea: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 21ee: 89 2b or r24, r25 + 21f0: 09 f4 brne .+2 ; 0x21f4 + 21f2: 1a c1 rjmp .+564 ; 0x2428 + 21f4: 6d eb ldi r22, 0xBD ; 189 + 21f6: 74 e0 ldi r23, 0x04 ; 4 + 21f8: 80 e1 ldi r24, 0x10 ; 16 + 21fa: 95 e2 ldi r25, 0x25 ; 37 + 21fc: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 2200: 89 2b or r24, r25 + 2202: 09 f4 brne .+2 ; 0x2206 + 2204: 0e c1 rjmp .+540 ; 0x2422 + 2206: 63 ed ldi r22, 0xD3 ; 211 + 2208: 74 e0 ldi r23, 0x04 ; 4 + 220a: 80 e1 ldi r24, 0x10 ; 16 + 220c: 95 e2 ldi r25, 0x25 ; 37 + 220e: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 2212: 89 2b or r24, r25 + 2214: 09 f4 brne .+2 ; 0x2218 + 2216: 02 c1 rjmp .+516 ; 0x241c + 2218: 69 ee ldi r22, 0xE9 ; 233 + 221a: 74 e0 ldi r23, 0x04 ; 4 + 221c: 80 e1 ldi r24, 0x10 ; 16 + 221e: 95 e2 ldi r25, 0x25 ; 37 + 2220: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 2224: 89 2b or r24, r25 + 2226: 09 f4 brne .+2 ; 0x222a + 2228: f6 c0 rjmp .+492 ; 0x2416 + 222a: 6f ef ldi r22, 0xFF ; 255 + 222c: 74 e0 ldi r23, 0x04 ; 4 + 222e: 80 e1 ldi r24, 0x10 ; 16 + 2230: 95 e2 ldi r25, 0x25 ; 37 + 2232: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 2236: 89 2b or r24, r25 + 2238: 09 f4 brne .+2 ; 0x223c + 223a: ea c0 rjmp .+468 ; 0x2410 + 223c: 65 e1 ldi r22, 0x15 ; 21 + 223e: 75 e0 ldi r23, 0x05 ; 5 + 2240: 80 e1 ldi r24, 0x10 ; 16 + 2242: 95 e2 ldi r25, 0x25 ; 37 + 2244: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 2248: 89 2b or r24, r25 + 224a: 09 f4 brne .+2 ; 0x224e + 224c: de c0 rjmp .+444 ; 0x240a + 224e: 6b e2 ldi r22, 0x2B ; 43 + 2250: 75 e0 ldi r23, 0x05 ; 5 + 2252: 80 e1 ldi r24, 0x10 ; 16 + 2254: 95 e2 ldi r25, 0x25 ; 37 + 2256: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 225a: 89 2b or r24, r25 + 225c: 09 f4 brne .+2 ; 0x2260 + 225e: d2 c0 rjmp .+420 ; 0x2404 + 2260: 61 e4 ldi r22, 0x41 ; 65 + 2262: 75 e0 ldi r23, 0x05 ; 5 + 2264: 80 e1 ldi r24, 0x10 ; 16 + 2266: 95 e2 ldi r25, 0x25 ; 37 + 2268: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 226c: 89 2b or r24, r25 + 226e: 09 f4 brne .+2 ; 0x2272 + 2270: c6 c0 rjmp .+396 ; 0x23fe + 2272: 67 e5 ldi r22, 0x57 ; 87 + 2274: 75 e0 ldi r23, 0x05 ; 5 + 2276: 80 e1 ldi r24, 0x10 ; 16 + 2278: 95 e2 ldi r25, 0x25 ; 37 + 227a: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 227e: 89 2b or r24, r25 + 2280: 09 f4 brne .+2 ; 0x2284 + 2282: ba c0 rjmp .+372 ; 0x23f8 + 2284: 6d e6 ldi r22, 0x6D ; 109 + 2286: 75 e0 ldi r23, 0x05 ; 5 + 2288: 80 e1 ldi r24, 0x10 ; 16 + 228a: 95 e2 ldi r25, 0x25 ; 37 + 228c: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 2290: 89 2b or r24, r25 + 2292: 09 f4 brne .+2 ; 0x2296 + 2294: ae c0 rjmp .+348 ; 0x23f2 + 2296: 63 e8 ldi r22, 0x83 ; 131 + 2298: 75 e0 ldi r23, 0x05 ; 5 + 229a: 80 e1 ldi r24, 0x10 ; 16 + 229c: 95 e2 ldi r25, 0x25 ; 37 + 229e: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 22a2: 89 2b or r24, r25 + 22a4: 09 f4 brne .+2 ; 0x22a8 + 22a6: a2 c0 rjmp .+324 ; 0x23ec + 22a8: 69 e9 ldi r22, 0x99 ; 153 + 22aa: 75 e0 ldi r23, 0x05 ; 5 + 22ac: 80 e1 ldi r24, 0x10 ; 16 + 22ae: 95 e2 ldi r25, 0x25 ; 37 + 22b0: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 22b4: 89 2b or r24, r25 + 22b6: 09 f4 brne .+2 ; 0x22ba + 22b8: 96 c0 rjmp .+300 ; 0x23e6 + 22ba: 6f ea ldi r22, 0xAF ; 175 + 22bc: 75 e0 ldi r23, 0x05 ; 5 + 22be: 80 e1 ldi r24, 0x10 ; 16 + 22c0: 95 e2 ldi r25, 0x25 ; 37 + 22c2: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 22c6: 89 2b or r24, r25 + 22c8: 09 f4 brne .+2 ; 0x22cc + 22ca: 8a c0 rjmp .+276 ; 0x23e0 + 22cc: 65 ec ldi r22, 0xC5 ; 197 + 22ce: 75 e0 ldi r23, 0x05 ; 5 + 22d0: 80 e1 ldi r24, 0x10 ; 16 + 22d2: 95 e2 ldi r25, 0x25 ; 37 + 22d4: 0e 94 df 25 call 0x4bbe ; 0x4bbe + 22d8: 89 2b or r24, r25 + 22da: 09 f4 brne .+2 ; 0x22de + 22dc: 52 c0 rjmp .+164 ; 0x2382 static void DecodeCommand(void) { uint8_t i; bool CommandFound = false; CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; - 1f4c: 88 ec ldi r24, 0xC8 ; 200 + 22de: 88 ec ldi r24, 0xC8 ; 200 } static void DecodeCommand(void) { uint8_t i; bool CommandFound = false; - 1f4e: c0 e0 ldi r28, 0x00 ; 0 + 22e0: c0 e0 ldi r28, 0x00 ; 0 static const char* GetStatusMessageP(CommandStatusIdType StatusId) { uint8_t i; for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { if (pgm_read_byte(&StatusTable[i].Id) == StatusId) - 1f50: e1 ea ldi r30, 0xA1 ; 161 - 1f52: f5 e0 ldi r31, 0x05 ; 5 - 1f54: e4 91 lpm r30, Z - 1f56: 8e 17 cp r24, r30 - 1f58: 09 f4 brne .+2 ; 0x1f5c - 1f5a: 30 c0 rjmp .+96 ; 0x1fbc - 1f5c: e2 ec ldi r30, 0xC2 ; 194 - 1f5e: f5 e0 ldi r31, 0x05 ; 5 - 1f60: e4 91 lpm r30, Z - 1f62: 8e 17 cp r24, r30 - 1f64: 09 f4 brne .+2 ; 0x1f68 - 1f66: 41 c0 rjmp .+130 ; 0x1fea - 1f68: e3 ee ldi r30, 0xE3 ; 227 - 1f6a: f5 e0 ldi r31, 0x05 ; 5 - 1f6c: e4 91 lpm r30, Z - 1f6e: 8e 17 cp r24, r30 - 1f70: 09 f4 brne .+2 ; 0x1f74 - 1f72: 38 c0 rjmp .+112 ; 0x1fe4 - 1f74: e4 e0 ldi r30, 0x04 ; 4 - 1f76: f6 e0 ldi r31, 0x06 ; 6 - 1f78: e4 91 lpm r30, Z - 1f7a: 8e 17 cp r24, r30 - 1f7c: 81 f1 breq .+96 ; 0x1fde - 1f7e: e5 e2 ldi r30, 0x25 ; 37 - 1f80: f6 e0 ldi r31, 0x06 ; 6 - 1f82: e4 91 lpm r30, Z - 1f84: 8e 17 cp r24, r30 - 1f86: 41 f1 breq .+80 ; 0x1fd8 - 1f88: e6 e4 ldi r30, 0x46 ; 70 - 1f8a: f6 e0 ldi r31, 0x06 ; 6 - 1f8c: e4 91 lpm r30, Z - 1f8e: 8e 17 cp r24, r30 - 1f90: 01 f1 breq .+64 ; 0x1fd2 + 22e2: e1 ee ldi r30, 0xE1 ; 225 + 22e4: f5 e0 ldi r31, 0x05 ; 5 + 22e6: e4 91 lpm r30, Z + 22e8: 8e 17 cp r24, r30 + 22ea: 09 f4 brne .+2 ; 0x22ee + 22ec: 30 c0 rjmp .+96 ; 0x234e + 22ee: e2 e0 ldi r30, 0x02 ; 2 + 22f0: f6 e0 ldi r31, 0x06 ; 6 + 22f2: e4 91 lpm r30, Z + 22f4: 8e 17 cp r24, r30 + 22f6: 09 f4 brne .+2 ; 0x22fa + 22f8: 41 c0 rjmp .+130 ; 0x237c + 22fa: e3 e2 ldi r30, 0x23 ; 35 + 22fc: f6 e0 ldi r31, 0x06 ; 6 + 22fe: e4 91 lpm r30, Z + 2300: 8e 17 cp r24, r30 + 2302: 09 f4 brne .+2 ; 0x2306 + 2304: 38 c0 rjmp .+112 ; 0x2376 + 2306: e4 e4 ldi r30, 0x44 ; 68 + 2308: f6 e0 ldi r31, 0x06 ; 6 + 230a: e4 91 lpm r30, Z + 230c: 8e 17 cp r24, r30 + 230e: 81 f1 breq .+96 ; 0x2370 + 2310: e5 e6 ldi r30, 0x65 ; 101 + 2312: f6 e0 ldi r31, 0x06 ; 6 + 2314: e4 91 lpm r30, Z + 2316: 8e 17 cp r24, r30 + 2318: 41 f1 breq .+80 ; 0x236a + 231a: e6 e8 ldi r30, 0x86 ; 134 + 231c: f6 e0 ldi r31, 0x06 ; 6 + 231e: e4 91 lpm r30, Z + 2320: 8e 17 cp r24, r30 + 2322: 01 f1 breq .+64 ; 0x2364 return StatusTable[i].Message; } return (void*) 0; - 1f92: 80 e0 ldi r24, 0x00 ; 0 - 1f94: 90 e0 ldi r25, 0x00 ; 0 + 2324: 80 e0 ldi r24, 0x00 ; 0 + 2326: 90 e0 ldi r25, 0x00 ; 0 } } } /* Send command status message */ TerminalSendStringP(GetStatusMessageP(StatusId)); - 1f96: e0 da rcall .-2624 ; 0x1558 + 2328: d8 da rcall .-2640 ; 0x18da TerminalSendStringP(PSTR(STATUS_MESSAGE_TRAILER)); - 1f98: 8b e9 ldi r24, 0x9B ; 155 - 1f9a: 95 e0 ldi r25, 0x05 ; 5 - 1f9c: dd da rcall .-2630 ; 0x1558 + 232a: 8b ed ldi r24, 0xDB ; 219 + 232c: 95 e0 ldi r25, 0x05 ; 5 + 232e: d5 da rcall .-2646 ; 0x18da if (CommandFound && (pTerminalBuffer[0] != '\0') ) { - 1f9e: cc 23 and r28, r28 - 1fa0: 09 f4 brne .+2 ; 0x1fa4 - 1fa2: fd ce rjmp .-518 ; 0x1d9e - 1fa4: 80 91 10 21 lds r24, 0x2110 - 1fa8: 88 23 and r24, r24 - 1faa: 09 f4 brne .+2 ; 0x1fae - 1fac: f8 ce rjmp .-528 ; 0x1d9e + 2330: cc 23 and r28, r28 + 2332: 09 f4 brne .+2 ; 0x2336 + 2334: fd ce rjmp .-518 ; 0x2130 + 2336: 80 91 10 25 lds r24, 0x2510 + 233a: 88 23 and r24, r24 + 233c: 09 f4 brne .+2 ; 0x2340 + 233e: f8 ce rjmp .-528 ; 0x2130 /* Send optional answer */ TerminalSendString(pTerminalBuffer); - 1fae: 80 e1 ldi r24, 0x10 ; 16 - 1fb0: 91 e2 ldi r25, 0x21 ; 33 - 1fb2: cd da rcall .-2662 ; 0x154e + 2340: 80 e1 ldi r24, 0x10 ; 16 + 2342: 95 e2 ldi r25, 0x25 ; 37 + 2344: c5 da rcall .-2678 ; 0x18d0 TerminalSendStringP(PSTR(OPTIONAL_ANSWER_TRAILER)); - 1fb4: 8e e9 ldi r24, 0x9E ; 158 - 1fb6: 95 e0 ldi r25, 0x05 ; 5 - 1fb8: cf da rcall .-2658 ; 0x1558 - 1fba: f1 ce rjmp .-542 ; 0x1d9e + 2346: 8e ed ldi r24, 0xDE ; 222 + 2348: 95 e0 ldi r25, 0x05 ; 5 + 234a: c7 da rcall .-2674 ; 0x18da + 234c: f1 ce rjmp .-542 ; 0x2130 static const char* GetStatusMessageP(CommandStatusIdType StatusId) { uint8_t i; for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { if (pgm_read_byte(&StatusTable[i].Id) == StatusId) - 1fbc: 20 e0 ldi r18, 0x00 ; 0 - 1fbe: 30 e0 ldi r19, 0x00 ; 0 + 234e: 20 e0 ldi r18, 0x00 ; 0 + 2350: 30 e0 ldi r19, 0x00 ; 0 return StatusTable[i].Message; - 1fc0: 41 e2 ldi r20, 0x21 ; 33 - 1fc2: 42 9f mul r20, r18 - 1fc4: c0 01 movw r24, r0 - 1fc6: 43 9f mul r20, r19 - 1fc8: 90 0d add r25, r0 - 1fca: 11 24 eor r1, r1 - 1fcc: 8e 55 subi r24, 0x5E ; 94 - 1fce: 9a 4f sbci r25, 0xFA ; 250 - 1fd0: e2 cf rjmp .-60 ; 0x1f96 + 2352: 41 e2 ldi r20, 0x21 ; 33 + 2354: 42 9f mul r20, r18 + 2356: c0 01 movw r24, r0 + 2358: 43 9f mul r20, r19 + 235a: 90 0d add r25, r0 + 235c: 11 24 eor r1, r1 + 235e: 8e 51 subi r24, 0x1E ; 30 + 2360: 9a 4f sbci r25, 0xFA ; 250 + 2362: e2 cf rjmp .-60 ; 0x2328 static const char* GetStatusMessageP(CommandStatusIdType StatusId) { uint8_t i; for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { if (pgm_read_byte(&StatusTable[i].Id) == StatusId) - 1fd2: 25 e0 ldi r18, 0x05 ; 5 - 1fd4: 30 e0 ldi r19, 0x00 ; 0 - 1fd6: f4 cf rjmp .-24 ; 0x1fc0 - 1fd8: 24 e0 ldi r18, 0x04 ; 4 - 1fda: 30 e0 ldi r19, 0x00 ; 0 - 1fdc: f1 cf rjmp .-30 ; 0x1fc0 - 1fde: 23 e0 ldi r18, 0x03 ; 3 - 1fe0: 30 e0 ldi r19, 0x00 ; 0 - 1fe2: ee cf rjmp .-36 ; 0x1fc0 - 1fe4: 22 e0 ldi r18, 0x02 ; 2 - 1fe6: 30 e0 ldi r19, 0x00 ; 0 - 1fe8: eb cf rjmp .-42 ; 0x1fc0 - 1fea: 21 e0 ldi r18, 0x01 ; 1 - 1fec: 30 e0 ldi r19, 0x00 ; 0 - 1fee: e8 cf rjmp .-48 ; 0x1fc0 + 2364: 25 e0 ldi r18, 0x05 ; 5 + 2366: 30 e0 ldi r19, 0x00 ; 0 + 2368: f4 cf rjmp .-24 ; 0x2352 + 236a: 24 e0 ldi r18, 0x04 ; 4 + 236c: 30 e0 ldi r19, 0x00 ; 0 + 236e: f1 cf rjmp .-30 ; 0x2352 + 2370: 23 e0 ldi r18, 0x03 ; 3 + 2372: 30 e0 ldi r19, 0x00 ; 0 + 2374: ee cf rjmp .-36 ; 0x2352 + 2376: 22 e0 ldi r18, 0x02 ; 2 + 2378: 30 e0 ldi r19, 0x00 ; 0 + 237a: eb cf rjmp .-42 ; 0x2352 + 237c: 21 e0 ldi r18, 0x01 ; 1 + 237e: 30 e0 ldi r19, 0x00 ; 0 + 2380: e8 cf rjmp .-48 ; 0x2352 CommandDelimiter = *pCommandDelimiter; *pCommandDelimiter = '\0'; /* Search in command table */ for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 1ff0: 2f e0 ldi r18, 0x0F ; 15 - 1ff2: 30 e0 ldi r19, 0x00 ; 0 + 2382: 2f e0 ldi r18, 0x0F ; 15 + 2384: 30 e0 ldi r19, 0x00 ; 0 /* Command found. Clear buffer, and call appropriate function */ char* pParam = ++pCommandDelimiter; pTerminalBuffer[0] = '\0'; - 1ff4: 10 92 10 21 sts 0x2110, r1 + 2386: 10 92 10 25 sts 0x2510, r1 CommandFound = true; StatusId = CallCommandFunc(&CommandTable[i], CommandDelimiter, pParam); - 1ff8: 46 e1 ldi r20, 0x16 ; 22 - 1ffa: 42 9f mul r20, r18 - 1ffc: c0 01 movw r24, r0 - 1ffe: 43 9f mul r20, r19 - 2000: 90 0d add r25, r0 - 2002: 11 24 eor r1, r1 - 2004: 85 5c subi r24, 0xC5 ; 197 - 2006: 9b 4f sbci r25, 0xFB ; 251 + 238a: 46 e1 ldi r20, 0x16 ; 22 + 238c: 42 9f mul r20, r18 + 238e: c0 01 movw r24, r0 + 2390: 43 9f mul r20, r19 + 2392: 90 0d add r25, r0 + 2394: 11 24 eor r1, r1 + 2396: 85 58 subi r24, 0x85 ; 133 + 2398: 9b 4f sbci r25, 0xFB ; 251 static CommandStatusIdType CallCommandFunc( const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { char* pTerminalBuffer = (char*) TerminalBuffer; /* Call appropriate function depending on CommandDelimiter */ if (CommandDelimiter == CHAR_GET_MODE) { - 2008: 1f 33 cpi r17, 0x3F ; 63 - 200a: f9 f0 breq .+62 ; 0x204a + 239a: 1f 33 cpi r17, 0x3F ; 63 + 239c: f9 f0 breq .+62 ; 0x23dc CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); if (GetFunc != NO_FUNCTION) { return GetFunc(pTerminalBuffer); } } else if (CommandDelimiter == CHAR_SET_MODE) { - 200c: 1d 33 cpi r17, 0x3D ; 61 - 200e: 89 f0 breq .+34 ; 0x2032 + 239e: 1d 33 cpi r17, 0x3D ; 61 + 23a0: 89 f0 breq .+34 ; 0x23c4 CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); if (SetFunc != NO_FUNCTION) { return SetFunc(pParam); } } else if (CommandDelimiter == CHAR_EXEC_MODE){ - 2010: 11 23 and r17, r17 - 2012: 19 f0 breq .+6 ; 0x201a + 23a2: 11 23 and r17, r17 + 23a4: 19 f0 breq .+6 ; 0x23ac } else { /* This should not happen (TM) */ } /* This delimiter has not been registered with this command */ return COMMAND_ERR_INVALID_USAGE_ID; - 2014: 89 ec ldi r24, 0xC9 ; 201 + 23a6: 89 ec ldi r24, 0xC9 ; 201 if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { /* Command found. Clear buffer, and call appropriate function */ char* pParam = ++pCommandDelimiter; pTerminalBuffer[0] = '\0'; CommandFound = true; - 2016: c1 e0 ldi r28, 0x01 ; 1 - 2018: 9b cf rjmp .-202 ; 0x1f50 + 23a8: c1 e0 ldi r28, 0x01 ; 1 + 23aa: 9b cf rjmp .-202 ; 0x22e2 CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); if (SetFunc != NO_FUNCTION) { return SetFunc(pParam); } } else if (CommandDelimiter == CHAR_EXEC_MODE){ CommandExecFuncType ExecFunc = pgm_read_ptr(&CommandEntry->ExecFunc); - 201a: 40 96 adiw r24, 0x10 ; 16 - 201c: fc 01 movw r30, r24 - 201e: 85 91 lpm r24, Z+ - 2020: 94 91 lpm r25, Z - 2022: fc 01 movw r30, r24 + 23ac: 40 96 adiw r24, 0x10 ; 16 + 23ae: fc 01 movw r30, r24 + 23b0: 85 91 lpm r24, Z+ + 23b2: 94 91 lpm r25, Z + 23b4: fc 01 movw r30, r24 if (ExecFunc != NO_FUNCTION) { - 2024: 00 97 sbiw r24, 0x00 ; 0 - 2026: b1 f3 breq .-20 ; 0x2014 + 23b6: 00 97 sbiw r24, 0x00 ; 0 + 23b8: b1 f3 breq .-20 ; 0x23a6 return ExecFunc(pTerminalBuffer); - 2028: 80 e1 ldi r24, 0x10 ; 16 - 202a: 91 e2 ldi r25, 0x21 ; 33 - 202c: 09 95 icall + 23ba: 80 e1 ldi r24, 0x10 ; 16 + 23bc: 95 e2 ldi r25, 0x25 ; 37 + 23be: 09 95 icall if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { /* Command found. Clear buffer, and call appropriate function */ char* pParam = ++pCommandDelimiter; pTerminalBuffer[0] = '\0'; CommandFound = true; - 202e: c1 e0 ldi r28, 0x01 ; 1 - 2030: 8f cf rjmp .-226 ; 0x1f50 + 23c0: c1 e0 ldi r28, 0x01 ; 1 + 23c2: 8f cf rjmp .-226 ; 0x22e2 CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); if (GetFunc != NO_FUNCTION) { return GetFunc(pTerminalBuffer); } } else if (CommandDelimiter == CHAR_SET_MODE) { CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); - 2032: 42 96 adiw r24, 0x12 ; 18 - 2034: fc 01 movw r30, r24 - 2036: 85 91 lpm r24, Z+ - 2038: 94 91 lpm r25, Z - 203a: fc 01 movw r30, r24 + 23c4: 42 96 adiw r24, 0x12 ; 18 + 23c6: fc 01 movw r30, r24 + 23c8: 85 91 lpm r24, Z+ + 23ca: 94 91 lpm r25, Z + 23cc: fc 01 movw r30, r24 if (SetFunc != NO_FUNCTION) { - 203c: 00 97 sbiw r24, 0x00 ; 0 - 203e: 51 f3 breq .-44 ; 0x2014 + 23ce: 00 97 sbiw r24, 0x00 ; 0 + 23d0: 51 f3 breq .-44 ; 0x23a6 return SetFunc(pParam); - 2040: ce 01 movw r24, r28 - 2042: 01 96 adiw r24, 0x01 ; 1 - 2044: 09 95 icall + 23d2: ce 01 movw r24, r28 + 23d4: 01 96 adiw r24, 0x01 ; 1 + 23d6: 09 95 icall if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { /* Command found. Clear buffer, and call appropriate function */ char* pParam = ++pCommandDelimiter; pTerminalBuffer[0] = '\0'; CommandFound = true; - 2046: c1 e0 ldi r28, 0x01 ; 1 - 2048: 83 cf rjmp .-250 ; 0x1f50 + 23d8: c1 e0 ldi r28, 0x01 ; 1 + 23da: 83 cf rjmp .-250 ; 0x22e2 const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { char* pTerminalBuffer = (char*) TerminalBuffer; /* Call appropriate function depending on CommandDelimiter */ if (CommandDelimiter == CHAR_GET_MODE) { CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); - 204a: 44 96 adiw r24, 0x14 ; 20 - 204c: e7 cf rjmp .-50 ; 0x201c + 23dc: 44 96 adiw r24, 0x14 ; 20 + 23de: e7 cf rjmp .-50 ; 0x23ae CommandDelimiter = *pCommandDelimiter; *pCommandDelimiter = '\0'; /* Search in command table */ for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 204e: 2e e0 ldi r18, 0x0E ; 14 - 2050: 30 e0 ldi r19, 0x00 ; 0 - 2052: d0 cf rjmp .-96 ; 0x1ff4 - 2054: 2d e0 ldi r18, 0x0D ; 13 - 2056: 30 e0 ldi r19, 0x00 ; 0 - 2058: cd cf rjmp .-102 ; 0x1ff4 - 205a: 2c e0 ldi r18, 0x0C ; 12 - 205c: 30 e0 ldi r19, 0x00 ; 0 - 205e: ca cf rjmp .-108 ; 0x1ff4 - 2060: 2b e0 ldi r18, 0x0B ; 11 - 2062: 30 e0 ldi r19, 0x00 ; 0 - 2064: c7 cf rjmp .-114 ; 0x1ff4 - 2066: 2a e0 ldi r18, 0x0A ; 10 - 2068: 30 e0 ldi r19, 0x00 ; 0 - 206a: c4 cf rjmp .-120 ; 0x1ff4 - 206c: 29 e0 ldi r18, 0x09 ; 9 - 206e: 30 e0 ldi r19, 0x00 ; 0 - 2070: c1 cf rjmp .-126 ; 0x1ff4 - 2072: 28 e0 ldi r18, 0x08 ; 8 - 2074: 30 e0 ldi r19, 0x00 ; 0 - 2076: be cf rjmp .-132 ; 0x1ff4 - 2078: 27 e0 ldi r18, 0x07 ; 7 - 207a: 30 e0 ldi r19, 0x00 ; 0 - 207c: bb cf rjmp .-138 ; 0x1ff4 - 207e: 26 e0 ldi r18, 0x06 ; 6 - 2080: 30 e0 ldi r19, 0x00 ; 0 - 2082: b8 cf rjmp .-144 ; 0x1ff4 - 2084: 25 e0 ldi r18, 0x05 ; 5 - 2086: 30 e0 ldi r19, 0x00 ; 0 - 2088: b5 cf rjmp .-150 ; 0x1ff4 - 208a: 24 e0 ldi r18, 0x04 ; 4 - 208c: 30 e0 ldi r19, 0x00 ; 0 - 208e: b2 cf rjmp .-156 ; 0x1ff4 - 2090: 23 e0 ldi r18, 0x03 ; 3 - 2092: 30 e0 ldi r19, 0x00 ; 0 - 2094: af cf rjmp .-162 ; 0x1ff4 - 2096: 22 e0 ldi r18, 0x02 ; 2 - 2098: 30 e0 ldi r19, 0x00 ; 0 - 209a: ac cf rjmp .-168 ; 0x1ff4 - 209c: 21 e0 ldi r18, 0x01 ; 1 - 209e: 30 e0 ldi r19, 0x00 ; 0 - 20a0: a9 cf rjmp .-174 ; 0x1ff4 - 20a2: 20 e0 ldi r18, 0x00 ; 0 - 20a4: 30 e0 ldi r19, 0x00 ; 0 - 20a6: a6 cf rjmp .-180 ; 0x1ff4 + 23e0: 2e e0 ldi r18, 0x0E ; 14 + 23e2: 30 e0 ldi r19, 0x00 ; 0 + 23e4: d0 cf rjmp .-96 ; 0x2386 + 23e6: 2d e0 ldi r18, 0x0D ; 13 + 23e8: 30 e0 ldi r19, 0x00 ; 0 + 23ea: cd cf rjmp .-102 ; 0x2386 + 23ec: 2c e0 ldi r18, 0x0C ; 12 + 23ee: 30 e0 ldi r19, 0x00 ; 0 + 23f0: ca cf rjmp .-108 ; 0x2386 + 23f2: 2b e0 ldi r18, 0x0B ; 11 + 23f4: 30 e0 ldi r19, 0x00 ; 0 + 23f6: c7 cf rjmp .-114 ; 0x2386 + 23f8: 2a e0 ldi r18, 0x0A ; 10 + 23fa: 30 e0 ldi r19, 0x00 ; 0 + 23fc: c4 cf rjmp .-120 ; 0x2386 + 23fe: 29 e0 ldi r18, 0x09 ; 9 + 2400: 30 e0 ldi r19, 0x00 ; 0 + 2402: c1 cf rjmp .-126 ; 0x2386 + 2404: 28 e0 ldi r18, 0x08 ; 8 + 2406: 30 e0 ldi r19, 0x00 ; 0 + 2408: be cf rjmp .-132 ; 0x2386 + 240a: 27 e0 ldi r18, 0x07 ; 7 + 240c: 30 e0 ldi r19, 0x00 ; 0 + 240e: bb cf rjmp .-138 ; 0x2386 + 2410: 26 e0 ldi r18, 0x06 ; 6 + 2412: 30 e0 ldi r19, 0x00 ; 0 + 2414: b8 cf rjmp .-144 ; 0x2386 + 2416: 25 e0 ldi r18, 0x05 ; 5 + 2418: 30 e0 ldi r19, 0x00 ; 0 + 241a: b5 cf rjmp .-150 ; 0x2386 + 241c: 24 e0 ldi r18, 0x04 ; 4 + 241e: 30 e0 ldi r19, 0x00 ; 0 + 2420: b2 cf rjmp .-156 ; 0x2386 + 2422: 23 e0 ldi r18, 0x03 ; 3 + 2424: 30 e0 ldi r19, 0x00 ; 0 + 2426: af cf rjmp .-162 ; 0x2386 + 2428: 22 e0 ldi r18, 0x02 ; 2 + 242a: 30 e0 ldi r19, 0x00 ; 0 + 242c: ac cf rjmp .-168 ; 0x2386 + 242e: 21 e0 ldi r18, 0x01 ; 1 + 2430: 30 e0 ldi r19, 0x00 ; 0 + 2432: a9 cf rjmp .-174 ; 0x2386 + 2434: 20 e0 ldi r18, 0x00 ; 0 + 2436: 30 e0 ldi r19, 0x00 ; 0 + 2438: a6 cf rjmp .-180 ; 0x2386 -000020a8 : +0000243a : return true; } void CommandLineTick(void) { - 20a8: 08 95 ret + 243a: 08 95 ret -000020aa : +0000243c : INLINE void CodecTask(void) { ActiveConfiguration.CodecTaskFunc(); } INLINE void CodecSetDemodPower(bool bOnOff) { CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; - 20aa: a0 e2 ldi r26, 0x20 ; 32 - 20ac: b6 e0 ldi r27, 0x06 ; 6 - 20ae: 82 e0 ldi r24, 0x02 ; 2 - 20b0: 11 96 adiw r26, 0x01 ; 1 - 20b2: 8c 93 st X, r24 - 20b4: 11 97 sbiw r26, 0x01 ; 1 + 243c: a0 e2 ldi r26, 0x20 ; 32 + 243e: b6 e0 ldi r27, 0x06 ; 6 + 2440: 82 e0 ldi r24, 0x02 ; 2 + 2442: 11 96 adiw r26, 0x01 ; 1 + 2444: 8c 93 st X, r24 + 2446: 11 97 sbiw r26, 0x01 ; 1 if (bOnOff) { CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; - 20b6: 15 96 adiw r26, 0x05 ; 5 - 20b8: 8c 93 st X, r24 - 20ba: 15 97 sbiw r26, 0x05 ; 5 + 2448: 15 96 adiw r26, 0x05 ; 5 + 244a: 8c 93 st X, r24 + 244c: 15 97 sbiw r26, 0x05 ; 5 static void StartDemod(void) { /* Activate Power for demodulator */ CodecSetDemodPower(true); /* Configure sampling-timer free running and sync to first modulation-pause. */ CODEC_TIMER_SAMPLING.CNT = 0; - 20bc: e0 e4 ldi r30, 0x40 ; 64 - 20be: f8 e0 ldi r31, 0x08 ; 8 - 20c0: 10 a2 std Z+32, r1 ; 0x20 - 20c2: 11 a2 std Z+33, r1 ; 0x21 + 244e: e0 e4 ldi r30, 0x40 ; 64 + 2450: f8 e0 ldi r31, 0x08 ; 8 + 2452: 10 a2 std Z+32, r1 ; 0x20 + 2454: 11 a2 std Z+33, r1 ; 0x21 CODEC_TIMER_SAMPLING.PER = SAMPLE_RATE_SYSTEM_CYCLES - 1; - 20c4: 8d e2 ldi r24, 0x2D ; 45 - 20c6: 91 e0 ldi r25, 0x01 ; 1 - 20c8: 86 a3 std Z+38, r24 ; 0x26 - 20ca: 97 a3 std Z+39, r25 ; 0x27 + 2456: 8d e2 ldi r24, 0x2D ; 45 + 2458: 91 e0 ldi r25, 0x01 ; 1 + 245a: 86 a3 std Z+38, r24 ; 0x26 + 245c: 97 a3 std Z+39, r25 ; 0x27 CODEC_TIMER_SAMPLING.CCA = 0xFFFF; /* CCA Interrupt is not active! */ - 20cc: 8f ef ldi r24, 0xFF ; 255 - 20ce: 9f ef ldi r25, 0xFF ; 255 - 20d0: 80 a7 std Z+40, r24 ; 0x28 - 20d2: 91 a7 std Z+41, r25 ; 0x29 + 245e: 8f ef ldi r24, 0xFF ; 255 + 2460: 9f ef ldi r25, 0xFF ; 255 + 2462: 80 a7 std Z+40, r24 ; 0x28 + 2464: 91 a7 std Z+41, r25 ; 0x29 CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_DIV1_gc; - 20d4: 81 e0 ldi r24, 0x01 ; 1 - 20d6: 80 83 st Z, r24 + 2466: 81 e0 ldi r24, 0x01 ; 1 + 2468: 80 83 st Z, r24 CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; - 20d8: 98 e8 ldi r25, 0x88 ; 136 - 20da: 93 83 std Z+3, r25 ; 0x03 + 246a: 98 e8 ldi r25, 0x88 ; 136 + 246c: 93 83 std Z+3, r25 ; 0x03 CODEC_TIMER_SAMPLING.INTCTRLB = TC_CCAINTLVL_HI_gc; - 20dc: 93 e0 ldi r25, 0x03 ; 3 - 20de: 97 83 std Z+7, r25 ; 0x07 + 246e: 93 e0 ldi r25, 0x03 ; 3 + 2470: 97 83 std Z+7, r25 ; 0x07 /* Start looking out for modulation pause via interrupt. */ CODEC_DEMOD_IN_PORT.INT0MASK = CODEC_DEMOD_IN_MASK0; - 20e0: 1a 96 adiw r26, 0x0a ; 10 - 20e2: 8c 93 st X, r24 - 20e4: 08 95 ret + 2472: 1a 96 adiw r26, 0x0a ; 10 + 2474: 8c 93 st X, r24 + 2476: 08 95 ret -000020e6 <__vector_34>: +00002478 <__vector_34>: } ISR(CODEC_DEMOD_IN_INT0_VECT) { - 20e6: 1f 92 push r1 - 20e8: 0f 92 push r0 - 20ea: 0f b6 in r0, 0x3f ; 63 - 20ec: 0f 92 push r0 - 20ee: 11 24 eor r1, r1 - 20f0: 8f 93 push r24 - 20f2: 9f 93 push r25 - 20f4: ef 93 push r30 - 20f6: ff 93 push r31 + 2478: 1f 92 push r1 + 247a: 0f 92 push r0 + 247c: 0f b6 in r0, 0x3f ; 63 + 247e: 0f 92 push r0 + 2480: 11 24 eor r1, r1 + 2482: 8f 93 push r24 + 2484: 9f 93 push r25 + 2486: ef 93 push r30 + 2488: ff 93 push r31 /* This is the first edge of the first modulation-pause after StartDemod. * Now we have time to prepare our timers and variables to start * demodulating beginning from one bit-width after this edge. */ CodecBufferPtr = CodecBuffer; - 20f8: 80 e1 ldi r24, 0x10 ; 16 - 20fa: 92 e2 ldi r25, 0x22 ; 34 - 20fc: 80 93 b1 20 sts 0x20B1, r24 - 2100: 90 93 b2 20 sts 0x20B2, r25 + 248a: 80 e1 ldi r24, 0x10 ; 16 + 248c: 96 e2 ldi r25, 0x26 ; 38 + 248e: 80 93 b1 24 sts 0x24B1, r24 + 2492: 90 93 b2 24 sts 0x24B2, r25 ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - 2104: 80 e9 ldi r24, 0x90 ; 144 - 2106: 92 e2 ldi r25, 0x22 ; 34 - 2108: 80 93 b3 20 sts 0x20B3, r24 - 210c: 90 93 b4 20 sts 0x20B4, r25 + 2496: 80 e9 ldi r24, 0x90 ; 144 + 2498: 96 e2 ldi r25, 0x26 ; 38 + 249a: 80 93 b3 24 sts 0x24B3, r24 + 249e: 90 93 b4 24 sts 0x24B4, r25 DataRegister = 0; - 2110: 10 92 aa 20 sts 0x20AA, r1 + 24a2: 10 92 aa 24 sts 0x24AA, r1 SampleRegister = 0; - 2114: 10 92 a9 20 sts 0x20A9, r1 + 24a6: 10 92 a9 24 sts 0x24A9, r1 SamplePosition = 0; - 2118: 10 92 a5 20 sts 0x20A5, r1 + 24aa: 10 92 a5 24 sts 0x24A5, r1 BitCount = 0; - 211c: 10 92 ad 20 sts 0x20AD, r1 - 2120: 10 92 ae 20 sts 0x20AE, r1 + 24ae: 10 92 ad 24 sts 0x24AD, r1 + 24b2: 10 92 ae 24 sts 0x24AE, r1 IsParityBit = false; - 2124: 10 92 a8 20 sts 0x20A8, r1 + 24b6: 10 92 a8 24 sts 0x24A8, r1 * XYZBUF mechanism of the xmega to automatically double the sampling rate on the * next overflow. For this we have to temporarily deactivate the automatical alignment * in order to catch next overflow event for updating the BUF registers. * We want to sample the demodulated data stream in the first quarter of the half-bit * where the pulsed miller encoded is located. */ CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_OFF_gc; - 2128: e0 e4 ldi r30, 0x40 ; 64 - 212a: f8 e0 ldi r31, 0x08 ; 8 - 212c: 13 82 std Z+3, r1 ; 0x03 + 24ba: e0 e4 ldi r30, 0x40 ; 64 + 24bc: f8 e0 ldi r31, 0x08 ; 8 + 24be: 13 82 std Z+3, r1 ; 0x03 CODEC_TIMER_SAMPLING.PERBUF = SAMPLE_RATE_SYSTEM_CYCLES/2 - 1; /* Half bit width */ - 212e: 86 e9 ldi r24, 0x96 ; 150 - 2130: 90 e0 ldi r25, 0x00 ; 0 - 2132: 86 ab std Z+54, r24 ; 0x36 - 2134: 97 ab std Z+55, r25 ; 0x37 + 24c0: 86 e9 ldi r24, 0x96 ; 150 + 24c2: 90 e0 ldi r25, 0x00 ; 0 + 24c4: 86 ab std Z+54, r24 ; 0x36 + 24c6: 97 ab std Z+55, r25 ; 0x37 CODEC_TIMER_SAMPLING.CCABUF = SAMPLE_RATE_SYSTEM_CYCLES/8 - 10 - 1; /* Compensate for DIGFILT and ISR prolog */ - 2136: 8a e1 ldi r24, 0x1A ; 26 - 2138: 90 e0 ldi r25, 0x00 ; 0 - 213a: 80 af std Z+56, r24 ; 0x38 - 213c: 91 af std Z+57, r25 ; 0x39 + 24c8: 8a e1 ldi r24, 0x1A ; 26 + 24ca: 90 e0 ldi r25, 0x00 ; 0 + 24cc: 80 af std Z+56, r24 ; 0x38 + 24ce: 91 af std Z+57, r25 ; 0x39 /* Setup Frame Delay Timer and wire to EVSYS. Frame delay time is * measured from last change in RF field, therefore we use * the event channel 1 (end of modulation pause) as the restart event. * The preliminary frame delay time chosen here is irrelevant, because * the correct FDT gets set automatically after demodulation. */ CODEC_TIMER_LOADMOD.CNT = 0; - 213e: e0 e4 ldi r30, 0x40 ; 64 - 2140: f9 e0 ldi r31, 0x09 ; 9 - 2142: 10 a2 std Z+32, r1 ; 0x20 - 2144: 11 a2 std Z+33, r1 ; 0x21 + 24d0: e0 e4 ldi r30, 0x40 ; 64 + 24d2: f9 e0 ldi r31, 0x09 ; 9 + 24d4: 10 a2 std Z+32, r1 ; 0x20 + 24d6: 11 a2 std Z+33, r1 ; 0x21 CODEC_TIMER_LOADMOD.PER = 0xFFFF; - 2146: 8f ef ldi r24, 0xFF ; 255 - 2148: 9f ef ldi r25, 0xFF ; 255 - 214a: 86 a3 std Z+38, r24 ; 0x26 - 214c: 97 a3 std Z+39, r25 ; 0x27 + 24d8: 8f ef ldi r24, 0xFF ; 255 + 24da: 9f ef ldi r25, 0xFF ; 255 + 24dc: 86 a3 std Z+38, r24 ; 0x26 + 24de: 97 a3 std Z+39, r25 ; 0x27 CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH1_gc; - 214e: 89 e8 ldi r24, 0x89 ; 137 - 2150: 83 83 std Z+3, r24 ; 0x03 + 24e0: 89 e8 ldi r24, 0x89 ; 137 + 24e2: 83 83 std Z+3, r24 ; 0x03 CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_EVCH6_gc; - 2152: 8e e0 ldi r24, 0x0E ; 14 - 2154: 80 83 st Z, r24 + 24e4: 8e e0 ldi r24, 0x0E ; 14 + 24e6: 80 83 st Z, r24 /* Disable this interrupt */ CODEC_DEMOD_IN_PORT.INT0MASK = 0; - 2156: e0 e2 ldi r30, 0x20 ; 32 - 2158: f6 e0 ldi r31, 0x06 ; 6 - 215a: 12 86 std Z+10, r1 ; 0x0a + 24e8: e0 e2 ldi r30, 0x20 ; 32 + 24ea: f6 e0 ldi r31, 0x06 ; 6 + 24ec: 12 86 std Z+10, r1 ; 0x0a } - 215c: ff 91 pop r31 - 215e: ef 91 pop r30 - 2160: 9f 91 pop r25 - 2162: 8f 91 pop r24 - 2164: 0f 90 pop r0 - 2166: 0f be out 0x3f, r0 ; 63 - 2168: 0f 90 pop r0 - 216a: 1f 90 pop r1 - 216c: 18 95 reti + 24ee: ff 91 pop r31 + 24f0: ef 91 pop r30 + 24f2: 9f 91 pop r25 + 24f4: 8f 91 pop r24 + 24f6: 0f 90 pop r0 + 24f8: 0f be out 0x3f, r0 ; 63 + 24fa: 0f 90 pop r0 + 24fc: 1f 90 pop r1 + 24fe: 18 95 reti -0000216e <__vector_22>: +00002500 <__vector_22>: ISR(CODEC_TIMER_SAMPLING_CCA_VECT) { - 216e: 1f 92 push r1 - 2170: 0f 92 push r0 - 2172: 0f b6 in r0, 0x3f ; 63 - 2174: 0f 92 push r0 - 2176: 11 24 eor r1, r1 - 2178: 2f 93 push r18 - 217a: 8f 93 push r24 - 217c: 9f 93 push r25 - 217e: ef 93 push r30 - 2180: ff 93 push r31 + 2500: 1f 92 push r1 + 2502: 0f 92 push r0 + 2504: 0f b6 in r0, 0x3f ; 63 + 2506: 0f 92 push r0 + 2508: 11 24 eor r1, r1 + 250a: 2f 93 push r18 + 250c: 8f 93 push r24 + 250e: 9f 93 push r25 + 2510: ef 93 push r30 + 2512: ff 93 push r31 /* This interrupt gets called twice for every bit to sample it. */ uint8_t SamplePin = CODEC_DEMOD_IN_PORT.IN & CODEC_DEMOD_IN_MASK; - 2182: 90 91 28 06 lds r25, 0x0628 + 2514: 90 91 28 06 lds r25, 0x0628 uint8_t NewSampleRegister; /* Shift sampled bit into sampling register and hold a local copy for fast access. */ NewSampleRegister = SampleRegister << 1; - 2186: 80 91 a9 20 lds r24, 0x20A9 + 2518: 80 91 a9 24 lds r24, 0x24A9 CODEC_DEMOD_IN_PORT.INT0MASK = 0; } ISR(CODEC_TIMER_SAMPLING_CCA_VECT) { /* This interrupt gets called twice for every bit to sample it. */ uint8_t SamplePin = CODEC_DEMOD_IN_PORT.IN & CODEC_DEMOD_IN_MASK; - 218a: 95 70 andi r25, 0x05 ; 5 + 251c: 95 70 andi r25, 0x05 ; 5 uint8_t NewSampleRegister; /* Shift sampled bit into sampling register and hold a local copy for fast access. */ NewSampleRegister = SampleRegister << 1; NewSampleRegister |= (!SamplePin ? 0x01 : 0x00); - 218c: 21 e0 ldi r18, 0x01 ; 1 - 218e: 09 f0 breq .+2 ; 0x2192 <__vector_22+0x24> - 2190: 20 e0 ldi r18, 0x00 ; 0 + 251e: 21 e0 ldi r18, 0x01 ; 1 + 2520: 09 f0 breq .+2 ; 0x2524 <__vector_22+0x24> + 2522: 20 e0 ldi r18, 0x00 ; 0 /* This interrupt gets called twice for every bit to sample it. */ uint8_t SamplePin = CODEC_DEMOD_IN_PORT.IN & CODEC_DEMOD_IN_MASK; uint8_t NewSampleRegister; /* Shift sampled bit into sampling register and hold a local copy for fast access. */ NewSampleRegister = SampleRegister << 1; - 2192: 88 0f add r24, r24 + 2524: 88 0f add r24, r24 NewSampleRegister |= (!SamplePin ? 0x01 : 0x00); - 2194: 82 2b or r24, r18 + 2526: 82 2b or r24, r18 SampleRegister = NewSampleRegister; - 2196: 80 93 a9 20 sts 0x20A9, r24 + 2528: 80 93 a9 24 sts 0x24A9, r24 if (SamplePosition) { - 219a: 90 91 a5 20 lds r25, 0x20A5 - 219e: 99 23 and r25, r25 - 21a0: a1 f1 breq .+104 ; 0x220a <__vector_22+0x9c> + 252c: 90 91 a5 24 lds r25, 0x24A5 + 2530: 99 23 and r25, r25 + 2532: a1 f1 breq .+104 ; 0x259c <__vector_22+0x9c> /* Analyze the sampling register after 2 samples. */ if ((NewSampleRegister & 0x07) == 0x07) { - 21a2: 98 2f mov r25, r24 - 21a4: 97 70 andi r25, 0x07 ; 7 - 21a6: 97 30 cpi r25, 0x07 ; 7 - 21a8: 09 f4 brne .+2 ; 0x21ac <__vector_22+0x3e> - 21aa: 42 c0 rjmp .+132 ; 0x2230 <__vector_22+0xc2> + 2534: 98 2f mov r25, r24 + 2536: 97 70 andi r25, 0x07 ; 7 + 2538: 97 30 cpi r25, 0x07 ; 7 + 253a: 09 f4 brne .+2 ; 0x253e <__vector_22+0x3e> + 253c: 42 c0 rjmp .+132 ; 0x25c2 <__vector_22+0xc2> /* Signal, that we have finished sampling */ Flags.DemodFinished = 1; } else { /* Otherwise, we check the two sample bits from the bit before. */ uint8_t BitSample = NewSampleRegister & 0xC; - 21ac: 98 2f mov r25, r24 - 21ae: 9c 70 andi r25, 0x0C ; 12 + 253e: 98 2f mov r25, r24 + 2540: 9c 70 andi r25, 0x0C ; 12 uint8_t Bit = 0; if (BitSample != (0x0 << 2)) { - 21b0: 61 f1 breq .+88 ; 0x220a <__vector_22+0x9c> + 2542: 61 f1 breq .+88 ; 0x259c <__vector_22+0x9c> /* We have a valid bit. decode and process it. */ if (BitSample & (0x1 << 2)) { - 21b2: 91 e0 ldi r25, 0x01 ; 1 - 21b4: 82 fd sbrc r24, 2 - 21b6: 6b c0 rjmp .+214 ; 0x228e <__vector_22+0x120> + 2544: 91 e0 ldi r25, 0x01 ; 1 + 2546: 82 fd sbrc r24, 2 + 2548: 6b c0 rjmp .+214 ; 0x2620 <__vector_22+0x120> } else { /* 10 sequence -> This is a one bit */ Bit = 1; } LastBit = Bit; - 21b8: 90 93 a7 20 sts 0x20A7, r25 + 254a: 90 93 a7 24 sts 0x24A7, r25 if (!IsParityBit) { - 21bc: 80 91 a8 20 lds r24, 0x20A8 - 21c0: 81 11 cpse r24, r1 - 21c2: 6d c0 rjmp .+218 ; 0x229e <__vector_22+0x130> + 254e: 80 91 a8 24 lds r24, 0x24A8 + 2552: 81 11 cpse r24, r1 + 2554: 6d c0 rjmp .+218 ; 0x2630 <__vector_22+0x130> /* This is a data bit, so shift it into the data register and * hold a local copy of it. */ uint8_t NewDataRegister = DataRegister >> 1; - 21c4: 80 91 aa 20 lds r24, 0x20AA - 21c8: 86 95 lsr r24 + 2556: 80 91 aa 24 lds r24, 0x24AA + 255a: 86 95 lsr r24 NewDataRegister |= (Bit ? 0x80 : 0x00); - 21ca: 99 23 and r25, r25 - 21cc: 09 f4 brne .+2 ; 0x21d0 <__vector_22+0x62> - 21ce: 71 c0 rjmp .+226 ; 0x22b2 <__vector_22+0x144> - 21d0: 20 e8 ldi r18, 0x80 ; 128 - 21d2: 28 2b or r18, r24 + 255c: 99 23 and r25, r25 + 255e: 09 f4 brne .+2 ; 0x2562 <__vector_22+0x62> + 2560: 71 c0 rjmp .+226 ; 0x2644 <__vector_22+0x144> + 2562: 20 e8 ldi r18, 0x80 ; 128 + 2564: 28 2b or r18, r24 DataRegister = NewDataRegister; - 21d4: 20 93 aa 20 sts 0x20AA, r18 + 2566: 20 93 aa 24 sts 0x24AA, r18 /* Update bitcount */ uint16_t NewBitCount = ++BitCount; - 21d8: 80 91 ad 20 lds r24, 0x20AD - 21dc: 90 91 ae 20 lds r25, 0x20AE - 21e0: 01 96 adiw r24, 0x01 ; 1 - 21e2: 80 93 ad 20 sts 0x20AD, r24 - 21e6: 90 93 ae 20 sts 0x20AE, r25 + 256a: 80 91 ad 24 lds r24, 0x24AD + 256e: 90 91 ae 24 lds r25, 0x24AE + 2572: 01 96 adiw r24, 0x01 ; 1 + 2574: 80 93 ad 24 sts 0x24AD, r24 + 2578: 90 93 ae 24 sts 0x24AE, r25 if ((NewBitCount & 0x07) == 0) { - 21ea: 87 70 andi r24, 0x07 ; 7 - 21ec: 99 27 eor r25, r25 - 21ee: 89 2b or r24, r25 - 21f0: 61 f4 brne .+24 ; 0x220a <__vector_22+0x9c> + 257c: 87 70 andi r24, 0x07 ; 7 + 257e: 99 27 eor r25, r25 + 2580: 89 2b or r24, r25 + 2582: 61 f4 brne .+24 ; 0x259c <__vector_22+0x9c> /* We have reached a byte boundary! Store the data register. */ /* TODO: Prevent buffer overflow */ *CodecBufferPtr++ = NewDataRegister; - 21f2: e0 91 b1 20 lds r30, 0x20B1 - 21f6: f0 91 b2 20 lds r31, 0x20B2 - 21fa: 21 93 st Z+, r18 - 21fc: e0 93 b1 20 sts 0x20B1, r30 - 2200: f0 93 b2 20 sts 0x20B2, r31 + 2584: e0 91 b1 24 lds r30, 0x24B1 + 2588: f0 91 b2 24 lds r31, 0x24B2 + 258c: 21 93 st Z+, r18 + 258e: e0 93 b1 24 sts 0x24B1, r30 + 2592: f0 93 b2 24 sts 0x24B2, r31 /* Store bit for determining FDT at EOC and enable parity * handling on next bit. */ IsParityBit = true; - 2204: 81 e0 ldi r24, 0x01 ; 1 - 2206: 80 93 a8 20 sts 0x20A8, r24 + 2596: 81 e0 ldi r24, 0x01 ; 1 + 2598: 80 93 a8 24 sts 0x24A8, r24 } } else { /* On odd sample position just sample. */ } SamplePosition = !SamplePosition; - 220a: 80 91 a5 20 lds r24, 0x20A5 - 220e: 91 e0 ldi r25, 0x01 ; 1 - 2210: 89 27 eor r24, r25 - 2212: 80 93 a5 20 sts 0x20A5, r24 + 259c: 80 91 a5 24 lds r24, 0x24A5 + 25a0: 91 e0 ldi r25, 0x01 ; 1 + 25a2: 89 27 eor r24, r25 + 25a4: 80 93 a5 24 sts 0x24A5, r24 /* Make sure the sampling timer gets automatically aligned to the * modulation pauses by using the RESTART event. * This can be understood as a "poor mans PLL" and makes sure that we are * never too far out the bit-grid while sampling. */ CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; - 2216: 88 e8 ldi r24, 0x88 ; 136 - 2218: 80 93 43 08 sts 0x0843, r24 + 25a8: 88 e8 ldi r24, 0x88 ; 136 + 25aa: 80 93 43 08 sts 0x0843, r24 } - 221c: ff 91 pop r31 - 221e: ef 91 pop r30 - 2220: 9f 91 pop r25 - 2222: 8f 91 pop r24 - 2224: 2f 91 pop r18 - 2226: 0f 90 pop r0 - 2228: 0f be out 0x3f, r0 ; 63 - 222a: 0f 90 pop r0 - 222c: 1f 90 pop r1 - 222e: 18 95 reti + 25ae: ff 91 pop r31 + 25b0: ef 91 pop r30 + 25b2: 9f 91 pop r25 + 25b4: 8f 91 pop r24 + 25b6: 2f 91 pop r18 + 25b8: 0f 90 pop r0 + 25ba: 0f be out 0x3f, r0 ; 63 + 25bc: 0f 90 pop r0 + 25be: 1f 90 pop r1 + 25c0: 18 95 reti if (SamplePosition) { /* Analyze the sampling register after 2 samples. */ if ((NewSampleRegister & 0x07) == 0x07) { /* No carrier modulation for 3 sample points. EOC! */ CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_OFF_gc; - 2230: 10 92 40 08 sts 0x0840, r1 + 25c2: 10 92 40 08 sts 0x0840, r1 CODEC_TIMER_SAMPLING.INTFLAGS = TC0_CCAIF_bm; - 2234: 80 e1 ldi r24, 0x10 ; 16 - 2236: 80 93 4c 08 sts 0x084C, r24 + 25c6: 80 e1 ldi r24, 0x10 ; 16 + 25c8: 80 93 4c 08 sts 0x084C, r24 /* By this time, the FDT timer is aligned to the last modulation * edge of the reader. So we disable the auto-synchronization and * let it count the frame delay time in the background, and generate * an interrupt once it has reached the FDT. */ CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_OFF_gc; - 223a: 10 92 43 09 sts 0x0943, r1 + 25cc: 10 92 43 09 sts 0x0943, r1 if (LastBit) { - 223e: 80 91 a7 20 lds r24, 0x20A7 - 2242: 88 23 and r24, r24 - 2244: 79 f1 breq .+94 ; 0x22a4 <__vector_22+0x136> + 25d0: 80 91 a7 24 lds r24, 0x24A7 + 25d4: 88 23 and r24, r24 + 25d6: 79 f1 breq .+94 ; 0x2636 <__vector_22+0x136> CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; - 2246: 8c eb ldi r24, 0xBC ; 188 - 2248: 94 e0 ldi r25, 0x04 ; 4 - 224a: 80 93 66 09 sts 0x0966, r24 - 224e: 90 93 67 09 sts 0x0967, r25 + 25d8: 8c eb ldi r24, 0xBC ; 188 + 25da: 94 e0 ldi r25, 0x04 ; 4 + 25dc: 80 93 66 09 sts 0x0966, r24 + 25e0: 90 93 67 09 sts 0x0967, r25 } else { CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; } LoadModState = LOADMOD_FDT; - 2252: 10 92 a6 20 sts 0x20A6, r1 + 25e4: 10 92 a6 24 sts 0x24A6, r1 CODEC_TIMER_LOADMOD.INTFLAGS = TC1_OVFIF_bm; - 2256: 81 e0 ldi r24, 0x01 ; 1 - 2258: 80 93 4c 09 sts 0x094C, r24 + 25e8: 81 e0 ldi r24, 0x01 ; 1 + 25ea: 80 93 4c 09 sts 0x094C, r24 CODEC_TIMER_LOADMOD.INTCTRLA = TC_OVFINTLVL_HI_gc; - 225c: 83 e0 ldi r24, 0x03 ; 3 - 225e: 80 93 46 09 sts 0x0946, r24 + 25ee: 83 e0 ldi r24, 0x03 ; 3 + 25f0: 80 93 46 09 sts 0x0946, r24 /* Determine if we did not receive a multiple of 8 bits. * If this is the case, right-align the remaining data and * store it into the buffer. */ uint8_t RemainingBits = BitCount % 8; - 2262: 80 91 ad 20 lds r24, 0x20AD - 2266: 90 91 ae 20 lds r25, 0x20AE - 226a: 87 70 andi r24, 0x07 ; 7 + 25f4: 80 91 ad 24 lds r24, 0x24AD + 25f8: 90 91 ae 24 lds r25, 0x24AE + 25fc: 87 70 andi r24, 0x07 ; 7 if (RemainingBits != 0) { - 226c: 61 f0 breq .+24 ; 0x2286 <__vector_22+0x118> + 25fe: 61 f0 breq .+24 ; 0x2618 <__vector_22+0x118> uint8_t NewDataRegister = DataRegister; - 226e: 90 91 aa 20 lds r25, 0x20AA + 2600: 90 91 aa 24 lds r25, 0x24AA while (RemainingBits++ < 8) { - 2272: 8f 5f subi r24, 0xFF ; 255 + 2604: 8f 5f subi r24, 0xFF ; 255 /* Pad with zeroes to right-align. */ NewDataRegister >>= 1; - 2274: 96 95 lsr r25 + 2606: 96 95 lsr r25 * store it into the buffer. */ uint8_t RemainingBits = BitCount % 8; if (RemainingBits != 0) { uint8_t NewDataRegister = DataRegister; while (RemainingBits++ < 8) { - 2276: 8f 5f subi r24, 0xFF ; 255 - 2278: 89 30 cpi r24, 0x09 ; 9 - 227a: e1 f7 brne .-8 ; 0x2274 <__vector_22+0x106> + 2608: 8f 5f subi r24, 0xFF ; 255 + 260a: 89 30 cpi r24, 0x09 ; 9 + 260c: e1 f7 brne .-8 ; 0x2606 <__vector_22+0x106> /* Pad with zeroes to right-align. */ NewDataRegister >>= 1; } /* TODO: Prevent buffer overflow */ *CodecBufferPtr = NewDataRegister; - 227c: e0 91 b1 20 lds r30, 0x20B1 - 2280: f0 91 b2 20 lds r31, 0x20B2 - 2284: 90 83 st Z, r25 + 260e: e0 91 b1 24 lds r30, 0x24B1 + 2612: f0 91 b2 24 lds r31, 0x24B2 + 2616: 90 83 st Z, r25 } /* Signal, that we have finished sampling */ Flags.DemodFinished = 1; - 2286: 81 e0 ldi r24, 0x01 ; 1 - 2288: 80 93 af 20 sts 0x20AF, r24 - 228c: be cf rjmp .-132 ; 0x220a <__vector_22+0x9c> + 2618: 81 e0 ldi r24, 0x01 ; 1 + 261a: 80 93 af 24 sts 0x24AF, r24 + 261e: be cf rjmp .-132 ; 0x259c <__vector_22+0x9c> uint8_t BitSample = NewSampleRegister & 0xC; uint8_t Bit = 0; if (BitSample != (0x0 << 2)) { /* We have a valid bit. decode and process it. */ if (BitSample & (0x1 << 2)) { - 228e: 90 e0 ldi r25, 0x00 ; 0 + 2620: 90 e0 ldi r25, 0x00 ; 0 } else { /* 10 sequence -> This is a one bit */ Bit = 1; } LastBit = Bit; - 2290: 90 93 a7 20 sts 0x20A7, r25 + 2622: 90 93 a7 24 sts 0x24A7, r25 if (!IsParityBit) { - 2294: 80 91 a8 20 lds r24, 0x20A8 - 2298: 88 23 and r24, r24 - 229a: 09 f4 brne .+2 ; 0x229e <__vector_22+0x130> - 229c: 93 cf rjmp .-218 ; 0x21c4 <__vector_22+0x56> + 2626: 80 91 a8 24 lds r24, 0x24A8 + 262a: 88 23 and r24, r24 + 262c: 09 f4 brne .+2 ; 0x2630 <__vector_22+0x130> + 262e: 93 cf rjmp .-218 ; 0x2556 <__vector_22+0x56> } else { /* This is a parity bit. Store it */ /* TODO: Store parity and prevent overflow */ //*ParityBufferPtr++ = Bit; IsParityBit = false; - 229e: 10 92 a8 20 sts 0x20A8, r1 - 22a2: b3 cf rjmp .-154 ; 0x220a <__vector_22+0x9c> + 2630: 10 92 a8 24 sts 0x24A8, r1 + 2634: b3 cf rjmp .-154 ; 0x259c <__vector_22+0x9c> CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_OFF_gc; if (LastBit) { CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; } else { CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; - 22a4: 8c e7 ldi r24, 0x7C ; 124 - 22a6: 94 e0 ldi r25, 0x04 ; 4 - 22a8: 80 93 66 09 sts 0x0966, r24 - 22ac: 90 93 67 09 sts 0x0967, r25 - 22b0: d0 cf rjmp .-96 ; 0x2252 <__vector_22+0xe4> + 2636: 8c e7 ldi r24, 0x7C ; 124 + 2638: 94 e0 ldi r25, 0x04 ; 4 + 263a: 80 93 66 09 sts 0x0966, r24 + 263e: 90 93 67 09 sts 0x0967, r25 + 2642: d0 cf rjmp .-96 ; 0x25e4 <__vector_22+0xe4> if (!IsParityBit) { /* This is a data bit, so shift it into the data register and * hold a local copy of it. */ uint8_t NewDataRegister = DataRegister >> 1; NewDataRegister |= (Bit ? 0x80 : 0x00); - 22b2: 20 e0 ldi r18, 0x00 ; 0 - 22b4: 8e cf rjmp .-228 ; 0x21d2 <__vector_22+0x64> + 2644: 20 e0 ldi r18, 0x00 ; 0 + 2646: 8e cf rjmp .-228 ; 0x2564 <__vector_22+0x64> -000022b6 <__vector_83>: +00002648 <__vector_83>: * This can be understood as a "poor mans PLL" and makes sure that we are * never too far out the bit-grid while sampling. */ CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; } ISR(CODEC_TIMER_OVF_VECT) { - 22b6: 1f 92 push r1 - 22b8: 0f 92 push r0 - 22ba: 0f b6 in r0, 0x3f ; 63 - 22bc: 0f 92 push r0 - 22be: 11 24 eor r1, r1 - 22c0: 2f 93 push r18 - 22c2: 3f 93 push r19 - 22c4: 8f 93 push r24 - 22c6: 9f 93 push r25 - 22c8: ef 93 push r30 - 22ca: ff 93 push r31 + 2648: 1f 92 push r1 + 264a: 0f 92 push r0 + 264c: 0f b6 in r0, 0x3f ; 63 + 264e: 0f 92 push r0 + 2650: 11 24 eor r1, r1 + 2652: 2f 93 push r18 + 2654: 3f 93 push r19 + 2656: 8f 93 push r24 + 2658: 9f 93 push r25 + 265a: ef 93 push r30 + 265c: ff 93 push r31 /* Bit rate timer. Output a half bit on the output. */ uint8_t Temp8; uint16_t Temp16; switch (LoadModState) { - 22cc: 80 91 a6 20 lds r24, 0x20A6 - 22d0: 85 30 cpi r24, 0x05 ; 5 - 22d2: 09 f4 brne .+2 ; 0x22d6 <__vector_83+0x20> - 22d4: 4d c0 rjmp .+154 ; 0x2370 <__vector_83+0xba> - 22d6: a8 f0 brcs .+42 ; 0x2302 <__vector_83+0x4c> - 22d8: 88 30 cpi r24, 0x08 ; 8 - 22da: 09 f4 brne .+2 ; 0x22de <__vector_83+0x28> - 22dc: 7c c0 rjmp .+248 ; 0x23d6 <__vector_83+0x120> - 22de: 20 f5 brcc .+72 ; 0x2328 <__vector_83+0x72> - 22e0: 86 30 cpi r24, 0x06 ; 6 - 22e2: 09 f4 brne .+2 ; 0x22e6 <__vector_83+0x30> - 22e4: b8 c0 rjmp .+368 ; 0x2456 <__vector_83+0x1a0> - 22e6: 87 30 cpi r24, 0x07 ; 7 - 22e8: 09 f4 brne .+2 ; 0x22ec <__vector_83+0x36> - 22ea: 8a c0 rjmp .+276 ; 0x2400 <__vector_83+0x14a> + 265e: 80 91 a6 24 lds r24, 0x24A6 + 2662: 85 30 cpi r24, 0x05 ; 5 + 2664: 09 f4 brne .+2 ; 0x2668 <__vector_83+0x20> + 2666: 4d c0 rjmp .+154 ; 0x2702 <__vector_83+0xba> + 2668: a8 f0 brcs .+42 ; 0x2694 <__vector_83+0x4c> + 266a: 88 30 cpi r24, 0x08 ; 8 + 266c: 09 f4 brne .+2 ; 0x2670 <__vector_83+0x28> + 266e: 7c c0 rjmp .+248 ; 0x2768 <__vector_83+0x120> + 2670: 20 f5 brcc .+72 ; 0x26ba <__vector_83+0x72> + 2672: 86 30 cpi r24, 0x06 ; 6 + 2674: 09 f4 brne .+2 ; 0x2678 <__vector_83+0x30> + 2676: b8 c0 rjmp .+368 ; 0x27e8 <__vector_83+0x1a0> + 2678: 87 30 cpi r24, 0x07 ; 7 + 267a: 09 f4 brne .+2 ; 0x267e <__vector_83+0x36> + 267c: 8a c0 rjmp .+276 ; 0x2792 <__vector_83+0x14a> break; default: break; } } - 22ec: ff 91 pop r31 - 22ee: ef 91 pop r30 - 22f0: 9f 91 pop r25 - 22f2: 8f 91 pop r24 - 22f4: 3f 91 pop r19 - 22f6: 2f 91 pop r18 - 22f8: 0f 90 pop r0 - 22fa: 0f be out 0x3f, r0 ; 63 - 22fc: 0f 90 pop r0 - 22fe: 1f 90 pop r1 - 2300: 18 95 reti + 267e: ff 91 pop r31 + 2680: ef 91 pop r30 + 2682: 9f 91 pop r25 + 2684: 8f 91 pop r24 + 2686: 3f 91 pop r19 + 2688: 2f 91 pop r18 + 268a: 0f 90 pop r0 + 268c: 0f be out 0x3f, r0 ; 63 + 268e: 0f 90 pop r0 + 2690: 1f 90 pop r1 + 2692: 18 95 reti ISR(CODEC_TIMER_OVF_VECT) { /* Bit rate timer. Output a half bit on the output. */ uint8_t Temp8; uint16_t Temp16; switch (LoadModState) { - 2302: 82 30 cpi r24, 0x02 ; 2 - 2304: 71 f1 breq .+92 ; 0x2362 <__vector_83+0xac> - 2306: f8 f0 brcs .+62 ; 0x2346 <__vector_83+0x90> - 2308: 83 30 cpi r24, 0x03 ; 3 - 230a: 09 f4 brne .+2 ; 0x230e <__vector_83+0x58> - 230c: 56 c0 rjmp .+172 ; 0x23ba <__vector_83+0x104> - 230e: 84 30 cpi r24, 0x04 ; 4 - 2310: 69 f7 brne .-38 ; 0x22ec <__vector_83+0x36> + 2694: 82 30 cpi r24, 0x02 ; 2 + 2696: 71 f1 breq .+92 ; 0x26f4 <__vector_83+0xac> + 2698: f8 f0 brcs .+62 ; 0x26d8 <__vector_83+0x90> + 269a: 83 30 cpi r24, 0x03 ; 3 + 269c: 09 f4 brne .+2 ; 0x26a0 <__vector_83+0x58> + 269e: 56 c0 rjmp .+172 ; 0x274c <__vector_83+0x104> + 26a0: 84 30 cpi r24, 0x04 ; 4 + 26a2: 69 f7 brne .-38 ; 0x267e <__vector_83+0x36> /* Fetch first byte */ DataRegister = *CodecBufferPtr; break; case LOADMOD_DATA0: if (DataRegister & 1) { - 2312: 80 91 aa 20 lds r24, 0x20AA - 2316: 80 fd sbrc r24, 0 - 2318: b7 c0 rjmp .+366 ; 0x2488 <__vector_83+0x1d2> + 26a4: 80 91 aa 24 lds r24, 0x24AA + 26a8: 80 fd sbrc r24, 0 + 26aa: b7 c0 rjmp .+366 ; 0x281a <__vector_83+0x1d2> CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; } else { CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 231a: 80 e4 ldi r24, 0x40 ; 64 - 231c: 80 93 46 06 sts 0x0646, r24 + 26ac: 80 e4 ldi r24, 0x40 ; 64 + 26ae: 80 93 46 06 sts 0x0646, r24 } LoadModState = LOADMOD_DATA1; - 2320: 85 e0 ldi r24, 0x05 ; 5 - 2322: 80 93 a6 20 sts 0x20A6, r24 + 26b2: 85 e0 ldi r24, 0x05 ; 5 + 26b4: 80 93 a6 24 sts 0x24A6, r24 break; - 2326: e2 cf rjmp .-60 ; 0x22ec <__vector_83+0x36> + 26b8: e2 cf rjmp .-60 ; 0x267e <__vector_83+0x36> ISR(CODEC_TIMER_OVF_VECT) { /* Bit rate timer. Output a half bit on the output. */ uint8_t Temp8; uint16_t Temp16; switch (LoadModState) { - 2328: 89 30 cpi r24, 0x09 ; 9 - 232a: 09 f4 brne .+2 ; 0x232e <__vector_83+0x78> - 232c: 5b c0 rjmp .+182 ; 0x23e4 <__vector_83+0x12e> - 232e: 8a 30 cpi r24, 0x0A ; 10 - 2330: e9 f6 brne .-70 ; 0x22ec <__vector_83+0x36> + 26ba: 89 30 cpi r24, 0x09 ; 9 + 26bc: 09 f4 brne .+2 ; 0x26c0 <__vector_83+0x78> + 26be: 5b c0 rjmp .+182 ; 0x2776 <__vector_83+0x12e> + 26c0: 8a 30 cpi r24, 0x0A ; 10 + 26c2: e9 f6 brne .-70 ; 0x267e <__vector_83+0x36> case LOADMOD_FINISHED: /* We have written all of our bits. Deactivate the loadmod * timer. Also disable the bit-rate interrupt again. And * stop the subcarrier divider. */ CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_OFF_gc; - 2332: 10 92 40 09 sts 0x0940, r1 + 26c4: 10 92 40 09 sts 0x0940, r1 CODEC_TIMER_LOADMOD.INTCTRLA = 0; - 2336: 10 92 46 09 sts 0x0946, r1 + 26c8: 10 92 46 09 sts 0x0946, r1 CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_OFF_gc; - 233a: 10 92 00 08 sts 0x0800, r1 + 26cc: 10 92 00 08 sts 0x0800, r1 /* Signal application that we have finished loadmod */ Flags.LoadmodFinished = 1; - 233e: 81 e0 ldi r24, 0x01 ; 1 - 2340: 80 93 b0 20 sts 0x20B0, r24 + 26d0: 81 e0 ldi r24, 0x01 ; 1 + 26d2: 80 93 b0 24 sts 0x24B0, r24 break; - 2344: d3 cf rjmp .-90 ; 0x22ec <__vector_83+0x36> + 26d6: d3 cf rjmp .-90 ; 0x267e <__vector_83+0x36> ISR(CODEC_TIMER_OVF_VECT) { /* Bit rate timer. Output a half bit on the output. */ uint8_t Temp8; uint16_t Temp16; switch (LoadModState) { - 2346: 88 23 and r24, r24 - 2348: 09 f4 brne .+2 ; 0x234c <__vector_83+0x96> - 234a: 53 c0 rjmp .+166 ; 0x23f2 <__vector_83+0x13c> - 234c: 81 30 cpi r24, 0x01 ; 1 - 234e: 71 f6 brne .-100 ; 0x22ec <__vector_83+0x36> + 26d8: 88 23 and r24, r24 + 26da: 09 f4 brne .+2 ; 0x26de <__vector_83+0x96> + 26dc: 53 c0 rjmp .+166 ; 0x2784 <__vector_83+0x13c> + 26de: 81 30 cpi r24, 0x01 ; 1 + 26e0: 71 f6 brne .-100 ; 0x267e <__vector_83+0x36> break; case LOADMOD_START: /* Application produced data. With this interrupt we are aligned to the bit-grid. * Start subcarrier generation and align to bitrate. */ CODEC_TIMER_LOADMOD.PER = ISO14443A_BIT_RATE_CYCLES / 2 - 1; - 2350: 8f e3 ldi r24, 0x3F ; 63 - 2352: 90 e0 ldi r25, 0x00 ; 0 - 2354: 80 93 66 09 sts 0x0966, r24 - 2358: 90 93 67 09 sts 0x0967, r25 + 26e2: 8f e3 ldi r24, 0x3F ; 63 + 26e4: 90 e0 ldi r25, 0x00 ; 0 + 26e6: 80 93 66 09 sts 0x0966, r24 + 26ea: 90 93 67 09 sts 0x0967, r25 CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_EVCH6_gc; - 235c: 8e e0 ldi r24, 0x0E ; 14 - 235e: 80 93 00 08 sts 0x0800, r24 + 26ee: 8e e0 ldi r24, 0x0E ; 14 + 26f0: 80 93 00 08 sts 0x0800, r24 /* Fallthrough to first bit */ case LOADMOD_START_BIT0: CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2362: 80 e4 ldi r24, 0x40 ; 64 - 2364: 80 93 45 06 sts 0x0645, r24 + 26f4: 80 e4 ldi r24, 0x40 ; 64 + 26f6: 80 93 45 06 sts 0x0645, r24 LoadModState = LOADMOD_START_BIT1; - 2368: 83 e0 ldi r24, 0x03 ; 3 - 236a: 80 93 a6 20 sts 0x20A6, r24 + 26fa: 83 e0 ldi r24, 0x03 ; 3 + 26fc: 80 93 a6 24 sts 0x24A6, r24 break; - 236e: be cf rjmp .-132 ; 0x22ec <__vector_83+0x36> + 2700: be cf rjmp .-132 ; 0x267e <__vector_83+0x36> LoadModState = LOADMOD_DATA1; break; case LOADMOD_DATA1: Temp8 = DataRegister; - 2370: 80 91 aa 20 lds r24, 0x20AA + 2702: 80 91 aa 24 lds r24, 0x24AA if (Temp8 & 1) { CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2374: 90 e4 ldi r25, 0x40 ; 64 + 2706: 90 e4 ldi r25, 0x40 ; 64 break; case LOADMOD_DATA1: Temp8 = DataRegister; if (Temp8 & 1) { - 2376: 80 fd sbrc r24, 0 - 2378: 84 c0 rjmp .+264 ; 0x2482 <__vector_83+0x1cc> + 2708: 80 fd sbrc r24, 0 + 270a: 84 c0 rjmp .+264 ; 0x2814 <__vector_83+0x1cc> CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; } else { CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 237a: 90 93 45 06 sts 0x0645, r25 + 270c: 90 93 45 06 sts 0x0645, r25 } DataRegister = Temp8 >> 1; - 237e: 86 95 lsr r24 - 2380: 80 93 aa 20 sts 0x20AA, r24 + 2710: 86 95 lsr r24 + 2712: 80 93 aa 24 sts 0x24AA, r24 Temp16 = BitSent; - 2384: 80 91 ab 20 lds r24, 0x20AB - 2388: 90 91 ac 20 lds r25, 0x20AC + 2716: 80 91 ab 24 lds r24, 0x24AB + 271a: 90 91 ac 24 lds r25, 0x24AC BitSent = ++Temp16; - 238c: 01 96 adiw r24, 0x01 ; 1 - 238e: 80 93 ab 20 sts 0x20AB, r24 - 2392: 90 93 ac 20 sts 0x20AC, r25 + 271e: 01 96 adiw r24, 0x01 ; 1 + 2720: 80 93 ab 24 sts 0x24AB, r24 + 2724: 90 93 ac 24 sts 0x24AC, r25 if ((Temp16 & 0x07) == 0) { - 2396: 9c 01 movw r18, r24 - 2398: 27 70 andi r18, 0x07 ; 7 - 239a: 33 27 eor r19, r19 - 239c: 23 2b or r18, r19 - 239e: 09 f4 brne .+2 ; 0x23a2 <__vector_83+0xec> - 23a0: 77 c0 rjmp .+238 ; 0x2490 <__vector_83+0x1da> + 2728: 9c 01 movw r18, r24 + 272a: 27 70 andi r18, 0x07 ; 7 + 272c: 33 27 eor r19, r19 + 272e: 23 2b or r18, r19 + 2730: 09 f4 brne .+2 ; 0x2734 <__vector_83+0xec> + 2732: 77 c0 rjmp .+238 ; 0x2822 <__vector_83+0x1da> /* Byte boundary. Load parity bit and output it later. */ LoadModState = LOADMOD_PARITY0; break; } if (Temp16 == BitCount) { - 23a2: 20 91 ad 20 lds r18, 0x20AD - 23a6: 30 91 ae 20 lds r19, 0x20AE - 23aa: 82 17 cp r24, r18 - 23ac: 93 07 cpc r25, r19 - 23ae: 09 f0 breq .+2 ; 0x23b2 <__vector_83+0xfc> - 23b0: 4e c0 rjmp .+156 ; 0x244e <__vector_83+0x198> + 2734: 20 91 ad 24 lds r18, 0x24AD + 2738: 30 91 ae 24 lds r19, 0x24AE + 273c: 82 17 cp r24, r18 + 273e: 93 07 cpc r25, r19 + 2740: 09 f0 breq .+2 ; 0x2744 <__vector_83+0xfc> + 2742: 4e c0 rjmp .+156 ; 0x27e0 <__vector_83+0x198> CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; } if (BitSent == BitCount) { /* No data left */ LoadModState = LOADMOD_STOP_BIT0; - 23b2: 88 e0 ldi r24, 0x08 ; 8 - 23b4: 80 93 a6 20 sts 0x20A6, r24 - 23b8: 99 cf rjmp .-206 ; 0x22ec <__vector_83+0x36> + 2744: 88 e0 ldi r24, 0x08 ; 8 + 2746: 80 93 a6 24 sts 0x24A6, r24 + 274a: 99 cf rjmp .-206 ; 0x267e <__vector_83+0x36> CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; LoadModState = LOADMOD_START_BIT1; break; case LOADMOD_START_BIT1: CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 23ba: 80 e4 ldi r24, 0x40 ; 64 - 23bc: 80 93 46 06 sts 0x0646, r24 + 274c: 80 e4 ldi r24, 0x40 ; 64 + 274e: 80 93 46 06 sts 0x0646, r24 LoadModState = LOADMOD_DATA0; - 23c0: 84 e0 ldi r24, 0x04 ; 4 - 23c2: 80 93 a6 20 sts 0x20A6, r24 + 2752: 84 e0 ldi r24, 0x04 ; 4 + 2754: 80 93 a6 24 sts 0x24A6, r24 /* Fetch first byte */ DataRegister = *CodecBufferPtr; - 23c6: e0 91 b1 20 lds r30, 0x20B1 - 23ca: f0 91 b2 20 lds r31, 0x20B2 - 23ce: 80 81 ld r24, Z - 23d0: 80 93 aa 20 sts 0x20AA, r24 + 2758: e0 91 b1 24 lds r30, 0x24B1 + 275c: f0 91 b2 24 lds r31, 0x24B2 + 2760: 80 81 ld r24, Z + 2762: 80 93 aa 24 sts 0x24AA, r24 break; - 23d4: 8b cf rjmp .-234 ; 0x22ec <__vector_83+0x36> + 2766: 8b cf rjmp .-234 ; 0x267e <__vector_83+0x36> } break; case LOADMOD_STOP_BIT0: CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 23d6: 80 e4 ldi r24, 0x40 ; 64 - 23d8: 80 93 46 06 sts 0x0646, r24 + 2768: 80 e4 ldi r24, 0x40 ; 64 + 276a: 80 93 46 06 sts 0x0646, r24 LoadModState = LOADMOD_STOP_BIT1; - 23dc: 89 e0 ldi r24, 0x09 ; 9 - 23de: 80 93 a6 20 sts 0x20A6, r24 + 276e: 89 e0 ldi r24, 0x09 ; 9 + 2770: 80 93 a6 24 sts 0x24A6, r24 break; - 23e2: 84 cf rjmp .-248 ; 0x22ec <__vector_83+0x36> + 2774: 84 cf rjmp .-248 ; 0x267e <__vector_83+0x36> case LOADMOD_STOP_BIT1: CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 23e4: 80 e4 ldi r24, 0x40 ; 64 - 23e6: 80 93 46 06 sts 0x0646, r24 + 2776: 80 e4 ldi r24, 0x40 ; 64 + 2778: 80 93 46 06 sts 0x0646, r24 LoadModState = LOADMOD_FINISHED; - 23ea: 8a e0 ldi r24, 0x0A ; 10 - 23ec: 80 93 a6 20 sts 0x20A6, r24 + 277c: 8a e0 ldi r24, 0x0A ; 10 + 277e: 80 93 a6 24 sts 0x24A6, r24 break; - 23f0: 7d cf rjmp .-262 ; 0x22ec <__vector_83+0x36> + 2782: 7d cf rjmp .-262 ; 0x267e <__vector_83+0x36> uint16_t Temp16; switch (LoadModState) { case LOADMOD_FDT: /* No data has been produced, but FDT has ended. Switch over to bit-grid aligning. */ CODEC_TIMER_LOADMOD.PER = ISO14443A_BIT_GRID_CYCLES - 1; - 23f2: 8f e7 ldi r24, 0x7F ; 127 - 23f4: 90 e0 ldi r25, 0x00 ; 0 - 23f6: 80 93 66 09 sts 0x0966, r24 - 23fa: 90 93 67 09 sts 0x0967, r25 + 2784: 8f e7 ldi r24, 0x7F ; 127 + 2786: 90 e0 ldi r25, 0x00 ; 0 + 2788: 80 93 66 09 sts 0x0966, r24 + 278c: 90 93 67 09 sts 0x0967, r25 break; - 23fe: 76 cf rjmp .-276 ; 0x22ec <__vector_83+0x36> + 2790: 76 cf rjmp .-276 ; 0x267e <__vector_83+0x36> LoadModState = LOADMOD_PARITY1; break; case LOADMOD_PARITY1: if (*ParityBufferPtr) { - 2400: e0 91 b3 20 lds r30, 0x20B3 - 2404: f0 91 b4 20 lds r31, 0x20B4 - 2408: 80 81 ld r24, Z - 240a: 81 11 cpse r24, r1 - 240c: 36 c0 rjmp .+108 ; 0x247a <__vector_83+0x1c4> + 2792: e0 91 b3 24 lds r30, 0x24B3 + 2796: f0 91 b4 24 lds r31, 0x24B4 + 279a: 80 81 ld r24, Z + 279c: 81 11 cpse r24, r1 + 279e: 36 c0 rjmp .+108 ; 0x280c <__vector_83+0x1c4> CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; } else { CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 240e: 80 e4 ldi r24, 0x40 ; 64 - 2410: 80 93 45 06 sts 0x0645, r24 + 27a0: 80 e4 ldi r24, 0x40 ; 64 + 27a2: 80 93 45 06 sts 0x0645, r24 } if (BitSent == BitCount) { - 2414: 20 91 ab 20 lds r18, 0x20AB - 2418: 30 91 ac 20 lds r19, 0x20AC - 241c: 80 91 ad 20 lds r24, 0x20AD - 2420: 90 91 ae 20 lds r25, 0x20AE - 2424: 28 17 cp r18, r24 - 2426: 39 07 cpc r19, r25 - 2428: 21 f2 breq .-120 ; 0x23b2 <__vector_83+0xfc> + 27a6: 20 91 ab 24 lds r18, 0x24AB + 27aa: 30 91 ac 24 lds r19, 0x24AC + 27ae: 80 91 ad 24 lds r24, 0x24AD + 27b2: 90 91 ae 24 lds r25, 0x24AE + 27b6: 28 17 cp r18, r24 + 27b8: 39 07 cpc r19, r25 + 27ba: 21 f2 breq .-120 ; 0x2744 <__vector_83+0xfc> /* No data left */ LoadModState = LOADMOD_STOP_BIT0; } else { /* Fetch next data and continue sending bits. */ ParityBufferPtr++; - 242a: 31 96 adiw r30, 0x01 ; 1 - 242c: e0 93 b3 20 sts 0x20B3, r30 - 2430: f0 93 b4 20 sts 0x20B4, r31 + 27bc: 31 96 adiw r30, 0x01 ; 1 + 27be: e0 93 b3 24 sts 0x24B3, r30 + 27c2: f0 93 b4 24 sts 0x24B4, r31 DataRegister = *++CodecBufferPtr; - 2434: e0 91 b1 20 lds r30, 0x20B1 - 2438: f0 91 b2 20 lds r31, 0x20B2 - 243c: cf 01 movw r24, r30 - 243e: 01 96 adiw r24, 0x01 ; 1 - 2440: 80 93 b1 20 sts 0x20B1, r24 - 2444: 90 93 b2 20 sts 0x20B2, r25 - 2448: 81 81 ldd r24, Z+1 ; 0x01 - 244a: 80 93 aa 20 sts 0x20AA, r24 + 27c6: e0 91 b1 24 lds r30, 0x24B1 + 27ca: f0 91 b2 24 lds r31, 0x24B2 + 27ce: cf 01 movw r24, r30 + 27d0: 01 96 adiw r24, 0x01 ; 1 + 27d2: 80 93 b1 24 sts 0x24B1, r24 + 27d6: 90 93 b2 24 sts 0x24B2, r25 + 27da: 81 81 ldd r24, Z+1 ; 0x01 + 27dc: 80 93 aa 24 sts 0x24AA, r24 LoadModState = LOADMOD_DATA0; - 244e: 84 e0 ldi r24, 0x04 ; 4 - 2450: 80 93 a6 20 sts 0x20A6, r24 - 2454: 4b cf rjmp .-362 ; 0x22ec <__vector_83+0x36> + 27e0: 84 e0 ldi r24, 0x04 ; 4 + 27e2: 80 93 a6 24 sts 0x24A6, r24 + 27e6: 4b cf rjmp .-362 ; 0x267e <__vector_83+0x36> LoadModState = LOADMOD_DATA0; break; case LOADMOD_PARITY0: if (*ParityBufferPtr) { - 2456: e0 91 b3 20 lds r30, 0x20B3 - 245a: f0 91 b4 20 lds r31, 0x20B4 - 245e: 80 81 ld r24, Z - 2460: 81 11 cpse r24, r1 - 2462: 07 c0 rjmp .+14 ; 0x2472 <__vector_83+0x1bc> + 27e8: e0 91 b3 24 lds r30, 0x24B3 + 27ec: f0 91 b4 24 lds r31, 0x24B4 + 27f0: 80 81 ld r24, Z + 27f2: 81 11 cpse r24, r1 + 27f4: 07 c0 rjmp .+14 ; 0x2804 <__vector_83+0x1bc> CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; } else { CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2464: 80 e4 ldi r24, 0x40 ; 64 - 2466: 80 93 46 06 sts 0x0646, r24 + 27f6: 80 e4 ldi r24, 0x40 ; 64 + 27f8: 80 93 46 06 sts 0x0646, r24 } LoadModState = LOADMOD_PARITY1; - 246a: 87 e0 ldi r24, 0x07 ; 7 - 246c: 80 93 a6 20 sts 0x20A6, r24 + 27fc: 87 e0 ldi r24, 0x07 ; 7 + 27fe: 80 93 a6 24 sts 0x24A6, r24 break; - 2470: 3d cf rjmp .-390 ; 0x22ec <__vector_83+0x36> + 2802: 3d cf rjmp .-390 ; 0x267e <__vector_83+0x36> break; case LOADMOD_PARITY0: if (*ParityBufferPtr) { CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2472: 80 e4 ldi r24, 0x40 ; 64 - 2474: 80 93 45 06 sts 0x0645, r24 - 2478: f8 cf rjmp .-16 ; 0x246a <__vector_83+0x1b4> + 2804: 80 e4 ldi r24, 0x40 ; 64 + 2806: 80 93 45 06 sts 0x0645, r24 + 280a: f8 cf rjmp .-16 ; 0x27fc <__vector_83+0x1b4> LoadModState = LOADMOD_PARITY1; break; case LOADMOD_PARITY1: if (*ParityBufferPtr) { CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 247a: 80 e4 ldi r24, 0x40 ; 64 - 247c: 80 93 46 06 sts 0x0646, r24 - 2480: c9 cf rjmp .-110 ; 0x2414 <__vector_83+0x15e> + 280c: 80 e4 ldi r24, 0x40 ; 64 + 280e: 80 93 46 06 sts 0x0646, r24 + 2812: c9 cf rjmp .-110 ; 0x27a6 <__vector_83+0x15e> case LOADMOD_DATA1: Temp8 = DataRegister; if (Temp8 & 1) { CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2482: 90 93 46 06 sts 0x0646, r25 - 2486: 7b cf rjmp .-266 ; 0x237e <__vector_83+0xc8> + 2814: 90 93 46 06 sts 0x0646, r25 + 2818: 7b cf rjmp .-266 ; 0x2710 <__vector_83+0xc8> DataRegister = *CodecBufferPtr; break; case LOADMOD_DATA0: if (DataRegister & 1) { CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2488: 80 e4 ldi r24, 0x40 ; 64 - 248a: 80 93 45 06 sts 0x0645, r24 - 248e: 48 cf rjmp .-368 ; 0x2320 <__vector_83+0x6a> + 281a: 80 e4 ldi r24, 0x40 ; 64 + 281c: 80 93 45 06 sts 0x0645, r24 + 2820: 48 cf rjmp .-368 ; 0x26b2 <__vector_83+0x6a> Temp16 = BitSent; BitSent = ++Temp16; if ((Temp16 & 0x07) == 0) { /* Byte boundary. Load parity bit and output it later. */ LoadModState = LOADMOD_PARITY0; - 2490: 86 e0 ldi r24, 0x06 ; 6 - 2492: 80 93 a6 20 sts 0x20A6, r24 + 2822: 86 e0 ldi r24, 0x06 ; 6 + 2824: 80 93 a6 24 sts 0x24A6, r24 break; - 2496: 2a cf rjmp .-428 ; 0x22ec <__vector_83+0x36> + 2828: 2a cf rjmp .-428 ; 0x267e <__vector_83+0x36> -00002498 : +0000282a : default: break; } } void ISO14443ACodecInit(void) { - 2498: cf 93 push r28 - 249a: df 93 push r29 + 282a: cf 93 push r28 + 282c: df 93 push r29 static volatile LoadModStateType LoadModState; static volatile bool SamplePosition; static void Initialize(void) { /* Configure CARRIER input pin and route it to EVSYS */ CODEC_CARRIER_IN_PORT.DIRCLR = CODEC_CARRIER_IN_MASK; - 249c: e0 e4 ldi r30, 0x40 ; 64 - 249e: f6 e0 ldi r31, 0x06 ; 6 - 24a0: 84 e0 ldi r24, 0x04 ; 4 - 24a2: 82 83 std Z+2, r24 ; 0x02 + 282e: e0 e4 ldi r30, 0x40 ; 64 + 2830: f6 e0 ldi r31, 0x06 ; 6 + 2832: 84 e0 ldi r24, 0x04 ; 4 + 2834: 82 83 std Z+2, r24 ; 0x02 CODEC_CARRIER_IN_PORT.CODEC_CARRIER_IN_PINCTRL = PORT_ISC_BOTHEDGES_gc; - 24a4: 12 8a std Z+18, r1 ; 0x12 + 2836: 12 8a std Z+18, r1 ; 0x12 EVSYS.CH6MUX = CODEC_CARRIER_IN_EVMUX; - 24a6: c0 e8 ldi r28, 0x80 ; 128 - 24a8: d1 e0 ldi r29, 0x01 ; 1 - 24aa: 82 e6 ldi r24, 0x62 ; 98 - 24ac: 8e 83 std Y+6, r24 ; 0x06 + 2838: c0 e8 ldi r28, 0x80 ; 128 + 283a: d1 e0 ldi r29, 0x01 ; 1 + 283c: 82 e6 ldi r24, 0x62 ; 98 + 283e: 8e 83 std Y+6, r24 ; 0x06 /* Configure two DEMOD pins for input. * Configure event channel 0 for rising edge (begin of modulation pause) * Configure event channel 1 for falling edge (end of modulation pause) */ CODEC_DEMOD_IN_PORT.DIRCLR = CODEC_DEMOD_IN_MASK; - 24ae: a0 e2 ldi r26, 0x20 ; 32 - 24b0: b6 e0 ldi r27, 0x06 ; 6 - 24b2: 85 e0 ldi r24, 0x05 ; 5 - 24b4: 12 96 adiw r26, 0x02 ; 2 - 24b6: 8c 93 st X, r24 - 24b8: 12 97 sbiw r26, 0x02 ; 2 + 2840: a0 e2 ldi r26, 0x20 ; 32 + 2842: b6 e0 ldi r27, 0x06 ; 6 + 2844: 85 e0 ldi r24, 0x05 ; 5 + 2846: 12 96 adiw r26, 0x02 ; 2 + 2848: 8c 93 st X, r24 + 284a: 12 97 sbiw r26, 0x02 ; 2 CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL0 = PORT_ISC_RISING_gc; - 24ba: 81 e0 ldi r24, 0x01 ; 1 - 24bc: 50 96 adiw r26, 0x10 ; 16 - 24be: 8c 93 st X, r24 - 24c0: 50 97 sbiw r26, 0x10 ; 16 + 284c: 81 e0 ldi r24, 0x01 ; 1 + 284e: 50 96 adiw r26, 0x10 ; 16 + 2850: 8c 93 st X, r24 + 2852: 50 97 sbiw r26, 0x10 ; 16 CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL1 = PORT_ISC_FALLING_gc; - 24c2: 82 e0 ldi r24, 0x02 ; 2 - 24c4: 52 96 adiw r26, 0x12 ; 18 - 24c6: 8c 93 st X, r24 - 24c8: 52 97 sbiw r26, 0x12 ; 18 + 2854: 82 e0 ldi r24, 0x02 ; 2 + 2856: 52 96 adiw r26, 0x12 ; 18 + 2858: 8c 93 st X, r24 + 285a: 52 97 sbiw r26, 0x12 ; 18 CODEC_DEMOD_IN_PORT.INT0MASK = 0; - 24ca: 1a 96 adiw r26, 0x0a ; 10 - 24cc: 1c 92 st X, r1 - 24ce: 1a 97 sbiw r26, 0x0a ; 10 + 285c: 1a 96 adiw r26, 0x0a ; 10 + 285e: 1c 92 st X, r1 + 2860: 1a 97 sbiw r26, 0x0a ; 10 CODEC_DEMOD_IN_PORT.INTCTRL = PORT_INT0LVL_HI_gc; - 24d0: 83 e0 ldi r24, 0x03 ; 3 - 24d2: 19 96 adiw r26, 0x09 ; 9 - 24d4: 8c 93 st X, r24 + 2862: 83 e0 ldi r24, 0x03 ; 3 + 2864: 19 96 adiw r26, 0x09 ; 9 + 2866: 8c 93 st X, r24 EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0; - 24d6: 98 e5 ldi r25, 0x58 ; 88 - 24d8: 98 83 st Y, r25 + 2868: 98 e5 ldi r25, 0x58 ; 88 + 286a: 98 83 st Y, r25 EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1; - 24da: 9a e5 ldi r25, 0x5A ; 90 - 24dc: 99 83 std Y+1, r25 ; 0x01 + 286c: 9a e5 ldi r25, 0x5A ; 90 + 286e: 99 83 std Y+1, r25 ; 0x01 /* Configure LOADMOD and SUBCARRIER output pins. * Disable PSK modulation by setting pin to low. */ CODEC_LOADMOD_PORT.DIRSET = CODEC_LOADMOD_MASK; - 24de: 90 e4 ldi r25, 0x40 ; 64 - 24e0: 91 83 std Z+1, r25 ; 0x01 + 2870: 90 e4 ldi r25, 0x40 ; 64 + 2872: 91 83 std Z+1, r25 ; 0x01 CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 24e2: 96 83 std Z+6, r25 ; 0x06 + 2874: 96 83 std Z+6, r25 ; 0x06 CODEC_SUBCARRIER_PORT.DIRSET = CODEC_SUBCARRIER_MASK; - 24e4: 81 83 std Z+1, r24 ; 0x01 + 2876: 81 83 std Z+1, r24 ; 0x01 CODEC_SUBCARRIER_PORT.OUTCLR = CODEC_SUBCARRIER_MASK; - 24e6: 86 83 std Z+6, r24 ; 0x06 + 2878: 86 83 std Z+6, r24 ; 0x06 /* Configure subcarrier generation with 50% DC output using OOK */ CODEC_SUBCARRIER_TIMER.PER = ISO14443A_SUBCARRIER_DIVIDER - 1; - 24e8: e0 e0 ldi r30, 0x00 ; 0 - 24ea: f8 e0 ldi r31, 0x08 ; 8 - 24ec: 8f e0 ldi r24, 0x0F ; 15 - 24ee: 90 e0 ldi r25, 0x00 ; 0 - 24f0: 86 a3 std Z+38, r24 ; 0x26 - 24f2: 97 a3 std Z+39, r25 ; 0x27 + 287a: e0 e0 ldi r30, 0x00 ; 0 + 287c: f8 e0 ldi r31, 0x08 ; 8 + 287e: 8f e0 ldi r24, 0x0F ; 15 + 2880: 90 e0 ldi r25, 0x00 ; 0 + 2882: 86 a3 std Z+38, r24 ; 0x26 + 2884: 97 a3 std Z+39, r25 ; 0x27 CODEC_SUBCARRIER_TIMER.CODEC_SUBCARRIER_CC_OOK = ISO14443A_SUBCARRIER_DIVIDER/2; - 24f4: 88 e0 ldi r24, 0x08 ; 8 - 24f6: 90 e0 ldi r25, 0x00 ; 0 - 24f8: 82 a7 std Z+42, r24 ; 0x2a - 24fa: 93 a7 std Z+43, r25 ; 0x2b + 2886: 88 e0 ldi r24, 0x08 ; 8 + 2888: 90 e0 ldi r25, 0x00 ; 0 + 288a: 82 a7 std Z+42, r24 ; 0x2a + 288c: 93 a7 std Z+43, r25 ; 0x2b CODEC_SUBCARRIER_TIMER.CTRLB = CODEC_SUBCARRIER_CCEN_OOK | TC_WGMODE_SINGLESLOPE_gc; - 24fc: 83 e2 ldi r24, 0x23 ; 35 - 24fe: 81 83 std Z+1, r24 ; 0x01 + 288e: 83 e2 ldi r24, 0x23 ; 35 + 2890: 81 83 std Z+1, r24 ; 0x01 void ISO14443ACodecInit(void) { /* Initialize common peripherals and start listening * for incoming data. */ Initialize(); StartDemod(); } - 2500: df 91 pop r29 - 2502: cf 91 pop r28 + 2892: df 91 pop r29 + 2894: cf 91 pop r28 void ISO14443ACodecInit(void) { /* Initialize common peripherals and start listening * for incoming data. */ Initialize(); StartDemod(); - 2504: d2 cd rjmp .-1116 ; 0x20aa + 2896: d2 cd rjmp .-1116 ; 0x243c -00002506 : +00002898 : } void ISO14443ACodecTask(void) { - 2506: cf 93 push r28 - 2508: df 93 push r29 + 2898: cf 93 push r28 + 289a: df 93 push r29 if (Flags.DemodFinished) { - 250a: 80 91 af 20 lds r24, 0x20AF - 250e: 88 23 and r24, r24 - 2510: c1 f0 breq .+48 ; 0x2542 + 289c: 80 91 af 24 lds r24, 0x24AF + 28a0: 88 23 and r24, r24 + 28a2: c1 f0 breq .+48 ; 0x28d4 Flags.DemodFinished = 0; - 2512: 10 92 af 20 sts 0x20AF, r1 + 28a4: 10 92 af 24 sts 0x24AF, r1 INLINE void CodecTask(void) { ActiveConfiguration.CodecTaskFunc(); } INLINE void CodecSetDemodPower(bool bOnOff) { CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; - 2516: 82 e0 ldi r24, 0x02 ; 2 - 2518: 80 93 21 06 sts 0x0621, r24 + 28a8: 82 e0 ldi r24, 0x02 ; 2 + 28aa: 80 93 21 06 sts 0x0621, r24 if (bOnOff) { CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; } else { CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK; - 251c: 80 93 26 06 sts 0x0626, r24 + 28ae: 80 93 26 06 sts 0x0626, r24 /* Reception finished. Process the received bytes */ CodecSetDemodPower(false); uint16_t DemodBitCount = BitCount; - 2520: 60 91 ad 20 lds r22, 0x20AD - 2524: 70 91 ae 20 lds r23, 0x20AE + 28b2: 60 91 ad 24 lds r22, 0x24AD + 28b6: 70 91 ae 24 lds r23, 0x24AE uint16_t AnswerBitCount = ISO14443A_APP_NO_RESPONSE; if (DemodBitCount > 0) { - 2528: 61 15 cp r22, r1 - 252a: 71 05 cpc r23, r1 - 252c: 89 f4 brne .+34 ; 0x2550 + 28ba: 61 15 cp r22, r1 + 28bc: 71 05 cpc r23, r1 + 28be: 89 f4 brne .+34 ; 0x28e2 INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); } INLINE void ApplicationReset(void) { ActiveConfiguration.ApplicationResetFunc(); - 252e: e0 91 ef 20 lds r30, 0x20EF - 2532: f0 91 f0 20 lds r31, 0x20F0 - 2536: 09 95 icall + 28c0: e0 91 ef 24 lds r30, 0x24EF + 28c4: f0 91 f0 24 lds r31, 0x24F0 + 28c8: 09 95 icall CodecBufferPtr = CodecBuffer; ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; LoadModState = LOADMOD_START; } else { /* No data to be processed. Disable loadmodding and start listening again */ CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_OFF_gc; - 2538: 10 92 40 09 sts 0x0940, r1 + 28ca: 10 92 40 09 sts 0x0940, r1 CODEC_TIMER_LOADMOD.INTCTRLA = 0; - 253c: 10 92 46 09 sts 0x0946, r1 + 28ce: 10 92 46 09 sts 0x0946, r1 StartDemod(); - 2540: b4 dd rcall .-1176 ; 0x20aa + 28d2: b4 dd rcall .-1176 ; 0x243c } } if (Flags.LoadmodFinished) { - 2542: 80 91 b0 20 lds r24, 0x20B0 - 2546: 81 11 cpse r24, r1 - 2548: 2a c0 rjmp .+84 ; 0x259e + 28d4: 80 91 b0 24 lds r24, 0x24B0 + 28d8: 81 11 cpse r24, r1 + 28da: 2a c0 rjmp .+84 ; 0x2930 Flags.LoadmodFinished = 0; /* Load modulation has been finished. Stop it and start to listen * for incoming data again. */ StartDemod(); } } - 254a: df 91 pop r29 - 254c: cf 91 pop r28 - 254e: 08 95 ret + 28dc: df 91 pop r29 + 28de: cf 91 pop r28 + 28e0: 08 95 ret INLINE void ApplicationTask(void) { ActiveConfiguration.ApplicationTaskFunc(); } INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); - 2550: e0 91 f3 20 lds r30, 0x20F3 - 2554: f0 91 f4 20 lds r31, 0x20F4 - 2558: 80 e1 ldi r24, 0x10 ; 16 - 255a: 92 e2 ldi r25, 0x22 ; 34 - 255c: 09 95 icall + 28e2: e0 91 f3 24 lds r30, 0x24F3 + 28e6: f0 91 f4 24 lds r31, 0x24F4 + 28ea: 80 e1 ldi r24, 0x10 ; 16 + 28ec: 96 e2 ldi r25, 0x26 ; 38 + 28ee: 09 95 icall if (DemodBitCount > 0) { /* Call application if we received data */ AnswerBitCount = ApplicationProcess(CodecBuffer, DemodBitCount); if (AnswerBitCount & ISO14443A_APP_CUSTOM_PARITY) { - 255e: 94 ff sbrs r25, 4 - 2560: 23 c0 rjmp .+70 ; 0x25a8 + 28f0: 94 ff sbrs r25, 4 + 28f2: 23 c0 rjmp .+70 ; 0x293a /* Application has generated it's own parity bits. * Clear this option bit. */ AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; - 2562: 9f 7e andi r25, 0xEF ; 239 + 28f4: 9f 7e andi r25, 0xEF ; 239 } } else { ApplicationReset(); } if (AnswerBitCount != ISO14443A_APP_NO_RESPONSE) { - 2564: 00 97 sbiw r24, 0x00 ; 0 - 2566: 41 f3 breq .-48 ; 0x2538 + 28f6: 00 97 sbiw r24, 0x00 ; 0 + 28f8: 41 f3 breq .-48 ; 0x28ca BitCount = AnswerBitCount; - 2568: 80 93 ad 20 sts 0x20AD, r24 - 256c: 90 93 ae 20 sts 0x20AE, r25 + 28fa: 80 93 ad 24 sts 0x24AD, r24 + 28fe: 90 93 ae 24 sts 0x24AE, r25 BitSent = 0; - 2570: 10 92 ab 20 sts 0x20AB, r1 - 2574: 10 92 ac 20 sts 0x20AC, r1 + 2902: 10 92 ab 24 sts 0x24AB, r1 + 2906: 10 92 ac 24 sts 0x24AC, r1 CodecBufferPtr = CodecBuffer; - 2578: 80 e1 ldi r24, 0x10 ; 16 - 257a: 92 e2 ldi r25, 0x22 ; 34 - 257c: 80 93 b1 20 sts 0x20B1, r24 - 2580: 90 93 b2 20 sts 0x20B2, r25 + 290a: 80 e1 ldi r24, 0x10 ; 16 + 290c: 96 e2 ldi r25, 0x26 ; 38 + 290e: 80 93 b1 24 sts 0x24B1, r24 + 2912: 90 93 b2 24 sts 0x24B2, r25 ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - 2584: 80 e9 ldi r24, 0x90 ; 144 - 2586: 92 e2 ldi r25, 0x22 ; 34 - 2588: 80 93 b3 20 sts 0x20B3, r24 - 258c: 90 93 b4 20 sts 0x20B4, r25 + 2916: 80 e9 ldi r24, 0x90 ; 144 + 2918: 96 e2 ldi r25, 0x26 ; 38 + 291a: 80 93 b3 24 sts 0x24B3, r24 + 291e: 90 93 b4 24 sts 0x24B4, r25 LoadModState = LOADMOD_START; - 2590: 81 e0 ldi r24, 0x01 ; 1 - 2592: 80 93 a6 20 sts 0x20A6, r24 + 2922: 81 e0 ldi r24, 0x01 ; 1 + 2924: 80 93 a6 24 sts 0x24A6, r24 StartDemod(); } } if (Flags.LoadmodFinished) { - 2596: 80 91 b0 20 lds r24, 0x20B0 - 259a: 88 23 and r24, r24 - 259c: b1 f2 breq .-84 ; 0x254a + 2928: 80 91 b0 24 lds r24, 0x24B0 + 292c: 88 23 and r24, r24 + 292e: b1 f2 breq .-84 ; 0x28dc Flags.LoadmodFinished = 0; - 259e: 10 92 b0 20 sts 0x20B0, r1 + 2930: 10 92 b0 24 sts 0x24B0, r1 /* Load modulation has been finished. Stop it and start to listen * for incoming data again. */ StartDemod(); } } - 25a2: df 91 pop r29 - 25a4: cf 91 pop r28 + 2934: df 91 pop r29 + 2936: cf 91 pop r28 if (Flags.LoadmodFinished) { Flags.LoadmodFinished = 0; /* Load modulation has been finished. Stop it and start to listen * for incoming data again. */ StartDemod(); - 25a6: 81 cd rjmp .-1278 ; 0x20aa + 2938: 81 cd rjmp .-1278 ; 0x243c /* Application has generated it's own parity bits. * Clear this option bit. */ AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; } else { /* We have to generate the parity bits ourself */ for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { - 25a8: ac 01 movw r20, r24 - 25aa: 56 95 lsr r21 - 25ac: 47 95 ror r20 - 25ae: 56 95 lsr r21 - 25b0: 47 95 ror r20 - 25b2: 56 95 lsr r21 - 25b4: 47 95 ror r20 - 25b6: 41 15 cp r20, r1 - 25b8: 51 05 cpc r21, r1 - 25ba: a1 f2 breq .-88 ; 0x2564 - 25bc: 60 e0 ldi r22, 0x00 ; 0 - 25be: 20 e0 ldi r18, 0x00 ; 0 - 25c0: 30 e0 ldi r19, 0x00 ; 0 + 293a: ac 01 movw r20, r24 + 293c: 56 95 lsr r21 + 293e: 47 95 ror r20 + 2940: 56 95 lsr r21 + 2942: 47 95 ror r20 + 2944: 56 95 lsr r21 + 2946: 47 95 ror r20 + 2948: 41 15 cp r20, r1 + 294a: 51 05 cpc r21, r1 + 294c: a1 f2 breq .-88 ; 0x28f6 + 294e: 60 e0 ldi r22, 0x00 ; 0 + 2950: 20 e0 ldi r18, 0x00 ; 0 + 2952: 30 e0 ldi r19, 0x00 ; 0 /* For each whole byte, generate a parity bit. */ CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CodecBuffer[i]); - 25c2: f9 01 movw r30, r18 - 25c4: e0 5f subi r30, 0xF0 ; 240 - 25c6: fd 4d sbci r31, 0xDD ; 221 - 25c8: 20 81 ld r18, Z - 25ca: 02 2e mov r0, r18 - 25cc: 22 95 swap r18 - 25ce: 20 25 eor r18, r0 - 25d0: 02 2e mov r0, r18 - 25d2: 26 95 lsr r18 - 25d4: 26 95 lsr r18 - 25d6: 20 25 eor r18, r0 + 2954: f9 01 movw r30, r18 + 2956: e0 5f subi r30, 0xF0 ; 240 + 2958: f9 4d sbci r31, 0xD9 ; 217 + 295a: 20 81 ld r18, Z + 295c: 02 2e mov r0, r18 + 295e: 22 95 swap r18 + 2960: 20 25 eor r18, r0 + 2962: 02 2e mov r0, r18 + 2964: 26 95 lsr r18 + 2966: 26 95 lsr r18 + 2968: 20 25 eor r18, r0 AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; } else { /* We have to generate the parity bits ourself */ for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { /* For each whole byte, generate a parity bit. */ CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = - 25d8: e0 58 subi r30, 0x80 ; 128 - 25da: ff 4f sbci r31, 0xFF ; 255 + 296a: e0 58 subi r30, 0x80 ; 128 + 296c: ff 4f sbci r31, 0xFF ; 255 ODD_PARITY(CodecBuffer[i]); - 25dc: 30 e0 ldi r19, 0x00 ; 0 - 25de: 2f 5f subi r18, 0xFF ; 255 - 25e0: 3f 4f sbci r19, 0xFF ; 255 - 25e2: 21 fb bst r18, 1 - 25e4: 77 27 eor r23, r23 - 25e6: 70 f9 bld r23, 0 - 25e8: c7 2f mov r28, r23 - 25ea: 20 e0 ldi r18, 0x00 ; 0 - 25ec: d2 2f mov r29, r18 - 25ee: 71 e0 ldi r23, 0x01 ; 1 - 25f0: c7 27 eor r28, r23 - 25f2: c0 83 st Z, r28 + 296e: 30 e0 ldi r19, 0x00 ; 0 + 2970: 2f 5f subi r18, 0xFF ; 255 + 2972: 3f 4f sbci r19, 0xFF ; 255 + 2974: 21 fb bst r18, 1 + 2976: 77 27 eor r23, r23 + 2978: 70 f9 bld r23, 0 + 297a: c7 2f mov r28, r23 + 297c: 20 e0 ldi r18, 0x00 ; 0 + 297e: d2 2f mov r29, r18 + 2980: 71 e0 ldi r23, 0x01 ; 1 + 2982: c7 27 eor r28, r23 + 2984: c0 83 st Z, r28 /* Application has generated it's own parity bits. * Clear this option bit. */ AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; } else { /* We have to generate the parity bits ourself */ for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { - 25f4: 6f 5f subi r22, 0xFF ; 255 - 25f6: 26 2f mov r18, r22 - 25f8: 30 e0 ldi r19, 0x00 ; 0 - 25fa: 24 17 cp r18, r20 - 25fc: 35 07 cpc r19, r21 - 25fe: 08 f3 brcs .-62 ; 0x25c2 - 2600: b1 cf rjmp .-158 ; 0x2564 + 2986: 6f 5f subi r22, 0xFF ; 255 + 2988: 26 2f mov r18, r22 + 298a: 30 e0 ldi r19, 0x00 ; 0 + 298c: 24 17 cp r18, r20 + 298e: 35 07 cpc r19, r21 + 2990: 08 f3 brcs .-62 ; 0x2954 + 2992: b1 cf rjmp .-158 ; 0x28f6 -00002602 : +00002994 : Block[11] = Block[3]; } void MifareClassicAppInit1K(void) { State = STATE_IDLE; - 2602: 81 e0 ldi r24, 0x01 ; 1 - 2604: 80 93 b5 20 sts 0x20B5, r24 + 2994: 81 e0 ldi r24, 0x01 ; 1 + 2996: 80 93 b5 24 sts 0x24B5, r24 CardATQAValue = MFCLASSIC_1K_ATQA_VALUE; - 2608: 84 e0 ldi r24, 0x04 ; 4 - 260a: 90 e0 ldi r25, 0x00 ; 0 - 260c: 80 93 b6 20 sts 0x20B6, r24 - 2610: 90 93 b7 20 sts 0x20B7, r25 + 299a: 84 e0 ldi r24, 0x04 ; 4 + 299c: 90 e0 ldi r25, 0x00 ; 0 + 299e: 80 93 b6 24 sts 0x24B6, r24 + 29a2: 90 93 b7 24 sts 0x24B7, r25 CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; - 2614: 88 e0 ldi r24, 0x08 ; 8 - 2616: 80 93 b8 20 sts 0x20B8, r24 - 261a: 08 95 ret + 29a6: 88 e0 ldi r24, 0x08 ; 8 + 29a8: 80 93 b8 24 sts 0x24B8, r24 + 29ac: 08 95 ret -0000261c : +000029ae : } void MifareClassicAppInit4K(void) { State = STATE_IDLE; - 261c: 81 e0 ldi r24, 0x01 ; 1 - 261e: 80 93 b5 20 sts 0x20B5, r24 + 29ae: 81 e0 ldi r24, 0x01 ; 1 + 29b0: 80 93 b5 24 sts 0x24B5, r24 CardATQAValue = MFCLASSIC_4K_ATQA_VALUE; - 2622: 82 e0 ldi r24, 0x02 ; 2 - 2624: 90 e0 ldi r25, 0x00 ; 0 - 2626: 80 93 b6 20 sts 0x20B6, r24 - 262a: 90 93 b7 20 sts 0x20B7, r25 + 29b4: 82 e0 ldi r24, 0x02 ; 2 + 29b6: 90 e0 ldi r25, 0x00 ; 0 + 29b8: 80 93 b6 24 sts 0x24B6, r24 + 29bc: 90 93 b7 24 sts 0x24B7, r25 CardSAKValue = MFCLASSIC_4K_SAK_CL1_VALUE; - 262e: 88 e1 ldi r24, 0x18 ; 24 - 2630: 80 93 b8 20 sts 0x20B8, r24 - 2634: 08 95 ret + 29c0: 88 e1 ldi r24, 0x18 ; 24 + 29c2: 80 93 b8 24 sts 0x24B8, r24 + 29c6: 08 95 ret -00002636 : +000029c8 : } void MifareClassicAppReset(void) { State = STATE_IDLE; - 2636: 81 e0 ldi r24, 0x01 ; 1 - 2638: 80 93 b5 20 sts 0x20B5, r24 - 263c: 08 95 ret + 29c8: 81 e0 ldi r24, 0x01 ; 1 + 29ca: 80 93 b5 24 sts 0x24B5, r24 + 29ce: 08 95 ret -0000263e : +000029d0 : } void MifareClassicAppTask(void) { - 263e: 08 95 ret + 29d0: 08 95 ret -00002640 : +000029d2 : } uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) { - 2640: 6f 92 push r6 - 2642: 7f 92 push r7 - 2644: 8f 92 push r8 - 2646: 9f 92 push r9 - 2648: af 92 push r10 - 264a: bf 92 push r11 - 264c: cf 92 push r12 - 264e: df 92 push r13 - 2650: ef 92 push r14 - 2652: ff 92 push r15 - 2654: 0f 93 push r16 - 2656: 1f 93 push r17 - 2658: cf 93 push r28 - 265a: df 93 push r29 - 265c: cd b7 in r28, 0x3d ; 61 - 265e: de b7 in r29, 0x3e ; 62 - 2660: 2e 97 sbiw r28, 0x0e ; 14 - 2662: cd bf out 0x3d, r28 ; 61 - 2664: de bf out 0x3e, r29 ; 62 - 2666: 8c 01 movw r16, r24 + 29d2: 6f 92 push r6 + 29d4: 7f 92 push r7 + 29d6: 8f 92 push r8 + 29d8: 9f 92 push r9 + 29da: af 92 push r10 + 29dc: bf 92 push r11 + 29de: cf 92 push r12 + 29e0: df 92 push r13 + 29e2: ef 92 push r14 + 29e4: ff 92 push r15 + 29e6: 0f 93 push r16 + 29e8: 1f 93 push r17 + 29ea: cf 93 push r28 + 29ec: df 93 push r29 + 29ee: cd b7 in r28, 0x3d ; 61 + 29f0: de b7 in r29, 0x3e ; 62 + 29f2: 2e 97 sbiw r28, 0x0e ; 14 + 29f4: cd bf out 0x3d, r28 ; 61 + 29f6: de bf out 0x3e, r29 ; 62 + 29f8: 8c 01 movw r16, r24 switch(State) { - 2668: 80 91 b5 20 lds r24, 0x20B5 - 266c: 84 30 cpi r24, 0x04 ; 4 - 266e: 09 f4 brne .+2 ; 0x2672 - 2670: f4 c0 rjmp .+488 ; 0x285a - 2672: 08 f4 brcc .+2 ; 0x2676 - 2674: 3b c0 rjmp .+118 ; 0x26ec - 2676: 86 30 cpi r24, 0x06 ; 6 - 2678: 09 f4 brne .+2 ; 0x267c - 267a: bd c0 rjmp .+378 ; 0x27f6 - 267c: 08 f0 brcs .+2 ; 0x2680 - 267e: 60 c0 rjmp .+192 ; 0x2740 + 29fa: 80 91 b5 24 lds r24, 0x24B5 + 29fe: 84 30 cpi r24, 0x04 ; 4 + 2a00: 09 f4 brne .+2 ; 0x2a04 + 2a02: f4 c0 rjmp .+488 ; 0x2bec + 2a04: 08 f4 brcc .+2 ; 0x2a08 + 2a06: 3b c0 rjmp .+118 ; 0x2a7e + 2a08: 86 30 cpi r24, 0x06 ; 6 + 2a0a: 09 f4 brne .+2 ; 0x2a0e + 2a0c: bd c0 rjmp .+378 ; 0x2b88 + 2a0e: 08 f0 brcs .+2 ; 0x2a12 + 2a10: 60 c0 rjmp .+192 ; 0x2ad2 case STATE_AUTHED_IDLE: /* In this state, all communication is encrypted. Thus we first have to encrypt * the incoming data. */ for (uint8_t i=0; i<4; i++) Buffer[i] ^= Crypto1Byte(); - 2680: f8 01 movw r30, r16 - 2682: d0 80 ld r13, Z - 2684: 31 d7 rcall .+3682 ; 0x34e8 - 2686: 8d 25 eor r24, r13 - 2688: d8 01 movw r26, r16 - 268a: 8c 93 st X, r24 - 268c: 11 96 adiw r26, 0x01 ; 1 - 268e: dc 90 ld r13, X - 2690: 2b d7 rcall .+3670 ; 0x34e8 - 2692: 8d 25 eor r24, r13 - 2694: f8 01 movw r30, r16 - 2696: 81 83 std Z+1, r24 ; 0x01 - 2698: d2 80 ldd r13, Z+2 ; 0x02 - 269a: 26 d7 rcall .+3660 ; 0x34e8 - 269c: 8d 25 eor r24, r13 - 269e: d8 01 movw r26, r16 - 26a0: 12 96 adiw r26, 0x02 ; 2 - 26a2: 8c 93 st X, r24 - 26a4: 12 97 sbiw r26, 0x02 ; 2 - 26a6: 13 96 adiw r26, 0x03 ; 3 - 26a8: dc 90 ld r13, X - 26aa: 1e d7 rcall .+3644 ; 0x34e8 - 26ac: 8d 25 eor r24, r13 - 26ae: f8 01 movw r30, r16 - 26b0: 83 83 std Z+3, r24 ; 0x03 + 2a12: f8 01 movw r30, r16 + 2a14: d0 80 ld r13, Z + 2a16: 31 d7 rcall .+3682 ; 0x387a + 2a18: 8d 25 eor r24, r13 + 2a1a: d8 01 movw r26, r16 + 2a1c: 8c 93 st X, r24 + 2a1e: 11 96 adiw r26, 0x01 ; 1 + 2a20: dc 90 ld r13, X + 2a22: 2b d7 rcall .+3670 ; 0x387a + 2a24: 8d 25 eor r24, r13 + 2a26: f8 01 movw r30, r16 + 2a28: 81 83 std Z+1, r24 ; 0x01 + 2a2a: d2 80 ldd r13, Z+2 ; 0x02 + 2a2c: 26 d7 rcall .+3660 ; 0x387a + 2a2e: 8d 25 eor r24, r13 + 2a30: d8 01 movw r26, r16 + 2a32: 12 96 adiw r26, 0x02 ; 2 + 2a34: 8c 93 st X, r24 + 2a36: 12 97 sbiw r26, 0x02 ; 2 + 2a38: 13 96 adiw r26, 0x03 ; 3 + 2a3a: dc 90 ld r13, X + 2a3c: 1e d7 rcall .+3644 ; 0x387a + 2a3e: 8d 25 eor r24, r13 + 2a40: f8 01 movw r30, r16 + 2a42: 83 83 std Z+3, r24 ; 0x03 if (Buffer[0] == CMD_READ) { - 26b2: 80 81 ld r24, Z - 26b4: 80 33 cpi r24, 0x30 ; 48 - 26b6: 09 f4 brne .+2 ; 0x26ba - 26b8: ac c2 rjmp .+1368 ; 0x2c12 + 2a44: 80 81 ld r24, Z + 2a46: 80 33 cpi r24, 0x30 ; 48 + 2a48: 09 f4 brne .+2 ; 0x2a4c + 2a4a: ac c2 rjmp .+1368 ; 0x2fa4 * BITS_PER_BYTE) | ISO14443A_APP_CUSTOM_PARITY; } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); return ACK_NAK_FRAME_SIZE; } } else if (Buffer[0] == CMD_WRITE) { - 26ba: 80 3a cpi r24, 0xA0 ; 160 - 26bc: 09 f4 brne .+2 ; 0x26c0 - 26be: 1f c3 rjmp .+1598 ; 0x2cfe + 2a4c: 80 3a cpi r24, 0xA0 ; 160 + 2a4e: 09 f4 brne .+2 ; 0x2a52 + 2a50: 1f c3 rjmp .+1598 ; 0x3090 <__stack+0x91> Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_DECREMENT) { - 26c0: 80 3c cpi r24, 0xC0 ; 192 - 26c2: 09 f4 brne .+2 ; 0x26c6 - 26c4: 3a c3 rjmp .+1652 ; 0x2d3a + 2a52: 80 3c cpi r24, 0xC0 ; 192 + 2a54: 09 f4 brne .+2 ; 0x2a58 + 2a56: 3a c3 rjmp .+1652 ; 0x30cc <__stack+0xcd> Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_INCREMENT) { - 26c6: 81 3c cpi r24, 0xC1 ; 193 - 26c8: 09 f4 brne .+2 ; 0x26cc - 26ca: da c3 rjmp .+1972 ; 0x2e80 + 2a58: 81 3c cpi r24, 0xC1 ; 193 + 2a5a: 09 f4 brne .+2 ; 0x2a5e + 2a5c: da c3 rjmp .+1972 ; 0x3212 <__stack+0x213> Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_RESTORE) { - 26cc: 82 3c cpi r24, 0xC2 ; 194 - 26ce: 09 f4 brne .+2 ; 0x26d2 - 26d0: e7 c3 rjmp .+1998 ; 0x2ea0 + 2a5e: 82 3c cpi r24, 0xC2 ; 194 + 2a60: 09 f4 brne .+2 ; 0x2a64 + 2a62: e7 c3 rjmp .+1998 ; 0x3232 <__stack+0x233> Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; }else if (Buffer[0] == CMD_TRANSFER) { - 26d2: 80 3b cpi r24, 0xB0 ; 176 - 26d4: 09 f4 brne .+2 ; 0x26d8 - 26d6: f1 c3 rjmp .+2018 ; 0x2eba + 2a64: 80 3b cpi r24, 0xB0 ; 176 + 2a66: 09 f4 brne .+2 ; 0x2a6a + 2a68: f1 c3 rjmp .+2018 ; 0x324c <__stack+0x24d> } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { - 26d8: 80 56 subi r24, 0x60 ; 96 - 26da: 82 30 cpi r24, 0x02 ; 2 - 26dc: 08 f4 brcc .+2 ; 0x26e0 - 26de: 94 c1 rjmp .+808 ; 0x2a08 + 2a6a: 80 56 subi r24, 0x60 ; 96 + 2a6c: 82 30 cpi r24, 0x02 ; 2 + 2a6e: 08 f4 brcc .+2 ; 0x2a72 + 2a70: 94 c1 rjmp .+808 ; 0x2d9a Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); return ACK_NAK_FRAME_SIZE; } } else { /* Unknown command. Enter HALT state */ State = STATE_IDLE; - 26e0: 81 e0 ldi r24, 0x01 ; 1 - 26e2: 80 93 b5 20 sts 0x20B5, r24 + 2a72: 81 e0 ldi r24, 0x01 ; 1 + 2a74: 80 93 b5 24 sts 0x24B5, r24 /* Unknown state? Should never happen. */ break; } /* No response has been sent, when we reach here */ return ISO14443A_APP_NO_RESPONSE; - 26e6: 20 e0 ldi r18, 0x00 ; 0 - 26e8: 30 e0 ldi r19, 0x00 ; 0 + 2a78: 20 e0 ldi r18, 0x00 ; 0 + 2a7a: 30 e0 ldi r19, 0x00 ; 0 } else { /* Unknown command. Enter HALT state */ State = STATE_IDLE; } break; - 26ea: 63 c0 rjmp .+198 ; 0x27b2 + 2a7c: 63 c0 rjmp .+198 ; 0x2b44 } uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) { switch(State) { - 26ec: 82 30 cpi r24, 0x02 ; 2 - 26ee: 09 f4 brne .+2 ; 0x26f2 - 26f0: a0 c0 rjmp .+320 ; 0x2832 - 26f2: 08 f4 brcc .+2 ; 0x26f6 - 26f4: 71 c0 rjmp .+226 ; 0x27d8 + 2a7e: 82 30 cpi r24, 0x02 ; 2 + 2a80: 09 f4 brne .+2 ; 0x2a84 + 2a82: a0 c0 rjmp .+320 ; 0x2bc4 + 2a84: 08 f4 brcc .+2 ; 0x2a88 + 2a86: 71 c0 rjmp .+226 ; 0x2b6a INLINE bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) { uint8_t* DataPtr = (uint8_t*) Buffer; if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - 26f6: f8 01 movw r30, r16 - 26f8: 80 81 ld r24, Z - 26fa: 86 32 cpi r24, 0x26 ; 38 - 26fc: 09 f4 brne .+2 ; 0x2700 - 26fe: 6f c1 rjmp .+734 ; 0x29de - 2700: 82 35 cpi r24, 0x52 ; 82 - 2702: 09 f4 brne .+2 ; 0x2706 - 2704: 6c c1 rjmp .+728 ; 0x29de + 2a88: f8 01 movw r30, r16 + 2a8a: 80 81 ld r24, Z + 2a8c: 86 32 cpi r24, 0x26 ; 38 + 2a8e: 09 f4 brne .+2 ; 0x2a92 + 2a90: 6f c1 rjmp .+734 ; 0x2d70 + 2a92: 82 35 cpi r24, 0x52 ; 82 + 2a94: 09 f4 brne .+2 ; 0x2a98 + 2a96: 6c c1 rjmp .+728 ; 0x2d70 case STATE_ACTIVE: if (ISO14443AWakeUp(Buffer, &BitCount, MFCLASSIC_1K_ATQA_VALUE)) { State = STATE_READY; return BitCount; } else if (Buffer[0] == CMD_HALT) { - 2706: 80 35 cpi r24, 0x50 ; 80 - 2708: 09 f4 brne .+2 ; 0x270c - 270a: 74 c1 rjmp .+744 ; 0x29f4 + 2a98: 80 35 cpi r24, 0x50 ; 80 + 2a9a: 09 f4 brne .+2 ; 0x2a9e + 2a9c: 74 c1 rjmp .+744 ; 0x2d86 } } else { Buffer[0] = NAK_INVALID_ARG; return ACK_NAK_FRAME_SIZE; } } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { - 270c: 98 2f mov r25, r24 - 270e: 90 56 subi r25, 0x60 ; 96 - 2710: 92 30 cpi r25, 0x02 ; 2 - 2712: 08 f4 brcc .+2 ; 0x2716 - 2714: e6 c1 rjmp .+972 ; 0x2ae2 + 2a9e: 98 2f mov r25, r24 + 2aa0: 90 56 subi r25, 0x60 ; 96 + 2aa2: 92 30 cpi r25, 0x02 ; 2 + 2aa4: 08 f4 brcc .+2 ; 0x2aa8 + 2aa6: e6 c1 rjmp .+972 ; 0x2e74 return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; } else { Buffer[0] = NAK_CRC_ERROR; return ACK_NAK_FRAME_SIZE; } } else if ( (Buffer[0] == CMD_READ) || (Buffer[0] == CMD_WRITE) || (Buffer[0] == CMD_DECREMENT) - 2716: 80 33 cpi r24, 0x30 ; 48 - 2718: 51 f0 breq .+20 ; 0x272e - 271a: 80 3a cpi r24, 0xA0 ; 160 - 271c: 41 f0 breq .+16 ; 0x272e - 271e: 80 3c cpi r24, 0xC0 ; 192 - 2720: 31 f0 breq .+12 ; 0x272e + 2aa8: 80 33 cpi r24, 0x30 ; 48 + 2aaa: 51 f0 breq .+20 ; 0x2ac0 + 2aac: 80 3a cpi r24, 0xA0 ; 160 + 2aae: 41 f0 breq .+16 ; 0x2ac0 + 2ab0: 80 3c cpi r24, 0xC0 ; 192 + 2ab2: 31 f0 breq .+12 ; 0x2ac0 || (Buffer[0] == CMD_INCREMENT) || (Buffer[0] == CMD_RESTORE) || (Buffer[0] == CMD_TRANSFER) ) { - 2722: 81 3c cpi r24, 0xC1 ; 193 - 2724: 21 f0 breq .+8 ; 0x272e - 2726: 82 3c cpi r24, 0xC2 ; 194 - 2728: 11 f0 breq .+4 ; 0x272e - 272a: 80 3b cpi r24, 0xB0 ; 176 - 272c: c9 f6 brne .-78 ; 0x26e0 + 2ab4: 81 3c cpi r24, 0xC1 ; 193 + 2ab6: 21 f0 breq .+8 ; 0x2ac0 + 2ab8: 82 3c cpi r24, 0xC2 ; 194 + 2aba: 11 f0 breq .+4 ; 0x2ac0 + 2abc: 80 3b cpi r24, 0xB0 ; 176 + 2abe: c9 f6 brne .-78 ; 0x2a72 State = STATE_IDLE; - 272e: 81 e0 ldi r24, 0x01 ; 1 - 2730: 80 93 b5 20 sts 0x20B5, r24 + 2ac0: 81 e0 ldi r24, 0x01 ; 1 + 2ac2: 80 93 b5 24 sts 0x24B5, r24 Buffer[0] = NAK_NOT_AUTHED; - 2734: 84 e0 ldi r24, 0x04 ; 4 - 2736: f8 01 movw r30, r16 - 2738: 80 83 st Z, r24 + 2ac6: 84 e0 ldi r24, 0x04 ; 4 + 2ac8: f8 01 movw r30, r16 + 2aca: 80 83 st Z, r24 return ACK_NAK_FRAME_SIZE; - 273a: 24 e0 ldi r18, 0x04 ; 4 - 273c: 30 e0 ldi r19, 0x00 ; 0 - 273e: 39 c0 rjmp .+114 ; 0x27b2 + 2acc: 24 e0 ldi r18, 0x04 ; 4 + 2ace: 30 e0 ldi r19, 0x00 ; 0 + 2ad0: 39 c0 rjmp .+114 ; 0x2b44 } uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) { switch(State) { - 2740: 8a 30 cpi r24, 0x0A ; 10 - 2742: 08 f0 brcs .+2 ; 0x2746 - 2744: 55 c0 rjmp .+170 ; 0x27f0 + 2ad2: 8a 30 cpi r24, 0x0A ; 10 + 2ad4: 08 f0 brcs .+2 ; 0x2ad8 + 2ad6: 55 c0 rjmp .+170 ; 0x2b82 * decrypt the data and check CRC. Read data from the requested block * address into the global block buffer and check for integrity. Then * add or subtract according to issued command if necessary and store * the block back into the global block buffer. */ for (uint8_t i=0; i<(MEM_VALUE_SIZE + ISO14443A_CRCA_SIZE); i++) Buffer[i] ^= Crypto1Byte(); - 2746: d8 01 movw r26, r16 - 2748: fc 90 ld r15, X - 274a: ce d6 rcall .+3484 ; 0x34e8 - 274c: 8f 25 eor r24, r15 - 274e: f8 01 movw r30, r16 - 2750: 80 83 st Z, r24 - 2752: f1 80 ldd r15, Z+1 ; 0x01 - 2754: c9 d6 rcall .+3474 ; 0x34e8 - 2756: 8f 25 eor r24, r15 - 2758: d8 01 movw r26, r16 - 275a: 11 96 adiw r26, 0x01 ; 1 - 275c: 8c 93 st X, r24 - 275e: 11 97 sbiw r26, 0x01 ; 1 - 2760: 12 96 adiw r26, 0x02 ; 2 - 2762: fc 90 ld r15, X - 2764: c1 d6 rcall .+3458 ; 0x34e8 - 2766: 8f 25 eor r24, r15 - 2768: f8 01 movw r30, r16 - 276a: 82 83 std Z+2, r24 ; 0x02 - 276c: f3 80 ldd r15, Z+3 ; 0x03 - 276e: bc d6 rcall .+3448 ; 0x34e8 - 2770: 8f 25 eor r24, r15 - 2772: d8 01 movw r26, r16 - 2774: 13 96 adiw r26, 0x03 ; 3 - 2776: 8c 93 st X, r24 - 2778: 13 97 sbiw r26, 0x03 ; 3 - 277a: 14 96 adiw r26, 0x04 ; 4 - 277c: fc 90 ld r15, X - 277e: b4 d6 rcall .+3432 ; 0x34e8 - 2780: 8f 25 eor r24, r15 - 2782: f8 01 movw r30, r16 - 2784: 84 83 std Z+4, r24 ; 0x04 - 2786: f5 80 ldd r15, Z+5 ; 0x05 - 2788: af d6 rcall .+3422 ; 0x34e8 - 278a: 8f 25 eor r24, r15 - 278c: d8 01 movw r26, r16 - 278e: 15 96 adiw r26, 0x05 ; 5 - 2790: 8c 93 st X, r24 + 2ad8: d8 01 movw r26, r16 + 2ada: fc 90 ld r15, X + 2adc: ce d6 rcall .+3484 ; 0x387a + 2ade: 8f 25 eor r24, r15 + 2ae0: f8 01 movw r30, r16 + 2ae2: 80 83 st Z, r24 + 2ae4: f1 80 ldd r15, Z+1 ; 0x01 + 2ae6: c9 d6 rcall .+3474 ; 0x387a + 2ae8: 8f 25 eor r24, r15 + 2aea: d8 01 movw r26, r16 + 2aec: 11 96 adiw r26, 0x01 ; 1 + 2aee: 8c 93 st X, r24 + 2af0: 11 97 sbiw r26, 0x01 ; 1 + 2af2: 12 96 adiw r26, 0x02 ; 2 + 2af4: fc 90 ld r15, X + 2af6: c1 d6 rcall .+3458 ; 0x387a + 2af8: 8f 25 eor r24, r15 + 2afa: f8 01 movw r30, r16 + 2afc: 82 83 std Z+2, r24 ; 0x02 + 2afe: f3 80 ldd r15, Z+3 ; 0x03 + 2b00: bc d6 rcall .+3448 ; 0x387a + 2b02: 8f 25 eor r24, r15 + 2b04: d8 01 movw r26, r16 + 2b06: 13 96 adiw r26, 0x03 ; 3 + 2b08: 8c 93 st X, r24 + 2b0a: 13 97 sbiw r26, 0x03 ; 3 + 2b0c: 14 96 adiw r26, 0x04 ; 4 + 2b0e: fc 90 ld r15, X + 2b10: b4 d6 rcall .+3432 ; 0x387a + 2b12: 8f 25 eor r24, r15 + 2b14: f8 01 movw r30, r16 + 2b16: 84 83 std Z+4, r24 ; 0x04 + 2b18: f5 80 ldd r15, Z+5 ; 0x05 + 2b1a: af d6 rcall .+3422 ; 0x387a + 2b1c: 8f 25 eor r24, r15 + 2b1e: d8 01 movw r26, r16 + 2b20: 15 96 adiw r26, 0x05 ; 5 + 2b22: 8c 93 st X, r24 if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { - 2792: 64 e0 ldi r22, 0x04 ; 4 - 2794: 70 e0 ldi r23, 0x00 ; 0 - 2796: c8 01 movw r24, r16 - 2798: 25 d4 rcall .+2122 ; 0x2fe4 - 279a: 81 11 cpse r24, r1 - 279c: 0c c2 rjmp .+1048 ; 0x2bb6 + 2b24: 64 e0 ldi r22, 0x04 ; 4 + 2b26: 70 e0 ldi r23, 0x00 ; 0 + 2b28: c8 01 movw r24, r16 + 2b2a: 25 d4 rcall .+2122 ; 0x3376 + 2b2c: 81 11 cpse r24, r1 + 2b2e: 0c c2 rjmp .+1048 ; 0x2f48 /* Not sure if this is the correct error code.. */ Buffer[0] = NAK_OTHER_ERROR ^ Crypto1Nibble(); } } else { /* CRC Error. */ Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 279e: e5 d6 rcall .+3530 ; 0x356a - 27a0: 91 e0 ldi r25, 0x01 ; 1 - 27a2: 98 27 eor r25, r24 - 27a4: f8 01 movw r30, r16 - 27a6: 90 83 st Z, r25 + 2b30: e5 d6 rcall .+3530 ; 0x38fc + 2b32: 91 e0 ldi r25, 0x01 ; 1 + 2b34: 98 27 eor r25, r24 + 2b36: f8 01 movw r30, r16 + 2b38: 90 83 st Z, r25 } State = STATE_AUTHED_IDLE; - 27a8: 85 e0 ldi r24, 0x05 ; 5 - 27aa: 80 93 b5 20 sts 0x20B5, r24 + 2b3a: 85 e0 ldi r24, 0x05 ; 5 + 2b3c: 80 93 b5 24 sts 0x24B5, r24 return ACK_NAK_FRAME_SIZE; - 27ae: 24 e0 ldi r18, 0x04 ; 4 - 27b0: 30 e0 ldi r19, 0x00 ; 0 + 2b40: 24 e0 ldi r18, 0x04 ; 4 + 2b42: 30 e0 ldi r19, 0x00 ; 0 break; } /* No response has been sent, when we reach here */ return ISO14443A_APP_NO_RESPONSE; } - 27b2: c9 01 movw r24, r18 - 27b4: 2e 96 adiw r28, 0x0e ; 14 - 27b6: cd bf out 0x3d, r28 ; 61 - 27b8: de bf out 0x3e, r29 ; 62 - 27ba: df 91 pop r29 - 27bc: cf 91 pop r28 - 27be: 1f 91 pop r17 - 27c0: 0f 91 pop r16 - 27c2: ff 90 pop r15 - 27c4: ef 90 pop r14 - 27c6: df 90 pop r13 - 27c8: cf 90 pop r12 - 27ca: bf 90 pop r11 - 27cc: af 90 pop r10 - 27ce: 9f 90 pop r9 - 27d0: 8f 90 pop r8 - 27d2: 7f 90 pop r7 - 27d4: 6f 90 pop r6 - 27d6: 08 95 ret + 2b44: c9 01 movw r24, r18 + 2b46: 2e 96 adiw r28, 0x0e ; 14 + 2b48: cd bf out 0x3d, r28 ; 61 + 2b4a: de bf out 0x3e, r29 ; 62 + 2b4c: df 91 pop r29 + 2b4e: cf 91 pop r28 + 2b50: 1f 91 pop r17 + 2b52: 0f 91 pop r16 + 2b54: ff 90 pop r15 + 2b56: ef 90 pop r14 + 2b58: df 90 pop r13 + 2b5a: cf 90 pop r12 + 2b5c: bf 90 pop r11 + 2b5e: af 90 pop r10 + 2b60: 9f 90 pop r9 + 2b62: 8f 90 pop r8 + 2b64: 7f 90 pop r7 + 2b66: 6f 90 pop r6 + 2b68: 08 95 ret uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) { switch(State) { case STATE_IDLE: case STATE_HALT: if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - 27d8: 20 91 b6 20 lds r18, 0x20B6 - 27dc: 90 91 b7 20 lds r25, 0x20B7 - 27e0: d8 01 movw r26, r16 - 27e2: 8c 91 ld r24, X - 27e4: 86 32 cpi r24, 0x26 ; 38 - 27e6: 09 f4 brne .+2 ; 0x27ea - 27e8: f1 c0 rjmp .+482 ; 0x29cc - 27ea: 82 35 cpi r24, 0x52 ; 82 - 27ec: 09 f4 brne .+2 ; 0x27f0 - 27ee: ee c0 rjmp .+476 ; 0x29cc + 2b6a: 20 91 b6 24 lds r18, 0x24B6 + 2b6e: 90 91 b7 24 lds r25, 0x24B7 + 2b72: d8 01 movw r26, r16 + 2b74: 8c 91 ld r24, X + 2b76: 86 32 cpi r24, 0x26 ; 38 + 2b78: 09 f4 brne .+2 ; 0x2b7c + 2b7a: f1 c0 rjmp .+482 ; 0x2d5e + 2b7c: 82 35 cpi r24, 0x52 ; 82 + 2b7e: 09 f4 brne .+2 ; 0x2b82 + 2b80: ee c0 rjmp .+476 ; 0x2d5e *BitCount = ISO14443A_SAK_FRAME_SIZE; return true; } else { /* We have not been selected. Don't send anything. */ *BitCount = 0; - 27f0: 20 e0 ldi r18, 0x00 ; 0 - 27f2: 30 e0 ldi r19, 0x00 ; 0 - 27f4: de cf rjmp .-68 ; 0x27b2 - 27f6: 78 01 movw r14, r16 + 2b82: 20 e0 ldi r18, 0x00 ; 0 + 2b84: 30 e0 ldi r19, 0x00 ; 0 + 2b86: de cf rjmp .-68 ; 0x2b44 + 2b88: 78 01 movw r14, r16 } uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) { switch(State) { - 27f8: 52 e1 ldi r21, 0x12 ; 18 - 27fa: d5 2e mov r13, r21 + 2b8a: 52 e1 ldi r21, 0x12 ; 18 + 2b8c: d5 2e mov r13, r21 * check for CRC. Then write the data when ReadOnly mode is not * activated. */ /* We receive 16 bytes of data to be written and 2 bytes CRCA. Decrypt */ for (uint8_t i=0; i<(MEM_BYTES_PER_BLOCK + ISO14443A_CRCA_SIZE); i++) Buffer[i] ^= Crypto1Byte(); - 27fc: d7 01 movw r26, r14 - 27fe: cc 90 ld r12, X - 2800: 73 d6 rcall .+3302 ; 0x34e8 - 2802: 8c 25 eor r24, r12 - 2804: f7 01 movw r30, r14 - 2806: 81 93 st Z+, r24 - 2808: 7f 01 movw r14, r30 - 280a: da 94 dec r13 + 2b8e: d7 01 movw r26, r14 + 2b90: cc 90 ld r12, X + 2b92: 73 d6 rcall .+3302 ; 0x387a + 2b94: 8c 25 eor r24, r12 + 2b96: f7 01 movw r30, r14 + 2b98: 81 93 st Z+, r24 + 2b9a: 7f 01 movw r14, r30 + 2b9c: da 94 dec r13 * sending the data to be written. Decrypt the data first and * check for CRC. Then write the data when ReadOnly mode is not * activated. */ /* We receive 16 bytes of data to be written and 2 bytes CRCA. Decrypt */ for (uint8_t i=0; i<(MEM_BYTES_PER_BLOCK + ISO14443A_CRCA_SIZE); i++) - 280c: b9 f7 brne .-18 ; 0x27fc + 2b9e: b9 f7 brne .-18 ; 0x2b8e Buffer[i] ^= Crypto1Byte(); if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { - 280e: 60 e1 ldi r22, 0x10 ; 16 - 2810: 70 e0 ldi r23, 0x00 ; 0 - 2812: c8 01 movw r24, r16 - 2814: e7 d3 rcall .+1998 ; 0x2fe4 - 2816: 88 23 and r24, r24 - 2818: 09 f4 brne .+2 ; 0x281c - 281a: c1 cf rjmp .-126 ; 0x279e + 2ba0: 60 e1 ldi r22, 0x10 ; 16 + 2ba2: 70 e0 ldi r23, 0x00 ; 0 + 2ba4: c8 01 movw r24, r16 + 2ba6: e7 d3 rcall .+1998 ; 0x3376 + 2ba8: 88 23 and r24, r24 + 2baa: 09 f4 brne .+2 ; 0x2bae + 2bac: c1 cf rjmp .-126 ; 0x2b30 if (!ActiveConfiguration.ReadOnly) { - 281c: 80 91 fc 20 lds r24, 0x20FC - 2820: 88 23 and r24, r24 - 2822: 09 f4 brne .+2 ; 0x2826 - 2824: e2 c1 rjmp .+964 ; 0x2bea + 2bae: 80 91 fc 24 lds r24, 0x24FC + 2bb2: 88 23 and r24, r24 + 2bb4: 09 f4 brne .+2 ; 0x2bb8 + 2bb6: e2 c1 rjmp .+964 ; 0x2f7c MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); } else { /* Silently ignore in ReadOnly mode */ } Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2826: a1 d6 rcall .+3394 ; 0x356a - 2828: 9a e0 ldi r25, 0x0A ; 10 - 282a: 98 27 eor r25, r24 - 282c: d8 01 movw r26, r16 - 282e: 9c 93 st X, r25 - 2830: bb cf rjmp .-138 ; 0x27a8 + 2bb8: a1 d6 rcall .+3394 ; 0x38fc + 2bba: 9a e0 ldi r25, 0x0A ; 10 + 2bbc: 98 27 eor r25, r24 + 2bbe: d8 01 movw r26, r16 + 2bc0: 9c 93 st X, r25 + 2bc2: bb cf rjmp .-138 ; 0x2b3a return BitCount; } break; case STATE_READY: if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - 2832: 20 91 b6 20 lds r18, 0x20B6 - 2836: 90 91 b7 20 lds r25, 0x20B7 + 2bc4: 20 91 b6 24 lds r18, 0x24B6 + 2bc8: 90 91 b7 24 lds r25, 0x24B7 INLINE bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) { uint8_t* DataPtr = (uint8_t*) Buffer; if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - 283a: d8 01 movw r26, r16 - 283c: 8c 91 ld r24, X - 283e: 86 32 cpi r24, 0x26 ; 38 - 2840: 09 f4 brne .+2 ; 0x2844 - 2842: c4 c0 rjmp .+392 ; 0x29cc - 2844: 82 35 cpi r24, 0x52 ; 82 - 2846: 09 f4 brne .+2 ; 0x284a - 2848: c1 c0 rjmp .+386 ; 0x29cc + 2bcc: d8 01 movw r26, r16 + 2bce: 8c 91 ld r24, X + 2bd0: 86 32 cpi r24, 0x26 ; 38 + 2bd2: 09 f4 brne .+2 ; 0x2bd6 + 2bd4: c4 c0 rjmp .+392 ; 0x2d5e + 2bd6: 82 35 cpi r24, 0x52 ; 82 + 2bd8: 09 f4 brne .+2 ; 0x2bdc + 2bda: c1 c0 rjmp .+386 ; 0x2d5e State = STATE_READY; return BitCount; } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { - 284a: 83 39 cpi r24, 0x93 ; 147 - 284c: 09 f4 brne .+2 ; 0x2850 - 284e: 20 c2 rjmp .+1088 ; 0x2c90 + 2bdc: 83 39 cpi r24, 0x93 ; 147 + 2bde: 09 f4 brne .+2 ; 0x2be2 + 2be0: 20 c2 rjmp .+1088 ; 0x3022 <__stack+0x23> * byte is supposed to be 0. */ if (Buffer[1] == 0) { if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { /* According to ISO14443, we must not send anything * in order to acknowledge the HALT command. */ State = STATE_HALT; - 2850: 10 92 b5 20 sts 0x20B5, r1 + 2be2: 10 92 b5 24 sts 0x24B5, r1 return ISO14443A_APP_NO_RESPONSE; - 2854: 20 e0 ldi r18, 0x00 ; 0 - 2856: 30 e0 ldi r19, 0x00 ; 0 - 2858: ac cf rjmp .-168 ; 0x27b2 + 2be6: 20 e0 ldi r18, 0x00 ; 0 + 2be8: 30 e0 ldi r19, 0x00 ; 0 + 2bea: ac cf rjmp .-168 ; 0x2b44 case STATE_AUTHING: /* Reader delivers an encrypted nonce. We use it * to setup the crypto1 LFSR in nonlinear feedback mode. * Furthermore it delivers an encrypted answer. Decrypt and check it */ Crypto1Auth(&Buffer[0]); - 285a: c8 01 movw r24, r16 - 285c: 1c d6 rcall .+3128 ; 0x3496 + 2bec: c8 01 movw r24, r16 + 2bee: 1c d6 rcall .+3128 ; 0x3828 for (uint8_t i=0; i<4; i++) Buffer[i+4] ^= Crypto1Byte(); - 285e: d8 01 movw r26, r16 - 2860: 14 96 adiw r26, 0x04 ; 4 - 2862: fc 90 ld r15, X - 2864: 41 d6 rcall .+3202 ; 0x34e8 - 2866: 8f 25 eor r24, r15 - 2868: f8 01 movw r30, r16 - 286a: 84 83 std Z+4, r24 ; 0x04 - 286c: f5 80 ldd r15, Z+5 ; 0x05 - 286e: 3c d6 rcall .+3192 ; 0x34e8 - 2870: 8f 25 eor r24, r15 - 2872: d8 01 movw r26, r16 - 2874: 15 96 adiw r26, 0x05 ; 5 - 2876: 8c 93 st X, r24 - 2878: 15 97 sbiw r26, 0x05 ; 5 - 287a: 16 96 adiw r26, 0x06 ; 6 - 287c: fc 90 ld r15, X - 287e: 34 d6 rcall .+3176 ; 0x34e8 - 2880: 8f 25 eor r24, r15 - 2882: f8 01 movw r30, r16 - 2884: 86 83 std Z+6, r24 ; 0x06 - 2886: f7 80 ldd r15, Z+7 ; 0x07 - 2888: 2f d6 rcall .+3166 ; 0x34e8 - 288a: 8f 25 eor r24, r15 - 288c: d8 01 movw r26, r16 - 288e: 17 96 adiw r26, 0x07 ; 7 - 2890: 8c 93 st X, r24 - 2892: 17 97 sbiw r26, 0x07 ; 7 + 2bf0: d8 01 movw r26, r16 + 2bf2: 14 96 adiw r26, 0x04 ; 4 + 2bf4: fc 90 ld r15, X + 2bf6: 41 d6 rcall .+3202 ; 0x387a + 2bf8: 8f 25 eor r24, r15 + 2bfa: f8 01 movw r30, r16 + 2bfc: 84 83 std Z+4, r24 ; 0x04 + 2bfe: f5 80 ldd r15, Z+5 ; 0x05 + 2c00: 3c d6 rcall .+3192 ; 0x387a + 2c02: 8f 25 eor r24, r15 + 2c04: d8 01 movw r26, r16 + 2c06: 15 96 adiw r26, 0x05 ; 5 + 2c08: 8c 93 st X, r24 + 2c0a: 15 97 sbiw r26, 0x05 ; 5 + 2c0c: 16 96 adiw r26, 0x06 ; 6 + 2c0e: fc 90 ld r15, X + 2c10: 34 d6 rcall .+3176 ; 0x387a + 2c12: 8f 25 eor r24, r15 + 2c14: f8 01 movw r30, r16 + 2c16: 86 83 std Z+6, r24 ; 0x06 + 2c18: f7 80 ldd r15, Z+7 ; 0x07 + 2c1a: 2f d6 rcall .+3166 ; 0x387a + 2c1c: 8f 25 eor r24, r15 + 2c1e: d8 01 movw r26, r16 + 2c20: 17 96 adiw r26, 0x07 ; 7 + 2c22: 8c 93 st X, r24 + 2c24: 17 97 sbiw r26, 0x07 ; 7 if ((Buffer[4] == ReaderResponse[0]) && - 2894: 14 96 adiw r26, 0x04 ; 4 - 2896: 2c 91 ld r18, X - 2898: 14 97 sbiw r26, 0x04 ; 4 - 289a: 90 91 b9 20 lds r25, 0x20B9 - 289e: 29 13 cpse r18, r25 - 28a0: 1f cf rjmp .-450 ; 0x26e0 - 28a2: 15 96 adiw r26, 0x05 ; 5 - 28a4: 2c 91 ld r18, X - 28a6: 15 97 sbiw r26, 0x05 ; 5 - 28a8: 90 91 ba 20 lds r25, 0x20BA - 28ac: 29 13 cpse r18, r25 - 28ae: 18 cf rjmp .-464 ; 0x26e0 + 2c26: 14 96 adiw r26, 0x04 ; 4 + 2c28: 2c 91 ld r18, X + 2c2a: 14 97 sbiw r26, 0x04 ; 4 + 2c2c: 90 91 b9 24 lds r25, 0x24B9 + 2c30: 29 13 cpse r18, r25 + 2c32: 1f cf rjmp .-450 ; 0x2a72 + 2c34: 15 96 adiw r26, 0x05 ; 5 + 2c36: 2c 91 ld r18, X + 2c38: 15 97 sbiw r26, 0x05 ; 5 + 2c3a: 90 91 ba 24 lds r25, 0x24BA + 2c3e: 29 13 cpse r18, r25 + 2c40: 18 cf rjmp .-464 ; 0x2a72 (Buffer[5] == ReaderResponse[1]) && - 28b0: 16 96 adiw r26, 0x06 ; 6 - 28b2: 2c 91 ld r18, X - 28b4: 90 91 bb 20 lds r25, 0x20BB - 28b8: 29 13 cpse r18, r25 - 28ba: 12 cf rjmp .-476 ; 0x26e0 + 2c42: 16 96 adiw r26, 0x06 ; 6 + 2c44: 2c 91 ld r18, X + 2c46: 90 91 bb 24 lds r25, 0x24BB + 2c4a: 29 13 cpse r18, r25 + 2c4c: 12 cf rjmp .-476 ; 0x2a72 (Buffer[6] == ReaderResponse[2]) && - 28bc: 90 91 bc 20 lds r25, 0x20BC - 28c0: 89 13 cpse r24, r25 - 28c2: 0e cf rjmp .-484 ; 0x26e0 + 2c4e: 90 91 bc 24 lds r25, 0x24BC + 2c52: 89 13 cpse r24, r25 + 2c54: 0e cf rjmp .-484 ; 0x2a72 (Buffer[7] == ReaderResponse[3])) { /* Reader is authenticated. Encrypt the precalculated card response * and generate the parity bits. */ for (uint8_t i=0; i - 28ca: 8f 25 eor r24, r15 - 28cc: f8 01 movw r30, r16 - 28ce: 80 83 st Z, r24 + 2c56: f0 90 bd 24 lds r15, 0x24BD + 2c5a: 0f d6 rcall .+3102 ; 0x387a + 2c5c: 8f 25 eor r24, r15 + 2c5e: f8 01 movw r30, r16 + 2c60: 80 83 st Z, r24 Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - 28d0: f0 90 bd 20 lds r15, 0x20BD - 28d4: 0f 2c mov r0, r15 - 28d6: f2 94 swap r15 - 28d8: f0 24 eor r15, r0 - 28da: 0f 2c mov r0, r15 - 28dc: f6 94 lsr r15 - 28de: f6 94 lsr r15 - 28e0: f0 24 eor r15, r0 - 28e2: 05 d4 rcall .+2058 ; 0x30ee - 28e4: f8 01 movw r30, r16 - 28e6: e0 58 subi r30, 0x80 ; 128 - 28e8: ff 4f sbci r31, 0xFF ; 255 - 28ea: 2f 2d mov r18, r15 - 28ec: 30 e0 ldi r19, 0x00 ; 0 - 28ee: 2f 5f subi r18, 0xFF ; 255 - 28f0: 3f 4f sbci r19, 0xFF ; 255 - 28f2: 21 fb bst r18, 1 - 28f4: 88 24 eor r8, r8 - 28f6: 80 f8 bld r8, 0 - 28f8: 91 2c mov r9, r1 - 28fa: 31 e0 ldi r19, 0x01 ; 1 - 28fc: 83 26 eor r8, r19 - 28fe: 88 25 eor r24, r8 - 2900: 80 83 st Z, r24 + 2c62: f0 90 bd 24 lds r15, 0x24BD + 2c66: 0f 2c mov r0, r15 + 2c68: f2 94 swap r15 + 2c6a: f0 24 eor r15, r0 + 2c6c: 0f 2c mov r0, r15 + 2c6e: f6 94 lsr r15 + 2c70: f6 94 lsr r15 + 2c72: f0 24 eor r15, r0 + 2c74: 05 d4 rcall .+2058 ; 0x3480 + 2c76: f8 01 movw r30, r16 + 2c78: e0 58 subi r30, 0x80 ; 128 + 2c7a: ff 4f sbci r31, 0xFF ; 255 + 2c7c: 2f 2d mov r18, r15 + 2c7e: 30 e0 ldi r19, 0x00 ; 0 + 2c80: 2f 5f subi r18, 0xFF ; 255 + 2c82: 3f 4f sbci r19, 0xFF ; 255 + 2c84: 21 fb bst r18, 1 + 2c86: 88 24 eor r8, r8 + 2c88: 80 f8 bld r8, 0 + 2c8a: 91 2c mov r9, r1 + 2c8c: 31 e0 ldi r19, 0x01 ; 1 + 2c8e: 83 26 eor r8, r19 + 2c90: 88 25 eor r24, r8 + 2c92: 80 83 st Z, r24 (Buffer[6] == ReaderResponse[2]) && (Buffer[7] == ReaderResponse[3])) { /* Reader is authenticated. Encrypt the precalculated card response * and generate the parity bits. */ for (uint8_t i=0; i - 2908: 8f 25 eor r24, r15 - 290a: d8 01 movw r26, r16 - 290c: 11 96 adiw r26, 0x01 ; 1 - 290e: 8c 93 st X, r24 + 2c94: f0 90 be 24 lds r15, 0x24BE + 2c98: f0 d5 rcall .+3040 ; 0x387a + 2c9a: 8f 25 eor r24, r15 + 2c9c: d8 01 movw r26, r16 + 2c9e: 11 96 adiw r26, 0x01 ; 1 + 2ca0: 8c 93 st X, r24 Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - 2910: f0 90 be 20 lds r15, 0x20BE - 2914: 0f 2c mov r0, r15 - 2916: f2 94 swap r15 - 2918: f0 24 eor r15, r0 - 291a: 0f 2c mov r0, r15 - 291c: f6 94 lsr r15 - 291e: f6 94 lsr r15 - 2920: f0 24 eor r15, r0 - 2922: e5 d3 rcall .+1994 ; 0x30ee - 2924: f8 01 movw r30, r16 - 2926: ef 57 subi r30, 0x7F ; 127 - 2928: ff 4f sbci r31, 0xFF ; 255 - 292a: 2f 2d mov r18, r15 - 292c: 30 e0 ldi r19, 0x00 ; 0 - 292e: 2f 5f subi r18, 0xFF ; 255 - 2930: 3f 4f sbci r19, 0xFF ; 255 - 2932: 21 fb bst r18, 1 - 2934: aa 24 eor r10, r10 - 2936: a0 f8 bld r10, 0 - 2938: b1 2c mov r11, r1 - 293a: b1 e0 ldi r27, 0x01 ; 1 - 293c: ab 26 eor r10, r27 - 293e: 8a 25 eor r24, r10 - 2940: 80 83 st Z, r24 + 2ca2: f0 90 be 24 lds r15, 0x24BE + 2ca6: 0f 2c mov r0, r15 + 2ca8: f2 94 swap r15 + 2caa: f0 24 eor r15, r0 + 2cac: 0f 2c mov r0, r15 + 2cae: f6 94 lsr r15 + 2cb0: f6 94 lsr r15 + 2cb2: f0 24 eor r15, r0 + 2cb4: e5 d3 rcall .+1994 ; 0x3480 + 2cb6: f8 01 movw r30, r16 + 2cb8: ef 57 subi r30, 0x7F ; 127 + 2cba: ff 4f sbci r31, 0xFF ; 255 + 2cbc: 2f 2d mov r18, r15 + 2cbe: 30 e0 ldi r19, 0x00 ; 0 + 2cc0: 2f 5f subi r18, 0xFF ; 255 + 2cc2: 3f 4f sbci r19, 0xFF ; 255 + 2cc4: 21 fb bst r18, 1 + 2cc6: aa 24 eor r10, r10 + 2cc8: a0 f8 bld r10, 0 + 2cca: b1 2c mov r11, r1 + 2ccc: b1 e0 ldi r27, 0x01 ; 1 + 2cce: ab 26 eor r10, r27 + 2cd0: 8a 25 eor r24, r10 + 2cd2: 80 83 st Z, r24 (Buffer[6] == ReaderResponse[2]) && (Buffer[7] == ReaderResponse[3])) { /* Reader is authenticated. Encrypt the precalculated card response * and generate the parity bits. */ for (uint8_t i=0; i - 2948: 8f 25 eor r24, r15 - 294a: f8 01 movw r30, r16 - 294c: 82 83 std Z+2, r24 ; 0x02 + 2cd4: f0 90 bf 24 lds r15, 0x24BF + 2cd8: d0 d5 rcall .+2976 ; 0x387a + 2cda: 8f 25 eor r24, r15 + 2cdc: f8 01 movw r30, r16 + 2cde: 82 83 std Z+2, r24 ; 0x02 Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - 294e: f0 90 bf 20 lds r15, 0x20BF - 2952: 0f 2c mov r0, r15 - 2954: f2 94 swap r15 - 2956: f0 24 eor r15, r0 - 2958: 0f 2c mov r0, r15 - 295a: f6 94 lsr r15 - 295c: f6 94 lsr r15 - 295e: f0 24 eor r15, r0 - 2960: c6 d3 rcall .+1932 ; 0x30ee - 2962: f8 01 movw r30, r16 - 2964: ee 57 subi r30, 0x7E ; 126 - 2966: ff 4f sbci r31, 0xFF ; 255 - 2968: 2f 2d mov r18, r15 - 296a: 30 e0 ldi r19, 0x00 ; 0 - 296c: 2f 5f subi r18, 0xFF ; 255 - 296e: 3f 4f sbci r19, 0xFF ; 255 - 2970: 21 fb bst r18, 1 - 2972: cc 24 eor r12, r12 - 2974: c0 f8 bld r12, 0 - 2976: d1 2c mov r13, r1 - 2978: 31 e0 ldi r19, 0x01 ; 1 - 297a: c3 26 eor r12, r19 - 297c: 8c 25 eor r24, r12 - 297e: 80 83 st Z, r24 + 2ce0: f0 90 bf 24 lds r15, 0x24BF + 2ce4: 0f 2c mov r0, r15 + 2ce6: f2 94 swap r15 + 2ce8: f0 24 eor r15, r0 + 2cea: 0f 2c mov r0, r15 + 2cec: f6 94 lsr r15 + 2cee: f6 94 lsr r15 + 2cf0: f0 24 eor r15, r0 + 2cf2: c6 d3 rcall .+1932 ; 0x3480 + 2cf4: f8 01 movw r30, r16 + 2cf6: ee 57 subi r30, 0x7E ; 126 + 2cf8: ff 4f sbci r31, 0xFF ; 255 + 2cfa: 2f 2d mov r18, r15 + 2cfc: 30 e0 ldi r19, 0x00 ; 0 + 2cfe: 2f 5f subi r18, 0xFF ; 255 + 2d00: 3f 4f sbci r19, 0xFF ; 255 + 2d02: 21 fb bst r18, 1 + 2d04: cc 24 eor r12, r12 + 2d06: c0 f8 bld r12, 0 + 2d08: d1 2c mov r13, r1 + 2d0a: 31 e0 ldi r19, 0x01 ; 1 + 2d0c: c3 26 eor r12, r19 + 2d0e: 8c 25 eor r24, r12 + 2d10: 80 83 st Z, r24 (Buffer[6] == ReaderResponse[2]) && (Buffer[7] == ReaderResponse[3])) { /* Reader is authenticated. Encrypt the precalculated card response * and generate the parity bits. */ for (uint8_t i=0; i - 2986: 8f 25 eor r24, r15 - 2988: d8 01 movw r26, r16 - 298a: 13 96 adiw r26, 0x03 ; 3 - 298c: 8c 93 st X, r24 + 2d12: f0 90 c0 24 lds r15, 0x24C0 + 2d16: b1 d5 rcall .+2914 ; 0x387a + 2d18: 8f 25 eor r24, r15 + 2d1a: d8 01 movw r26, r16 + 2d1c: 13 96 adiw r26, 0x03 ; 3 + 2d1e: 8c 93 st X, r24 Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - 298e: f0 90 c0 20 lds r15, 0x20C0 - 2992: 0f 2c mov r0, r15 - 2994: f2 94 swap r15 - 2996: f0 24 eor r15, r0 - 2998: 0f 2c mov r0, r15 - 299a: f6 94 lsr r15 - 299c: f6 94 lsr r15 - 299e: f0 24 eor r15, r0 - 29a0: a6 d3 rcall .+1868 ; 0x30ee - 29a2: f8 01 movw r30, r16 - 29a4: ed 57 subi r30, 0x7D ; 125 - 29a6: ff 4f sbci r31, 0xFF ; 255 - 29a8: 2f 2d mov r18, r15 - 29aa: 30 e0 ldi r19, 0x00 ; 0 - 29ac: 2f 5f subi r18, 0xFF ; 255 - 29ae: 3f 4f sbci r19, 0xFF ; 255 - 29b0: 21 fb bst r18, 1 - 29b2: 66 24 eor r6, r6 - 29b4: 60 f8 bld r6, 0 - 29b6: 71 2c mov r7, r1 - 29b8: b1 e0 ldi r27, 0x01 ; 1 - 29ba: 6b 26 eor r6, r27 - 29bc: 86 25 eor r24, r6 - 29be: 80 83 st Z, r24 + 2d20: f0 90 c0 24 lds r15, 0x24C0 + 2d24: 0f 2c mov r0, r15 + 2d26: f2 94 swap r15 + 2d28: f0 24 eor r15, r0 + 2d2a: 0f 2c mov r0, r15 + 2d2c: f6 94 lsr r15 + 2d2e: f6 94 lsr r15 + 2d30: f0 24 eor r15, r0 + 2d32: a6 d3 rcall .+1868 ; 0x3480 + 2d34: f8 01 movw r30, r16 + 2d36: ed 57 subi r30, 0x7D ; 125 + 2d38: ff 4f sbci r31, 0xFF ; 255 + 2d3a: 2f 2d mov r18, r15 + 2d3c: 30 e0 ldi r19, 0x00 ; 0 + 2d3e: 2f 5f subi r18, 0xFF ; 255 + 2d40: 3f 4f sbci r19, 0xFF ; 255 + 2d42: 21 fb bst r18, 1 + 2d44: 66 24 eor r6, r6 + 2d46: 60 f8 bld r6, 0 + 2d48: 71 2c mov r7, r1 + 2d4a: b1 e0 ldi r27, 0x01 ; 1 + 2d4c: 6b 26 eor r6, r27 + 2d4e: 86 25 eor r24, r6 + 2d50: 80 83 st Z, r24 } State = STATE_AUTHED_IDLE; - 29c0: 85 e0 ldi r24, 0x05 ; 5 - 29c2: 80 93 b5 20 sts 0x20B5, r24 + 2d52: 85 e0 ldi r24, 0x05 ; 5 + 2d54: 80 93 b5 24 sts 0x24B5, r24 return (CMD_AUTH_BA_FRAME_SIZE * BITS_PER_BYTE) | ISO14443A_APP_CUSTOM_PARITY; - 29c6: 20 e2 ldi r18, 0x20 ; 32 - 29c8: 30 e1 ldi r19, 0x10 ; 16 - 29ca: f3 ce rjmp .-538 ; 0x27b2 + 2d58: 20 e2 ldi r18, 0x20 ; 32 + 2d5a: 30 e1 ldi r19, 0x10 ; 16 + 2d5c: f3 ce rjmp .-538 ; 0x2b44 DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 29cc: f8 01 movw r30, r16 - 29ce: 20 83 st Z, r18 + 2d5e: f8 01 movw r30, r16 + 2d60: 20 83 st Z, r18 DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 29d0: 91 83 std Z+1, r25 ; 0x01 + 2d62: 91 83 std Z+1, r25 ; 0x01 } break; case STATE_READY: if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { State = STATE_READY; - 29d2: 82 e0 ldi r24, 0x02 ; 2 - 29d4: 80 93 b5 20 sts 0x20B5, r24 + 2d64: 82 e0 ldi r24, 0x02 ; 2 + 2d66: 80 93 b5 24 sts 0x24B5, r24 *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 29d8: 20 e1 ldi r18, 0x10 ; 16 - 29da: 30 e0 ldi r19, 0x00 ; 0 + 2d6a: 20 e1 ldi r18, 0x10 ; 16 + 2d6c: 30 e0 ldi r19, 0x00 ; 0 return BitCount; - 29dc: ea ce rjmp .-556 ; 0x27b2 + 2d6e: ea ce rjmp .-556 ; 0x2b44 bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) { uint8_t* DataPtr = (uint8_t*) Buffer; if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 29de: 84 e0 ldi r24, 0x04 ; 4 - 29e0: d8 01 movw r26, r16 - 29e2: 8c 93 st X, r24 + 2d70: 84 e0 ldi r24, 0x04 ; 4 + 2d72: d8 01 movw r26, r16 + 2d74: 8c 93 st X, r24 DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 29e4: 11 96 adiw r26, 0x01 ; 1 - 29e6: 1c 92 st X, r1 + 2d76: 11 96 adiw r26, 0x01 ; 1 + 2d78: 1c 92 st X, r1 } break; case STATE_ACTIVE: if (ISO14443AWakeUp(Buffer, &BitCount, MFCLASSIC_1K_ATQA_VALUE)) { State = STATE_READY; - 29e8: 82 e0 ldi r24, 0x02 ; 2 - 29ea: 80 93 b5 20 sts 0x20B5, r24 + 2d7a: 82 e0 ldi r24, 0x02 ; 2 + 2d7c: 80 93 b5 24 sts 0x24B5, r24 *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 29ee: 20 e1 ldi r18, 0x10 ; 16 - 29f0: 30 e0 ldi r19, 0x00 ; 0 + 2d80: 20 e1 ldi r18, 0x10 ; 16 + 2d82: 30 e0 ldi r19, 0x00 ; 0 return BitCount; - 29f2: df ce rjmp .-578 ; 0x27b2 + 2d84: df ce rjmp .-578 ; 0x2b44 } else if (Buffer[0] == CMD_HALT) { /* Halts the tag. According to the ISO14443, the second * byte is supposed to be 0. */ if (Buffer[1] == 0) { - 29f4: f8 01 movw r30, r16 - 29f6: 81 81 ldd r24, Z+1 ; 0x01 - 29f8: 88 23 and r24, r24 - 29fa: 09 f4 brne .+2 ; 0x29fe - 29fc: 7c c2 rjmp .+1272 ; 0x2ef6 + 2d86: f8 01 movw r30, r16 + 2d88: 81 81 ldd r24, Z+1 ; 0x01 + 2d8a: 88 23 and r24, r24 + 2d8c: 09 f4 brne .+2 ; 0x2d90 + 2d8e: 7c c2 rjmp .+1272 ; 0x3288 <__stack+0x289> } else { Buffer[0] = NAK_CRC_ERROR; return ACK_NAK_FRAME_SIZE; } } else { Buffer[0] = NAK_INVALID_ARG; - 29fe: f8 01 movw r30, r16 - 2a00: 10 82 st Z, r1 + 2d90: f8 01 movw r30, r16 + 2d92: 10 82 st Z, r1 return ACK_NAK_FRAME_SIZE; - 2a02: 24 e0 ldi r18, 0x04 ; 4 - 2a04: 30 e0 ldi r19, 0x00 ; 0 - 2a06: d5 ce rjmp .-598 ; 0x27b2 + 2d94: 24 e0 ldi r18, 0x04 ; 4 + 2d96: 30 e0 ldi r19, 0x00 ; 0 + 2d98: d5 ce rjmp .-598 ; 0x2b44 Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 2a08: 62 e0 ldi r22, 0x02 ; 2 - 2a0a: 70 e0 ldi r23, 0x00 ; 0 - 2a0c: c8 01 movw r24, r16 - 2a0e: ea d2 rcall .+1492 ; 0x2fe4 - 2a10: 88 23 and r24, r24 - 2a12: 09 f4 brne .+2 ; 0x2a16 - 2a14: f6 c0 rjmp .+492 ; 0x2c02 + 2d9a: 62 e0 ldi r22, 0x02 ; 2 + 2d9c: 70 e0 ldi r23, 0x00 ; 0 + 2d9e: c8 01 movw r24, r16 + 2da0: ea d2 rcall .+1492 ; 0x3376 + 2da2: 88 23 and r24, r24 + 2da4: 09 f4 brne .+2 ; 0x2da8 + 2da6: f6 c0 rjmp .+492 ; 0x2f94 /* Nested authentication. */ uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - 2a16: f8 01 movw r30, r16 - 2a18: 81 81 ldd r24, Z+1 ; 0x01 - 2a1a: 8c 73 andi r24, 0x3C ; 60 + 2da8: f8 01 movw r30, r16 + 2daa: 81 81 ldd r24, Z+1 ; 0x01 + 2dac: 8c 73 andi r24, 0x3C ; 60 uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 2a1c: 90 81 ld r25, Z - 2a1e: 90 36 cpi r25, 0x60 ; 96 - 2a20: 09 f4 brne .+2 ; 0x2a24 - 2a22: 85 c2 rjmp .+1290 ; 0x2f2e - 2a24: 6a e3 ldi r22, 0x3A ; 58 - 2a26: 70 e0 ldi r23, 0x00 ; 0 + 2dae: 90 81 ld r25, Z + 2db0: 90 36 cpi r25, 0x60 ; 96 + 2db2: 09 f4 brne .+2 ; 0x2db6 + 2db4: 85 c2 rjmp .+1290 ; 0x32c0 <__stack+0x2c1> + 2db6: 6a e3 ldi r22, 0x3A ; 58 + 2db8: 70 e0 ldi r23, 0x00 ; 0 uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; - 2a28: 7b 01 movw r14, r22 - 2a2a: f0 e1 ldi r31, 0x10 ; 16 - 2a2c: 8f 9f mul r24, r31 - 2a2e: e0 0c add r14, r0 - 2a30: f1 1c adc r15, r1 - 2a32: 11 24 eor r1, r1 + 2dba: 7b 01 movw r14, r22 + 2dbc: f0 e1 ldi r31, 0x10 ; 16 + 2dbe: 8f 9f mul r24, r31 + 2dc0: e0 0c add r14, r0 + 2dc2: f1 1c adc r15, r1 + 2dc4: 11 24 eor r1, r1 uint8_t Key[6]; uint8_t Uid[4]; uint8_t CardNonce[4]; /* Generate a random nonce and read UID and key from memory */ RandomGetBuffer(CardNonce, sizeof(CardNonce)); - 2a34: 64 e0 ldi r22, 0x04 ; 4 - 2a36: ce 01 movw r24, r28 - 2a38: 07 96 adiw r24, 0x07 ; 7 - 2a3a: 0e 94 df 04 call 0x9be ; 0x9be + 2dc6: 64 e0 ldi r22, 0x04 ; 4 + 2dc8: ce 01 movw r24, r28 + 2dca: 07 96 adiw r24, 0x07 ; 7 + 2dcc: 0e 94 03 05 call 0xa06 ; 0xa06 MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2a3e: 44 e0 ldi r20, 0x04 ; 4 - 2a40: 50 e0 ldi r21, 0x00 ; 0 - 2a42: 60 e0 ldi r22, 0x00 ; 0 - 2a44: 70 e0 ldi r23, 0x00 ; 0 - 2a46: ce 01 movw r24, r28 - 2a48: 0b 96 adiw r24, 0x0b ; 11 - 2a4a: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 2dd0: 44 e0 ldi r20, 0x04 ; 4 + 2dd2: 50 e0 ldi r21, 0x00 ; 0 + 2dd4: 60 e0 ldi r22, 0x00 ; 0 + 2dd6: 70 e0 ldi r23, 0x00 ; 0 + 2dd8: ce 01 movw r24, r28 + 2dda: 0b 96 adiw r24, 0x0b ; 11 + 2ddc: 0e 94 a2 05 call 0xb44 ; 0xb44 MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); - 2a4e: 46 e0 ldi r20, 0x06 ; 6 - 2a50: 50 e0 ldi r21, 0x00 ; 0 - 2a52: b7 01 movw r22, r14 - 2a54: ce 01 movw r24, r28 - 2a56: 01 96 adiw r24, 0x01 ; 1 - 2a58: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 2de0: 46 e0 ldi r20, 0x06 ; 6 + 2de2: 50 e0 ldi r21, 0x00 ; 0 + 2de4: b7 01 movw r22, r14 + 2de6: ce 01 movw r24, r28 + 2de8: 01 96 adiw r24, 0x01 ; 1 + 2dea: 0e 94 a2 05 call 0xb44 ; 0xb44 /* Precalculate the reader response from card-nonce */ for (uint8_t i=0; i + 2e06: 60 e4 ldi r22, 0x40 ; 64 + 2e08: 70 e0 ldi r23, 0x00 ; 0 + 2e0a: 89 eb ldi r24, 0xB9 ; 185 + 2e0c: 94 e2 ldi r25, 0x24 ; 36 + 2e0e: 9a d5 rcall .+2868 ; 0x3944 /* Precalculate our response from the reader response */ for (uint8_t i=0; i + 2e30: 60 e2 ldi r22, 0x20 ; 32 + 2e32: 70 e0 ldi r23, 0x00 ; 0 + 2e34: 8d eb ldi r24, 0xBD ; 189 + 2e36: 94 e2 ldi r25, 0x24 ; 36 + 2e38: 85 d5 rcall .+2826 ; 0x3944 /* Setup crypto1 cipher. */ Crypto1Setup(Key, Uid, CardNonce); - 2aa8: ae 01 movw r20, r28 - 2aaa: 49 5f subi r20, 0xF9 ; 249 - 2aac: 5f 4f sbci r21, 0xFF ; 255 - 2aae: be 01 movw r22, r28 - 2ab0: 65 5f subi r22, 0xF5 ; 245 - 2ab2: 7f 4f sbci r23, 0xFF ; 255 - 2ab4: ce 01 movw r24, r28 - 2ab6: 01 96 adiw r24, 0x01 ; 1 - 2ab8: 4e d3 rcall .+1692 ; 0x3156 + 2e3a: ae 01 movw r20, r28 + 2e3c: 49 5f subi r20, 0xF9 ; 249 + 2e3e: 5f 4f sbci r21, 0xFF ; 255 + 2e40: be 01 movw r22, r28 + 2e42: 65 5f subi r22, 0xF5 ; 245 + 2e44: 7f 4f sbci r23, 0xFF ; 255 + 2e46: ce 01 movw r24, r28 + 2e48: 01 96 adiw r24, 0x01 ; 1 + 2e4a: 4e d3 rcall .+1692 ; 0x34e8 for (uint8_t i=0; i + 2e6e: 20 e2 ldi r18, 0x20 ; 32 + 2e70: 30 e0 ldi r19, 0x00 ; 0 + 2e72: 68 ce rjmp .-816 ; 0x2b44 } else { Buffer[0] = NAK_INVALID_ARG; return ACK_NAK_FRAME_SIZE; } } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 2ae2: 62 e0 ldi r22, 0x02 ; 2 - 2ae4: 70 e0 ldi r23, 0x00 ; 0 - 2ae6: c8 01 movw r24, r16 - 2ae8: 7d d2 rcall .+1274 ; 0x2fe4 - 2aea: 88 23 and r24, r24 - 2aec: 09 f4 brne .+2 ; 0x2af0 - 2aee: 09 c2 rjmp .+1042 ; 0x2f02 + 2e74: 62 e0 ldi r22, 0x02 ; 2 + 2e76: 70 e0 ldi r23, 0x00 ; 0 + 2e78: c8 01 movw r24, r16 + 2e7a: 7d d2 rcall .+1274 ; 0x3376 + 2e7c: 88 23 and r24, r24 + 2e7e: 09 f4 brne .+2 ; 0x2e82 + 2e80: 09 c2 rjmp .+1042 ; 0x3294 <__stack+0x295> uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - 2af0: d8 01 movw r26, r16 - 2af2: 11 96 adiw r26, 0x01 ; 1 - 2af4: 2c 91 ld r18, X - 2af6: 11 97 sbiw r26, 0x01 ; 1 - 2af8: 2c 73 andi r18, 0x3C ; 60 + 2e82: d8 01 movw r26, r16 + 2e84: 11 96 adiw r26, 0x01 ; 1 + 2e86: 2c 91 ld r18, X + 2e88: 11 97 sbiw r26, 0x01 ; 1 + 2e8a: 2c 73 andi r18, 0x3C ; 60 uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 2afa: 8c 91 ld r24, X - 2afc: 80 36 cpi r24, 0x60 ; 96 - 2afe: 09 f4 brne .+2 ; 0x2b02 - 2b00: 19 c2 rjmp .+1074 ; 0x2f34 - 2b02: 8a e3 ldi r24, 0x3A ; 58 - 2b04: 90 e0 ldi r25, 0x00 ; 0 + 2e8c: 8c 91 ld r24, X + 2e8e: 80 36 cpi r24, 0x60 ; 96 + 2e90: 09 f4 brne .+2 ; 0x2e94 + 2e92: 19 c2 rjmp .+1074 ; 0x32c6 <__stack+0x2c7> + 2e94: 8a e3 ldi r24, 0x3A ; 58 + 2e96: 90 e0 ldi r25, 0x00 ; 0 uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; - 2b06: 7c 01 movw r14, r24 - 2b08: b0 e1 ldi r27, 0x10 ; 16 - 2b0a: 2b 9f mul r18, r27 - 2b0c: e0 0c add r14, r0 - 2b0e: f1 1c adc r15, r1 - 2b10: 11 24 eor r1, r1 + 2e98: 7c 01 movw r14, r24 + 2e9a: b0 e1 ldi r27, 0x10 ; 16 + 2e9c: 2b 9f mul r18, r27 + 2e9e: e0 0c add r14, r0 + 2ea0: f1 1c adc r15, r1 + 2ea2: 11 24 eor r1, r1 uint8_t Key[6]; uint8_t Uid[4]; uint8_t CardNonce[4]; /* Generate a random nonce and read UID and key from memory */ RandomGetBuffer(CardNonce, sizeof(CardNonce)); - 2b12: 64 e0 ldi r22, 0x04 ; 4 - 2b14: ce 01 movw r24, r28 - 2b16: 07 96 adiw r24, 0x07 ; 7 - 2b18: 0e 94 df 04 call 0x9be ; 0x9be + 2ea4: 64 e0 ldi r22, 0x04 ; 4 + 2ea6: ce 01 movw r24, r28 + 2ea8: 07 96 adiw r24, 0x07 ; 7 + 2eaa: 0e 94 03 05 call 0xa06 ; 0xa06 MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2b1c: 44 e0 ldi r20, 0x04 ; 4 - 2b1e: 50 e0 ldi r21, 0x00 ; 0 - 2b20: 60 e0 ldi r22, 0x00 ; 0 - 2b22: 70 e0 ldi r23, 0x00 ; 0 - 2b24: ce 01 movw r24, r28 - 2b26: 0b 96 adiw r24, 0x0b ; 11 - 2b28: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 2eae: 44 e0 ldi r20, 0x04 ; 4 + 2eb0: 50 e0 ldi r21, 0x00 ; 0 + 2eb2: 60 e0 ldi r22, 0x00 ; 0 + 2eb4: 70 e0 ldi r23, 0x00 ; 0 + 2eb6: ce 01 movw r24, r28 + 2eb8: 0b 96 adiw r24, 0x0b ; 11 + 2eba: 0e 94 a2 05 call 0xb44 ; 0xb44 MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); - 2b2c: 46 e0 ldi r20, 0x06 ; 6 - 2b2e: 50 e0 ldi r21, 0x00 ; 0 - 2b30: b7 01 movw r22, r14 - 2b32: ce 01 movw r24, r28 - 2b34: 01 96 adiw r24, 0x01 ; 1 - 2b36: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 2ebe: 46 e0 ldi r20, 0x06 ; 6 + 2ec0: 50 e0 ldi r21, 0x00 ; 0 + 2ec2: b7 01 movw r22, r14 + 2ec4: ce 01 movw r24, r28 + 2ec6: 01 96 adiw r24, 0x01 ; 1 + 2ec8: 0e 94 a2 05 call 0xb44 ; 0xb44 /* Precalculate the reader response from card-nonce */ for (uint8_t i=0; i + 2ee4: 60 e4 ldi r22, 0x40 ; 64 + 2ee6: 70 e0 ldi r23, 0x00 ; 0 + 2ee8: 89 eb ldi r24, 0xB9 ; 185 + 2eea: 94 e2 ldi r25, 0x24 ; 36 + 2eec: 2b d5 rcall .+2646 ; 0x3944 /* Precalculate our response from the reader response */ for (uint8_t i=0; i + 2f0e: 60 e2 ldi r22, 0x20 ; 32 + 2f10: 70 e0 ldi r23, 0x00 ; 0 + 2f12: 8d eb ldi r24, 0xBD ; 189 + 2f14: 94 e2 ldi r25, 0x24 ; 36 + 2f16: 16 d5 rcall .+2604 ; 0x3944 /* Respond with the random card nonce and expect further authentication * form the reader in the next frame. */ State = STATE_AUTHING; - 2b86: 84 e0 ldi r24, 0x04 ; 4 - 2b88: 80 93 b5 20 sts 0x20B5, r24 + 2f18: 84 e0 ldi r24, 0x04 ; 4 + 2f1a: 80 93 b5 24 sts 0x24B5, r24 for (uint8_t i=0; i + 2f30: ae 01 movw r20, r28 + 2f32: 49 5f subi r20, 0xF9 ; 249 + 2f34: 5f 4f sbci r21, 0xFF ; 255 + 2f36: be 01 movw r22, r28 + 2f38: 65 5f subi r22, 0xF5 ; 245 + 2f3a: 7f 4f sbci r23, 0xFF ; 255 + 2f3c: ce 01 movw r24, r28 + 2f3e: 01 96 adiw r24, 0x01 ; 1 + 2f40: d3 d2 rcall .+1446 ; 0x34e8 return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; - 2bb0: 20 e2 ldi r18, 0x20 ; 32 - 2bb2: 30 e0 ldi r19, 0x00 ; 0 - 2bb4: fe cd rjmp .-1028 ; 0x27b2 + 2f42: 20 e2 ldi r18, 0x20 ; 32 + 2f44: 30 e0 ldi r19, 0x00 ; 0 + 2f46: fe cd rjmp .-1028 ; 0x2b44 * the block back into the global block buffer. */ for (uint8_t i=0; i<(MEM_VALUE_SIZE + ISO14443A_CRCA_SIZE); i++) Buffer[i] ^= Crypto1Byte(); if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { MemoryReadBlock(BlockBuffer, (uint16_t) CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 2bb6: 60 91 c1 20 lds r22, 0x20C1 - 2bba: b0 e1 ldi r27, 0x10 ; 16 - 2bbc: 6b 9f mul r22, r27 - 2bbe: b0 01 movw r22, r0 - 2bc0: 11 24 eor r1, r1 - 2bc2: 40 e1 ldi r20, 0x10 ; 16 - 2bc4: 50 e0 ldi r21, 0x00 ; 0 - 2bc6: 82 ec ldi r24, 0xC2 ; 194 - 2bc8: 90 e2 ldi r25, 0x20 ; 32 - 2bca: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 2f48: 60 91 c1 24 lds r22, 0x24C1 + 2f4c: b0 e1 ldi r27, 0x10 ; 16 + 2f4e: 6b 9f mul r22, r27 + 2f50: b0 01 movw r22, r0 + 2f52: 11 24 eor r1, r1 + 2f54: 40 e1 ldi r20, 0x10 ; 16 + 2f56: 50 e0 ldi r21, 0x00 ; 0 + 2f58: 82 ec ldi r24, 0xC2 ; 194 + 2f5a: 94 e2 ldi r25, 0x24 ; 36 + 2f5c: 0e 94 a2 05 call 0xb44 ; 0xb44 INLINE bool CheckValueIntegrity(uint8_t* Block) { /* Value Blocks contain a value stored three times, with * the middle portion inverted. */ if ( (Block[0] == (uint8_t) ~Block[4]) && (Block[0] == Block[8]) - 2bce: 20 91 c2 20 lds r18, 0x20C2 - 2bd2: 80 91 c6 20 lds r24, 0x20C6 - 2bd6: 80 95 com r24 - 2bd8: 28 17 cp r18, r24 - 2bda: 09 f4 brne .+2 ; 0x2bde - 2bdc: c4 c0 rjmp .+392 ; 0x2d66 + 2f60: 20 91 c2 24 lds r18, 0x24C2 + 2f64: 80 91 c6 24 lds r24, 0x24C6 + 2f68: 80 95 com r24 + 2f6a: 28 17 cp r18, r24 + 2f6c: 09 f4 brne .+2 ; 0x2f70 + 2f6e: c4 c0 rjmp .+392 ; 0x30f8 <__stack+0xf9> State = STATE_AUTHED_IDLE; /* No ACK response on value commands part 2 */ return ISO14443A_APP_NO_RESPONSE; } else { /* Not sure if this is the correct error code.. */ Buffer[0] = NAK_OTHER_ERROR ^ Crypto1Nibble(); - 2bde: c5 d4 rcall .+2442 ; 0x356a - 2be0: 96 e0 ldi r25, 0x06 ; 6 - 2be2: 98 27 eor r25, r24 - 2be4: d8 01 movw r26, r16 - 2be6: 9c 93 st X, r25 - 2be8: df cd rjmp .-1090 ; 0x27a8 + 2f70: c5 d4 rcall .+2442 ; 0x38fc + 2f72: 96 e0 ldi r25, 0x06 ; 6 + 2f74: 98 27 eor r25, r24 + 2f76: d8 01 movw r26, r16 + 2f78: 9c 93 st X, r25 + 2f7a: df cd rjmp .-1090 ; 0x2b3a for (uint8_t i=0; i<(MEM_BYTES_PER_BLOCK + ISO14443A_CRCA_SIZE); i++) Buffer[i] ^= Crypto1Byte(); if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { if (!ActiveConfiguration.ReadOnly) { MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 2bea: 60 91 c1 20 lds r22, 0x20C1 - 2bee: f0 e1 ldi r31, 0x10 ; 16 - 2bf0: 6f 9f mul r22, r31 - 2bf2: b0 01 movw r22, r0 - 2bf4: 11 24 eor r1, r1 - 2bf6: 40 e1 ldi r20, 0x10 ; 16 - 2bf8: 50 e0 ldi r21, 0x00 ; 0 - 2bfa: c8 01 movw r24, r16 - 2bfc: 0e 94 81 06 call 0xd02 ; 0xd02 - 2c00: 12 ce rjmp .-988 ; 0x2826 + 2f7c: 60 91 c1 24 lds r22, 0x24C1 + 2f80: f0 e1 ldi r31, 0x10 ; 16 + 2f82: 6f 9f mul r22, r31 + 2f84: b0 01 movw r22, r0 + 2f86: 11 24 eor r1, r1 + 2f88: 40 e1 ldi r20, 0x10 ; 16 + 2f8a: 50 e0 ldi r21, 0x00 ; 0 + 2f8c: c8 01 movw r24, r16 + 2f8e: 0e 94 ba 05 call 0xb74 ; 0xb74 + 2f92: 12 ce rjmp .-988 ; 0x2bb8 * form the reader in the next frame. */ State = STATE_AUTHING; return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 2c02: b3 d4 rcall .+2406 ; 0x356a - 2c04: 91 e0 ldi r25, 0x01 ; 1 - 2c06: 98 27 eor r25, r24 - 2c08: f8 01 movw r30, r16 - 2c0a: 90 83 st Z, r25 + 2f94: b3 d4 rcall .+2406 ; 0x38fc + 2f96: 91 e0 ldi r25, 0x01 ; 1 + 2f98: 98 27 eor r25, r24 + 2f9a: f8 01 movw r30, r16 + 2f9c: 90 83 st Z, r25 return ACK_NAK_FRAME_SIZE; - 2c0c: 24 e0 ldi r18, 0x04 ; 4 - 2c0e: 30 e0 ldi r19, 0x00 ; 0 - 2c10: d0 cd rjmp .-1120 ; 0x27b2 + 2f9e: 24 e0 ldi r18, 0x04 ; 4 + 2fa0: 30 e0 ldi r19, 0x00 ; 0 + 2fa2: d0 cd rjmp .-1120 ; 0x2b44 * the incoming data. */ for (uint8_t i=0; i<4; i++) Buffer[i] ^= Crypto1Byte(); if (Buffer[0] == CMD_READ) { if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { - 2c12: 62 e0 ldi r22, 0x02 ; 2 - 2c14: 70 e0 ldi r23, 0x00 ; 0 - 2c16: c8 01 movw r24, r16 - 2c18: e5 d1 rcall .+970 ; 0x2fe4 - 2c1a: 88 23 and r24, r24 - 2c1c: 91 f3 breq .-28 ; 0x2c02 + 2fa4: 62 e0 ldi r22, 0x02 ; 2 + 2fa6: 70 e0 ldi r23, 0x00 ; 0 + 2fa8: c8 01 movw r24, r16 + 2faa: e5 d1 rcall .+970 ; 0x3376 + 2fac: 88 23 and r24, r24 + 2fae: 91 f3 breq .-28 ; 0x2f94 /* Read command. Read data from memory and append CRCA. */ MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 2c1e: d8 01 movw r26, r16 - 2c20: 11 96 adiw r26, 0x01 ; 1 - 2c22: 6c 91 ld r22, X - 2c24: b0 e1 ldi r27, 0x10 ; 16 - 2c26: 6b 9f mul r22, r27 - 2c28: b0 01 movw r22, r0 - 2c2a: 11 24 eor r1, r1 - 2c2c: 40 e1 ldi r20, 0x10 ; 16 - 2c2e: 50 e0 ldi r21, 0x00 ; 0 - 2c30: c8 01 movw r24, r16 - 2c32: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 2fb0: d8 01 movw r26, r16 + 2fb2: 11 96 adiw r26, 0x01 ; 1 + 2fb4: 6c 91 ld r22, X + 2fb6: b0 e1 ldi r27, 0x10 ; 16 + 2fb8: 6b 9f mul r22, r27 + 2fba: b0 01 movw r22, r0 + 2fbc: 11 24 eor r1, r1 + 2fbe: 40 e1 ldi r20, 0x10 ; 16 + 2fc0: 50 e0 ldi r21, 0x00 ; 0 + 2fc2: c8 01 movw r24, r16 + 2fc4: 0e 94 a2 05 call 0xb44 ; 0xb44 ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); - 2c36: 60 e1 ldi r22, 0x10 ; 16 - 2c38: 70 e0 ldi r23, 0x00 ; 0 - 2c3a: c8 01 movw r24, r16 - 2c3c: a4 d1 rcall .+840 ; 0x2f86 + 2fc8: 60 e1 ldi r22, 0x10 ; 16 + 2fca: 70 e0 ldi r23, 0x00 ; 0 + 2fcc: c8 01 movw r24, r16 + 2fce: a4 d1 rcall .+840 ; 0x3318 void MifareClassicAppTask(void) { } uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) - 2c3e: 68 01 movw r12, r16 - 2c40: e0 e8 ldi r30, 0x80 ; 128 - 2c42: ce 0e add r12, r30 - 2c44: d1 1c adc r13, r1 + 2fd0: 68 01 movw r12, r16 + 2fd2: e0 e8 ldi r30, 0x80 ; 128 + 2fd4: ce 0e add r12, r30 + 2fd6: d1 1c adc r13, r1 /* Read command. Read data from memory and append CRCA. */ MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); /* Encrypt and calculate parity bits. */ for (uint8_t i=0; i<(ISO14443A_CRCA_SIZE + MEM_BYTES_PER_BLOCK); i++) { - 2c46: a1 2c mov r10, r1 + 2fd8: a1 2c mov r10, r1 uint8_t Plain = Buffer[i]; - 2c48: d8 01 movw r26, r16 - 2c4a: bc 90 ld r11, X + 2fda: d8 01 movw r26, r16 + 2fdc: bc 90 ld r11, X Buffer[i] = Plain ^ Crypto1Byte(); - 2c4c: 4d d4 rcall .+2202 ; 0x34e8 - 2c4e: 8b 25 eor r24, r11 - 2c50: f8 01 movw r30, r16 - 2c52: 81 93 st Z+, r24 - 2c54: 8f 01 movw r16, r30 + 2fde: 4d d4 rcall .+2202 ; 0x387a + 2fe0: 8b 25 eor r24, r11 + 2fe2: f8 01 movw r30, r16 + 2fe4: 81 93 st Z+, r24 + 2fe6: 8f 01 movw r16, r30 Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(Plain) ^ Crypto1FilterOutput(); - 2c56: 0b 2c mov r0, r11 - 2c58: b2 94 swap r11 - 2c5a: b0 24 eor r11, r0 - 2c5c: 0b 2c mov r0, r11 - 2c5e: b6 94 lsr r11 - 2c60: b6 94 lsr r11 - 2c62: b0 24 eor r11, r0 - 2c64: 44 d2 rcall .+1160 ; 0x30ee - 2c66: 2b 2d mov r18, r11 - 2c68: 30 e0 ldi r19, 0x00 ; 0 - 2c6a: 2f 5f subi r18, 0xFF ; 255 - 2c6c: 3f 4f sbci r19, 0xFF ; 255 - 2c6e: 21 fb bst r18, 1 - 2c70: ee 24 eor r14, r14 - 2c72: e0 f8 bld r14, 0 - 2c74: f1 2c mov r15, r1 - 2c76: f1 e0 ldi r31, 0x01 ; 1 - 2c78: ef 26 eor r14, r31 - 2c7a: 8e 25 eor r24, r14 - 2c7c: d6 01 movw r26, r12 - 2c7e: 8d 93 st X+, r24 - 2c80: 6d 01 movw r12, r26 + 2fe8: 0b 2c mov r0, r11 + 2fea: b2 94 swap r11 + 2fec: b0 24 eor r11, r0 + 2fee: 0b 2c mov r0, r11 + 2ff0: b6 94 lsr r11 + 2ff2: b6 94 lsr r11 + 2ff4: b0 24 eor r11, r0 + 2ff6: 44 d2 rcall .+1160 ; 0x3480 + 2ff8: 2b 2d mov r18, r11 + 2ffa: 30 e0 ldi r19, 0x00 ; 0 + 2ffc: 2f 5f subi r18, 0xFF ; 255 + 2ffe: 3f 4f sbci r19, 0xFF ; 255 + 3000: 21 fb bst r18, 1 + 3002: ee 24 eor r14, r14 + 3004: e0 f8 bld r14, 0 + 3006: f1 2c mov r15, r1 + 3008: f1 e0 ldi r31, 0x01 ; 1 + 300a: ef 26 eor r14, r31 + 300c: 8e 25 eor r24, r14 + 300e: d6 01 movw r26, r12 + 3010: 8d 93 st X+, r24 + 3012: 6d 01 movw r12, r26 /* Read command. Read data from memory and append CRCA. */ MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); /* Encrypt and calculate parity bits. */ for (uint8_t i=0; i<(ISO14443A_CRCA_SIZE + MEM_BYTES_PER_BLOCK); i++) { - 2c82: a3 94 inc r10 - 2c84: b2 e1 ldi r27, 0x12 ; 18 - 2c86: ab 12 cpse r10, r27 - 2c88: df cf rjmp .-66 ; 0x2c48 + 3014: a3 94 inc r10 + 3016: b2 e1 ldi r27, 0x12 ; 18 + 3018: ab 12 cpse r10, r27 + 301a: df cf rjmp .-66 ; 0x2fda uint8_t Plain = Buffer[i]; Buffer[i] = Plain ^ Crypto1Byte(); Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(Plain) ^ Crypto1FilterOutput(); } return ( (CMD_READ_RESPONSE_FRAME_SIZE + ISO14443A_CRCA_SIZE ) - 2c8a: 20 e9 ldi r18, 0x90 ; 144 - 2c8c: 30 e1 ldi r19, 0x10 ; 16 - 2c8e: 91 cd rjmp .-1246 ; 0x27b2 + 301c: 20 e9 ldi r18, 0x90 ; 144 + 301e: 30 e1 ldi r19, 0x10 ; 16 + 3020: 91 cd rjmp .-1246 ; 0x2b44 State = STATE_READY; return BitCount; } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { /* Load UID CL1 and perform anticollision */ uint8_t UidCL1[4]; MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2c90: 44 e0 ldi r20, 0x04 ; 4 - 2c92: 50 e0 ldi r21, 0x00 ; 0 - 2c94: 60 e0 ldi r22, 0x00 ; 0 - 2c96: 70 e0 ldi r23, 0x00 ; 0 - 2c98: ce 01 movw r24, r28 - 2c9a: 01 96 adiw r24, 0x01 ; 1 - 2c9c: 0e 94 fc 05 call 0xbf8 ; 0xbf8 + 3022: 44 e0 ldi r20, 0x04 ; 4 + 3024: 50 e0 ldi r21, 0x00 ; 0 + 3026: 60 e0 ldi r22, 0x00 ; 0 + 3028: 70 e0 ldi r23, 0x00 ; 0 + 302a: ce 01 movw r24, r28 + 302c: 01 96 adiw r24, 0x01 ; 1 + 302e: 0e 94 a2 05 call 0xb44 ; 0xb44 if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) { - 2ca0: 90 91 b8 20 lds r25, 0x20B8 + 3032: 90 91 b8 24 lds r25, 0x24B8 uint8_t* DataPtr = (uint8_t*) Buffer; uint8_t NVB = DataPtr[1]; //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; switch (NVB) { - 2ca4: d8 01 movw r26, r16 - 2ca6: 11 96 adiw r26, 0x01 ; 1 - 2ca8: 8c 91 ld r24, X - 2caa: 80 32 cpi r24, 0x20 ; 32 - 2cac: 09 f4 brne .+2 ; 0x2cb0 - 2cae: 2f c1 rjmp .+606 ; 0x2f0e - 2cb0: 80 37 cpi r24, 0x70 ; 112 - 2cb2: 09 f0 breq .+2 ; 0x2cb6 - 2cb4: 9d cd rjmp .-1222 ; 0x27f0 + 3036: d8 01 movw r26, r16 + 3038: 11 96 adiw r26, 0x01 ; 1 + 303a: 8c 91 ld r24, X + 303c: 80 32 cpi r24, 0x20 ; 32 + 303e: 09 f4 brne .+2 ; 0x3042 <__stack+0x43> + 3040: 2f c1 rjmp .+606 ; 0x32a0 <__stack+0x2a1> + 3042: 80 37 cpi r24, 0x70 ; 112 + 3044: 09 f0 breq .+2 ; 0x3048 <__stack+0x49> + 3046: 9d cd rjmp .-1222 ; 0x2b82 return false; case ISO14443A_NVB_AC_END: /* End of anticollision procedure. * Send SAK CLn if we are selected. */ if ( (DataPtr[2] == UidCL[0]) && - 2cb6: d8 01 movw r26, r16 - 2cb8: 12 96 adiw r26, 0x02 ; 2 - 2cba: 2c 91 ld r18, X - 2cbc: 12 97 sbiw r26, 0x02 ; 2 - 2cbe: 89 81 ldd r24, Y+1 ; 0x01 - 2cc0: 28 13 cpse r18, r24 - 2cc2: 96 cd rjmp .-1236 ; 0x27f0 - 2cc4: 13 96 adiw r26, 0x03 ; 3 - 2cc6: 2c 91 ld r18, X - 2cc8: 13 97 sbiw r26, 0x03 ; 3 - 2cca: 8a 81 ldd r24, Y+2 ; 0x02 - 2ccc: 28 13 cpse r18, r24 - 2cce: 90 cd rjmp .-1248 ; 0x27f0 + 3048: d8 01 movw r26, r16 + 304a: 12 96 adiw r26, 0x02 ; 2 + 304c: 2c 91 ld r18, X + 304e: 12 97 sbiw r26, 0x02 ; 2 + 3050: 89 81 ldd r24, Y+1 ; 0x01 + 3052: 28 13 cpse r18, r24 + 3054: 96 cd rjmp .-1236 ; 0x2b82 + 3056: 13 96 adiw r26, 0x03 ; 3 + 3058: 2c 91 ld r18, X + 305a: 13 97 sbiw r26, 0x03 ; 3 + 305c: 8a 81 ldd r24, Y+2 ; 0x02 + 305e: 28 13 cpse r18, r24 + 3060: 90 cd rjmp .-1248 ; 0x2b82 (DataPtr[3] == UidCL[1]) && - 2cd0: 14 96 adiw r26, 0x04 ; 4 - 2cd2: 2c 91 ld r18, X - 2cd4: 14 97 sbiw r26, 0x04 ; 4 - 2cd6: 8b 81 ldd r24, Y+3 ; 0x03 - 2cd8: 28 13 cpse r18, r24 - 2cda: 8a cd rjmp .-1260 ; 0x27f0 + 3062: 14 96 adiw r26, 0x04 ; 4 + 3064: 2c 91 ld r18, X + 3066: 14 97 sbiw r26, 0x04 ; 4 + 3068: 8b 81 ldd r24, Y+3 ; 0x03 + 306a: 28 13 cpse r18, r24 + 306c: 8a cd rjmp .-1260 ; 0x2b82 (DataPtr[4] == UidCL[2]) && - 2cdc: 15 96 adiw r26, 0x05 ; 5 - 2cde: 2c 91 ld r18, X - 2ce0: 15 97 sbiw r26, 0x05 ; 5 - 2ce2: 8c 81 ldd r24, Y+4 ; 0x04 - 2ce4: 28 13 cpse r18, r24 - 2ce6: 84 cd rjmp .-1272 ; 0x27f0 + 306e: 15 96 adiw r26, 0x05 ; 5 + 3070: 2c 91 ld r18, X + 3072: 15 97 sbiw r26, 0x05 ; 5 + 3074: 8c 81 ldd r24, Y+4 ; 0x04 + 3076: 28 13 cpse r18, r24 + 3078: 84 cd rjmp .-1272 ; 0x2b82 (DataPtr[5] == UidCL[3]) ) { DataPtr[0] = SAKValue; - 2ce8: 9c 93 st X, r25 + 307a: 9c 93 st X, r25 ISO14443AAppendCRCA(Buffer, 1); - 2cea: 61 e0 ldi r22, 0x01 ; 1 - 2cec: 70 e0 ldi r23, 0x00 ; 0 - 2cee: c8 01 movw r24, r16 - 2cf0: 4a d1 rcall .+660 ; 0x2f86 + 307c: 61 e0 ldi r22, 0x01 ; 1 + 307e: 70 e0 ldi r23, 0x00 ; 0 + 3080: c8 01 movw r24, r16 + 3082: 4a d1 rcall .+660 ; 0x3318 State = STATE_ACTIVE; - 2cf2: 83 e0 ldi r24, 0x03 ; 3 - 2cf4: 80 93 b5 20 sts 0x20B5, r24 + 3084: 83 e0 ldi r24, 0x03 ; 3 + 3086: 80 93 b5 24 sts 0x24B5, r24 *BitCount = ISO14443A_SAK_FRAME_SIZE; - 2cf8: 28 e1 ldi r18, 0x18 ; 24 - 2cfa: 30 e0 ldi r19, 0x00 ; 0 - 2cfc: 5a cd rjmp .-1356 ; 0x27b2 + 308a: 28 e1 ldi r18, 0x18 ; 24 + 308c: 30 e0 ldi r19, 0x00 ; 0 + 308e: 5a cd rjmp .-1356 ; 0x2b44 } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); return ACK_NAK_FRAME_SIZE; } } else if (Buffer[0] == CMD_WRITE) { if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { - 2cfe: 62 e0 ldi r22, 0x02 ; 2 - 2d00: 70 e0 ldi r23, 0x00 ; 0 - 2d02: c8 01 movw r24, r16 - 2d04: 6f d1 rcall .+734 ; 0x2fe4 - 2d06: 88 23 and r24, r24 - 2d08: 81 f0 breq .+32 ; 0x2d2a + 3090: 62 e0 ldi r22, 0x02 ; 2 + 3092: 70 e0 ldi r23, 0x00 ; 0 + 3094: c8 01 movw r24, r16 + 3096: 6f d1 rcall .+734 ; 0x3376 + 3098: 88 23 and r24, r24 + 309a: 81 f0 breq .+32 ; 0x30bc <__stack+0xbd> /* Write command. Store the address and prepare for the upcoming data. * Respond with ACK. */ CurrentAddress = Buffer[1]; - 2d0a: d8 01 movw r26, r16 - 2d0c: 11 96 adiw r26, 0x01 ; 1 - 2d0e: 8c 91 ld r24, X - 2d10: 80 93 c1 20 sts 0x20C1, r24 + 309c: d8 01 movw r26, r16 + 309e: 11 96 adiw r26, 0x01 ; 1 + 30a0: 8c 91 ld r24, X + 30a2: 80 93 c1 24 sts 0x24C1, r24 State = STATE_WRITE; - 2d14: 86 e0 ldi r24, 0x06 ; 6 - 2d16: 80 93 b5 20 sts 0x20B5, r24 + 30a6: 86 e0 ldi r24, 0x06 ; 6 + 30a8: 80 93 b5 24 sts 0x24B5, r24 MemoryWriteBlock(BlockBuffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK ); } else { /* In read only mode, silently ignore the write */ } Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2d1a: 27 d4 rcall .+2126 ; 0x356a - 2d1c: 9a e0 ldi r25, 0x0A ; 10 - 2d1e: 98 27 eor r25, r24 - 2d20: f8 01 movw r30, r16 - 2d22: 90 83 st Z, r25 + 30ac: 27 d4 rcall .+2126 ; 0x38fc + 30ae: 9a e0 ldi r25, 0x0A ; 10 + 30b0: 98 27 eor r25, r24 + 30b2: f8 01 movw r30, r16 + 30b4: 90 83 st Z, r25 } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; - 2d24: 24 e0 ldi r18, 0x04 ; 4 - 2d26: 30 e0 ldi r19, 0x00 ; 0 - 2d28: 44 cd rjmp .-1400 ; 0x27b2 + 30b6: 24 e0 ldi r18, 0x04 ; 4 + 30b8: 30 e0 ldi r19, 0x00 ; 0 + 30ba: 44 cd rjmp .-1400 ; 0x2b44 /* In read only mode, silently ignore the write */ } Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 2d2a: 1f d4 rcall .+2110 ; 0x356a - 2d2c: 91 e0 ldi r25, 0x01 ; 1 - 2d2e: 98 27 eor r25, r24 - 2d30: d8 01 movw r26, r16 - 2d32: 9c 93 st X, r25 + 30bc: 1f d4 rcall .+2110 ; 0x38fc + 30be: 91 e0 ldi r25, 0x01 ; 1 + 30c0: 98 27 eor r25, r24 + 30c2: d8 01 movw r26, r16 + 30c4: 9c 93 st X, r25 } return ACK_NAK_FRAME_SIZE; - 2d34: 24 e0 ldi r18, 0x04 ; 4 - 2d36: 30 e0 ldi r19, 0x00 ; 0 - 2d38: 3c cd rjmp .-1416 ; 0x27b2 + 30c6: 24 e0 ldi r18, 0x04 ; 4 + 30c8: 30 e0 ldi r19, 0x00 ; 0 + 30ca: 3c cd rjmp .-1416 ; 0x2b44 } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_DECREMENT) { if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { - 2d3a: 62 e0 ldi r22, 0x02 ; 2 - 2d3c: 70 e0 ldi r23, 0x00 ; 0 - 2d3e: c8 01 movw r24, r16 - 2d40: 51 d1 rcall .+674 ; 0x2fe4 - 2d42: 88 23 and r24, r24 - 2d44: 09 f4 brne .+2 ; 0x2d48 - 2d46: 5d cf rjmp .-326 ; 0x2c02 + 30cc: 62 e0 ldi r22, 0x02 ; 2 + 30ce: 70 e0 ldi r23, 0x00 ; 0 + 30d0: c8 01 movw r24, r16 + 30d2: 51 d1 rcall .+674 ; 0x3376 + 30d4: 88 23 and r24, r24 + 30d6: 09 f4 brne .+2 ; 0x30da <__stack+0xdb> + 30d8: 5d cf rjmp .-326 ; 0x2f94 CurrentAddress = Buffer[1]; - 2d48: f8 01 movw r30, r16 - 2d4a: 81 81 ldd r24, Z+1 ; 0x01 - 2d4c: 80 93 c1 20 sts 0x20C1, r24 + 30da: f8 01 movw r30, r16 + 30dc: 81 81 ldd r24, Z+1 ; 0x01 + 30de: 80 93 c1 24 sts 0x24C1, r24 State = STATE_DECREMENT; - 2d50: 88 e0 ldi r24, 0x08 ; 8 + 30e2: 88 e0 ldi r24, 0x08 ; 8 } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_RESTORE) { if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { CurrentAddress = Buffer[1]; State = STATE_RESTORE; - 2d52: 80 93 b5 20 sts 0x20B5, r24 + 30e4: 80 93 b5 24 sts 0x24B5, r24 Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2d56: 09 d4 rcall .+2066 ; 0x356a - 2d58: 9a e0 ldi r25, 0x0A ; 10 - 2d5a: 98 27 eor r25, r24 - 2d5c: d8 01 movw r26, r16 - 2d5e: 9c 93 st X, r25 + 30e8: 09 d4 rcall .+2066 ; 0x38fc + 30ea: 9a e0 ldi r25, 0x0A ; 10 + 30ec: 98 27 eor r25, r24 + 30ee: d8 01 movw r26, r16 + 30f0: 9c 93 st X, r25 } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; - 2d60: 24 e0 ldi r18, 0x04 ; 4 - 2d62: 30 e0 ldi r19, 0x00 ; 0 - 2d64: 26 cd rjmp .-1460 ; 0x27b2 + 30f2: 24 e0 ldi r18, 0x04 ; 4 + 30f4: 30 e0 ldi r19, 0x00 ; 0 + 30f6: 26 cd rjmp .-1460 ; 0x2b44 INLINE bool CheckValueIntegrity(uint8_t* Block) { /* Value Blocks contain a value stored three times, with * the middle portion inverted. */ if ( (Block[0] == (uint8_t) ~Block[4]) && (Block[0] == Block[8]) - 2d66: 80 91 ca 20 lds r24, 0x20CA - 2d6a: 28 13 cpse r18, r24 - 2d6c: 38 cf rjmp .-400 ; 0x2bde + 30f8: 80 91 ca 24 lds r24, 0x24CA + 30fc: 28 13 cpse r18, r24 + 30fe: 38 cf rjmp .-400 ; 0x2f70 && (Block[1] == (uint8_t) ~Block[5]) && (Block[1] == Block[9]) - 2d6e: e0 91 c3 20 lds r30, 0x20C3 - 2d72: 80 91 c7 20 lds r24, 0x20C7 - 2d76: 80 95 com r24 - 2d78: e8 13 cpse r30, r24 - 2d7a: 31 cf rjmp .-414 ; 0x2bde - 2d7c: 80 91 cb 20 lds r24, 0x20CB - 2d80: e8 13 cpse r30, r24 - 2d82: 2d cf rjmp .-422 ; 0x2bde + 3100: e0 91 c3 24 lds r30, 0x24C3 + 3104: 80 91 c7 24 lds r24, 0x24C7 + 3108: 80 95 com r24 + 310a: e8 13 cpse r30, r24 + 310c: 31 cf rjmp .-414 ; 0x2f70 + 310e: 80 91 cb 24 lds r24, 0x24CB + 3112: e8 13 cpse r30, r24 + 3114: 2d cf rjmp .-422 ; 0x2f70 && (Block[2] == (uint8_t) ~Block[6]) && (Block[2] == Block[10]) - 2d84: 80 91 c4 20 lds r24, 0x20C4 - 2d88: 90 91 c8 20 lds r25, 0x20C8 - 2d8c: 90 95 com r25 - 2d8e: 89 13 cpse r24, r25 - 2d90: 26 cf rjmp .-436 ; 0x2bde - 2d92: 90 91 cc 20 lds r25, 0x20CC - 2d96: 89 13 cpse r24, r25 - 2d98: 22 cf rjmp .-444 ; 0x2bde + 3116: 80 91 c4 24 lds r24, 0x24C4 + 311a: 90 91 c8 24 lds r25, 0x24C8 + 311e: 90 95 com r25 + 3120: 89 13 cpse r24, r25 + 3122: 26 cf rjmp .-436 ; 0x2f70 + 3124: 90 91 cc 24 lds r25, 0x24CC + 3128: 89 13 cpse r24, r25 + 312a: 22 cf rjmp .-444 ; 0x2f70 && (Block[3] == (uint8_t) ~Block[7]) && (Block[3] == Block[11]) - 2d9a: 30 91 c5 20 lds r19, 0x20C5 - 2d9e: 90 91 c9 20 lds r25, 0x20C9 - 2da2: 90 95 com r25 - 2da4: 39 13 cpse r19, r25 - 2da6: 1b cf rjmp .-458 ; 0x2bde - 2da8: 90 91 cd 20 lds r25, 0x20CD - 2dac: 39 13 cpse r19, r25 - 2dae: 17 cf rjmp .-466 ; 0x2bde + 312c: 30 91 c5 24 lds r19, 0x24C5 + 3130: 90 91 c9 24 lds r25, 0x24C9 + 3134: 90 95 com r25 + 3136: 39 13 cpse r19, r25 + 3138: 1b cf rjmp .-458 ; 0x2f70 + 313a: 90 91 cd 24 lds r25, 0x24CD + 313e: 39 13 cpse r19, r25 + 3140: 17 cf rjmp .-466 ; 0x2f70 && (Block[12] == (uint8_t) ~Block[13]) - 2db0: 40 91 ce 20 lds r20, 0x20CE - 2db4: 90 91 cf 20 lds r25, 0x20CF - 2db8: 90 95 com r25 - 2dba: 49 13 cpse r20, r25 - 2dbc: 10 cf rjmp .-480 ; 0x2bde + 3142: 40 91 ce 24 lds r20, 0x24CE + 3146: 90 91 cf 24 lds r25, 0x24CF + 314a: 90 95 com r25 + 314c: 49 13 cpse r20, r25 + 314e: 10 cf rjmp .-480 ; 0x2f70 && (Block[12] == Block[14]) - 2dbe: 90 91 d0 20 lds r25, 0x20D0 - 2dc2: 49 13 cpse r20, r25 - 2dc4: 0c cf rjmp .-488 ; 0x2bde + 3150: 90 91 d0 24 lds r25, 0x24D0 + 3154: 49 13 cpse r20, r25 + 3156: 0c cf rjmp .-488 ; 0x2f70 && (Block[14] == (uint8_t) ~Block[15])) { - 2dc6: 90 91 d1 20 lds r25, 0x20D1 - 2dca: 90 95 com r25 - 2dcc: 49 13 cpse r20, r25 - 2dce: 07 cf rjmp .-498 ; 0x2bde + 3158: 90 91 d1 24 lds r25, 0x24D1 + 315c: 90 95 com r25 + 315e: 49 13 cpse r20, r25 + 3160: 07 cf rjmp .-498 ; 0x2f70 } INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) { *Value = 0; *Value |= ((uint32_t) Block[0] << 0); - 2dd0: d8 01 movw r26, r16 - 2dd2: 9c 91 ld r25, X + 3162: d8 01 movw r26, r16 + 3164: 9c 91 ld r25, X *Value |= ((uint32_t) Block[1] << 8); - 2dd4: 11 96 adiw r26, 0x01 ; 1 - 2dd6: fc 91 ld r31, X - 2dd8: 11 97 sbiw r26, 0x01 ; 1 + 3166: 11 96 adiw r26, 0x01 ; 1 + 3168: fc 91 ld r31, X + 316a: 11 97 sbiw r26, 0x01 ; 1 *Value |= ((uint32_t) Block[2] << 16); - 2dda: 12 96 adiw r26, 0x02 ; 2 - 2ddc: 4c 91 ld r20, X - 2dde: 12 97 sbiw r26, 0x02 ; 2 - 2de0: 50 e0 ldi r21, 0x00 ; 0 - 2de2: 60 e0 ldi r22, 0x00 ; 0 - 2de4: 70 e0 ldi r23, 0x00 ; 0 - 2de6: ba 01 movw r22, r20 - 2de8: 55 27 eor r21, r21 - 2dea: 44 27 eor r20, r20 + 316c: 12 96 adiw r26, 0x02 ; 2 + 316e: 4c 91 ld r20, X + 3170: 12 97 sbiw r26, 0x02 ; 2 + 3172: 50 e0 ldi r21, 0x00 ; 0 + 3174: 60 e0 ldi r22, 0x00 ; 0 + 3176: 70 e0 ldi r23, 0x00 ; 0 + 3178: ba 01 movw r22, r20 + 317a: 55 27 eor r21, r21 + 317c: 44 27 eor r20, r20 INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) { *Value = 0; *Value |= ((uint32_t) Block[0] << 0); *Value |= ((uint32_t) Block[1] << 8); - 2dec: 5f 2b or r21, r31 + 317e: 5f 2b or r21, r31 *Value |= ((uint32_t) Block[2] << 16); - 2dee: 49 2b or r20, r25 + 3180: 49 2b or r20, r25 *Value |= ((uint32_t) Block[3] << 24); - 2df0: 13 96 adiw r26, 0x03 ; 3 - 2df2: 9c 91 ld r25, X - 2df4: 79 2b or r23, r25 + 3182: 13 96 adiw r26, 0x03 ; 3 + 3184: 9c 91 ld r25, X + 3186: 79 2b or r23, r25 INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) { *Value = 0; *Value |= ((uint32_t) Block[0] << 0); *Value |= ((uint32_t) Block[1] << 8); *Value |= ((uint32_t) Block[2] << 16); - 2df6: 90 e0 ldi r25, 0x00 ; 0 - 2df8: a0 e0 ldi r26, 0x00 ; 0 - 2dfa: b0 e0 ldi r27, 0x00 ; 0 - 2dfc: dc 01 movw r26, r24 - 2dfe: 99 27 eor r25, r25 - 2e00: 88 27 eor r24, r24 + 3188: 90 e0 ldi r25, 0x00 ; 0 + 318a: a0 e0 ldi r26, 0x00 ; 0 + 318c: b0 e0 ldi r27, 0x00 ; 0 + 318e: dc 01 movw r26, r24 + 3190: 99 27 eor r25, r25 + 3192: 88 27 eor r24, r24 INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) { *Value = 0; *Value |= ((uint32_t) Block[0] << 0); *Value |= ((uint32_t) Block[1] << 8); - 2e02: 9e 2b or r25, r30 + 3194: 9e 2b or r25, r30 *Value |= ((uint32_t) Block[2] << 16); - 2e04: 82 2b or r24, r18 + 3196: 82 2b or r24, r18 *Value |= ((uint32_t) Block[3] << 24); - 2e06: b3 2b or r27, r19 + 3198: b3 2b or r27, r19 uint32_t BlockValue; ValueFromBlock(&ParamValue, Buffer); ValueFromBlock(&BlockValue, BlockBuffer); if (State == STATE_DECREMENT) { - 2e08: 20 91 b5 20 lds r18, 0x20B5 - 2e0c: 28 30 cpi r18, 0x08 ; 8 - 2e0e: 09 f4 brne .+2 ; 0x2e12 - 2e10: 6d c0 rjmp .+218 ; 0x2eec + 319a: 20 91 b5 24 lds r18, 0x24B5 + 319e: 28 30 cpi r18, 0x08 ; 8 + 31a0: 09 f4 brne .+2 ; 0x31a4 <__stack+0x1a5> + 31a2: 6d c0 rjmp .+218 ; 0x327e <__stack+0x27f> BlockValue -= ParamValue; } else if (State == STATE_INCREMENT) { - 2e12: 27 30 cpi r18, 0x07 ; 7 - 2e14: 21 f4 brne .+8 ; 0x2e1e + 31a4: 27 30 cpi r18, 0x07 ; 7 + 31a6: 21 f4 brne .+8 ; 0x31b0 <__stack+0x1b1> BlockValue += ParamValue; - 2e16: 84 0f add r24, r20 - 2e18: 95 1f adc r25, r21 - 2e1a: a6 1f adc r26, r22 - 2e1c: b7 1f adc r27, r23 + 31a8: 84 0f add r24, r20 + 31aa: 95 1f adc r25, r21 + 31ac: a6 1f adc r26, r22 + 31ae: b7 1f adc r27, r23 *Value |= ((uint32_t) Block[3] << 24); } INLINE void ValueToBlock(uint8_t* Block, uint32_t Value) { Block[0] = (uint8_t) (Value >> 0); - 2e1e: 80 93 c2 20 sts 0x20C2, r24 + 31b0: 80 93 c2 24 sts 0x24C2, r24 Block[1] = (uint8_t) (Value >> 8); - 2e22: c9 2e mov r12, r25 - 2e24: da 2e mov r13, r26 - 2e26: eb 2e mov r14, r27 - 2e28: ff 24 eor r15, r15 - 2e2a: c0 92 c3 20 sts 0x20C3, r12 + 31b4: c9 2e mov r12, r25 + 31b6: da 2e mov r13, r26 + 31b8: eb 2e mov r14, r27 + 31ba: ff 24 eor r15, r15 + 31bc: c0 92 c3 24 sts 0x24C3, r12 Block[2] = (uint8_t) (Value >> 16); - 2e2e: 8d 01 movw r16, r26 - 2e30: 22 27 eor r18, r18 - 2e32: 33 27 eor r19, r19 - 2e34: 00 93 c4 20 sts 0x20C4, r16 + 31c0: 8d 01 movw r16, r26 + 31c2: 22 27 eor r18, r18 + 31c4: 33 27 eor r19, r19 + 31c6: 00 93 c4 24 sts 0x24C4, r16 Block[3] = (uint8_t) (Value >> 24); - 2e38: 4b 2f mov r20, r27 - 2e3a: 55 27 eor r21, r21 - 2e3c: 66 27 eor r22, r22 - 2e3e: 77 27 eor r23, r23 - 2e40: 40 93 c5 20 sts 0x20C5, r20 + 31ca: 4b 2f mov r20, r27 + 31cc: 55 27 eor r21, r21 + 31ce: 66 27 eor r22, r22 + 31d0: 77 27 eor r23, r23 + 31d2: 40 93 c5 24 sts 0x24C5, r20 Block[4] = ~Block[0]; - 2e44: e8 2f mov r30, r24 - 2e46: e0 95 com r30 - 2e48: e0 93 c6 20 sts 0x20C6, r30 + 31d6: e8 2f mov r30, r24 + 31d8: e0 95 com r30 + 31da: e0 93 c6 24 sts 0x24C6, r30 Block[5] = ~Block[1]; - 2e4c: ec 2d mov r30, r12 - 2e4e: e0 95 com r30 - 2e50: e0 93 c7 20 sts 0x20C7, r30 + 31de: ec 2d mov r30, r12 + 31e0: e0 95 com r30 + 31e2: e0 93 c7 24 sts 0x24C7, r30 Block[6] = ~Block[2]; - 2e54: e0 2f mov r30, r16 - 2e56: e0 95 com r30 - 2e58: e0 93 c8 20 sts 0x20C8, r30 + 31e6: e0 2f mov r30, r16 + 31e8: e0 95 com r30 + 31ea: e0 93 c8 24 sts 0x24C8, r30 Block[7] = ~Block[3]; - 2e5c: e4 2f mov r30, r20 - 2e5e: e0 95 com r30 - 2e60: e0 93 c9 20 sts 0x20C9, r30 + 31ee: e4 2f mov r30, r20 + 31f0: e0 95 com r30 + 31f2: e0 93 c9 24 sts 0x24C9, r30 Block[8] = Block[0]; - 2e64: 80 93 ca 20 sts 0x20CA, r24 + 31f6: 80 93 ca 24 sts 0x24CA, r24 Block[9] = Block[1]; - 2e68: c0 92 cb 20 sts 0x20CB, r12 + 31fa: c0 92 cb 24 sts 0x24CB, r12 Block[10] = Block[2]; - 2e6c: 00 93 cc 20 sts 0x20CC, r16 + 31fe: 00 93 cc 24 sts 0x24CC, r16 Block[11] = Block[3]; - 2e70: 40 93 cd 20 sts 0x20CD, r20 + 3202: 40 93 cd 24 sts 0x24CD, r20 /* Do nothing */ } ValueToBlock(BlockBuffer, BlockValue); State = STATE_AUTHED_IDLE; - 2e74: 85 e0 ldi r24, 0x05 ; 5 - 2e76: 80 93 b5 20 sts 0x20B5, r24 + 3206: 85 e0 ldi r24, 0x05 ; 5 + 3208: 80 93 b5 24 sts 0x24B5, r24 /* No ACK response on value commands part 2 */ return ISO14443A_APP_NO_RESPONSE; - 2e7a: 20 e0 ldi r18, 0x00 ; 0 - 2e7c: 30 e0 ldi r19, 0x00 ; 0 - 2e7e: 99 cc rjmp .-1742 ; 0x27b2 + 320c: 20 e0 ldi r18, 0x00 ; 0 + 320e: 30 e0 ldi r19, 0x00 ; 0 + 3210: 99 cc rjmp .-1742 ; 0x2b44 } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_INCREMENT) { if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { - 2e80: 62 e0 ldi r22, 0x02 ; 2 - 2e82: 70 e0 ldi r23, 0x00 ; 0 - 2e84: c8 01 movw r24, r16 - 2e86: ae d0 rcall .+348 ; 0x2fe4 - 2e88: 88 23 and r24, r24 - 2e8a: 09 f4 brne .+2 ; 0x2e8e - 2e8c: 4e cf rjmp .-356 ; 0x2d2a + 3212: 62 e0 ldi r22, 0x02 ; 2 + 3214: 70 e0 ldi r23, 0x00 ; 0 + 3216: c8 01 movw r24, r16 + 3218: ae d0 rcall .+348 ; 0x3376 + 321a: 88 23 and r24, r24 + 321c: 09 f4 brne .+2 ; 0x3220 <__stack+0x221> + 321e: 4e cf rjmp .-356 ; 0x30bc <__stack+0xbd> CurrentAddress = Buffer[1]; - 2e8e: d8 01 movw r26, r16 - 2e90: 11 96 adiw r26, 0x01 ; 1 - 2e92: 8c 91 ld r24, X - 2e94: 80 93 c1 20 sts 0x20C1, r24 + 3220: d8 01 movw r26, r16 + 3222: 11 96 adiw r26, 0x01 ; 1 + 3224: 8c 91 ld r24, X + 3226: 80 93 c1 24 sts 0x24C1, r24 State = STATE_INCREMENT; - 2e98: 87 e0 ldi r24, 0x07 ; 7 - 2e9a: 80 93 b5 20 sts 0x20B5, r24 - 2e9e: 3d cf rjmp .-390 ; 0x2d1a + 322a: 87 e0 ldi r24, 0x07 ; 7 + 322c: 80 93 b5 24 sts 0x24B5, r24 + 3230: 3d cf rjmp .-390 ; 0x30ac <__stack+0xad> } else { Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; } else if (Buffer[0] == CMD_RESTORE) { if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { - 2ea0: 62 e0 ldi r22, 0x02 ; 2 - 2ea2: 70 e0 ldi r23, 0x00 ; 0 - 2ea4: c8 01 movw r24, r16 - 2ea6: 9e d0 rcall .+316 ; 0x2fe4 - 2ea8: 88 23 and r24, r24 - 2eaa: 09 f4 brne .+2 ; 0x2eae - 2eac: aa ce rjmp .-684 ; 0x2c02 + 3232: 62 e0 ldi r22, 0x02 ; 2 + 3234: 70 e0 ldi r23, 0x00 ; 0 + 3236: c8 01 movw r24, r16 + 3238: 9e d0 rcall .+316 ; 0x3376 + 323a: 88 23 and r24, r24 + 323c: 09 f4 brne .+2 ; 0x3240 <__stack+0x241> + 323e: aa ce rjmp .-684 ; 0x2f94 CurrentAddress = Buffer[1]; - 2eae: f8 01 movw r30, r16 - 2eb0: 81 81 ldd r24, Z+1 ; 0x01 - 2eb2: 80 93 c1 20 sts 0x20C1, r24 + 3240: f8 01 movw r30, r16 + 3242: 81 81 ldd r24, Z+1 ; 0x01 + 3244: 80 93 c1 24 sts 0x24C1, r24 State = STATE_RESTORE; - 2eb6: 89 e0 ldi r24, 0x09 ; 9 - 2eb8: 4c cf rjmp .-360 ; 0x2d52 + 3248: 89 e0 ldi r24, 0x09 ; 9 + 324a: 4c cf rjmp .-360 ; 0x30e4 <__stack+0xe5> Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); } return ACK_NAK_FRAME_SIZE; }else if (Buffer[0] == CMD_TRANSFER) { /* Write back the global block buffer to the desired block address */ if (ISO14443ACheckCRCA(Buffer, CMD_TRANSFER_FRAME_SIZE)) { - 2eba: 62 e0 ldi r22, 0x02 ; 2 - 2ebc: 70 e0 ldi r23, 0x00 ; 0 - 2ebe: c8 01 movw r24, r16 - 2ec0: 91 d0 rcall .+290 ; 0x2fe4 - 2ec2: 88 23 and r24, r24 - 2ec4: 09 f4 brne .+2 ; 0x2ec8 - 2ec6: 31 cf rjmp .-414 ; 0x2d2a + 324c: 62 e0 ldi r22, 0x02 ; 2 + 324e: 70 e0 ldi r23, 0x00 ; 0 + 3250: c8 01 movw r24, r16 + 3252: 91 d0 rcall .+290 ; 0x3376 + 3254: 88 23 and r24, r24 + 3256: 09 f4 brne .+2 ; 0x325a <__stack+0x25b> + 3258: 31 cf rjmp .-414 ; 0x30bc <__stack+0xbd> if (!ActiveConfiguration.ReadOnly) { - 2ec8: 80 91 fc 20 lds r24, 0x20FC - 2ecc: 81 11 cpse r24, r1 - 2ece: 25 cf rjmp .-438 ; 0x2d1a + 325a: 80 91 fc 24 lds r24, 0x24FC + 325e: 81 11 cpse r24, r1 + 3260: 25 cf rjmp .-438 ; 0x30ac <__stack+0xad> MemoryWriteBlock(BlockBuffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK ); - 2ed0: d8 01 movw r26, r16 - 2ed2: 11 96 adiw r26, 0x01 ; 1 - 2ed4: 6c 91 ld r22, X - 2ed6: b0 e1 ldi r27, 0x10 ; 16 - 2ed8: 6b 9f mul r22, r27 - 2eda: b0 01 movw r22, r0 - 2edc: 11 24 eor r1, r1 - 2ede: 40 e1 ldi r20, 0x10 ; 16 - 2ee0: 50 e0 ldi r21, 0x00 ; 0 - 2ee2: 82 ec ldi r24, 0xC2 ; 194 - 2ee4: 90 e2 ldi r25, 0x20 ; 32 - 2ee6: 0e 94 81 06 call 0xd02 ; 0xd02 - 2eea: 17 cf rjmp .-466 ; 0x2d1a + 3262: d8 01 movw r26, r16 + 3264: 11 96 adiw r26, 0x01 ; 1 + 3266: 6c 91 ld r22, X + 3268: b0 e1 ldi r27, 0x10 ; 16 + 326a: 6b 9f mul r22, r27 + 326c: b0 01 movw r22, r0 + 326e: 11 24 eor r1, r1 + 3270: 40 e1 ldi r20, 0x10 ; 16 + 3272: 50 e0 ldi r21, 0x00 ; 0 + 3274: 82 ec ldi r24, 0xC2 ; 194 + 3276: 94 e2 ldi r25, 0x24 ; 36 + 3278: 0e 94 ba 05 call 0xb74 ; 0xb74 + 327c: 17 cf rjmp .-466 ; 0x30ac <__stack+0xad> ValueFromBlock(&ParamValue, Buffer); ValueFromBlock(&BlockValue, BlockBuffer); if (State == STATE_DECREMENT) { BlockValue -= ParamValue; - 2eec: 84 1b sub r24, r20 - 2eee: 95 0b sbc r25, r21 - 2ef0: a6 0b sbc r26, r22 - 2ef2: b7 0b sbc r27, r23 - 2ef4: 94 cf rjmp .-216 ; 0x2e1e + 327e: 84 1b sub r24, r20 + 3280: 95 0b sbc r25, r21 + 3282: a6 0b sbc r26, r22 + 3284: b7 0b sbc r27, r23 + 3286: 94 cf rjmp .-216 ; 0x31b0 <__stack+0x1b1> return BitCount; } else if (Buffer[0] == CMD_HALT) { /* Halts the tag. According to the ISO14443, the second * byte is supposed to be 0. */ if (Buffer[1] == 0) { if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { - 2ef6: 62 e0 ldi r22, 0x02 ; 2 - 2ef8: 70 e0 ldi r23, 0x00 ; 0 - 2efa: c8 01 movw r24, r16 - 2efc: 73 d0 rcall .+230 ; 0x2fe4 - 2efe: 81 11 cpse r24, r1 - 2f00: a7 cc rjmp .-1714 ; 0x2850 + 3288: 62 e0 ldi r22, 0x02 ; 2 + 328a: 70 e0 ldi r23, 0x00 ; 0 + 328c: c8 01 movw r24, r16 + 328e: 73 d0 rcall .+230 ; 0x3376 + 3290: 81 11 cpse r24, r1 + 3292: a7 cc rjmp .-1714 ; 0x2be2 /* Setup crypto1 cipher. Discard in-place encrypted CardNonce. */ Crypto1Setup(Key, Uid, CardNonce); return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; } else { Buffer[0] = NAK_CRC_ERROR; - 2f02: 81 e0 ldi r24, 0x01 ; 1 - 2f04: d8 01 movw r26, r16 - 2f06: 8c 93 st X, r24 + 3294: 81 e0 ldi r24, 0x01 ; 1 + 3296: d8 01 movw r26, r16 + 3298: 8c 93 st X, r24 return ACK_NAK_FRAME_SIZE; - 2f08: 24 e0 ldi r18, 0x04 ; 4 - 2f0a: 30 e0 ldi r19, 0x00 ; 0 - 2f0c: 52 cc rjmp .-1884 ; 0x27b2 + 329a: 24 e0 ldi r18, 0x04 ; 4 + 329c: 30 e0 ldi r19, 0x00 ; 0 + 329e: 52 cc rjmp .-1884 ; 0x2b44 switch (NVB) { case ISO14443A_NVB_AC_START: /* Start of anticollision procedure. * Send whole UID CLn + BCC */ DataPtr[0] = UidCL[0]; - 2f0e: 89 81 ldd r24, Y+1 ; 0x01 - 2f10: f8 01 movw r30, r16 - 2f12: 80 83 st Z, r24 + 32a0: 89 81 ldd r24, Y+1 ; 0x01 + 32a2: f8 01 movw r30, r16 + 32a4: 80 83 st Z, r24 DataPtr[1] = UidCL[1]; - 2f14: 3a 81 ldd r19, Y+2 ; 0x02 - 2f16: 31 83 std Z+1, r19 ; 0x01 + 32a6: 3a 81 ldd r19, Y+2 ; 0x02 + 32a8: 31 83 std Z+1, r19 ; 0x01 DataPtr[2] = UidCL[2]; - 2f18: 2b 81 ldd r18, Y+3 ; 0x03 - 2f1a: 22 83 std Z+2, r18 ; 0x02 + 32aa: 2b 81 ldd r18, Y+3 ; 0x03 + 32ac: 22 83 std Z+2, r18 ; 0x02 DataPtr[3] = UidCL[3]; - 2f1c: 9c 81 ldd r25, Y+4 ; 0x04 - 2f1e: 93 83 std Z+3, r25 ; 0x03 + 32ae: 9c 81 ldd r25, Y+4 ; 0x04 + 32b0: 93 83 std Z+3, r25 ; 0x03 DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 2f20: 83 27 eor r24, r19 - 2f22: 82 27 eor r24, r18 - 2f24: 89 27 eor r24, r25 - 2f26: 84 83 std Z+4, r24 ; 0x04 + 32b2: 83 27 eor r24, r19 + 32b4: 82 27 eor r24, r18 + 32b6: 89 27 eor r24, r25 + 32b8: 84 83 std Z+4, r24 ; 0x04 *BitCount = ISO14443A_CL_FRAME_SIZE; - 2f28: 28 e2 ldi r18, 0x28 ; 40 - 2f2a: 30 e0 ldi r19, 0x00 ; 0 - 2f2c: 42 cc rjmp .-1916 ; 0x27b2 + 32ba: 28 e2 ldi r18, 0x28 ; 40 + 32bc: 30 e0 ldi r19, 0x00 ; 0 + 32be: 42 cc rjmp .-1916 ; 0x2b44 return ACK_NAK_FRAME_SIZE; } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { /* Nested authentication. */ uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 2f2e: 60 e3 ldi r22, 0x30 ; 48 - 2f30: 70 e0 ldi r23, 0x00 ; 0 - 2f32: 7a cd rjmp .-1292 ; 0x2a28 + 32c0: 60 e3 ldi r22, 0x30 ; 48 + 32c2: 70 e0 ldi r23, 0x00 ; 0 + 32c4: 7a cd rjmp .-1292 ; 0x2dba return ACK_NAK_FRAME_SIZE; } } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 2f34: 80 e3 ldi r24, 0x30 ; 48 - 2f36: 90 e0 ldi r25, 0x00 ; 0 - 2f38: e6 cd rjmp .-1076 ; 0x2b06 + 32c6: 80 e3 ldi r24, 0x30 ; 48 + 32c8: 90 e0 ldi r25, 0x00 ; 0 + 32ca: e6 cd rjmp .-1076 ; 0x2e98 -00002f3a : +000032cc : return ISO14443A_APP_NO_RESPONSE; } void MifareClassicGetUid(ConfigurationUidType Uid) { MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2f3a: 44 e0 ldi r20, 0x04 ; 4 - 2f3c: 50 e0 ldi r21, 0x00 ; 0 - 2f3e: 60 e0 ldi r22, 0x00 ; 0 - 2f40: 70 e0 ldi r23, 0x00 ; 0 - 2f42: 0c 94 fc 05 jmp 0xbf8 ; 0xbf8 + 32cc: 44 e0 ldi r20, 0x04 ; 4 + 32ce: 50 e0 ldi r21, 0x00 ; 0 + 32d0: 60 e0 ldi r22, 0x00 ; 0 + 32d2: 70 e0 ldi r23, 0x00 ; 0 + 32d4: 0c 94 a2 05 jmp 0xb44 ; 0xb44 -00002f46 : +000032d8 : } void MifareClassicSetUid(ConfigurationUidType Uid) { - 2f46: cf 93 push r28 - 2f48: df 93 push r29 - 2f4a: 1f 92 push r1 - 2f4c: cd b7 in r28, 0x3d ; 61 - 2f4e: de b7 in r29, 0x3e ; 62 + 32d8: cf 93 push r28 + 32da: df 93 push r29 + 32dc: 1f 92 push r1 + 32de: cd b7 in r28, 0x3d ; 61 + 32e0: de b7 in r29, 0x3e ; 62 uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; - 2f50: fc 01 movw r30, r24 - 2f52: 21 81 ldd r18, Z+1 ; 0x01 - 2f54: 30 81 ld r19, Z - 2f56: 23 27 eor r18, r19 - 2f58: 32 81 ldd r19, Z+2 ; 0x02 - 2f5a: 23 27 eor r18, r19 - 2f5c: 33 81 ldd r19, Z+3 ; 0x03 - 2f5e: 23 27 eor r18, r19 - 2f60: 29 83 std Y+1, r18 ; 0x01 + 32e2: fc 01 movw r30, r24 + 32e4: 21 81 ldd r18, Z+1 ; 0x01 + 32e6: 30 81 ld r19, Z + 32e8: 23 27 eor r18, r19 + 32ea: 32 81 ldd r19, Z+2 ; 0x02 + 32ec: 23 27 eor r18, r19 + 32ee: 33 81 ldd r19, Z+3 ; 0x03 + 32f0: 23 27 eor r18, r19 + 32f2: 29 83 std Y+1, r18 ; 0x01 MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2f62: 44 e0 ldi r20, 0x04 ; 4 - 2f64: 50 e0 ldi r21, 0x00 ; 0 - 2f66: 60 e0 ldi r22, 0x00 ; 0 - 2f68: 70 e0 ldi r23, 0x00 ; 0 - 2f6a: 0e 94 81 06 call 0xd02 ; 0xd02 + 32f4: 44 e0 ldi r20, 0x04 ; 4 + 32f6: 50 e0 ldi r21, 0x00 ; 0 + 32f8: 60 e0 ldi r22, 0x00 ; 0 + 32fa: 70 e0 ldi r23, 0x00 ; 0 + 32fc: 0e 94 ba 05 call 0xb74 ; 0xb74 MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); - 2f6e: 41 e0 ldi r20, 0x01 ; 1 - 2f70: 50 e0 ldi r21, 0x00 ; 0 - 2f72: 64 e0 ldi r22, 0x04 ; 4 - 2f74: 70 e0 ldi r23, 0x00 ; 0 - 2f76: ce 01 movw r24, r28 - 2f78: 01 96 adiw r24, 0x01 ; 1 - 2f7a: 0e 94 81 06 call 0xd02 ; 0xd02 + 3300: 41 e0 ldi r20, 0x01 ; 1 + 3302: 50 e0 ldi r21, 0x00 ; 0 + 3304: 64 e0 ldi r22, 0x04 ; 4 + 3306: 70 e0 ldi r23, 0x00 ; 0 + 3308: ce 01 movw r24, r28 + 330a: 01 96 adiw r24, 0x01 ; 1 + 330c: 0e 94 ba 05 call 0xb74 ; 0xb74 } - 2f7e: 0f 90 pop r0 - 2f80: df 91 pop r29 - 2f82: cf 91 pop r28 - 2f84: 08 95 ret + 3310: 0f 90 pop r0 + 3312: df 91 pop r29 + 3314: cf 91 pop r28 + 3316: 08 95 ret -00002f86 : +00003318 : void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { - 2f86: 61 15 cp r22, r1 - 2f88: 71 05 cpc r23, r1 - 2f8a: 41 f1 breq .+80 ; 0x2fdc + 3318: 61 15 cp r22, r1 + 331a: 71 05 cpc r23, r1 + 331c: 41 f1 breq .+80 ; 0x336e * policies, either expressed or implied, of the ORIGINAL AUTHORS. */ #include "ISO14443-3A.h" void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { - 2f8c: 68 0f add r22, r24 - 2f8e: 79 1f adc r23, r25 + 331e: 68 0f add r22, r24 + 3320: 79 1f adc r23, r25 uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; - 2f90: fc 01 movw r30, r24 + 3322: fc 01 movw r30, r24 */ #include "ISO14443-3A.h" void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; - 2f92: 23 e6 ldi r18, 0x63 ; 99 - 2f94: 33 e6 ldi r19, 0x63 ; 99 + 3324: 23 e6 ldi r18, 0x63 ; 99 + 3326: 33 e6 ldi r19, 0x63 ; 99 uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { uint8_t Byte = *DataPtr++; - 2f96: 41 91 ld r20, Z+ + 3328: 41 91 ld r20, Z+ Byte ^= (uint8_t) (Checksum & 0x00FF); - 2f98: 42 27 eor r20, r18 + 332a: 42 27 eor r20, r18 Byte ^= Byte << 4; - 2f9a: 50 e1 ldi r21, 0x10 ; 16 - 2f9c: 45 9f mul r20, r21 - 2f9e: c0 01 movw r24, r0 - 2fa0: 11 24 eor r1, r1 - 2fa2: a4 2f mov r26, r20 - 2fa4: a8 27 eor r26, r24 + 332c: 50 e1 ldi r21, 0x10 ; 16 + 332e: 45 9f mul r20, r21 + 3330: c0 01 movw r24, r0 + 3332: 11 24 eor r1, r1 + 3334: a4 2f mov r26, r20 + 3336: a8 27 eor r26, r24 Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 2fa6: 8a 2f mov r24, r26 - 2fa8: 90 e0 ldi r25, 0x00 ; 0 - 2faa: 58 2f mov r21, r24 - 2fac: 44 27 eor r20, r20 + 3338: 8a 2f mov r24, r26 + 333a: 90 e0 ldi r25, 0x00 ; 0 + 333c: 58 2f mov r21, r24 + 333e: 44 27 eor r20, r20 ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 2fae: 88 0f add r24, r24 - 2fb0: 99 1f adc r25, r25 - 2fb2: 88 0f add r24, r24 - 2fb4: 99 1f adc r25, r25 - 2fb6: 88 0f add r24, r24 - 2fb8: 99 1f adc r25, r25 + 3340: 88 0f add r24, r24 + 3342: 99 1f adc r25, r25 + 3344: 88 0f add r24, r24 + 3346: 99 1f adc r25, r25 + 3348: 88 0f add r24, r24 + 334a: 99 1f adc r25, r25 uint8_t Byte = *DataPtr++; Byte ^= (uint8_t) (Checksum & 0x00FF); Byte ^= Byte << 4; Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 2fba: 48 27 eor r20, r24 - 2fbc: 59 27 eor r21, r25 - 2fbe: 23 2f mov r18, r19 - 2fc0: 33 27 eor r19, r19 - 2fc2: 24 27 eor r18, r20 - 2fc4: 35 27 eor r19, r21 + 334c: 48 27 eor r20, r24 + 334e: 59 27 eor r21, r25 + 3350: 23 2f mov r18, r19 + 3352: 33 27 eor r19, r19 + 3354: 24 27 eor r18, r20 + 3356: 35 27 eor r19, r21 ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 2fc6: a2 95 swap r26 - 2fc8: af 70 andi r26, 0x0F ; 15 + 3358: a2 95 swap r26 + 335a: af 70 andi r26, 0x0F ; 15 uint8_t Byte = *DataPtr++; Byte ^= (uint8_t) (Checksum & 0x00FF); Byte ^= Byte << 4; Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 2fca: 2a 27 eor r18, r26 + 335c: 2a 27 eor r18, r26 void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { - 2fcc: e6 17 cp r30, r22 - 2fce: f7 07 cpc r31, r23 - 2fd0: 11 f7 brne .-60 ; 0x2f96 - 2fd2: 92 2f mov r25, r18 - 2fd4: 83 2f mov r24, r19 + 335e: e6 17 cp r30, r22 + 3360: f7 07 cpc r31, r23 + 3362: 11 f7 brne .-60 ; 0x3328 + 3364: 92 2f mov r25, r18 + 3366: 83 2f mov r24, r19 Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); } *DataPtr++ = (Checksum >> 0) & 0x00FF; - 2fd6: 90 83 st Z, r25 + 3368: 90 83 st Z, r25 *DataPtr = (Checksum >> 8) & 0x00FF; - 2fd8: 81 83 std Z+1, r24 ; 0x01 - 2fda: 08 95 ret + 336a: 81 83 std Z+1, r24 ; 0x01 + 336c: 08 95 ret #include "ISO14443-3A.h" void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; - 2fdc: fc 01 movw r30, r24 + 336e: fc 01 movw r30, r24 while(ByteCount--) { - 2fde: 83 e6 ldi r24, 0x63 ; 99 - 2fe0: 93 e6 ldi r25, 0x63 ; 99 - 2fe2: f9 cf rjmp .-14 ; 0x2fd6 + 3370: 83 e6 ldi r24, 0x63 ; 99 + 3372: 93 e6 ldi r25, 0x63 ; 99 + 3374: f9 cf rjmp .-14 ; 0x3368 -00002fe4 : +00003376 : bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { - 2fe4: 61 15 cp r22, r1 - 2fe6: 71 05 cpc r23, r1 - 2fe8: b1 f1 breq .+108 ; 0x3056 <__stack+0x57> + 3376: 61 15 cp r22, r1 + 3378: 71 05 cpc r23, r1 + 337a: b1 f1 breq .+108 ; 0x33e8 *DataPtr++ = (Checksum >> 0) & 0x00FF; *DataPtr = (Checksum >> 8) & 0x00FF; } bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) - 2fea: 68 0f add r22, r24 - 2fec: 79 1f adc r23, r25 + 337c: 68 0f add r22, r24 + 337e: 79 1f adc r23, r25 { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; - 2fee: fc 01 movw r30, r24 + 3380: fc 01 movw r30, r24 *DataPtr = (Checksum >> 8) & 0x00FF; } bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; - 2ff0: 23 e6 ldi r18, 0x63 ; 99 - 2ff2: 33 e6 ldi r19, 0x63 ; 99 + 3382: 23 e6 ldi r18, 0x63 ; 99 + 3384: 33 e6 ldi r19, 0x63 ; 99 uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { uint8_t Byte = *DataPtr++; - 2ff4: 41 91 ld r20, Z+ + 3386: 41 91 ld r20, Z+ Byte ^= (uint8_t) (Checksum & 0x00FF); - 2ff6: 42 27 eor r20, r18 + 3388: 42 27 eor r20, r18 Byte ^= Byte << 4; - 2ff8: 50 e1 ldi r21, 0x10 ; 16 - 2ffa: 45 9f mul r20, r21 - 2ffc: c0 01 movw r24, r0 - 2ffe: 11 24 eor r1, r1 - 3000: a4 2f mov r26, r20 - 3002: a8 27 eor r26, r24 + 338a: 50 e1 ldi r21, 0x10 ; 16 + 338c: 45 9f mul r20, r21 + 338e: c0 01 movw r24, r0 + 3390: 11 24 eor r1, r1 + 3392: a4 2f mov r26, r20 + 3394: a8 27 eor r26, r24 Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 3004: 8a 2f mov r24, r26 - 3006: 90 e0 ldi r25, 0x00 ; 0 - 3008: 58 2f mov r21, r24 - 300a: 44 27 eor r20, r20 + 3396: 8a 2f mov r24, r26 + 3398: 90 e0 ldi r25, 0x00 ; 0 + 339a: 58 2f mov r21, r24 + 339c: 44 27 eor r20, r20 ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 300c: 88 0f add r24, r24 - 300e: 99 1f adc r25, r25 - 3010: 88 0f add r24, r24 - 3012: 99 1f adc r25, r25 - 3014: 88 0f add r24, r24 - 3016: 99 1f adc r25, r25 + 339e: 88 0f add r24, r24 + 33a0: 99 1f adc r25, r25 + 33a2: 88 0f add r24, r24 + 33a4: 99 1f adc r25, r25 + 33a6: 88 0f add r24, r24 + 33a8: 99 1f adc r25, r25 uint8_t Byte = *DataPtr++; Byte ^= (uint8_t) (Checksum & 0x00FF); Byte ^= Byte << 4; Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 3018: 48 27 eor r20, r24 - 301a: 59 27 eor r21, r25 - 301c: 23 2f mov r18, r19 - 301e: 33 27 eor r19, r19 - 3020: 24 27 eor r18, r20 - 3022: 35 27 eor r19, r21 + 33aa: 48 27 eor r20, r24 + 33ac: 59 27 eor r21, r25 + 33ae: 23 2f mov r18, r19 + 33b0: 33 27 eor r19, r19 + 33b2: 24 27 eor r18, r20 + 33b4: 35 27 eor r19, r21 ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 3024: a2 95 swap r26 - 3026: af 70 andi r26, 0x0F ; 15 + 33b6: a2 95 swap r26 + 33b8: af 70 andi r26, 0x0F ; 15 uint8_t Byte = *DataPtr++; Byte ^= (uint8_t) (Checksum & 0x00FF); Byte ^= Byte << 4; Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 3028: 2a 27 eor r18, r26 + 33ba: 2a 27 eor r18, r26 bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; while(ByteCount--) { - 302a: e6 17 cp r30, r22 - 302c: f7 07 cpc r31, r23 - 302e: 11 f7 brne .-60 ; 0x2ff4 - 3030: a9 01 movw r20, r18 - 3032: 55 27 eor r21, r21 + 33bc: e6 17 cp r30, r22 + 33be: f7 07 cpc r31, r23 + 33c0: 11 f7 brne .-60 ; 0x3386 + 33c2: a9 01 movw r20, r18 + 33c4: 55 27 eor r21, r21 Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); } return (DataPtr[0] == ((Checksum >> 0) & 0xFF)) && (DataPtr[1] == ((Checksum >> 8) & 0xFF)); - 3034: 80 81 ld r24, Z - 3036: 90 e0 ldi r25, 0x00 ; 0 - 3038: 84 17 cp r24, r20 - 303a: 95 07 cpc r25, r21 - 303c: 11 f0 breq .+4 ; 0x3042 <__stack+0x43> - 303e: 80 e0 ldi r24, 0x00 ; 0 + 33c6: 80 81 ld r24, Z + 33c8: 90 e0 ldi r25, 0x00 ; 0 + 33ca: 84 17 cp r24, r20 + 33cc: 95 07 cpc r25, r21 + 33ce: 11 f0 breq .+4 ; 0x33d4 + 33d0: 80 e0 ldi r24, 0x00 ; 0 } - 3040: 08 95 ret + 33d2: 08 95 ret Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); } return (DataPtr[0] == ((Checksum >> 0) & 0xFF)) && (DataPtr[1] == ((Checksum >> 8) & 0xFF)); - 3042: 41 81 ldd r20, Z+1 ; 0x01 - 3044: 50 e0 ldi r21, 0x00 ; 0 - 3046: 23 2f mov r18, r19 - 3048: 33 27 eor r19, r19 - 304a: 81 e0 ldi r24, 0x01 ; 1 - 304c: 42 17 cp r20, r18 - 304e: 53 07 cpc r21, r19 - 3050: b9 f3 breq .-18 ; 0x3040 <__stack+0x41> - 3052: 80 e0 ldi r24, 0x00 ; 0 - 3054: f5 cf rjmp .-22 ; 0x3040 <__stack+0x41> + 33d4: 41 81 ldd r20, Z+1 ; 0x01 + 33d6: 50 e0 ldi r21, 0x00 ; 0 + 33d8: 23 2f mov r18, r19 + 33da: 33 27 eor r19, r19 + 33dc: 81 e0 ldi r24, 0x01 ; 1 + 33de: 42 17 cp r20, r18 + 33e0: 53 07 cpc r21, r19 + 33e2: b9 f3 breq .-18 ; 0x33d2 + 33e4: 80 e0 ldi r24, 0x00 ; 0 + 33e6: f5 cf rjmp .-22 ; 0x33d2 } bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; uint8_t* DataPtr = (uint8_t*) Buffer; - 3056: fc 01 movw r30, r24 + 33e8: fc 01 movw r30, r24 while(ByteCount--) { - 3058: 43 e6 ldi r20, 0x63 ; 99 - 305a: 50 e0 ldi r21, 0x00 ; 0 + 33ea: 43 e6 ldi r20, 0x63 ; 99 + 33ec: 50 e0 ldi r21, 0x00 ; 0 *DataPtr = (Checksum >> 8) & 0x00FF; } bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) { uint16_t Checksum = 0x6363; - 305c: 23 e6 ldi r18, 0x63 ; 99 - 305e: 33 e6 ldi r19, 0x63 ; 99 - 3060: e9 cf rjmp .-46 ; 0x3034 <__stack+0x35> + 33ee: 23 e6 ldi r18, 0x63 ; 99 + 33f0: 33 e6 ldi r19, 0x63 ; 99 + 33f2: e9 cf rjmp .-46 ; 0x33c6 -00003062 : +000033f4 : /* Split Crypto1 state into even and odd bits to speed up the output filter network */ static uint8_t StateEven[LFSR_SIZE/2] = {0}; static uint8_t StateOdd[LFSR_SIZE/2] = {0}; /* Proceed LFSR by one clock cycle */ static void Crypto1LFSR(uint8_t In) { - 3062: cf 93 push r28 + 33f4: cf 93 push r28 uint8_t Feedback = 0; /* Calculate feedback according to LFSR taps. XOR all 6 state bytes * into a single bit. */ Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); - 3064: b0 91 d5 20 lds r27, 0x20D5 + 33f6: b0 91 d5 24 lds r27, 0x24D5 Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); - 3068: c0 91 d6 20 lds r28, 0x20D6 + 33fa: c0 91 d6 24 lds r28, 0x24D6 Feedback ^= StateEven[2] & (uint8_t) (LFSR_MASK_EVEN >> 16); - 306c: 40 91 d7 20 lds r20, 0x20D7 + 33fe: 40 91 d7 24 lds r20, 0x24D7 Feedback ^= StateOdd[0] & (uint8_t) (LFSR_MASK_ODD >> 0); - 3070: a0 91 d2 20 lds r26, 0x20D2 + 3402: a0 91 d2 24 lds r26, 0x24D2 Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); - 3074: f0 91 d3 20 lds r31, 0x20D3 + 3406: f0 91 d3 24 lds r31, 0x24D3 Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); - 3078: e0 91 d4 20 lds r30, 0x20D4 + 340a: e0 91 d4 24 lds r30, 0x24D4 uint8_t Feedback = 0; /* Calculate feedback according to LFSR taps. XOR all 6 state bytes * into a single bit. */ Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); - 307c: 9c 2f mov r25, r28 - 307e: 90 71 andi r25, 0x10 ; 16 + 340e: 9c 2f mov r25, r28 + 3410: 90 71 andi r25, 0x10 ; 16 static void Crypto1LFSR(uint8_t In) { uint8_t Feedback = 0; /* Calculate feedback according to LFSR taps. XOR all 6 state bytes * into a single bit. */ Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); - 3080: 2b 2f mov r18, r27 - 3082: 21 7e andi r18, 0xE1 ; 225 + 3412: 2b 2f mov r18, r27 + 3414: 21 7e andi r18, 0xE1 ; 225 Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); - 3084: 92 27 eor r25, r18 + 3416: 92 27 eor r25, r18 Feedback ^= StateEven[2] & (uint8_t) (LFSR_MASK_EVEN >> 16); - 3086: 24 2f mov r18, r20 - 3088: 20 72 andi r18, 0x20 ; 32 - 308a: 92 27 eor r25, r18 + 3418: 24 2f mov r18, r20 + 341a: 20 72 andi r18, 0x20 ; 32 + 341c: 92 27 eor r25, r18 Feedback ^= StateOdd[0] & (uint8_t) (LFSR_MASK_ODD >> 0); - 308c: 2a 2f mov r18, r26 - 308e: 24 79 andi r18, 0x94 ; 148 - 3090: 92 27 eor r25, r18 + 341e: 2a 2f mov r18, r26 + 3420: 24 79 andi r18, 0x94 ; 148 + 3422: 92 27 eor r25, r18 Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); - 3092: 2f 2f mov r18, r31 - 3094: 23 77 andi r18, 0x73 ; 115 - 3096: 92 27 eor r25, r18 + 3424: 2f 2f mov r18, r31 + 3426: 23 77 andi r18, 0x73 ; 115 + 3428: 92 27 eor r25, r18 Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); - 3098: 2e 2f mov r18, r30 - 309a: 2a 73 andi r18, 0x3A ; 58 - 309c: 92 27 eor r25, r18 + 342a: 2e 2f mov r18, r30 + 342c: 2a 73 andi r18, 0x3A ; 58 + 342e: 92 27 eor r25, r18 Feedback ^= Feedback >> 4; - 309e: 39 2f mov r19, r25 - 30a0: 32 95 swap r19 - 30a2: 3f 70 andi r19, 0x0F ; 15 - 30a4: 39 27 eor r19, r25 + 3430: 39 2f mov r19, r25 + 3432: 32 95 swap r19 + 3434: 3f 70 andi r19, 0x0F ; 15 + 3436: 39 27 eor r19, r25 Feedback ^= Feedback >> 2; - 30a6: 23 2f mov r18, r19 - 30a8: 26 95 lsr r18 - 30aa: 26 95 lsr r18 - 30ac: 23 27 eor r18, r19 + 3438: 23 2f mov r18, r19 + 343a: 26 95 lsr r18 + 343c: 26 95 lsr r18 + 343e: 23 27 eor r18, r19 Feedback ^= Feedback >> 1; - 30ae: 92 2f mov r25, r18 - 30b0: 96 95 lsr r25 + 3440: 92 2f mov r25, r18 + 3442: 96 95 lsr r25 * - the new odd state becomes the old even state right-shifted by 1. * For shifting the even state, we convert it into a 32 bit int first */ uint32_t Temp = 0; Temp |= ((uint32_t) StateEven[0] << 0); Temp |= ((uint32_t) StateEven[1] << 8); Temp |= ((uint32_t) StateEven[2] << 16); - 30b2: 50 e0 ldi r21, 0x00 ; 0 - 30b4: 60 e0 ldi r22, 0x00 ; 0 - 30b6: 70 e0 ldi r23, 0x00 ; 0 - 30b8: ba 01 movw r22, r20 - 30ba: 55 27 eor r21, r21 - 30bc: 44 27 eor r20, r20 + 3444: 50 e0 ldi r21, 0x00 ; 0 + 3446: 60 e0 ldi r22, 0x00 ; 0 + 3448: 70 e0 ldi r23, 0x00 ; 0 + 344a: ba 01 movw r22, r20 + 344c: 55 27 eor r21, r21 + 344e: 44 27 eor r20, r20 * - the new even state becomes the old odd state * - the new odd state becomes the old even state right-shifted by 1. * For shifting the even state, we convert it into a 32 bit int first */ uint32_t Temp = 0; Temp |= ((uint32_t) StateEven[0] << 0); Temp |= ((uint32_t) StateEven[1] << 8); - 30be: 5c 2b or r21, r28 + 3450: 5c 2b or r21, r28 Temp |= ((uint32_t) StateEven[2] << 16); - 30c0: 4b 2b or r20, r27 + 3452: 4b 2b or r20, r27 /* Proceed LFSR. Try to force compiler not to shift the unneded upper bits. */ Temp = (Temp >> 1) & 0x00FFFFFF; - 30c2: 76 95 lsr r23 - 30c4: 67 95 ror r22 - 30c6: 57 95 ror r21 - 30c8: 47 95 ror r20 + 3454: 76 95 lsr r23 + 3456: 67 95 ror r22 + 3458: 57 95 ror r21 + 345a: 47 95 ror r20 Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); Feedback ^= Feedback >> 4; Feedback ^= Feedback >> 2; Feedback ^= Feedback >> 1; - 30ca: 92 27 eor r25, r18 + 345c: 92 27 eor r25, r18 /* Proceed LFSR. Try to force compiler not to shift the unneded upper bits. */ Temp = (Temp >> 1) & 0x00FFFFFF; /* Calculate MSBit of even state as input bit to LFSR */ if ( (Feedback & 0x01) ^ In ) { - 30cc: 91 70 andi r25, 0x01 ; 1 - 30ce: 98 13 cpse r25, r24 + 345e: 91 70 andi r25, 0x01 ; 1 + 3460: 98 13 cpse r25, r24 Temp |= (uint32_t) 1 << (8 * LFSR_SIZE/2 - 1); - 30d0: 60 68 ori r22, 0x80 ; 128 + 3462: 60 68 ori r22, 0x80 ; 128 } /* Convert even state back into byte array and swap odd/even state * as explained above. */ StateEven[0] = StateOdd[0]; - 30d2: a0 93 d5 20 sts 0x20D5, r26 + 3464: a0 93 d5 24 sts 0x24D5, r26 StateEven[1] = StateOdd[1]; - 30d6: f0 93 d6 20 sts 0x20D6, r31 + 3468: f0 93 d6 24 sts 0x24D6, r31 StateEven[2] = StateOdd[2]; - 30da: e0 93 d7 20 sts 0x20D7, r30 + 346c: e0 93 d7 24 sts 0x24D7, r30 StateOdd[0] = (uint8_t) (Temp >> 0); - 30de: 40 93 d2 20 sts 0x20D2, r20 + 3470: 40 93 d2 24 sts 0x24D2, r20 StateOdd[1] = (uint8_t) (Temp >> 8); - 30e2: 50 93 d3 20 sts 0x20D3, r21 + 3474: 50 93 d3 24 sts 0x24D3, r21 StateOdd[2] = (uint8_t) (Temp >> 16); - 30e6: 60 93 d4 20 sts 0x20D4, r22 + 3478: 60 93 d4 24 sts 0x24D4, r22 } - 30ea: cf 91 pop r28 - 30ec: 08 95 ret + 347c: cf 91 pop r28 + 347e: 08 95 ret -000030ee : +00003480 : uint8_t Crypto1FilterOutput(void) { - 30ee: cf 93 push r28 - 30f0: df 93 push r29 + 3480: cf 93 push r28 + 3482: df 93 push r29 * 5 bits that are used to lookup the output bit. */ uint8_t Sum = 0; Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; - 30f2: c0 91 d3 20 lds r28, 0x20D3 + 3484: c0 91 d3 24 lds r28, 0x24D3 Sum |= TableAB[2][(StateOdd[1] >> 4) & 0x0F]; Sum |= TableAB[3][(StateOdd[2] >> 0) & 0x0F]; - 30f6: 90 91 d4 20 lds r25, 0x20D4 - 30fa: a9 2f mov r26, r25 - 30fc: af 70 andi r26, 0x0F ; 15 - 30fe: b0 e0 ldi r27, 0x00 ; 0 - 3100: a0 5e subi r26, 0xE0 ; 224 - 3102: bf 4d sbci r27, 0xDF ; 223 + 3488: 90 91 d4 24 lds r25, 0x24D4 + 348c: a9 2f mov r26, r25 + 348e: af 70 andi r26, 0x0F ; 15 + 3490: b0 e0 ldi r27, 0x00 ; 0 + 3492: a0 5e subi r26, 0xE0 ; 224 + 3494: bf 4d sbci r27, 0xDF ; 223 * 5 bits that are used to lookup the output bit. */ uint8_t Sum = 0; Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; - 3104: ec 2f mov r30, r28 - 3106: ef 70 andi r30, 0x0F ; 15 - 3108: f0 e0 ldi r31, 0x00 ; 0 - 310a: e0 5e subi r30, 0xE0 ; 224 - 310c: ff 4d sbci r31, 0xDF ; 223 - 310e: d0 96 adiw r26, 0x30 ; 48 - 3110: 8c 91 ld r24, X - 3112: 20 89 ldd r18, Z+16 ; 0x10 - 3114: 82 2b or r24, r18 + 3496: ec 2f mov r30, r28 + 3498: ef 70 andi r30, 0x0F ; 15 + 349a: f0 e0 ldi r31, 0x00 ; 0 + 349c: e0 5e subi r30, 0xE0 ; 224 + 349e: ff 4d sbci r31, 0xDF ; 223 + 34a0: d0 96 adiw r26, 0x30 ; 48 + 34a2: 8c 91 ld r24, X + 34a4: 20 89 ldd r18, Z+16 ; 0x10 + 34a6: 82 2b or r24, r18 * can simply be ORed together to produce the resulting * 5 bits that are used to lookup the output bit. */ uint8_t Sum = 0; Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; - 3116: e0 91 d2 20 lds r30, 0x20D2 - 311a: e2 95 swap r30 - 311c: ef 70 andi r30, 0x0F ; 15 - 311e: f0 e0 ldi r31, 0x00 ; 0 - 3120: e0 5e subi r30, 0xE0 ; 224 - 3122: ff 4d sbci r31, 0xDF ; 223 + 34a8: e0 91 d2 24 lds r30, 0x24D2 + 34ac: e2 95 swap r30 + 34ae: ef 70 andi r30, 0x0F ; 15 + 34b0: f0 e0 ldi r31, 0x00 ; 0 + 34b2: e0 5e subi r30, 0xE0 ; 224 + 34b4: ff 4d sbci r31, 0xDF ; 223 Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; Sum |= TableAB[2][(StateOdd[1] >> 4) & 0x0F]; - 3124: 20 81 ld r18, Z - 3126: 82 2b or r24, r18 - 3128: c2 95 swap r28 - 312a: cf 70 andi r28, 0x0F ; 15 - 312c: d0 e0 ldi r29, 0x00 ; 0 - 312e: c0 5e subi r28, 0xE0 ; 224 - 3130: df 4d sbci r29, 0xDF ; 223 + 34b6: 20 81 ld r18, Z + 34b8: 82 2b or r24, r18 + 34ba: c2 95 swap r28 + 34bc: cf 70 andi r28, 0x0F ; 15 + 34be: d0 e0 ldi r29, 0x00 ; 0 + 34c0: c0 5e subi r28, 0xE0 ; 224 + 34c2: df 4d sbci r29, 0xDF ; 223 Sum |= TableAB[3][(StateOdd[2] >> 0) & 0x0F]; - 3132: 28 a1 ldd r18, Y+32 ; 0x20 - 3134: 82 2b or r24, r18 + 34c4: 28 a1 ldd r18, Y+32 ; 0x20 + 34c6: 82 2b or r24, r18 Sum |= TableAB[4][(StateOdd[2] >> 4) & 0x0F]; - 3136: 92 95 swap r25 - 3138: 9f 70 andi r25, 0x0F ; 15 - 313a: a9 2f mov r26, r25 - 313c: b0 e0 ldi r27, 0x00 ; 0 - 313e: a0 5a subi r26, 0xA0 ; 160 - 3140: bf 4d sbci r27, 0xDF ; 223 - 3142: 9c 91 ld r25, X - 3144: 89 2b or r24, r25 + 34c8: 92 95 swap r25 + 34ca: 9f 70 andi r25, 0x0F ; 15 + 34cc: a9 2f mov r26, r25 + 34ce: b0 e0 ldi r27, 0x00 ; 0 + 34d0: a0 5a subi r26, 0xA0 ; 160 + 34d2: bf 4d sbci r27, 0xDF ; 223 + 34d4: 9c 91 ld r25, X + 34d6: 89 2b or r24, r25 return TableC[Sum]; - 3146: e8 2f mov r30, r24 - 3148: f0 e0 ldi r31, 0x00 ; 0 - 314a: e0 59 subi r30, 0x90 ; 144 - 314c: ff 4d sbci r31, 0xDF ; 223 + 34d8: e8 2f mov r30, r24 + 34da: f0 e0 ldi r31, 0x00 ; 0 + 34dc: e0 59 subi r30, 0x90 ; 144 + 34de: ff 4d sbci r31, 0xDF ; 223 } - 314e: 80 81 ld r24, Z - 3150: df 91 pop r29 - 3152: cf 91 pop r28 - 3154: 08 95 ret + 34e0: 80 81 ld r24, Z + 34e2: df 91 pop r29 + 34e4: cf 91 pop r28 + 34e6: 08 95 ret -00003156 : +000034e8 : void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]) { - 3156: cf 92 push r12 - 3158: df 92 push r13 - 315a: ef 92 push r14 - 315c: ff 92 push r15 - 315e: 0f 93 push r16 - 3160: 1f 93 push r17 - 3162: cf 93 push r28 - 3164: df 93 push r29 - 3166: fc 01 movw r30, r24 - 3168: db 01 movw r26, r22 - 316a: ea 01 movw r28, r20 + 34e8: cf 92 push r12 + 34ea: df 92 push r13 + 34ec: ef 92 push r14 + 34ee: ff 92 push r15 + 34f0: 0f 93 push r16 + 34f2: 1f 93 push r17 + 34f4: cf 93 push r28 + 34f6: df 93 push r29 + 34f8: fc 01 movw r30, r24 + 34fa: db 01 movw r26, r22 + 34fc: ea 01 movw r28, r20 * The inner loop generates 8 even and 8 odd bits from 16 key bits and * the outer loop stores them. */ for (i=0; i<(LFSR_SIZE/2); i++) { uint8_t EvenByte = 0; uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - 316c: 91 81 ldd r25, Z+1 ; 0x01 - 316e: 80 e0 ldi r24, 0x00 ; 0 - 3170: 20 81 ld r18, Z - 3172: 82 2b or r24, r18 - 3174: 80 fd sbrc r24, 0 - 3176: 8d c1 rjmp .+794 ; 0x3492 - 3178: 30 e0 ldi r19, 0x00 ; 0 - 317a: 81 fd sbrc r24, 1 - 317c: 88 c1 rjmp .+784 ; 0x348e - 317e: 20 e0 ldi r18, 0x00 ; 0 + 34fe: 91 81 ldd r25, Z+1 ; 0x01 + 3500: 80 e0 ldi r24, 0x00 ; 0 + 3502: 20 81 ld r18, Z + 3504: 82 2b or r24, r18 + 3506: 80 fd sbrc r24, 0 + 3508: 8d c1 rjmp .+794 ; 0x3824 + 350a: 30 e0 ldi r19, 0x00 ; 0 + 350c: 81 fd sbrc r24, 1 + 350e: 88 c1 rjmp .+784 ; 0x3820 + 3510: 20 e0 ldi r18, 0x00 ; 0 if (KeyWord & (1<<1)) { OddByte |= 0x80; } KeyWord >>= 2; - 3180: 96 95 lsr r25 - 3182: 87 95 ror r24 - 3184: 96 95 lsr r25 - 3186: 87 95 ror r24 + 3512: 96 95 lsr r25 + 3514: 87 95 ror r24 + 3516: 96 95 lsr r25 + 3518: 87 95 ror r24 for (j=0; j<8; j++) { EvenByte >>= 1; OddByte >>= 1; if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3188: 43 2f mov r20, r19 - 318a: 40 68 ori r20, 0x80 ; 128 - 318c: 80 fd sbrc r24, 0 - 318e: 34 2f mov r19, r20 + 351a: 43 2f mov r20, r19 + 351c: 40 68 ori r20, 0x80 ; 128 + 351e: 80 fd sbrc r24, 0 + 3520: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3190: 42 2f mov r20, r18 - 3192: 40 68 ori r20, 0x80 ; 128 - 3194: 81 fd sbrc r24, 1 - 3196: 24 2f mov r18, r20 + 3522: 42 2f mov r20, r18 + 3524: 40 68 ori r20, 0x80 ; 128 + 3526: 81 fd sbrc r24, 1 + 3528: 24 2f mov r18, r20 } KeyWord >>= 2; - 3198: 96 95 lsr r25 - 319a: 87 95 ror r24 - 319c: 96 95 lsr r25 - 319e: 87 95 ror r24 + 352a: 96 95 lsr r25 + 352c: 87 95 ror r24 + 352e: 96 95 lsr r25 + 3530: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 31a0: 36 95 lsr r19 + 3532: 36 95 lsr r19 OddByte >>= 1; - 31a2: 26 95 lsr r18 + 3534: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 31a4: 43 2f mov r20, r19 - 31a6: 40 68 ori r20, 0x80 ; 128 - 31a8: 80 fd sbrc r24, 0 - 31aa: 34 2f mov r19, r20 + 3536: 43 2f mov r20, r19 + 3538: 40 68 ori r20, 0x80 ; 128 + 353a: 80 fd sbrc r24, 0 + 353c: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 31ac: 42 2f mov r20, r18 - 31ae: 40 68 ori r20, 0x80 ; 128 - 31b0: 81 fd sbrc r24, 1 - 31b2: 24 2f mov r18, r20 + 353e: 42 2f mov r20, r18 + 3540: 40 68 ori r20, 0x80 ; 128 + 3542: 81 fd sbrc r24, 1 + 3544: 24 2f mov r18, r20 } KeyWord >>= 2; - 31b4: 96 95 lsr r25 - 31b6: 87 95 ror r24 - 31b8: 96 95 lsr r25 - 31ba: 87 95 ror r24 + 3546: 96 95 lsr r25 + 3548: 87 95 ror r24 + 354a: 96 95 lsr r25 + 354c: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 31bc: 36 95 lsr r19 + 354e: 36 95 lsr r19 OddByte >>= 1; - 31be: 26 95 lsr r18 + 3550: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 31c0: 43 2f mov r20, r19 - 31c2: 40 68 ori r20, 0x80 ; 128 - 31c4: 80 fd sbrc r24, 0 - 31c6: 34 2f mov r19, r20 + 3552: 43 2f mov r20, r19 + 3554: 40 68 ori r20, 0x80 ; 128 + 3556: 80 fd sbrc r24, 0 + 3558: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 31c8: 42 2f mov r20, r18 - 31ca: 40 68 ori r20, 0x80 ; 128 - 31cc: 81 fd sbrc r24, 1 - 31ce: 24 2f mov r18, r20 + 355a: 42 2f mov r20, r18 + 355c: 40 68 ori r20, 0x80 ; 128 + 355e: 81 fd sbrc r24, 1 + 3560: 24 2f mov r18, r20 } KeyWord >>= 2; - 31d0: 96 95 lsr r25 - 31d2: 87 95 ror r24 - 31d4: 96 95 lsr r25 - 31d6: 87 95 ror r24 + 3562: 96 95 lsr r25 + 3564: 87 95 ror r24 + 3566: 96 95 lsr r25 + 3568: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 31d8: 36 95 lsr r19 + 356a: 36 95 lsr r19 OddByte >>= 1; - 31da: 26 95 lsr r18 + 356c: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 31dc: 43 2f mov r20, r19 - 31de: 40 68 ori r20, 0x80 ; 128 - 31e0: 80 fd sbrc r24, 0 - 31e2: 34 2f mov r19, r20 + 356e: 43 2f mov r20, r19 + 3570: 40 68 ori r20, 0x80 ; 128 + 3572: 80 fd sbrc r24, 0 + 3574: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 31e4: 42 2f mov r20, r18 - 31e6: 40 68 ori r20, 0x80 ; 128 - 31e8: 81 fd sbrc r24, 1 - 31ea: 24 2f mov r18, r20 + 3576: 42 2f mov r20, r18 + 3578: 40 68 ori r20, 0x80 ; 128 + 357a: 81 fd sbrc r24, 1 + 357c: 24 2f mov r18, r20 } KeyWord >>= 2; - 31ec: 96 95 lsr r25 - 31ee: 87 95 ror r24 - 31f0: 96 95 lsr r25 - 31f2: 87 95 ror r24 + 357e: 96 95 lsr r25 + 3580: 87 95 ror r24 + 3582: 96 95 lsr r25 + 3584: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 31f4: 36 95 lsr r19 + 3586: 36 95 lsr r19 OddByte >>= 1; - 31f6: 26 95 lsr r18 + 3588: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 31f8: 43 2f mov r20, r19 - 31fa: 40 68 ori r20, 0x80 ; 128 - 31fc: 80 fd sbrc r24, 0 - 31fe: 34 2f mov r19, r20 + 358a: 43 2f mov r20, r19 + 358c: 40 68 ori r20, 0x80 ; 128 + 358e: 80 fd sbrc r24, 0 + 3590: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3200: 42 2f mov r20, r18 - 3202: 40 68 ori r20, 0x80 ; 128 - 3204: 81 fd sbrc r24, 1 - 3206: 24 2f mov r18, r20 + 3592: 42 2f mov r20, r18 + 3594: 40 68 ori r20, 0x80 ; 128 + 3596: 81 fd sbrc r24, 1 + 3598: 24 2f mov r18, r20 } KeyWord >>= 2; - 3208: 96 95 lsr r25 - 320a: 87 95 ror r24 - 320c: 96 95 lsr r25 - 320e: 87 95 ror r24 + 359a: 96 95 lsr r25 + 359c: 87 95 ror r24 + 359e: 96 95 lsr r25 + 35a0: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 3210: 36 95 lsr r19 + 35a2: 36 95 lsr r19 OddByte >>= 1; - 3212: 26 95 lsr r18 + 35a4: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3214: 43 2f mov r20, r19 - 3216: 40 68 ori r20, 0x80 ; 128 - 3218: 80 fd sbrc r24, 0 - 321a: 34 2f mov r19, r20 + 35a6: 43 2f mov r20, r19 + 35a8: 40 68 ori r20, 0x80 ; 128 + 35aa: 80 fd sbrc r24, 0 + 35ac: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 321c: 42 2f mov r20, r18 - 321e: 40 68 ori r20, 0x80 ; 128 - 3220: 81 fd sbrc r24, 1 - 3222: 24 2f mov r18, r20 + 35ae: 42 2f mov r20, r18 + 35b0: 40 68 ori r20, 0x80 ; 128 + 35b2: 81 fd sbrc r24, 1 + 35b4: 24 2f mov r18, r20 } KeyWord >>= 2; - 3224: 96 95 lsr r25 - 3226: 87 95 ror r24 - 3228: 96 95 lsr r25 - 322a: 87 95 ror r24 + 35b6: 96 95 lsr r25 + 35b8: 87 95 ror r24 + 35ba: 96 95 lsr r25 + 35bc: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 322c: 36 95 lsr r19 + 35be: 36 95 lsr r19 OddByte >>= 1; - 322e: 26 95 lsr r18 + 35c0: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3230: 53 2f mov r21, r19 - 3232: 50 68 ori r21, 0x80 ; 128 + 35c2: 53 2f mov r21, r19 + 35c4: 50 68 ori r21, 0x80 ; 128 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3234: 42 2f mov r20, r18 - 3236: 40 68 ori r20, 0x80 ; 128 + 35c6: 42 2f mov r20, r18 + 35c8: 40 68 ori r20, 0x80 ; 128 } KeyWord >>= 2; } StateEven[i] = EvenByte; - 3238: 80 fd sbrc r24, 0 - 323a: 35 2f mov r19, r21 - 323c: 30 93 d5 20 sts 0x20D5, r19 + 35ca: 80 fd sbrc r24, 0 + 35cc: 35 2f mov r19, r21 + 35ce: 30 93 d5 24 sts 0x24D5, r19 StateOdd[i] = OddByte; - 3240: 81 fd sbrc r24, 1 - 3242: 24 2f mov r18, r20 - 3244: 20 93 d2 20 sts 0x20D2, r18 + 35d2: 81 fd sbrc r24, 1 + 35d4: 24 2f mov r18, r20 + 35d6: 20 93 d2 24 sts 0x24D2, r18 * The inner loop generates 8 even and 8 odd bits from 16 key bits and * the outer loop stores them. */ for (i=0; i<(LFSR_SIZE/2); i++) { uint8_t EvenByte = 0; uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - 3248: 93 81 ldd r25, Z+3 ; 0x03 - 324a: 80 e0 ldi r24, 0x00 ; 0 - 324c: 22 81 ldd r18, Z+2 ; 0x02 - 324e: 82 2b or r24, r18 - 3250: 80 fd sbrc r24, 0 - 3252: 1b c1 rjmp .+566 ; 0x348a - 3254: 30 e0 ldi r19, 0x00 ; 0 - 3256: 81 fd sbrc r24, 1 - 3258: 16 c1 rjmp .+556 ; 0x3486 - 325a: 20 e0 ldi r18, 0x00 ; 0 + 35da: 93 81 ldd r25, Z+3 ; 0x03 + 35dc: 80 e0 ldi r24, 0x00 ; 0 + 35de: 22 81 ldd r18, Z+2 ; 0x02 + 35e0: 82 2b or r24, r18 + 35e2: 80 fd sbrc r24, 0 + 35e4: 1b c1 rjmp .+566 ; 0x381c + 35e6: 30 e0 ldi r19, 0x00 ; 0 + 35e8: 81 fd sbrc r24, 1 + 35ea: 16 c1 rjmp .+556 ; 0x3818 + 35ec: 20 e0 ldi r18, 0x00 ; 0 if (KeyWord & (1<<1)) { OddByte |= 0x80; } KeyWord >>= 2; - 325c: 96 95 lsr r25 - 325e: 87 95 ror r24 - 3260: 96 95 lsr r25 - 3262: 87 95 ror r24 + 35ee: 96 95 lsr r25 + 35f0: 87 95 ror r24 + 35f2: 96 95 lsr r25 + 35f4: 87 95 ror r24 for (j=0; j<8; j++) { EvenByte >>= 1; OddByte >>= 1; if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3264: 43 2f mov r20, r19 - 3266: 40 68 ori r20, 0x80 ; 128 - 3268: 80 fd sbrc r24, 0 - 326a: 34 2f mov r19, r20 + 35f6: 43 2f mov r20, r19 + 35f8: 40 68 ori r20, 0x80 ; 128 + 35fa: 80 fd sbrc r24, 0 + 35fc: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 326c: 42 2f mov r20, r18 - 326e: 40 68 ori r20, 0x80 ; 128 - 3270: 81 fd sbrc r24, 1 - 3272: 24 2f mov r18, r20 + 35fe: 42 2f mov r20, r18 + 3600: 40 68 ori r20, 0x80 ; 128 + 3602: 81 fd sbrc r24, 1 + 3604: 24 2f mov r18, r20 } KeyWord >>= 2; - 3274: 96 95 lsr r25 - 3276: 87 95 ror r24 - 3278: 96 95 lsr r25 - 327a: 87 95 ror r24 + 3606: 96 95 lsr r25 + 3608: 87 95 ror r24 + 360a: 96 95 lsr r25 + 360c: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 327c: 36 95 lsr r19 + 360e: 36 95 lsr r19 OddByte >>= 1; - 327e: 26 95 lsr r18 + 3610: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3280: 43 2f mov r20, r19 - 3282: 40 68 ori r20, 0x80 ; 128 - 3284: 80 fd sbrc r24, 0 - 3286: 34 2f mov r19, r20 + 3612: 43 2f mov r20, r19 + 3614: 40 68 ori r20, 0x80 ; 128 + 3616: 80 fd sbrc r24, 0 + 3618: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3288: 42 2f mov r20, r18 - 328a: 40 68 ori r20, 0x80 ; 128 - 328c: 81 fd sbrc r24, 1 - 328e: 24 2f mov r18, r20 + 361a: 42 2f mov r20, r18 + 361c: 40 68 ori r20, 0x80 ; 128 + 361e: 81 fd sbrc r24, 1 + 3620: 24 2f mov r18, r20 } KeyWord >>= 2; - 3290: 96 95 lsr r25 - 3292: 87 95 ror r24 - 3294: 96 95 lsr r25 - 3296: 87 95 ror r24 + 3622: 96 95 lsr r25 + 3624: 87 95 ror r24 + 3626: 96 95 lsr r25 + 3628: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 3298: 36 95 lsr r19 + 362a: 36 95 lsr r19 OddByte >>= 1; - 329a: 26 95 lsr r18 + 362c: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 329c: 43 2f mov r20, r19 - 329e: 40 68 ori r20, 0x80 ; 128 - 32a0: 80 fd sbrc r24, 0 - 32a2: 34 2f mov r19, r20 + 362e: 43 2f mov r20, r19 + 3630: 40 68 ori r20, 0x80 ; 128 + 3632: 80 fd sbrc r24, 0 + 3634: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 32a4: 42 2f mov r20, r18 - 32a6: 40 68 ori r20, 0x80 ; 128 - 32a8: 81 fd sbrc r24, 1 - 32aa: 24 2f mov r18, r20 + 3636: 42 2f mov r20, r18 + 3638: 40 68 ori r20, 0x80 ; 128 + 363a: 81 fd sbrc r24, 1 + 363c: 24 2f mov r18, r20 } KeyWord >>= 2; - 32ac: 96 95 lsr r25 - 32ae: 87 95 ror r24 - 32b0: 96 95 lsr r25 - 32b2: 87 95 ror r24 + 363e: 96 95 lsr r25 + 3640: 87 95 ror r24 + 3642: 96 95 lsr r25 + 3644: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 32b4: 36 95 lsr r19 + 3646: 36 95 lsr r19 OddByte >>= 1; - 32b6: 26 95 lsr r18 + 3648: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 32b8: 43 2f mov r20, r19 - 32ba: 40 68 ori r20, 0x80 ; 128 - 32bc: 80 fd sbrc r24, 0 - 32be: 34 2f mov r19, r20 + 364a: 43 2f mov r20, r19 + 364c: 40 68 ori r20, 0x80 ; 128 + 364e: 80 fd sbrc r24, 0 + 3650: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 32c0: 42 2f mov r20, r18 - 32c2: 40 68 ori r20, 0x80 ; 128 - 32c4: 81 fd sbrc r24, 1 - 32c6: 24 2f mov r18, r20 + 3652: 42 2f mov r20, r18 + 3654: 40 68 ori r20, 0x80 ; 128 + 3656: 81 fd sbrc r24, 1 + 3658: 24 2f mov r18, r20 } KeyWord >>= 2; - 32c8: 96 95 lsr r25 - 32ca: 87 95 ror r24 - 32cc: 96 95 lsr r25 - 32ce: 87 95 ror r24 + 365a: 96 95 lsr r25 + 365c: 87 95 ror r24 + 365e: 96 95 lsr r25 + 3660: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 32d0: 36 95 lsr r19 + 3662: 36 95 lsr r19 OddByte >>= 1; - 32d2: 26 95 lsr r18 + 3664: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 32d4: 43 2f mov r20, r19 - 32d6: 40 68 ori r20, 0x80 ; 128 - 32d8: 80 fd sbrc r24, 0 - 32da: 34 2f mov r19, r20 + 3666: 43 2f mov r20, r19 + 3668: 40 68 ori r20, 0x80 ; 128 + 366a: 80 fd sbrc r24, 0 + 366c: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 32dc: 42 2f mov r20, r18 - 32de: 40 68 ori r20, 0x80 ; 128 - 32e0: 81 fd sbrc r24, 1 - 32e2: 24 2f mov r18, r20 + 366e: 42 2f mov r20, r18 + 3670: 40 68 ori r20, 0x80 ; 128 + 3672: 81 fd sbrc r24, 1 + 3674: 24 2f mov r18, r20 } KeyWord >>= 2; - 32e4: 96 95 lsr r25 - 32e6: 87 95 ror r24 - 32e8: 96 95 lsr r25 - 32ea: 87 95 ror r24 + 3676: 96 95 lsr r25 + 3678: 87 95 ror r24 + 367a: 96 95 lsr r25 + 367c: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 32ec: 36 95 lsr r19 + 367e: 36 95 lsr r19 OddByte >>= 1; - 32ee: 26 95 lsr r18 + 3680: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 32f0: 43 2f mov r20, r19 - 32f2: 40 68 ori r20, 0x80 ; 128 - 32f4: 80 fd sbrc r24, 0 - 32f6: 34 2f mov r19, r20 + 3682: 43 2f mov r20, r19 + 3684: 40 68 ori r20, 0x80 ; 128 + 3686: 80 fd sbrc r24, 0 + 3688: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 32f8: 42 2f mov r20, r18 - 32fa: 40 68 ori r20, 0x80 ; 128 - 32fc: 81 fd sbrc r24, 1 - 32fe: 24 2f mov r18, r20 + 368a: 42 2f mov r20, r18 + 368c: 40 68 ori r20, 0x80 ; 128 + 368e: 81 fd sbrc r24, 1 + 3690: 24 2f mov r18, r20 } KeyWord >>= 2; - 3300: 96 95 lsr r25 - 3302: 87 95 ror r24 - 3304: 96 95 lsr r25 - 3306: 87 95 ror r24 + 3692: 96 95 lsr r25 + 3694: 87 95 ror r24 + 3696: 96 95 lsr r25 + 3698: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 3308: 36 95 lsr r19 + 369a: 36 95 lsr r19 OddByte >>= 1; - 330a: 26 95 lsr r18 + 369c: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 330c: 53 2f mov r21, r19 - 330e: 50 68 ori r21, 0x80 ; 128 + 369e: 53 2f mov r21, r19 + 36a0: 50 68 ori r21, 0x80 ; 128 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3310: 42 2f mov r20, r18 - 3312: 40 68 ori r20, 0x80 ; 128 + 36a2: 42 2f mov r20, r18 + 36a4: 40 68 ori r20, 0x80 ; 128 } KeyWord >>= 2; } StateEven[i] = EvenByte; - 3314: 80 fd sbrc r24, 0 - 3316: 35 2f mov r19, r21 - 3318: 30 93 d6 20 sts 0x20D6, r19 + 36a6: 80 fd sbrc r24, 0 + 36a8: 35 2f mov r19, r21 + 36aa: 30 93 d6 24 sts 0x24D6, r19 StateOdd[i] = OddByte; - 331c: 81 fd sbrc r24, 1 - 331e: 24 2f mov r18, r20 - 3320: 20 93 d3 20 sts 0x20D3, r18 + 36ae: 81 fd sbrc r24, 1 + 36b0: 24 2f mov r18, r20 + 36b2: 20 93 d3 24 sts 0x24D3, r18 * The inner loop generates 8 even and 8 odd bits from 16 key bits and * the outer loop stores them. */ for (i=0; i<(LFSR_SIZE/2); i++) { uint8_t EvenByte = 0; uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - 3324: 95 81 ldd r25, Z+5 ; 0x05 - 3326: 80 e0 ldi r24, 0x00 ; 0 - 3328: 24 81 ldd r18, Z+4 ; 0x04 - 332a: 82 2b or r24, r18 - 332c: 80 fd sbrc r24, 0 - 332e: a9 c0 rjmp .+338 ; 0x3482 - 3330: 30 e0 ldi r19, 0x00 ; 0 - 3332: 81 fd sbrc r24, 1 - 3334: a4 c0 rjmp .+328 ; 0x347e - 3336: 20 e0 ldi r18, 0x00 ; 0 + 36b6: 95 81 ldd r25, Z+5 ; 0x05 + 36b8: 80 e0 ldi r24, 0x00 ; 0 + 36ba: 24 81 ldd r18, Z+4 ; 0x04 + 36bc: 82 2b or r24, r18 + 36be: 80 fd sbrc r24, 0 + 36c0: a9 c0 rjmp .+338 ; 0x3814 + 36c2: 30 e0 ldi r19, 0x00 ; 0 + 36c4: 81 fd sbrc r24, 1 + 36c6: a4 c0 rjmp .+328 ; 0x3810 + 36c8: 20 e0 ldi r18, 0x00 ; 0 if (KeyWord & (1<<1)) { OddByte |= 0x80; } KeyWord >>= 2; - 3338: 96 95 lsr r25 - 333a: 87 95 ror r24 - 333c: 96 95 lsr r25 - 333e: 87 95 ror r24 + 36ca: 96 95 lsr r25 + 36cc: 87 95 ror r24 + 36ce: 96 95 lsr r25 + 36d0: 87 95 ror r24 for (j=0; j<8; j++) { EvenByte >>= 1; OddByte >>= 1; if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3340: 43 2f mov r20, r19 - 3342: 40 68 ori r20, 0x80 ; 128 - 3344: 80 fd sbrc r24, 0 - 3346: 34 2f mov r19, r20 + 36d2: 43 2f mov r20, r19 + 36d4: 40 68 ori r20, 0x80 ; 128 + 36d6: 80 fd sbrc r24, 0 + 36d8: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3348: 42 2f mov r20, r18 - 334a: 40 68 ori r20, 0x80 ; 128 - 334c: 81 fd sbrc r24, 1 - 334e: 24 2f mov r18, r20 + 36da: 42 2f mov r20, r18 + 36dc: 40 68 ori r20, 0x80 ; 128 + 36de: 81 fd sbrc r24, 1 + 36e0: 24 2f mov r18, r20 } KeyWord >>= 2; - 3350: 96 95 lsr r25 - 3352: 87 95 ror r24 - 3354: 96 95 lsr r25 - 3356: 87 95 ror r24 + 36e2: 96 95 lsr r25 + 36e4: 87 95 ror r24 + 36e6: 96 95 lsr r25 + 36e8: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 3358: 36 95 lsr r19 + 36ea: 36 95 lsr r19 OddByte >>= 1; - 335a: 26 95 lsr r18 + 36ec: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 335c: 43 2f mov r20, r19 - 335e: 40 68 ori r20, 0x80 ; 128 - 3360: 80 fd sbrc r24, 0 - 3362: 34 2f mov r19, r20 + 36ee: 43 2f mov r20, r19 + 36f0: 40 68 ori r20, 0x80 ; 128 + 36f2: 80 fd sbrc r24, 0 + 36f4: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3364: 42 2f mov r20, r18 - 3366: 40 68 ori r20, 0x80 ; 128 - 3368: 81 fd sbrc r24, 1 - 336a: 24 2f mov r18, r20 + 36f6: 42 2f mov r20, r18 + 36f8: 40 68 ori r20, 0x80 ; 128 + 36fa: 81 fd sbrc r24, 1 + 36fc: 24 2f mov r18, r20 } KeyWord >>= 2; - 336c: 96 95 lsr r25 - 336e: 87 95 ror r24 - 3370: 96 95 lsr r25 - 3372: 87 95 ror r24 + 36fe: 96 95 lsr r25 + 3700: 87 95 ror r24 + 3702: 96 95 lsr r25 + 3704: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 3374: 36 95 lsr r19 + 3706: 36 95 lsr r19 OddByte >>= 1; - 3376: 26 95 lsr r18 + 3708: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3378: 43 2f mov r20, r19 - 337a: 40 68 ori r20, 0x80 ; 128 - 337c: 80 fd sbrc r24, 0 - 337e: 34 2f mov r19, r20 + 370a: 43 2f mov r20, r19 + 370c: 40 68 ori r20, 0x80 ; 128 + 370e: 80 fd sbrc r24, 0 + 3710: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 3380: 42 2f mov r20, r18 - 3382: 40 68 ori r20, 0x80 ; 128 - 3384: 81 fd sbrc r24, 1 - 3386: 24 2f mov r18, r20 + 3712: 42 2f mov r20, r18 + 3714: 40 68 ori r20, 0x80 ; 128 + 3716: 81 fd sbrc r24, 1 + 3718: 24 2f mov r18, r20 } KeyWord >>= 2; - 3388: 96 95 lsr r25 - 338a: 87 95 ror r24 - 338c: 96 95 lsr r25 - 338e: 87 95 ror r24 + 371a: 96 95 lsr r25 + 371c: 87 95 ror r24 + 371e: 96 95 lsr r25 + 3720: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 3390: 36 95 lsr r19 + 3722: 36 95 lsr r19 OddByte >>= 1; - 3392: 26 95 lsr r18 + 3724: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 3394: 43 2f mov r20, r19 - 3396: 40 68 ori r20, 0x80 ; 128 - 3398: 80 fd sbrc r24, 0 - 339a: 34 2f mov r19, r20 + 3726: 43 2f mov r20, r19 + 3728: 40 68 ori r20, 0x80 ; 128 + 372a: 80 fd sbrc r24, 0 + 372c: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 339c: 42 2f mov r20, r18 - 339e: 40 68 ori r20, 0x80 ; 128 - 33a0: 81 fd sbrc r24, 1 - 33a2: 24 2f mov r18, r20 + 372e: 42 2f mov r20, r18 + 3730: 40 68 ori r20, 0x80 ; 128 + 3732: 81 fd sbrc r24, 1 + 3734: 24 2f mov r18, r20 } KeyWord >>= 2; - 33a4: 96 95 lsr r25 - 33a6: 87 95 ror r24 - 33a8: 96 95 lsr r25 - 33aa: 87 95 ror r24 + 3736: 96 95 lsr r25 + 3738: 87 95 ror r24 + 373a: 96 95 lsr r25 + 373c: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 33ac: 36 95 lsr r19 + 373e: 36 95 lsr r19 OddByte >>= 1; - 33ae: 26 95 lsr r18 + 3740: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 33b0: 43 2f mov r20, r19 - 33b2: 40 68 ori r20, 0x80 ; 128 - 33b4: 80 fd sbrc r24, 0 - 33b6: 34 2f mov r19, r20 + 3742: 43 2f mov r20, r19 + 3744: 40 68 ori r20, 0x80 ; 128 + 3746: 80 fd sbrc r24, 0 + 3748: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 33b8: 42 2f mov r20, r18 - 33ba: 40 68 ori r20, 0x80 ; 128 - 33bc: 81 fd sbrc r24, 1 - 33be: 24 2f mov r18, r20 + 374a: 42 2f mov r20, r18 + 374c: 40 68 ori r20, 0x80 ; 128 + 374e: 81 fd sbrc r24, 1 + 3750: 24 2f mov r18, r20 } KeyWord >>= 2; - 33c0: 96 95 lsr r25 - 33c2: 87 95 ror r24 - 33c4: 96 95 lsr r25 - 33c6: 87 95 ror r24 + 3752: 96 95 lsr r25 + 3754: 87 95 ror r24 + 3756: 96 95 lsr r25 + 3758: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 33c8: 36 95 lsr r19 + 375a: 36 95 lsr r19 OddByte >>= 1; - 33ca: 26 95 lsr r18 + 375c: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 33cc: 43 2f mov r20, r19 - 33ce: 40 68 ori r20, 0x80 ; 128 - 33d0: 80 fd sbrc r24, 0 - 33d2: 34 2f mov r19, r20 + 375e: 43 2f mov r20, r19 + 3760: 40 68 ori r20, 0x80 ; 128 + 3762: 80 fd sbrc r24, 0 + 3764: 34 2f mov r19, r20 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 33d4: 42 2f mov r20, r18 - 33d6: 40 68 ori r20, 0x80 ; 128 - 33d8: 81 fd sbrc r24, 1 - 33da: 24 2f mov r18, r20 + 3766: 42 2f mov r20, r18 + 3768: 40 68 ori r20, 0x80 ; 128 + 376a: 81 fd sbrc r24, 1 + 376c: 24 2f mov r18, r20 } KeyWord >>= 2; - 33dc: 96 95 lsr r25 - 33de: 87 95 ror r24 - 33e0: 96 95 lsr r25 - 33e2: 87 95 ror r24 + 376e: 96 95 lsr r25 + 3770: 87 95 ror r24 + 3772: 96 95 lsr r25 + 3774: 87 95 ror r24 uint8_t OddByte = 0; uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; uint8_t j; for (j=0; j<8; j++) { EvenByte >>= 1; - 33e4: 36 95 lsr r19 + 3776: 36 95 lsr r19 OddByte >>= 1; - 33e6: 26 95 lsr r18 + 3778: 26 95 lsr r18 if (KeyWord & (1<<0)) { EvenByte |= 0x80; - 33e8: 53 2f mov r21, r19 - 33ea: 50 68 ori r21, 0x80 ; 128 + 377a: 53 2f mov r21, r19 + 377c: 50 68 ori r21, 0x80 ; 128 } if (KeyWord & (1<<1)) { OddByte |= 0x80; - 33ec: 42 2f mov r20, r18 - 33ee: 40 68 ori r20, 0x80 ; 128 + 377e: 42 2f mov r20, r18 + 3780: 40 68 ori r20, 0x80 ; 128 } KeyWord >>= 2; } StateEven[i] = EvenByte; - 33f0: 80 fd sbrc r24, 0 - 33f2: 35 2f mov r19, r21 - 33f4: 30 93 d7 20 sts 0x20D7, r19 + 3782: 80 fd sbrc r24, 0 + 3784: 35 2f mov r19, r21 + 3786: 30 93 d7 24 sts 0x24D7, r19 StateOdd[i] = OddByte; - 33f8: 81 fd sbrc r24, 1 - 33fa: 24 2f mov r18, r20 - 33fc: 20 93 d4 20 sts 0x20D4, r18 + 378a: 81 fd sbrc r24, 1 + 378c: 24 2f mov r18, r20 + 378e: 20 93 d4 24 sts 0x24D4, r18 /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the * Crypto1 LFSR.*/ uint32_t Temp = 0; Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; - 3400: 89 81 ldd r24, Y+1 ; 0x01 - 3402: 11 96 adiw r26, 0x01 ; 1 - 3404: 9c 91 ld r25, X - 3406: 11 97 sbiw r26, 0x01 ; 1 - 3408: 89 27 eor r24, r25 + 3792: 89 81 ldd r24, Y+1 ; 0x01 + 3794: 11 96 adiw r26, 0x01 ; 1 + 3796: 9c 91 ld r25, X + 3798: 11 97 sbiw r26, 0x01 ; 1 + 379a: 89 27 eor r24, r25 Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; - 340a: ca 80 ldd r12, Y+2 ; 0x02 - 340c: 12 96 adiw r26, 0x02 ; 2 - 340e: 9c 91 ld r25, X - 3410: 12 97 sbiw r26, 0x02 ; 2 - 3412: c9 26 eor r12, r25 - 3414: d1 2c mov r13, r1 - 3416: e1 2c mov r14, r1 - 3418: f1 2c mov r15, r1 - 341a: 76 01 movw r14, r12 - 341c: dd 24 eor r13, r13 - 341e: cc 24 eor r12, r12 + 379c: ca 80 ldd r12, Y+2 ; 0x02 + 379e: 12 96 adiw r26, 0x02 ; 2 + 37a0: 9c 91 ld r25, X + 37a2: 12 97 sbiw r26, 0x02 ; 2 + 37a4: c9 26 eor r12, r25 + 37a6: d1 2c mov r13, r1 + 37a8: e1 2c mov r14, r1 + 37aa: f1 2c mov r15, r1 + 37ac: 76 01 movw r14, r12 + 37ae: dd 24 eor r13, r13 + 37b0: cc 24 eor r12, r12 /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the * Crypto1 LFSR.*/ uint32_t Temp = 0; Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; - 3420: d8 2a or r13, r24 + 37b2: d8 2a or r13, r24 /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the * Crypto1 LFSR.*/ uint32_t Temp = 0; Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; - 3422: 88 81 ld r24, Y - 3424: 9c 91 ld r25, X - 3426: 89 27 eor r24, r25 + 37b4: 88 81 ld r24, Y + 37b6: 9c 91 ld r25, X + 37b8: 89 27 eor r24, r25 Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; - 3428: c8 2a or r12, r24 + 37ba: c8 2a or r12, r24 Temp |= (uint32_t) (Uid[3] ^ CardNonce[3]) << 24; - 342a: 8b 81 ldd r24, Y+3 ; 0x03 - 342c: 13 96 adiw r26, 0x03 ; 3 - 342e: 9c 91 ld r25, X - 3430: 89 27 eor r24, r25 - 3432: f8 2a or r15, r24 - 3434: 10 e2 ldi r17, 0x20 ; 32 + 37bc: 8b 81 ldd r24, Y+3 ; 0x03 + 37be: 13 96 adiw r26, 0x03 ; 3 + 37c0: 9c 91 ld r25, X + 37c2: 89 27 eor r24, r25 + 37c4: f8 2a or r15, r24 + 37c6: 10 e2 ldi r17, 0x20 ; 32 for (i=0; i<32; i++) { uint8_t Out = Crypto1FilterOutput(); - 3436: 5b de rcall .-842 ; 0x30ee - 3438: 08 2f mov r16, r24 + 37c8: 5b de rcall .-842 ; 0x3480 + 37ca: 08 2f mov r16, r24 Crypto1LFSR(Temp & 0x01); - 343a: 8c 2d mov r24, r12 - 343c: 81 70 andi r24, 0x01 ; 1 - 343e: 11 de rcall .-990 ; 0x3062 + 37cc: 8c 2d mov r24, r12 + 37ce: 81 70 andi r24, 0x01 ; 1 + 37d0: 11 de rcall .-990 ; 0x33f4 Temp >>= 1; - 3440: f6 94 lsr r15 - 3442: e7 94 ror r14 - 3444: d7 94 ror r13 - 3446: c7 94 ror r12 + 37d2: f6 94 lsr r15 + 37d4: e7 94 ror r14 + 37d6: d7 94 ror r13 + 37d8: c7 94 ror r12 /* Store the keystream for later use */ if (Out) { - 3448: 00 23 and r16, r16 - 344a: 11 f0 breq .+4 ; 0x3450 + 37da: 00 23 and r16, r16 + 37dc: 11 f0 breq .+4 ; 0x37e2 Temp |= (uint32_t) 1 << 31; - 344c: 68 94 set - 344e: f7 f8 bld r15, 7 - 3450: 11 50 subi r17, 0x01 ; 1 + 37de: 68 94 set + 37e0: f7 f8 bld r15, 7 + 37e2: 11 50 subi r17, 0x01 ; 1 Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; Temp |= (uint32_t) (Uid[3] ^ CardNonce[3]) << 24; for (i=0; i<32; i++) { - 3452: 89 f7 brne .-30 ; 0x3436 + 37e4: 89 f7 brne .-30 ; 0x37c8 } /* Crypto1 state register is now set up to be used for authentication. * In case of nested authentication, we need to use the produced keystream * to encrypt the CardNonce. For this case we do the encryption in-place. */ CardNonce[0] ^= (uint8_t) (Temp >> 0); - 3454: 88 81 ld r24, Y - 3456: 8c 25 eor r24, r12 - 3458: 88 83 st Y, r24 + 37e6: 88 81 ld r24, Y + 37e8: 8c 25 eor r24, r12 + 37ea: 88 83 st Y, r24 CardNonce[1] ^= (uint8_t) (Temp >> 8); - 345a: 89 81 ldd r24, Y+1 ; 0x01 - 345c: 8d 25 eor r24, r13 - 345e: 89 83 std Y+1, r24 ; 0x01 + 37ec: 89 81 ldd r24, Y+1 ; 0x01 + 37ee: 8d 25 eor r24, r13 + 37f0: 89 83 std Y+1, r24 ; 0x01 CardNonce[2] ^= (uint8_t) (Temp >> 16); - 3460: 8a 81 ldd r24, Y+2 ; 0x02 - 3462: 8e 25 eor r24, r14 - 3464: 8a 83 std Y+2, r24 ; 0x02 + 37f2: 8a 81 ldd r24, Y+2 ; 0x02 + 37f4: 8e 25 eor r24, r14 + 37f6: 8a 83 std Y+2, r24 ; 0x02 CardNonce[3] ^= (uint8_t) (Temp >> 24); - 3466: 8b 81 ldd r24, Y+3 ; 0x03 - 3468: 8f 25 eor r24, r15 - 346a: 8b 83 std Y+3, r24 ; 0x03 + 37f8: 8b 81 ldd r24, Y+3 ; 0x03 + 37fa: 8f 25 eor r24, r15 + 37fc: 8b 83 std Y+3, r24 ; 0x03 } - 346c: df 91 pop r29 - 346e: cf 91 pop r28 - 3470: 1f 91 pop r17 - 3472: 0f 91 pop r16 - 3474: ff 90 pop r15 - 3476: ef 90 pop r14 - 3478: df 90 pop r13 - 347a: cf 90 pop r12 - 347c: 08 95 ret - 347e: 20 e4 ldi r18, 0x40 ; 64 - 3480: 5b cf rjmp .-330 ; 0x3338 - 3482: 30 e4 ldi r19, 0x40 ; 64 - 3484: 56 cf rjmp .-340 ; 0x3332 - 3486: 20 e4 ldi r18, 0x40 ; 64 - 3488: e9 ce rjmp .-558 ; 0x325c - 348a: 30 e4 ldi r19, 0x40 ; 64 - 348c: e4 ce rjmp .-568 ; 0x3256 - 348e: 20 e4 ldi r18, 0x40 ; 64 - 3490: 77 ce rjmp .-786 ; 0x3180 - 3492: 30 e4 ldi r19, 0x40 ; 64 - 3494: 72 ce rjmp .-796 ; 0x317a + 37fe: df 91 pop r29 + 3800: cf 91 pop r28 + 3802: 1f 91 pop r17 + 3804: 0f 91 pop r16 + 3806: ff 90 pop r15 + 3808: ef 90 pop r14 + 380a: df 90 pop r13 + 380c: cf 90 pop r12 + 380e: 08 95 ret + 3810: 20 e4 ldi r18, 0x40 ; 64 + 3812: 5b cf rjmp .-330 ; 0x36ca + 3814: 30 e4 ldi r19, 0x40 ; 64 + 3816: 56 cf rjmp .-340 ; 0x36c4 + 3818: 20 e4 ldi r18, 0x40 ; 64 + 381a: e9 ce rjmp .-558 ; 0x35ee + 381c: 30 e4 ldi r19, 0x40 ; 64 + 381e: e4 ce rjmp .-568 ; 0x35e8 + 3820: 20 e4 ldi r18, 0x40 ; 64 + 3822: 77 ce rjmp .-786 ; 0x3512 + 3824: 30 e4 ldi r19, 0x40 ; 64 + 3826: 72 ce rjmp .-796 ; 0x350c -00003496 : +00003828 : void Crypto1Auth(uint8_t EncryptedReaderNonce[4]) { - 3496: cf 92 push r12 - 3498: df 92 push r13 - 349a: ef 92 push r14 - 349c: ff 92 push r15 - 349e: cf 93 push r28 - 34a0: fc 01 movw r30, r24 + 3828: cf 92 push r12 + 382a: df 92 push r13 + 382c: ef 92 push r14 + 382e: ff 92 push r15 + 3830: cf 93 push r28 + 3832: fc 01 movw r30, r24 uint32_t Temp = 0; /* For ease of processing, we convert the encrypted reader nonce * into a 32 bit integer */ Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; - 34a2: 81 81 ldd r24, Z+1 ; 0x01 + 3834: 81 81 ldd r24, Z+1 ; 0x01 Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; - 34a4: c2 80 ldd r12, Z+2 ; 0x02 - 34a6: d1 2c mov r13, r1 - 34a8: e1 2c mov r14, r1 - 34aa: f1 2c mov r15, r1 - 34ac: 76 01 movw r14, r12 - 34ae: dd 24 eor r13, r13 - 34b0: cc 24 eor r12, r12 + 3836: c2 80 ldd r12, Z+2 ; 0x02 + 3838: d1 2c mov r13, r1 + 383a: e1 2c mov r14, r1 + 383c: f1 2c mov r15, r1 + 383e: 76 01 movw r14, r12 + 3840: dd 24 eor r13, r13 + 3842: cc 24 eor r12, r12 uint32_t Temp = 0; /* For ease of processing, we convert the encrypted reader nonce * into a 32 bit integer */ Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; - 34b2: d8 2a or r13, r24 + 3844: d8 2a or r13, r24 { uint32_t Temp = 0; /* For ease of processing, we convert the encrypted reader nonce * into a 32 bit integer */ Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; - 34b4: 80 81 ld r24, Z + 3846: 80 81 ld r24, Z Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; - 34b6: c8 2a or r12, r24 + 3848: c8 2a or r12, r24 Temp |= (uint32_t) EncryptedReaderNonce[3] << 24; - 34b8: 83 81 ldd r24, Z+3 ; 0x03 - 34ba: f8 2a or r15, r24 - 34bc: c0 e2 ldi r28, 0x20 ; 32 + 384a: 83 81 ldd r24, Z+3 ; 0x03 + 384c: f8 2a or r15, r24 + 384e: c0 e2 ldi r28, 0x20 ; 32 uint8_t i; for (i=0; i<32; i++) { /* Decrypt one output bit of the given encrypted nonce using the * filter output as keystream. */ uint8_t Out = Crypto1FilterOutput(); - 34be: 17 de rcall .-978 ; 0x30ee + 3850: 17 de rcall .-978 ; 0x3480 uint8_t Bit = Out ^ (Temp & 0x01); - 34c0: b7 01 movw r22, r14 - 34c2: a6 01 movw r20, r12 - 34c4: 41 70 andi r20, 0x01 ; 1 - 34c6: 55 27 eor r21, r21 - 34c8: 66 27 eor r22, r22 - 34ca: 77 27 eor r23, r23 + 3852: b7 01 movw r22, r14 + 3854: a6 01 movw r20, r12 + 3856: 41 70 andi r20, 0x01 ; 1 + 3858: 55 27 eor r21, r21 + 385a: 66 27 eor r22, r22 + 385c: 77 27 eor r23, r23 /* Feed back the bit to load the LFSR with the (decrypted) nonce */ Crypto1LFSR(Bit); - 34cc: 84 27 eor r24, r20 - 34ce: c9 dd rcall .-1134 ; 0x3062 + 385e: 84 27 eor r24, r20 + 3860: c9 dd rcall .-1134 ; 0x33f4 Temp >>= 1; - 34d0: f6 94 lsr r15 - 34d2: e7 94 ror r14 - 34d4: d7 94 ror r13 - 34d6: c7 94 ror r12 - 34d8: c1 50 subi r28, 0x01 ; 1 + 3862: f6 94 lsr r15 + 3864: e7 94 ror r14 + 3866: d7 94 ror r13 + 3868: c7 94 ror r12 + 386a: c1 50 subi r28, 0x01 ; 1 Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; Temp |= (uint32_t) EncryptedReaderNonce[3] << 24; uint8_t i; for (i=0; i<32; i++) { - 34da: 89 f7 brne .-30 ; 0x34be + 386c: 89 f7 brne .-30 ; 0x3850 /* Feed back the bit to load the LFSR with the (decrypted) nonce */ Crypto1LFSR(Bit); Temp >>= 1; } } - 34dc: cf 91 pop r28 - 34de: ff 90 pop r15 - 34e0: ef 90 pop r14 - 34e2: df 90 pop r13 - 34e4: cf 90 pop r12 - 34e6: 08 95 ret + 386e: cf 91 pop r28 + 3870: ff 90 pop r15 + 3872: ef 90 pop r14 + 3874: df 90 pop r13 + 3876: cf 90 pop r12 + 3878: 08 95 ret -000034e8 : +0000387a : uint8_t Crypto1Byte(void) { - 34e8: cf 93 push r28 - 34ea: df 93 push r29 + 387a: cf 93 push r28 + 387c: df 93 push r29 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 34ec: 00 de rcall .-1024 ; 0x30ee - 34ee: c8 2f mov r28, r24 + 387e: 00 de rcall .-1024 ; 0x3480 + 3880: c8 2f mov r28, r24 Crypto1LFSR(0); - 34f0: 80 e0 ldi r24, 0x00 ; 0 - 34f2: b7 dd rcall .-1170 ; 0x3062 + 3882: 80 e0 ldi r24, 0x00 ; 0 + 3884: b7 dd rcall .-1170 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; if (Out) { - 34f4: cc 23 and r28, r28 - 34f6: 09 f4 brne .+2 ; 0x34fa - 34f8: 36 c0 rjmp .+108 ; 0x3566 + 3886: cc 23 and r28, r28 + 3888: 09 f4 brne .+2 ; 0x388c + 388a: 36 c0 rjmp .+108 ; 0x38f8 KeyStream |= (1<<7); - 34fa: c0 e8 ldi r28, 0x80 ; 128 + 388c: c0 e8 ldi r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 34fc: f8 dd rcall .-1040 ; 0x30ee - 34fe: d8 2f mov r29, r24 + 388e: f8 dd rcall .-1040 ; 0x3480 + 3890: d8 2f mov r29, r24 Crypto1LFSR(0); - 3500: 80 e0 ldi r24, 0x00 ; 0 - 3502: af dd rcall .-1186 ; 0x3062 + 3892: 80 e0 ldi r24, 0x00 ; 0 + 3894: af dd rcall .-1186 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 3504: c6 95 lsr r28 + 3896: c6 95 lsr r28 if (Out) { - 3506: d1 11 cpse r29, r1 + 3898: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 3508: c0 68 ori r28, 0x80 ; 128 + 389a: c0 68 ori r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 350a: f1 dd rcall .-1054 ; 0x30ee - 350c: d8 2f mov r29, r24 + 389c: f1 dd rcall .-1054 ; 0x3480 + 389e: d8 2f mov r29, r24 Crypto1LFSR(0); - 350e: 80 e0 ldi r24, 0x00 ; 0 - 3510: a8 dd rcall .-1200 ; 0x3062 + 38a0: 80 e0 ldi r24, 0x00 ; 0 + 38a2: a8 dd rcall .-1200 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 3512: c6 95 lsr r28 + 38a4: c6 95 lsr r28 if (Out) { - 3514: d1 11 cpse r29, r1 + 38a6: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 3516: c0 68 ori r28, 0x80 ; 128 + 38a8: c0 68 ori r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 3518: ea dd rcall .-1068 ; 0x30ee - 351a: d8 2f mov r29, r24 + 38aa: ea dd rcall .-1068 ; 0x3480 + 38ac: d8 2f mov r29, r24 Crypto1LFSR(0); - 351c: 80 e0 ldi r24, 0x00 ; 0 - 351e: a1 dd rcall .-1214 ; 0x3062 + 38ae: 80 e0 ldi r24, 0x00 ; 0 + 38b0: a1 dd rcall .-1214 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 3520: c6 95 lsr r28 + 38b2: c6 95 lsr r28 if (Out) { - 3522: d1 11 cpse r29, r1 + 38b4: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 3524: c0 68 ori r28, 0x80 ; 128 + 38b6: c0 68 ori r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 3526: e3 dd rcall .-1082 ; 0x30ee - 3528: d8 2f mov r29, r24 + 38b8: e3 dd rcall .-1082 ; 0x3480 + 38ba: d8 2f mov r29, r24 Crypto1LFSR(0); - 352a: 80 e0 ldi r24, 0x00 ; 0 - 352c: 9a dd rcall .-1228 ; 0x3062 + 38bc: 80 e0 ldi r24, 0x00 ; 0 + 38be: 9a dd rcall .-1228 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 352e: c6 95 lsr r28 + 38c0: c6 95 lsr r28 if (Out) { - 3530: d1 11 cpse r29, r1 + 38c2: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 3532: c0 68 ori r28, 0x80 ; 128 + 38c4: c0 68 ori r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 3534: dc dd rcall .-1096 ; 0x30ee - 3536: d8 2f mov r29, r24 + 38c6: dc dd rcall .-1096 ; 0x3480 + 38c8: d8 2f mov r29, r24 Crypto1LFSR(0); - 3538: 80 e0 ldi r24, 0x00 ; 0 - 353a: 93 dd rcall .-1242 ; 0x3062 + 38ca: 80 e0 ldi r24, 0x00 ; 0 + 38cc: 93 dd rcall .-1242 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 353c: c6 95 lsr r28 + 38ce: c6 95 lsr r28 if (Out) { - 353e: d1 11 cpse r29, r1 + 38d0: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 3540: c0 68 ori r28, 0x80 ; 128 + 38d2: c0 68 ori r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 3542: d5 dd rcall .-1110 ; 0x30ee - 3544: d8 2f mov r29, r24 + 38d4: d5 dd rcall .-1110 ; 0x3480 + 38d6: d8 2f mov r29, r24 Crypto1LFSR(0); - 3546: 80 e0 ldi r24, 0x00 ; 0 - 3548: 8c dd rcall .-1256 ; 0x3062 + 38d8: 80 e0 ldi r24, 0x00 ; 0 + 38da: 8c dd rcall .-1256 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 354a: c6 95 lsr r28 + 38dc: c6 95 lsr r28 if (Out) { - 354c: d1 11 cpse r29, r1 + 38de: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 354e: c0 68 ori r28, 0x80 ; 128 + 38e0: c0 68 ori r28, 0x80 ; 128 /* Generate 8 keystream-bits */ for (i=0; i<8; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 3550: ce dd rcall .-1124 ; 0x30ee - 3552: d8 2f mov r29, r24 + 38e2: ce dd rcall .-1124 ; 0x3480 + 38e4: d8 2f mov r29, r24 Crypto1LFSR(0); - 3554: 80 e0 ldi r24, 0x00 ; 0 - 3556: 85 dd rcall .-1270 ; 0x3062 + 38e6: 80 e0 ldi r24, 0x00 ; 0 + 38e8: 85 dd rcall .-1270 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 3558: 8c 2f mov r24, r28 - 355a: 86 95 lsr r24 + 38ea: 8c 2f mov r24, r28 + 38ec: 86 95 lsr r24 if (Out) { - 355c: d1 11 cpse r29, r1 + 38ee: d1 11 cpse r29, r1 KeyStream |= (1<<7); - 355e: 80 68 ori r24, 0x80 ; 128 + 38f0: 80 68 ori r24, 0x80 ; 128 } } return KeyStream; } - 3560: df 91 pop r29 - 3562: cf 91 pop r28 - 3564: 08 95 ret + 38f2: df 91 pop r29 + 38f4: cf 91 pop r28 + 38f6: 08 95 ret * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); Crypto1LFSR(0); /* Store keystream bit */ KeyStream >>= 1; - 3566: c0 e0 ldi r28, 0x00 ; 0 - 3568: c9 cf rjmp .-110 ; 0x34fc + 38f8: c0 e0 ldi r28, 0x00 ; 0 + 38fa: c9 cf rjmp .-110 ; 0x388e -0000356a : +000038fc : return KeyStream; } uint8_t Crypto1Nibble(void) { - 356a: cf 93 push r28 - 356c: df 93 push r29 + 38fc: cf 93 push r28 + 38fe: df 93 push r29 /* Generate 4 keystream-bits */ for (i=0; i<4; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 356e: bf dd rcall .-1154 ; 0x30ee - 3570: c8 2f mov r28, r24 + 3900: bf dd rcall .-1154 ; 0x3480 + 3902: c8 2f mov r28, r24 Crypto1LFSR(0); - 3572: 80 e0 ldi r24, 0x00 ; 0 - 3574: 76 dd rcall .-1300 ; 0x3062 + 3904: 80 e0 ldi r24, 0x00 ; 0 + 3906: 76 dd rcall .-1300 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; if (Out) { - 3576: cc 23 and r28, r28 - 3578: d1 f0 breq .+52 ; 0x35ae + 3908: cc 23 and r28, r28 + 390a: d1 f0 breq .+52 ; 0x3940 KeyStream |= (1<<3); - 357a: c8 e0 ldi r28, 0x08 ; 8 + 390c: c8 e0 ldi r28, 0x08 ; 8 /* Generate 4 keystream-bits */ for (i=0; i<4; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 357c: b8 dd rcall .-1168 ; 0x30ee - 357e: d8 2f mov r29, r24 + 390e: b8 dd rcall .-1168 ; 0x3480 + 3910: d8 2f mov r29, r24 Crypto1LFSR(0); - 3580: 80 e0 ldi r24, 0x00 ; 0 - 3582: 6f dd rcall .-1314 ; 0x3062 + 3912: 80 e0 ldi r24, 0x00 ; 0 + 3914: 6f dd rcall .-1314 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 3584: c6 95 lsr r28 + 3916: c6 95 lsr r28 if (Out) { - 3586: d1 11 cpse r29, r1 + 3918: d1 11 cpse r29, r1 KeyStream |= (1<<3); - 3588: c8 60 ori r28, 0x08 ; 8 + 391a: c8 60 ori r28, 0x08 ; 8 /* Generate 4 keystream-bits */ for (i=0; i<4; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 358a: b1 dd rcall .-1182 ; 0x30ee - 358c: d8 2f mov r29, r24 + 391c: b1 dd rcall .-1182 ; 0x3480 + 391e: d8 2f mov r29, r24 Crypto1LFSR(0); - 358e: 80 e0 ldi r24, 0x00 ; 0 - 3590: 68 dd rcall .-1328 ; 0x3062 + 3920: 80 e0 ldi r24, 0x00 ; 0 + 3922: 68 dd rcall .-1328 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 3592: c6 95 lsr r28 + 3924: c6 95 lsr r28 if (Out) { - 3594: d1 11 cpse r29, r1 + 3926: d1 11 cpse r29, r1 KeyStream |= (1<<3); - 3596: c8 60 ori r28, 0x08 ; 8 + 3928: c8 60 ori r28, 0x08 ; 8 /* Generate 4 keystream-bits */ for (i=0; i<4; i++) { /* Calculate output of function-network and cycle LFSR with no * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); - 3598: aa dd rcall .-1196 ; 0x30ee - 359a: d8 2f mov r29, r24 + 392a: aa dd rcall .-1196 ; 0x3480 + 392c: d8 2f mov r29, r24 Crypto1LFSR(0); - 359c: 80 e0 ldi r24, 0x00 ; 0 - 359e: 61 dd rcall .-1342 ; 0x3062 + 392e: 80 e0 ldi r24, 0x00 ; 0 + 3930: 61 dd rcall .-1342 ; 0x33f4 /* Store keystream bit */ KeyStream >>= 1; - 35a0: 8c 2f mov r24, r28 - 35a2: 86 95 lsr r24 + 3932: 8c 2f mov r24, r28 + 3934: 86 95 lsr r24 if (Out) { - 35a4: d1 11 cpse r29, r1 + 3936: d1 11 cpse r29, r1 KeyStream |= (1<<3); - 35a6: 88 60 ori r24, 0x08 ; 8 + 3938: 88 60 ori r24, 0x08 ; 8 } } return KeyStream; } - 35a8: df 91 pop r29 - 35aa: cf 91 pop r28 - 35ac: 08 95 ret + 393a: df 91 pop r29 + 393c: cf 91 pop r28 + 393e: 08 95 ret * additional input, thus linearly! */ uint8_t Out = Crypto1FilterOutput(); Crypto1LFSR(0); /* Store keystream bit */ KeyStream >>= 1; - 35ae: c0 e0 ldi r28, 0x00 ; 0 - 35b0: e5 cf rjmp .-54 ; 0x357c + 3940: c0 e0 ldi r28, 0x00 ; 0 + 3942: e5 cf rjmp .-54 ; 0x390e -000035b2 : +00003944 : return KeyStream; } void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) { - 35b2: 6f 92 push r6 - 35b4: 7f 92 push r7 - 35b6: 8f 92 push r8 - 35b8: 9f 92 push r9 - 35ba: af 92 push r10 - 35bc: bf 92 push r11 - 35be: cf 92 push r12 - 35c0: df 92 push r13 - 35c2: ef 92 push r14 - 35c4: ff 92 push r15 - 35c6: 0f 93 push r16 - 35c8: 1f 93 push r17 - 35ca: cf 93 push r28 - 35cc: df 93 push r29 - 35ce: 3c 01 movw r6, r24 + 3944: 6f 92 push r6 + 3946: 7f 92 push r7 + 3948: 8f 92 push r8 + 394a: 9f 92 push r9 + 394c: af 92 push r10 + 394e: bf 92 push r11 + 3950: cf 92 push r12 + 3952: df 92 push r13 + 3954: ef 92 push r14 + 3956: ff 92 push r15 + 3958: 0f 93 push r16 + 395a: 1f 93 push r17 + 395c: cf 93 push r28 + 395e: df 93 push r29 + 3960: 3c 01 movw r6, r24 while(ClockCount--) { - 35d0: cb 01 movw r24, r22 - 35d2: 01 97 sbiw r24, 0x01 ; 1 - 35d4: 67 2b or r22, r23 - 35d6: c9 f1 breq .+114 ; 0x364a - 35d8: f3 01 movw r30, r6 - 35da: a2 81 ldd r26, Z+2 ; 0x02 - 35dc: c0 81 ld r28, Z - 35de: b1 81 ldd r27, Z+1 ; 0x01 - 35e0: d3 81 ldd r29, Z+3 ; 0x03 + 3962: cb 01 movw r24, r22 + 3964: 01 97 sbiw r24, 0x01 ; 1 + 3966: 67 2b or r22, r23 + 3968: c9 f1 breq .+114 ; 0x39dc + 396a: f3 01 movw r30, r6 + 396c: a2 81 ldd r26, Z+2 ; 0x02 + 396e: c0 81 ld r28, Z + 3970: b1 81 ldd r27, Z+1 ; 0x01 + 3972: d3 81 ldd r29, Z+3 ; 0x03 * XOR all tapped bits to a single feedback bit. */ uint8_t Feedback = 0; Feedback ^= State[0] & (uint8_t) (PRNG_MASK >> 0); Feedback ^= State[1] & (uint8_t) (PRNG_MASK >> 8); Feedback ^= State[2] & (uint8_t) (PRNG_MASK >> 16); - 35e2: 2a 2f mov r18, r26 - 35e4: 2d 72 andi r18, 0x2D ; 45 + 3974: 2a 2f mov r18, r26 + 3976: 2d 72 andi r18, 0x2D ; 45 Feedback ^= State[3] & (uint8_t) (PRNG_MASK >> 24); Feedback ^= Feedback >> 4; - 35e6: 32 2f mov r19, r18 - 35e8: 32 95 swap r19 - 35ea: 3f 70 andi r19, 0x0F ; 15 - 35ec: 32 27 eor r19, r18 + 3978: 32 2f mov r19, r18 + 397a: 32 95 swap r19 + 397c: 3f 70 andi r19, 0x0F ; 15 + 397e: 32 27 eor r19, r18 Feedback ^= Feedback >> 2; - 35ee: 23 2f mov r18, r19 - 35f0: 26 95 lsr r18 - 35f2: 26 95 lsr r18 - 35f4: 23 27 eor r18, r19 + 3980: 23 2f mov r18, r19 + 3982: 26 95 lsr r18 + 3984: 26 95 lsr r18 + 3986: 23 27 eor r18, r19 Feedback ^= Feedback >> 1; - 35f6: 32 2f mov r19, r18 - 35f8: 36 95 lsr r19 + 3988: 32 2f mov r19, r18 + 398a: 36 95 lsr r19 uint32_t Temp = 0; Temp |= (uint32_t) State[0] << 0; Temp |= (uint32_t) State[1] << 8; Temp |= (uint32_t) State[2] << 16; Temp |= (uint32_t) State[3] << 24; - 35fa: 4d 2f mov r20, r29 - 35fc: 50 e0 ldi r21, 0x00 ; 0 - 35fe: 60 e0 ldi r22, 0x00 ; 0 - 3600: 70 e0 ldi r23, 0x00 ; 0 - 3602: 74 2f mov r23, r20 - 3604: 66 27 eor r22, r22 - 3606: 55 27 eor r21, r21 - 3608: 44 27 eor r20, r20 + 398c: 4d 2f mov r20, r29 + 398e: 50 e0 ldi r21, 0x00 ; 0 + 3990: 60 e0 ldi r22, 0x00 ; 0 + 3992: 70 e0 ldi r23, 0x00 ; 0 + 3994: 74 2f mov r23, r20 + 3996: 66 27 eor r22, r22 + 3998: 55 27 eor r21, r21 + 399a: 44 27 eor r20, r20 /* For ease of processing convert the state into a 32 bit integer first */ uint32_t Temp = 0; Temp |= (uint32_t) State[0] << 0; Temp |= (uint32_t) State[1] << 8; - 360a: 5b 2b or r21, r27 + 399c: 5b 2b or r21, r27 Temp |= (uint32_t) State[2] << 16; - 360c: 4c 2b or r20, r28 + 399e: 4c 2b or r20, r28 Temp |= (uint32_t) State[3] << 24; - 360e: 6a 2b or r22, r26 + 39a0: 6a 2b or r22, r26 /* Cycle LFSR and feed back. */ Temp >>= 1; - 3610: 76 95 lsr r23 - 3612: 67 95 ror r22 - 3614: 57 95 ror r21 - 3616: 47 95 ror r20 + 39a2: 76 95 lsr r23 + 39a4: 67 95 ror r22 + 39a6: 57 95 ror r21 + 39a8: 47 95 ror r20 Feedback ^= State[2] & (uint8_t) (PRNG_MASK >> 16); Feedback ^= State[3] & (uint8_t) (PRNG_MASK >> 24); Feedback ^= Feedback >> 4; Feedback ^= Feedback >> 2; Feedback ^= Feedback >> 1; - 3618: 32 27 eor r19, r18 + 39aa: 32 27 eor r19, r18 Temp |= (uint32_t) State[3] << 24; /* Cycle LFSR and feed back. */ Temp >>= 1; if (Feedback & 0x01) { - 361a: 30 fd sbrc r19, 0 + 39ac: 30 fd sbrc r19, 0 Temp |= (uint32_t) 1 << (8 * PRNG_SIZE - 1); - 361c: 70 68 ori r23, 0x80 ; 128 + 39ae: 70 68 ori r23, 0x80 ; 128 } /* Store back state */ State[0] = (uint8_t) (Temp >> 0); - 361e: c4 2f mov r28, r20 + 39b0: c4 2f mov r28, r20 State[1] = (uint8_t) (Temp >> 8); - 3620: 85 2e mov r8, r21 - 3622: 96 2e mov r9, r22 - 3624: a7 2e mov r10, r23 - 3626: bb 24 eor r11, r11 - 3628: b8 2d mov r27, r8 + 39b2: 85 2e mov r8, r21 + 39b4: 96 2e mov r9, r22 + 39b6: a7 2e mov r10, r23 + 39b8: bb 24 eor r11, r11 + 39ba: b8 2d mov r27, r8 State[2] = (uint8_t) (Temp >> 16); - 362a: 6b 01 movw r12, r22 - 362c: ee 24 eor r14, r14 - 362e: ff 24 eor r15, r15 - 3630: ac 2d mov r26, r12 + 39bc: 6b 01 movw r12, r22 + 39be: ee 24 eor r14, r14 + 39c0: ff 24 eor r15, r15 + 39c2: ac 2d mov r26, r12 State[3] = (uint8_t) (Temp >> 24); - 3632: 07 2f mov r16, r23 - 3634: 11 27 eor r17, r17 - 3636: 22 27 eor r18, r18 - 3638: 33 27 eor r19, r19 - 363a: d0 2f mov r29, r16 + 39c4: 07 2f mov r16, r23 + 39c6: 11 27 eor r17, r17 + 39c8: 22 27 eor r18, r18 + 39ca: 33 27 eor r19, r19 + 39cc: d0 2f mov r29, r16 return KeyStream; } void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) { while(ClockCount--) { - 363c: 01 97 sbiw r24, 0x01 ; 1 - 363e: 88 f6 brcc .-94 ; 0x35e2 - 3640: f3 01 movw r30, r6 - 3642: 40 83 st Z, r20 - 3644: 81 82 std Z+1, r8 ; 0x01 - 3646: c2 82 std Z+2, r12 ; 0x02 - 3648: 03 83 std Z+3, r16 ; 0x03 + 39ce: 01 97 sbiw r24, 0x01 ; 1 + 39d0: 88 f6 brcc .-94 ; 0x3974 + 39d2: f3 01 movw r30, r6 + 39d4: 40 83 st Z, r20 + 39d6: 81 82 std Z+1, r8 ; 0x01 + 39d8: c2 82 std Z+2, r12 ; 0x02 + 39da: 03 83 std Z+3, r16 ; 0x03 State[2] = (uint8_t) (Temp >> 16); State[3] = (uint8_t) (Temp >> 24); } } - 364a: df 91 pop r29 - 364c: cf 91 pop r28 - 364e: 1f 91 pop r17 - 3650: 0f 91 pop r16 - 3652: ff 90 pop r15 - 3654: ef 90 pop r14 - 3656: df 90 pop r13 - 3658: cf 90 pop r12 - 365a: bf 90 pop r11 - 365c: af 90 pop r10 - 365e: 9f 90 pop r9 - 3660: 8f 90 pop r8 - 3662: 7f 90 pop r7 - 3664: 6f 90 pop r6 - 3666: 08 95 ret + 39dc: df 91 pop r29 + 39de: cf 91 pop r28 + 39e0: 1f 91 pop r17 + 39e2: 0f 91 pop r16 + 39e4: ff 90 pop r15 + 39e6: ef 90 pop r14 + 39e8: df 90 pop r13 + 39ea: cf 90 pop r12 + 39ec: bf 90 pop r11 + 39ee: af 90 pop r10 + 39f0: 9f 90 pop r9 + 39f2: 8f 90 pop r8 + 39f4: 7f 90 pop r7 + 39f6: 6f 90 pop r6 + 39f8: 08 95 ret -00003668 : +000039fa : #if !defined(NO_DEVICE_REMOTE_WAKEUP) bool USB_Device_RemoteWakeupEnabled; #endif void USB_Device_ProcessControlRequest(void) { - 3668: 0f 93 push r16 - 366a: 1f 93 push r17 - 366c: cf 93 push r28 - 366e: df 93 push r29 - 3670: cd b7 in r28, 0x3d ; 61 - 3672: de b7 in r29, 0x3e ; 62 - 3674: ec 97 sbiw r28, 0x3c ; 60 - 3676: cd bf out 0x3d, r28 ; 61 - 3678: de bf out 0x3e, r29 ; 62 + 39fa: 0f 93 push r16 + 39fc: 1f 93 push r17 + 39fe: cf 93 push r28 + 3a00: df 93 push r29 + 3a02: cd b7 in r28, 0x3d ; 61 + 3a04: de b7 in r29, 0x3e ; 62 + 3a06: ec 97 sbiw r28, 0x3c ; 60 + 3a08: cd bf out 0x3d, r28 ; 61 + 3a0a: de bf out 0x3e, r29 ; 62 USB_ControlRequest.wLength = Endpoint_Read_16_LE(); #else uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest; for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++) *(RequestHeader++) = Endpoint_Read_8(); - 367a: 2b d3 rcall .+1622 ; 0x3cd2 - 367c: 80 93 15 23 sts 0x2315, r24 - 3680: 28 d3 rcall .+1616 ; 0x3cd2 - 3682: 80 93 16 23 sts 0x2316, r24 - 3686: 25 d3 rcall .+1610 ; 0x3cd2 - 3688: 80 93 17 23 sts 0x2317, r24 - 368c: 22 d3 rcall .+1604 ; 0x3cd2 - 368e: 80 93 18 23 sts 0x2318, r24 - 3692: 1f d3 rcall .+1598 ; 0x3cd2 - 3694: 80 93 19 23 sts 0x2319, r24 - 3698: 1c d3 rcall .+1592 ; 0x3cd2 - 369a: 80 93 1a 23 sts 0x231A, r24 - 369e: 19 d3 rcall .+1586 ; 0x3cd2 - 36a0: 80 93 1b 23 sts 0x231B, r24 - 36a4: 16 d3 rcall .+1580 ; 0x3cd2 - 36a6: 80 93 1c 23 sts 0x231C, r24 + 3a0c: 2b d3 rcall .+1622 ; 0x4064 + 3a0e: 80 93 15 27 sts 0x2715, r24 + 3a12: 28 d3 rcall .+1616 ; 0x4064 + 3a14: 80 93 16 27 sts 0x2716, r24 + 3a18: 25 d3 rcall .+1610 ; 0x4064 + 3a1a: 80 93 17 27 sts 0x2717, r24 + 3a1e: 22 d3 rcall .+1604 ; 0x4064 + 3a20: 80 93 18 27 sts 0x2718, r24 + 3a24: 1f d3 rcall .+1598 ; 0x4064 + 3a26: 80 93 19 27 sts 0x2719, r24 + 3a2a: 1c d3 rcall .+1592 ; 0x4064 + 3a2c: 80 93 1a 27 sts 0x271A, r24 + 3a30: 19 d3 rcall .+1586 ; 0x4064 + 3a32: 80 93 1b 27 sts 0x271B, r24 + 3a36: 16 d3 rcall .+1580 ; 0x4064 + 3a38: 80 93 1c 27 sts 0x271C, r24 #endif EVENT_USB_Device_ControlRequest(); - 36aa: 0e 94 36 0b call 0x166c ; 0x166c + 3a3c: 0e 94 f9 0c call 0x19f2 ; 0x19f2 if (Endpoint_IsSETUPReceived()) - 36ae: b0 d3 rcall .+1888 ; 0x3e10 - 36b0: 88 23 and r24, r24 - 36b2: 89 f0 breq .+34 ; 0x36d6 + 3a40: b0 d3 rcall .+1888 ; 0x41a2 + 3a42: 88 23 and r24, r24 + 3a44: 89 f0 breq .+34 ; 0x3a68 { uint8_t bmRequestType = USB_ControlRequest.bmRequestType; - 36b4: 90 91 15 23 lds r25, 0x2315 + 3a46: 90 91 15 27 lds r25, 0x2715 switch (USB_ControlRequest.bRequest) - 36b8: 80 91 16 23 lds r24, 0x2316 - 36bc: 85 30 cpi r24, 0x05 ; 5 - 36be: 09 f4 brne .+2 ; 0x36c2 - 36c0: 52 c0 rjmp .+164 ; 0x3766 - 36c2: b0 f0 brcs .+44 ; 0x36f0 - 36c4: 88 30 cpi r24, 0x08 ; 8 - 36c6: 09 f4 brne .+2 ; 0x36ca - 36c8: b3 c0 rjmp .+358 ; 0x3830 - 36ca: 89 30 cpi r24, 0x09 ; 9 - 36cc: 09 f4 brne .+2 ; 0x36d0 - 36ce: 98 c0 rjmp .+304 ; 0x3800 - 36d0: 86 30 cpi r24, 0x06 ; 6 - 36d2: 09 f4 brne .+2 ; 0x36d6 - 36d4: 5a c0 rjmp .+180 ; 0x378a + 3a4a: 80 91 16 27 lds r24, 0x2716 + 3a4e: 85 30 cpi r24, 0x05 ; 5 + 3a50: 09 f4 brne .+2 ; 0x3a54 + 3a52: 52 c0 rjmp .+164 ; 0x3af8 + 3a54: b0 f0 brcs .+44 ; 0x3a82 + 3a56: 88 30 cpi r24, 0x08 ; 8 + 3a58: 09 f4 brne .+2 ; 0x3a5c + 3a5a: b3 c0 rjmp .+358 ; 0x3bc2 + 3a5c: 89 30 cpi r24, 0x09 ; 9 + 3a5e: 09 f4 brne .+2 ; 0x3a62 + 3a60: 98 c0 rjmp .+304 ; 0x3b92 + 3a62: 86 30 cpi r24, 0x06 ; 6 + 3a64: 09 f4 brne .+2 ; 0x3a68 + 3a66: 5a c0 rjmp .+180 ; 0x3b1c default: break; } } if (Endpoint_IsSETUPReceived()) - 36d6: 9c d3 rcall .+1848 ; 0x3e10 - 36d8: 88 23 and r24, r24 - 36da: 11 f0 breq .+4 ; 0x36e0 + 3a68: 9c d3 rcall .+1848 ; 0x41a2 + 3a6a: 88 23 and r24, r24 + 3a6c: 11 f0 breq .+4 ; 0x3a72 { Endpoint_ClearSETUP(); - 36dc: 6d d3 rcall .+1754 ; 0x3db8 + 3a6e: 6d d3 rcall .+1754 ; 0x414a Endpoint_StallTransaction(); - 36de: 50 d3 rcall .+1696 ; 0x3d80 + 3a70: 50 d3 rcall .+1696 ; 0x4112 } } - 36e0: ec 96 adiw r28, 0x3c ; 60 - 36e2: cd bf out 0x3d, r28 ; 61 - 36e4: de bf out 0x3e, r29 ; 62 - 36e6: df 91 pop r29 - 36e8: cf 91 pop r28 - 36ea: 1f 91 pop r17 - 36ec: 0f 91 pop r16 - 36ee: 08 95 ret + 3a72: ec 96 adiw r28, 0x3c ; 60 + 3a74: cd bf out 0x3d, r28 ; 61 + 3a76: de bf out 0x3e, r29 ; 62 + 3a78: df 91 pop r29 + 3a7a: cf 91 pop r28 + 3a7c: 1f 91 pop r17 + 3a7e: 0f 91 pop r16 + 3a80: 08 95 ret if (Endpoint_IsSETUPReceived()) { uint8_t bmRequestType = USB_ControlRequest.bmRequestType; switch (USB_ControlRequest.bRequest) - 36f0: 81 30 cpi r24, 0x01 ; 1 - 36f2: 21 f0 breq .+8 ; 0x36fc - 36f4: 08 f4 brcc .+2 ; 0x36f8 - 36f6: 68 c0 rjmp .+208 ; 0x37c8 - 36f8: 83 30 cpi r24, 0x03 ; 3 - 36fa: 69 f7 brne .-38 ; 0x36d6 + 3a82: 81 30 cpi r24, 0x01 ; 1 + 3a84: 21 f0 breq .+8 ; 0x3a8e + 3a86: 08 f4 brcc .+2 ; 0x3a8a + 3a88: 68 c0 rjmp .+208 ; 0x3b5a + 3a8a: 83 30 cpi r24, 0x03 ; 3 + 3a8c: 69 f7 brne .-38 ; 0x3a68 } break; case REQ_ClearFeature: case REQ_SetFeature: if ((bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) || - 36fc: 99 23 and r25, r25 - 36fe: 09 f4 brne .+2 ; 0x3702 - 3700: a1 c0 rjmp .+322 ; 0x3844 - 3702: 92 30 cpi r25, 0x02 ; 2 - 3704: 41 f7 brne .-48 ; 0x36d6 + 3a8e: 99 23 and r25, r25 + 3a90: 09 f4 brne .+2 ; 0x3a94 + 3a92: a1 c0 rjmp .+322 ; 0x3bd6 + 3a94: 92 30 cpi r25, 0x02 ; 2 + 3a96: 41 f7 brne .-48 ; 0x3a68 break; #endif #if !defined(CONTROL_ONLY_DEVICE) case REQREC_ENDPOINT: if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt) - 3706: 80 91 17 23 lds r24, 0x2317 - 370a: 81 11 cpse r24, r1 - 370c: 27 c0 rjmp .+78 ; 0x375c + 3a98: 80 91 17 27 lds r24, 0x2717 + 3a9c: 81 11 cpse r24, r1 + 3a9e: 27 c0 rjmp .+78 ; 0x3aee { uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); - 370e: 00 91 19 23 lds r16, 0x2319 - 3712: 10 91 1a 23 lds r17, 0x231A - 3716: 0f 70 andi r16, 0x0F ; 15 - 3718: 11 27 eor r17, r17 + 3aa0: 00 91 19 27 lds r16, 0x2719 + 3aa4: 10 91 1a 27 lds r17, 0x271A + 3aa8: 0f 70 andi r16, 0x0F ; 15 + 3aaa: 11 27 eor r17, r17 if (EndpointIndex == ENDPOINT_CONTROLEP) - 371a: 01 15 cp r16, r1 - 371c: 11 05 cpc r17, r1 - 371e: d9 f2 breq .-74 ; 0x36d6 + 3aac: 01 15 cp r16, r1 + 3aae: 11 05 cpc r17, r1 + 3ab0: d9 f2 breq .-74 ; 0x3a68 return; Endpoint_SelectEndpoint(EndpointIndex); - 3720: 80 2f mov r24, r16 - 3722: f5 d2 rcall .+1514 ; 0x3d0e + 3ab2: 80 2f mov r24, r16 + 3ab4: f5 d2 rcall .+1514 ; 0x40a0 if (Endpoint_IsEnabled()) { if (USB_ControlRequest.bRequest == REQ_SetFeature) - 3724: 80 91 16 23 lds r24, 0x2316 - 3728: 83 30 cpi r24, 0x03 ; 3 - 372a: 09 f4 brne .+2 ; 0x372e - 372c: e6 c0 rjmp .+460 ; 0x38fa + 3ab6: 80 91 16 27 lds r24, 0x2716 + 3aba: 83 30 cpi r24, 0x03 ; 3 + 3abc: 09 f4 brne .+2 ; 0x3ac0 + 3abe: e6 c0 rjmp .+460 ; 0x3c8c * \ingroup Group_EndpointPacketManagement_XMEGA */ static inline void Endpoint_ClearStall(void) ATTR_ALWAYS_INLINE; static inline void Endpoint_ClearStall(void) { USB_Endpoint_SelectedHandle->CTRL &= ~USB_EP_STALL_bm; - 372e: e0 91 1f 23 lds r30, 0x231F - 3732: f0 91 20 23 lds r31, 0x2320 - 3736: 81 81 ldd r24, Z+1 ; 0x01 - 3738: 8b 7f andi r24, 0xFB ; 251 - 373a: 81 83 std Z+1, r24 ; 0x01 + 3ac0: e0 91 1f 27 lds r30, 0x271F + 3ac4: f0 91 20 27 lds r31, 0x2720 + 3ac8: 81 81 ldd r24, Z+1 ; 0x01 + 3aca: 8b 7f andi r24, 0xFB ; 251 + 3acc: 81 83 std Z+1, r24 ; 0x01 static inline void Endpoint_ResetEndpoint(const uint8_t Address) { if (Address & ENDPOINT_DIR_IN) USB_Endpoint_FIFOs[Address & ENDPOINT_EPNUM_MASK].IN.Position = 0; else USB_Endpoint_FIFOs[Address & ENDPOINT_EPNUM_MASK].OUT.Position = 0; - 373c: 84 e8 ldi r24, 0x84 ; 132 - 373e: 80 9f mul r24, r16 - 3740: f0 01 movw r30, r0 - 3742: 81 9f mul r24, r17 - 3744: f0 0d add r31, r0 - 3746: 11 24 eor r1, r1 - 3748: ed 59 subi r30, 0x9D ; 157 - 374a: fc 4d sbci r31, 0xDC ; 220 - 374c: 10 82 st Z, r1 + 3ace: 84 e8 ldi r24, 0x84 ; 132 + 3ad0: 80 9f mul r24, r16 + 3ad2: f0 01 movw r30, r0 + 3ad4: 81 9f mul r24, r17 + 3ad6: f0 0d add r31, r0 + 3ad8: 11 24 eor r1, r1 + 3ada: ed 59 subi r30, 0x9D ; 157 + 3adc: f8 4d sbci r31, 0xD8 ; 216 + 3ade: 10 82 st Z, r1 /** Resets the data toggle of the currently selected endpoint. */ static inline void Endpoint_ResetDataToggle(void) ATTR_ALWAYS_INLINE; static inline void Endpoint_ResetDataToggle(void) { USB_Endpoint_SelectedHandle->STATUS &= ~USB_EP_TOGGLE_bm; - 374e: e0 91 1f 23 lds r30, 0x231F - 3752: f0 91 20 23 lds r31, 0x2320 - 3756: 80 81 ld r24, Z - 3758: 8e 7f andi r24, 0xFE ; 254 - 375a: 80 83 st Z, r24 + 3ae0: e0 91 1f 27 lds r30, 0x271F + 3ae4: f0 91 20 27 lds r31, 0x2720 + 3ae8: 80 81 ld r24, Z + 3aea: 8e 7f andi r24, 0xFE ; 254 + 3aec: 80 83 st Z, r24 #endif default: return; } Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 375c: 80 e0 ldi r24, 0x00 ; 0 - 375e: d7 d2 rcall .+1454 ; 0x3d0e + 3aee: 80 e0 ldi r24, 0x00 ; 0 + 3af0: d7 d2 rcall .+1454 ; 0x40a0 Endpoint_ClearSETUP(); - 3760: 2b d3 rcall .+1622 ; 0x3db8 + 3af2: 2b d3 rcall .+1622 ; 0x414a Endpoint_ClearStatusStage(); - 3762: 8f d4 rcall .+2334 ; 0x4082 - 3764: b8 cf rjmp .-144 ; 0x36d6 + 3af4: 8f d4 rcall .+2334 ; 0x4414 + 3af6: b8 cf rjmp .-144 ; 0x3a68 USB_Device_ClearSetFeature(); } break; case REQ_SetAddress: if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - 3766: 91 11 cpse r25, r1 - 3768: b6 cf rjmp .-148 ; 0x36d6 + 3af8: 91 11 cpse r25, r1 + 3afa: b6 cf rjmp .-148 ; 0x3a68 } } static void USB_Device_SetAddress(void) { uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F); - 376a: 10 91 17 23 lds r17, 0x2317 - 376e: 1f 77 andi r17, 0x7F ; 127 + 3afc: 10 91 17 27 lds r17, 0x2717 + 3b00: 1f 77 andi r17, 0x7F ; 127 USB_Device_SetDeviceAddress(DeviceAddress); Endpoint_ClearSETUP(); - 3770: 23 d3 rcall .+1606 ; 0x3db8 + 3b02: 23 d3 rcall .+1606 ; 0x414a Endpoint_ClearStatusStage(); - 3772: 87 d4 rcall .+2318 ; 0x4082 + 3b04: 87 d4 rcall .+2318 ; 0x4414 while (!(Endpoint_IsINReady())); - 3774: 7f d3 rcall .+1790 ; 0x3e74 - 3776: 88 23 and r24, r24 - 3778: e9 f3 breq .-6 ; 0x3774 + 3b06: 7f d3 rcall .+1790 ; 0x4206 + 3b08: 88 23 and r24, r24 + 3b0a: e9 f3 breq .-6 ; 0x3b06 } static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) { USB.ADDR = Address; - 377a: 10 93 c3 04 sts 0x04C3, r17 + 3b0c: 10 93 c3 04 sts 0x04C3, r17 USB_Device_EnableDeviceAddress(DeviceAddress); USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; - 377e: 11 11 cpse r17, r1 - 3780: 76 c0 rjmp .+236 ; 0x386e - 3782: 82 e0 ldi r24, 0x02 ; 2 - 3784: 80 93 14 23 sts 0x2314, r24 - 3788: a6 cf rjmp .-180 ; 0x36d6 + 3b10: 11 11 cpse r17, r1 + 3b12: 76 c0 rjmp .+236 ; 0x3c00 + 3b14: 82 e0 ldi r24, 0x02 ; 2 + 3b16: 80 93 14 27 sts 0x2714, r24 + 3b1a: a6 cf rjmp .-180 ; 0x3a68 if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) USB_Device_SetAddress(); break; case REQ_GetDescriptor: if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || - 378a: 90 58 subi r25, 0x80 ; 128 - 378c: 92 30 cpi r25, 0x02 ; 2 - 378e: 08 f0 brcs .+2 ; 0x3792 - 3790: a2 cf rjmp .-188 ; 0x36d6 + 3b1c: 90 58 subi r25, 0x80 ; 128 + 3b1e: 92 30 cpi r25, 0x02 ; 2 + 3b20: 08 f0 brcs .+2 ; 0x3b24 + 3b22: a2 cf rjmp .-188 ; 0x3a68 !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS)) uint8_t DescriptorAddressSpace; #endif #if !defined(NO_INTERNAL_SERIAL) && (USE_INTERNAL_SERIAL != NO_DESCRIPTOR) if (USB_ControlRequest.wValue == ((DTYPE_String << 8) | USE_INTERNAL_SERIAL)) - 3792: 80 91 17 23 lds r24, 0x2317 - 3796: 90 91 18 23 lds r25, 0x2318 - 379a: 8c 3d cpi r24, 0xDC ; 220 - 379c: 23 e0 ldi r18, 0x03 ; 3 - 379e: 92 07 cpc r25, r18 - 37a0: 09 f4 brne .+2 ; 0x37a4 - 37a2: 67 c0 rjmp .+206 ; 0x3872 + 3b24: 80 91 17 27 lds r24, 0x2717 + 3b28: 90 91 18 27 lds r25, 0x2718 + 3b2c: 8c 3d cpi r24, 0xDC ; 220 + 3b2e: 23 e0 ldi r18, 0x03 ; 3 + 3b30: 92 07 cpc r25, r18 + 3b32: 09 f4 brne .+2 ; 0x3b36 + 3b34: 67 c0 rjmp .+206 ; 0x3c04 USB_Device_GetInternalSerialDescriptor(); return; } #endif if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, - 37a4: ae 01 movw r20, r28 - 37a6: 45 5c subi r20, 0xC5 ; 197 - 37a8: 5f 4f sbci r21, 0xFF ; 255 - 37aa: 60 91 19 23 lds r22, 0x2319 - 37ae: 0e 94 88 03 call 0x710 ; 0x710 - 37b2: 8c 01 movw r16, r24 - 37b4: 00 97 sbiw r24, 0x00 ; 0 - 37b6: 09 f4 brne .+2 ; 0x37ba - 37b8: 8e cf rjmp .-228 ; 0x36d6 + 3b36: ae 01 movw r20, r28 + 3b38: 45 5c subi r20, 0xC5 ; 197 + 3b3a: 5f 4f sbci r21, 0xFF ; 255 + 3b3c: 60 91 19 27 lds r22, 0x2719 + 3b40: 0e 94 ac 03 call 0x758 ; 0x758 + 3b44: 8c 01 movw r16, r24 + 3b46: 00 97 sbiw r24, 0x00 ; 0 + 3b48: 09 f4 brne .+2 ; 0x3b4c + 3b4a: 8e cf rjmp .-228 ; 0x3a68 )) == NO_DESCRIPTOR) { return; } Endpoint_ClearSETUP(); - 37ba: fe d2 rcall .+1532 ; 0x3db8 + 3b4c: fe d2 rcall .+1532 ; 0x414a #if defined(USE_RAM_DESCRIPTORS) || !defined(ARCH_HAS_MULTI_ADDRESS_SPACE) Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize); #elif defined(USE_EEPROM_DESCRIPTORS) Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize); #elif defined(USE_FLASH_DESCRIPTORS) Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize); - 37bc: b8 01 movw r22, r16 - 37be: 8b ad ldd r24, Y+59 ; 0x3b - 37c0: 9c ad ldd r25, Y+60 ; 0x3c - 37c2: c0 d1 rcall .+896 ; 0x3b44 + 3b4e: b8 01 movw r22, r16 + 3b50: 8b ad ldd r24, Y+59 ; 0x3b + 3b52: 9c ad ldd r25, Y+60 ; 0x3c + 3b54: c0 d1 rcall .+896 ; 0x3ed6 Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize); else Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize); #endif Endpoint_ClearOUT(); - 37c4: 77 d2 rcall .+1262 ; 0x3cb4 - 37c6: 87 cf rjmp .-242 ; 0x36d6 + 3b56: 77 d2 rcall .+1262 ; 0x4046 + 3b58: 87 cf rjmp .-242 ; 0x3a68 uint8_t bmRequestType = USB_ControlRequest.bmRequestType; switch (USB_ControlRequest.bRequest) { case REQ_GetStatus: if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || - 37c8: 90 38 cpi r25, 0x80 ; 128 - 37ca: 09 f4 brne .+2 ; 0x37ce - 37cc: 47 c0 rjmp .+142 ; 0x385c - 37ce: 92 38 cpi r25, 0x82 ; 130 - 37d0: 09 f0 breq .+2 ; 0x37d4 - 37d2: 81 cf rjmp .-254 ; 0x36d6 + 3b5a: 90 38 cpi r25, 0x80 ; 128 + 3b5c: 09 f4 brne .+2 ; 0x3b60 + 3b5e: 47 c0 rjmp .+142 ; 0x3bee + 3b60: 92 38 cpi r25, 0x82 ; 130 + 3b62: 09 f0 breq .+2 ; 0x3b66 + 3b64: 81 cf rjmp .-254 ; 0x3a68 CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; #endif break; case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT): #if !defined(CONTROL_ONLY_DEVICE) Endpoint_SelectEndpoint((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); - 37d4: 80 91 19 23 lds r24, 0x2319 - 37d8: 8f 70 andi r24, 0x0F ; 15 - 37da: 99 d2 rcall .+1330 ; 0x3d0e + 3b66: 80 91 19 27 lds r24, 0x2719 + 3b6a: 8f 70 andi r24, 0x0F ; 15 + 3b6c: 99 d2 rcall .+1330 ; 0x40a0 * \return Boolean \c true if the currently selected endpoint is stalled, \c false otherwise. */ static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline bool Endpoint_IsStalled(void) { return ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_STALL_bm) ? true : false); - 37dc: e0 91 1f 23 lds r30, 0x231F - 37e0: f0 91 20 23 lds r31, 0x2320 - 37e4: 11 81 ldd r17, Z+1 ; 0x01 - 37e6: 12 fb bst r17, 2 - 37e8: 11 27 eor r17, r17 - 37ea: 10 f9 bld r17, 0 + 3b6e: e0 91 1f 27 lds r30, 0x271F + 3b72: f0 91 20 27 lds r31, 0x2720 + 3b76: 11 81 ldd r17, Z+1 ; 0x01 + 3b78: 12 fb bst r17, 2 + 3b7a: 11 27 eor r17, r17 + 3b7c: 10 f9 bld r17, 0 CurrentStatus = Endpoint_IsStalled(); Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 37ec: 80 e0 ldi r24, 0x00 ; 0 - 37ee: 8f d2 rcall .+1310 ; 0x3d0e + 3b7e: 80 e0 ldi r24, 0x00 ; 0 + 3b80: 8f d2 rcall .+1310 ; 0x40a0 break; default: return; } Endpoint_ClearSETUP(); - 37f0: e3 d2 rcall .+1478 ; 0x3db8 + 3b82: e3 d2 rcall .+1478 ; 0x414a * \param[in] Data Data to write to the currently selected endpoint's FIFO buffer. */ static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_16_LE(const uint16_t Data) { Endpoint_Write_8(Data & 0xFF); - 37f2: 81 2f mov r24, r17 - 37f4: 7d d2 rcall .+1274 ; 0x3cf0 + 3b84: 81 2f mov r24, r17 + 3b86: 7d d2 rcall .+1274 ; 0x4082 Endpoint_Write_8(Data >> 8); - 37f6: 80 e0 ldi r24, 0x00 ; 0 - 37f8: 7b d2 rcall .+1270 ; 0x3cf0 + 3b88: 80 e0 ldi r24, 0x00 ; 0 + 3b8a: 7b d2 rcall .+1270 ; 0x4082 Endpoint_Write_16_LE(CurrentStatus); Endpoint_ClearIN(); - 37fa: 43 d2 rcall .+1158 ; 0x3c82 + 3b8c: 43 d2 rcall .+1158 ; 0x4014 Endpoint_ClearStatusStage(); - 37fc: 42 d4 rcall .+2180 ; 0x4082 - 37fe: 6b cf rjmp .-298 ; 0x36d6 + 3b8e: 42 d4 rcall .+2180 ; 0x4414 + 3b90: 6b cf rjmp .-298 ; 0x3a68 if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) USB_Device_GetConfiguration(); break; case REQ_SetConfiguration: if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - 3800: 91 11 cpse r25, r1 - 3802: 69 cf rjmp .-302 ; 0x36d6 + 3b92: 91 11 cpse r25, r1 + 3b94: 69 cf rjmp .-302 ; 0x3a68 } static void USB_Device_SetConfiguration(void) { #if defined(FIXED_NUM_CONFIGURATIONS) if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS) - 3804: 80 91 17 23 lds r24, 0x2317 - 3808: 82 30 cpi r24, 0x02 ; 2 - 380a: 08 f0 brcs .+2 ; 0x380e - 380c: 64 cf rjmp .-312 ; 0x36d6 + 3b96: 80 91 17 27 lds r24, 0x2717 + 3b9a: 82 30 cpi r24, 0x02 ; 2 + 3b9c: 08 f0 brcs .+2 ; 0x3ba0 + 3b9e: 64 cf rjmp .-312 ; 0x3a68 if ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations) return; #endif #endif Endpoint_ClearSETUP(); - 380e: d4 d2 rcall .+1448 ; 0x3db8 + 3ba0: d4 d2 rcall .+1448 ; 0x414a USB_Device_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue; - 3810: 80 91 17 23 lds r24, 0x2317 - 3814: 80 93 10 23 sts 0x2310, r24 + 3ba2: 80 91 17 27 lds r24, 0x2717 + 3ba6: 80 93 10 27 sts 0x2710, r24 Endpoint_ClearStatusStage(); - 3818: 34 d4 rcall .+2152 ; 0x4082 + 3baa: 34 d4 rcall .+2152 ; 0x4414 if (USB_Device_ConfigurationNumber) - 381a: 80 91 10 23 lds r24, 0x2310 - 381e: 88 23 and r24, r24 - 3820: 09 f4 brne .+2 ; 0x3824 - 3822: 61 c0 rjmp .+194 ; 0x38e6 + 3bac: 80 91 10 27 lds r24, 0x2710 + 3bb0: 88 23 and r24, r24 + 3bb2: 09 f4 brne .+2 ; 0x3bb6 + 3bb4: 61 c0 rjmp .+194 ; 0x3c78 USB_DeviceState = DEVICE_STATE_Configured; - 3824: 84 e0 ldi r24, 0x04 ; 4 - 3826: 80 93 14 23 sts 0x2314, r24 + 3bb6: 84 e0 ldi r24, 0x04 ; 4 + 3bb8: 80 93 14 27 sts 0x2714, r24 else USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; EVENT_USB_Device_ConfigurationChanged(); - 382a: 0e 94 32 0b call 0x1664 ; 0x1664 - 382e: 53 cf rjmp .-346 ; 0x36d6 + 3bbc: 0e 94 f5 0c call 0x19ea ; 0x19ea + 3bc0: 53 cf rjmp .-346 ; 0x3a68 USB_Device_GetDescriptor(); } break; case REQ_GetConfiguration: if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) - 3830: 90 38 cpi r25, 0x80 ; 128 - 3832: 09 f0 breq .+2 ; 0x3836 - 3834: 50 cf rjmp .-352 ; 0x36d6 + 3bc2: 90 38 cpi r25, 0x80 ; 128 + 3bc4: 09 f0 breq .+2 ; 0x3bc8 + 3bc6: 50 cf rjmp .-352 ; 0x3a68 EVENT_USB_Device_ConfigurationChanged(); } static void USB_Device_GetConfiguration(void) { Endpoint_ClearSETUP(); - 3836: c0 d2 rcall .+1408 ; 0x3db8 + 3bc8: c0 d2 rcall .+1408 ; 0x414a Endpoint_Write_8(USB_Device_ConfigurationNumber); - 3838: 80 91 10 23 lds r24, 0x2310 - 383c: 59 d2 rcall .+1202 ; 0x3cf0 + 3bca: 80 91 10 27 lds r24, 0x2710 + 3bce: 59 d2 rcall .+1202 ; 0x4082 Endpoint_ClearIN(); - 383e: 21 d2 rcall .+1090 ; 0x3c82 + 3bd0: 21 d2 rcall .+1090 ; 0x4014 Endpoint_ClearStatusStage(); - 3840: 20 d4 rcall .+2112 ; 0x4082 - 3842: 49 cf rjmp .-366 ; 0x36d6 + 3bd2: 20 d4 rcall .+2112 ; 0x4414 + 3bd4: 49 cf rjmp .-366 ; 0x3a68 { switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) { #if !defined(NO_DEVICE_REMOTE_WAKEUP) case REQREC_DEVICE: if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup) - 3844: 90 91 17 23 lds r25, 0x2317 - 3848: 91 30 cpi r25, 0x01 ; 1 - 384a: 09 f0 breq .+2 ; 0x384e - 384c: 44 cf rjmp .-376 ; 0x36d6 + 3bd6: 90 91 17 27 lds r25, 0x2717 + 3bda: 91 30 cpi r25, 0x01 ; 1 + 3bdc: 09 f0 breq .+2 ; 0x3be0 + 3bde: 44 cf rjmp .-376 ; 0x3a68 USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature); - 384e: 91 e0 ldi r25, 0x01 ; 1 - 3850: 83 30 cpi r24, 0x03 ; 3 - 3852: 09 f0 breq .+2 ; 0x3856 - 3854: 90 e0 ldi r25, 0x00 ; 0 - 3856: 90 93 12 23 sts 0x2312, r25 - 385a: 80 cf rjmp .-256 ; 0x375c + 3be0: 91 e0 ldi r25, 0x01 ; 1 + 3be2: 83 30 cpi r24, 0x03 ; 3 + 3be4: 09 f0 breq .+2 ; 0x3be8 + 3be6: 90 e0 ldi r25, 0x00 ; 0 + 3be8: 90 93 12 27 sts 0x2712, r25 + 3bec: 80 cf rjmp .-256 ; 0x3aee Endpoint_ClearOUT(); } static void USB_Device_GetStatus(void) { uint8_t CurrentStatus = 0; - 385c: 10 91 11 23 lds r17, 0x2311 + 3bee: 10 91 11 27 lds r17, 0x2711 if (USB_Device_CurrentlySelfPowered) CurrentStatus |= FEATURE_SELFPOWERED_ENABLED; #endif #if !defined(NO_DEVICE_REMOTE_WAKEUP) if (USB_Device_RemoteWakeupEnabled) - 3860: 80 91 12 23 lds r24, 0x2312 - 3864: 88 23 and r24, r24 - 3866: 09 f4 brne .+2 ; 0x386a - 3868: c3 cf rjmp .-122 ; 0x37f0 + 3bf2: 80 91 12 27 lds r24, 0x2712 + 3bf6: 88 23 and r24, r24 + 3bf8: 09 f4 brne .+2 ; 0x3bfc + 3bfa: c3 cf rjmp .-122 ; 0x3b82 CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; - 386a: 12 60 ori r17, 0x02 ; 2 - 386c: c1 cf rjmp .-126 ; 0x37f0 + 3bfc: 12 60 ori r17, 0x02 ; 2 + 3bfe: c1 cf rjmp .-126 ; 0x3b82 while (!(Endpoint_IsINReady())); USB_Device_EnableDeviceAddress(DeviceAddress); USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; - 386e: 83 e0 ldi r24, 0x03 ; 3 - 3870: 89 cf rjmp .-238 ; 0x3784 + 3c00: 83 e0 ldi r24, 0x03 ; 3 + 3c02: 89 cf rjmp .-238 ; 0x3b16 { USB_Descriptor_Header_t Header; uint16_t UnicodeString[INTERNAL_SERIAL_LENGTH_BITS / 4]; } SignatureDescriptor; SignatureDescriptor.Header.Type = DTYPE_String; - 3872: 83 e0 ldi r24, 0x03 ; 3 - 3874: 8a 83 std Y+2, r24 ; 0x02 + 3c04: 83 e0 ldi r24, 0x03 ; 3 + 3c06: 8a 83 std Y+2, r24 ; 0x02 SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4); - 3876: 8a e3 ldi r24, 0x3A ; 58 - 3878: 89 83 std Y+1, r24 ; 0x01 + 3c08: 8a e3 ldi r24, 0x3A ; 58 + 3c0a: 89 83 std Y+1, r24 ; 0x01 #if (ARCH == ARCH_AVR8) return SREG; #elif (ARCH == ARCH_UC3) return __builtin_mfsr(AVR32_SR); #elif (ARCH == ARCH_XMEGA) return SREG; - 387a: 5f b7 in r21, 0x3f ; 63 + 3c0c: 5f b7 in r21, 0x3f ; 63 #if (ARCH == ARCH_AVR8) cli(); #elif (ARCH == ARCH_UC3) __builtin_ssrf(AVR32_SR_GM_OFFSET); #elif (ARCH == ARCH_XMEGA) cli(); - 387c: f8 94 cli + 3c0e: f8 94 cli for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++) { uint8_t SerialByte; NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 387e: 82 e0 ldi r24, 0x02 ; 2 - 3880: 80 93 ca 01 sts 0x01CA, r24 + 3c10: 82 e0 ldi r24, 0x02 ; 2 + 3c12: 80 93 ca 01 sts 0x01CA, r24 SerialByte = pgm_read_byte(SigReadAddress); - 3884: e8 e0 ldi r30, 0x08 ; 8 - 3886: f0 e0 ldi r31, 0x00 ; 0 - 3888: e4 91 lpm r30, Z + 3c16: e8 e0 ldi r30, 0x08 ; 8 + 3c18: f0 e0 ldi r31, 0x00 ; 0 + 3c1a: e4 91 lpm r30, Z NVM.CMD = 0; - 388a: 10 92 ca 01 sts 0x01CA, r1 + 3c1c: 10 92 ca 01 sts 0x01CA, r1 USB_Device_GetSerialString(SignatureDescriptor.UnicodeString); - 388e: de 01 movw r26, r28 - 3890: 13 96 adiw r26, 0x03 ; 3 + 3c20: de 01 movw r26, r28 + 3c22: 13 96 adiw r26, 0x03 ; 3 uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); GlobalInterruptDisable(); uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS; for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++) - 3892: 20 e0 ldi r18, 0x00 ; 0 + 3c24: 20 e0 ldi r18, 0x00 ; 0 static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString) { uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); GlobalInterruptDisable(); uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS; - 3894: 38 e0 ldi r19, 0x08 ; 8 + 3c26: 38 e0 ldi r19, 0x08 ; 8 for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++) { uint8_t SerialByte; NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 3896: 42 e0 ldi r20, 0x02 ; 2 + 3c28: 42 e0 ldi r20, 0x02 ; 2 { SerialByte >>= 4; SigReadAddress++; } SerialByte &= 0x0F; - 3898: ef 70 andi r30, 0x0F ; 15 + 3c2a: ef 70 andi r30, 0x0F ; 15 UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? - 389a: 8e 2f mov r24, r30 - 389c: 90 e0 ldi r25, 0x00 ; 0 - 389e: ea 30 cpi r30, 0x0A ; 10 - 38a0: b8 f0 brcs .+46 ; 0x38d0 - 38a2: c7 96 adiw r24, 0x37 ; 55 - 38a4: 8d 93 st X+, r24 - 38a6: 9d 93 st X+, r25 + 3c2c: 8e 2f mov r24, r30 + 3c2e: 90 e0 ldi r25, 0x00 ; 0 + 3c30: ea 30 cpi r30, 0x0A ; 10 + 3c32: b8 f0 brcs .+46 ; 0x3c62 + 3c34: c7 96 adiw r24, 0x37 ; 55 + 3c36: 8d 93 st X+, r24 + 3c38: 9d 93 st X+, r25 uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); GlobalInterruptDisable(); uint8_t SigReadAddress = INTERNAL_SERIAL_START_ADDRESS; for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++) - 38a8: 2f 5f subi r18, 0xFF ; 255 - 38aa: 2c 31 cpi r18, 0x1C ; 28 - 38ac: 99 f0 breq .+38 ; 0x38d4 + 3c3a: 2f 5f subi r18, 0xFF ; 255 + 3c3c: 2c 31 cpi r18, 0x1C ; 28 + 3c3e: 99 f0 breq .+38 ; 0x3c66 { uint8_t SerialByte; NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 38ae: 40 93 ca 01 sts 0x01CA, r20 + 3c40: 40 93 ca 01 sts 0x01CA, r20 SerialByte = pgm_read_byte(SigReadAddress); - 38b2: e3 2f mov r30, r19 - 38b4: f0 e0 ldi r31, 0x00 ; 0 - 38b6: e4 91 lpm r30, Z + 3c44: e3 2f mov r30, r19 + 3c46: f0 e0 ldi r31, 0x00 ; 0 + 3c48: e4 91 lpm r30, Z NVM.CMD = 0; - 38b8: 10 92 ca 01 sts 0x01CA, r1 + 3c4a: 10 92 ca 01 sts 0x01CA, r1 if (SerialCharNum & 0x01) - 38bc: 20 ff sbrs r18, 0 - 38be: ec cf rjmp .-40 ; 0x3898 + 3c4e: 20 ff sbrs r18, 0 + 3c50: ec cf rjmp .-40 ; 0x3c2a { SerialByte >>= 4; - 38c0: e2 95 swap r30 - 38c2: ef 70 andi r30, 0x0F ; 15 + 3c52: e2 95 swap r30 + 3c54: ef 70 andi r30, 0x0F ; 15 SigReadAddress++; - 38c4: 3f 5f subi r19, 0xFF ; 255 + 3c56: 3f 5f subi r19, 0xFF ; 255 } SerialByte &= 0x0F; - 38c6: ef 70 andi r30, 0x0F ; 15 + 3c58: ef 70 andi r30, 0x0F ; 15 UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? - 38c8: 8e 2f mov r24, r30 - 38ca: 90 e0 ldi r25, 0x00 ; 0 - 38cc: ea 30 cpi r30, 0x0A ; 10 - 38ce: 48 f7 brcc .-46 ; 0x38a2 - 38d0: c0 96 adiw r24, 0x30 ; 48 - 38d2: e8 cf rjmp .-48 ; 0x38a4 + 3c5a: 8e 2f mov r24, r30 + 3c5c: 90 e0 ldi r25, 0x00 ; 0 + 3c5e: ea 30 cpi r30, 0x0A ; 10 + 3c60: 48 f7 brcc .-46 ; 0x3c34 + 3c62: c0 96 adiw r24, 0x30 ; 48 + 3c64: e8 cf rjmp .-48 ; 0x3c36 if (GlobalIntState & AVR32_SR_GM) __builtin_ssrf(AVR32_SR_GM_OFFSET); else __builtin_csrf(AVR32_SR_GM_OFFSET); #elif (ARCH == ARCH_XMEGA) SREG = GlobalIntState; - 38d4: 5f bf out 0x3f, r21 ; 63 + 3c66: 5f bf out 0x3f, r21 ; 63 Endpoint_ClearSETUP(); - 38d6: 70 d2 rcall .+1248 ; 0x3db8 + 3c68: 70 d2 rcall .+1248 ; 0x414a Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor)); - 38d8: 6a e3 ldi r22, 0x3A ; 58 - 38da: 70 e0 ldi r23, 0x00 ; 0 - 38dc: ce 01 movw r24, r28 - 38de: 01 96 adiw r24, 0x01 ; 1 - 38e0: 90 d0 rcall .+288 ; 0x3a02 + 3c6a: 6a e3 ldi r22, 0x3A ; 58 + 3c6c: 70 e0 ldi r23, 0x00 ; 0 + 3c6e: ce 01 movw r24, r28 + 3c70: 01 96 adiw r24, 0x01 ; 1 + 3c72: 90 d0 rcall .+288 ; 0x3d94 Endpoint_ClearOUT(); - 38e2: e8 d1 rcall .+976 ; 0x3cb4 - 38e4: f8 ce rjmp .-528 ; 0x36d6 + 3c74: e8 d1 rcall .+976 ; 0x4046 + 3c76: f8 ce rjmp .-528 ; 0x3a68 } static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; static inline bool USB_Device_IsAddressSet(void) { return ((USB.ADDR != 0) ? true : false); - 38e6: 80 91 c3 04 lds r24, 0x04C3 + 3c78: 80 91 c3 04 lds r24, 0x04C3 Endpoint_ClearStatusStage(); if (USB_Device_ConfigurationNumber) USB_DeviceState = DEVICE_STATE_Configured; else USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; - 38ea: 88 23 and r24, r24 - 38ec: 21 f0 breq .+8 ; 0x38f6 - 38ee: 84 e0 ldi r24, 0x04 ; 4 - 38f0: 80 93 14 23 sts 0x2314, r24 - 38f4: 9a cf rjmp .-204 ; 0x382a - 38f6: 81 e0 ldi r24, 0x01 ; 1 - 38f8: fb cf rjmp .-10 ; 0x38f0 + 3c7c: 88 23 and r24, r24 + 3c7e: 21 f0 breq .+8 ; 0x3c88 + 3c80: 84 e0 ldi r24, 0x04 ; 4 + 3c82: 80 93 14 27 sts 0x2714, r24 + 3c86: 9a cf rjmp .-204 ; 0x3bbc + 3c88: 81 e0 ldi r24, 0x01 ; 1 + 3c8a: fb cf rjmp .-10 ; 0x3c82 if (Endpoint_IsEnabled()) { if (USB_ControlRequest.bRequest == REQ_SetFeature) { Endpoint_StallTransaction(); - 38fa: 42 d2 rcall .+1156 ; 0x3d80 - 38fc: 2f cf rjmp .-418 ; 0x375c + 3c8c: 42 d2 rcall .+1156 ; 0x4112 + 3c8e: 2f cf rjmp .-418 ; 0x3aee -000038fe : +00003c90 : #define __INCLUDE_FROM_EVENTS_C #define __INCLUDE_FROM_USB_DRIVER #include "Events.h" void USB_Event_Stub(void) { - 38fe: 08 95 ret + 3c90: 08 95 ret -00003900 : +00003c92 : #if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) volatile uint8_t USB_DeviceState; #endif void USB_USBTask(void) { - 3900: cf 93 push r28 + 3c92: cf 93 push r28 } #if defined(USB_CAN_BE_DEVICE) static void USB_DeviceTask(void) { if (USB_DeviceState == DEVICE_STATE_Unattached) - 3902: 80 91 14 23 lds r24, 0x2314 - 3906: 81 11 cpse r24, r1 - 3908: 02 c0 rjmp .+4 ; 0x390e + 3c94: 80 91 14 27 lds r24, 0x2714 + 3c98: 81 11 cpse r24, r1 + 3c9a: 02 c0 rjmp .+4 ; 0x3ca0 #elif defined(USB_CAN_BE_HOST) USB_HostTask(); #elif defined(USB_CAN_BE_DEVICE) USB_DeviceTask(); #endif } - 390a: cf 91 pop r28 - 390c: 08 95 ret + 3c9c: cf 91 pop r28 + 3c9e: 08 95 ret * \return Index of the currently selected endpoint. */ static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Endpoint_GetCurrentEndpoint(void) { return USB_Endpoint_SelectedEndpoint; - 390e: c0 91 21 23 lds r28, 0x2321 + 3ca0: c0 91 21 27 lds r28, 0x2721 if (USB_DeviceState == DEVICE_STATE_Unattached) return; uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 3912: 80 e0 ldi r24, 0x00 ; 0 - 3914: fc d1 rcall .+1016 ; 0x3d0e + 3ca4: 80 e0 ldi r24, 0x00 ; 0 + 3ca6: fc d1 rcall .+1016 ; 0x40a0 if (Endpoint_IsSETUPReceived()) - 3916: 7c d2 rcall .+1272 ; 0x3e10 - 3918: 81 11 cpse r24, r1 - 391a: 03 c0 rjmp .+6 ; 0x3922 + 3ca8: 7c d2 rcall .+1272 ; 0x41a2 + 3caa: 81 11 cpse r24, r1 + 3cac: 03 c0 rjmp .+6 ; 0x3cb4 USB_Device_ProcessControlRequest(); Endpoint_SelectEndpoint(PrevEndpoint); - 391c: 8c 2f mov r24, r28 + 3cae: 8c 2f mov r24, r28 #elif defined(USB_CAN_BE_HOST) USB_HostTask(); #elif defined(USB_CAN_BE_DEVICE) USB_DeviceTask(); #endif } - 391e: cf 91 pop r28 + 3cb0: cf 91 pop r28 Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); if (Endpoint_IsSETUPReceived()) USB_Device_ProcessControlRequest(); Endpoint_SelectEndpoint(PrevEndpoint); - 3920: f6 c1 rjmp .+1004 ; 0x3d0e + 3cb2: f6 c1 rjmp .+1004 ; 0x40a0 uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); if (Endpoint_IsSETUPReceived()) USB_Device_ProcessControlRequest(); - 3922: a2 de rcall .-700 ; 0x3668 + 3cb4: a2 de rcall .-700 ; 0x39fa Endpoint_SelectEndpoint(PrevEndpoint); - 3924: 8c 2f mov r24, r28 + 3cb6: 8c 2f mov r24, r28 #elif defined(USB_CAN_BE_HOST) USB_HostTask(); #elif defined(USB_CAN_BE_DEVICE) USB_DeviceTask(); #endif } - 3926: cf 91 pop r28 + 3cb8: cf 91 pop r28 Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); if (Endpoint_IsSETUPReceived()) USB_Device_ProcessControlRequest(); Endpoint_SelectEndpoint(PrevEndpoint); - 3928: f2 c1 rjmp .+996 ; 0x3d0e + 3cba: f2 c1 rjmp .+996 ; 0x40a0 -0000392a : +00003cbc : return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; } return ENDPOINT_RWCSTREAM_NoError; - 392a: af 92 push r10 - 392c: bf 92 push r11 - 392e: df 92 push r13 - 3930: ef 92 push r14 - 3932: ff 92 push r15 - 3934: 0f 93 push r16 - 3936: 1f 93 push r17 - 3938: cf 93 push r28 - 393a: df 93 push r29 - 393c: 8c 01 movw r16, r24 - 393e: eb 01 movw r28, r22 - 3940: 7a 01 movw r14, r20 - 3942: b5 d3 rcall .+1898 ; 0x40ae - 3944: d8 2e mov r13, r24 - 3946: 81 11 cpse r24, r1 - 3948: 27 c0 rjmp .+78 ; 0x3998 - 394a: e1 14 cp r14, r1 - 394c: f1 04 cpc r15, r1 - 394e: a1 f1 breq .+104 ; 0x39b8 - 3950: f7 01 movw r30, r14 - 3952: 20 81 ld r18, Z - 3954: 31 81 ldd r19, Z+1 ; 0x01 - 3956: c2 1b sub r28, r18 - 3958: d3 0b sbc r29, r19 - 395a: 02 0f add r16, r18 - 395c: 13 1f adc r17, r19 - 395e: 20 97 sbiw r28, 0x00 ; 0 - 3960: d9 f0 breq .+54 ; 0x3998 - 3962: a1 2c mov r10, r1 - 3964: b1 2c mov r11, r1 - 3966: 80 91 1d 23 lds r24, 0x231D - 396a: 90 91 1e 23 lds r25, 0x231E - 396e: fc 01 movw r30, r24 - 3970: ef 5b subi r30, 0xBF ; 191 - 3972: ff 4f sbci r31, 0xFF ; 255 - 3974: 20 81 ld r18, Z - 3976: fc 01 movw r30, r24 - 3978: e0 5c subi r30, 0xC0 ; 192 - 397a: ff 4f sbci r31, 0xFF ; 255 - 397c: 80 81 ld r24, Z - 397e: 28 17 cp r18, r24 - 3980: 90 f1 brcs .+100 ; 0x39e6 - 3982: 7f d1 rcall .+766 ; 0x3c82 - 3984: bd df rcall .-134 ; 0x3900 - 3986: f7 01 movw r30, r14 - 3988: 80 81 ld r24, Z - 398a: 91 81 ldd r25, Z+1 ; 0x01 - 398c: 8a 0d add r24, r10 - 398e: 9b 1d adc r25, r11 - 3990: 80 83 st Z, r24 - 3992: 91 83 std Z+1, r25 ; 0x01 - 3994: 25 e0 ldi r18, 0x05 ; 5 - 3996: d2 2e mov r13, r18 - 3998: 8d 2d mov r24, r13 - 399a: df 91 pop r29 - 399c: cf 91 pop r28 - 399e: 1f 91 pop r17 - 39a0: 0f 91 pop r16 - 39a2: ff 90 pop r15 - 39a4: ef 90 pop r14 - 39a6: df 90 pop r13 - 39a8: bf 90 pop r11 - 39aa: af 90 pop r10 - 39ac: 08 95 ret - 39ae: 69 d1 rcall .+722 ; 0x3c82 - 39b0: a7 df rcall .-178 ; 0x3900 - 39b2: 7d d3 rcall .+1786 ; 0x40ae - 39b4: 81 11 cpse r24, r1 - 39b6: 23 c0 rjmp .+70 ; 0x39fe - 39b8: 20 97 sbiw r28, 0x00 ; 0 - 39ba: 71 f3 breq .-36 ; 0x3998 - 39bc: 20 91 1d 23 lds r18, 0x231D - 39c0: 30 91 1e 23 lds r19, 0x231E - 39c4: f9 01 movw r30, r18 - 39c6: ef 5b subi r30, 0xBF ; 191 - 39c8: ff 4f sbci r31, 0xFF ; 255 - 39ca: 90 81 ld r25, Z - 39cc: f9 01 movw r30, r18 - 39ce: e0 5c subi r30, 0xC0 ; 192 - 39d0: ff 4f sbci r31, 0xFF ; 255 - 39d2: 80 81 ld r24, Z - 39d4: 98 17 cp r25, r24 - 39d6: 58 f7 brcc .-42 ; 0x39ae - 39d8: f8 01 movw r30, r16 - 39da: 81 91 ld r24, Z+ - 39dc: 8f 01 movw r16, r30 - 39de: 88 d1 rcall .+784 ; 0x3cf0 - 39e0: 21 97 sbiw r28, 0x01 ; 1 - 39e2: 61 f7 brne .-40 ; 0x39bc - 39e4: d9 cf rjmp .-78 ; 0x3998 - 39e6: f8 01 movw r30, r16 - 39e8: 81 91 ld r24, Z+ - 39ea: 8f 01 movw r16, r30 - 39ec: 81 d1 rcall .+770 ; 0x3cf0 - 39ee: ff ef ldi r31, 0xFF ; 255 - 39f0: af 1a sub r10, r31 - 39f2: bf 0a sbc r11, r31 - 39f4: ca 15 cp r28, r10 - 39f6: db 05 cpc r29, r11 - 39f8: 09 f0 breq .+2 ; 0x39fc - 39fa: b5 cf rjmp .-150 ; 0x3966 - 39fc: cd cf rjmp .-102 ; 0x3998 - 39fe: d8 2e mov r13, r24 - 3a00: cb cf rjmp .-106 ; 0x3998 + 3cbc: af 92 push r10 + 3cbe: bf 92 push r11 + 3cc0: df 92 push r13 + 3cc2: ef 92 push r14 + 3cc4: ff 92 push r15 + 3cc6: 0f 93 push r16 + 3cc8: 1f 93 push r17 + 3cca: cf 93 push r28 + 3ccc: df 93 push r29 + 3cce: 8c 01 movw r16, r24 + 3cd0: eb 01 movw r28, r22 + 3cd2: 7a 01 movw r14, r20 + 3cd4: b5 d3 rcall .+1898 ; 0x4440 + 3cd6: d8 2e mov r13, r24 + 3cd8: 81 11 cpse r24, r1 + 3cda: 27 c0 rjmp .+78 ; 0x3d2a + 3cdc: e1 14 cp r14, r1 + 3cde: f1 04 cpc r15, r1 + 3ce0: a1 f1 breq .+104 ; 0x3d4a + 3ce2: f7 01 movw r30, r14 + 3ce4: 20 81 ld r18, Z + 3ce6: 31 81 ldd r19, Z+1 ; 0x01 + 3ce8: c2 1b sub r28, r18 + 3cea: d3 0b sbc r29, r19 + 3cec: 02 0f add r16, r18 + 3cee: 13 1f adc r17, r19 + 3cf0: 20 97 sbiw r28, 0x00 ; 0 + 3cf2: d9 f0 breq .+54 ; 0x3d2a + 3cf4: a1 2c mov r10, r1 + 3cf6: b1 2c mov r11, r1 + 3cf8: 80 91 1d 27 lds r24, 0x271D + 3cfc: 90 91 1e 27 lds r25, 0x271E + 3d00: fc 01 movw r30, r24 + 3d02: ef 5b subi r30, 0xBF ; 191 + 3d04: ff 4f sbci r31, 0xFF ; 255 + 3d06: 20 81 ld r18, Z + 3d08: fc 01 movw r30, r24 + 3d0a: e0 5c subi r30, 0xC0 ; 192 + 3d0c: ff 4f sbci r31, 0xFF ; 255 + 3d0e: 80 81 ld r24, Z + 3d10: 28 17 cp r18, r24 + 3d12: 90 f1 brcs .+100 ; 0x3d78 + 3d14: 7f d1 rcall .+766 ; 0x4014 + 3d16: bd df rcall .-134 ; 0x3c92 + 3d18: f7 01 movw r30, r14 + 3d1a: 80 81 ld r24, Z + 3d1c: 91 81 ldd r25, Z+1 ; 0x01 + 3d1e: 8a 0d add r24, r10 + 3d20: 9b 1d adc r25, r11 + 3d22: 80 83 st Z, r24 + 3d24: 91 83 std Z+1, r25 ; 0x01 + 3d26: 25 e0 ldi r18, 0x05 ; 5 + 3d28: d2 2e mov r13, r18 + 3d2a: 8d 2d mov r24, r13 + 3d2c: df 91 pop r29 + 3d2e: cf 91 pop r28 + 3d30: 1f 91 pop r17 + 3d32: 0f 91 pop r16 + 3d34: ff 90 pop r15 + 3d36: ef 90 pop r14 + 3d38: df 90 pop r13 + 3d3a: bf 90 pop r11 + 3d3c: af 90 pop r10 + 3d3e: 08 95 ret + 3d40: 69 d1 rcall .+722 ; 0x4014 + 3d42: a7 df rcall .-178 ; 0x3c92 + 3d44: 7d d3 rcall .+1786 ; 0x4440 + 3d46: 81 11 cpse r24, r1 + 3d48: 23 c0 rjmp .+70 ; 0x3d90 + 3d4a: 20 97 sbiw r28, 0x00 ; 0 + 3d4c: 71 f3 breq .-36 ; 0x3d2a + 3d4e: 20 91 1d 27 lds r18, 0x271D + 3d52: 30 91 1e 27 lds r19, 0x271E + 3d56: f9 01 movw r30, r18 + 3d58: ef 5b subi r30, 0xBF ; 191 + 3d5a: ff 4f sbci r31, 0xFF ; 255 + 3d5c: 90 81 ld r25, Z + 3d5e: f9 01 movw r30, r18 + 3d60: e0 5c subi r30, 0xC0 ; 192 + 3d62: ff 4f sbci r31, 0xFF ; 255 + 3d64: 80 81 ld r24, Z + 3d66: 98 17 cp r25, r24 + 3d68: 58 f7 brcc .-42 ; 0x3d40 + 3d6a: f8 01 movw r30, r16 + 3d6c: 81 91 ld r24, Z+ + 3d6e: 8f 01 movw r16, r30 + 3d70: 88 d1 rcall .+784 ; 0x4082 + 3d72: 21 97 sbiw r28, 0x01 ; 1 + 3d74: 61 f7 brne .-40 ; 0x3d4e + 3d76: d9 cf rjmp .-78 ; 0x3d2a + 3d78: f8 01 movw r30, r16 + 3d7a: 81 91 ld r24, Z+ + 3d7c: 8f 01 movw r16, r30 + 3d7e: 81 d1 rcall .+770 ; 0x4082 + 3d80: ff ef ldi r31, 0xFF ; 255 + 3d82: af 1a sub r10, r31 + 3d84: bf 0a sbc r11, r31 + 3d86: ca 15 cp r28, r10 + 3d88: db 05 cpc r29, r11 + 3d8a: 09 f0 breq .+2 ; 0x3d8e + 3d8c: b5 cf rjmp .-150 ; 0x3cf8 + 3d8e: cd cf rjmp .-102 ; 0x3d2a + 3d90: d8 2e mov r13, r24 + 3d92: cb cf rjmp .-106 ; 0x3d2a -00003a02 : - 3a02: cf 92 push r12 - 3a04: df 92 push r13 - 3a06: ef 92 push r14 - 3a08: ff 92 push r15 - 3a0a: 0f 93 push r16 - 3a0c: 1f 93 push r17 - 3a0e: cf 93 push r28 - 3a10: df 93 push r29 - 3a12: 6c 01 movw r12, r24 - 3a14: eb 01 movw r28, r22 - 3a16: 80 91 21 23 lds r24, 0x2321 - 3a1a: 80 68 ori r24, 0x80 ; 128 - 3a1c: 78 d1 rcall .+752 ; 0x3d0e - 3a1e: 00 91 1b 23 lds r16, 0x231B - 3a22: 10 91 1c 23 lds r17, 0x231C - 3a26: 0c 17 cp r16, r28 - 3a28: 1d 07 cpc r17, r29 - 3a2a: 20 f0 brcs .+8 ; 0x3a34 - 3a2c: 20 97 sbiw r28, 0x00 ; 0 - 3a2e: 09 f4 brne .+2 ; 0x3a32 - 3a30: 83 c0 rjmp .+262 ; 0x3b38 - 3a32: 8e 01 movw r16, r28 - 3a34: c0 e0 ldi r28, 0x00 ; 0 - 3a36: 01 15 cp r16, r1 - 3a38: 11 05 cpc r17, r1 - 3a3a: 09 f0 breq .+2 ; 0x3a3e - 3a3c: 4a c0 rjmp .+148 ; 0x3ad2 - 3a3e: cc 23 and r28, r28 - 3a40: 09 f4 brne .+2 ; 0x3a44 - 3a42: 5c c0 rjmp .+184 ; 0x3afc - 3a44: 80 91 14 23 lds r24, 0x2314 - 3a48: 88 23 and r24, r24 - 3a4a: 09 f4 brne .+2 ; 0x3a4e - 3a4c: 55 c0 rjmp .+170 ; 0x3af8 - 3a4e: 85 30 cpi r24, 0x05 ; 5 - 3a50: 09 f4 brne .+2 ; 0x3a54 - 3a52: 5d c0 rjmp .+186 ; 0x3b0e - 3a54: dd d1 rcall .+954 ; 0x3e10 - 3a56: 81 11 cpse r24, r1 - 3a58: 6d c0 rjmp .+218 ; 0x3b34 - 3a5a: f3 d1 rcall .+998 ; 0x3e42 - 3a5c: 81 11 cpse r24, r1 - 3a5e: 4e c0 rjmp .+156 ; 0x3afc - 3a60: 09 d2 rcall .+1042 ; 0x3e74 - 3a62: 88 23 and r24, r24 - 3a64: 79 f3 breq .-34 ; 0x3a44 - 3a66: 80 91 21 23 lds r24, 0x2321 - 3a6a: 87 fd sbrc r24, 7 - 3a6c: 5a c0 rjmp .+180 ; 0x3b22 - 3a6e: 20 91 1d 23 lds r18, 0x231D - 3a72: 30 91 1e 23 lds r19, 0x231E - 3a76: f9 01 movw r30, r18 - 3a78: e0 5c subi r30, 0xC0 ; 192 - 3a7a: ff 4f sbci r31, 0xFF ; 255 - 3a7c: e0 80 ld r14, Z - 3a7e: f9 01 movw r30, r18 - 3a80: ef 5b subi r30, 0xBF ; 191 - 3a82: ff 4f sbci r31, 0xFF ; 255 - 3a84: 80 81 ld r24, Z - 3a86: f1 2c mov r15, r1 - 3a88: e8 1a sub r14, r24 - 3a8a: f1 08 sbc r15, r1 - 3a8c: 01 15 cp r16, r1 - 3a8e: 11 05 cpc r17, r1 - 3a90: a9 f0 breq .+42 ; 0x3abc - 3a92: 88 e0 ldi r24, 0x08 ; 8 - 3a94: e8 16 cp r14, r24 - 3a96: f1 04 cpc r15, r1 - 3a98: 88 f4 brcc .+34 ; 0x3abc - 3a9a: e6 01 movw r28, r12 - 3a9c: 04 c0 rjmp .+8 ; 0x3aa6 - 3a9e: 88 e0 ldi r24, 0x08 ; 8 - 3aa0: e8 16 cp r14, r24 - 3aa2: f1 04 cpc r15, r1 - 3aa4: 59 f0 breq .+22 ; 0x3abc - 3aa6: 89 91 ld r24, Y+ - 3aa8: 23 d1 rcall .+582 ; 0x3cf0 - 3aaa: 6e 01 movw r12, r28 - 3aac: 01 50 subi r16, 0x01 ; 1 - 3aae: 11 09 sbc r17, r1 - 3ab0: 8f ef ldi r24, 0xFF ; 255 - 3ab2: e8 1a sub r14, r24 - 3ab4: f8 0a sbc r15, r24 - 3ab6: 01 15 cp r16, r1 - 3ab8: 11 05 cpc r17, r1 - 3aba: 89 f7 brne .-30 ; 0x3a9e - 3abc: c1 e0 ldi r28, 0x01 ; 1 - 3abe: 88 e0 ldi r24, 0x08 ; 8 - 3ac0: e8 16 cp r14, r24 - 3ac2: f1 04 cpc r15, r1 - 3ac4: 09 f0 breq .+2 ; 0x3ac8 - 3ac6: c0 e0 ldi r28, 0x00 ; 0 - 3ac8: dc d0 rcall .+440 ; 0x3c82 - 3aca: 01 15 cp r16, r1 - 3acc: 11 05 cpc r17, r1 - 3ace: 09 f4 brne .+2 ; 0x3ad2 - 3ad0: b6 cf rjmp .-148 ; 0x3a3e - 3ad2: 80 91 14 23 lds r24, 0x2314 - 3ad6: 88 23 and r24, r24 - 3ad8: 79 f0 breq .+30 ; 0x3af8 - 3ada: 85 30 cpi r24, 0x05 ; 5 - 3adc: c1 f0 breq .+48 ; 0x3b0e - 3ade: 98 d1 rcall .+816 ; 0x3e10 - 3ae0: 81 11 cpse r24, r1 - 3ae2: 28 c0 rjmp .+80 ; 0x3b34 - 3ae4: ae d1 rcall .+860 ; 0x3e42 - 3ae6: 81 11 cpse r24, r1 - 3ae8: 09 c0 rjmp .+18 ; 0x3afc - 3aea: c4 d1 rcall .+904 ; 0x3e74 - 3aec: 81 11 cpse r24, r1 - 3aee: bb cf rjmp .-138 ; 0x3a66 - 3af0: 80 91 14 23 lds r24, 0x2314 - 3af4: 81 11 cpse r24, r1 - 3af6: f1 cf rjmp .-30 ; 0x3ada - 3af8: 82 e0 ldi r24, 0x02 ; 2 - 3afa: 0a c0 rjmp .+20 ; 0x3b10 - 3afc: a2 d1 rcall .+836 ; 0x3e42 - 3afe: 81 11 cpse r24, r1 - 3b00: 1f c0 rjmp .+62 ; 0x3b40 - 3b02: 80 91 14 23 lds r24, 0x2314 - 3b06: 88 23 and r24, r24 - 3b08: b9 f3 breq .-18 ; 0x3af8 - 3b0a: 85 30 cpi r24, 0x05 ; 5 - 3b0c: b9 f7 brne .-18 ; 0x3afc - 3b0e: 83 e0 ldi r24, 0x03 ; 3 - 3b10: df 91 pop r29 - 3b12: cf 91 pop r28 - 3b14: 1f 91 pop r17 - 3b16: 0f 91 pop r16 - 3b18: ff 90 pop r15 - 3b1a: ef 90 pop r14 - 3b1c: df 90 pop r13 - 3b1e: cf 90 pop r12 - 3b20: 08 95 ret - 3b22: e0 91 1d 23 lds r30, 0x231D - 3b26: f0 91 1e 23 lds r31, 0x231E - 3b2a: ef 5b subi r30, 0xBF ; 191 - 3b2c: ff 4f sbci r31, 0xFF ; 255 - 3b2e: e0 80 ld r14, Z - 3b30: f1 2c mov r15, r1 - 3b32: ac cf rjmp .-168 ; 0x3a8c - 3b34: 81 e0 ldi r24, 0x01 ; 1 - 3b36: ec cf rjmp .-40 ; 0x3b10 - 3b38: a4 d0 rcall .+328 ; 0x3c82 - 3b3a: 00 e0 ldi r16, 0x00 ; 0 - 3b3c: 10 e0 ldi r17, 0x00 ; 0 - 3b3e: 7a cf rjmp .-268 ; 0x3a34 - 3b40: 80 e0 ldi r24, 0x00 ; 0 - 3b42: e6 cf rjmp .-52 ; 0x3b10 +00003d94 : + 3d94: cf 92 push r12 + 3d96: df 92 push r13 + 3d98: ef 92 push r14 + 3d9a: ff 92 push r15 + 3d9c: 0f 93 push r16 + 3d9e: 1f 93 push r17 + 3da0: cf 93 push r28 + 3da2: df 93 push r29 + 3da4: 6c 01 movw r12, r24 + 3da6: eb 01 movw r28, r22 + 3da8: 80 91 21 27 lds r24, 0x2721 + 3dac: 80 68 ori r24, 0x80 ; 128 + 3dae: 78 d1 rcall .+752 ; 0x40a0 + 3db0: 00 91 1b 27 lds r16, 0x271B + 3db4: 10 91 1c 27 lds r17, 0x271C + 3db8: 0c 17 cp r16, r28 + 3dba: 1d 07 cpc r17, r29 + 3dbc: 20 f0 brcs .+8 ; 0x3dc6 + 3dbe: 20 97 sbiw r28, 0x00 ; 0 + 3dc0: 09 f4 brne .+2 ; 0x3dc4 + 3dc2: 83 c0 rjmp .+262 ; 0x3eca + 3dc4: 8e 01 movw r16, r28 + 3dc6: c0 e0 ldi r28, 0x00 ; 0 + 3dc8: 01 15 cp r16, r1 + 3dca: 11 05 cpc r17, r1 + 3dcc: 09 f0 breq .+2 ; 0x3dd0 + 3dce: 4a c0 rjmp .+148 ; 0x3e64 + 3dd0: cc 23 and r28, r28 + 3dd2: 09 f4 brne .+2 ; 0x3dd6 + 3dd4: 5c c0 rjmp .+184 ; 0x3e8e + 3dd6: 80 91 14 27 lds r24, 0x2714 + 3dda: 88 23 and r24, r24 + 3ddc: 09 f4 brne .+2 ; 0x3de0 + 3dde: 55 c0 rjmp .+170 ; 0x3e8a + 3de0: 85 30 cpi r24, 0x05 ; 5 + 3de2: 09 f4 brne .+2 ; 0x3de6 + 3de4: 5d c0 rjmp .+186 ; 0x3ea0 + 3de6: dd d1 rcall .+954 ; 0x41a2 + 3de8: 81 11 cpse r24, r1 + 3dea: 6d c0 rjmp .+218 ; 0x3ec6 + 3dec: f3 d1 rcall .+998 ; 0x41d4 + 3dee: 81 11 cpse r24, r1 + 3df0: 4e c0 rjmp .+156 ; 0x3e8e + 3df2: 09 d2 rcall .+1042 ; 0x4206 + 3df4: 88 23 and r24, r24 + 3df6: 79 f3 breq .-34 ; 0x3dd6 + 3df8: 80 91 21 27 lds r24, 0x2721 + 3dfc: 87 fd sbrc r24, 7 + 3dfe: 5a c0 rjmp .+180 ; 0x3eb4 + 3e00: 20 91 1d 27 lds r18, 0x271D + 3e04: 30 91 1e 27 lds r19, 0x271E + 3e08: f9 01 movw r30, r18 + 3e0a: e0 5c subi r30, 0xC0 ; 192 + 3e0c: ff 4f sbci r31, 0xFF ; 255 + 3e0e: e0 80 ld r14, Z + 3e10: f9 01 movw r30, r18 + 3e12: ef 5b subi r30, 0xBF ; 191 + 3e14: ff 4f sbci r31, 0xFF ; 255 + 3e16: 80 81 ld r24, Z + 3e18: f1 2c mov r15, r1 + 3e1a: e8 1a sub r14, r24 + 3e1c: f1 08 sbc r15, r1 + 3e1e: 01 15 cp r16, r1 + 3e20: 11 05 cpc r17, r1 + 3e22: a9 f0 breq .+42 ; 0x3e4e + 3e24: 88 e0 ldi r24, 0x08 ; 8 + 3e26: e8 16 cp r14, r24 + 3e28: f1 04 cpc r15, r1 + 3e2a: 88 f4 brcc .+34 ; 0x3e4e + 3e2c: e6 01 movw r28, r12 + 3e2e: 04 c0 rjmp .+8 ; 0x3e38 + 3e30: 88 e0 ldi r24, 0x08 ; 8 + 3e32: e8 16 cp r14, r24 + 3e34: f1 04 cpc r15, r1 + 3e36: 59 f0 breq .+22 ; 0x3e4e + 3e38: 89 91 ld r24, Y+ + 3e3a: 23 d1 rcall .+582 ; 0x4082 + 3e3c: 6e 01 movw r12, r28 + 3e3e: 01 50 subi r16, 0x01 ; 1 + 3e40: 11 09 sbc r17, r1 + 3e42: 8f ef ldi r24, 0xFF ; 255 + 3e44: e8 1a sub r14, r24 + 3e46: f8 0a sbc r15, r24 + 3e48: 01 15 cp r16, r1 + 3e4a: 11 05 cpc r17, r1 + 3e4c: 89 f7 brne .-30 ; 0x3e30 + 3e4e: c1 e0 ldi r28, 0x01 ; 1 + 3e50: 88 e0 ldi r24, 0x08 ; 8 + 3e52: e8 16 cp r14, r24 + 3e54: f1 04 cpc r15, r1 + 3e56: 09 f0 breq .+2 ; 0x3e5a + 3e58: c0 e0 ldi r28, 0x00 ; 0 + 3e5a: dc d0 rcall .+440 ; 0x4014 + 3e5c: 01 15 cp r16, r1 + 3e5e: 11 05 cpc r17, r1 + 3e60: 09 f4 brne .+2 ; 0x3e64 + 3e62: b6 cf rjmp .-148 ; 0x3dd0 + 3e64: 80 91 14 27 lds r24, 0x2714 + 3e68: 88 23 and r24, r24 + 3e6a: 79 f0 breq .+30 ; 0x3e8a + 3e6c: 85 30 cpi r24, 0x05 ; 5 + 3e6e: c1 f0 breq .+48 ; 0x3ea0 + 3e70: 98 d1 rcall .+816 ; 0x41a2 + 3e72: 81 11 cpse r24, r1 + 3e74: 28 c0 rjmp .+80 ; 0x3ec6 + 3e76: ae d1 rcall .+860 ; 0x41d4 + 3e78: 81 11 cpse r24, r1 + 3e7a: 09 c0 rjmp .+18 ; 0x3e8e + 3e7c: c4 d1 rcall .+904 ; 0x4206 + 3e7e: 81 11 cpse r24, r1 + 3e80: bb cf rjmp .-138 ; 0x3df8 + 3e82: 80 91 14 27 lds r24, 0x2714 + 3e86: 81 11 cpse r24, r1 + 3e88: f1 cf rjmp .-30 ; 0x3e6c + 3e8a: 82 e0 ldi r24, 0x02 ; 2 + 3e8c: 0a c0 rjmp .+20 ; 0x3ea2 + 3e8e: a2 d1 rcall .+836 ; 0x41d4 + 3e90: 81 11 cpse r24, r1 + 3e92: 1f c0 rjmp .+62 ; 0x3ed2 + 3e94: 80 91 14 27 lds r24, 0x2714 + 3e98: 88 23 and r24, r24 + 3e9a: b9 f3 breq .-18 ; 0x3e8a + 3e9c: 85 30 cpi r24, 0x05 ; 5 + 3e9e: b9 f7 brne .-18 ; 0x3e8e + 3ea0: 83 e0 ldi r24, 0x03 ; 3 + 3ea2: df 91 pop r29 + 3ea4: cf 91 pop r28 + 3ea6: 1f 91 pop r17 + 3ea8: 0f 91 pop r16 + 3eaa: ff 90 pop r15 + 3eac: ef 90 pop r14 + 3eae: df 90 pop r13 + 3eb0: cf 90 pop r12 + 3eb2: 08 95 ret + 3eb4: e0 91 1d 27 lds r30, 0x271D + 3eb8: f0 91 1e 27 lds r31, 0x271E + 3ebc: ef 5b subi r30, 0xBF ; 191 + 3ebe: ff 4f sbci r31, 0xFF ; 255 + 3ec0: e0 80 ld r14, Z + 3ec2: f1 2c mov r15, r1 + 3ec4: ac cf rjmp .-168 ; 0x3e1e + 3ec6: 81 e0 ldi r24, 0x01 ; 1 + 3ec8: ec cf rjmp .-40 ; 0x3ea2 + 3eca: a4 d0 rcall .+328 ; 0x4014 + 3ecc: 00 e0 ldi r16, 0x00 ; 0 + 3ece: 10 e0 ldi r17, 0x00 ; 0 + 3ed0: 7a cf rjmp .-268 ; 0x3dc6 + 3ed2: 80 e0 ldi r24, 0x00 ; 0 + 3ed4: e6 cf rjmp .-52 ; 0x3ea2 -00003b44 : +00003ed6 : #if defined(TEMPLATE_FUNC_NAME) uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, uint16_t Length) { - 3b44: cf 92 push r12 - 3b46: df 92 push r13 - 3b48: ef 92 push r14 - 3b4a: ff 92 push r15 - 3b4c: 0f 93 push r16 - 3b4e: 1f 93 push r17 - 3b50: cf 93 push r28 - 3b52: df 93 push r29 - 3b54: d8 2e mov r13, r24 - 3b56: c9 2e mov r12, r25 - 3b58: 8b 01 movw r16, r22 + 3ed6: cf 92 push r12 + 3ed8: df 92 push r13 + 3eda: ef 92 push r14 + 3edc: ff 92 push r15 + 3ede: 0f 93 push r16 + 3ee0: 1f 93 push r17 + 3ee2: cf 93 push r28 + 3ee4: df 93 push r29 + 3ee6: d8 2e mov r13, r24 + 3ee8: c9 2e mov r12, r25 + 3eea: 8b 01 movw r16, r22 uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); bool LastPacketFull = false; Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - 3b5a: 80 91 21 23 lds r24, 0x2321 - 3b5e: 80 68 ori r24, 0x80 ; 128 - 3b60: d6 d0 rcall .+428 ; 0x3d0e + 3eec: 80 91 21 27 lds r24, 0x2721 + 3ef0: 80 68 ori r24, 0x80 ; 128 + 3ef2: d6 d0 rcall .+428 ; 0x40a0 if (Length > USB_ControlRequest.wLength) - 3b62: c0 91 1b 23 lds r28, 0x231B - 3b66: d0 91 1c 23 lds r29, 0x231C - 3b6a: c0 17 cp r28, r16 - 3b6c: d1 07 cpc r29, r17 - 3b6e: 28 f0 brcs .+10 ; 0x3b7a + 3ef4: c0 91 1b 27 lds r28, 0x271B + 3ef8: d0 91 1c 27 lds r29, 0x271C + 3efc: c0 17 cp r28, r16 + 3efe: d1 07 cpc r29, r17 + 3f00: 28 f0 brcs .+10 ; 0x3f0c Length = USB_ControlRequest.wLength; else if (!(Length)) - 3b70: 01 15 cp r16, r1 - 3b72: 11 05 cpc r17, r1 - 3b74: 09 f4 brne .+2 ; 0x3b78 - 3b76: 7f c0 rjmp .+254 ; 0x3c76 - 3b78: e8 01 movw r28, r16 - 3b7a: ed 2c mov r14, r13 - 3b7c: fc 2c mov r15, r12 - 3b7e: d1 2c mov r13, r1 - 3b80: 20 97 sbiw r28, 0x00 ; 0 - 3b82: 09 f0 breq .+2 ; 0x3b86 - 3b84: 45 c0 rjmp .+138 ; 0x3c10 - 3b86: dd 20 and r13, r13 - 3b88: 09 f4 brne .+2 ; 0x3b8c - 3b8a: 57 c0 rjmp .+174 ; 0x3c3a + 3f02: 01 15 cp r16, r1 + 3f04: 11 05 cpc r17, r1 + 3f06: 09 f4 brne .+2 ; 0x3f0a + 3f08: 7f c0 rjmp .+254 ; 0x4008 + 3f0a: e8 01 movw r28, r16 + 3f0c: ed 2c mov r14, r13 + 3f0e: fc 2c mov r15, r12 + 3f10: d1 2c mov r13, r1 + 3f12: 20 97 sbiw r28, 0x00 ; 0 + 3f14: 09 f0 breq .+2 ; 0x3f18 + 3f16: 45 c0 rjmp .+138 ; 0x3fa2 + 3f18: dd 20 and r13, r13 + 3f1a: 09 f4 brne .+2 ; 0x3f1e + 3f1c: 57 c0 rjmp .+174 ; 0x3fcc Endpoint_ClearIN(); while (Length || LastPacketFull) { uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3b8c: 80 91 14 23 lds r24, 0x2314 + 3f1e: 80 91 14 27 lds r24, 0x2714 if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3b90: 88 23 and r24, r24 - 3b92: 09 f4 brne .+2 ; 0x3b96 - 3b94: 50 c0 rjmp .+160 ; 0x3c36 + 3f22: 88 23 and r24, r24 + 3f24: 09 f4 brne .+2 ; 0x3f28 + 3f26: 50 c0 rjmp .+160 ; 0x3fc8 return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 3b96: 85 30 cpi r24, 0x05 ; 5 - 3b98: 09 f4 brne .+2 ; 0x3b9c - 3b9a: 58 c0 rjmp .+176 ; 0x3c4c + 3f28: 85 30 cpi r24, 0x05 ; 5 + 3f2a: 09 f4 brne .+2 ; 0x3f2e + 3f2c: 58 c0 rjmp .+176 ; 0x3fde return ENDPOINT_RWCSTREAM_BusSuspended; else if (Endpoint_IsSETUPReceived()) - 3b9c: 39 d1 rcall .+626 ; 0x3e10 - 3b9e: 81 11 cpse r24, r1 - 3ba0: 68 c0 rjmp .+208 ; 0x3c72 + 3f2e: 39 d1 rcall .+626 ; 0x41a2 + 3f30: 81 11 cpse r24, r1 + 3f32: 68 c0 rjmp .+208 ; 0x4004 return ENDPOINT_RWCSTREAM_HostAborted; else if (Endpoint_IsOUTReceived()) - 3ba2: 4f d1 rcall .+670 ; 0x3e42 - 3ba4: 81 11 cpse r24, r1 - 3ba6: 49 c0 rjmp .+146 ; 0x3c3a + 3f34: 4f d1 rcall .+670 ; 0x41d4 + 3f36: 81 11 cpse r24, r1 + 3f38: 49 c0 rjmp .+146 ; 0x3fcc break; if (Endpoint_IsINReady()) - 3ba8: 65 d1 rcall .+714 ; 0x3e74 - 3baa: 88 23 and r24, r24 - 3bac: 79 f3 breq .-34 ; 0x3b8c + 3f3a: 65 d1 rcall .+714 ; 0x4206 + 3f3c: 88 23 and r24, r24 + 3f3e: 79 f3 breq .-34 ; 0x3f1e * \return Total number of bytes in the currently selected Endpoint's FIFO buffer. */ static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint16_t Endpoint_BytesInEndpoint(void) { if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN) - 3bae: 80 91 21 23 lds r24, 0x2321 - 3bb2: 87 fd sbrc r24, 7 - 3bb4: 55 c0 rjmp .+170 ; 0x3c60 + 3f40: 80 91 21 27 lds r24, 0x2721 + 3f44: 87 fd sbrc r24, 7 + 3f46: 55 c0 rjmp .+170 ; 0x3ff2 return USB_Endpoint_SelectedFIFO->Position; else return (USB_Endpoint_SelectedFIFO->Length - USB_Endpoint_SelectedFIFO->Position); - 3bb6: 80 91 1d 23 lds r24, 0x231D - 3bba: 90 91 1e 23 lds r25, 0x231E - 3bbe: fc 01 movw r30, r24 - 3bc0: e0 5c subi r30, 0xC0 ; 192 - 3bc2: ff 4f sbci r31, 0xFF ; 255 - 3bc4: 00 81 ld r16, Z - 3bc6: fc 01 movw r30, r24 - 3bc8: ef 5b subi r30, 0xBF ; 191 - 3bca: ff 4f sbci r31, 0xFF ; 255 - 3bcc: 80 81 ld r24, Z - 3bce: 10 e0 ldi r17, 0x00 ; 0 - 3bd0: 08 1b sub r16, r24 - 3bd2: 11 09 sbc r17, r1 + 3f48: 80 91 1d 27 lds r24, 0x271D + 3f4c: 90 91 1e 27 lds r25, 0x271E + 3f50: fc 01 movw r30, r24 + 3f52: e0 5c subi r30, 0xC0 ; 192 + 3f54: ff 4f sbci r31, 0xFF ; 255 + 3f56: 00 81 ld r16, Z + 3f58: fc 01 movw r30, r24 + 3f5a: ef 5b subi r30, 0xBF ; 191 + 3f5c: ff 4f sbci r31, 0xFF ; 255 + 3f5e: 80 81 ld r24, Z + 3f60: 10 e0 ldi r17, 0x00 ; 0 + 3f62: 08 1b sub r16, r24 + 3f64: 11 09 sbc r17, r1 { uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) - 3bd4: 20 97 sbiw r28, 0x00 ; 0 - 3bd6: 91 f0 breq .+36 ; 0x3bfc - 3bd8: 08 30 cpi r16, 0x08 ; 8 - 3bda: 11 05 cpc r17, r1 - 3bdc: 20 f0 brcs .+8 ; 0x3be6 - 3bde: 0e c0 rjmp .+28 ; 0x3bfc - 3be0: 08 30 cpi r16, 0x08 ; 8 - 3be2: 11 05 cpc r17, r1 - 3be4: 59 f0 breq .+22 ; 0x3bfc + 3f66: 20 97 sbiw r28, 0x00 ; 0 + 3f68: 91 f0 breq .+36 ; 0x3f8e + 3f6a: 08 30 cpi r16, 0x08 ; 8 + 3f6c: 11 05 cpc r17, r1 + 3f6e: 20 f0 brcs .+8 ; 0x3f78 + 3f70: 0e c0 rjmp .+28 ; 0x3f8e + 3f72: 08 30 cpi r16, 0x08 ; 8 + 3f74: 11 05 cpc r17, r1 + 3f76: 59 f0 breq .+22 ; 0x3f8e { TEMPLATE_TRANSFER_BYTE(DataStream); - 3be6: f7 01 movw r30, r14 - 3be8: 84 91 lpm r24, Z - 3bea: 82 d0 rcall .+260 ; 0x3cf0 + 3f78: f7 01 movw r30, r14 + 3f7a: 84 91 lpm r24, Z + 3f7c: 82 d0 rcall .+260 ; 0x4082 TEMPLATE_BUFFER_MOVE(DataStream, 1); - 3bec: ff ef ldi r31, 0xFF ; 255 - 3bee: ef 1a sub r14, r31 - 3bf0: ff 0a sbc r15, r31 + 3f7e: ff ef ldi r31, 0xFF ; 255 + 3f80: ef 1a sub r14, r31 + 3f82: ff 0a sbc r15, r31 Length--; - 3bf2: 21 97 sbiw r28, 0x01 ; 1 + 3f84: 21 97 sbiw r28, 0x01 ; 1 BytesInEndpoint++; - 3bf4: 0f 5f subi r16, 0xFF ; 255 - 3bf6: 1f 4f sbci r17, 0xFF ; 255 + 3f86: 0f 5f subi r16, 0xFF ; 255 + 3f88: 1f 4f sbci r17, 0xFF ; 255 if (Endpoint_IsINReady()) { uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) - 3bf8: 20 97 sbiw r28, 0x00 ; 0 - 3bfa: 91 f7 brne .-28 ; 0x3be0 + 3f8a: 20 97 sbiw r28, 0x00 ; 0 + 3f8c: 91 f7 brne .-28 ; 0x3f72 TEMPLATE_BUFFER_MOVE(DataStream, 1); Length--; BytesInEndpoint++; } LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); - 3bfc: dd 24 eor r13, r13 - 3bfe: d3 94 inc r13 - 3c00: 08 30 cpi r16, 0x08 ; 8 - 3c02: 11 05 cpc r17, r1 - 3c04: 09 f0 breq .+2 ; 0x3c08 - 3c06: d1 2c mov r13, r1 + 3f8e: dd 24 eor r13, r13 + 3f90: d3 94 inc r13 + 3f92: 08 30 cpi r16, 0x08 ; 8 + 3f94: 11 05 cpc r17, r1 + 3f96: 09 f0 breq .+2 ; 0x3f9a + 3f98: d1 2c mov r13, r1 Endpoint_ClearIN(); - 3c08: 3c d0 rcall .+120 ; 0x3c82 - 3c0a: 20 97 sbiw r28, 0x00 ; 0 - 3c0c: 09 f4 brne .+2 ; 0x3c10 - 3c0e: bb cf rjmp .-138 ; 0x3b86 + 3f9a: 3c d0 rcall .+120 ; 0x4014 + 3f9c: 20 97 sbiw r28, 0x00 ; 0 + 3f9e: 09 f4 brne .+2 ; 0x3fa2 + 3fa0: bb cf rjmp .-138 ; 0x3f18 else if (!(Length)) Endpoint_ClearIN(); while (Length || LastPacketFull) { uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3c10: 80 91 14 23 lds r24, 0x2314 + 3fa2: 80 91 14 27 lds r24, 0x2714 if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3c14: 88 23 and r24, r24 - 3c16: 79 f0 breq .+30 ; 0x3c36 + 3fa6: 88 23 and r24, r24 + 3fa8: 79 f0 breq .+30 ; 0x3fc8 return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 3c18: 85 30 cpi r24, 0x05 ; 5 - 3c1a: c1 f0 breq .+48 ; 0x3c4c + 3faa: 85 30 cpi r24, 0x05 ; 5 + 3fac: c1 f0 breq .+48 ; 0x3fde return ENDPOINT_RWCSTREAM_BusSuspended; else if (Endpoint_IsSETUPReceived()) - 3c1c: f9 d0 rcall .+498 ; 0x3e10 - 3c1e: 81 11 cpse r24, r1 - 3c20: 28 c0 rjmp .+80 ; 0x3c72 + 3fae: f9 d0 rcall .+498 ; 0x41a2 + 3fb0: 81 11 cpse r24, r1 + 3fb2: 28 c0 rjmp .+80 ; 0x4004 return ENDPOINT_RWCSTREAM_HostAborted; else if (Endpoint_IsOUTReceived()) - 3c22: 0f d1 rcall .+542 ; 0x3e42 - 3c24: 81 11 cpse r24, r1 - 3c26: 09 c0 rjmp .+18 ; 0x3c3a + 3fb4: 0f d1 rcall .+542 ; 0x41d4 + 3fb6: 81 11 cpse r24, r1 + 3fb8: 09 c0 rjmp .+18 ; 0x3fcc break; if (Endpoint_IsINReady()) - 3c28: 25 d1 rcall .+586 ; 0x3e74 - 3c2a: 81 11 cpse r24, r1 - 3c2c: c0 cf rjmp .-128 ; 0x3bae + 3fba: 25 d1 rcall .+586 ; 0x4206 + 3fbc: 81 11 cpse r24, r1 + 3fbe: c0 cf rjmp .-128 ; 0x3f40 else if (!(Length)) Endpoint_ClearIN(); while (Length || LastPacketFull) { uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3c2e: 80 91 14 23 lds r24, 0x2314 + 3fc0: 80 91 14 27 lds r24, 0x2714 if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3c32: 81 11 cpse r24, r1 - 3c34: f1 cf rjmp .-30 ; 0x3c18 + 3fc4: 81 11 cpse r24, r1 + 3fc6: f1 cf rjmp .-30 ; 0x3faa return ENDPOINT_RWCSTREAM_DeviceDisconnected; - 3c36: 82 e0 ldi r24, 0x02 ; 2 - 3c38: 0a c0 rjmp .+20 ; 0x3c4e + 3fc8: 82 e0 ldi r24, 0x02 ; 2 + 3fca: 0a c0 rjmp .+20 ; 0x3fe0 LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); Endpoint_ClearIN(); } } while (!(Endpoint_IsOUTReceived())) - 3c3a: 03 d1 rcall .+518 ; 0x3e42 - 3c3c: 81 11 cpse r24, r1 - 3c3e: 1f c0 rjmp .+62 ; 0x3c7e + 3fcc: 03 d1 rcall .+518 ; 0x41d4 + 3fce: 81 11 cpse r24, r1 + 3fd0: 1f c0 rjmp .+62 ; 0x4010 { uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3c40: 80 91 14 23 lds r24, 0x2314 + 3fd2: 80 91 14 27 lds r24, 0x2714 if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3c44: 88 23 and r24, r24 - 3c46: b9 f3 breq .-18 ; 0x3c36 + 3fd6: 88 23 and r24, r24 + 3fd8: b9 f3 breq .-18 ; 0x3fc8 return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 3c48: 85 30 cpi r24, 0x05 ; 5 - 3c4a: b9 f7 brne .-18 ; 0x3c3a + 3fda: 85 30 cpi r24, 0x05 ; 5 + 3fdc: b9 f7 brne .-18 ; 0x3fcc uint8_t USB_DeviceState_LCL = USB_DeviceState; if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; - 3c4c: 83 e0 ldi r24, 0x03 ; 3 + 3fde: 83 e0 ldi r24, 0x03 ; 3 else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; } return ENDPOINT_RWCSTREAM_NoError; } - 3c4e: df 91 pop r29 - 3c50: cf 91 pop r28 - 3c52: 1f 91 pop r17 - 3c54: 0f 91 pop r16 - 3c56: ff 90 pop r15 - 3c58: ef 90 pop r14 - 3c5a: df 90 pop r13 - 3c5c: cf 90 pop r12 - 3c5e: 08 95 ret - */ - static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; - static inline uint16_t Endpoint_BytesInEndpoint(void) - { - if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN) - return USB_Endpoint_SelectedFIFO->Position; - 3c60: e0 91 1d 23 lds r30, 0x231D - 3c64: f0 91 1e 23 lds r31, 0x231E - 3c68: ef 5b subi r30, 0xBF ; 191 - 3c6a: ff 4f sbci r31, 0xFF ; 255 - 3c6c: 00 81 ld r16, Z - 3c6e: 10 e0 ldi r17, 0x00 ; 0 - 3c70: b1 cf rjmp .-158 ; 0x3bd4 - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - else if (Endpoint_IsSETUPReceived()) - return ENDPOINT_RWCSTREAM_HostAborted; - 3c72: 81 e0 ldi r24, 0x01 ; 1 - 3c74: ec cf rjmp .-40 ; 0x3c4e - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - - if (Length > USB_ControlRequest.wLength) - Length = USB_ControlRequest.wLength; - else if (!(Length)) - Endpoint_ClearIN(); - 3c76: 05 d0 rcall .+10 ; 0x3c82 - 3c78: c0 e0 ldi r28, 0x00 ; 0 - 3c7a: d0 e0 ldi r29, 0x00 ; 0 - 3c7c: 7e cf rjmp .-260 ; 0x3b7a - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; - 3c7e: 80 e0 ldi r24, 0x00 ; 0 - 3c80: e6 cf rjmp .-52 ; 0x3c4e - -00003c82 : - USB_Endpoint_SelectedFIFO->Position = 0; -} - -void Endpoint_ClearIN(void) -{ - USB_Endpoint_SelectedHandle->CNT = USB_Endpoint_SelectedFIFO->Position; - 3c82: e0 91 1f 23 lds r30, 0x231F - 3c86: f0 91 20 23 lds r31, 0x2320 - 3c8a: a0 91 1d 23 lds r26, 0x231D - 3c8e: b0 91 1e 23 lds r27, 0x231E - 3c92: af 5b subi r26, 0xBF ; 191 - 3c94: bf 4f sbci r27, 0xFF ; 255 - 3c96: 8c 91 ld r24, X - 3c98: 90 e0 ldi r25, 0x00 ; 0 - 3c9a: 82 83 std Z+2, r24 ; 0x02 - 3c9c: 93 83 std Z+3, r25 ; 0x03 - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 3c9e: 80 81 ld r24, Z - 3ca0: 8d 79 andi r24, 0x9D ; 157 - 3ca2: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3ca4: e0 91 1d 23 lds r30, 0x231D - 3ca8: f0 91 1e 23 lds r31, 0x231E - 3cac: ef 5b subi r30, 0xBF ; 191 - 3cae: ff 4f sbci r31, 0xFF ; 255 - 3cb0: 10 82 st Z, r1 - 3cb2: 08 95 ret - -00003cb4 : -} - -void Endpoint_ClearOUT(void) -{ - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 3cb4: e0 91 1f 23 lds r30, 0x231F - 3cb8: f0 91 20 23 lds r31, 0x2320 - 3cbc: 80 81 ld r24, Z - 3cbe: 8d 79 andi r24, 0x9D ; 157 - 3cc0: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3cc2: e0 91 1d 23 lds r30, 0x231D - 3cc6: f0 91 1e 23 lds r31, 0x231E - 3cca: ef 5b subi r30, 0xBF ; 191 - 3ccc: ff 4f sbci r31, 0xFF ; 255 - 3cce: 10 82 st Z, r1 - 3cd0: 08 95 ret - -00003cd2 : - } -} - -uint8_t Endpoint_Read_8(void) -{ - return USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++]; - 3cd2: 80 91 1d 23 lds r24, 0x231D - 3cd6: 90 91 1e 23 lds r25, 0x231E - 3cda: fc 01 movw r30, r24 - 3cdc: ef 5b subi r30, 0xBF ; 191 - 3cde: ff 4f sbci r31, 0xFF ; 255 - 3ce0: 20 81 ld r18, Z - 3ce2: dc 01 movw r26, r24 - 3ce4: a2 0f add r26, r18 - 3ce6: b1 1d adc r27, r1 - 3ce8: 8c 91 ld r24, X - 3cea: 2f 5f subi r18, 0xFF ; 255 - 3cec: 20 83 st Z, r18 -} - 3cee: 08 95 ret - -00003cf0 : - -void Endpoint_Write_8(const uint8_t Data) -{ - USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; - 3cf0: 20 91 1d 23 lds r18, 0x231D - 3cf4: 30 91 1e 23 lds r19, 0x231E - 3cf8: f9 01 movw r30, r18 - 3cfa: ef 5b subi r30, 0xBF ; 191 - 3cfc: ff 4f sbci r31, 0xFF ; 255 - 3cfe: 90 81 ld r25, Z - 3d00: d9 01 movw r26, r18 - 3d02: a9 0f add r26, r25 - 3d04: b1 1d adc r27, r1 - 3d06: 8c 93 st X, r24 - 3d08: 9f 5f subi r25, 0xFF ; 255 - 3d0a: 90 83 st Z, r25 - 3d0c: 08 95 ret - -00003d0e : - -void Endpoint_SelectEndpoint(const uint8_t Address) -{ - uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); - - USB_Endpoint_SelectedEndpoint = Address; - 3d0e: 80 93 21 23 sts 0x2321, r24 - USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; -} - -void Endpoint_SelectEndpoint(const uint8_t Address) -{ - uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); - 3d12: 28 2f mov r18, r24 - 3d14: 2f 70 andi r18, 0x0F ; 15 - - USB_Endpoint_SelectedEndpoint = Address; - - Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; - 3d16: 62 2f mov r22, r18 - 3d18: 70 e0 ldi r23, 0x00 ; 0 - 3d1a: 94 e8 ldi r25, 0x84 ; 132 - 3d1c: 29 9f mul r18, r25 - 3d1e: 90 01 movw r18, r0 - 3d20: 11 24 eor r1, r1 - 3d22: 2e 5d subi r18, 0xDE ; 222 - 3d24: 3c 4d sbci r19, 0xDC ; 220 - USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; - 3d26: 40 91 c6 04 lds r20, 0x04C6 - 3d2a: 50 91 c7 04 lds r21, 0x04C7 - - if (Address & ENDPOINT_DIR_IN) - 3d2e: 87 fd sbrc r24, 7 - 3d30: 12 c0 rjmp .+36 ; 0x3d56 - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; - } - else - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; - 3d32: 20 93 1d 23 sts 0x231D, r18 - 3d36: 30 93 1e 23 sts 0x231E, r19 - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; - 3d3a: cb 01 movw r24, r22 - 3d3c: 82 95 swap r24 - 3d3e: 92 95 swap r25 - 3d40: 90 7f andi r25, 0xF0 ; 240 - 3d42: 98 27 eor r25, r24 - 3d44: 80 7f andi r24, 0xF0 ; 240 - 3d46: 98 27 eor r25, r24 - 3d48: 84 0f add r24, r20 - 3d4a: 95 1f adc r25, r21 - 3d4c: 80 93 1f 23 sts 0x231F, r24 - 3d50: 90 93 20 23 sts 0x2320, r25 - 3d54: 08 95 ret - Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; - USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; - - if (Address & ENDPOINT_DIR_IN) - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; - 3d56: 2e 5b subi r18, 0xBE ; 190 - 3d58: 3f 4f sbci r19, 0xFF ; 255 - 3d5a: 20 93 1d 23 sts 0x231D, r18 - 3d5e: 30 93 1e 23 sts 0x231E, r19 - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; - 3d62: 62 95 swap r22 - 3d64: 72 95 swap r23 - 3d66: 70 7f andi r23, 0xF0 ; 240 - 3d68: 76 27 eor r23, r22 - 3d6a: 60 7f andi r22, 0xF0 ; 240 - 3d6c: 76 27 eor r23, r22 - 3d6e: 68 5f subi r22, 0xF8 ; 248 - 3d70: 7f 4f sbci r23, 0xFF ; 255 - 3d72: 64 0f add r22, r20 - 3d74: 75 1f adc r23, r21 - 3d76: 60 93 1f 23 sts 0x231F, r22 - 3d7a: 70 93 20 23 sts 0x2320, r23 - 3d7e: 08 95 ret - -00003d80 : - USB_Endpoint_SelectedFIFO->Position = 0; -} - -void Endpoint_StallTransaction(void) -{ - USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; - 3d80: e0 91 1f 23 lds r30, 0x231F - 3d84: f0 91 20 23 lds r31, 0x2320 - 3d88: 81 81 ldd r24, Z+1 ; 0x01 - 3d8a: 84 60 ori r24, 0x04 ; 4 - 3d8c: 81 83 std Z+1, r24 ; 0x01 - - if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc) - 3d8e: e0 91 1f 23 lds r30, 0x231F - 3d92: f0 91 20 23 lds r31, 0x2320 - 3d96: 81 81 ldd r24, Z+1 ; 0x01 - 3d98: 80 7c andi r24, 0xC0 ; 192 - 3d9a: 80 34 cpi r24, 0x40 ; 64 - 3d9c: 09 f0 breq .+2 ; 0x3da0 - 3d9e: 08 95 ret - { - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN); - 3da0: 80 91 21 23 lds r24, 0x2321 - 3da4: 80 58 subi r24, 0x80 ; 128 - 3da6: b3 df rcall .-154 ; 0x3d0e - USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; - 3da8: e0 91 1f 23 lds r30, 0x231F - 3dac: f0 91 20 23 lds r31, 0x2320 - 3db0: 81 81 ldd r24, Z+1 ; 0x01 - 3db2: 84 60 ori r24, 0x04 ; 4 - 3db4: 81 83 std Z+1, r24 ; 0x01 - 3db6: 08 95 ret - -00003db8 : - return false; -} - -void Endpoint_ClearSETUP(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 3db8: 80 91 21 23 lds r24, 0x2321 - 3dbc: 8f 77 andi r24, 0x7F ; 127 - 3dbe: a7 df rcall .-178 ; 0x3d0e - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 3dc0: e0 91 1f 23 lds r30, 0x231F - 3dc4: f0 91 20 23 lds r31, 0x2320 - 3dc8: 80 81 ld r24, Z - 3dca: 8d 78 andi r24, 0x8D ; 141 - 3dcc: 80 83 st Z, r24 - USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; - 3dce: e0 91 1f 23 lds r30, 0x231F - 3dd2: f0 91 20 23 lds r31, 0x2320 - 3dd6: 80 81 ld r24, Z - 3dd8: 81 60 ori r24, 0x01 ; 1 - 3dda: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3ddc: e0 91 1d 23 lds r30, 0x231D - 3de0: f0 91 1e 23 lds r31, 0x231E - 3de4: ef 5b subi r30, 0xBF ; 191 - 3de6: ff 4f sbci r31, 0xFF ; 255 - 3de8: 10 82 st Z, r1 - - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - 3dea: 80 91 21 23 lds r24, 0x2321 - 3dee: 80 68 ori r24, 0x80 ; 128 - 3df0: 8e df rcall .-228 ; 0x3d0e - USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; - 3df2: e0 91 1f 23 lds r30, 0x231F - 3df6: f0 91 20 23 lds r31, 0x2320 - 3dfa: 80 81 ld r24, Z - 3dfc: 81 60 ori r24, 0x01 ; 1 - 3dfe: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3e00: e0 91 1d 23 lds r30, 0x231D - 3e04: f0 91 1e 23 lds r31, 0x231E - 3e08: ef 5b subi r30, 0xBF ; 191 - 3e0a: ff 4f sbci r31, 0xFF ; 255 - 3e0c: 10 82 st Z, r1 - 3e0e: 08 95 ret - -00003e10 : - return false; -} - -bool Endpoint_IsSETUPReceived(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 3e10: 80 91 21 23 lds r24, 0x2321 - 3e14: 8f 77 andi r24, 0x7F ; 127 - 3e16: 7b df rcall .-266 ; 0x3d0e - - if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_SETUP_bm) - 3e18: e0 91 1f 23 lds r30, 0x231F - 3e1c: f0 91 20 23 lds r31, 0x2320 - 3e20: 80 81 ld r24, Z - 3e22: 84 ff sbrs r24, 4 - 3e24: 0c c0 rjmp .+24 ; 0x3e3e - { - USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; - 3e26: 20 91 1d 23 lds r18, 0x231D - 3e2a: 30 91 1e 23 lds r19, 0x231E - 3e2e: 82 81 ldd r24, Z+2 ; 0x02 - 3e30: 93 81 ldd r25, Z+3 ; 0x03 - 3e32: f9 01 movw r30, r18 - 3e34: e0 5c subi r30, 0xC0 ; 192 - 3e36: ff 4f sbci r31, 0xFF ; 255 - 3e38: 80 83 st Z, r24 - return true; - 3e3a: 81 e0 ldi r24, 0x01 ; 1 - 3e3c: 08 95 ret - } - - return false; - 3e3e: 80 e0 ldi r24, 0x00 ; 0 -} - 3e40: 08 95 ret - -00003e42 : - return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); -} - -bool Endpoint_IsOUTReceived(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 3e42: 80 91 21 23 lds r24, 0x2321 - 3e46: 8f 77 andi r24, 0x7F ; 127 - 3e48: 62 df rcall .-316 ; 0x3d0e - - if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_TRNCOMPL0_bm) - 3e4a: e0 91 1f 23 lds r30, 0x231F - 3e4e: f0 91 20 23 lds r31, 0x2320 - 3e52: 80 81 ld r24, Z - 3e54: 85 ff sbrs r24, 5 - 3e56: 0c c0 rjmp .+24 ; 0x3e70 - { - USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; - 3e58: 20 91 1d 23 lds r18, 0x231D - 3e5c: 30 91 1e 23 lds r19, 0x231E - 3e60: 82 81 ldd r24, Z+2 ; 0x02 - 3e62: 93 81 ldd r25, Z+3 ; 0x03 - 3e64: f9 01 movw r30, r18 - 3e66: e0 5c subi r30, 0xC0 ; 192 - 3e68: ff 4f sbci r31, 0xFF ; 255 - 3e6a: 80 83 st Z, r24 - return true; - 3e6c: 81 e0 ldi r24, 0x01 ; 1 - 3e6e: 08 95 ret - } - - return false; - 3e70: 80 e0 ldi r24, 0x00 ; 0 -} - 3e72: 08 95 ret - -00003e74 : -volatile USB_EP_t* USB_Endpoint_SelectedHandle; -volatile Endpoint_FIFO_t* USB_Endpoint_SelectedFIFO; - -bool Endpoint_IsINReady(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - 3e74: 80 91 21 23 lds r24, 0x2321 - 3e78: 80 68 ori r24, 0x80 ; 128 - 3e7a: 49 df rcall .-366 ; 0x3d0e - - return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); - 3e7c: e0 91 1f 23 lds r30, 0x231F - 3e80: f0 91 20 23 lds r31, 0x2320 - 3e84: 80 81 ld r24, Z -} - 3e86: 86 95 lsr r24 - 3e88: 81 70 andi r24, 0x01 ; 1 - 3e8a: 08 95 ret - -00003e8c : -} - -bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address, - const uint8_t Config, - const uint8_t Size) -{ - 3e8c: 1f 93 push r17 - 3e8e: cf 93 push r28 - 3e90: df 93 push r29 - 3e92: 00 d0 rcall .+0 ; 0x3e94 - 3e94: cd b7 in r28, 0x3d ; 61 - 3e96: de b7 in r29, 0x3e ; 62 - 3e98: 18 2f mov r17, r24 - Endpoint_SelectEndpoint(Address); - 3e9a: 4a 83 std Y+2, r20 ; 0x02 - 3e9c: 69 83 std Y+1, r22 ; 0x01 - 3e9e: 37 df rcall .-402 ; 0x3d0e - - USB_Endpoint_SelectedHandle->CTRL = 0; - 3ea0: e0 91 1f 23 lds r30, 0x231F - 3ea4: f0 91 20 23 lds r31, 0x2320 - 3ea8: 11 82 std Z+1, r1 ; 0x01 - USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; - 3eaa: e0 91 1f 23 lds r30, 0x231F - 3eae: f0 91 20 23 lds r31, 0x2320 - 3eb2: 4a 81 ldd r20, Y+2 ; 0x02 - 3eb4: 69 81 ldd r22, Y+1 ; 0x01 - 3eb6: 17 fd sbrc r17, 7 - 3eb8: 22 c0 rjmp .+68 ; 0x3efe - 3eba: 10 82 st Z, r1 - USB_Endpoint_SelectedHandle->CTRL = Config; - 3ebc: e0 91 1f 23 lds r30, 0x231F - 3ec0: f0 91 20 23 lds r31, 0x2320 - 3ec4: 61 83 std Z+1, r22 ; 0x01 - USB_Endpoint_SelectedHandle->CNT = 0; - 3ec6: e0 91 1f 23 lds r30, 0x231F - 3eca: f0 91 20 23 lds r31, 0x2320 - 3ece: 12 82 std Z+2, r1 ; 0x02 - 3ed0: 13 82 std Z+3, r1 ; 0x03 - USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; - 3ed2: 80 91 1d 23 lds r24, 0x231D - 3ed6: 90 91 1e 23 lds r25, 0x231E - 3eda: 84 83 std Z+4, r24 ; 0x04 - 3edc: 95 83 std Z+5, r25 ; 0x05 - - USB_Endpoint_SelectedFIFO->Length = (Address & ENDPOINT_DIR_IN) ? Size : 0; - 3ede: 40 e0 ldi r20, 0x00 ; 0 - 3ee0: fc 01 movw r30, r24 - 3ee2: e0 5c subi r30, 0xC0 ; 192 - 3ee4: ff 4f sbci r31, 0xFF ; 255 - 3ee6: 40 83 st Z, r20 - USB_Endpoint_SelectedFIFO->Position = 0; - 3ee8: fc 01 movw r30, r24 - 3eea: ef 5b subi r30, 0xBF ; 191 - 3eec: ff 4f sbci r31, 0xFF ; 255 - 3eee: 10 82 st Z, r1 - - return true; -} - 3ef0: 81 e0 ldi r24, 0x01 ; 1 - 3ef2: 0f 90 pop r0 - 3ef4: 0f 90 pop r0 - 3ef6: df 91 pop r29 - 3ef8: cf 91 pop r28 - 3efa: 1f 91 pop r17 - 3efc: 08 95 ret - const uint8_t Size) -{ - Endpoint_SelectEndpoint(Address); - - USB_Endpoint_SelectedHandle->CTRL = 0; - USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; - 3efe: 82 e0 ldi r24, 0x02 ; 2 - 3f00: 80 83 st Z, r24 - USB_Endpoint_SelectedHandle->CTRL = Config; - 3f02: e0 91 1f 23 lds r30, 0x231F - 3f06: f0 91 20 23 lds r31, 0x2320 - 3f0a: 61 83 std Z+1, r22 ; 0x01 - USB_Endpoint_SelectedHandle->CNT = 0; - 3f0c: e0 91 1f 23 lds r30, 0x231F - 3f10: f0 91 20 23 lds r31, 0x2320 - 3f14: 12 82 std Z+2, r1 ; 0x02 - 3f16: 13 82 std Z+3, r1 ; 0x03 - USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; - 3f18: 80 91 1d 23 lds r24, 0x231D - 3f1c: 90 91 1e 23 lds r25, 0x231E - 3f20: 84 83 std Z+4, r24 ; 0x04 - 3f22: 95 83 std Z+5, r25 ; 0x05 - 3f24: dd cf rjmp .-70 ; 0x3ee0 - -00003f26 : - } -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - const uint8_t Entries) -{ - 3f26: af 92 push r10 - 3f28: bf 92 push r11 - 3f2a: df 92 push r13 - 3f2c: ef 92 push r14 - 3f2e: ff 92 push r15 - 3f30: 0f 93 push r16 - 3f32: 1f 93 push r17 - 3f34: cf 93 push r28 - 3f36: df 93 push r29 - 3f38: 00 d0 rcall .+0 ; 0x3f3a - 3f3a: cd b7 in r28, 0x3d ; 61 - 3f3c: de b7 in r29, 0x3e ; 62 - 3f3e: e6 2e mov r14, r22 - for (uint8_t i = 0; i < Entries; i++) - 3f40: 66 23 and r22, r22 - 3f42: 09 f4 brne .+2 ; 0x3f46 - 3f44: 4a c0 rjmp .+148 ; 0x3fda - 3f46: 5c 01 movw r10, r24 - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; - } -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - 3f48: 8c 01 movw r16, r24 - 3f4a: 0c 5f subi r16, 0xFC ; 252 - 3f4c: 1f 4f sbci r17, 0xFF ; 255 - const uint8_t Entries) -{ - for (uint8_t i = 0; i < Entries; i++) - 3f4e: f1 2c mov r15, r1 - { - if (!(Table[i].Address)) - 3f50: d5 01 movw r26, r10 - 3f52: 5c 91 ld r21, X - 3f54: 55 23 and r21, r21 - 3f56: c9 f1 breq .+114 ; 0x3fca - continue; - - if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) - 3f58: d5 01 movw r26, r10 - 3f5a: 11 96 adiw r26, 0x01 ; 1 - 3f5c: ed 91 ld r30, X+ - 3f5e: fc 91 ld r31, X - 3f60: 12 97 sbiw r26, 0x02 ; 2 - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; - } -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - 3f62: d8 01 movw r26, r16 - 3f64: 11 97 sbiw r26, 0x01 ; 1 - for (uint8_t i = 0; i < Entries; i++) - { - if (!(Table[i].Address)) - continue; - - if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) - 3f66: 4c 91 ld r20, X - static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address, - const uint8_t Type, - const uint16_t Size, - const uint8_t Banks) - { - uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); - 3f68: d8 01 movw r26, r16 - 3f6a: 8c 91 ld r24, X - 3f6c: 82 30 cpi r24, 0x02 ; 2 - 3f6e: 08 f4 brcc .+2 ; 0x3f72 - 3f70: 43 c0 rjmp .+134 ; 0x3ff8 - 3f72: 98 e1 ldi r25, 0x18 ; 24 - 3f74: 88 e1 ldi r24, 0x18 ; 24 - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) - { - uint8_t MaskVal = 0; - uint16_t CheckBytes = 8; - - while (CheckBytes < Bytes) - 3f76: e9 30 cpi r30, 0x09 ; 9 - 3f78: f1 05 cpc r31, r1 - 3f7a: 50 f0 brcs .+20 ; 0x3f90 - 3f7c: 28 e0 ldi r18, 0x08 ; 8 - 3f7e: 30 e0 ldi r19, 0x00 ; 0 - 3f80: 90 e0 ldi r25, 0x00 ; 0 - { - MaskVal++; - 3f82: 9f 5f subi r25, 0xFF ; 255 - CheckBytes <<= 1; - 3f84: 22 0f add r18, r18 - 3f86: 33 1f adc r19, r19 - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) - { - uint8_t MaskVal = 0; - uint16_t CheckBytes = 8; - - while (CheckBytes < Bytes) - 3f88: 2e 17 cp r18, r30 - 3f8a: 3f 07 cpc r19, r31 - 3f8c: d0 f3 brcs .-12 ; 0x3f82 - 3f8e: 98 2b or r25, r24 - const uint16_t Size, - const uint8_t Banks) - { - uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); - - if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) - 3f90: 25 2f mov r18, r21 - 3f92: 2f 70 andi r18, 0x0F ; 15 - 3f94: 30 e0 ldi r19, 0x00 ; 0 - 3f96: 26 30 cpi r18, 0x06 ; 6 - 3f98: 31 05 cpc r19, r1 - 3f9a: 64 f5 brge .+88 ; 0x3ff4 - return false; - - // TODO - Fix once limitations are lifted - EPConfigMask &= ~USB_EP_PINGPONG_bm; - if (Size > 64) - 3f9c: e1 34 cpi r30, 0x41 ; 65 - 3f9e: f1 05 cpc r31, r1 - 3fa0: 48 f5 brcc .+82 ; 0x3ff4 - - if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) - return false; - - // TODO - Fix once limitations are lifted - EPConfigMask &= ~USB_EP_PINGPONG_bm; - 3fa2: 9f 7e andi r25, 0xEF ; 239 - if (Size > 64) - return false; - - switch (Type) - 3fa4: 41 11 cpse r20, r1 - 3fa6: 2b c0 rjmp .+86 ; 0x3ffe - { - case EP_TYPE_CONTROL: - EPConfigMask |= USB_EP_TYPE_CONTROL_gc; - 3fa8: 90 64 ori r25, 0x40 ; 64 - EPConfigMask |= USB_EP_TYPE_BULK_gc; - break; - } - - if (Type == EP_TYPE_CONTROL) - Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 3faa: de 2e mov r13, r30 - 3fac: 4e 2f mov r20, r30 - 3fae: 69 2f mov r22, r25 - 3fb0: 85 2f mov r24, r21 - 3fb2: 80 58 subi r24, 0x80 ; 128 - 3fb4: 59 83 std Y+1, r21 ; 0x01 - 3fb6: 9a 83 std Y+2, r25 ; 0x02 - 3fb8: 69 df rcall .-302 ; 0x3e8c - 3fba: 9a 81 ldd r25, Y+2 ; 0x02 - 3fbc: 59 81 ldd r21, Y+1 ; 0x01 - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 3fbe: 4d 2d mov r20, r13 - 3fc0: 69 2f mov r22, r25 - 3fc2: 85 2f mov r24, r21 - 3fc4: 63 df rcall .-314 ; 0x3e8c - 3fc6: 88 23 and r24, r24 - 3fc8: a9 f0 breq .+42 ; 0x3ff4 -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - const uint8_t Entries) -{ - for (uint8_t i = 0; i < Entries; i++) - 3fca: f3 94 inc r15 - 3fcc: b5 e0 ldi r27, 0x05 ; 5 - 3fce: ab 0e add r10, r27 - 3fd0: b1 1c adc r11, r1 - 3fd2: 0b 5f subi r16, 0xFB ; 251 - 3fd4: 1f 4f sbci r17, 0xFF ; 255 - 3fd6: fe 10 cpse r15, r14 - 3fd8: bb cf rjmp .-138 ; 0x3f50 - { - return false; - } - } - - return true; - 3fda: 81 e0 ldi r24, 0x01 ; 1 -} - 3fdc: 0f 90 pop r0 - 3fde: 0f 90 pop r0 3fe0: df 91 pop r29 3fe2: cf 91 pop r28 3fe4: 1f 91 pop r17 @@ -13361,2691 +13457,3369 @@ bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, 3fe8: ff 90 pop r15 3fea: ef 90 pop r14 3fec: df 90 pop r13 - 3fee: bf 90 pop r11 - 3ff0: af 90 pop r10 - 3ff2: 08 95 ret + 3fee: cf 90 pop r12 + 3ff0: 08 95 ret + */ + static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline uint16_t Endpoint_BytesInEndpoint(void) + { + if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN) + return USB_Endpoint_SelectedFIFO->Position; + 3ff2: e0 91 1d 27 lds r30, 0x271D + 3ff6: f0 91 1e 27 lds r31, 0x271E + 3ffa: ef 5b subi r30, 0xBF ; 191 + 3ffc: ff 4f sbci r31, 0xFF ; 255 + 3ffe: 00 81 ld r16, Z + 4000: 10 e0 ldi r17, 0x00 ; 0 + 4002: b1 cf rjmp .-158 ; 0x3f66 + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_RWCSTREAM_BusSuspended; + else if (Endpoint_IsSETUPReceived()) + return ENDPOINT_RWCSTREAM_HostAborted; + 4004: 81 e0 ldi r24, 0x01 ; 1 + 4006: ec cf rjmp .-40 ; 0x3fe0 + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); + + if (Length > USB_ControlRequest.wLength) + Length = USB_ControlRequest.wLength; + else if (!(Length)) + Endpoint_ClearIN(); + 4008: 05 d0 rcall .+10 ; 0x4014 + 400a: c0 e0 ldi r28, 0x00 ; 0 + 400c: d0 e0 ldi r29, 0x00 ; 0 + 400e: 7e cf rjmp .-260 ; 0x3f0c + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_RWCSTREAM_BusSuspended; + } + + return ENDPOINT_RWCSTREAM_NoError; + 4010: 80 e0 ldi r24, 0x00 ; 0 + 4012: e6 cf rjmp .-52 ; 0x3fe0 + +00004014 : + USB_Endpoint_SelectedFIFO->Position = 0; +} + +void Endpoint_ClearIN(void) +{ + USB_Endpoint_SelectedHandle->CNT = USB_Endpoint_SelectedFIFO->Position; + 4014: e0 91 1f 27 lds r30, 0x271F + 4018: f0 91 20 27 lds r31, 0x2720 + 401c: a0 91 1d 27 lds r26, 0x271D + 4020: b0 91 1e 27 lds r27, 0x271E + 4024: af 5b subi r26, 0xBF ; 191 + 4026: bf 4f sbci r27, 0xFF ; 255 + 4028: 8c 91 ld r24, X + 402a: 90 e0 ldi r25, 0x00 ; 0 + 402c: 82 83 std Z+2, r24 ; 0x02 + 402e: 93 83 std Z+3, r25 ; 0x03 + USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); + 4030: 80 81 ld r24, Z + 4032: 8d 79 andi r24, 0x9D ; 157 + 4034: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 4036: e0 91 1d 27 lds r30, 0x271D + 403a: f0 91 1e 27 lds r31, 0x271E + 403e: ef 5b subi r30, 0xBF ; 191 + 4040: ff 4f sbci r31, 0xFF ; 255 + 4042: 10 82 st Z, r1 + 4044: 08 95 ret + +00004046 : +} + +void Endpoint_ClearOUT(void) +{ + USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); + 4046: e0 91 1f 27 lds r30, 0x271F + 404a: f0 91 20 27 lds r31, 0x2720 + 404e: 80 81 ld r24, Z + 4050: 8d 79 andi r24, 0x9D ; 157 + 4052: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 4054: e0 91 1d 27 lds r30, 0x271D + 4058: f0 91 1e 27 lds r31, 0x271E + 405c: ef 5b subi r30, 0xBF ; 191 + 405e: ff 4f sbci r31, 0xFF ; 255 + 4060: 10 82 st Z, r1 + 4062: 08 95 ret + +00004064 : + } +} + +uint8_t Endpoint_Read_8(void) +{ + return USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++]; + 4064: 80 91 1d 27 lds r24, 0x271D + 4068: 90 91 1e 27 lds r25, 0x271E + 406c: fc 01 movw r30, r24 + 406e: ef 5b subi r30, 0xBF ; 191 + 4070: ff 4f sbci r31, 0xFF ; 255 + 4072: 20 81 ld r18, Z + 4074: dc 01 movw r26, r24 + 4076: a2 0f add r26, r18 + 4078: b1 1d adc r27, r1 + 407a: 8c 91 ld r24, X + 407c: 2f 5f subi r18, 0xFF ; 255 + 407e: 20 83 st Z, r18 +} + 4080: 08 95 ret + +00004082 : + +void Endpoint_Write_8(const uint8_t Data) +{ + USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; + 4082: 20 91 1d 27 lds r18, 0x271D + 4086: 30 91 1e 27 lds r19, 0x271E + 408a: f9 01 movw r30, r18 + 408c: ef 5b subi r30, 0xBF ; 191 + 408e: ff 4f sbci r31, 0xFF ; 255 + 4090: 90 81 ld r25, Z + 4092: d9 01 movw r26, r18 + 4094: a9 0f add r26, r25 + 4096: b1 1d adc r27, r1 + 4098: 8c 93 st X, r24 + 409a: 9f 5f subi r25, 0xFF ; 255 + 409c: 90 83 st Z, r25 + 409e: 08 95 ret + +000040a0 : + +void Endpoint_SelectEndpoint(const uint8_t Address) +{ + uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); + + USB_Endpoint_SelectedEndpoint = Address; + 40a0: 80 93 21 27 sts 0x2721, r24 + USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; +} + +void Endpoint_SelectEndpoint(const uint8_t Address) +{ + uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); + 40a4: 28 2f mov r18, r24 + 40a6: 2f 70 andi r18, 0x0F ; 15 + + USB_Endpoint_SelectedEndpoint = Address; + + Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; + 40a8: 62 2f mov r22, r18 + 40aa: 70 e0 ldi r23, 0x00 ; 0 + 40ac: 94 e8 ldi r25, 0x84 ; 132 + 40ae: 29 9f mul r18, r25 + 40b0: 90 01 movw r18, r0 + 40b2: 11 24 eor r1, r1 + 40b4: 2e 5d subi r18, 0xDE ; 222 + 40b6: 38 4d sbci r19, 0xD8 ; 216 + USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; + 40b8: 40 91 c6 04 lds r20, 0x04C6 + 40bc: 50 91 c7 04 lds r21, 0x04C7 + + if (Address & ENDPOINT_DIR_IN) + 40c0: 87 fd sbrc r24, 7 + 40c2: 12 c0 rjmp .+36 ; 0x40e8 + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; + } + else + { + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; + 40c4: 20 93 1d 27 sts 0x271D, r18 + 40c8: 30 93 1e 27 sts 0x271E, r19 + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; + 40cc: cb 01 movw r24, r22 + 40ce: 82 95 swap r24 + 40d0: 92 95 swap r25 + 40d2: 90 7f andi r25, 0xF0 ; 240 + 40d4: 98 27 eor r25, r24 + 40d6: 80 7f andi r24, 0xF0 ; 240 + 40d8: 98 27 eor r25, r24 + 40da: 84 0f add r24, r20 + 40dc: 95 1f adc r25, r21 + 40de: 80 93 1f 27 sts 0x271F, r24 + 40e2: 90 93 20 27 sts 0x2720, r25 + 40e6: 08 95 ret + Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; + USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; + + if (Address & ENDPOINT_DIR_IN) + { + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; + 40e8: 2e 5b subi r18, 0xBE ; 190 + 40ea: 3f 4f sbci r19, 0xFF ; 255 + 40ec: 20 93 1d 27 sts 0x271D, r18 + 40f0: 30 93 1e 27 sts 0x271E, r19 + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; + 40f4: 62 95 swap r22 + 40f6: 72 95 swap r23 + 40f8: 70 7f andi r23, 0xF0 ; 240 + 40fa: 76 27 eor r23, r22 + 40fc: 60 7f andi r22, 0xF0 ; 240 + 40fe: 76 27 eor r23, r22 + 4100: 68 5f subi r22, 0xF8 ; 248 + 4102: 7f 4f sbci r23, 0xFF ; 255 + 4104: 64 0f add r22, r20 + 4106: 75 1f adc r23, r21 + 4108: 60 93 1f 27 sts 0x271F, r22 + 410c: 70 93 20 27 sts 0x2720, r23 + 4110: 08 95 ret + +00004112 : + USB_Endpoint_SelectedFIFO->Position = 0; +} + +void Endpoint_StallTransaction(void) +{ + USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; + 4112: e0 91 1f 27 lds r30, 0x271F + 4116: f0 91 20 27 lds r31, 0x2720 + 411a: 81 81 ldd r24, Z+1 ; 0x01 + 411c: 84 60 ori r24, 0x04 ; 4 + 411e: 81 83 std Z+1, r24 ; 0x01 + + if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc) + 4120: e0 91 1f 27 lds r30, 0x271F + 4124: f0 91 20 27 lds r31, 0x2720 + 4128: 81 81 ldd r24, Z+1 ; 0x01 + 412a: 80 7c andi r24, 0xC0 ; 192 + 412c: 80 34 cpi r24, 0x40 ; 64 + 412e: 09 f0 breq .+2 ; 0x4132 + 4130: 08 95 ret + { + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN); + 4132: 80 91 21 27 lds r24, 0x2721 + 4136: 80 58 subi r24, 0x80 ; 128 + 4138: b3 df rcall .-154 ; 0x40a0 + USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; + 413a: e0 91 1f 27 lds r30, 0x271F + 413e: f0 91 20 27 lds r31, 0x2720 + 4142: 81 81 ldd r24, Z+1 ; 0x01 + 4144: 84 60 ori r24, 0x04 ; 4 + 4146: 81 83 std Z+1, r24 ; 0x01 + 4148: 08 95 ret + +0000414a : + return false; +} + +void Endpoint_ClearSETUP(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); + 414a: 80 91 21 27 lds r24, 0x2721 + 414e: 8f 77 andi r24, 0x7F ; 127 + 4150: a7 df rcall .-178 ; 0x40a0 + USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); + 4152: e0 91 1f 27 lds r30, 0x271F + 4156: f0 91 20 27 lds r31, 0x2720 + 415a: 80 81 ld r24, Z + 415c: 8d 78 andi r24, 0x8D ; 141 + 415e: 80 83 st Z, r24 + USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; + 4160: e0 91 1f 27 lds r30, 0x271F + 4164: f0 91 20 27 lds r31, 0x2720 + 4168: 80 81 ld r24, Z + 416a: 81 60 ori r24, 0x01 ; 1 + 416c: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 416e: e0 91 1d 27 lds r30, 0x271D + 4172: f0 91 1e 27 lds r31, 0x271E + 4176: ef 5b subi r30, 0xBF ; 191 + 4178: ff 4f sbci r31, 0xFF ; 255 + 417a: 10 82 st Z, r1 + + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); + 417c: 80 91 21 27 lds r24, 0x2721 + 4180: 80 68 ori r24, 0x80 ; 128 + 4182: 8e df rcall .-228 ; 0x40a0 + USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; + 4184: e0 91 1f 27 lds r30, 0x271F + 4188: f0 91 20 27 lds r31, 0x2720 + 418c: 80 81 ld r24, Z + 418e: 81 60 ori r24, 0x01 ; 1 + 4190: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 4192: e0 91 1d 27 lds r30, 0x271D + 4196: f0 91 1e 27 lds r31, 0x271E + 419a: ef 5b subi r30, 0xBF ; 191 + 419c: ff 4f sbci r31, 0xFF ; 255 + 419e: 10 82 st Z, r1 + 41a0: 08 95 ret + +000041a2 : + return false; +} + +bool Endpoint_IsSETUPReceived(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); + 41a2: 80 91 21 27 lds r24, 0x2721 + 41a6: 8f 77 andi r24, 0x7F ; 127 + 41a8: 7b df rcall .-266 ; 0x40a0 + + if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_SETUP_bm) + 41aa: e0 91 1f 27 lds r30, 0x271F + 41ae: f0 91 20 27 lds r31, 0x2720 + 41b2: 80 81 ld r24, Z + 41b4: 84 ff sbrs r24, 4 + 41b6: 0c c0 rjmp .+24 ; 0x41d0 + { + USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; + 41b8: 20 91 1d 27 lds r18, 0x271D + 41bc: 30 91 1e 27 lds r19, 0x271E + 41c0: 82 81 ldd r24, Z+2 ; 0x02 + 41c2: 93 81 ldd r25, Z+3 ; 0x03 + 41c4: f9 01 movw r30, r18 + 41c6: e0 5c subi r30, 0xC0 ; 192 + 41c8: ff 4f sbci r31, 0xFF ; 255 + 41ca: 80 83 st Z, r24 + return true; + 41cc: 81 e0 ldi r24, 0x01 ; 1 + 41ce: 08 95 ret + } + + return false; + 41d0: 80 e0 ldi r24, 0x00 ; 0 +} + 41d2: 08 95 ret + +000041d4 : + return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); +} + +bool Endpoint_IsOUTReceived(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); + 41d4: 80 91 21 27 lds r24, 0x2721 + 41d8: 8f 77 andi r24, 0x7F ; 127 + 41da: 62 df rcall .-316 ; 0x40a0 + + if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_TRNCOMPL0_bm) + 41dc: e0 91 1f 27 lds r30, 0x271F + 41e0: f0 91 20 27 lds r31, 0x2720 + 41e4: 80 81 ld r24, Z + 41e6: 85 ff sbrs r24, 5 + 41e8: 0c c0 rjmp .+24 ; 0x4202 + { + USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; + 41ea: 20 91 1d 27 lds r18, 0x271D + 41ee: 30 91 1e 27 lds r19, 0x271E + 41f2: 82 81 ldd r24, Z+2 ; 0x02 + 41f4: 93 81 ldd r25, Z+3 ; 0x03 + 41f6: f9 01 movw r30, r18 + 41f8: e0 5c subi r30, 0xC0 ; 192 + 41fa: ff 4f sbci r31, 0xFF ; 255 + 41fc: 80 83 st Z, r24 + return true; + 41fe: 81 e0 ldi r24, 0x01 ; 1 + 4200: 08 95 ret + } + + return false; + 4202: 80 e0 ldi r24, 0x00 ; 0 +} + 4204: 08 95 ret + +00004206 : +volatile USB_EP_t* USB_Endpoint_SelectedHandle; +volatile Endpoint_FIFO_t* USB_Endpoint_SelectedFIFO; + +bool Endpoint_IsINReady(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); + 4206: 80 91 21 27 lds r24, 0x2721 + 420a: 80 68 ori r24, 0x80 ; 128 + 420c: 49 df rcall .-366 ; 0x40a0 + + return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); + 420e: e0 91 1f 27 lds r30, 0x271F + 4212: f0 91 20 27 lds r31, 0x2720 + 4216: 80 81 ld r24, Z +} + 4218: 86 95 lsr r24 + 421a: 81 70 andi r24, 0x01 ; 1 + 421c: 08 95 ret + +0000421e : +} + +bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address, + const uint8_t Config, + const uint8_t Size) +{ + 421e: 1f 93 push r17 + 4220: cf 93 push r28 + 4222: df 93 push r29 + 4224: 00 d0 rcall .+0 ; 0x4226 + 4226: cd b7 in r28, 0x3d ; 61 + 4228: de b7 in r29, 0x3e ; 62 + 422a: 18 2f mov r17, r24 + Endpoint_SelectEndpoint(Address); + 422c: 4a 83 std Y+2, r20 ; 0x02 + 422e: 69 83 std Y+1, r22 ; 0x01 + 4230: 37 df rcall .-402 ; 0x40a0 + + USB_Endpoint_SelectedHandle->CTRL = 0; + 4232: e0 91 1f 27 lds r30, 0x271F + 4236: f0 91 20 27 lds r31, 0x2720 + 423a: 11 82 std Z+1, r1 ; 0x01 + USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; + 423c: e0 91 1f 27 lds r30, 0x271F + 4240: f0 91 20 27 lds r31, 0x2720 + 4244: 4a 81 ldd r20, Y+2 ; 0x02 + 4246: 69 81 ldd r22, Y+1 ; 0x01 + 4248: 17 fd sbrc r17, 7 + 424a: 22 c0 rjmp .+68 ; 0x4290 + 424c: 10 82 st Z, r1 + USB_Endpoint_SelectedHandle->CTRL = Config; + 424e: e0 91 1f 27 lds r30, 0x271F + 4252: f0 91 20 27 lds r31, 0x2720 + 4256: 61 83 std Z+1, r22 ; 0x01 + USB_Endpoint_SelectedHandle->CNT = 0; + 4258: e0 91 1f 27 lds r30, 0x271F + 425c: f0 91 20 27 lds r31, 0x2720 + 4260: 12 82 std Z+2, r1 ; 0x02 + 4262: 13 82 std Z+3, r1 ; 0x03 + USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; + 4264: 80 91 1d 27 lds r24, 0x271D + 4268: 90 91 1e 27 lds r25, 0x271E + 426c: 84 83 std Z+4, r24 ; 0x04 + 426e: 95 83 std Z+5, r25 ; 0x05 + + USB_Endpoint_SelectedFIFO->Length = (Address & ENDPOINT_DIR_IN) ? Size : 0; + 4270: 40 e0 ldi r20, 0x00 ; 0 + 4272: fc 01 movw r30, r24 + 4274: e0 5c subi r30, 0xC0 ; 192 + 4276: ff 4f sbci r31, 0xFF ; 255 + 4278: 40 83 st Z, r20 + USB_Endpoint_SelectedFIFO->Position = 0; + 427a: fc 01 movw r30, r24 + 427c: ef 5b subi r30, 0xBF ; 191 + 427e: ff 4f sbci r31, 0xFF ; 255 + 4280: 10 82 st Z, r1 + + return true; +} + 4282: 81 e0 ldi r24, 0x01 ; 1 + 4284: 0f 90 pop r0 + 4286: 0f 90 pop r0 + 4288: df 91 pop r29 + 428a: cf 91 pop r28 + 428c: 1f 91 pop r17 + 428e: 08 95 ret + const uint8_t Size) +{ + Endpoint_SelectEndpoint(Address); + + USB_Endpoint_SelectedHandle->CTRL = 0; + USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; + 4290: 82 e0 ldi r24, 0x02 ; 2 + 4292: 80 83 st Z, r24 + USB_Endpoint_SelectedHandle->CTRL = Config; + 4294: e0 91 1f 27 lds r30, 0x271F + 4298: f0 91 20 27 lds r31, 0x2720 + 429c: 61 83 std Z+1, r22 ; 0x01 + USB_Endpoint_SelectedHandle->CNT = 0; + 429e: e0 91 1f 27 lds r30, 0x271F + 42a2: f0 91 20 27 lds r31, 0x2720 + 42a6: 12 82 std Z+2, r1 ; 0x02 + 42a8: 13 82 std Z+3, r1 ; 0x03 + USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; + 42aa: 80 91 1d 27 lds r24, 0x271D + 42ae: 90 91 1e 27 lds r25, 0x271E + 42b2: 84 83 std Z+4, r24 ; 0x04 + 42b4: 95 83 std Z+5, r25 ; 0x05 + 42b6: dd cf rjmp .-70 ; 0x4272 + +000042b8 : + } +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + const uint8_t Entries) +{ + 42b8: af 92 push r10 + 42ba: bf 92 push r11 + 42bc: df 92 push r13 + 42be: ef 92 push r14 + 42c0: ff 92 push r15 + 42c2: 0f 93 push r16 + 42c4: 1f 93 push r17 + 42c6: cf 93 push r28 + 42c8: df 93 push r29 + 42ca: 00 d0 rcall .+0 ; 0x42cc + 42cc: cd b7 in r28, 0x3d ; 61 + 42ce: de b7 in r29, 0x3e ; 62 + 42d0: e6 2e mov r14, r22 + for (uint8_t i = 0; i < Entries; i++) + 42d2: 66 23 and r22, r22 + 42d4: 09 f4 brne .+2 ; 0x42d8 + 42d6: 4a c0 rjmp .+148 ; 0x436c + 42d8: 5c 01 movw r10, r24 + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; + } +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + 42da: 8c 01 movw r16, r24 + 42dc: 0c 5f subi r16, 0xFC ; 252 + 42de: 1f 4f sbci r17, 0xFF ; 255 + const uint8_t Entries) +{ + for (uint8_t i = 0; i < Entries; i++) + 42e0: f1 2c mov r15, r1 + { + if (!(Table[i].Address)) + 42e2: d5 01 movw r26, r10 + 42e4: 5c 91 ld r21, X + 42e6: 55 23 and r21, r21 + 42e8: c9 f1 breq .+114 ; 0x435c + continue; + + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) + 42ea: d5 01 movw r26, r10 + 42ec: 11 96 adiw r26, 0x01 ; 1 + 42ee: ed 91 ld r30, X+ + 42f0: fc 91 ld r31, X + 42f2: 12 97 sbiw r26, 0x02 ; 2 + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; + } +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + 42f4: d8 01 movw r26, r16 + 42f6: 11 97 sbiw r26, 0x01 ; 1 + for (uint8_t i = 0; i < Entries; i++) + { if (!(Table[i].Address)) continue; if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) - { - return false; - 3ff4: 80 e0 ldi r24, 0x00 ; 0 - 3ff6: f2 cf rjmp .-28 ; 0x3fdc + 42f8: 4c 91 ld r20, X static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address, const uint8_t Type, const uint16_t Size, const uint8_t Banks) { uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); - 3ff8: 98 e0 ldi r25, 0x08 ; 8 - 3ffa: 88 e0 ldi r24, 0x08 ; 8 - 3ffc: bc cf rjmp .-136 ; 0x3f76 + 42fa: d8 01 movw r26, r16 + 42fc: 8c 91 ld r24, X + 42fe: 82 30 cpi r24, 0x02 ; 2 + 4300: 08 f4 brcc .+2 ; 0x4304 + 4302: 43 c0 rjmp .+134 ; 0x438a + 4304: 98 e1 ldi r25, 0x18 ; 24 + 4306: 88 e1 ldi r24, 0x18 ; 24 + static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) + { + uint8_t MaskVal = 0; + uint16_t CheckBytes = 8; + + while (CheckBytes < Bytes) + 4308: e9 30 cpi r30, 0x09 ; 9 + 430a: f1 05 cpc r31, r1 + 430c: 50 f0 brcs .+20 ; 0x4322 + 430e: 28 e0 ldi r18, 0x08 ; 8 + 4310: 30 e0 ldi r19, 0x00 ; 0 + 4312: 90 e0 ldi r25, 0x00 ; 0 + { + MaskVal++; + 4314: 9f 5f subi r25, 0xFF ; 255 + CheckBytes <<= 1; + 4316: 22 0f add r18, r18 + 4318: 33 1f adc r19, r19 + static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) + { + uint8_t MaskVal = 0; + uint16_t CheckBytes = 8; + + while (CheckBytes < Bytes) + 431a: 2e 17 cp r18, r30 + 431c: 3f 07 cpc r19, r31 + 431e: d0 f3 brcs .-12 ; 0x4314 + 4320: 98 2b or r25, r24 + const uint16_t Size, + const uint8_t Banks) + { + uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); + + if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) + 4322: 25 2f mov r18, r21 + 4324: 2f 70 andi r18, 0x0F ; 15 + 4326: 30 e0 ldi r19, 0x00 ; 0 + 4328: 26 30 cpi r18, 0x06 ; 6 + 432a: 31 05 cpc r19, r1 + 432c: 64 f5 brge .+88 ; 0x4386 + return false; + + // TODO - Fix once limitations are lifted + EPConfigMask &= ~USB_EP_PINGPONG_bm; + if (Size > 64) + 432e: e1 34 cpi r30, 0x41 ; 65 + 4330: f1 05 cpc r31, r1 + 4332: 48 f5 brcc .+82 ; 0x4386 + + if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) + return false; + + // TODO - Fix once limitations are lifted + EPConfigMask &= ~USB_EP_PINGPONG_bm; + 4334: 9f 7e andi r25, 0xEF ; 239 + if (Size > 64) + return false; + + switch (Type) + 4336: 41 11 cpse r20, r1 + 4338: 2b c0 rjmp .+86 ; 0x4390 + { + case EP_TYPE_CONTROL: + EPConfigMask |= USB_EP_TYPE_CONTROL_gc; + 433a: 90 64 ori r25, 0x40 ; 64 + EPConfigMask |= USB_EP_TYPE_BULK_gc; + break; + } + + if (Type == EP_TYPE_CONTROL) + Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); + 433c: de 2e mov r13, r30 + 433e: 4e 2f mov r20, r30 + 4340: 69 2f mov r22, r25 + 4342: 85 2f mov r24, r21 + 4344: 80 58 subi r24, 0x80 ; 128 + 4346: 59 83 std Y+1, r21 ; 0x01 + 4348: 9a 83 std Y+2, r25 ; 0x02 + 434a: 69 df rcall .-302 ; 0x421e + 434c: 9a 81 ldd r25, Y+2 ; 0x02 + 434e: 59 81 ldd r21, Y+1 ; 0x01 + + return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); + 4350: 4d 2d mov r20, r13 + 4352: 69 2f mov r22, r25 + 4354: 85 2f mov r24, r21 + 4356: 63 df rcall .-314 ; 0x421e + 4358: 88 23 and r24, r24 + 435a: a9 f0 breq .+42 ; 0x4386 +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + const uint8_t Entries) +{ + for (uint8_t i = 0; i < Entries; i++) + 435c: f3 94 inc r15 + 435e: b5 e0 ldi r27, 0x05 ; 5 + 4360: ab 0e add r10, r27 + 4362: b1 1c adc r11, r1 + 4364: 0b 5f subi r16, 0xFB ; 251 + 4366: 1f 4f sbci r17, 0xFF ; 255 + 4368: fe 10 cpse r15, r14 + 436a: bb cf rjmp .-138 ; 0x42e2 + { + return false; + } + } + + return true; + 436c: 81 e0 ldi r24, 0x01 ; 1 +} + 436e: 0f 90 pop r0 + 4370: 0f 90 pop r0 + 4372: df 91 pop r29 + 4374: cf 91 pop r28 + 4376: 1f 91 pop r17 + 4378: 0f 91 pop r16 + 437a: ff 90 pop r15 + 437c: ef 90 pop r14 + 437e: df 90 pop r13 + 4380: bf 90 pop r11 + 4382: af 90 pop r10 + 4384: 08 95 ret + if (!(Table[i].Address)) + continue; + + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) + { + return false; + 4386: 80 e0 ldi r24, 0x00 ; 0 + 4388: f2 cf rjmp .-28 ; 0x436e + static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address, + const uint8_t Type, + const uint16_t Size, + const uint8_t Banks) + { + uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); + 438a: 98 e0 ldi r25, 0x08 ; 8 + 438c: 88 e0 ldi r24, 0x08 ; 8 + 438e: bc cf rjmp .-136 ; 0x4308 // TODO - Fix once limitations are lifted EPConfigMask &= ~USB_EP_PINGPONG_bm; if (Size > 64) return false; switch (Type) - 3ffe: 41 30 cpi r20, 0x01 ; 1 - 4000: 29 f0 breq .+10 ; 0x400c + 4390: 41 30 cpi r20, 0x01 ; 1 + 4392: 29 f0 breq .+10 ; 0x439e break; case EP_TYPE_ISOCHRONOUS: EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; break; default: EPConfigMask |= USB_EP_TYPE_BULK_gc; - 4002: 90 68 ori r25, 0x80 ; 128 + 4394: 90 68 ori r25, 0x80 ; 128 break; } if (Type == EP_TYPE_CONTROL) - 4004: 44 23 and r20, r20 - 4006: 89 f2 breq .-94 ; 0x3faa - 4008: de 2e mov r13, r30 - 400a: d9 cf rjmp .-78 ; 0x3fbe + 4396: 44 23 and r20, r20 + 4398: 89 f2 breq .-94 ; 0x433c + 439a: de 2e mov r13, r30 + 439c: d9 cf rjmp .-78 ; 0x4350 { case EP_TYPE_CONTROL: EPConfigMask |= USB_EP_TYPE_CONTROL_gc; break; case EP_TYPE_ISOCHRONOUS: EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; - 400c: 90 6c ori r25, 0xC0 ; 192 - 400e: de 2e mov r13, r30 - 4010: d6 cf rjmp .-84 ; 0x3fbe + 439e: 90 6c ori r25, 0xC0 ; 192 + 43a0: de 2e mov r13, r30 + 43a2: d6 cf rjmp .-84 ; 0x4350 -00004012 : +000043a4 : void Endpoint_ClearEndpoints(void) { for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) { ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4012: e0 ec ldi r30, 0xC0 ; 192 - 4014: f4 e0 ldi r31, 0x04 ; 4 - 4016: a6 81 ldd r26, Z+6 ; 0x06 - 4018: b7 81 ldd r27, Z+7 ; 0x07 - 401a: 19 96 adiw r26, 0x09 ; 9 - 401c: 1c 92 st X, r1 + 43a4: e0 ec ldi r30, 0xC0 ; 192 + 43a6: f4 e0 ldi r31, 0x04 ; 4 + 43a8: a6 81 ldd r26, Z+6 ; 0x06 + 43aa: b7 81 ldd r27, Z+7 ; 0x07 + 43ac: 19 96 adiw r26, 0x09 ; 9 + 43ae: 1c 92 st X, r1 ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 401e: a6 81 ldd r26, Z+6 ; 0x06 - 4020: b7 81 ldd r27, Z+7 ; 0x07 - 4022: 11 96 adiw r26, 0x01 ; 1 - 4024: 1c 92 st X, r1 + 43b0: a6 81 ldd r26, Z+6 ; 0x06 + 43b2: b7 81 ldd r27, Z+7 ; 0x07 + 43b4: 11 96 adiw r26, 0x01 ; 1 + 43b6: 1c 92 st X, r1 void Endpoint_ClearEndpoints(void) { for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) { ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4026: a6 81 ldd r26, Z+6 ; 0x06 - 4028: b7 81 ldd r27, Z+7 ; 0x07 - 402a: 59 96 adiw r26, 0x19 ; 25 - 402c: 1c 92 st X, r1 + 43b8: a6 81 ldd r26, Z+6 ; 0x06 + 43ba: b7 81 ldd r27, Z+7 ; 0x07 + 43bc: 59 96 adiw r26, 0x19 ; 25 + 43be: 1c 92 st X, r1 ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 402e: a6 81 ldd r26, Z+6 ; 0x06 - 4030: b7 81 ldd r27, Z+7 ; 0x07 - 4032: 51 96 adiw r26, 0x11 ; 17 - 4034: 1c 92 st X, r1 + 43c0: a6 81 ldd r26, Z+6 ; 0x06 + 43c2: b7 81 ldd r27, Z+7 ; 0x07 + 43c4: 51 96 adiw r26, 0x11 ; 17 + 43c6: 1c 92 st X, r1 void Endpoint_ClearEndpoints(void) { for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) { ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4036: a6 81 ldd r26, Z+6 ; 0x06 - 4038: b7 81 ldd r27, Z+7 ; 0x07 - 403a: 99 96 adiw r26, 0x29 ; 41 - 403c: 1c 92 st X, r1 + 43c8: a6 81 ldd r26, Z+6 ; 0x06 + 43ca: b7 81 ldd r27, Z+7 ; 0x07 + 43cc: 99 96 adiw r26, 0x29 ; 41 + 43ce: 1c 92 st X, r1 ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 403e: a6 81 ldd r26, Z+6 ; 0x06 - 4040: b7 81 ldd r27, Z+7 ; 0x07 - 4042: 91 96 adiw r26, 0x21 ; 33 - 4044: 1c 92 st X, r1 + 43d0: a6 81 ldd r26, Z+6 ; 0x06 + 43d2: b7 81 ldd r27, Z+7 ; 0x07 + 43d4: 91 96 adiw r26, 0x21 ; 33 + 43d6: 1c 92 st X, r1 void Endpoint_ClearEndpoints(void) { for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) { ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4046: a6 81 ldd r26, Z+6 ; 0x06 - 4048: b7 81 ldd r27, Z+7 ; 0x07 - 404a: d9 96 adiw r26, 0x39 ; 57 - 404c: 1c 92 st X, r1 + 43d8: a6 81 ldd r26, Z+6 ; 0x06 + 43da: b7 81 ldd r27, Z+7 ; 0x07 + 43dc: d9 96 adiw r26, 0x39 ; 57 + 43de: 1c 92 st X, r1 ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 404e: a6 81 ldd r26, Z+6 ; 0x06 - 4050: b7 81 ldd r27, Z+7 ; 0x07 - 4052: d1 96 adiw r26, 0x31 ; 49 - 4054: 1c 92 st X, r1 + 43e0: a6 81 ldd r26, Z+6 ; 0x06 + 43e2: b7 81 ldd r27, Z+7 ; 0x07 + 43e4: d1 96 adiw r26, 0x31 ; 49 + 43e6: 1c 92 st X, r1 void Endpoint_ClearEndpoints(void) { for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) { ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4056: a6 81 ldd r26, Z+6 ; 0x06 - 4058: b7 81 ldd r27, Z+7 ; 0x07 - 405a: a7 5b subi r26, 0xB7 ; 183 - 405c: bf 4f sbci r27, 0xFF ; 255 - 405e: 1c 92 st X, r1 + 43e8: a6 81 ldd r26, Z+6 ; 0x06 + 43ea: b7 81 ldd r27, Z+7 ; 0x07 + 43ec: a7 5b subi r26, 0xB7 ; 183 + 43ee: bf 4f sbci r27, 0xFF ; 255 + 43f0: 1c 92 st X, r1 ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4060: a6 81 ldd r26, Z+6 ; 0x06 - 4062: b7 81 ldd r27, Z+7 ; 0x07 - 4064: af 5b subi r26, 0xBF ; 191 - 4066: bf 4f sbci r27, 0xFF ; 255 - 4068: 1c 92 st X, r1 + 43f2: a6 81 ldd r26, Z+6 ; 0x06 + 43f4: b7 81 ldd r27, Z+7 ; 0x07 + 43f6: af 5b subi r26, 0xBF ; 191 + 43f8: bf 4f sbci r27, 0xFF ; 255 + 43fa: 1c 92 st X, r1 void Endpoint_ClearEndpoints(void) { for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) { ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 406a: a6 81 ldd r26, Z+6 ; 0x06 - 406c: b7 81 ldd r27, Z+7 ; 0x07 - 406e: a7 5a subi r26, 0xA7 ; 167 - 4070: bf 4f sbci r27, 0xFF ; 255 - 4072: 1c 92 st X, r1 + 43fc: a6 81 ldd r26, Z+6 ; 0x06 + 43fe: b7 81 ldd r27, Z+7 ; 0x07 + 4400: a7 5a subi r26, 0xA7 ; 167 + 4402: bf 4f sbci r27, 0xFF ; 255 + 4404: 1c 92 st X, r1 ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4074: 06 80 ldd r0, Z+6 ; 0x06 - 4076: f7 81 ldd r31, Z+7 ; 0x07 - 4078: e0 2d mov r30, r0 - 407a: ef 5a subi r30, 0xAF ; 175 - 407c: ff 4f sbci r31, 0xFF ; 255 - 407e: 10 82 st Z, r1 - 4080: 08 95 ret + 4406: 06 80 ldd r0, Z+6 ; 0x06 + 4408: f7 81 ldd r31, Z+7 ; 0x07 + 440a: e0 2d mov r30, r0 + 440c: ef 5a subi r30, 0xAF ; 175 + 440e: ff 4f sbci r31, 0xFF ; 255 + 4410: 10 82 st Z, r1 + 4412: 08 95 ret -00004082 : +00004414 : } } void Endpoint_ClearStatusStage(void) { if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) - 4082: 80 91 15 23 lds r24, 0x2315 - 4086: 87 fd sbrc r24, 7 - 4088: 08 c0 rjmp .+16 ; 0x409a + 4414: 80 91 15 27 lds r24, 0x2715 + 4418: 87 fd sbrc r24, 7 + 441a: 08 c0 rjmp .+16 ; 0x442c Endpoint_ClearOUT(); } else { while (!(Endpoint_IsINReady())) - 408a: f4 de rcall .-536 ; 0x3e74 - 408c: 81 11 cpse r24, r1 - 408e: 0d c0 rjmp .+26 ; 0x40aa + 441c: f4 de rcall .-536 ; 0x4206 + 441e: 81 11 cpse r24, r1 + 4420: 0d c0 rjmp .+26 ; 0x443c { if (USB_DeviceState == DEVICE_STATE_Unattached) - 4090: 80 91 14 23 lds r24, 0x2314 - 4094: 81 11 cpse r24, r1 - 4096: f9 cf rjmp .-14 ; 0x408a - 4098: 08 95 ret + 4422: 80 91 14 27 lds r24, 0x2714 + 4426: 81 11 cpse r24, r1 + 4428: f9 cf rjmp .-14 ; 0x441c + 442a: 08 95 ret void Endpoint_ClearStatusStage(void) { if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) { while (!(Endpoint_IsOUTReceived())) - 409a: d3 de rcall .-602 ; 0x3e42 - 409c: 81 11 cpse r24, r1 - 409e: 06 c0 rjmp .+12 ; 0x40ac + 442c: d3 de rcall .-602 ; 0x41d4 + 442e: 81 11 cpse r24, r1 + 4430: 06 c0 rjmp .+12 ; 0x443e { if (USB_DeviceState == DEVICE_STATE_Unattached) - 40a0: 80 91 14 23 lds r24, 0x2314 - 40a4: 81 11 cpse r24, r1 - 40a6: f9 cf rjmp .-14 ; 0x409a - 40a8: 08 95 ret + 4432: 80 91 14 27 lds r24, 0x2714 + 4436: 81 11 cpse r24, r1 + 4438: f9 cf rjmp .-14 ; 0x442c + 443a: 08 95 ret { if (USB_DeviceState == DEVICE_STATE_Unattached) return; } Endpoint_ClearIN(); - 40aa: eb cd rjmp .-1066 ; 0x3c82 + 443c: eb cd rjmp .-1066 ; 0x4014 { if (USB_DeviceState == DEVICE_STATE_Unattached) return; } Endpoint_ClearOUT(); - 40ac: 03 ce rjmp .-1018 ; 0x3cb4 + 443e: 03 ce rjmp .-1018 ; 0x4046 -000040ae : +00004440 : } } #if !defined(CONTROL_ONLY_DEVICE) uint8_t Endpoint_WaitUntilReady(void) { - 40ae: 1f 93 push r17 - 40b0: cf 93 push r28 - 40b2: df 93 push r29 + 4440: 1f 93 push r17 + 4442: cf 93 push r28 + 4444: df 93 push r29 * \return Current USB frame number from the USB controller. */ static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; static inline uint16_t USB_Device_GetFrameNumber(void) { return ((USB_EndpointTable_t*)USB.EPPTR)->FrameNum; - 40b4: e0 91 c6 04 lds r30, 0x04C6 - 40b8: f0 91 c7 04 lds r31, 0x04C7 - 40bc: e0 5a subi r30, 0xA0 ; 160 - 40be: ff 4f sbci r31, 0xFF ; 255 - 40c0: c0 81 ld r28, Z - 40c2: d1 81 ldd r29, Z+1 ; 0x01 + 4446: e0 91 c6 04 lds r30, 0x04C6 + 444a: f0 91 c7 04 lds r31, 0x04C7 + 444e: e0 5a subi r30, 0xA0 ; 160 + 4450: ff 4f sbci r31, 0xFF ; 255 + 4452: c0 81 ld r28, Z + 4454: d1 81 ldd r29, Z+1 ; 0x01 #if (USB_STREAM_TIMEOUT_MS < 0xFF) uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS; - 40c4: 14 e6 ldi r17, 0x64 ; 100 + 4456: 14 e6 ldi r17, 0x64 ; 100 * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask. */ static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Endpoint_GetEndpointDirection(void) { return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN); - 40c6: 80 91 21 23 lds r24, 0x2321 - 40ca: 80 78 andi r24, 0x80 ; 128 + 4458: 80 91 21 27 lds r24, 0x2721 + 445c: 80 78 andi r24, 0x80 ; 128 uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); for (;;) { if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) - 40cc: 80 38 cpi r24, 0x80 ; 128 - 40ce: 31 f1 breq .+76 ; 0x411c + 445e: 80 38 cpi r24, 0x80 ; 128 + 4460: 31 f1 breq .+76 ; 0x44ae if (Endpoint_IsINReady()) return ENDPOINT_READYWAIT_NoError; } else { if (Endpoint_IsOUTReceived()) - 40d0: b8 de rcall .-656 ; 0x3e42 - 40d2: 81 11 cpse r24, r1 - 40d4: 26 c0 rjmp .+76 ; 0x4122 + 4462: b8 de rcall .-656 ; 0x41d4 + 4464: 81 11 cpse r24, r1 + 4466: 26 c0 rjmp .+76 ; 0x44b4 return ENDPOINT_READYWAIT_NoError; } uint8_t USB_DeviceState_LCL = USB_DeviceState; - 40d6: 80 91 14 23 lds r24, 0x2314 + 4468: 80 91 14 27 lds r24, 0x2714 if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 40da: 88 23 and r24, r24 - 40dc: 39 f1 breq .+78 ; 0x412c + 446c: 88 23 and r24, r24 + 446e: 39 f1 breq .+78 ; 0x44be return ENDPOINT_READYWAIT_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 40de: 85 30 cpi r24, 0x05 ; 5 - 40e0: 51 f1 breq .+84 ; 0x4136 + 4470: 85 30 cpi r24, 0x05 ; 5 + 4472: 51 f1 breq .+84 ; 0x44c8 * \return Boolean \c true if the currently selected endpoint is stalled, \c false otherwise. */ static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline bool Endpoint_IsStalled(void) { return ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_STALL_bm) ? true : false); - 40e2: e0 91 1f 23 lds r30, 0x231F - 40e6: f0 91 20 23 lds r31, 0x2320 - 40ea: 81 81 ldd r24, Z+1 ; 0x01 + 4474: e0 91 1f 27 lds r30, 0x271F + 4478: f0 91 20 27 lds r31, 0x2720 + 447c: 81 81 ldd r24, Z+1 ; 0x01 return ENDPOINT_READYWAIT_BusSuspended; else if (Endpoint_IsStalled()) - 40ec: 82 fd sbrc r24, 2 - 40ee: 28 c0 rjmp .+80 ; 0x4140 - 40f0: e0 91 c6 04 lds r30, 0x04C6 - 40f4: f0 91 c7 04 lds r31, 0x04C7 - 40f8: e0 5a subi r30, 0xA0 ; 160 - 40fa: ff 4f sbci r31, 0xFF ; 255 - 40fc: 80 81 ld r24, Z - 40fe: 91 81 ldd r25, Z+1 ; 0x01 + 447e: 82 fd sbrc r24, 2 + 4480: 28 c0 rjmp .+80 ; 0x44d2 + 4482: e0 91 c6 04 lds r30, 0x04C6 + 4486: f0 91 c7 04 lds r31, 0x04C7 + 448a: e0 5a subi r30, 0xA0 ; 160 + 448c: ff 4f sbci r31, 0xFF ; 255 + 448e: 80 81 ld r24, Z + 4490: 91 81 ldd r25, Z+1 ; 0x01 return ENDPOINT_READYWAIT_EndpointStalled; uint16_t CurrentFrameNumber = USB_Device_GetFrameNumber(); if (CurrentFrameNumber != PreviousFrameNumber) - 4100: c8 17 cp r28, r24 - 4102: d9 07 cpc r29, r25 - 4104: 01 f3 breq .-64 ; 0x40c6 + 4492: c8 17 cp r28, r24 + 4494: d9 07 cpc r29, r25 + 4496: 01 f3 breq .-64 ; 0x4458 { PreviousFrameNumber = CurrentFrameNumber; if (!(TimeoutMSRem--)) - 4106: 21 2f mov r18, r17 - 4108: 21 50 subi r18, 0x01 ; 1 - 410a: 11 23 and r17, r17 - 410c: f1 f0 breq .+60 ; 0x414a - 410e: ec 01 movw r28, r24 - 4110: 12 2f mov r17, r18 + 4498: 21 2f mov r18, r17 + 449a: 21 50 subi r18, 0x01 ; 1 + 449c: 11 23 and r17, r17 + 449e: f1 f0 breq .+60 ; 0x44dc + 44a0: ec 01 movw r28, r24 + 44a2: 12 2f mov r17, r18 * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask. */ static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Endpoint_GetEndpointDirection(void) { return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN); - 4112: 80 91 21 23 lds r24, 0x2321 - 4116: 80 78 andi r24, 0x80 ; 128 + 44a4: 80 91 21 27 lds r24, 0x2721 + 44a8: 80 78 andi r24, 0x80 ; 128 uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); for (;;) { if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) - 4118: 80 38 cpi r24, 0x80 ; 128 - 411a: d1 f6 brne .-76 ; 0x40d0 + 44aa: 80 38 cpi r24, 0x80 ; 128 + 44ac: d1 f6 brne .-76 ; 0x4462 { if (Endpoint_IsINReady()) - 411c: ab de rcall .-682 ; 0x3e74 - 411e: 88 23 and r24, r24 - 4120: d1 f2 breq .-76 ; 0x40d6 + 44ae: ab de rcall .-682 ; 0x4206 + 44b0: 88 23 and r24, r24 + 44b2: d1 f2 breq .-76 ; 0x4468 return ENDPOINT_READYWAIT_NoError; - 4122: 80 e0 ldi r24, 0x00 ; 0 + 44b4: 80 e0 ldi r24, 0x00 ; 0 if (!(TimeoutMSRem--)) return ENDPOINT_READYWAIT_Timeout; } } } - 4124: df 91 pop r29 - 4126: cf 91 pop r28 - 4128: 1f 91 pop r17 - 412a: 08 95 ret + 44b6: df 91 pop r29 + 44b8: cf 91 pop r28 + 44ba: 1f 91 pop r17 + 44bc: 08 95 ret } uint8_t USB_DeviceState_LCL = USB_DeviceState; if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) return ENDPOINT_READYWAIT_DeviceDisconnected; - 412c: 82 e0 ldi r24, 0x02 ; 2 + 44be: 82 e0 ldi r24, 0x02 ; 2 if (!(TimeoutMSRem--)) return ENDPOINT_READYWAIT_Timeout; } } } - 412e: df 91 pop r29 - 4130: cf 91 pop r28 - 4132: 1f 91 pop r17 - 4134: 08 95 ret + 44c0: df 91 pop r29 + 44c2: cf 91 pop r28 + 44c4: 1f 91 pop r17 + 44c6: 08 95 ret uint8_t USB_DeviceState_LCL = USB_DeviceState; if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) return ENDPOINT_READYWAIT_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_READYWAIT_BusSuspended; - 4136: 83 e0 ldi r24, 0x03 ; 3 + 44c8: 83 e0 ldi r24, 0x03 ; 3 if (!(TimeoutMSRem--)) return ENDPOINT_READYWAIT_Timeout; } } } - 4138: df 91 pop r29 - 413a: cf 91 pop r28 - 413c: 1f 91 pop r17 - 413e: 08 95 ret + 44ca: df 91 pop r29 + 44cc: cf 91 pop r28 + 44ce: 1f 91 pop r17 + 44d0: 08 95 ret if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) return ENDPOINT_READYWAIT_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_READYWAIT_BusSuspended; else if (Endpoint_IsStalled()) return ENDPOINT_READYWAIT_EndpointStalled; - 4140: 81 e0 ldi r24, 0x01 ; 1 + 44d2: 81 e0 ldi r24, 0x01 ; 1 if (!(TimeoutMSRem--)) return ENDPOINT_READYWAIT_Timeout; } } } - 4142: df 91 pop r29 - 4144: cf 91 pop r28 - 4146: 1f 91 pop r17 - 4148: 08 95 ret + 44d4: df 91 pop r29 + 44d6: cf 91 pop r28 + 44d8: 1f 91 pop r17 + 44da: 08 95 ret if (CurrentFrameNumber != PreviousFrameNumber) { PreviousFrameNumber = CurrentFrameNumber; if (!(TimeoutMSRem--)) return ENDPOINT_READYWAIT_Timeout; - 414a: 84 e0 ldi r24, 0x04 ; 4 + 44dc: 84 e0 ldi r24, 0x04 ; 4 } } } - 414c: df 91 pop r29 - 414e: cf 91 pop r28 - 4150: 1f 91 pop r17 - 4152: 08 95 ret + 44de: df 91 pop r29 + 44e0: cf 91 pop r28 + 44e2: 1f 91 pop r17 + 44e4: 08 95 ret -00004154 : +000044e6 : USB_ResetInterface(); } void USB_Disable(void) { USB_INT_DisableAllInterrupts(); - 4154: 63 d0 rcall .+198 ; 0x421c + 44e6: 63 d0 rcall .+198 ; 0x45ae USB_INT_ClearAllInterrupts(); - 4156: 69 d0 rcall .+210 ; 0x422a + 44e8: 69 d0 rcall .+210 ; 0x45bc * enumerating the device once attached until \ref USB_Attach() is called. */ static inline void USB_Detach(void) ATTR_ALWAYS_INLINE; static inline void USB_Detach(void) { USB.CTRLB &= ~USB_ATTACH_bm; - 4158: e0 ec ldi r30, 0xC0 ; 192 - 415a: f4 e0 ldi r31, 0x04 ; 4 - 415c: 81 81 ldd r24, Z+1 ; 0x01 - 415e: 8e 7f andi r24, 0xFE ; 254 - 4160: 81 83 std Z+1, r24 ; 0x01 + 44ea: e0 ec ldi r30, 0xC0 ; 192 + 44ec: f4 e0 ldi r31, 0x04 ; 4 + 44ee: 81 81 ldd r24, Z+1 ; 0x01 + 44f0: 8e 7f andi r24, 0xFE ; 254 + 44f2: 81 83 std Z+1, r24 ; 0x01 } static inline void USB_Controller_Disable(void) ATTR_ALWAYS_INLINE; static inline void USB_Controller_Disable(void) { USB.CTRLA &= ~USB_ENABLE_bm; - 4162: 80 81 ld r24, Z - 4164: 8f 77 andi r24, 0x7F ; 127 - 4166: 80 83 st Z, r24 + 44f4: 80 81 ld r24, Z + 44f6: 8f 77 andi r24, 0x7F ; 127 + 44f8: 80 83 st Z, r24 USB_Detach(); USB_Controller_Disable(); USB_IsInitialized = false; - 4168: 10 92 13 23 sts 0x2313, r1 - 416c: 08 95 ret + 44fa: 10 92 13 27 sts 0x2713, r1 + 44fe: 08 95 ret -0000416e : +00004500 : } void USB_ResetInterface(void) { - 416e: cf 93 push r28 - 4170: df 93 push r29 + 4500: cf 93 push r28 + 4502: df 93 push r29 #if defined(USB_DEVICE_OPT_FULLSPEED) if (USB_Options & USB_DEVICE_OPT_LOWSPEED) CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp); else CLK.USBCTRL = (((F_USB / 48000000) - 1) << CLK_USBPSDIV_gp); - 4172: e0 e4 ldi r30, 0x40 ; 64 - 4174: f0 e0 ldi r31, 0x00 ; 0 - 4176: 14 82 std Z+4, r1 ; 0x04 + 4504: e0 e4 ldi r30, 0x40 ; 64 + 4506: f0 e0 ldi r31, 0x00 ; 0 + 4508: 14 82 std Z+4, r1 ; 0x04 #else CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp); #endif if (USB_Options & USB_OPT_PLLCLKSRC) CLK.USBCTRL |= (CLK_USBSRC_PLL_gc | CLK_USBSEN_bm); - 4178: 84 81 ldd r24, Z+4 ; 0x04 - 417a: 81 60 ori r24, 0x01 ; 1 - 417c: 84 83 std Z+4, r24 ; 0x04 + 450a: 84 81 ldd r24, Z+4 ; 0x04 + 450c: 81 60 ori r24, 0x01 ; 1 + 450e: 84 83 std Z+4, r24 ; 0x04 else CLK.USBCTRL |= (CLK_USBSRC_RC32M_gc | CLK_USBSEN_bm); USB_Device_SetDeviceAddress(0); USB_INT_DisableAllInterrupts(); - 417e: 4e d0 rcall .+156 ; 0x421c + 4510: 4e d0 rcall .+156 ; 0x45ae USB_INT_ClearAllInterrupts(); - 4180: 54 d0 rcall .+168 ; 0x422a + 4512: 54 d0 rcall .+168 ; 0x45bc } static inline void USB_Controller_Reset(void) ATTR_ALWAYS_INLINE; static inline void USB_Controller_Reset(void) { USB.CTRLA &= ~USB_ENABLE_bm; - 4182: c0 ec ldi r28, 0xC0 ; 192 - 4184: d4 e0 ldi r29, 0x04 ; 4 - 4186: 88 81 ld r24, Y - 4188: 8f 77 andi r24, 0x7F ; 127 - 418a: 88 83 st Y, r24 + 4514: c0 ec ldi r28, 0xC0 ; 192 + 4516: d4 e0 ldi r29, 0x04 ; 4 + 4518: 88 81 ld r24, Y + 451a: 8f 77 andi r24, 0x7F ; 127 + 451c: 88 83 st Y, r24 USB.CTRLA |= USB_ENABLE_bm; - 418c: 88 81 ld r24, Y - 418e: 80 68 ori r24, 0x80 ; 128 - 4190: 88 83 st Y, r24 + 451e: 88 81 ld r24, Y + 4520: 80 68 ori r24, 0x80 ; 128 + 4522: 88 83 st Y, r24 } #if defined(USB_CAN_BE_DEVICE) static void USB_Init_Device(void) { USB_DeviceState = DEVICE_STATE_Unattached; - 4192: 10 92 14 23 sts 0x2314, r1 + 4524: 10 92 14 27 sts 0x2714, r1 USB_Device_ConfigurationNumber = 0; - 4196: 10 92 10 23 sts 0x2310, r1 + 4528: 10 92 10 27 sts 0x2710, r1 #if !defined(NO_DEVICE_REMOTE_WAKEUP) USB_Device_RemoteWakeupEnabled = false; - 419a: 10 92 12 23 sts 0x2312, r1 + 452c: 10 92 12 27 sts 0x2712, r1 #endif #if !defined(NO_DEVICE_SELF_POWER) USB_Device_CurrentlySelfPowered = false; - 419e: 10 92 11 23 sts 0x2311, r1 + 4530: 10 92 11 27 sts 0x2711, r1 } static inline void USB_Device_SetFullSpeed(void) ATTR_ALWAYS_INLINE; static inline void USB_Device_SetFullSpeed(void) { USB.CTRLA |= USB_SPEED_bm; - 41a2: 88 81 ld r24, Y - 41a4: 80 64 ori r24, 0x40 ; 64 - 41a6: 88 83 st Y, r24 + 4534: 88 81 ld r24, Y + 4536: 80 64 ori r24, 0x40 ; 64 + 4538: 88 83 st Y, r24 EPConfigMask |= USB_EP_TYPE_BULK_gc; break; } if (Type == EP_TYPE_CONTROL) Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 41a8: 48 e0 ldi r20, 0x08 ; 8 - 41aa: 68 e4 ldi r22, 0x48 ; 72 - 41ac: 80 e8 ldi r24, 0x80 ; 128 - 41ae: 6e de rcall .-804 ; 0x3e8c + 453a: 48 e0 ldi r20, 0x08 ; 8 + 453c: 68 e4 ldi r22, 0x48 ; 72 + 453e: 80 e8 ldi r24, 0x80 ; 128 + 4540: 6e de rcall .-804 ; 0x421e return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 41b0: 48 e0 ldi r20, 0x08 ; 8 - 41b2: 68 e4 ldi r22, 0x48 ; 72 - 41b4: 80 e0 ldi r24, 0x00 ; 0 - 41b6: 6a de rcall .-812 ; 0x3e8c + 4542: 48 e0 ldi r20, 0x08 ; 8 + 4544: 68 e4 ldi r22, 0x48 ; 72 + 4546: 80 e0 ldi r24, 0x00 ; 0 + 4548: 6a de rcall .-812 ; 0x421e static inline void USB_INT_Enable(const uint8_t Interrupt) { switch (Interrupt) { case USB_INT_BUSEVENTI: USB.INTCTRLA |= USB_BUSEVIE_bm; - 41b8: 88 85 ldd r24, Y+8 ; 0x08 - 41ba: 80 64 ori r24, 0x40 ; 64 - 41bc: 88 87 std Y+8, r24 ; 0x08 + 454a: 88 85 ldd r24, Y+8 ; 0x08 + 454c: 80 64 ori r24, 0x40 ; 64 + 454e: 88 87 std Y+8, r24 ; 0x08 * register and despite the datasheet making no mention of its requirement in host mode. */ static inline void USB_Attach(void) ATTR_ALWAYS_INLINE; static inline void USB_Attach(void) { USB.CTRLB |= USB_ATTACH_bm; - 41be: 89 81 ldd r24, Y+1 ; 0x01 - 41c0: 81 60 ori r24, 0x01 ; 1 - 41c2: 89 83 std Y+1, r24 ; 0x01 + 4550: 89 81 ldd r24, Y+1 ; 0x01 + 4552: 81 60 ori r24, 0x01 ; 1 + 4554: 89 83 std Y+1, r24 ; 0x01 USB_INT_DisableAllInterrupts(); USB_INT_ClearAllInterrupts(); USB_Controller_Reset(); USB_Init_Device(); } - 41c4: df 91 pop r29 - 41c6: cf 91 pop r28 - 41c8: 08 95 ret + 4556: df 91 pop r29 + 4558: cf 91 pop r28 + 455a: 08 95 ret -000041ca : +0000455c : #if !defined(USE_STATIC_OPTIONS) const uint8_t Options #endif ) { - 41ca: cf 93 push r28 - 41cc: df 93 push r29 + 455c: cf 93 push r28 + 455e: df 93 push r29 #if (ARCH == ARCH_AVR8) return SREG; #elif (ARCH == ARCH_UC3) return __builtin_mfsr(AVR32_SR); #elif (ARCH == ARCH_XMEGA) return SREG; - 41ce: 3f b7 in r19, 0x3f ; 63 + 4560: 3f b7 in r19, 0x3f ; 63 #if (ARCH == ARCH_AVR8) cli(); #elif (ARCH == ARCH_UC3) __builtin_ssrf(AVR32_SR_GM_OFFSET); #elif (ARCH == ARCH_XMEGA) cli(); - 41d0: f8 94 cli + 4562: f8 94 cli #endif uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); GlobalInterruptDisable(); NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 41d2: c0 ec ldi r28, 0xC0 ; 192 - 41d4: d1 e0 ldi r29, 0x01 ; 1 - 41d6: 22 e0 ldi r18, 0x02 ; 2 - 41d8: 2a 87 std Y+10, r18 ; 0x0a + 4564: c0 ec ldi r28, 0xC0 ; 192 + 4566: d1 e0 ldi r29, 0x01 ; 1 + 4568: 22 e0 ldi r18, 0x02 ; 2 + 456a: 2a 87 std Y+10, r18 ; 0x0a USB.CAL0 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL0)); - 41da: ea e1 ldi r30, 0x1A ; 26 - 41dc: f0 e0 ldi r31, 0x00 ; 0 - 41de: e4 91 lpm r30, Z - 41e0: a0 ec ldi r26, 0xC0 ; 192 - 41e2: b4 e0 ldi r27, 0x04 ; 4 - 41e4: da 96 adiw r26, 0x3a ; 58 - 41e6: ec 93 st X, r30 - 41e8: da 97 sbiw r26, 0x3a ; 58 + 456c: ea e1 ldi r30, 0x1A ; 26 + 456e: f0 e0 ldi r31, 0x00 ; 0 + 4570: e4 91 lpm r30, Z + 4572: a0 ec ldi r26, 0xC0 ; 192 + 4574: b4 e0 ldi r27, 0x04 ; 4 + 4576: da 96 adiw r26, 0x3a ; 58 + 4578: ec 93 st X, r30 + 457a: da 97 sbiw r26, 0x3a ; 58 USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1)); - 41ea: eb e1 ldi r30, 0x1B ; 27 - 41ec: f0 e0 ldi r31, 0x00 ; 0 - 41ee: e4 91 lpm r30, Z - 41f0: db 96 adiw r26, 0x3b ; 59 - 41f2: ec 93 st X, r30 - 41f4: db 97 sbiw r26, 0x3b ; 59 + 457c: eb e1 ldi r30, 0x1B ; 27 + 457e: f0 e0 ldi r31, 0x00 ; 0 + 4580: e4 91 lpm r30, Z + 4582: db 96 adiw r26, 0x3b ; 59 + 4584: ec 93 st X, r30 + 4586: db 97 sbiw r26, 0x3b ; 59 NVM.CMD = NVM_CMD_NO_OPERATION_gc; - 41f6: 1a 86 std Y+10, r1 ; 0x0a + 4588: 1a 86 std Y+10, r1 ; 0x0a /* Ugly workaround to ensure an aligned table, since __BIGGEST_ALIGNMENT__ == 1 for the 8-bit AVR-GCC toolchain */ USB.EPPTR = ((intptr_t)&USB_EndpointTable[1] & ~(1 << 0)); - 41f8: 8b e3 ldi r24, 0x3B ; 59 - 41fa: 96 e2 ldi r25, 0x26 ; 38 - 41fc: 8e 7f andi r24, 0xFE ; 254 - 41fe: 16 96 adiw r26, 0x06 ; 6 - 4200: 8d 93 st X+, r24 - 4202: 9c 93 st X, r25 - 4204: 17 97 sbiw r26, 0x07 ; 7 + 458a: 8b e3 ldi r24, 0x3B ; 59 + 458c: 9a e2 ldi r25, 0x2A ; 42 + 458e: 8e 7f andi r24, 0xFE ; 254 + 4590: 16 96 adiw r26, 0x06 ; 6 + 4592: 8d 93 st X+, r24 + 4594: 9c 93 st X, r25 + 4596: 17 97 sbiw r26, 0x07 ; 7 USB.CTRLA = (USB_STFRNUM_bm | ((ENDPOINT_TOTAL_ENDPOINTS - 1) << USB_MAXEP_gp)); - 4206: 85 e1 ldi r24, 0x15 ; 21 - 4208: 8c 93 st X, r24 + 4598: 85 e1 ldi r24, 0x15 ; 21 + 459a: 8c 93 st X, r24 if ((USB_Options & USB_OPT_BUSEVENT_PRIHIGH) == USB_OPT_BUSEVENT_PRIHIGH) USB.INTCTRLA = (3 << USB_INTLVL_gp); else if ((USB_Options & USB_OPT_BUSEVENT_PRIMED) == USB_OPT_BUSEVENT_PRIMED) USB.INTCTRLA = (2 << USB_INTLVL_gp); - 420a: 18 96 adiw r26, 0x08 ; 8 - 420c: 2c 93 st X, r18 + 459c: 18 96 adiw r26, 0x08 ; 8 + 459e: 2c 93 st X, r18 if (GlobalIntState & AVR32_SR_GM) __builtin_ssrf(AVR32_SR_GM_OFFSET); else __builtin_csrf(AVR32_SR_GM_OFFSET); #elif (ARCH == ARCH_XMEGA) SREG = GlobalIntState; - 420e: 3f bf out 0x3f, r19 ; 63 + 45a0: 3f bf out 0x3f, r19 ; 63 #if defined(USB_CAN_BE_BOTH) USB_CurrentMode = Mode; #endif USB_IsInitialized = true; - 4210: 81 e0 ldi r24, 0x01 ; 1 - 4212: 80 93 13 23 sts 0x2313, r24 + 45a2: 81 e0 ldi r24, 0x01 ; 1 + 45a4: 80 93 13 27 sts 0x2713, r24 USB_ResetInterface(); } - 4216: df 91 pop r29 - 4218: cf 91 pop r28 + 45a8: df 91 pop r29 + 45aa: cf 91 pop r28 USB_CurrentMode = Mode; #endif USB_IsInitialized = true; USB_ResetInterface(); - 421a: a9 cf rjmp .-174 ; 0x416e + 45ac: a9 cf rjmp .-174 ; 0x4500 -0000421c : +000045ae : #define __INCLUDE_FROM_USB_DRIVER #include "../USBInterrupt.h" void USB_INT_DisableAllInterrupts(void) { USB.INTCTRLA &= USB_INTLVL_gm; - 421c: e0 ec ldi r30, 0xC0 ; 192 - 421e: f4 e0 ldi r31, 0x04 ; 4 - 4220: 80 85 ldd r24, Z+8 ; 0x08 - 4222: 83 70 andi r24, 0x03 ; 3 - 4224: 80 87 std Z+8, r24 ; 0x08 + 45ae: e0 ec ldi r30, 0xC0 ; 192 + 45b0: f4 e0 ldi r31, 0x04 ; 4 + 45b2: 80 85 ldd r24, Z+8 ; 0x08 + 45b4: 83 70 andi r24, 0x03 ; 3 + 45b6: 80 87 std Z+8, r24 ; 0x08 USB.INTCTRLB = 0; - 4226: 11 86 std Z+9, r1 ; 0x09 - 4228: 08 95 ret + 45b8: 11 86 std Z+9, r1 ; 0x09 + 45ba: 08 95 ret -0000422a : +000045bc : } void USB_INT_ClearAllInterrupts(void) { USB.INTFLAGSACLR = 0xFF; - 422a: e0 ec ldi r30, 0xC0 ; 192 - 422c: f4 e0 ldi r31, 0x04 ; 4 - 422e: 8f ef ldi r24, 0xFF ; 255 - 4230: 82 87 std Z+10, r24 ; 0x0a + 45bc: e0 ec ldi r30, 0xC0 ; 192 + 45be: f4 e0 ldi r31, 0x04 ; 4 + 45c0: 8f ef ldi r24, 0xFF ; 255 + 45c2: 82 87 std Z+10, r24 ; 0x0a USB.INTFLAGSBCLR = 0xFF; - 4232: 84 87 std Z+12, r24 ; 0x0c - 4234: 08 95 ret + 45c4: 84 87 std Z+12, r24 ; 0x0c + 45c6: 08 95 ret -00004236 <__vector_125>: +000045c8 <__vector_125>: } ISR(USB_BUSEVENT_vect) { - 4236: 1f 92 push r1 - 4238: 0f 92 push r0 - 423a: 0f b6 in r0, 0x3f ; 63 - 423c: 0f 92 push r0 - 423e: 11 24 eor r1, r1 - 4240: 2f 93 push r18 - 4242: 3f 93 push r19 - 4244: 4f 93 push r20 - 4246: 5f 93 push r21 - 4248: 6f 93 push r22 - 424a: 7f 93 push r23 - 424c: 8f 93 push r24 - 424e: 9f 93 push r25 - 4250: af 93 push r26 - 4252: bf 93 push r27 - 4254: ef 93 push r30 - 4256: ff 93 push r31 + 45c8: 1f 92 push r1 + 45ca: 0f 92 push r0 + 45cc: 0f b6 in r0, 0x3f ; 63 + 45ce: 0f 92 push r0 + 45d0: 11 24 eor r1, r1 + 45d2: 2f 93 push r18 + 45d4: 3f 93 push r19 + 45d6: 4f 93 push r20 + 45d8: 5f 93 push r21 + 45da: 6f 93 push r22 + 45dc: 7f 93 push r23 + 45de: 8f 93 push r24 + 45e0: 9f 93 push r25 + 45e2: af 93 push r26 + 45e4: bf 93 push r27 + 45e6: ef 93 push r30 + 45e8: ff 93 push r31 case USB_INT_BUSEVENTI_Resume: return ((USB.INTFLAGSACLR & USB_RESUMEIF_bm) ? true : false); case USB_INT_BUSEVENTI_Reset: return ((USB.INTFLAGSACLR & USB_RSTIF_bm) ? true : false); case USB_INT_SOFI: return ((USB.INTFLAGSACLR & USB_SOFIF_bm) ? true : false); - 4258: 80 91 ca 04 lds r24, 0x04CA + 45ea: 80 91 ca 04 lds r24, 0x04CA #if !defined(NO_SOF_EVENTS) if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) - 425c: 87 fd sbrc r24, 7 - 425e: 4d c0 rjmp .+154 ; 0x42fa <__vector_125+0xc4> + 45ee: 87 fd sbrc r24, 7 + 45f0: 4d c0 rjmp .+154 ; 0x468c <__vector_125+0xc4> static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) { switch (Interrupt) { case USB_INT_BUSEVENTI_Suspend: return ((USB.INTFLAGSACLR & USB_SUSPENDIF_bm) ? true : false); - 4260: 80 91 ca 04 lds r24, 0x04CA + 45f2: 80 91 ca 04 lds r24, 0x04CA EVENT_USB_Device_StartOfFrame(); } #endif if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) - 4264: 86 fd sbrc r24, 6 - 4266: 41 c0 rjmp .+130 ; 0x42ea <__vector_125+0xb4> + 45f6: 86 fd sbrc r24, 6 + 45f8: 41 c0 rjmp .+130 ; 0x467c <__vector_125+0xb4> case USB_INT_BUSEVENTI_Resume: return ((USB.INTFLAGSACLR & USB_RESUMEIF_bm) ? true : false); - 4268: 80 91 ca 04 lds r24, 0x04CA + 45fa: 80 91 ca 04 lds r24, 0x04CA USB_DeviceState = DEVICE_STATE_Suspended; EVENT_USB_Device_Suspend(); #endif } if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Resume)) - 426c: 85 ff sbrs r24, 5 - 426e: 0c c0 rjmp .+24 ; 0x4288 <__vector_125+0x52> + 45fe: 85 ff sbrs r24, 5 + 4600: 0c c0 rjmp .+24 ; 0x461a <__vector_125+0x52> { case USB_INT_BUSEVENTI_Suspend: USB.INTFLAGSACLR = USB_SUSPENDIF_bm; break; case USB_INT_BUSEVENTI_Resume: USB.INTFLAGSACLR = USB_RESUMEIF_bm; - 4270: 80 e2 ldi r24, 0x20 ; 32 - 4272: 80 93 ca 04 sts 0x04CA, r24 + 4602: 80 e2 ldi r24, 0x20 ; 32 + 4604: 80 93 ca 04 sts 0x04CA, r24 { USB_INT_Clear(USB_INT_BUSEVENTI_Resume); if (USB_Device_ConfigurationNumber) - 4276: 80 91 10 23 lds r24, 0x2310 - 427a: 88 23 and r24, r24 - 427c: 71 f1 breq .+92 ; 0x42da <__vector_125+0xa4> + 4608: 80 91 10 27 lds r24, 0x2710 + 460c: 88 23 and r24, r24 + 460e: 71 f1 breq .+92 ; 0x466c <__vector_125+0xa4> USB_DeviceState = DEVICE_STATE_Configured; - 427e: 84 e0 ldi r24, 0x04 ; 4 - 4280: 80 93 14 23 sts 0x2314, r24 + 4610: 84 e0 ldi r24, 0x04 ; 4 + 4612: 80 93 14 27 sts 0x2714, r24 else USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; #if !defined(NO_LIMITED_CONTROLLER_CONNECT) EVENT_USB_Device_Connect(); - 4284: 0e 94 28 0b call 0x1650 ; 0x1650 + 4616: 0e 94 eb 0c call 0x19d6 ; 0x19d6 case USB_INT_BUSEVENTI_Suspend: return ((USB.INTFLAGSACLR & USB_SUSPENDIF_bm) ? true : false); case USB_INT_BUSEVENTI_Resume: return ((USB.INTFLAGSACLR & USB_RESUMEIF_bm) ? true : false); case USB_INT_BUSEVENTI_Reset: return ((USB.INTFLAGSACLR & USB_RSTIF_bm) ? true : false); - 4288: 80 91 ca 04 lds r24, 0x04CA + 461a: 80 91 ca 04 lds r24, 0x04CA #else EVENT_USB_Device_WakeUp(); #endif } if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Reset)) - 428c: 84 ff sbrs r24, 4 - 428e: 14 c0 rjmp .+40 ; 0x42b8 <__vector_125+0x82> + 461e: 84 ff sbrs r24, 4 + 4620: 14 c0 rjmp .+40 ; 0x464a <__vector_125+0x82> break; case USB_INT_BUSEVENTI_Resume: USB.INTFLAGSACLR = USB_RESUMEIF_bm; break; case USB_INT_BUSEVENTI_Reset: USB.INTFLAGSACLR = USB_RSTIF_bm; - 4290: 80 e1 ldi r24, 0x10 ; 16 - 4292: 80 93 ca 04 sts 0x04CA, r24 + 4622: 80 e1 ldi r24, 0x10 ; 16 + 4624: 80 93 ca 04 sts 0x04CA, r24 { USB_INT_Clear(USB_INT_BUSEVENTI_Reset); USB_DeviceState = DEVICE_STATE_Default; - 4296: 82 e0 ldi r24, 0x02 ; 2 - 4298: 80 93 14 23 sts 0x2314, r24 + 4628: 82 e0 ldi r24, 0x02 ; 2 + 462a: 80 93 14 27 sts 0x2714, r24 USB_Device_ConfigurationNumber = 0; - 429c: 10 92 10 23 sts 0x2310, r1 + 462e: 10 92 10 27 sts 0x2710, r1 } static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) { USB.ADDR = Address; - 42a0: 10 92 c3 04 sts 0x04C3, r1 + 4632: 10 92 c3 04 sts 0x04C3, r1 USB_Device_EnableDeviceAddress(0); Endpoint_ClearEndpoints(); - 42a4: b6 de rcall .-660 ; 0x4012 + 4636: b6 de rcall .-660 ; 0x43a4 EPConfigMask |= USB_EP_TYPE_BULK_gc; break; } if (Type == EP_TYPE_CONTROL) Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 42a6: 48 e0 ldi r20, 0x08 ; 8 - 42a8: 68 e4 ldi r22, 0x48 ; 72 - 42aa: 80 e8 ldi r24, 0x80 ; 128 - 42ac: ef dd rcall .-1058 ; 0x3e8c + 4638: 48 e0 ldi r20, 0x08 ; 8 + 463a: 68 e4 ldi r22, 0x48 ; 72 + 463c: 80 e8 ldi r24, 0x80 ; 128 + 463e: ef dd rcall .-1058 ; 0x421e return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 42ae: 48 e0 ldi r20, 0x08 ; 8 - 42b0: 68 e4 ldi r22, 0x48 ; 72 - 42b2: 80 e0 ldi r24, 0x00 ; 0 - 42b4: eb dd rcall .-1066 ; 0x3e8c + 4640: 48 e0 ldi r20, 0x08 ; 8 + 4642: 68 e4 ldi r22, 0x48 ; 72 + 4644: 80 e0 ldi r24, 0x00 ; 0 + 4646: eb dd rcall .-1066 ; 0x421e Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL, USB_Device_ControlEndpointSize, 1); EVENT_USB_Device_Reset(); - 42b6: 23 db rcall .-2490 ; 0x38fe + 4648: 23 db rcall .-2490 ; 0x3c90 } } - 42b8: ff 91 pop r31 - 42ba: ef 91 pop r30 - 42bc: bf 91 pop r27 - 42be: af 91 pop r26 - 42c0: 9f 91 pop r25 - 42c2: 8f 91 pop r24 - 42c4: 7f 91 pop r23 - 42c6: 6f 91 pop r22 - 42c8: 5f 91 pop r21 - 42ca: 4f 91 pop r20 - 42cc: 3f 91 pop r19 - 42ce: 2f 91 pop r18 - 42d0: 0f 90 pop r0 - 42d2: 0f be out 0x3f, r0 ; 63 - 42d4: 0f 90 pop r0 - 42d6: 1f 90 pop r1 - 42d8: 18 95 reti + 464a: ff 91 pop r31 + 464c: ef 91 pop r30 + 464e: bf 91 pop r27 + 4650: af 91 pop r26 + 4652: 9f 91 pop r25 + 4654: 8f 91 pop r24 + 4656: 7f 91 pop r23 + 4658: 6f 91 pop r22 + 465a: 5f 91 pop r21 + 465c: 4f 91 pop r20 + 465e: 3f 91 pop r19 + 4660: 2f 91 pop r18 + 4662: 0f 90 pop r0 + 4664: 0f be out 0x3f, r0 ; 63 + 4666: 0f 90 pop r0 + 4668: 1f 90 pop r1 + 466a: 18 95 reti } static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; static inline bool USB_Device_IsAddressSet(void) { return ((USB.ADDR != 0) ? true : false); - 42da: 80 91 c3 04 lds r24, 0x04C3 + 466c: 80 91 c3 04 lds r24, 0x04C3 USB_INT_Clear(USB_INT_BUSEVENTI_Resume); if (USB_Device_ConfigurationNumber) USB_DeviceState = DEVICE_STATE_Configured; else USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; - 42de: 81 11 cpse r24, r1 - 42e0: 15 c0 rjmp .+42 ; 0x430c <__vector_125+0xd6> - 42e2: 81 e0 ldi r24, 0x01 ; 1 - 42e4: 80 93 14 23 sts 0x2314, r24 - 42e8: cd cf rjmp .-102 ; 0x4284 <__vector_125+0x4e> + 4670: 81 11 cpse r24, r1 + 4672: 15 c0 rjmp .+42 ; 0x469e <__vector_125+0xd6> + 4674: 81 e0 ldi r24, 0x01 ; 1 + 4676: 80 93 14 27 sts 0x2714, r24 + 467a: cd cf rjmp .-102 ; 0x4616 <__vector_125+0x4e> static inline void USB_INT_Clear(const uint8_t Interrupt) { switch (Interrupt) { case USB_INT_BUSEVENTI_Suspend: USB.INTFLAGSACLR = USB_SUSPENDIF_bm; - 42ea: 80 e4 ldi r24, 0x40 ; 64 - 42ec: 80 93 ca 04 sts 0x04CA, r24 + 467c: 80 e4 ldi r24, 0x40 ; 64 + 467e: 80 93 ca 04 sts 0x04CA, r24 if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) { USB_INT_Clear(USB_INT_BUSEVENTI_Suspend); #if !defined(NO_LIMITED_CONTROLLER_CONNECT) USB_DeviceState = DEVICE_STATE_Unattached; - 42f0: 10 92 14 23 sts 0x2314, r1 + 4682: 10 92 14 27 sts 0x2714, r1 EVENT_USB_Device_Disconnect(); - 42f4: 0e 94 2d 0b call 0x165a ; 0x165a - 42f8: b7 cf rjmp .-146 ; 0x4268 <__vector_125+0x32> + 4686: 0e 94 f0 0c call 0x19e0 ; 0x19e0 + 468a: b7 cf rjmp .-146 ; 0x45fa <__vector_125+0x32> switch (Interrupt) { case USB_INT_BUSEVENTI: return ((USB.INTCTRLA & USB_BUSEVIE_bm) ? true : false); case USB_INT_SOFI: return ((USB.INTCTRLA & USB_SOFIE_bm) ? true : false); - 42fa: 80 91 c8 04 lds r24, 0x04C8 + 468c: 80 91 c8 04 lds r24, 0x04C8 } ISR(USB_BUSEVENT_vect) { #if !defined(NO_SOF_EVENTS) if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) - 42fe: 87 ff sbrs r24, 7 - 4300: af cf rjmp .-162 ; 0x4260 <__vector_125+0x2a> + 4690: 87 ff sbrs r24, 7 + 4692: af cf rjmp .-162 ; 0x45f2 <__vector_125+0x2a> break; case USB_INT_BUSEVENTI_Reset: USB.INTFLAGSACLR = USB_RSTIF_bm; break; case USB_INT_SOFI: USB.INTFLAGSACLR = USB_SOFIF_bm; - 4302: 80 e8 ldi r24, 0x80 ; 128 - 4304: 80 93 ca 04 sts 0x04CA, r24 + 4694: 80 e8 ldi r24, 0x80 ; 128 + 4696: 80 93 ca 04 sts 0x04CA, r24 { USB_INT_Clear(USB_INT_SOFI); EVENT_USB_Device_StartOfFrame(); - 4308: fa da rcall .-2572 ; 0x38fe - 430a: aa cf rjmp .-172 ; 0x4260 <__vector_125+0x2a> + 469a: fa da rcall .-2572 ; 0x3c90 + 469c: aa cf rjmp .-172 ; 0x45f2 <__vector_125+0x2a> USB_INT_Clear(USB_INT_BUSEVENTI_Resume); if (USB_Device_ConfigurationNumber) USB_DeviceState = DEVICE_STATE_Configured; else USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; - 430c: 83 e0 ldi r24, 0x03 ; 3 - 430e: ea cf rjmp .-44 ; 0x42e4 <__vector_125+0xae> + 469e: 83 e0 ldi r24, 0x03 ; 3 + 46a0: ea cf rjmp .-44 ; 0x4676 <__vector_125+0xae> -00004310 : +000046a2 : void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, FILE* const Stream) { *Stream = (FILE)FDEV_SETUP_STREAM(CDC_Device_putchar, CDC_Device_getchar_Blocking, _FDEV_SETUP_RW); fdev_set_udata(Stream, CDCInterfaceInfo); - 4310: cf 93 push r28 - 4312: df 93 push r29 - 4314: ec 01 movw r28, r24 - 4316: 40 96 adiw r24, 0x10 ; 16 - 4318: fc 01 movw r30, r24 - 431a: 8b e0 ldi r24, 0x0B ; 11 - 431c: df 01 movw r26, r30 - 431e: 1d 92 st X+, r1 - 4320: 8a 95 dec r24 - 4322: e9 f7 brne .-6 ; 0x431e - 4324: 82 e0 ldi r24, 0x02 ; 2 - 4326: 8c 83 std Y+4, r24 ; 0x04 - 4328: 89 87 std Y+9, r24 ; 0x09 - 432a: 83 e0 ldi r24, 0x03 ; 3 - 432c: 8e 87 std Y+14, r24 ; 0x0e - 432e: 61 e0 ldi r22, 0x01 ; 1 - 4330: ce 01 movw r24, r28 - 4332: 01 96 adiw r24, 0x01 ; 1 - 4334: f8 dd rcall .-1040 ; 0x3f26 - 4336: 81 11 cpse r24, r1 - 4338: 04 c0 rjmp .+8 ; 0x4342 - 433a: 80 e0 ldi r24, 0x00 ; 0 - 433c: df 91 pop r29 - 433e: cf 91 pop r28 - 4340: 08 95 ret - 4342: 61 e0 ldi r22, 0x01 ; 1 - 4344: ce 01 movw r24, r28 - 4346: 06 96 adiw r24, 0x06 ; 6 - 4348: ee dd rcall .-1060 ; 0x3f26 - 434a: 88 23 and r24, r24 - 434c: b1 f3 breq .-20 ; 0x433a - 434e: 61 e0 ldi r22, 0x01 ; 1 - 4350: ce 01 movw r24, r28 - 4352: 0b 96 adiw r24, 0x0b ; 11 - 4354: df 91 pop r29 - 4356: cf 91 pop r28 - 4358: e6 cd rjmp .-1076 ; 0x3f26 + 46a2: cf 93 push r28 + 46a4: df 93 push r29 + 46a6: ec 01 movw r28, r24 + 46a8: 40 96 adiw r24, 0x10 ; 16 + 46aa: fc 01 movw r30, r24 + 46ac: 8b e0 ldi r24, 0x0B ; 11 + 46ae: df 01 movw r26, r30 + 46b0: 1d 92 st X+, r1 + 46b2: 8a 95 dec r24 + 46b4: e9 f7 brne .-6 ; 0x46b0 + 46b6: 82 e0 ldi r24, 0x02 ; 2 + 46b8: 8c 83 std Y+4, r24 ; 0x04 + 46ba: 89 87 std Y+9, r24 ; 0x09 + 46bc: 83 e0 ldi r24, 0x03 ; 3 + 46be: 8e 87 std Y+14, r24 ; 0x0e + 46c0: 61 e0 ldi r22, 0x01 ; 1 + 46c2: ce 01 movw r24, r28 + 46c4: 01 96 adiw r24, 0x01 ; 1 + 46c6: f8 dd rcall .-1040 ; 0x42b8 + 46c8: 81 11 cpse r24, r1 + 46ca: 04 c0 rjmp .+8 ; 0x46d4 + 46cc: 80 e0 ldi r24, 0x00 ; 0 + 46ce: df 91 pop r29 + 46d0: cf 91 pop r28 + 46d2: 08 95 ret + 46d4: 61 e0 ldi r22, 0x01 ; 1 + 46d6: ce 01 movw r24, r28 + 46d8: 06 96 adiw r24, 0x06 ; 6 + 46da: ee dd rcall .-1060 ; 0x42b8 + 46dc: 88 23 and r24, r24 + 46de: b1 f3 breq .-20 ; 0x46cc + 46e0: 61 e0 ldi r22, 0x01 ; 1 + 46e2: ce 01 movw r24, r28 + 46e4: 0b 96 adiw r24, 0x0b ; 11 + 46e6: df 91 pop r29 + 46e8: cf 91 pop r28 + 46ea: e6 cd rjmp .-1076 ; 0x42b8 -0000435a : - 435a: cf 93 push r28 - 435c: df 93 push r29 - 435e: d6 2f mov r29, r22 - 4360: c7 2f mov r28, r23 - 4362: 20 91 14 23 lds r18, 0x2314 - 4366: 24 30 cpi r18, 0x04 ; 4 - 4368: 21 f0 breq .+8 ; 0x4372 - 436a: 82 e0 ldi r24, 0x02 ; 2 - 436c: df 91 pop r29 - 436e: cf 91 pop r28 - 4370: 08 95 ret - 4372: fc 01 movw r30, r24 - 4374: 44 89 ldd r20, Z+20 ; 0x14 - 4376: 55 89 ldd r21, Z+21 ; 0x15 - 4378: 66 89 ldd r22, Z+22 ; 0x16 - 437a: 77 89 ldd r23, Z+23 ; 0x17 - 437c: 45 2b or r20, r21 - 437e: 46 2b or r20, r22 - 4380: 47 2b or r20, r23 - 4382: 99 f3 breq .-26 ; 0x436a - 4384: 81 81 ldd r24, Z+1 ; 0x01 - 4386: c3 dc rcall .-1658 ; 0x3d0e - 4388: ad 2f mov r26, r29 - 438a: bc 2f mov r27, r28 - 438c: fd 01 movw r30, r26 - 438e: 01 90 ld r0, Z+ - 4390: 00 20 and r0, r0 - 4392: e9 f7 brne .-6 ; 0x438e - 4394: bf 01 movw r22, r30 - 4396: 61 50 subi r22, 0x01 ; 1 - 4398: 71 09 sbc r23, r1 - 439a: 6a 1b sub r22, r26 - 439c: 7b 0b sbc r23, r27 - 439e: 40 e0 ldi r20, 0x00 ; 0 - 43a0: 50 e0 ldi r21, 0x00 ; 0 - 43a2: 8d 2f mov r24, r29 - 43a4: 9c 2f mov r25, r28 - 43a6: df 91 pop r29 - 43a8: cf 91 pop r28 - 43aa: bf ca rjmp .-2690 ; 0x392a +000046ec : + 46ec: cf 93 push r28 + 46ee: df 93 push r29 + 46f0: d6 2f mov r29, r22 + 46f2: c7 2f mov r28, r23 + 46f4: 20 91 14 27 lds r18, 0x2714 + 46f8: 24 30 cpi r18, 0x04 ; 4 + 46fa: 21 f0 breq .+8 ; 0x4704 + 46fc: 82 e0 ldi r24, 0x02 ; 2 + 46fe: df 91 pop r29 + 4700: cf 91 pop r28 + 4702: 08 95 ret + 4704: fc 01 movw r30, r24 + 4706: 44 89 ldd r20, Z+20 ; 0x14 + 4708: 55 89 ldd r21, Z+21 ; 0x15 + 470a: 66 89 ldd r22, Z+22 ; 0x16 + 470c: 77 89 ldd r23, Z+23 ; 0x17 + 470e: 45 2b or r20, r21 + 4710: 46 2b or r20, r22 + 4712: 47 2b or r20, r23 + 4714: 99 f3 breq .-26 ; 0x46fc + 4716: 81 81 ldd r24, Z+1 ; 0x01 + 4718: c3 dc rcall .-1658 ; 0x40a0 + 471a: ad 2f mov r26, r29 + 471c: bc 2f mov r27, r28 + 471e: fd 01 movw r30, r26 + 4720: 01 90 ld r0, Z+ + 4722: 00 20 and r0, r0 + 4724: e9 f7 brne .-6 ; 0x4720 + 4726: bf 01 movw r22, r30 + 4728: 61 50 subi r22, 0x01 ; 1 + 472a: 71 09 sbc r23, r1 + 472c: 6a 1b sub r22, r26 + 472e: 7b 0b sbc r23, r27 + 4730: 40 e0 ldi r20, 0x00 ; 0 + 4732: 50 e0 ldi r21, 0x00 ; 0 + 4734: 8d 2f mov r24, r29 + 4736: 9c 2f mov r25, r28 + 4738: df 91 pop r29 + 473a: cf 91 pop r28 + 473c: bf ca rjmp .-2690 ; 0x3cbc -000043ac : - 43ac: ef 92 push r14 - 43ae: ff 92 push r15 - 43b0: 0f 93 push r16 - 43b2: 1f 93 push r17 - 43b4: cf 93 push r28 - 43b6: df 93 push r29 - 43b8: eb 01 movw r28, r22 - 43ba: 7a 01 movw r14, r20 - 43bc: 20 91 14 23 lds r18, 0x2314 - 43c0: 24 30 cpi r18, 0x04 ; 4 - 43c2: 41 f0 breq .+16 ; 0x43d4 - 43c4: 82 e0 ldi r24, 0x02 ; 2 - 43c6: df 91 pop r29 - 43c8: cf 91 pop r28 - 43ca: 1f 91 pop r17 - 43cc: 0f 91 pop r16 - 43ce: ff 90 pop r15 - 43d0: ef 90 pop r14 - 43d2: 08 95 ret - 43d4: fc 01 movw r30, r24 - 43d6: 04 89 ldd r16, Z+20 ; 0x14 - 43d8: 15 89 ldd r17, Z+21 ; 0x15 - 43da: 26 89 ldd r18, Z+22 ; 0x16 - 43dc: 37 89 ldd r19, Z+23 ; 0x17 - 43de: 01 2b or r16, r17 - 43e0: 02 2b or r16, r18 - 43e2: 03 2b or r16, r19 - 43e4: 79 f3 breq .-34 ; 0x43c4 - 43e6: 81 81 ldd r24, Z+1 ; 0x01 - 43e8: 92 dc rcall .-1756 ; 0x3d0e - 43ea: 40 e0 ldi r20, 0x00 ; 0 - 43ec: 50 e0 ldi r21, 0x00 ; 0 - 43ee: b7 01 movw r22, r14 - 43f0: ce 01 movw r24, r28 - 43f2: df 91 pop r29 - 43f4: cf 91 pop r28 - 43f6: 1f 91 pop r17 - 43f8: 0f 91 pop r16 - 43fa: ff 90 pop r15 - 43fc: ef 90 pop r14 - 43fe: 95 ca rjmp .-2774 ; 0x392a +0000473e : + 473e: ef 92 push r14 + 4740: ff 92 push r15 + 4742: 0f 93 push r16 + 4744: 1f 93 push r17 + 4746: cf 93 push r28 + 4748: df 93 push r29 + 474a: eb 01 movw r28, r22 + 474c: 7a 01 movw r14, r20 + 474e: 20 91 14 27 lds r18, 0x2714 + 4752: 24 30 cpi r18, 0x04 ; 4 + 4754: 41 f0 breq .+16 ; 0x4766 + 4756: 82 e0 ldi r24, 0x02 ; 2 + 4758: df 91 pop r29 + 475a: cf 91 pop r28 + 475c: 1f 91 pop r17 + 475e: 0f 91 pop r16 + 4760: ff 90 pop r15 + 4762: ef 90 pop r14 + 4764: 08 95 ret + 4766: fc 01 movw r30, r24 + 4768: 04 89 ldd r16, Z+20 ; 0x14 + 476a: 15 89 ldd r17, Z+21 ; 0x15 + 476c: 26 89 ldd r18, Z+22 ; 0x16 + 476e: 37 89 ldd r19, Z+23 ; 0x17 + 4770: 01 2b or r16, r17 + 4772: 02 2b or r16, r18 + 4774: 03 2b or r16, r19 + 4776: 79 f3 breq .-34 ; 0x4756 + 4778: 81 81 ldd r24, Z+1 ; 0x01 + 477a: 92 dc rcall .-1756 ; 0x40a0 + 477c: 40 e0 ldi r20, 0x00 ; 0 + 477e: 50 e0 ldi r21, 0x00 ; 0 + 4780: b7 01 movw r22, r14 + 4782: ce 01 movw r24, r28 + 4784: df 91 pop r29 + 4786: cf 91 pop r28 + 4788: 1f 91 pop r17 + 478a: 0f 91 pop r16 + 478c: ff 90 pop r15 + 478e: ef 90 pop r14 + 4790: 95 ca rjmp .-2774 ; 0x3cbc -00004400 : - 4400: 0f 93 push r16 - 4402: 1f 93 push r17 - 4404: cf 93 push r28 - 4406: df 93 push r29 - 4408: 1f 92 push r1 - 440a: cd b7 in r28, 0x3d ; 61 - 440c: de b7 in r29, 0x3e ; 62 - 440e: 20 91 14 23 lds r18, 0x2314 - 4412: 24 30 cpi r18, 0x04 ; 4 - 4414: 39 f0 breq .+14 ; 0x4424 - 4416: 82 e0 ldi r24, 0x02 ; 2 - 4418: 0f 90 pop r0 - 441a: df 91 pop r29 - 441c: cf 91 pop r28 - 441e: 1f 91 pop r17 - 4420: 0f 91 pop r16 - 4422: 08 95 ret - 4424: fc 01 movw r30, r24 - 4426: 04 89 ldd r16, Z+20 ; 0x14 - 4428: 15 89 ldd r17, Z+21 ; 0x15 - 442a: 26 89 ldd r18, Z+22 ; 0x16 - 442c: 37 89 ldd r19, Z+23 ; 0x17 - 442e: 01 2b or r16, r17 - 4430: 02 2b or r16, r18 - 4432: 03 2b or r16, r19 - 4434: 81 f3 breq .-32 ; 0x4416 - 4436: 81 81 ldd r24, Z+1 ; 0x01 - 4438: 69 83 std Y+1, r22 ; 0x01 - 443a: 69 dc rcall .-1838 ; 0x3d0e - 443c: 20 91 1d 23 lds r18, 0x231D - 4440: 30 91 1e 23 lds r19, 0x231E - 4444: f9 01 movw r30, r18 - 4446: ef 5b subi r30, 0xBF ; 191 - 4448: ff 4f sbci r31, 0xFF ; 255 - 444a: 90 81 ld r25, Z - 444c: f9 01 movw r30, r18 - 444e: e0 5c subi r30, 0xC0 ; 192 - 4450: ff 4f sbci r31, 0xFF ; 255 - 4452: 80 81 ld r24, Z - 4454: 69 81 ldd r22, Y+1 ; 0x01 - 4456: 98 17 cp r25, r24 - 4458: 30 f0 brcs .+12 ; 0x4466 - 445a: 69 83 std Y+1, r22 ; 0x01 - 445c: 12 dc rcall .-2012 ; 0x3c82 - 445e: 27 de rcall .-946 ; 0x40ae - 4460: 69 81 ldd r22, Y+1 ; 0x01 - 4462: 81 11 cpse r24, r1 - 4464: d9 cf rjmp .-78 ; 0x4418 - 4466: 86 2f mov r24, r22 - 4468: 43 dc rcall .-1914 ; 0x3cf0 - 446a: 80 e0 ldi r24, 0x00 ; 0 - 446c: d5 cf rjmp .-86 ; 0x4418 +00004792 : + 4792: 0f 93 push r16 + 4794: 1f 93 push r17 + 4796: cf 93 push r28 + 4798: df 93 push r29 + 479a: 1f 92 push r1 + 479c: cd b7 in r28, 0x3d ; 61 + 479e: de b7 in r29, 0x3e ; 62 + 47a0: 20 91 14 27 lds r18, 0x2714 + 47a4: 24 30 cpi r18, 0x04 ; 4 + 47a6: 39 f0 breq .+14 ; 0x47b6 + 47a8: 82 e0 ldi r24, 0x02 ; 2 + 47aa: 0f 90 pop r0 + 47ac: df 91 pop r29 + 47ae: cf 91 pop r28 + 47b0: 1f 91 pop r17 + 47b2: 0f 91 pop r16 + 47b4: 08 95 ret + 47b6: fc 01 movw r30, r24 + 47b8: 04 89 ldd r16, Z+20 ; 0x14 + 47ba: 15 89 ldd r17, Z+21 ; 0x15 + 47bc: 26 89 ldd r18, Z+22 ; 0x16 + 47be: 37 89 ldd r19, Z+23 ; 0x17 + 47c0: 01 2b or r16, r17 + 47c2: 02 2b or r16, r18 + 47c4: 03 2b or r16, r19 + 47c6: 81 f3 breq .-32 ; 0x47a8 + 47c8: 81 81 ldd r24, Z+1 ; 0x01 + 47ca: 69 83 std Y+1, r22 ; 0x01 + 47cc: 69 dc rcall .-1838 ; 0x40a0 + 47ce: 20 91 1d 27 lds r18, 0x271D + 47d2: 30 91 1e 27 lds r19, 0x271E + 47d6: f9 01 movw r30, r18 + 47d8: ef 5b subi r30, 0xBF ; 191 + 47da: ff 4f sbci r31, 0xFF ; 255 + 47dc: 90 81 ld r25, Z + 47de: f9 01 movw r30, r18 + 47e0: e0 5c subi r30, 0xC0 ; 192 + 47e2: ff 4f sbci r31, 0xFF ; 255 + 47e4: 80 81 ld r24, Z + 47e6: 69 81 ldd r22, Y+1 ; 0x01 + 47e8: 98 17 cp r25, r24 + 47ea: 30 f0 brcs .+12 ; 0x47f8 + 47ec: 69 83 std Y+1, r22 ; 0x01 + 47ee: 12 dc rcall .-2012 ; 0x4014 + 47f0: 27 de rcall .-946 ; 0x4440 + 47f2: 69 81 ldd r22, Y+1 ; 0x01 + 47f4: 81 11 cpse r24, r1 + 47f6: d9 cf rjmp .-78 ; 0x47aa + 47f8: 86 2f mov r24, r22 + 47fa: 43 dc rcall .-1914 ; 0x4082 + 47fc: 80 e0 ldi r24, 0x00 ; 0 + 47fe: d5 cf rjmp .-86 ; 0x47aa -0000446e : - 446e: 0f 93 push r16 - 4470: 1f 93 push r17 - 4472: cf 93 push r28 - 4474: df 93 push r29 - 4476: 1f 92 push r1 - 4478: cd b7 in r28, 0x3d ; 61 - 447a: de b7 in r29, 0x3e ; 62 - 447c: 20 91 14 23 lds r18, 0x2314 - 4480: 24 30 cpi r18, 0x04 ; 4 - 4482: 39 f0 breq .+14 ; 0x4492 - 4484: 82 e0 ldi r24, 0x02 ; 2 - 4486: 0f 90 pop r0 - 4488: df 91 pop r29 - 448a: cf 91 pop r28 - 448c: 1f 91 pop r17 - 448e: 0f 91 pop r16 - 4490: 08 95 ret - 4492: fc 01 movw r30, r24 - 4494: 44 89 ldd r20, Z+20 ; 0x14 - 4496: 55 89 ldd r21, Z+21 ; 0x15 - 4498: 66 89 ldd r22, Z+22 ; 0x16 - 449a: 77 89 ldd r23, Z+23 ; 0x17 - 449c: 45 2b or r20, r21 - 449e: 46 2b or r20, r22 - 44a0: 47 2b or r20, r23 - 44a2: 81 f3 breq .-32 ; 0x4484 - 44a4: 81 81 ldd r24, Z+1 ; 0x01 - 44a6: 33 dc rcall .-1946 ; 0x3d0e - 44a8: 80 91 21 23 lds r24, 0x2321 - 44ac: 20 91 1d 23 lds r18, 0x231D - 44b0: 30 91 1e 23 lds r19, 0x231E - 44b4: f9 01 movw r30, r18 - 44b6: 87 fd sbrc r24, 7 - 44b8: 1d c0 rjmp .+58 ; 0x44f4 - 44ba: e0 5c subi r30, 0xC0 ; 192 - 44bc: ff 4f sbci r31, 0xFF ; 255 - 44be: 80 81 ld r24, Z - 44c0: f9 01 movw r30, r18 - 44c2: ef 5b subi r30, 0xBF ; 191 - 44c4: ff 4f sbci r31, 0xFF ; 255 - 44c6: 40 81 ld r20, Z - 44c8: 90 e0 ldi r25, 0x00 ; 0 - 44ca: 84 1b sub r24, r20 - 44cc: 91 09 sbc r25, r1 - 44ce: 89 2b or r24, r25 - 44d0: 11 f4 brne .+4 ; 0x44d6 - 44d2: 80 e0 ldi r24, 0x00 ; 0 - 44d4: d8 cf rjmp .-80 ; 0x4486 - 44d6: 00 81 ld r16, Z - 44d8: f9 01 movw r30, r18 - 44da: e0 5c subi r30, 0xC0 ; 192 - 44dc: ff 4f sbci r31, 0xFF ; 255 - 44de: 10 81 ld r17, Z - 44e0: d0 db rcall .-2144 ; 0x3c82 - 44e2: 01 17 cp r16, r17 - 44e4: b0 f3 brcs .-20 ; 0x44d2 - 44e6: e3 dd rcall .-1082 ; 0x40ae - 44e8: 81 11 cpse r24, r1 - 44ea: cd cf rjmp .-102 ; 0x4486 - 44ec: 89 83 std Y+1, r24 ; 0x01 - 44ee: c9 db rcall .-2158 ; 0x3c82 - 44f0: 89 81 ldd r24, Y+1 ; 0x01 - 44f2: c9 cf rjmp .-110 ; 0x4486 - 44f4: ef 5b subi r30, 0xBF ; 191 - 44f6: ff 4f sbci r31, 0xFF ; 255 - 44f8: 80 81 ld r24, Z - 44fa: 90 e0 ldi r25, 0x00 ; 0 - 44fc: e8 cf rjmp .-48 ; 0x44ce +00004800 : + 4800: 0f 93 push r16 + 4802: 1f 93 push r17 + 4804: cf 93 push r28 + 4806: df 93 push r29 + 4808: 1f 92 push r1 + 480a: cd b7 in r28, 0x3d ; 61 + 480c: de b7 in r29, 0x3e ; 62 + 480e: 20 91 14 27 lds r18, 0x2714 + 4812: 24 30 cpi r18, 0x04 ; 4 + 4814: 39 f0 breq .+14 ; 0x4824 + 4816: 82 e0 ldi r24, 0x02 ; 2 + 4818: 0f 90 pop r0 + 481a: df 91 pop r29 + 481c: cf 91 pop r28 + 481e: 1f 91 pop r17 + 4820: 0f 91 pop r16 + 4822: 08 95 ret + 4824: fc 01 movw r30, r24 + 4826: 44 89 ldd r20, Z+20 ; 0x14 + 4828: 55 89 ldd r21, Z+21 ; 0x15 + 482a: 66 89 ldd r22, Z+22 ; 0x16 + 482c: 77 89 ldd r23, Z+23 ; 0x17 + 482e: 45 2b or r20, r21 + 4830: 46 2b or r20, r22 + 4832: 47 2b or r20, r23 + 4834: 81 f3 breq .-32 ; 0x4816 + 4836: 81 81 ldd r24, Z+1 ; 0x01 + 4838: 33 dc rcall .-1946 ; 0x40a0 + 483a: 80 91 21 27 lds r24, 0x2721 + 483e: 20 91 1d 27 lds r18, 0x271D + 4842: 30 91 1e 27 lds r19, 0x271E + 4846: f9 01 movw r30, r18 + 4848: 87 fd sbrc r24, 7 + 484a: 1d c0 rjmp .+58 ; 0x4886 + 484c: e0 5c subi r30, 0xC0 ; 192 + 484e: ff 4f sbci r31, 0xFF ; 255 + 4850: 80 81 ld r24, Z + 4852: f9 01 movw r30, r18 + 4854: ef 5b subi r30, 0xBF ; 191 + 4856: ff 4f sbci r31, 0xFF ; 255 + 4858: 40 81 ld r20, Z + 485a: 90 e0 ldi r25, 0x00 ; 0 + 485c: 84 1b sub r24, r20 + 485e: 91 09 sbc r25, r1 + 4860: 89 2b or r24, r25 + 4862: 11 f4 brne .+4 ; 0x4868 + 4864: 80 e0 ldi r24, 0x00 ; 0 + 4866: d8 cf rjmp .-80 ; 0x4818 + 4868: 00 81 ld r16, Z + 486a: f9 01 movw r30, r18 + 486c: e0 5c subi r30, 0xC0 ; 192 + 486e: ff 4f sbci r31, 0xFF ; 255 + 4870: 10 81 ld r17, Z + 4872: d0 db rcall .-2144 ; 0x4014 + 4874: 01 17 cp r16, r17 + 4876: b0 f3 brcs .-20 ; 0x4864 + 4878: e3 dd rcall .-1082 ; 0x4440 + 487a: 81 11 cpse r24, r1 + 487c: cd cf rjmp .-102 ; 0x4818 + 487e: 89 83 std Y+1, r24 ; 0x01 + 4880: c9 db rcall .-2158 ; 0x4014 + 4882: 89 81 ldd r24, Y+1 ; 0x01 + 4884: c9 cf rjmp .-110 ; 0x4818 + 4886: ef 5b subi r30, 0xBF ; 191 + 4888: ff 4f sbci r31, 0xFF ; 255 + 488a: 80 81 ld r24, Z + 488c: 90 e0 ldi r25, 0x00 ; 0 + 488e: e8 cf rjmp .-48 ; 0x4860 -000044fe : - 44fe: cf 93 push r28 - 4500: df 93 push r29 - 4502: ec 01 movw r28, r24 - 4504: 80 91 14 23 lds r24, 0x2314 - 4508: 84 30 cpi r24, 0x04 ; 4 - 450a: 19 f0 breq .+6 ; 0x4512 - 450c: df 91 pop r29 - 450e: cf 91 pop r28 - 4510: 08 95 ret - 4512: 4c 89 ldd r20, Y+20 ; 0x14 - 4514: 5d 89 ldd r21, Y+21 ; 0x15 - 4516: 6e 89 ldd r22, Y+22 ; 0x16 - 4518: 7f 89 ldd r23, Y+23 ; 0x17 - 451a: 45 2b or r20, r21 - 451c: 46 2b or r20, r22 - 451e: 47 2b or r20, r23 - 4520: a9 f3 breq .-22 ; 0x450c - 4522: 89 81 ldd r24, Y+1 ; 0x01 - 4524: f4 db rcall .-2072 ; 0x3d0e - 4526: a6 dc rcall .-1716 ; 0x3e74 - 4528: 88 23 and r24, r24 - 452a: 81 f3 breq .-32 ; 0x450c - 452c: ce 01 movw r24, r28 - 452e: df 91 pop r29 - 4530: cf 91 pop r28 - 4532: 9d cf rjmp .-198 ; 0x446e +00004890 : + 4890: cf 93 push r28 + 4892: df 93 push r29 + 4894: ec 01 movw r28, r24 + 4896: 80 91 14 27 lds r24, 0x2714 + 489a: 84 30 cpi r24, 0x04 ; 4 + 489c: 19 f0 breq .+6 ; 0x48a4 + 489e: df 91 pop r29 + 48a0: cf 91 pop r28 + 48a2: 08 95 ret + 48a4: 4c 89 ldd r20, Y+20 ; 0x14 + 48a6: 5d 89 ldd r21, Y+21 ; 0x15 + 48a8: 6e 89 ldd r22, Y+22 ; 0x16 + 48aa: 7f 89 ldd r23, Y+23 ; 0x17 + 48ac: 45 2b or r20, r21 + 48ae: 46 2b or r20, r22 + 48b0: 47 2b or r20, r23 + 48b2: a9 f3 breq .-22 ; 0x489e + 48b4: 89 81 ldd r24, Y+1 ; 0x01 + 48b6: f4 db rcall .-2072 ; 0x40a0 + 48b8: a6 dc rcall .-1716 ; 0x4206 + 48ba: 88 23 and r24, r24 + 48bc: 81 f3 breq .-32 ; 0x489e + 48be: ce 01 movw r24, r28 + 48c0: df 91 pop r29 + 48c2: cf 91 pop r28 + 48c4: 9d cf rjmp .-198 ; 0x4800 -00004534 : - 4534: cf 93 push r28 - 4536: df 93 push r29 - 4538: 20 91 14 23 lds r18, 0x2314 - 453c: 24 30 cpi r18, 0x04 ; 4 - 453e: c1 f5 brne .+112 ; 0x45b0 - 4540: fc 01 movw r30, r24 - 4542: 44 89 ldd r20, Z+20 ; 0x14 - 4544: 55 89 ldd r21, Z+21 ; 0x15 - 4546: 66 89 ldd r22, Z+22 ; 0x16 - 4548: 77 89 ldd r23, Z+23 ; 0x17 - 454a: 45 2b or r20, r21 - 454c: 46 2b or r20, r22 - 454e: 47 2b or r20, r23 - 4550: 79 f1 breq .+94 ; 0x45b0 - 4552: 86 81 ldd r24, Z+6 ; 0x06 - 4554: dc db rcall .-2120 ; 0x3d0e - 4556: 75 dc rcall .-1814 ; 0x3e42 - 4558: 88 23 and r24, r24 - 455a: 51 f1 breq .+84 ; 0x45b0 - 455c: 80 91 21 23 lds r24, 0x2321 - 4560: 87 fd sbrc r24, 7 - 4562: 3d c0 rjmp .+122 ; 0x45de - 4564: 80 91 1d 23 lds r24, 0x231D - 4568: 90 91 1e 23 lds r25, 0x231E - 456c: fc 01 movw r30, r24 - 456e: e0 5c subi r30, 0xC0 ; 192 - 4570: ff 4f sbci r31, 0xFF ; 255 - 4572: 20 81 ld r18, Z - 4574: fc 01 movw r30, r24 - 4576: ef 5b subi r30, 0xBF ; 191 - 4578: ff 4f sbci r31, 0xFF ; 255 - 457a: 40 81 ld r20, Z - 457c: 30 e0 ldi r19, 0x00 ; 0 - 457e: 24 1b sub r18, r20 - 4580: 31 09 sbc r19, r1 - 4582: 23 2b or r18, r19 - 4584: d9 f4 brne .+54 ; 0x45bc - 4586: cf ef ldi r28, 0xFF ; 255 - 4588: df ef ldi r29, 0xFF ; 255 - 458a: 20 91 21 23 lds r18, 0x2321 - 458e: 27 fd sbrc r18, 7 - 4590: 23 c0 rjmp .+70 ; 0x45d8 - 4592: dc 01 movw r26, r24 - 4594: a0 5c subi r26, 0xC0 ; 192 - 4596: bf 4f sbci r27, 0xFF ; 255 - 4598: 8c 91 ld r24, X - 459a: 20 81 ld r18, Z - 459c: 90 e0 ldi r25, 0x00 ; 0 - 459e: 82 1b sub r24, r18 - 45a0: 91 09 sbc r25, r1 - 45a2: 89 2b or r24, r25 - 45a4: 39 f4 brne .+14 ; 0x45b4 - 45a6: 86 db rcall .-2292 ; 0x3cb4 - 45a8: ce 01 movw r24, r28 - 45aa: df 91 pop r29 - 45ac: cf 91 pop r28 - 45ae: 08 95 ret - 45b0: cf ef ldi r28, 0xFF ; 255 - 45b2: df ef ldi r29, 0xFF ; 255 - 45b4: ce 01 movw r24, r28 - 45b6: df 91 pop r29 - 45b8: cf 91 pop r28 - 45ba: 08 95 ret - 45bc: 8a db rcall .-2284 ; 0x3cd2 - 45be: c8 2f mov r28, r24 - 45c0: d0 e0 ldi r29, 0x00 ; 0 - 45c2: 80 91 1d 23 lds r24, 0x231D - 45c6: 90 91 1e 23 lds r25, 0x231E - 45ca: fc 01 movw r30, r24 - 45cc: ef 5b subi r30, 0xBF ; 191 - 45ce: ff 4f sbci r31, 0xFF ; 255 - 45d0: 20 91 21 23 lds r18, 0x2321 - 45d4: 27 ff sbrs r18, 7 - 45d6: dd cf rjmp .-70 ; 0x4592 - 45d8: 80 81 ld r24, Z - 45da: 90 e0 ldi r25, 0x00 ; 0 - 45dc: e2 cf rjmp .-60 ; 0x45a2 - 45de: 80 91 1d 23 lds r24, 0x231D - 45e2: 90 91 1e 23 lds r25, 0x231E - 45e6: fc 01 movw r30, r24 - 45e8: ef 5b subi r30, 0xBF ; 191 - 45ea: ff 4f sbci r31, 0xFF ; 255 - 45ec: 20 81 ld r18, Z - 45ee: 30 e0 ldi r19, 0x00 ; 0 - 45f0: c8 cf rjmp .-112 ; 0x4582 +000048c6 : + 48c6: cf 93 push r28 + 48c8: df 93 push r29 + 48ca: 20 91 14 27 lds r18, 0x2714 + 48ce: 24 30 cpi r18, 0x04 ; 4 + 48d0: c1 f5 brne .+112 ; 0x4942 + 48d2: fc 01 movw r30, r24 + 48d4: 44 89 ldd r20, Z+20 ; 0x14 + 48d6: 55 89 ldd r21, Z+21 ; 0x15 + 48d8: 66 89 ldd r22, Z+22 ; 0x16 + 48da: 77 89 ldd r23, Z+23 ; 0x17 + 48dc: 45 2b or r20, r21 + 48de: 46 2b or r20, r22 + 48e0: 47 2b or r20, r23 + 48e2: 79 f1 breq .+94 ; 0x4942 + 48e4: 86 81 ldd r24, Z+6 ; 0x06 + 48e6: dc db rcall .-2120 ; 0x40a0 + 48e8: 75 dc rcall .-1814 ; 0x41d4 + 48ea: 88 23 and r24, r24 + 48ec: 51 f1 breq .+84 ; 0x4942 + 48ee: 80 91 21 27 lds r24, 0x2721 + 48f2: 87 fd sbrc r24, 7 + 48f4: 3d c0 rjmp .+122 ; 0x4970 + 48f6: 80 91 1d 27 lds r24, 0x271D + 48fa: 90 91 1e 27 lds r25, 0x271E + 48fe: fc 01 movw r30, r24 + 4900: e0 5c subi r30, 0xC0 ; 192 + 4902: ff 4f sbci r31, 0xFF ; 255 + 4904: 20 81 ld r18, Z + 4906: fc 01 movw r30, r24 + 4908: ef 5b subi r30, 0xBF ; 191 + 490a: ff 4f sbci r31, 0xFF ; 255 + 490c: 40 81 ld r20, Z + 490e: 30 e0 ldi r19, 0x00 ; 0 + 4910: 24 1b sub r18, r20 + 4912: 31 09 sbc r19, r1 + 4914: 23 2b or r18, r19 + 4916: d9 f4 brne .+54 ; 0x494e + 4918: cf ef ldi r28, 0xFF ; 255 + 491a: df ef ldi r29, 0xFF ; 255 + 491c: 20 91 21 27 lds r18, 0x2721 + 4920: 27 fd sbrc r18, 7 + 4922: 23 c0 rjmp .+70 ; 0x496a + 4924: dc 01 movw r26, r24 + 4926: a0 5c subi r26, 0xC0 ; 192 + 4928: bf 4f sbci r27, 0xFF ; 255 + 492a: 8c 91 ld r24, X + 492c: 20 81 ld r18, Z + 492e: 90 e0 ldi r25, 0x00 ; 0 + 4930: 82 1b sub r24, r18 + 4932: 91 09 sbc r25, r1 + 4934: 89 2b or r24, r25 + 4936: 39 f4 brne .+14 ; 0x4946 + 4938: 86 db rcall .-2292 ; 0x4046 + 493a: ce 01 movw r24, r28 + 493c: df 91 pop r29 + 493e: cf 91 pop r28 + 4940: 08 95 ret + 4942: cf ef ldi r28, 0xFF ; 255 + 4944: df ef ldi r29, 0xFF ; 255 + 4946: ce 01 movw r24, r28 + 4948: df 91 pop r29 + 494a: cf 91 pop r28 + 494c: 08 95 ret + 494e: 8a db rcall .-2284 ; 0x4064 + 4950: c8 2f mov r28, r24 + 4952: d0 e0 ldi r29, 0x00 ; 0 + 4954: 80 91 1d 27 lds r24, 0x271D + 4958: 90 91 1e 27 lds r25, 0x271E + 495c: fc 01 movw r30, r24 + 495e: ef 5b subi r30, 0xBF ; 191 + 4960: ff 4f sbci r31, 0xFF ; 255 + 4962: 20 91 21 27 lds r18, 0x2721 + 4966: 27 ff sbrs r18, 7 + 4968: dd cf rjmp .-70 ; 0x4924 + 496a: 80 81 ld r24, Z + 496c: 90 e0 ldi r25, 0x00 ; 0 + 496e: e2 cf rjmp .-60 ; 0x4934 + 4970: 80 91 1d 27 lds r24, 0x271D + 4974: 90 91 1e 27 lds r25, 0x271E + 4978: fc 01 movw r30, r24 + 497a: ef 5b subi r30, 0xBF ; 191 + 497c: ff 4f sbci r31, 0xFF ; 255 + 497e: 20 81 ld r18, Z + 4980: 30 e0 ldi r19, 0x00 ; 0 + 4982: c8 cf rjmp .-112 ; 0x4914 -000045f2 : +00004984 : return ReceivedByte; } #endif void CDC_Device_Event_Stub(void) { - 45f2: 08 95 ret + 4984: 08 95 ret -000045f4 : +00004986 : #define __INCLUDE_FROM_CDC_DRIVER #define __INCLUDE_FROM_CDC_DEVICE_C #include "CDCClassDevice.h" void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) { - 45f4: ff 92 push r15 - 45f6: 0f 93 push r16 - 45f8: 1f 93 push r17 - 45fa: cf 93 push r28 - 45fc: df 93 push r29 - 45fe: ec 01 movw r28, r24 + 4986: ff 92 push r15 + 4988: 0f 93 push r16 + 498a: 1f 93 push r17 + 498c: cf 93 push r28 + 498e: df 93 push r29 + 4990: ec 01 movw r28, r24 if (!(Endpoint_IsSETUPReceived())) - 4600: 07 dc rcall .-2034 ; 0x3e10 - 4602: 88 23 and r24, r24 - 4604: 49 f0 breq .+18 ; 0x4618 + 4992: 07 dc rcall .-2034 ; 0x41a2 + 4994: 88 23 and r24, r24 + 4996: 49 f0 breq .+18 ; 0x49aa return; if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) - 4606: 88 81 ld r24, Y - 4608: 90 e0 ldi r25, 0x00 ; 0 - 460a: 20 91 19 23 lds r18, 0x2319 - 460e: 30 91 1a 23 lds r19, 0x231A - 4612: 28 17 cp r18, r24 - 4614: 39 07 cpc r19, r25 - 4616: 31 f0 breq .+12 ; 0x4624 + 4998: 88 81 ld r24, Y + 499a: 90 e0 ldi r25, 0x00 ; 0 + 499c: 20 91 19 27 lds r18, 0x2719 + 49a0: 30 91 1a 27 lds r19, 0x271A + 49a4: 28 17 cp r18, r24 + 49a6: 39 07 cpc r19, r25 + 49a8: 31 f0 breq .+12 ; 0x49b6 EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); } break; } } - 4618: df 91 pop r29 - 461a: cf 91 pop r28 - 461c: 1f 91 pop r17 - 461e: 0f 91 pop r16 - 4620: ff 90 pop r15 - 4622: 08 95 ret + 49aa: df 91 pop r29 + 49ac: cf 91 pop r28 + 49ae: 1f 91 pop r17 + 49b0: 0f 91 pop r16 + 49b2: ff 90 pop r15 + 49b4: 08 95 ret return; if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) return; switch (USB_ControlRequest.bRequest) - 4624: 80 91 16 23 lds r24, 0x2316 - 4628: 81 32 cpi r24, 0x21 ; 33 - 462a: 09 f4 brne .+2 ; 0x462e - 462c: 4b c0 rjmp .+150 ; 0x46c4 - 462e: 08 f0 brcs .+2 ; 0x4632 - 4630: 33 c0 rjmp .+102 ; 0x4698 - 4632: 80 32 cpi r24, 0x20 ; 32 - 4634: 89 f7 brne .-30 ; 0x4618 + 49b6: 80 91 16 27 lds r24, 0x2716 + 49ba: 81 32 cpi r24, 0x21 ; 33 + 49bc: 09 f4 brne .+2 ; 0x49c0 + 49be: 4b c0 rjmp .+150 ; 0x4a56 + 49c0: 08 f0 brcs .+2 ; 0x49c4 + 49c2: 33 c0 rjmp .+102 ; 0x4a2a + 49c4: 80 32 cpi r24, 0x20 ; 32 + 49c6: 89 f7 brne .-30 ; 0x49aa Endpoint_ClearStatusStage(); } break; case CDC_REQ_SetLineEncoding: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 4636: 80 91 15 23 lds r24, 0x2315 - 463a: 81 32 cpi r24, 0x21 ; 33 - 463c: 69 f7 brne .-38 ; 0x4618 + 49c8: 80 91 15 27 lds r24, 0x2715 + 49cc: 81 32 cpi r24, 0x21 ; 33 + 49ce: 69 f7 brne .-38 ; 0x49aa { Endpoint_ClearSETUP(); - 463e: bc db rcall .-2184 ; 0x3db8 + 49d0: bc db rcall .-2184 ; 0x414a while (!(Endpoint_IsOUTReceived())) - 4640: 04 c0 rjmp .+8 ; 0x464a + 49d2: 04 c0 rjmp .+8 ; 0x49dc { if (USB_DeviceState == DEVICE_STATE_Unattached) - 4642: 80 91 14 23 lds r24, 0x2314 - 4646: 88 23 and r24, r24 - 4648: 39 f3 breq .-50 ; 0x4618 + 49d4: 80 91 14 27 lds r24, 0x2714 + 49d8: 88 23 and r24, r24 + 49da: 39 f3 breq .-50 ; 0x49aa case CDC_REQ_SetLineEncoding: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); while (!(Endpoint_IsOUTReceived())) - 464a: fb db rcall .-2058 ; 0x3e42 - 464c: 88 23 and r24, r24 - 464e: c9 f3 breq .-14 ; 0x4642 + 49dc: fb db rcall .-2058 ; 0x41d4 + 49de: 88 23 and r24, r24 + 49e0: c9 f3 breq .-14 ; 0x49d4 * \return Next four bytes in the currently selected endpoint's FIFO buffer. */ static inline uint32_t Endpoint_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Endpoint_Read_32_LE(void) { uint32_t Byte0 = Endpoint_Read_8(); - 4650: 40 db rcall .-2432 ; 0x3cd2 - 4652: 08 2f mov r16, r24 + 49e2: 40 db rcall .-2432 ; 0x4064 + 49e4: 08 2f mov r16, r24 uint32_t Byte1 = Endpoint_Read_8(); - 4654: 3e db rcall .-2436 ; 0x3cd2 - 4656: 18 2f mov r17, r24 + 49e6: 3e db rcall .-2436 ; 0x4064 + 49e8: 18 2f mov r17, r24 uint32_t Byte2 = Endpoint_Read_8(); - 4658: 3c db rcall .-2440 ; 0x3cd2 - 465a: f8 2e mov r15, r24 + 49ea: 3c db rcall .-2440 ; 0x4064 + 49ec: f8 2e mov r15, r24 uint32_t Byte3 = Endpoint_Read_8(); - 465c: 3a db rcall .-2444 ; 0x3cd2 + 49ee: 3a db rcall .-2444 ; 0x4064 static inline uint32_t Endpoint_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint32_t Endpoint_Read_32_LE(void) { uint32_t Byte0 = Endpoint_Read_8(); uint32_t Byte1 = Endpoint_Read_8(); uint32_t Byte2 = Endpoint_Read_8(); - 465e: 4f 2d mov r20, r15 - 4660: 50 e0 ldi r21, 0x00 ; 0 - 4662: 60 e0 ldi r22, 0x00 ; 0 - 4664: 70 e0 ldi r23, 0x00 ; 0 + 49f0: 4f 2d mov r20, r15 + 49f2: 50 e0 ldi r21, 0x00 ; 0 + 49f4: 60 e0 ldi r22, 0x00 ; 0 + 49f6: 70 e0 ldi r23, 0x00 ; 0 uint32_t Byte3 = Endpoint_Read_8(); return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0); - 4666: ba 01 movw r22, r20 - 4668: 55 27 eor r21, r21 - 466a: 44 27 eor r20, r20 - 466c: 78 2b or r23, r24 - 466e: 40 2b or r20, r16 - 4670: 51 2b or r21, r17 + 49f8: ba 01 movw r22, r20 + 49fa: 55 27 eor r21, r21 + 49fc: 44 27 eor r20, r20 + 49fe: 78 2b or r23, r24 + 4a00: 40 2b or r20, r16 + 4a02: 51 2b or r21, r17 { if (USB_DeviceState == DEVICE_STATE_Unattached) return; } CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE(); - 4672: 4c 8b std Y+20, r20 ; 0x14 - 4674: 5d 8b std Y+21, r21 ; 0x15 - 4676: 6e 8b std Y+22, r22 ; 0x16 - 4678: 7f 8b std Y+23, r23 ; 0x17 + 4a04: 4c 8b std Y+20, r20 ; 0x14 + 4a06: 5d 8b std Y+21, r21 ; 0x15 + 4a08: 6e 8b std Y+22, r22 ; 0x16 + 4a0a: 7f 8b std Y+23, r23 ; 0x17 CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8(); - 467a: 2b db rcall .-2474 ; 0x3cd2 - 467c: 88 8f std Y+24, r24 ; 0x18 + 4a0c: 2b db rcall .-2474 ; 0x4064 + 4a0e: 88 8f std Y+24, r24 ; 0x18 CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8(); - 467e: 29 db rcall .-2478 ; 0x3cd2 - 4680: 89 8f std Y+25, r24 ; 0x19 + 4a10: 29 db rcall .-2478 ; 0x4064 + 4a12: 89 8f std Y+25, r24 ; 0x19 CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); - 4682: 27 db rcall .-2482 ; 0x3cd2 - 4684: 8a 8f std Y+26, r24 ; 0x1a + 4a14: 27 db rcall .-2482 ; 0x4064 + 4a16: 8a 8f std Y+26, r24 ; 0x1a Endpoint_ClearOUT(); - 4686: 16 db rcall .-2516 ; 0x3cb4 + 4a18: 16 db rcall .-2516 ; 0x4046 Endpoint_ClearStatusStage(); - 4688: fc dc rcall .-1544 ; 0x4082 + 4a1a: fc dc rcall .-1544 ; 0x4414 EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - 468a: ce 01 movw r24, r28 + 4a1c: ce 01 movw r24, r28 EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); } break; } } - 468c: df 91 pop r29 - 468e: cf 91 pop r28 - 4690: 1f 91 pop r17 - 4692: 0f 91 pop r16 - 4694: ff 90 pop r15 + 4a1e: df 91 pop r29 + 4a20: cf 91 pop r28 + 4a22: 1f 91 pop r17 + 4a24: 0f 91 pop r16 + 4a26: ff 90 pop r15 CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); Endpoint_ClearOUT(); Endpoint_ClearStatusStage(); EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - 4696: ad cf rjmp .-166 ; 0x45f2 + 4a28: ad cf rjmp .-166 ; 0x4984 return; if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) return; switch (USB_ControlRequest.bRequest) - 4698: 82 32 cpi r24, 0x22 ; 34 - 469a: 09 f4 brne .+2 ; 0x469e - 469c: 34 c0 rjmp .+104 ; 0x4706 - 469e: 83 32 cpi r24, 0x23 ; 35 - 46a0: 09 f0 breq .+2 ; 0x46a4 - 46a2: ba cf rjmp .-140 ; 0x4618 + 4a2a: 82 32 cpi r24, 0x22 ; 34 + 4a2c: 09 f4 brne .+2 ; 0x4a30 + 4a2e: 34 c0 rjmp .+104 ; 0x4a98 + 4a30: 83 32 cpi r24, 0x23 ; 35 + 4a32: 09 f0 breq .+2 ; 0x4a36 + 4a34: ba cf rjmp .-140 ; 0x49aa EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); } break; case CDC_REQ_SendBreak: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 46a4: 80 91 15 23 lds r24, 0x2315 - 46a8: 81 32 cpi r24, 0x21 ; 33 - 46aa: 09 f0 breq .+2 ; 0x46ae - 46ac: b5 cf rjmp .-150 ; 0x4618 + 4a36: 80 91 15 27 lds r24, 0x2715 + 4a3a: 81 32 cpi r24, 0x21 ; 33 + 4a3c: 09 f0 breq .+2 ; 0x4a40 + 4a3e: b5 cf rjmp .-150 ; 0x49aa { Endpoint_ClearSETUP(); - 46ae: 84 db rcall .-2296 ; 0x3db8 + 4a40: 84 db rcall .-2296 ; 0x414a Endpoint_ClearStatusStage(); - 46b0: e8 dc rcall .-1584 ; 0x4082 + 4a42: e8 dc rcall .-1584 ; 0x4414 EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - 46b2: 60 91 17 23 lds r22, 0x2317 - 46b6: ce 01 movw r24, r28 + 4a44: 60 91 17 27 lds r22, 0x2717 + 4a48: ce 01 movw r24, r28 } break; } } - 46b8: df 91 pop r29 - 46ba: cf 91 pop r28 - 46bc: 1f 91 pop r17 - 46be: 0f 91 pop r16 - 46c0: ff 90 pop r15 + 4a4a: df 91 pop r29 + 4a4c: cf 91 pop r28 + 4a4e: 1f 91 pop r17 + 4a50: 0f 91 pop r16 + 4a52: ff 90 pop r15 if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); Endpoint_ClearStatusStage(); EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - 46c2: 97 cf rjmp .-210 ; 0x45f2 + 4a54: 97 cf rjmp .-210 ; 0x4984 return; switch (USB_ControlRequest.bRequest) { case CDC_REQ_GetLineEncoding: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) - 46c4: 80 91 15 23 lds r24, 0x2315 - 46c8: 81 3a cpi r24, 0xA1 ; 161 - 46ca: 09 f0 breq .+2 ; 0x46ce - 46cc: a5 cf rjmp .-182 ; 0x4618 + 4a56: 80 91 15 27 lds r24, 0x2715 + 4a5a: 81 3a cpi r24, 0xA1 ; 161 + 4a5c: 09 f0 breq .+2 ; 0x4a60 + 4a5e: a5 cf rjmp .-182 ; 0x49aa { Endpoint_ClearSETUP(); - 46ce: 74 db rcall .-2328 ; 0x3db8 + 4a60: 74 db rcall .-2328 ; 0x414a while (!(Endpoint_IsINReady())); - 46d0: d1 db rcall .-2142 ; 0x3e74 - 46d2: 88 23 and r24, r24 - 46d4: e9 f3 breq .-6 ; 0x46d0 + 4a62: d1 db rcall .-2142 ; 0x4206 + 4a64: 88 23 and r24, r24 + 4a66: e9 f3 breq .-6 ; 0x4a62 Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS); - 46d6: 8c 89 ldd r24, Y+20 ; 0x14 - 46d8: fd 88 ldd r15, Y+21 ; 0x15 - 46da: 0e 89 ldd r16, Y+22 ; 0x16 - 46dc: 1f 89 ldd r17, Y+23 ; 0x17 + 4a68: 8c 89 ldd r24, Y+20 ; 0x14 + 4a6a: fd 88 ldd r15, Y+21 ; 0x15 + 4a6c: 0e 89 ldd r16, Y+22 ; 0x16 + 4a6e: 1f 89 ldd r17, Y+23 ; 0x17 * \param[in] Data Data to write to the currently selected endpoint's FIFO buffer. */ static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_32_LE(const uint32_t Data) { Endpoint_Write_8(Data & 0xFF); - 46de: 08 db rcall .-2544 ; 0x3cf0 + 4a70: 08 db rcall .-2544 ; 0x4082 Endpoint_Write_8(Data >> 8); - 46e0: 8f 2d mov r24, r15 - 46e2: 06 db rcall .-2548 ; 0x3cf0 + 4a72: 8f 2d mov r24, r15 + 4a74: 06 db rcall .-2548 ; 0x4082 Endpoint_Write_8(Data >> 16); - 46e4: 80 2f mov r24, r16 - 46e6: 04 db rcall .-2552 ; 0x3cf0 + 4a76: 80 2f mov r24, r16 + 4a78: 04 db rcall .-2552 ; 0x4082 Endpoint_Write_8(Data >> 24); - 46e8: 81 2f mov r24, r17 - 46ea: 02 db rcall .-2556 ; 0x3cf0 + 4a7a: 81 2f mov r24, r17 + 4a7c: 02 db rcall .-2556 ; 0x4082 Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat); - 46ec: 88 8d ldd r24, Y+24 ; 0x18 - 46ee: 00 db rcall .-2560 ; 0x3cf0 + 4a7e: 88 8d ldd r24, Y+24 ; 0x18 + 4a80: 00 db rcall .-2560 ; 0x4082 Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType); - 46f0: 89 8d ldd r24, Y+25 ; 0x19 - 46f2: fe da rcall .-2564 ; 0x3cf0 + 4a82: 89 8d ldd r24, Y+25 ; 0x19 + 4a84: fe da rcall .-2564 ; 0x4082 Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits); - 46f4: 8a 8d ldd r24, Y+26 ; 0x1a - 46f6: fc da rcall .-2568 ; 0x3cf0 + 4a86: 8a 8d ldd r24, Y+26 ; 0x1a + 4a88: fc da rcall .-2568 ; 0x4082 Endpoint_ClearIN(); - 46f8: c4 da rcall .-2680 ; 0x3c82 + 4a8a: c4 da rcall .-2680 ; 0x4014 EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); } break; } } - 46fa: df 91 pop r29 - 46fc: cf 91 pop r28 - 46fe: 1f 91 pop r17 - 4700: 0f 91 pop r16 - 4702: ff 90 pop r15 + 4a8c: df 91 pop r29 + 4a8e: cf 91 pop r28 + 4a90: 1f 91 pop r17 + 4a92: 0f 91 pop r16 + 4a94: ff 90 pop r15 Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat); Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType); Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits); Endpoint_ClearIN(); Endpoint_ClearStatusStage(); - 4704: be cc rjmp .-1668 ; 0x4082 + 4a96: be cc rjmp .-1668 ; 0x4414 EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); } break; case CDC_REQ_SetControlLineState: if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 4706: 80 91 15 23 lds r24, 0x2315 - 470a: 81 32 cpi r24, 0x21 ; 33 - 470c: 09 f0 breq .+2 ; 0x4710 - 470e: 84 cf rjmp .-248 ; 0x4618 + 4a98: 80 91 15 27 lds r24, 0x2715 + 4a9c: 81 32 cpi r24, 0x21 ; 33 + 4a9e: 09 f0 breq .+2 ; 0x4aa2 + 4aa0: 84 cf rjmp .-248 ; 0x49aa { Endpoint_ClearSETUP(); - 4710: 53 db rcall .-2394 ; 0x3db8 + 4aa2: 53 db rcall .-2394 ; 0x414a Endpoint_ClearStatusStage(); - 4712: b7 dc rcall .-1682 ; 0x4082 + 4aa4: b7 dc rcall .-1682 ; 0x4414 CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; - 4714: 80 91 17 23 lds r24, 0x2317 - 4718: 90 91 18 23 lds r25, 0x2318 - 471c: 88 8b std Y+16, r24 ; 0x10 - 471e: 99 8b std Y+17, r25 ; 0x11 + 4aa6: 80 91 17 27 lds r24, 0x2717 + 4aaa: 90 91 18 27 lds r25, 0x2718 + 4aae: 88 8b std Y+16, r24 ; 0x10 + 4ab0: 99 8b std Y+17, r25 ; 0x11 EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - 4720: ce 01 movw r24, r28 + 4ab2: ce 01 movw r24, r28 EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); } break; } } - 4722: df 91 pop r29 - 4724: cf 91 pop r28 - 4726: 1f 91 pop r17 - 4728: 0f 91 pop r16 - 472a: ff 90 pop r15 + 4ab4: df 91 pop r29 + 4ab6: cf 91 pop r28 + 4ab8: 1f 91 pop r17 + 4aba: 0f 91 pop r16 + 4abc: ff 90 pop r15 Endpoint_ClearSETUP(); Endpoint_ClearStatusStage(); CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - 472c: 62 cf rjmp .-316 ; 0x45f2 + 4abe: 62 cf rjmp .-316 ; 0x4984 -0000472e <__mulshisi3>: - 472e: b7 ff sbrs r27, 7 - 4730: 04 c0 rjmp .+8 ; 0x473a <__muluhisi3> +00004ac0 <__mulshisi3>: + 4ac0: b7 ff sbrs r27, 7 + 4ac2: 04 c0 rjmp .+8 ; 0x4acc <__muluhisi3> -00004732 <__mulohisi3>: - 4732: 03 d0 rcall .+6 ; 0x473a <__muluhisi3> - 4734: 82 1b sub r24, r18 - 4736: 93 0b sbc r25, r19 - 4738: 08 95 ret +00004ac4 <__mulohisi3>: + 4ac4: 03 d0 rcall .+6 ; 0x4acc <__muluhisi3> + 4ac6: 82 1b sub r24, r18 + 4ac8: 93 0b sbc r25, r19 + 4aca: 08 95 ret -0000473a <__muluhisi3>: - 473a: 09 d0 rcall .+18 ; 0x474e <__umulhisi3> - 473c: a5 9f mul r26, r21 - 473e: 90 0d add r25, r0 - 4740: b4 9f mul r27, r20 - 4742: 90 0d add r25, r0 - 4744: a4 9f mul r26, r20 - 4746: 80 0d add r24, r0 - 4748: 91 1d adc r25, r1 - 474a: 11 24 eor r1, r1 - 474c: 08 95 ret +00004acc <__muluhisi3>: + 4acc: 09 d0 rcall .+18 ; 0x4ae0 <__umulhisi3> + 4ace: a5 9f mul r26, r21 + 4ad0: 90 0d add r25, r0 + 4ad2: b4 9f mul r27, r20 + 4ad4: 90 0d add r25, r0 + 4ad6: a4 9f mul r26, r20 + 4ad8: 80 0d add r24, r0 + 4ada: 91 1d adc r25, r1 + 4adc: 11 24 eor r1, r1 + 4ade: 08 95 ret -0000474e <__umulhisi3>: - 474e: a2 9f mul r26, r18 - 4750: b0 01 movw r22, r0 - 4752: b3 9f mul r27, r19 - 4754: c0 01 movw r24, r0 - 4756: a3 9f mul r26, r19 - 4758: 01 d0 rcall .+2 ; 0x475c <__umulhisi3+0xe> - 475a: b2 9f mul r27, r18 - 475c: 70 0d add r23, r0 - 475e: 81 1d adc r24, r1 - 4760: 11 24 eor r1, r1 - 4762: 91 1d adc r25, r1 - 4764: 08 95 ret +00004ae0 <__umulhisi3>: + 4ae0: a2 9f mul r26, r18 + 4ae2: b0 01 movw r22, r0 + 4ae4: b3 9f mul r27, r19 + 4ae6: c0 01 movw r24, r0 + 4ae8: a3 9f mul r26, r19 + 4aea: 01 d0 rcall .+2 ; 0x4aee <__umulhisi3+0xe> + 4aec: b2 9f mul r27, r18 + 4aee: 70 0d add r23, r0 + 4af0: 81 1d adc r24, r1 + 4af2: 11 24 eor r1, r1 + 4af4: 91 1d adc r25, r1 + 4af6: 08 95 ret -00004766 : - 4766: 8f 92 push r8 - 4768: 9f 92 push r9 - 476a: af 92 push r10 - 476c: bf 92 push r11 - 476e: cf 92 push r12 - 4770: df 92 push r13 - 4772: ef 92 push r14 - 4774: ff 92 push r15 - 4776: cf 93 push r28 - 4778: df 93 push r29 - 477a: ec 01 movw r28, r24 - 477c: 68 81 ld r22, Y - 477e: 79 81 ldd r23, Y+1 ; 0x01 - 4780: 8a 81 ldd r24, Y+2 ; 0x02 - 4782: 9b 81 ldd r25, Y+3 ; 0x03 - 4784: 61 15 cp r22, r1 - 4786: 71 05 cpc r23, r1 - 4788: 81 05 cpc r24, r1 - 478a: 91 05 cpc r25, r1 - 478c: 21 f4 brne .+8 ; 0x4796 - 478e: 64 e2 ldi r22, 0x24 ; 36 - 4790: 79 ed ldi r23, 0xD9 ; 217 - 4792: 8b e5 ldi r24, 0x5B ; 91 - 4794: 97 e0 ldi r25, 0x07 ; 7 - 4796: 2d e1 ldi r18, 0x1D ; 29 - 4798: 33 ef ldi r19, 0xF3 ; 243 - 479a: 41 e0 ldi r20, 0x01 ; 1 - 479c: 50 e0 ldi r21, 0x00 ; 0 - 479e: 38 d3 rcall .+1648 ; 0x4e10 <__divmodsi4> - 47a0: 49 01 movw r8, r18 - 47a2: 5a 01 movw r10, r20 - 47a4: 9b 01 movw r18, r22 - 47a6: ac 01 movw r20, r24 - 47a8: a7 ea ldi r26, 0xA7 ; 167 - 47aa: b1 e4 ldi r27, 0x41 ; 65 - 47ac: c6 df rcall .-116 ; 0x473a <__muluhisi3> - 47ae: 6b 01 movw r12, r22 - 47b0: 7c 01 movw r14, r24 - 47b2: ac ee ldi r26, 0xEC ; 236 - 47b4: b4 ef ldi r27, 0xF4 ; 244 - 47b6: a5 01 movw r20, r10 - 47b8: 94 01 movw r18, r8 - 47ba: bb df rcall .-138 ; 0x4732 <__mulohisi3> - 47bc: c6 0e add r12, r22 - 47be: d7 1e adc r13, r23 - 47c0: e8 1e adc r14, r24 - 47c2: f9 1e adc r15, r25 - 47c4: f7 fe sbrs r15, 7 - 47c6: 06 c0 rjmp .+12 ; 0x47d4 - 47c8: 81 e0 ldi r24, 0x01 ; 1 - 47ca: c8 1a sub r12, r24 - 47cc: d1 08 sbc r13, r1 - 47ce: e1 08 sbc r14, r1 - 47d0: 80 e8 ldi r24, 0x80 ; 128 - 47d2: f8 0a sbc r15, r24 - 47d4: c8 82 st Y, r12 - 47d6: d9 82 std Y+1, r13 ; 0x01 - 47d8: ea 82 std Y+2, r14 ; 0x02 - 47da: fb 82 std Y+3, r15 ; 0x03 - 47dc: e8 94 clt - 47de: d7 f8 bld r13, 7 - 47e0: ee 24 eor r14, r14 - 47e2: ff 24 eor r15, r15 - 47e4: c6 01 movw r24, r12 - 47e6: df 91 pop r29 - 47e8: cf 91 pop r28 - 47ea: ff 90 pop r15 - 47ec: ef 90 pop r14 - 47ee: df 90 pop r13 - 47f0: cf 90 pop r12 - 47f2: bf 90 pop r11 - 47f4: af 90 pop r10 - 47f6: 9f 90 pop r9 - 47f8: 8f 90 pop r8 - 47fa: 08 95 ret +00004af8 : + 4af8: 8f 92 push r8 + 4afa: 9f 92 push r9 + 4afc: af 92 push r10 + 4afe: bf 92 push r11 + 4b00: cf 92 push r12 + 4b02: df 92 push r13 + 4b04: ef 92 push r14 + 4b06: ff 92 push r15 + 4b08: cf 93 push r28 + 4b0a: df 93 push r29 + 4b0c: ec 01 movw r28, r24 + 4b0e: 68 81 ld r22, Y + 4b10: 79 81 ldd r23, Y+1 ; 0x01 + 4b12: 8a 81 ldd r24, Y+2 ; 0x02 + 4b14: 9b 81 ldd r25, Y+3 ; 0x03 + 4b16: 61 15 cp r22, r1 + 4b18: 71 05 cpc r23, r1 + 4b1a: 81 05 cpc r24, r1 + 4b1c: 91 05 cpc r25, r1 + 4b1e: 21 f4 brne .+8 ; 0x4b28 + 4b20: 64 e2 ldi r22, 0x24 ; 36 + 4b22: 79 ed ldi r23, 0xD9 ; 217 + 4b24: 8b e5 ldi r24, 0x5B ; 91 + 4b26: 97 e0 ldi r25, 0x07 ; 7 + 4b28: 2d e1 ldi r18, 0x1D ; 29 + 4b2a: 33 ef ldi r19, 0xF3 ; 243 + 4b2c: 41 e0 ldi r20, 0x01 ; 1 + 4b2e: 50 e0 ldi r21, 0x00 ; 0 + 4b30: 38 d3 rcall .+1648 ; 0x51a2 <__divmodsi4> + 4b32: 49 01 movw r8, r18 + 4b34: 5a 01 movw r10, r20 + 4b36: 9b 01 movw r18, r22 + 4b38: ac 01 movw r20, r24 + 4b3a: a7 ea ldi r26, 0xA7 ; 167 + 4b3c: b1 e4 ldi r27, 0x41 ; 65 + 4b3e: c6 df rcall .-116 ; 0x4acc <__muluhisi3> + 4b40: 6b 01 movw r12, r22 + 4b42: 7c 01 movw r14, r24 + 4b44: ac ee ldi r26, 0xEC ; 236 + 4b46: b4 ef ldi r27, 0xF4 ; 244 + 4b48: a5 01 movw r20, r10 + 4b4a: 94 01 movw r18, r8 + 4b4c: bb df rcall .-138 ; 0x4ac4 <__mulohisi3> + 4b4e: c6 0e add r12, r22 + 4b50: d7 1e adc r13, r23 + 4b52: e8 1e adc r14, r24 + 4b54: f9 1e adc r15, r25 + 4b56: f7 fe sbrs r15, 7 + 4b58: 06 c0 rjmp .+12 ; 0x4b66 + 4b5a: 81 e0 ldi r24, 0x01 ; 1 + 4b5c: c8 1a sub r12, r24 + 4b5e: d1 08 sbc r13, r1 + 4b60: e1 08 sbc r14, r1 + 4b62: 80 e8 ldi r24, 0x80 ; 128 + 4b64: f8 0a sbc r15, r24 + 4b66: c8 82 st Y, r12 + 4b68: d9 82 std Y+1, r13 ; 0x01 + 4b6a: ea 82 std Y+2, r14 ; 0x02 + 4b6c: fb 82 std Y+3, r15 ; 0x03 + 4b6e: e8 94 clt + 4b70: d7 f8 bld r13, 7 + 4b72: ee 24 eor r14, r14 + 4b74: ff 24 eor r15, r15 + 4b76: c6 01 movw r24, r12 + 4b78: df 91 pop r29 + 4b7a: cf 91 pop r28 + 4b7c: ff 90 pop r15 + 4b7e: ef 90 pop r14 + 4b80: df 90 pop r13 + 4b82: cf 90 pop r12 + 4b84: bf 90 pop r11 + 4b86: af 90 pop r10 + 4b88: 9f 90 pop r9 + 4b8a: 8f 90 pop r8 + 4b8c: 08 95 ret -000047fc : - 47fc: b4 cf rjmp .-152 ; 0x4766 +00004b8e : + 4b8e: b4 cf rjmp .-152 ; 0x4af8 -000047fe : - 47fe: 8c e1 ldi r24, 0x1C ; 28 - 4800: 90 e2 ldi r25, 0x20 ; 32 - 4802: b1 cf rjmp .-158 ; 0x4766 +00004b90 : + 4b90: 8c e1 ldi r24, 0x1C ; 28 + 4b92: 90 e2 ldi r25, 0x20 ; 32 + 4b94: b1 cf rjmp .-158 ; 0x4af8 -00004804 : - 4804: a0 e0 ldi r26, 0x00 ; 0 - 4806: b0 e0 ldi r27, 0x00 ; 0 - 4808: 80 93 1c 20 sts 0x201C, r24 - 480c: 90 93 1d 20 sts 0x201D, r25 - 4810: a0 93 1e 20 sts 0x201E, r26 - 4814: b0 93 1f 20 sts 0x201F, r27 - 4818: 08 95 ret +00004b96 : + 4b96: a0 e0 ldi r26, 0x00 ; 0 + 4b98: b0 e0 ldi r27, 0x00 ; 0 + 4b9a: 80 93 1c 20 sts 0x201C, r24 + 4b9e: 90 93 1d 20 sts 0x201D, r25 + 4ba2: a0 93 1e 20 sts 0x201E, r26 + 4ba6: b0 93 1f 20 sts 0x201F, r27 + 4baa: 08 95 ret -0000481a : - 481a: fb 01 movw r30, r22 - 481c: dc 01 movw r26, r24 - 481e: 02 c0 rjmp .+4 ; 0x4824 - 4820: 05 90 lpm r0, Z+ - 4822: 0d 92 st X+, r0 - 4824: 41 50 subi r20, 0x01 ; 1 - 4826: 50 40 sbci r21, 0x00 ; 0 - 4828: d8 f7 brcc .-10 ; 0x4820 - 482a: 08 95 ret +00004bac : + 4bac: fb 01 movw r30, r22 + 4bae: dc 01 movw r26, r24 + 4bb0: 02 c0 rjmp .+4 ; 0x4bb6 + 4bb2: 05 90 lpm r0, Z+ + 4bb4: 0d 92 st X+, r0 + 4bb6: 41 50 subi r20, 0x01 ; 1 + 4bb8: 50 40 sbci r21, 0x00 ; 0 + 4bba: d8 f7 brcc .-10 ; 0x4bb2 + 4bbc: 08 95 ret -0000482c : - 482c: fb 01 movw r30, r22 - 482e: dc 01 movw r26, r24 - 4830: 8d 91 ld r24, X+ - 4832: 05 90 lpm r0, Z+ - 4834: 80 19 sub r24, r0 - 4836: 01 10 cpse r0, r1 - 4838: d9 f3 breq .-10 ; 0x4830 - 483a: 99 0b sbc r25, r25 - 483c: 08 95 ret +00004bbe : + 4bbe: fb 01 movw r30, r22 + 4bc0: dc 01 movw r26, r24 + 4bc2: 8d 91 ld r24, X+ + 4bc4: 05 90 lpm r0, Z+ + 4bc6: 80 19 sub r24, r0 + 4bc8: 01 10 cpse r0, r1 + 4bca: d9 f3 breq .-10 ; 0x4bc2 + 4bcc: 99 0b sbc r25, r25 + 4bce: 08 95 ret -0000483e : - 483e: fb 01 movw r30, r22 - 4840: dc 01 movw r26, r24 - 4842: 41 50 subi r20, 0x01 ; 1 - 4844: 50 40 sbci r21, 0x00 ; 0 - 4846: 48 f0 brcs .+18 ; 0x485a - 4848: 05 90 lpm r0, Z+ - 484a: 0d 92 st X+, r0 - 484c: 00 20 and r0, r0 - 484e: c9 f7 brne .-14 ; 0x4842 - 4850: 01 c0 rjmp .+2 ; 0x4854 - 4852: 1d 92 st X+, r1 - 4854: 41 50 subi r20, 0x01 ; 1 - 4856: 50 40 sbci r21, 0x00 ; 0 - 4858: e0 f7 brcc .-8 ; 0x4852 - 485a: 08 95 ret +00004bd0 : + 4bd0: fb 01 movw r30, r22 + 4bd2: dc 01 movw r26, r24 + 4bd4: 41 50 subi r20, 0x01 ; 1 + 4bd6: 50 40 sbci r21, 0x00 ; 0 + 4bd8: 48 f0 brcs .+18 ; 0x4bec + 4bda: 05 90 lpm r0, Z+ + 4bdc: 0d 92 st X+, r0 + 4bde: 00 20 and r0, r0 + 4be0: c9 f7 brne .-14 ; 0x4bd4 + 4be2: 01 c0 rjmp .+2 ; 0x4be6 + 4be4: 1d 92 st X+, r1 + 4be6: 41 50 subi r20, 0x01 ; 1 + 4be8: 50 40 sbci r21, 0x00 ; 0 + 4bea: e0 f7 brcc .-8 ; 0x4be4 + 4bec: 08 95 ret -0000485c : - 485c: fb 01 movw r30, r22 - 485e: dc 01 movw r26, r24 - 4860: 02 c0 rjmp .+4 ; 0x4866 - 4862: 01 90 ld r0, Z+ - 4864: 0d 92 st X+, r0 - 4866: 41 50 subi r20, 0x01 ; 1 - 4868: 50 40 sbci r21, 0x00 ; 0 - 486a: d8 f7 brcc .-10 ; 0x4862 - 486c: 08 95 ret +00004bee : + 4bee: fb 01 movw r30, r22 + 4bf0: dc 01 movw r26, r24 + 4bf2: 02 c0 rjmp .+4 ; 0x4bf8 + 4bf4: 01 90 ld r0, Z+ + 4bf6: 0d 92 st X+, r0 + 4bf8: 41 50 subi r20, 0x01 ; 1 + 4bfa: 50 40 sbci r21, 0x00 ; 0 + 4bfc: d8 f7 brcc .-10 ; 0x4bf4 + 4bfe: 08 95 ret -0000486e : - 486e: ae e0 ldi r26, 0x0E ; 14 - 4870: b0 e0 ldi r27, 0x00 ; 0 - 4872: ec e3 ldi r30, 0x3C ; 60 - 4874: f4 e2 ldi r31, 0x24 ; 36 - 4876: f5 c2 rjmp .+1514 ; 0x4e62 <__prologue_saves__+0x1c> - 4878: 0d 89 ldd r16, Y+21 ; 0x15 - 487a: 1e 89 ldd r17, Y+22 ; 0x16 - 487c: 8f 89 ldd r24, Y+23 ; 0x17 - 487e: 98 8d ldd r25, Y+24 ; 0x18 - 4880: 2e e0 ldi r18, 0x0E ; 14 - 4882: 2c 83 std Y+4, r18 ; 0x04 - 4884: 09 83 std Y+1, r16 ; 0x01 - 4886: 1a 83 std Y+2, r17 ; 0x02 - 4888: 97 ff sbrs r25, 7 - 488a: 02 c0 rjmp .+4 ; 0x4890 - 488c: 80 e0 ldi r24, 0x00 ; 0 - 488e: 90 e8 ldi r25, 0x80 ; 128 - 4890: 01 97 sbiw r24, 0x01 ; 1 - 4892: 8d 83 std Y+5, r24 ; 0x05 - 4894: 9e 83 std Y+6, r25 ; 0x06 - 4896: ce 01 movw r24, r28 - 4898: 4b 96 adiw r24, 0x1b ; 27 - 489a: ac 01 movw r20, r24 - 489c: 69 8d ldd r22, Y+25 ; 0x19 - 489e: 7a 8d ldd r23, Y+26 ; 0x1a - 48a0: ce 01 movw r24, r28 - 48a2: 01 96 adiw r24, 0x01 ; 1 - 48a4: 11 d0 rcall .+34 ; 0x48c8 - 48a6: 4d 81 ldd r20, Y+5 ; 0x05 - 48a8: 5e 81 ldd r21, Y+6 ; 0x06 - 48aa: 57 fd sbrc r21, 7 - 48ac: 0a c0 rjmp .+20 ; 0x48c2 - 48ae: 2f 81 ldd r18, Y+7 ; 0x07 - 48b0: 38 85 ldd r19, Y+8 ; 0x08 - 48b2: 42 17 cp r20, r18 - 48b4: 53 07 cpc r21, r19 - 48b6: 0c f4 brge .+2 ; 0x48ba - 48b8: 9a 01 movw r18, r20 - 48ba: f8 01 movw r30, r16 - 48bc: e2 0f add r30, r18 - 48be: f3 1f adc r31, r19 - 48c0: 10 82 st Z, r1 - 48c2: 2e 96 adiw r28, 0x0e ; 14 - 48c4: e4 e0 ldi r30, 0x04 ; 4 - 48c6: e6 c2 rjmp .+1484 ; 0x4e94 <__epilogue_restores__+0x1c> +00004c00 : + 4c00: ae e0 ldi r26, 0x0E ; 14 + 4c02: b0 e0 ldi r27, 0x00 ; 0 + 4c04: e5 e0 ldi r30, 0x05 ; 5 + 4c06: f6 e2 ldi r31, 0x26 ; 38 + 4c08: f5 c2 rjmp .+1514 ; 0x51f4 <__prologue_saves__+0x1c> + 4c0a: 0d 89 ldd r16, Y+21 ; 0x15 + 4c0c: 1e 89 ldd r17, Y+22 ; 0x16 + 4c0e: 8f 89 ldd r24, Y+23 ; 0x17 + 4c10: 98 8d ldd r25, Y+24 ; 0x18 + 4c12: 2e e0 ldi r18, 0x0E ; 14 + 4c14: 2c 83 std Y+4, r18 ; 0x04 + 4c16: 09 83 std Y+1, r16 ; 0x01 + 4c18: 1a 83 std Y+2, r17 ; 0x02 + 4c1a: 97 ff sbrs r25, 7 + 4c1c: 02 c0 rjmp .+4 ; 0x4c22 + 4c1e: 80 e0 ldi r24, 0x00 ; 0 + 4c20: 90 e8 ldi r25, 0x80 ; 128 + 4c22: 01 97 sbiw r24, 0x01 ; 1 + 4c24: 8d 83 std Y+5, r24 ; 0x05 + 4c26: 9e 83 std Y+6, r25 ; 0x06 + 4c28: ce 01 movw r24, r28 + 4c2a: 4b 96 adiw r24, 0x1b ; 27 + 4c2c: ac 01 movw r20, r24 + 4c2e: 69 8d ldd r22, Y+25 ; 0x19 + 4c30: 7a 8d ldd r23, Y+26 ; 0x1a + 4c32: ce 01 movw r24, r28 + 4c34: 01 96 adiw r24, 0x01 ; 1 + 4c36: 11 d0 rcall .+34 ; 0x4c5a + 4c38: 4d 81 ldd r20, Y+5 ; 0x05 + 4c3a: 5e 81 ldd r21, Y+6 ; 0x06 + 4c3c: 57 fd sbrc r21, 7 + 4c3e: 0a c0 rjmp .+20 ; 0x4c54 + 4c40: 2f 81 ldd r18, Y+7 ; 0x07 + 4c42: 38 85 ldd r19, Y+8 ; 0x08 + 4c44: 42 17 cp r20, r18 + 4c46: 53 07 cpc r21, r19 + 4c48: 0c f4 brge .+2 ; 0x4c4c + 4c4a: 9a 01 movw r18, r20 + 4c4c: f8 01 movw r30, r16 + 4c4e: e2 0f add r30, r18 + 4c50: f3 1f adc r31, r19 + 4c52: 10 82 st Z, r1 + 4c54: 2e 96 adiw r28, 0x0e ; 14 + 4c56: e4 e0 ldi r30, 0x04 ; 4 + 4c58: e6 c2 rjmp .+1484 ; 0x5226 <__epilogue_restores__+0x1c> -000048c8 : - 48c8: ac e0 ldi r26, 0x0C ; 12 - 48ca: b0 e0 ldi r27, 0x00 ; 0 - 48cc: e9 e6 ldi r30, 0x69 ; 105 - 48ce: f4 e2 ldi r31, 0x24 ; 36 - 48d0: ba c2 rjmp .+1396 ; 0x4e46 <__prologue_saves__> - 48d2: 7c 01 movw r14, r24 - 48d4: 6b 01 movw r12, r22 - 48d6: 8a 01 movw r16, r20 - 48d8: fc 01 movw r30, r24 - 48da: 16 82 std Z+6, r1 ; 0x06 - 48dc: 17 82 std Z+7, r1 ; 0x07 - 48de: 83 81 ldd r24, Z+3 ; 0x03 - 48e0: 81 ff sbrs r24, 1 - 48e2: b9 c1 rjmp .+882 ; 0x4c56 - 48e4: 88 24 eor r8, r8 - 48e6: 83 94 inc r8 - 48e8: 91 2c mov r9, r1 - 48ea: 8c 0e add r8, r28 - 48ec: 9d 1e adc r9, r29 - 48ee: f7 01 movw r30, r14 - 48f0: 93 81 ldd r25, Z+3 ; 0x03 - 48f2: f6 01 movw r30, r12 - 48f4: 93 fd sbrc r25, 3 - 48f6: 85 91 lpm r24, Z+ - 48f8: 93 ff sbrs r25, 3 - 48fa: 81 91 ld r24, Z+ - 48fc: 6f 01 movw r12, r30 - 48fe: 88 23 and r24, r24 - 4900: 09 f4 brne .+2 ; 0x4904 - 4902: a5 c1 rjmp .+842 ; 0x4c4e - 4904: 85 32 cpi r24, 0x25 ; 37 - 4906: 39 f4 brne .+14 ; 0x4916 - 4908: 93 fd sbrc r25, 3 - 490a: 85 91 lpm r24, Z+ - 490c: 93 ff sbrs r25, 3 - 490e: 81 91 ld r24, Z+ - 4910: 6f 01 movw r12, r30 - 4912: 85 32 cpi r24, 0x25 ; 37 - 4914: 21 f4 brne .+8 ; 0x491e - 4916: b7 01 movw r22, r14 - 4918: 90 e0 ldi r25, 0x00 ; 0 - 491a: f0 d1 rcall .+992 ; 0x4cfc - 491c: e8 cf rjmp .-48 ; 0x48ee - 491e: 51 2c mov r5, r1 - 4920: 31 2c mov r3, r1 - 4922: 20 e0 ldi r18, 0x00 ; 0 - 4924: 20 32 cpi r18, 0x20 ; 32 - 4926: a8 f4 brcc .+42 ; 0x4952 - 4928: 8b 32 cpi r24, 0x2B ; 43 - 492a: 61 f0 breq .+24 ; 0x4944 - 492c: 28 f4 brcc .+10 ; 0x4938 - 492e: 80 32 cpi r24, 0x20 ; 32 - 4930: 51 f0 breq .+20 ; 0x4946 - 4932: 83 32 cpi r24, 0x23 ; 35 - 4934: 71 f4 brne .+28 ; 0x4952 - 4936: 0b c0 rjmp .+22 ; 0x494e - 4938: 8d 32 cpi r24, 0x2D ; 45 - 493a: 39 f0 breq .+14 ; 0x494a - 493c: 80 33 cpi r24, 0x30 ; 48 - 493e: 49 f4 brne .+18 ; 0x4952 - 4940: 21 60 ori r18, 0x01 ; 1 - 4942: 28 c0 rjmp .+80 ; 0x4994 - 4944: 22 60 ori r18, 0x02 ; 2 - 4946: 24 60 ori r18, 0x04 ; 4 - 4948: 25 c0 rjmp .+74 ; 0x4994 - 494a: 28 60 ori r18, 0x08 ; 8 - 494c: 23 c0 rjmp .+70 ; 0x4994 - 494e: 20 61 ori r18, 0x10 ; 16 - 4950: 21 c0 rjmp .+66 ; 0x4994 - 4952: 27 fd sbrc r18, 7 - 4954: 27 c0 rjmp .+78 ; 0x49a4 - 4956: 38 2f mov r19, r24 - 4958: 30 53 subi r19, 0x30 ; 48 - 495a: 3a 30 cpi r19, 0x0A ; 10 - 495c: 78 f4 brcc .+30 ; 0x497c - 495e: 26 ff sbrs r18, 6 - 4960: 06 c0 rjmp .+12 ; 0x496e - 4962: fa e0 ldi r31, 0x0A ; 10 - 4964: 5f 9e mul r5, r31 - 4966: 30 0d add r19, r0 - 4968: 11 24 eor r1, r1 - 496a: 53 2e mov r5, r19 - 496c: 13 c0 rjmp .+38 ; 0x4994 - 496e: 8a e0 ldi r24, 0x0A ; 10 - 4970: 38 9e mul r3, r24 - 4972: 30 0d add r19, r0 - 4974: 11 24 eor r1, r1 - 4976: 33 2e mov r3, r19 - 4978: 20 62 ori r18, 0x20 ; 32 - 497a: 0c c0 rjmp .+24 ; 0x4994 - 497c: 8e 32 cpi r24, 0x2E ; 46 - 497e: 21 f4 brne .+8 ; 0x4988 - 4980: 26 fd sbrc r18, 6 - 4982: 65 c1 rjmp .+714 ; 0x4c4e - 4984: 20 64 ori r18, 0x40 ; 64 - 4986: 06 c0 rjmp .+12 ; 0x4994 - 4988: 8c 36 cpi r24, 0x6C ; 108 - 498a: 11 f4 brne .+4 ; 0x4990 - 498c: 20 68 ori r18, 0x80 ; 128 - 498e: 02 c0 rjmp .+4 ; 0x4994 - 4990: 88 36 cpi r24, 0x68 ; 104 - 4992: 41 f4 brne .+16 ; 0x49a4 - 4994: f6 01 movw r30, r12 - 4996: 93 fd sbrc r25, 3 - 4998: 85 91 lpm r24, Z+ - 499a: 93 ff sbrs r25, 3 - 499c: 81 91 ld r24, Z+ - 499e: 6f 01 movw r12, r30 - 49a0: 81 11 cpse r24, r1 - 49a2: c0 cf rjmp .-128 ; 0x4924 - 49a4: 98 2f mov r25, r24 - 49a6: 95 54 subi r25, 0x45 ; 69 - 49a8: 93 30 cpi r25, 0x03 ; 3 - 49aa: 18 f0 brcs .+6 ; 0x49b2 - 49ac: 90 52 subi r25, 0x20 ; 32 - 49ae: 93 30 cpi r25, 0x03 ; 3 - 49b0: 28 f4 brcc .+10 ; 0x49bc - 49b2: 0c 5f subi r16, 0xFC ; 252 - 49b4: 1f 4f sbci r17, 0xFF ; 255 - 49b6: ff e3 ldi r31, 0x3F ; 63 - 49b8: f9 83 std Y+1, r31 ; 0x01 - 49ba: 0d c0 rjmp .+26 ; 0x49d6 - 49bc: 83 36 cpi r24, 0x63 ; 99 - 49be: 31 f0 breq .+12 ; 0x49cc - 49c0: 83 37 cpi r24, 0x73 ; 115 - 49c2: 71 f0 breq .+28 ; 0x49e0 - 49c4: 83 35 cpi r24, 0x53 ; 83 - 49c6: 09 f0 breq .+2 ; 0x49ca - 49c8: 5a c0 rjmp .+180 ; 0x4a7e - 49ca: 22 c0 rjmp .+68 ; 0x4a10 - 49cc: f8 01 movw r30, r16 - 49ce: 80 81 ld r24, Z - 49d0: 89 83 std Y+1, r24 ; 0x01 - 49d2: 0e 5f subi r16, 0xFE ; 254 - 49d4: 1f 4f sbci r17, 0xFF ; 255 - 49d6: 44 24 eor r4, r4 - 49d8: 43 94 inc r4 - 49da: 51 2c mov r5, r1 - 49dc: 54 01 movw r10, r8 - 49de: 14 c0 rjmp .+40 ; 0x4a08 - 49e0: 38 01 movw r6, r16 - 49e2: f2 e0 ldi r31, 0x02 ; 2 - 49e4: 6f 0e add r6, r31 - 49e6: 71 1c adc r7, r1 - 49e8: f8 01 movw r30, r16 - 49ea: a0 80 ld r10, Z - 49ec: b1 80 ldd r11, Z+1 ; 0x01 - 49ee: 26 ff sbrs r18, 6 - 49f0: 03 c0 rjmp .+6 ; 0x49f8 - 49f2: 65 2d mov r22, r5 - 49f4: 70 e0 ldi r23, 0x00 ; 0 - 49f6: 02 c0 rjmp .+4 ; 0x49fc - 49f8: 6f ef ldi r22, 0xFF ; 255 - 49fa: 7f ef ldi r23, 0xFF ; 255 - 49fc: c5 01 movw r24, r10 - 49fe: 2c 87 std Y+12, r18 ; 0x0c - 4a00: 72 d1 rcall .+740 ; 0x4ce6 - 4a02: 2c 01 movw r4, r24 - 4a04: 83 01 movw r16, r6 - 4a06: 2c 85 ldd r18, Y+12 ; 0x0c - 4a08: 6f e7 ldi r22, 0x7F ; 127 - 4a0a: 26 2e mov r2, r22 - 4a0c: 22 22 and r2, r18 - 4a0e: 17 c0 rjmp .+46 ; 0x4a3e - 4a10: 38 01 movw r6, r16 - 4a12: f2 e0 ldi r31, 0x02 ; 2 - 4a14: 6f 0e add r6, r31 - 4a16: 71 1c adc r7, r1 - 4a18: f8 01 movw r30, r16 - 4a1a: a0 80 ld r10, Z - 4a1c: b1 80 ldd r11, Z+1 ; 0x01 - 4a1e: 26 ff sbrs r18, 6 - 4a20: 03 c0 rjmp .+6 ; 0x4a28 - 4a22: 65 2d mov r22, r5 - 4a24: 70 e0 ldi r23, 0x00 ; 0 - 4a26: 02 c0 rjmp .+4 ; 0x4a2c - 4a28: 6f ef ldi r22, 0xFF ; 255 - 4a2a: 7f ef ldi r23, 0xFF ; 255 - 4a2c: c5 01 movw r24, r10 - 4a2e: 2c 87 std Y+12, r18 ; 0x0c - 4a30: 4f d1 rcall .+670 ; 0x4cd0 - 4a32: 2c 01 movw r4, r24 - 4a34: 2c 85 ldd r18, Y+12 ; 0x0c - 4a36: 50 e8 ldi r21, 0x80 ; 128 - 4a38: 25 2e mov r2, r21 - 4a3a: 22 2a or r2, r18 - 4a3c: 83 01 movw r16, r6 - 4a3e: 23 fc sbrc r2, 3 - 4a40: 1a c0 rjmp .+52 ; 0x4a76 - 4a42: 05 c0 rjmp .+10 ; 0x4a4e - 4a44: b7 01 movw r22, r14 - 4a46: 80 e2 ldi r24, 0x20 ; 32 - 4a48: 90 e0 ldi r25, 0x00 ; 0 - 4a4a: 58 d1 rcall .+688 ; 0x4cfc - 4a4c: 3a 94 dec r3 - 4a4e: 83 2d mov r24, r3 - 4a50: 90 e0 ldi r25, 0x00 ; 0 - 4a52: 48 16 cp r4, r24 - 4a54: 59 06 cpc r5, r25 - 4a56: b0 f3 brcs .-20 ; 0x4a44 - 4a58: 0e c0 rjmp .+28 ; 0x4a76 - 4a5a: f5 01 movw r30, r10 - 4a5c: 27 fc sbrc r2, 7 - 4a5e: 85 91 lpm r24, Z+ - 4a60: 27 fe sbrs r2, 7 - 4a62: 81 91 ld r24, Z+ - 4a64: 5f 01 movw r10, r30 - 4a66: b7 01 movw r22, r14 - 4a68: 90 e0 ldi r25, 0x00 ; 0 - 4a6a: 48 d1 rcall .+656 ; 0x4cfc - 4a6c: 31 10 cpse r3, r1 - 4a6e: 3a 94 dec r3 - 4a70: f1 e0 ldi r31, 0x01 ; 1 - 4a72: 4f 1a sub r4, r31 - 4a74: 51 08 sbc r5, r1 - 4a76: 41 14 cp r4, r1 - 4a78: 51 04 cpc r5, r1 - 4a7a: 79 f7 brne .-34 ; 0x4a5a - 4a7c: e5 c0 rjmp .+458 ; 0x4c48 - 4a7e: 84 36 cpi r24, 0x64 ; 100 - 4a80: 11 f0 breq .+4 ; 0x4a86 - 4a82: 89 36 cpi r24, 0x69 ; 105 - 4a84: 39 f5 brne .+78 ; 0x4ad4 - 4a86: f8 01 movw r30, r16 - 4a88: 27 ff sbrs r18, 7 - 4a8a: 07 c0 rjmp .+14 ; 0x4a9a - 4a8c: 60 81 ld r22, Z - 4a8e: 71 81 ldd r23, Z+1 ; 0x01 - 4a90: 82 81 ldd r24, Z+2 ; 0x02 - 4a92: 93 81 ldd r25, Z+3 ; 0x03 - 4a94: 0c 5f subi r16, 0xFC ; 252 - 4a96: 1f 4f sbci r17, 0xFF ; 255 - 4a98: 08 c0 rjmp .+16 ; 0x4aaa - 4a9a: 60 81 ld r22, Z - 4a9c: 71 81 ldd r23, Z+1 ; 0x01 - 4a9e: 88 27 eor r24, r24 - 4aa0: 77 fd sbrc r23, 7 - 4aa2: 80 95 com r24 - 4aa4: 98 2f mov r25, r24 - 4aa6: 0e 5f subi r16, 0xFE ; 254 - 4aa8: 1f 4f sbci r17, 0xFF ; 255 - 4aaa: 4f e6 ldi r20, 0x6F ; 111 - 4aac: b4 2e mov r11, r20 - 4aae: b2 22 and r11, r18 - 4ab0: 97 ff sbrs r25, 7 - 4ab2: 09 c0 rjmp .+18 ; 0x4ac6 - 4ab4: 90 95 com r25 - 4ab6: 80 95 com r24 - 4ab8: 70 95 com r23 - 4aba: 61 95 neg r22 - 4abc: 7f 4f sbci r23, 0xFF ; 255 - 4abe: 8f 4f sbci r24, 0xFF ; 255 - 4ac0: 9f 4f sbci r25, 0xFF ; 255 - 4ac2: f0 e8 ldi r31, 0x80 ; 128 - 4ac4: bf 2a or r11, r31 - 4ac6: 2a e0 ldi r18, 0x0A ; 10 - 4ac8: 30 e0 ldi r19, 0x00 ; 0 - 4aca: a4 01 movw r20, r8 - 4acc: 43 d1 rcall .+646 ; 0x4d54 <__ultoa_invert> - 4ace: a8 2e mov r10, r24 - 4ad0: a8 18 sub r10, r8 - 4ad2: 42 c0 rjmp .+132 ; 0x4b58 - 4ad4: 85 37 cpi r24, 0x75 ; 117 - 4ad6: 31 f4 brne .+12 ; 0x4ae4 - 4ad8: 3f ee ldi r19, 0xEF ; 239 - 4ada: b3 2e mov r11, r19 - 4adc: b2 22 and r11, r18 - 4ade: 2a e0 ldi r18, 0x0A ; 10 - 4ae0: 30 e0 ldi r19, 0x00 ; 0 - 4ae2: 24 c0 rjmp .+72 ; 0x4b2c - 4ae4: 99 ef ldi r25, 0xF9 ; 249 - 4ae6: b9 2e mov r11, r25 - 4ae8: b2 22 and r11, r18 - 4aea: 8f 36 cpi r24, 0x6F ; 111 - 4aec: b9 f0 breq .+46 ; 0x4b1c - 4aee: 20 f4 brcc .+8 ; 0x4af8 - 4af0: 88 35 cpi r24, 0x58 ; 88 - 4af2: 09 f0 breq .+2 ; 0x4af6 - 4af4: ac c0 rjmp .+344 ; 0x4c4e - 4af6: 0d c0 rjmp .+26 ; 0x4b12 - 4af8: 80 37 cpi r24, 0x70 ; 112 - 4afa: 21 f0 breq .+8 ; 0x4b04 - 4afc: 88 37 cpi r24, 0x78 ; 120 - 4afe: 09 f0 breq .+2 ; 0x4b02 - 4b00: a6 c0 rjmp .+332 ; 0x4c4e - 4b02: 02 c0 rjmp .+4 ; 0x4b08 - 4b04: 20 e1 ldi r18, 0x10 ; 16 - 4b06: b2 2a or r11, r18 - 4b08: b4 fe sbrs r11, 4 - 4b0a: 0b c0 rjmp .+22 ; 0x4b22 - 4b0c: 84 e0 ldi r24, 0x04 ; 4 - 4b0e: b8 2a or r11, r24 - 4b10: 08 c0 rjmp .+16 ; 0x4b22 - 4b12: 24 ff sbrs r18, 4 - 4b14: 09 c0 rjmp .+18 ; 0x4b28 - 4b16: e6 e0 ldi r30, 0x06 ; 6 - 4b18: be 2a or r11, r30 - 4b1a: 06 c0 rjmp .+12 ; 0x4b28 - 4b1c: 28 e0 ldi r18, 0x08 ; 8 - 4b1e: 30 e0 ldi r19, 0x00 ; 0 - 4b20: 05 c0 rjmp .+10 ; 0x4b2c - 4b22: 20 e1 ldi r18, 0x10 ; 16 - 4b24: 30 e0 ldi r19, 0x00 ; 0 - 4b26: 02 c0 rjmp .+4 ; 0x4b2c - 4b28: 20 e1 ldi r18, 0x10 ; 16 - 4b2a: 32 e0 ldi r19, 0x02 ; 2 - 4b2c: f8 01 movw r30, r16 - 4b2e: b7 fe sbrs r11, 7 - 4b30: 07 c0 rjmp .+14 ; 0x4b40 - 4b32: 60 81 ld r22, Z - 4b34: 71 81 ldd r23, Z+1 ; 0x01 - 4b36: 82 81 ldd r24, Z+2 ; 0x02 - 4b38: 93 81 ldd r25, Z+3 ; 0x03 - 4b3a: 0c 5f subi r16, 0xFC ; 252 - 4b3c: 1f 4f sbci r17, 0xFF ; 255 - 4b3e: 06 c0 rjmp .+12 ; 0x4b4c - 4b40: 60 81 ld r22, Z - 4b42: 71 81 ldd r23, Z+1 ; 0x01 - 4b44: 80 e0 ldi r24, 0x00 ; 0 - 4b46: 90 e0 ldi r25, 0x00 ; 0 - 4b48: 0e 5f subi r16, 0xFE ; 254 - 4b4a: 1f 4f sbci r17, 0xFF ; 255 - 4b4c: a4 01 movw r20, r8 - 4b4e: 02 d1 rcall .+516 ; 0x4d54 <__ultoa_invert> - 4b50: a8 2e mov r10, r24 - 4b52: a8 18 sub r10, r8 - 4b54: ff e7 ldi r31, 0x7F ; 127 - 4b56: bf 22 and r11, r31 - 4b58: b6 fe sbrs r11, 6 - 4b5a: 0b c0 rjmp .+22 ; 0x4b72 - 4b5c: 2b 2d mov r18, r11 - 4b5e: 2e 7f andi r18, 0xFE ; 254 - 4b60: a5 14 cp r10, r5 - 4b62: 50 f4 brcc .+20 ; 0x4b78 - 4b64: b4 fe sbrs r11, 4 - 4b66: 0a c0 rjmp .+20 ; 0x4b7c - 4b68: b2 fc sbrc r11, 2 - 4b6a: 08 c0 rjmp .+16 ; 0x4b7c - 4b6c: 2b 2d mov r18, r11 - 4b6e: 2e 7e andi r18, 0xEE ; 238 - 4b70: 05 c0 rjmp .+10 ; 0x4b7c - 4b72: 7a 2c mov r7, r10 - 4b74: 2b 2d mov r18, r11 - 4b76: 03 c0 rjmp .+6 ; 0x4b7e - 4b78: 7a 2c mov r7, r10 - 4b7a: 01 c0 rjmp .+2 ; 0x4b7e - 4b7c: 75 2c mov r7, r5 - 4b7e: 24 ff sbrs r18, 4 - 4b80: 0d c0 rjmp .+26 ; 0x4b9c - 4b82: fe 01 movw r30, r28 - 4b84: ea 0d add r30, r10 - 4b86: f1 1d adc r31, r1 - 4b88: 80 81 ld r24, Z - 4b8a: 80 33 cpi r24, 0x30 ; 48 - 4b8c: 11 f4 brne .+4 ; 0x4b92 - 4b8e: 29 7e andi r18, 0xE9 ; 233 - 4b90: 09 c0 rjmp .+18 ; 0x4ba4 - 4b92: 22 ff sbrs r18, 2 - 4b94: 06 c0 rjmp .+12 ; 0x4ba2 - 4b96: 73 94 inc r7 - 4b98: 73 94 inc r7 - 4b9a: 04 c0 rjmp .+8 ; 0x4ba4 - 4b9c: 82 2f mov r24, r18 - 4b9e: 86 78 andi r24, 0x86 ; 134 - 4ba0: 09 f0 breq .+2 ; 0x4ba4 - 4ba2: 73 94 inc r7 - 4ba4: 23 fd sbrc r18, 3 - 4ba6: 13 c0 rjmp .+38 ; 0x4bce - 4ba8: 20 ff sbrs r18, 0 - 4baa: 0e c0 rjmp .+28 ; 0x4bc8 - 4bac: 5a 2c mov r5, r10 - 4bae: 73 14 cp r7, r3 - 4bb0: 58 f4 brcc .+22 ; 0x4bc8 - 4bb2: 53 0c add r5, r3 - 4bb4: 57 18 sub r5, r7 - 4bb6: 73 2c mov r7, r3 - 4bb8: 07 c0 rjmp .+14 ; 0x4bc8 - 4bba: b7 01 movw r22, r14 - 4bbc: 80 e2 ldi r24, 0x20 ; 32 - 4bbe: 90 e0 ldi r25, 0x00 ; 0 - 4bc0: 2c 87 std Y+12, r18 ; 0x0c - 4bc2: 9c d0 rcall .+312 ; 0x4cfc - 4bc4: 73 94 inc r7 - 4bc6: 2c 85 ldd r18, Y+12 ; 0x0c - 4bc8: 73 14 cp r7, r3 - 4bca: b8 f3 brcs .-18 ; 0x4bba - 4bcc: 04 c0 rjmp .+8 ; 0x4bd6 - 4bce: 73 14 cp r7, r3 - 4bd0: 10 f4 brcc .+4 ; 0x4bd6 - 4bd2: 37 18 sub r3, r7 - 4bd4: 01 c0 rjmp .+2 ; 0x4bd8 - 4bd6: 31 2c mov r3, r1 - 4bd8: 24 ff sbrs r18, 4 - 4bda: 11 c0 rjmp .+34 ; 0x4bfe - 4bdc: b7 01 movw r22, r14 - 4bde: 80 e3 ldi r24, 0x30 ; 48 - 4be0: 90 e0 ldi r25, 0x00 ; 0 - 4be2: 2c 87 std Y+12, r18 ; 0x0c - 4be4: 8b d0 rcall .+278 ; 0x4cfc - 4be6: 2c 85 ldd r18, Y+12 ; 0x0c - 4be8: 22 ff sbrs r18, 2 - 4bea: 1c c0 rjmp .+56 ; 0x4c24 - 4bec: 21 ff sbrs r18, 1 - 4bee: 03 c0 rjmp .+6 ; 0x4bf6 - 4bf0: 88 e5 ldi r24, 0x58 ; 88 - 4bf2: 90 e0 ldi r25, 0x00 ; 0 - 4bf4: 02 c0 rjmp .+4 ; 0x4bfa - 4bf6: 88 e7 ldi r24, 0x78 ; 120 - 4bf8: 90 e0 ldi r25, 0x00 ; 0 - 4bfa: b7 01 movw r22, r14 - 4bfc: 0c c0 rjmp .+24 ; 0x4c16 - 4bfe: 82 2f mov r24, r18 - 4c00: 86 78 andi r24, 0x86 ; 134 - 4c02: 81 f0 breq .+32 ; 0x4c24 - 4c04: 21 fd sbrc r18, 1 - 4c06: 02 c0 rjmp .+4 ; 0x4c0c - 4c08: 80 e2 ldi r24, 0x20 ; 32 - 4c0a: 01 c0 rjmp .+2 ; 0x4c0e - 4c0c: 8b e2 ldi r24, 0x2B ; 43 - 4c0e: 27 fd sbrc r18, 7 - 4c10: 8d e2 ldi r24, 0x2D ; 45 - 4c12: b7 01 movw r22, r14 - 4c14: 90 e0 ldi r25, 0x00 ; 0 - 4c16: 72 d0 rcall .+228 ; 0x4cfc - 4c18: 05 c0 rjmp .+10 ; 0x4c24 - 4c1a: b7 01 movw r22, r14 - 4c1c: 80 e3 ldi r24, 0x30 ; 48 - 4c1e: 90 e0 ldi r25, 0x00 ; 0 - 4c20: 6d d0 rcall .+218 ; 0x4cfc - 4c22: 5a 94 dec r5 - 4c24: a5 14 cp r10, r5 - 4c26: c8 f3 brcs .-14 ; 0x4c1a - 4c28: aa 94 dec r10 - 4c2a: f4 01 movw r30, r8 - 4c2c: ea 0d add r30, r10 - 4c2e: f1 1d adc r31, r1 - 4c30: b7 01 movw r22, r14 - 4c32: 80 81 ld r24, Z - 4c34: 90 e0 ldi r25, 0x00 ; 0 - 4c36: 62 d0 rcall .+196 ; 0x4cfc - 4c38: a1 10 cpse r10, r1 - 4c3a: f6 cf rjmp .-20 ; 0x4c28 - 4c3c: 05 c0 rjmp .+10 ; 0x4c48 - 4c3e: b7 01 movw r22, r14 - 4c40: 80 e2 ldi r24, 0x20 ; 32 - 4c42: 90 e0 ldi r25, 0x00 ; 0 - 4c44: 5b d0 rcall .+182 ; 0x4cfc - 4c46: 3a 94 dec r3 - 4c48: 31 10 cpse r3, r1 - 4c4a: f9 cf rjmp .-14 ; 0x4c3e - 4c4c: 50 ce rjmp .-864 ; 0x48ee - 4c4e: f7 01 movw r30, r14 - 4c50: 26 81 ldd r18, Z+6 ; 0x06 - 4c52: 37 81 ldd r19, Z+7 ; 0x07 - 4c54: 02 c0 rjmp .+4 ; 0x4c5a - 4c56: 2f ef ldi r18, 0xFF ; 255 - 4c58: 3f ef ldi r19, 0xFF ; 255 - 4c5a: c9 01 movw r24, r18 - 4c5c: 2c 96 adiw r28, 0x0c ; 12 - 4c5e: e2 e1 ldi r30, 0x12 ; 18 - 4c60: 0b c1 rjmp .+534 ; 0x4e78 <__epilogue_restores__> +00004c5a : + 4c5a: ac e0 ldi r26, 0x0C ; 12 + 4c5c: b0 e0 ldi r27, 0x00 ; 0 + 4c5e: e2 e3 ldi r30, 0x32 ; 50 + 4c60: f6 e2 ldi r31, 0x26 ; 38 + 4c62: ba c2 rjmp .+1396 ; 0x51d8 <__prologue_saves__> + 4c64: 7c 01 movw r14, r24 + 4c66: 6b 01 movw r12, r22 + 4c68: 8a 01 movw r16, r20 + 4c6a: fc 01 movw r30, r24 + 4c6c: 16 82 std Z+6, r1 ; 0x06 + 4c6e: 17 82 std Z+7, r1 ; 0x07 + 4c70: 83 81 ldd r24, Z+3 ; 0x03 + 4c72: 81 ff sbrs r24, 1 + 4c74: b9 c1 rjmp .+882 ; 0x4fe8 + 4c76: 88 24 eor r8, r8 + 4c78: 83 94 inc r8 + 4c7a: 91 2c mov r9, r1 + 4c7c: 8c 0e add r8, r28 + 4c7e: 9d 1e adc r9, r29 + 4c80: f7 01 movw r30, r14 + 4c82: 93 81 ldd r25, Z+3 ; 0x03 + 4c84: f6 01 movw r30, r12 + 4c86: 93 fd sbrc r25, 3 + 4c88: 85 91 lpm r24, Z+ + 4c8a: 93 ff sbrs r25, 3 + 4c8c: 81 91 ld r24, Z+ + 4c8e: 6f 01 movw r12, r30 + 4c90: 88 23 and r24, r24 + 4c92: 09 f4 brne .+2 ; 0x4c96 + 4c94: a5 c1 rjmp .+842 ; 0x4fe0 + 4c96: 85 32 cpi r24, 0x25 ; 37 + 4c98: 39 f4 brne .+14 ; 0x4ca8 + 4c9a: 93 fd sbrc r25, 3 + 4c9c: 85 91 lpm r24, Z+ + 4c9e: 93 ff sbrs r25, 3 + 4ca0: 81 91 ld r24, Z+ + 4ca2: 6f 01 movw r12, r30 + 4ca4: 85 32 cpi r24, 0x25 ; 37 + 4ca6: 21 f4 brne .+8 ; 0x4cb0 + 4ca8: b7 01 movw r22, r14 + 4caa: 90 e0 ldi r25, 0x00 ; 0 + 4cac: f0 d1 rcall .+992 ; 0x508e + 4cae: e8 cf rjmp .-48 ; 0x4c80 + 4cb0: 51 2c mov r5, r1 + 4cb2: 31 2c mov r3, r1 + 4cb4: 20 e0 ldi r18, 0x00 ; 0 + 4cb6: 20 32 cpi r18, 0x20 ; 32 + 4cb8: a8 f4 brcc .+42 ; 0x4ce4 + 4cba: 8b 32 cpi r24, 0x2B ; 43 + 4cbc: 61 f0 breq .+24 ; 0x4cd6 + 4cbe: 28 f4 brcc .+10 ; 0x4cca + 4cc0: 80 32 cpi r24, 0x20 ; 32 + 4cc2: 51 f0 breq .+20 ; 0x4cd8 + 4cc4: 83 32 cpi r24, 0x23 ; 35 + 4cc6: 71 f4 brne .+28 ; 0x4ce4 + 4cc8: 0b c0 rjmp .+22 ; 0x4ce0 + 4cca: 8d 32 cpi r24, 0x2D ; 45 + 4ccc: 39 f0 breq .+14 ; 0x4cdc + 4cce: 80 33 cpi r24, 0x30 ; 48 + 4cd0: 49 f4 brne .+18 ; 0x4ce4 + 4cd2: 21 60 ori r18, 0x01 ; 1 + 4cd4: 28 c0 rjmp .+80 ; 0x4d26 + 4cd6: 22 60 ori r18, 0x02 ; 2 + 4cd8: 24 60 ori r18, 0x04 ; 4 + 4cda: 25 c0 rjmp .+74 ; 0x4d26 + 4cdc: 28 60 ori r18, 0x08 ; 8 + 4cde: 23 c0 rjmp .+70 ; 0x4d26 + 4ce0: 20 61 ori r18, 0x10 ; 16 + 4ce2: 21 c0 rjmp .+66 ; 0x4d26 + 4ce4: 27 fd sbrc r18, 7 + 4ce6: 27 c0 rjmp .+78 ; 0x4d36 + 4ce8: 38 2f mov r19, r24 + 4cea: 30 53 subi r19, 0x30 ; 48 + 4cec: 3a 30 cpi r19, 0x0A ; 10 + 4cee: 78 f4 brcc .+30 ; 0x4d0e + 4cf0: 26 ff sbrs r18, 6 + 4cf2: 06 c0 rjmp .+12 ; 0x4d00 + 4cf4: fa e0 ldi r31, 0x0A ; 10 + 4cf6: 5f 9e mul r5, r31 + 4cf8: 30 0d add r19, r0 + 4cfa: 11 24 eor r1, r1 + 4cfc: 53 2e mov r5, r19 + 4cfe: 13 c0 rjmp .+38 ; 0x4d26 + 4d00: 8a e0 ldi r24, 0x0A ; 10 + 4d02: 38 9e mul r3, r24 + 4d04: 30 0d add r19, r0 + 4d06: 11 24 eor r1, r1 + 4d08: 33 2e mov r3, r19 + 4d0a: 20 62 ori r18, 0x20 ; 32 + 4d0c: 0c c0 rjmp .+24 ; 0x4d26 + 4d0e: 8e 32 cpi r24, 0x2E ; 46 + 4d10: 21 f4 brne .+8 ; 0x4d1a + 4d12: 26 fd sbrc r18, 6 + 4d14: 65 c1 rjmp .+714 ; 0x4fe0 + 4d16: 20 64 ori r18, 0x40 ; 64 + 4d18: 06 c0 rjmp .+12 ; 0x4d26 + 4d1a: 8c 36 cpi r24, 0x6C ; 108 + 4d1c: 11 f4 brne .+4 ; 0x4d22 + 4d1e: 20 68 ori r18, 0x80 ; 128 + 4d20: 02 c0 rjmp .+4 ; 0x4d26 + 4d22: 88 36 cpi r24, 0x68 ; 104 + 4d24: 41 f4 brne .+16 ; 0x4d36 + 4d26: f6 01 movw r30, r12 + 4d28: 93 fd sbrc r25, 3 + 4d2a: 85 91 lpm r24, Z+ + 4d2c: 93 ff sbrs r25, 3 + 4d2e: 81 91 ld r24, Z+ + 4d30: 6f 01 movw r12, r30 + 4d32: 81 11 cpse r24, r1 + 4d34: c0 cf rjmp .-128 ; 0x4cb6 + 4d36: 98 2f mov r25, r24 + 4d38: 95 54 subi r25, 0x45 ; 69 + 4d3a: 93 30 cpi r25, 0x03 ; 3 + 4d3c: 18 f0 brcs .+6 ; 0x4d44 + 4d3e: 90 52 subi r25, 0x20 ; 32 + 4d40: 93 30 cpi r25, 0x03 ; 3 + 4d42: 28 f4 brcc .+10 ; 0x4d4e + 4d44: 0c 5f subi r16, 0xFC ; 252 + 4d46: 1f 4f sbci r17, 0xFF ; 255 + 4d48: ff e3 ldi r31, 0x3F ; 63 + 4d4a: f9 83 std Y+1, r31 ; 0x01 + 4d4c: 0d c0 rjmp .+26 ; 0x4d68 + 4d4e: 83 36 cpi r24, 0x63 ; 99 + 4d50: 31 f0 breq .+12 ; 0x4d5e + 4d52: 83 37 cpi r24, 0x73 ; 115 + 4d54: 71 f0 breq .+28 ; 0x4d72 + 4d56: 83 35 cpi r24, 0x53 ; 83 + 4d58: 09 f0 breq .+2 ; 0x4d5c + 4d5a: 5a c0 rjmp .+180 ; 0x4e10 + 4d5c: 22 c0 rjmp .+68 ; 0x4da2 + 4d5e: f8 01 movw r30, r16 + 4d60: 80 81 ld r24, Z + 4d62: 89 83 std Y+1, r24 ; 0x01 + 4d64: 0e 5f subi r16, 0xFE ; 254 + 4d66: 1f 4f sbci r17, 0xFF ; 255 + 4d68: 44 24 eor r4, r4 + 4d6a: 43 94 inc r4 + 4d6c: 51 2c mov r5, r1 + 4d6e: 54 01 movw r10, r8 + 4d70: 14 c0 rjmp .+40 ; 0x4d9a + 4d72: 38 01 movw r6, r16 + 4d74: f2 e0 ldi r31, 0x02 ; 2 + 4d76: 6f 0e add r6, r31 + 4d78: 71 1c adc r7, r1 + 4d7a: f8 01 movw r30, r16 + 4d7c: a0 80 ld r10, Z + 4d7e: b1 80 ldd r11, Z+1 ; 0x01 + 4d80: 26 ff sbrs r18, 6 + 4d82: 03 c0 rjmp .+6 ; 0x4d8a + 4d84: 65 2d mov r22, r5 + 4d86: 70 e0 ldi r23, 0x00 ; 0 + 4d88: 02 c0 rjmp .+4 ; 0x4d8e + 4d8a: 6f ef ldi r22, 0xFF ; 255 + 4d8c: 7f ef ldi r23, 0xFF ; 255 + 4d8e: c5 01 movw r24, r10 + 4d90: 2c 87 std Y+12, r18 ; 0x0c + 4d92: 72 d1 rcall .+740 ; 0x5078 + 4d94: 2c 01 movw r4, r24 + 4d96: 83 01 movw r16, r6 + 4d98: 2c 85 ldd r18, Y+12 ; 0x0c + 4d9a: 6f e7 ldi r22, 0x7F ; 127 + 4d9c: 26 2e mov r2, r22 + 4d9e: 22 22 and r2, r18 + 4da0: 17 c0 rjmp .+46 ; 0x4dd0 + 4da2: 38 01 movw r6, r16 + 4da4: f2 e0 ldi r31, 0x02 ; 2 + 4da6: 6f 0e add r6, r31 + 4da8: 71 1c adc r7, r1 + 4daa: f8 01 movw r30, r16 + 4dac: a0 80 ld r10, Z + 4dae: b1 80 ldd r11, Z+1 ; 0x01 + 4db0: 26 ff sbrs r18, 6 + 4db2: 03 c0 rjmp .+6 ; 0x4dba + 4db4: 65 2d mov r22, r5 + 4db6: 70 e0 ldi r23, 0x00 ; 0 + 4db8: 02 c0 rjmp .+4 ; 0x4dbe + 4dba: 6f ef ldi r22, 0xFF ; 255 + 4dbc: 7f ef ldi r23, 0xFF ; 255 + 4dbe: c5 01 movw r24, r10 + 4dc0: 2c 87 std Y+12, r18 ; 0x0c + 4dc2: 4f d1 rcall .+670 ; 0x5062 + 4dc4: 2c 01 movw r4, r24 + 4dc6: 2c 85 ldd r18, Y+12 ; 0x0c + 4dc8: 50 e8 ldi r21, 0x80 ; 128 + 4dca: 25 2e mov r2, r21 + 4dcc: 22 2a or r2, r18 + 4dce: 83 01 movw r16, r6 + 4dd0: 23 fc sbrc r2, 3 + 4dd2: 1a c0 rjmp .+52 ; 0x4e08 + 4dd4: 05 c0 rjmp .+10 ; 0x4de0 + 4dd6: b7 01 movw r22, r14 + 4dd8: 80 e2 ldi r24, 0x20 ; 32 + 4dda: 90 e0 ldi r25, 0x00 ; 0 + 4ddc: 58 d1 rcall .+688 ; 0x508e + 4dde: 3a 94 dec r3 + 4de0: 83 2d mov r24, r3 + 4de2: 90 e0 ldi r25, 0x00 ; 0 + 4de4: 48 16 cp r4, r24 + 4de6: 59 06 cpc r5, r25 + 4de8: b0 f3 brcs .-20 ; 0x4dd6 + 4dea: 0e c0 rjmp .+28 ; 0x4e08 + 4dec: f5 01 movw r30, r10 + 4dee: 27 fc sbrc r2, 7 + 4df0: 85 91 lpm r24, Z+ + 4df2: 27 fe sbrs r2, 7 + 4df4: 81 91 ld r24, Z+ + 4df6: 5f 01 movw r10, r30 + 4df8: b7 01 movw r22, r14 + 4dfa: 90 e0 ldi r25, 0x00 ; 0 + 4dfc: 48 d1 rcall .+656 ; 0x508e + 4dfe: 31 10 cpse r3, r1 + 4e00: 3a 94 dec r3 + 4e02: f1 e0 ldi r31, 0x01 ; 1 + 4e04: 4f 1a sub r4, r31 + 4e06: 51 08 sbc r5, r1 + 4e08: 41 14 cp r4, r1 + 4e0a: 51 04 cpc r5, r1 + 4e0c: 79 f7 brne .-34 ; 0x4dec + 4e0e: e5 c0 rjmp .+458 ; 0x4fda + 4e10: 84 36 cpi r24, 0x64 ; 100 + 4e12: 11 f0 breq .+4 ; 0x4e18 + 4e14: 89 36 cpi r24, 0x69 ; 105 + 4e16: 39 f5 brne .+78 ; 0x4e66 + 4e18: f8 01 movw r30, r16 + 4e1a: 27 ff sbrs r18, 7 + 4e1c: 07 c0 rjmp .+14 ; 0x4e2c + 4e1e: 60 81 ld r22, Z + 4e20: 71 81 ldd r23, Z+1 ; 0x01 + 4e22: 82 81 ldd r24, Z+2 ; 0x02 + 4e24: 93 81 ldd r25, Z+3 ; 0x03 + 4e26: 0c 5f subi r16, 0xFC ; 252 + 4e28: 1f 4f sbci r17, 0xFF ; 255 + 4e2a: 08 c0 rjmp .+16 ; 0x4e3c + 4e2c: 60 81 ld r22, Z + 4e2e: 71 81 ldd r23, Z+1 ; 0x01 + 4e30: 88 27 eor r24, r24 + 4e32: 77 fd sbrc r23, 7 + 4e34: 80 95 com r24 + 4e36: 98 2f mov r25, r24 + 4e38: 0e 5f subi r16, 0xFE ; 254 + 4e3a: 1f 4f sbci r17, 0xFF ; 255 + 4e3c: 4f e6 ldi r20, 0x6F ; 111 + 4e3e: b4 2e mov r11, r20 + 4e40: b2 22 and r11, r18 + 4e42: 97 ff sbrs r25, 7 + 4e44: 09 c0 rjmp .+18 ; 0x4e58 + 4e46: 90 95 com r25 + 4e48: 80 95 com r24 + 4e4a: 70 95 com r23 + 4e4c: 61 95 neg r22 + 4e4e: 7f 4f sbci r23, 0xFF ; 255 + 4e50: 8f 4f sbci r24, 0xFF ; 255 + 4e52: 9f 4f sbci r25, 0xFF ; 255 + 4e54: f0 e8 ldi r31, 0x80 ; 128 + 4e56: bf 2a or r11, r31 + 4e58: 2a e0 ldi r18, 0x0A ; 10 + 4e5a: 30 e0 ldi r19, 0x00 ; 0 + 4e5c: a4 01 movw r20, r8 + 4e5e: 43 d1 rcall .+646 ; 0x50e6 <__ultoa_invert> + 4e60: a8 2e mov r10, r24 + 4e62: a8 18 sub r10, r8 + 4e64: 42 c0 rjmp .+132 ; 0x4eea + 4e66: 85 37 cpi r24, 0x75 ; 117 + 4e68: 31 f4 brne .+12 ; 0x4e76 + 4e6a: 3f ee ldi r19, 0xEF ; 239 + 4e6c: b3 2e mov r11, r19 + 4e6e: b2 22 and r11, r18 + 4e70: 2a e0 ldi r18, 0x0A ; 10 + 4e72: 30 e0 ldi r19, 0x00 ; 0 + 4e74: 24 c0 rjmp .+72 ; 0x4ebe + 4e76: 99 ef ldi r25, 0xF9 ; 249 + 4e78: b9 2e mov r11, r25 + 4e7a: b2 22 and r11, r18 + 4e7c: 8f 36 cpi r24, 0x6F ; 111 + 4e7e: b9 f0 breq .+46 ; 0x4eae + 4e80: 20 f4 brcc .+8 ; 0x4e8a + 4e82: 88 35 cpi r24, 0x58 ; 88 + 4e84: 09 f0 breq .+2 ; 0x4e88 + 4e86: ac c0 rjmp .+344 ; 0x4fe0 + 4e88: 0d c0 rjmp .+26 ; 0x4ea4 + 4e8a: 80 37 cpi r24, 0x70 ; 112 + 4e8c: 21 f0 breq .+8 ; 0x4e96 + 4e8e: 88 37 cpi r24, 0x78 ; 120 + 4e90: 09 f0 breq .+2 ; 0x4e94 + 4e92: a6 c0 rjmp .+332 ; 0x4fe0 + 4e94: 02 c0 rjmp .+4 ; 0x4e9a + 4e96: 20 e1 ldi r18, 0x10 ; 16 + 4e98: b2 2a or r11, r18 + 4e9a: b4 fe sbrs r11, 4 + 4e9c: 0b c0 rjmp .+22 ; 0x4eb4 + 4e9e: 84 e0 ldi r24, 0x04 ; 4 + 4ea0: b8 2a or r11, r24 + 4ea2: 08 c0 rjmp .+16 ; 0x4eb4 + 4ea4: 24 ff sbrs r18, 4 + 4ea6: 09 c0 rjmp .+18 ; 0x4eba + 4ea8: e6 e0 ldi r30, 0x06 ; 6 + 4eaa: be 2a or r11, r30 + 4eac: 06 c0 rjmp .+12 ; 0x4eba + 4eae: 28 e0 ldi r18, 0x08 ; 8 + 4eb0: 30 e0 ldi r19, 0x00 ; 0 + 4eb2: 05 c0 rjmp .+10 ; 0x4ebe + 4eb4: 20 e1 ldi r18, 0x10 ; 16 + 4eb6: 30 e0 ldi r19, 0x00 ; 0 + 4eb8: 02 c0 rjmp .+4 ; 0x4ebe + 4eba: 20 e1 ldi r18, 0x10 ; 16 + 4ebc: 32 e0 ldi r19, 0x02 ; 2 + 4ebe: f8 01 movw r30, r16 + 4ec0: b7 fe sbrs r11, 7 + 4ec2: 07 c0 rjmp .+14 ; 0x4ed2 + 4ec4: 60 81 ld r22, Z + 4ec6: 71 81 ldd r23, Z+1 ; 0x01 + 4ec8: 82 81 ldd r24, Z+2 ; 0x02 + 4eca: 93 81 ldd r25, Z+3 ; 0x03 + 4ecc: 0c 5f subi r16, 0xFC ; 252 + 4ece: 1f 4f sbci r17, 0xFF ; 255 + 4ed0: 06 c0 rjmp .+12 ; 0x4ede + 4ed2: 60 81 ld r22, Z + 4ed4: 71 81 ldd r23, Z+1 ; 0x01 + 4ed6: 80 e0 ldi r24, 0x00 ; 0 + 4ed8: 90 e0 ldi r25, 0x00 ; 0 + 4eda: 0e 5f subi r16, 0xFE ; 254 + 4edc: 1f 4f sbci r17, 0xFF ; 255 + 4ede: a4 01 movw r20, r8 + 4ee0: 02 d1 rcall .+516 ; 0x50e6 <__ultoa_invert> + 4ee2: a8 2e mov r10, r24 + 4ee4: a8 18 sub r10, r8 + 4ee6: ff e7 ldi r31, 0x7F ; 127 + 4ee8: bf 22 and r11, r31 + 4eea: b6 fe sbrs r11, 6 + 4eec: 0b c0 rjmp .+22 ; 0x4f04 + 4eee: 2b 2d mov r18, r11 + 4ef0: 2e 7f andi r18, 0xFE ; 254 + 4ef2: a5 14 cp r10, r5 + 4ef4: 50 f4 brcc .+20 ; 0x4f0a + 4ef6: b4 fe sbrs r11, 4 + 4ef8: 0a c0 rjmp .+20 ; 0x4f0e + 4efa: b2 fc sbrc r11, 2 + 4efc: 08 c0 rjmp .+16 ; 0x4f0e + 4efe: 2b 2d mov r18, r11 + 4f00: 2e 7e andi r18, 0xEE ; 238 + 4f02: 05 c0 rjmp .+10 ; 0x4f0e + 4f04: 7a 2c mov r7, r10 + 4f06: 2b 2d mov r18, r11 + 4f08: 03 c0 rjmp .+6 ; 0x4f10 + 4f0a: 7a 2c mov r7, r10 + 4f0c: 01 c0 rjmp .+2 ; 0x4f10 + 4f0e: 75 2c mov r7, r5 + 4f10: 24 ff sbrs r18, 4 + 4f12: 0d c0 rjmp .+26 ; 0x4f2e + 4f14: fe 01 movw r30, r28 + 4f16: ea 0d add r30, r10 + 4f18: f1 1d adc r31, r1 + 4f1a: 80 81 ld r24, Z + 4f1c: 80 33 cpi r24, 0x30 ; 48 + 4f1e: 11 f4 brne .+4 ; 0x4f24 + 4f20: 29 7e andi r18, 0xE9 ; 233 + 4f22: 09 c0 rjmp .+18 ; 0x4f36 + 4f24: 22 ff sbrs r18, 2 + 4f26: 06 c0 rjmp .+12 ; 0x4f34 + 4f28: 73 94 inc r7 + 4f2a: 73 94 inc r7 + 4f2c: 04 c0 rjmp .+8 ; 0x4f36 + 4f2e: 82 2f mov r24, r18 + 4f30: 86 78 andi r24, 0x86 ; 134 + 4f32: 09 f0 breq .+2 ; 0x4f36 + 4f34: 73 94 inc r7 + 4f36: 23 fd sbrc r18, 3 + 4f38: 13 c0 rjmp .+38 ; 0x4f60 + 4f3a: 20 ff sbrs r18, 0 + 4f3c: 0e c0 rjmp .+28 ; 0x4f5a + 4f3e: 5a 2c mov r5, r10 + 4f40: 73 14 cp r7, r3 + 4f42: 58 f4 brcc .+22 ; 0x4f5a + 4f44: 53 0c add r5, r3 + 4f46: 57 18 sub r5, r7 + 4f48: 73 2c mov r7, r3 + 4f4a: 07 c0 rjmp .+14 ; 0x4f5a + 4f4c: b7 01 movw r22, r14 + 4f4e: 80 e2 ldi r24, 0x20 ; 32 + 4f50: 90 e0 ldi r25, 0x00 ; 0 + 4f52: 2c 87 std Y+12, r18 ; 0x0c + 4f54: 9c d0 rcall .+312 ; 0x508e + 4f56: 73 94 inc r7 + 4f58: 2c 85 ldd r18, Y+12 ; 0x0c + 4f5a: 73 14 cp r7, r3 + 4f5c: b8 f3 brcs .-18 ; 0x4f4c + 4f5e: 04 c0 rjmp .+8 ; 0x4f68 + 4f60: 73 14 cp r7, r3 + 4f62: 10 f4 brcc .+4 ; 0x4f68 + 4f64: 37 18 sub r3, r7 + 4f66: 01 c0 rjmp .+2 ; 0x4f6a + 4f68: 31 2c mov r3, r1 + 4f6a: 24 ff sbrs r18, 4 + 4f6c: 11 c0 rjmp .+34 ; 0x4f90 + 4f6e: b7 01 movw r22, r14 + 4f70: 80 e3 ldi r24, 0x30 ; 48 + 4f72: 90 e0 ldi r25, 0x00 ; 0 + 4f74: 2c 87 std Y+12, r18 ; 0x0c + 4f76: 8b d0 rcall .+278 ; 0x508e + 4f78: 2c 85 ldd r18, Y+12 ; 0x0c + 4f7a: 22 ff sbrs r18, 2 + 4f7c: 1c c0 rjmp .+56 ; 0x4fb6 + 4f7e: 21 ff sbrs r18, 1 + 4f80: 03 c0 rjmp .+6 ; 0x4f88 + 4f82: 88 e5 ldi r24, 0x58 ; 88 + 4f84: 90 e0 ldi r25, 0x00 ; 0 + 4f86: 02 c0 rjmp .+4 ; 0x4f8c + 4f88: 88 e7 ldi r24, 0x78 ; 120 + 4f8a: 90 e0 ldi r25, 0x00 ; 0 + 4f8c: b7 01 movw r22, r14 + 4f8e: 0c c0 rjmp .+24 ; 0x4fa8 + 4f90: 82 2f mov r24, r18 + 4f92: 86 78 andi r24, 0x86 ; 134 + 4f94: 81 f0 breq .+32 ; 0x4fb6 + 4f96: 21 fd sbrc r18, 1 + 4f98: 02 c0 rjmp .+4 ; 0x4f9e + 4f9a: 80 e2 ldi r24, 0x20 ; 32 + 4f9c: 01 c0 rjmp .+2 ; 0x4fa0 + 4f9e: 8b e2 ldi r24, 0x2B ; 43 + 4fa0: 27 fd sbrc r18, 7 + 4fa2: 8d e2 ldi r24, 0x2D ; 45 + 4fa4: b7 01 movw r22, r14 + 4fa6: 90 e0 ldi r25, 0x00 ; 0 + 4fa8: 72 d0 rcall .+228 ; 0x508e + 4faa: 05 c0 rjmp .+10 ; 0x4fb6 + 4fac: b7 01 movw r22, r14 + 4fae: 80 e3 ldi r24, 0x30 ; 48 + 4fb0: 90 e0 ldi r25, 0x00 ; 0 + 4fb2: 6d d0 rcall .+218 ; 0x508e + 4fb4: 5a 94 dec r5 + 4fb6: a5 14 cp r10, r5 + 4fb8: c8 f3 brcs .-14 ; 0x4fac + 4fba: aa 94 dec r10 + 4fbc: f4 01 movw r30, r8 + 4fbe: ea 0d add r30, r10 + 4fc0: f1 1d adc r31, r1 + 4fc2: b7 01 movw r22, r14 + 4fc4: 80 81 ld r24, Z + 4fc6: 90 e0 ldi r25, 0x00 ; 0 + 4fc8: 62 d0 rcall .+196 ; 0x508e + 4fca: a1 10 cpse r10, r1 + 4fcc: f6 cf rjmp .-20 ; 0x4fba + 4fce: 05 c0 rjmp .+10 ; 0x4fda + 4fd0: b7 01 movw r22, r14 + 4fd2: 80 e2 ldi r24, 0x20 ; 32 + 4fd4: 90 e0 ldi r25, 0x00 ; 0 + 4fd6: 5b d0 rcall .+182 ; 0x508e + 4fd8: 3a 94 dec r3 + 4fda: 31 10 cpse r3, r1 + 4fdc: f9 cf rjmp .-14 ; 0x4fd0 + 4fde: 50 ce rjmp .-864 ; 0x4c80 + 4fe0: f7 01 movw r30, r14 + 4fe2: 26 81 ldd r18, Z+6 ; 0x06 + 4fe4: 37 81 ldd r19, Z+7 ; 0x07 + 4fe6: 02 c0 rjmp .+4 ; 0x4fec + 4fe8: 2f ef ldi r18, 0xFF ; 255 + 4fea: 3f ef ldi r19, 0xFF ; 255 + 4fec: c9 01 movw r24, r18 + 4fee: 2c 96 adiw r28, 0x0c ; 12 + 4ff0: e2 e1 ldi r30, 0x12 ; 18 + 4ff2: 0b c1 rjmp .+534 ; 0x520a <__epilogue_restores__> -00004c62 <__eerd_block_x32a4u>: - 4c62: e0 ec ldi r30, 0xC0 ; 192 - 4c64: f1 e0 ldi r31, 0x01 ; 1 - 4c66: a7 85 ldd r26, Z+15 ; 0x0f - 4c68: a7 fd sbrc r26, 7 - 4c6a: fd cf rjmp .-6 ; 0x4c66 <__eerd_block_x32a4u+0x4> - 4c6c: a4 85 ldd r26, Z+12 ; 0x0c - 4c6e: a8 60 ori r26, 0x08 ; 8 - 4c70: a4 87 std Z+12, r26 ; 0x0c - 4c72: 60 50 subi r22, 0x00 ; 0 - 4c74: 70 4f sbci r23, 0xF0 ; 240 - 4c76: f2 cd rjmp .-1052 ; 0x485c +00004ff4 <__eerd_block_x32a4u>: + 4ff4: e0 ec ldi r30, 0xC0 ; 192 + 4ff6: f1 e0 ldi r31, 0x01 ; 1 + 4ff8: a7 85 ldd r26, Z+15 ; 0x0f + 4ffa: a7 fd sbrc r26, 7 + 4ffc: fd cf rjmp .-6 ; 0x4ff8 <__eerd_block_x32a4u+0x4> + 4ffe: a4 85 ldd r26, Z+12 ; 0x0c + 5000: a8 60 ori r26, 0x08 ; 8 + 5002: a4 87 std Z+12, r26 ; 0x0c + 5004: 60 50 subi r22, 0x00 ; 0 + 5006: 70 4f sbci r23, 0xF0 ; 240 + 5008: f2 cd rjmp .-1052 ; 0x4bee -00004c78 <__eewr_block_x32a4u>: - 4c78: dc 01 movw r26, r24 - 4c7a: cb 01 movw r24, r22 - 4c7c: 02 c0 rjmp .+4 ; 0x4c82 <__eewr_block_x32a4u+0xa> - 4c7e: 2d 91 ld r18, X+ - 4c80: 05 d0 rcall .+10 ; 0x4c8c <__eewr_r18_x32a4u> - 4c82: 41 50 subi r20, 0x01 ; 1 - 4c84: 50 40 sbci r21, 0x00 ; 0 - 4c86: d8 f7 brcc .-10 ; 0x4c7e <__eewr_block_x32a4u+0x6> - 4c88: 08 95 ret +0000500a <__eewr_block_x32a4u>: + 500a: dc 01 movw r26, r24 + 500c: cb 01 movw r24, r22 + 500e: 02 c0 rjmp .+4 ; 0x5014 <__eewr_block_x32a4u+0xa> + 5010: 2d 91 ld r18, X+ + 5012: 05 d0 rcall .+10 ; 0x501e <__eewr_r18_x32a4u> + 5014: 41 50 subi r20, 0x01 ; 1 + 5016: 50 40 sbci r21, 0x00 ; 0 + 5018: d8 f7 brcc .-10 ; 0x5010 <__eewr_block_x32a4u+0x6> + 501a: 08 95 ret -00004c8a <__eewr_byte_x32a4u>: - 4c8a: 26 2f mov r18, r22 +0000501c <__eewr_byte_x32a4u>: + 501c: 26 2f mov r18, r22 -00004c8c <__eewr_r18_x32a4u>: - 4c8c: e0 ec ldi r30, 0xC0 ; 192 - 4c8e: f1 e0 ldi r31, 0x01 ; 1 - 4c90: 37 85 ldd r19, Z+15 ; 0x0f - 4c92: 37 fd sbrc r19, 7 - 4c94: fd cf rjmp .-6 ; 0x4c90 <__eewr_r18_x32a4u+0x4> - 4c96: 34 85 ldd r19, Z+12 ; 0x0c - 4c98: 37 7f andi r19, 0xF7 ; 247 - 4c9a: 34 87 std Z+12, r19 ; 0x0c - 4c9c: 37 85 ldd r19, Z+15 ; 0x0f - 4c9e: 31 ff sbrs r19, 1 - 4ca0: 09 c0 rjmp .+18 ; 0x4cb4 <__eewr_r18_x32a4u+0x28> - 4ca2: 36 e3 ldi r19, 0x36 ; 54 - 4ca4: 32 87 std Z+10, r19 ; 0x0a - 4ca6: 38 ed ldi r19, 0xD8 ; 216 - 4ca8: 34 bf out 0x34, r19 ; 52 - 4caa: 31 e0 ldi r19, 0x01 ; 1 - 4cac: 33 87 std Z+11, r19 ; 0x0b - 4cae: 37 85 ldd r19, Z+15 ; 0x0f - 4cb0: 37 fd sbrc r19, 7 - 4cb2: fd cf rjmp .-6 ; 0x4cae <__eewr_r18_x32a4u+0x22> - 4cb4: 33 e3 ldi r19, 0x33 ; 51 - 4cb6: 32 87 std Z+10, r19 ; 0x0a - 4cb8: 80 83 st Z, r24 - 4cba: 91 83 std Z+1, r25 ; 0x01 - 4cbc: 12 82 std Z+2, r1 ; 0x02 - 4cbe: 24 83 std Z+4, r18 ; 0x04 - 4cc0: 25 e3 ldi r18, 0x35 ; 53 - 4cc2: 22 87 std Z+10, r18 ; 0x0a - 4cc4: 28 ed ldi r18, 0xD8 ; 216 - 4cc6: 31 e0 ldi r19, 0x01 ; 1 - 4cc8: 24 bf out 0x34, r18 ; 52 - 4cca: 33 87 std Z+11, r19 ; 0x0b - 4ccc: 01 96 adiw r24, 0x01 ; 1 - 4cce: 08 95 ret +0000501e <__eewr_r18_x32a4u>: + 501e: e0 ec ldi r30, 0xC0 ; 192 + 5020: f1 e0 ldi r31, 0x01 ; 1 + 5022: 37 85 ldd r19, Z+15 ; 0x0f + 5024: 37 fd sbrc r19, 7 + 5026: fd cf rjmp .-6 ; 0x5022 <__eewr_r18_x32a4u+0x4> + 5028: 34 85 ldd r19, Z+12 ; 0x0c + 502a: 37 7f andi r19, 0xF7 ; 247 + 502c: 34 87 std Z+12, r19 ; 0x0c + 502e: 37 85 ldd r19, Z+15 ; 0x0f + 5030: 31 ff sbrs r19, 1 + 5032: 09 c0 rjmp .+18 ; 0x5046 <__eewr_r18_x32a4u+0x28> + 5034: 36 e3 ldi r19, 0x36 ; 54 + 5036: 32 87 std Z+10, r19 ; 0x0a + 5038: 38 ed ldi r19, 0xD8 ; 216 + 503a: 34 bf out 0x34, r19 ; 52 + 503c: 31 e0 ldi r19, 0x01 ; 1 + 503e: 33 87 std Z+11, r19 ; 0x0b + 5040: 37 85 ldd r19, Z+15 ; 0x0f + 5042: 37 fd sbrc r19, 7 + 5044: fd cf rjmp .-6 ; 0x5040 <__eewr_r18_x32a4u+0x22> + 5046: 33 e3 ldi r19, 0x33 ; 51 + 5048: 32 87 std Z+10, r19 ; 0x0a + 504a: 80 83 st Z, r24 + 504c: 91 83 std Z+1, r25 ; 0x01 + 504e: 12 82 std Z+2, r1 ; 0x02 + 5050: 24 83 std Z+4, r18 ; 0x04 + 5052: 25 e3 ldi r18, 0x35 ; 53 + 5054: 22 87 std Z+10, r18 ; 0x0a + 5056: 28 ed ldi r18, 0xD8 ; 216 + 5058: 31 e0 ldi r19, 0x01 ; 1 + 505a: 24 bf out 0x34, r18 ; 52 + 505c: 33 87 std Z+11, r19 ; 0x0b + 505e: 01 96 adiw r24, 0x01 ; 1 + 5060: 08 95 ret -00004cd0 : - 4cd0: fc 01 movw r30, r24 - 4cd2: 05 90 lpm r0, Z+ - 4cd4: 61 50 subi r22, 0x01 ; 1 - 4cd6: 70 40 sbci r23, 0x00 ; 0 - 4cd8: 01 10 cpse r0, r1 - 4cda: d8 f7 brcc .-10 ; 0x4cd2 - 4cdc: 80 95 com r24 - 4cde: 90 95 com r25 - 4ce0: 8e 0f add r24, r30 - 4ce2: 9f 1f adc r25, r31 - 4ce4: 08 95 ret +00005062 : + 5062: fc 01 movw r30, r24 + 5064: 05 90 lpm r0, Z+ + 5066: 61 50 subi r22, 0x01 ; 1 + 5068: 70 40 sbci r23, 0x00 ; 0 + 506a: 01 10 cpse r0, r1 + 506c: d8 f7 brcc .-10 ; 0x5064 + 506e: 80 95 com r24 + 5070: 90 95 com r25 + 5072: 8e 0f add r24, r30 + 5074: 9f 1f adc r25, r31 + 5076: 08 95 ret -00004ce6 : - 4ce6: fc 01 movw r30, r24 - 4ce8: 61 50 subi r22, 0x01 ; 1 - 4cea: 70 40 sbci r23, 0x00 ; 0 - 4cec: 01 90 ld r0, Z+ - 4cee: 01 10 cpse r0, r1 - 4cf0: d8 f7 brcc .-10 ; 0x4ce8 - 4cf2: 80 95 com r24 - 4cf4: 90 95 com r25 - 4cf6: 8e 0f add r24, r30 - 4cf8: 9f 1f adc r25, r31 - 4cfa: 08 95 ret +00005078 : + 5078: fc 01 movw r30, r24 + 507a: 61 50 subi r22, 0x01 ; 1 + 507c: 70 40 sbci r23, 0x00 ; 0 + 507e: 01 90 ld r0, Z+ + 5080: 01 10 cpse r0, r1 + 5082: d8 f7 brcc .-10 ; 0x507a + 5084: 80 95 com r24 + 5086: 90 95 com r25 + 5088: 8e 0f add r24, r30 + 508a: 9f 1f adc r25, r31 + 508c: 08 95 ret -00004cfc : - 4cfc: 0f 93 push r16 - 4cfe: 1f 93 push r17 - 4d00: cf 93 push r28 - 4d02: df 93 push r29 - 4d04: 8c 01 movw r16, r24 - 4d06: eb 01 movw r28, r22 - 4d08: 8b 81 ldd r24, Y+3 ; 0x03 - 4d0a: 81 fd sbrc r24, 1 - 4d0c: 03 c0 rjmp .+6 ; 0x4d14 - 4d0e: 0f ef ldi r16, 0xFF ; 255 - 4d10: 1f ef ldi r17, 0xFF ; 255 - 4d12: 1a c0 rjmp .+52 ; 0x4d48 - 4d14: 82 ff sbrs r24, 2 - 4d16: 0d c0 rjmp .+26 ; 0x4d32 - 4d18: 2e 81 ldd r18, Y+6 ; 0x06 - 4d1a: 3f 81 ldd r19, Y+7 ; 0x07 - 4d1c: 8c 81 ldd r24, Y+4 ; 0x04 - 4d1e: 9d 81 ldd r25, Y+5 ; 0x05 - 4d20: 28 17 cp r18, r24 - 4d22: 39 07 cpc r19, r25 - 4d24: 64 f4 brge .+24 ; 0x4d3e - 4d26: e8 81 ld r30, Y - 4d28: f9 81 ldd r31, Y+1 ; 0x01 - 4d2a: 01 93 st Z+, r16 - 4d2c: e8 83 st Y, r30 - 4d2e: f9 83 std Y+1, r31 ; 0x01 - 4d30: 06 c0 rjmp .+12 ; 0x4d3e - 4d32: e8 85 ldd r30, Y+8 ; 0x08 - 4d34: f9 85 ldd r31, Y+9 ; 0x09 - 4d36: 80 2f mov r24, r16 - 4d38: 09 95 icall - 4d3a: 89 2b or r24, r25 - 4d3c: 41 f7 brne .-48 ; 0x4d0e - 4d3e: 8e 81 ldd r24, Y+6 ; 0x06 - 4d40: 9f 81 ldd r25, Y+7 ; 0x07 - 4d42: 01 96 adiw r24, 0x01 ; 1 - 4d44: 8e 83 std Y+6, r24 ; 0x06 - 4d46: 9f 83 std Y+7, r25 ; 0x07 - 4d48: c8 01 movw r24, r16 - 4d4a: df 91 pop r29 - 4d4c: cf 91 pop r28 - 4d4e: 1f 91 pop r17 - 4d50: 0f 91 pop r16 - 4d52: 08 95 ret +0000508e : + 508e: 0f 93 push r16 + 5090: 1f 93 push r17 + 5092: cf 93 push r28 + 5094: df 93 push r29 + 5096: 8c 01 movw r16, r24 + 5098: eb 01 movw r28, r22 + 509a: 8b 81 ldd r24, Y+3 ; 0x03 + 509c: 81 fd sbrc r24, 1 + 509e: 03 c0 rjmp .+6 ; 0x50a6 + 50a0: 0f ef ldi r16, 0xFF ; 255 + 50a2: 1f ef ldi r17, 0xFF ; 255 + 50a4: 1a c0 rjmp .+52 ; 0x50da + 50a6: 82 ff sbrs r24, 2 + 50a8: 0d c0 rjmp .+26 ; 0x50c4 + 50aa: 2e 81 ldd r18, Y+6 ; 0x06 + 50ac: 3f 81 ldd r19, Y+7 ; 0x07 + 50ae: 8c 81 ldd r24, Y+4 ; 0x04 + 50b0: 9d 81 ldd r25, Y+5 ; 0x05 + 50b2: 28 17 cp r18, r24 + 50b4: 39 07 cpc r19, r25 + 50b6: 64 f4 brge .+24 ; 0x50d0 + 50b8: e8 81 ld r30, Y + 50ba: f9 81 ldd r31, Y+1 ; 0x01 + 50bc: 01 93 st Z+, r16 + 50be: e8 83 st Y, r30 + 50c0: f9 83 std Y+1, r31 ; 0x01 + 50c2: 06 c0 rjmp .+12 ; 0x50d0 + 50c4: e8 85 ldd r30, Y+8 ; 0x08 + 50c6: f9 85 ldd r31, Y+9 ; 0x09 + 50c8: 80 2f mov r24, r16 + 50ca: 09 95 icall + 50cc: 89 2b or r24, r25 + 50ce: 41 f7 brne .-48 ; 0x50a0 + 50d0: 8e 81 ldd r24, Y+6 ; 0x06 + 50d2: 9f 81 ldd r25, Y+7 ; 0x07 + 50d4: 01 96 adiw r24, 0x01 ; 1 + 50d6: 8e 83 std Y+6, r24 ; 0x06 + 50d8: 9f 83 std Y+7, r25 ; 0x07 + 50da: c8 01 movw r24, r16 + 50dc: df 91 pop r29 + 50de: cf 91 pop r28 + 50e0: 1f 91 pop r17 + 50e2: 0f 91 pop r16 + 50e4: 08 95 ret -00004d54 <__ultoa_invert>: - 4d54: fa 01 movw r30, r20 - 4d56: aa 27 eor r26, r26 - 4d58: 28 30 cpi r18, 0x08 ; 8 - 4d5a: 51 f1 breq .+84 ; 0x4db0 <__ultoa_invert+0x5c> - 4d5c: 20 31 cpi r18, 0x10 ; 16 - 4d5e: 81 f1 breq .+96 ; 0x4dc0 <__ultoa_invert+0x6c> - 4d60: e8 94 clt - 4d62: 6f 93 push r22 - 4d64: 6e 7f andi r22, 0xFE ; 254 - 4d66: 6e 5f subi r22, 0xFE ; 254 - 4d68: 7f 4f sbci r23, 0xFF ; 255 - 4d6a: 8f 4f sbci r24, 0xFF ; 255 - 4d6c: 9f 4f sbci r25, 0xFF ; 255 - 4d6e: af 4f sbci r26, 0xFF ; 255 - 4d70: b1 e0 ldi r27, 0x01 ; 1 - 4d72: 3e d0 rcall .+124 ; 0x4df0 <__ultoa_invert+0x9c> - 4d74: b4 e0 ldi r27, 0x04 ; 4 - 4d76: 3c d0 rcall .+120 ; 0x4df0 <__ultoa_invert+0x9c> - 4d78: 67 0f add r22, r23 - 4d7a: 78 1f adc r23, r24 - 4d7c: 89 1f adc r24, r25 - 4d7e: 9a 1f adc r25, r26 - 4d80: a1 1d adc r26, r1 - 4d82: 68 0f add r22, r24 - 4d84: 79 1f adc r23, r25 - 4d86: 8a 1f adc r24, r26 - 4d88: 91 1d adc r25, r1 - 4d8a: a1 1d adc r26, r1 - 4d8c: 6a 0f add r22, r26 - 4d8e: 71 1d adc r23, r1 - 4d90: 81 1d adc r24, r1 - 4d92: 91 1d adc r25, r1 - 4d94: a1 1d adc r26, r1 - 4d96: 20 d0 rcall .+64 ; 0x4dd8 <__ultoa_invert+0x84> - 4d98: 09 f4 brne .+2 ; 0x4d9c <__ultoa_invert+0x48> - 4d9a: 68 94 set - 4d9c: 3f 91 pop r19 - 4d9e: 2a e0 ldi r18, 0x0A ; 10 - 4da0: 26 9f mul r18, r22 - 4da2: 11 24 eor r1, r1 - 4da4: 30 19 sub r19, r0 - 4da6: 30 5d subi r19, 0xD0 ; 208 - 4da8: 31 93 st Z+, r19 - 4daa: de f6 brtc .-74 ; 0x4d62 <__ultoa_invert+0xe> - 4dac: cf 01 movw r24, r30 - 4dae: 08 95 ret - 4db0: 46 2f mov r20, r22 - 4db2: 47 70 andi r20, 0x07 ; 7 - 4db4: 40 5d subi r20, 0xD0 ; 208 - 4db6: 41 93 st Z+, r20 - 4db8: b3 e0 ldi r27, 0x03 ; 3 - 4dba: 0f d0 rcall .+30 ; 0x4dda <__ultoa_invert+0x86> - 4dbc: c9 f7 brne .-14 ; 0x4db0 <__ultoa_invert+0x5c> - 4dbe: f6 cf rjmp .-20 ; 0x4dac <__ultoa_invert+0x58> - 4dc0: 46 2f mov r20, r22 - 4dc2: 4f 70 andi r20, 0x0F ; 15 - 4dc4: 40 5d subi r20, 0xD0 ; 208 - 4dc6: 4a 33 cpi r20, 0x3A ; 58 - 4dc8: 18 f0 brcs .+6 ; 0x4dd0 <__ultoa_invert+0x7c> - 4dca: 49 5d subi r20, 0xD9 ; 217 - 4dcc: 31 fd sbrc r19, 1 - 4dce: 40 52 subi r20, 0x20 ; 32 - 4dd0: 41 93 st Z+, r20 - 4dd2: 02 d0 rcall .+4 ; 0x4dd8 <__ultoa_invert+0x84> - 4dd4: a9 f7 brne .-22 ; 0x4dc0 <__ultoa_invert+0x6c> - 4dd6: ea cf rjmp .-44 ; 0x4dac <__ultoa_invert+0x58> - 4dd8: b4 e0 ldi r27, 0x04 ; 4 - 4dda: a6 95 lsr r26 - 4ddc: 97 95 ror r25 - 4dde: 87 95 ror r24 - 4de0: 77 95 ror r23 - 4de2: 67 95 ror r22 - 4de4: ba 95 dec r27 - 4de6: c9 f7 brne .-14 ; 0x4dda <__ultoa_invert+0x86> - 4de8: 00 97 sbiw r24, 0x00 ; 0 - 4dea: 61 05 cpc r22, r1 - 4dec: 71 05 cpc r23, r1 - 4dee: 08 95 ret - 4df0: 9b 01 movw r18, r22 - 4df2: ac 01 movw r20, r24 - 4df4: 0a 2e mov r0, r26 - 4df6: 06 94 lsr r0 - 4df8: 57 95 ror r21 - 4dfa: 47 95 ror r20 - 4dfc: 37 95 ror r19 - 4dfe: 27 95 ror r18 - 4e00: ba 95 dec r27 - 4e02: c9 f7 brne .-14 ; 0x4df6 <__ultoa_invert+0xa2> - 4e04: 62 0f add r22, r18 - 4e06: 73 1f adc r23, r19 - 4e08: 84 1f adc r24, r20 - 4e0a: 95 1f adc r25, r21 - 4e0c: a0 1d adc r26, r0 - 4e0e: 08 95 ret +000050e6 <__ultoa_invert>: + 50e6: fa 01 movw r30, r20 + 50e8: aa 27 eor r26, r26 + 50ea: 28 30 cpi r18, 0x08 ; 8 + 50ec: 51 f1 breq .+84 ; 0x5142 <__ultoa_invert+0x5c> + 50ee: 20 31 cpi r18, 0x10 ; 16 + 50f0: 81 f1 breq .+96 ; 0x5152 <__ultoa_invert+0x6c> + 50f2: e8 94 clt + 50f4: 6f 93 push r22 + 50f6: 6e 7f andi r22, 0xFE ; 254 + 50f8: 6e 5f subi r22, 0xFE ; 254 + 50fa: 7f 4f sbci r23, 0xFF ; 255 + 50fc: 8f 4f sbci r24, 0xFF ; 255 + 50fe: 9f 4f sbci r25, 0xFF ; 255 + 5100: af 4f sbci r26, 0xFF ; 255 + 5102: b1 e0 ldi r27, 0x01 ; 1 + 5104: 3e d0 rcall .+124 ; 0x5182 <__ultoa_invert+0x9c> + 5106: b4 e0 ldi r27, 0x04 ; 4 + 5108: 3c d0 rcall .+120 ; 0x5182 <__ultoa_invert+0x9c> + 510a: 67 0f add r22, r23 + 510c: 78 1f adc r23, r24 + 510e: 89 1f adc r24, r25 + 5110: 9a 1f adc r25, r26 + 5112: a1 1d adc r26, r1 + 5114: 68 0f add r22, r24 + 5116: 79 1f adc r23, r25 + 5118: 8a 1f adc r24, r26 + 511a: 91 1d adc r25, r1 + 511c: a1 1d adc r26, r1 + 511e: 6a 0f add r22, r26 + 5120: 71 1d adc r23, r1 + 5122: 81 1d adc r24, r1 + 5124: 91 1d adc r25, r1 + 5126: a1 1d adc r26, r1 + 5128: 20 d0 rcall .+64 ; 0x516a <__ultoa_invert+0x84> + 512a: 09 f4 brne .+2 ; 0x512e <__ultoa_invert+0x48> + 512c: 68 94 set + 512e: 3f 91 pop r19 + 5130: 2a e0 ldi r18, 0x0A ; 10 + 5132: 26 9f mul r18, r22 + 5134: 11 24 eor r1, r1 + 5136: 30 19 sub r19, r0 + 5138: 30 5d subi r19, 0xD0 ; 208 + 513a: 31 93 st Z+, r19 + 513c: de f6 brtc .-74 ; 0x50f4 <__ultoa_invert+0xe> + 513e: cf 01 movw r24, r30 + 5140: 08 95 ret + 5142: 46 2f mov r20, r22 + 5144: 47 70 andi r20, 0x07 ; 7 + 5146: 40 5d subi r20, 0xD0 ; 208 + 5148: 41 93 st Z+, r20 + 514a: b3 e0 ldi r27, 0x03 ; 3 + 514c: 0f d0 rcall .+30 ; 0x516c <__ultoa_invert+0x86> + 514e: c9 f7 brne .-14 ; 0x5142 <__ultoa_invert+0x5c> + 5150: f6 cf rjmp .-20 ; 0x513e <__ultoa_invert+0x58> + 5152: 46 2f mov r20, r22 + 5154: 4f 70 andi r20, 0x0F ; 15 + 5156: 40 5d subi r20, 0xD0 ; 208 + 5158: 4a 33 cpi r20, 0x3A ; 58 + 515a: 18 f0 brcs .+6 ; 0x5162 <__ultoa_invert+0x7c> + 515c: 49 5d subi r20, 0xD9 ; 217 + 515e: 31 fd sbrc r19, 1 + 5160: 40 52 subi r20, 0x20 ; 32 + 5162: 41 93 st Z+, r20 + 5164: 02 d0 rcall .+4 ; 0x516a <__ultoa_invert+0x84> + 5166: a9 f7 brne .-22 ; 0x5152 <__ultoa_invert+0x6c> + 5168: ea cf rjmp .-44 ; 0x513e <__ultoa_invert+0x58> + 516a: b4 e0 ldi r27, 0x04 ; 4 + 516c: a6 95 lsr r26 + 516e: 97 95 ror r25 + 5170: 87 95 ror r24 + 5172: 77 95 ror r23 + 5174: 67 95 ror r22 + 5176: ba 95 dec r27 + 5178: c9 f7 brne .-14 ; 0x516c <__ultoa_invert+0x86> + 517a: 00 97 sbiw r24, 0x00 ; 0 + 517c: 61 05 cpc r22, r1 + 517e: 71 05 cpc r23, r1 + 5180: 08 95 ret + 5182: 9b 01 movw r18, r22 + 5184: ac 01 movw r20, r24 + 5186: 0a 2e mov r0, r26 + 5188: 06 94 lsr r0 + 518a: 57 95 ror r21 + 518c: 47 95 ror r20 + 518e: 37 95 ror r19 + 5190: 27 95 ror r18 + 5192: ba 95 dec r27 + 5194: c9 f7 brne .-14 ; 0x5188 <__ultoa_invert+0xa2> + 5196: 62 0f add r22, r18 + 5198: 73 1f adc r23, r19 + 519a: 84 1f adc r24, r20 + 519c: 95 1f adc r25, r21 + 519e: a0 1d adc r26, r0 + 51a0: 08 95 ret -00004e10 <__divmodsi4>: - 4e10: 05 2e mov r0, r21 - 4e12: 97 fb bst r25, 7 - 4e14: 16 f4 brtc .+4 ; 0x4e1a <__divmodsi4+0xa> - 4e16: 00 94 com r0 - 4e18: 06 d0 rcall .+12 ; 0x4e26 <__divmodsi4_neg1> - 4e1a: 57 fd sbrc r21, 7 - 4e1c: 0c d0 rcall .+24 ; 0x4e36 <__divmodsi4_neg2> - 4e1e: 44 d0 rcall .+136 ; 0x4ea8 <__udivmodsi4> - 4e20: 07 fc sbrc r0, 7 - 4e22: 09 d0 rcall .+18 ; 0x4e36 <__divmodsi4_neg2> - 4e24: 7e f4 brtc .+30 ; 0x4e44 <__divmodsi4_exit> +000051a2 <__divmodsi4>: + 51a2: 05 2e mov r0, r21 + 51a4: 97 fb bst r25, 7 + 51a6: 16 f4 brtc .+4 ; 0x51ac <__divmodsi4+0xa> + 51a8: 00 94 com r0 + 51aa: 06 d0 rcall .+12 ; 0x51b8 <__divmodsi4_neg1> + 51ac: 57 fd sbrc r21, 7 + 51ae: 0c d0 rcall .+24 ; 0x51c8 <__divmodsi4_neg2> + 51b0: 44 d0 rcall .+136 ; 0x523a <__udivmodsi4> + 51b2: 07 fc sbrc r0, 7 + 51b4: 09 d0 rcall .+18 ; 0x51c8 <__divmodsi4_neg2> + 51b6: 7e f4 brtc .+30 ; 0x51d6 <__divmodsi4_exit> -00004e26 <__divmodsi4_neg1>: - 4e26: 90 95 com r25 - 4e28: 80 95 com r24 - 4e2a: 70 95 com r23 - 4e2c: 61 95 neg r22 - 4e2e: 7f 4f sbci r23, 0xFF ; 255 - 4e30: 8f 4f sbci r24, 0xFF ; 255 - 4e32: 9f 4f sbci r25, 0xFF ; 255 - 4e34: 08 95 ret +000051b8 <__divmodsi4_neg1>: + 51b8: 90 95 com r25 + 51ba: 80 95 com r24 + 51bc: 70 95 com r23 + 51be: 61 95 neg r22 + 51c0: 7f 4f sbci r23, 0xFF ; 255 + 51c2: 8f 4f sbci r24, 0xFF ; 255 + 51c4: 9f 4f sbci r25, 0xFF ; 255 + 51c6: 08 95 ret -00004e36 <__divmodsi4_neg2>: - 4e36: 50 95 com r21 - 4e38: 40 95 com r20 - 4e3a: 30 95 com r19 - 4e3c: 21 95 neg r18 - 4e3e: 3f 4f sbci r19, 0xFF ; 255 - 4e40: 4f 4f sbci r20, 0xFF ; 255 - 4e42: 5f 4f sbci r21, 0xFF ; 255 +000051c8 <__divmodsi4_neg2>: + 51c8: 50 95 com r21 + 51ca: 40 95 com r20 + 51cc: 30 95 com r19 + 51ce: 21 95 neg r18 + 51d0: 3f 4f sbci r19, 0xFF ; 255 + 51d2: 4f 4f sbci r20, 0xFF ; 255 + 51d4: 5f 4f sbci r21, 0xFF ; 255 -00004e44 <__divmodsi4_exit>: - 4e44: 08 95 ret +000051d6 <__divmodsi4_exit>: + 51d6: 08 95 ret -00004e46 <__prologue_saves__>: - 4e46: 2f 92 push r2 - 4e48: 3f 92 push r3 - 4e4a: 4f 92 push r4 - 4e4c: 5f 92 push r5 - 4e4e: 6f 92 push r6 - 4e50: 7f 92 push r7 - 4e52: 8f 92 push r8 - 4e54: 9f 92 push r9 - 4e56: af 92 push r10 - 4e58: bf 92 push r11 - 4e5a: cf 92 push r12 - 4e5c: df 92 push r13 - 4e5e: ef 92 push r14 - 4e60: ff 92 push r15 - 4e62: 0f 93 push r16 - 4e64: 1f 93 push r17 - 4e66: cf 93 push r28 - 4e68: df 93 push r29 - 4e6a: cd b7 in r28, 0x3d ; 61 - 4e6c: de b7 in r29, 0x3e ; 62 - 4e6e: ca 1b sub r28, r26 - 4e70: db 0b sbc r29, r27 - 4e72: cd bf out 0x3d, r28 ; 61 - 4e74: de bf out 0x3e, r29 ; 62 - 4e76: 09 94 ijmp +000051d8 <__prologue_saves__>: + 51d8: 2f 92 push r2 + 51da: 3f 92 push r3 + 51dc: 4f 92 push r4 + 51de: 5f 92 push r5 + 51e0: 6f 92 push r6 + 51e2: 7f 92 push r7 + 51e4: 8f 92 push r8 + 51e6: 9f 92 push r9 + 51e8: af 92 push r10 + 51ea: bf 92 push r11 + 51ec: cf 92 push r12 + 51ee: df 92 push r13 + 51f0: ef 92 push r14 + 51f2: ff 92 push r15 + 51f4: 0f 93 push r16 + 51f6: 1f 93 push r17 + 51f8: cf 93 push r28 + 51fa: df 93 push r29 + 51fc: cd b7 in r28, 0x3d ; 61 + 51fe: de b7 in r29, 0x3e ; 62 + 5200: ca 1b sub r28, r26 + 5202: db 0b sbc r29, r27 + 5204: cd bf out 0x3d, r28 ; 61 + 5206: de bf out 0x3e, r29 ; 62 + 5208: 09 94 ijmp -00004e78 <__epilogue_restores__>: - 4e78: 2a 88 ldd r2, Y+18 ; 0x12 - 4e7a: 39 88 ldd r3, Y+17 ; 0x11 - 4e7c: 48 88 ldd r4, Y+16 ; 0x10 - 4e7e: 5f 84 ldd r5, Y+15 ; 0x0f - 4e80: 6e 84 ldd r6, Y+14 ; 0x0e - 4e82: 7d 84 ldd r7, Y+13 ; 0x0d - 4e84: 8c 84 ldd r8, Y+12 ; 0x0c - 4e86: 9b 84 ldd r9, Y+11 ; 0x0b - 4e88: aa 84 ldd r10, Y+10 ; 0x0a - 4e8a: b9 84 ldd r11, Y+9 ; 0x09 - 4e8c: c8 84 ldd r12, Y+8 ; 0x08 - 4e8e: df 80 ldd r13, Y+7 ; 0x07 - 4e90: ee 80 ldd r14, Y+6 ; 0x06 - 4e92: fd 80 ldd r15, Y+5 ; 0x05 - 4e94: 0c 81 ldd r16, Y+4 ; 0x04 - 4e96: 1b 81 ldd r17, Y+3 ; 0x03 - 4e98: aa 81 ldd r26, Y+2 ; 0x02 - 4e9a: b9 81 ldd r27, Y+1 ; 0x01 - 4e9c: ce 0f add r28, r30 - 4e9e: d1 1d adc r29, r1 - 4ea0: cd bf out 0x3d, r28 ; 61 - 4ea2: de bf out 0x3e, r29 ; 62 - 4ea4: ed 01 movw r28, r26 - 4ea6: 08 95 ret +0000520a <__epilogue_restores__>: + 520a: 2a 88 ldd r2, Y+18 ; 0x12 + 520c: 39 88 ldd r3, Y+17 ; 0x11 + 520e: 48 88 ldd r4, Y+16 ; 0x10 + 5210: 5f 84 ldd r5, Y+15 ; 0x0f + 5212: 6e 84 ldd r6, Y+14 ; 0x0e + 5214: 7d 84 ldd r7, Y+13 ; 0x0d + 5216: 8c 84 ldd r8, Y+12 ; 0x0c + 5218: 9b 84 ldd r9, Y+11 ; 0x0b + 521a: aa 84 ldd r10, Y+10 ; 0x0a + 521c: b9 84 ldd r11, Y+9 ; 0x09 + 521e: c8 84 ldd r12, Y+8 ; 0x08 + 5220: df 80 ldd r13, Y+7 ; 0x07 + 5222: ee 80 ldd r14, Y+6 ; 0x06 + 5224: fd 80 ldd r15, Y+5 ; 0x05 + 5226: 0c 81 ldd r16, Y+4 ; 0x04 + 5228: 1b 81 ldd r17, Y+3 ; 0x03 + 522a: aa 81 ldd r26, Y+2 ; 0x02 + 522c: b9 81 ldd r27, Y+1 ; 0x01 + 522e: ce 0f add r28, r30 + 5230: d1 1d adc r29, r1 + 5232: cd bf out 0x3d, r28 ; 61 + 5234: de bf out 0x3e, r29 ; 62 + 5236: ed 01 movw r28, r26 + 5238: 08 95 ret -00004ea8 <__udivmodsi4>: - 4ea8: a1 e2 ldi r26, 0x21 ; 33 - 4eaa: 1a 2e mov r1, r26 - 4eac: aa 1b sub r26, r26 - 4eae: bb 1b sub r27, r27 - 4eb0: fd 01 movw r30, r26 - 4eb2: 0d c0 rjmp .+26 ; 0x4ece <__udivmodsi4_ep> +0000523a <__udivmodsi4>: + 523a: a1 e2 ldi r26, 0x21 ; 33 + 523c: 1a 2e mov r1, r26 + 523e: aa 1b sub r26, r26 + 5240: bb 1b sub r27, r27 + 5242: fd 01 movw r30, r26 + 5244: 0d c0 rjmp .+26 ; 0x5260 <__udivmodsi4_ep> -00004eb4 <__udivmodsi4_loop>: - 4eb4: aa 1f adc r26, r26 - 4eb6: bb 1f adc r27, r27 - 4eb8: ee 1f adc r30, r30 - 4eba: ff 1f adc r31, r31 - 4ebc: a2 17 cp r26, r18 - 4ebe: b3 07 cpc r27, r19 - 4ec0: e4 07 cpc r30, r20 - 4ec2: f5 07 cpc r31, r21 - 4ec4: 20 f0 brcs .+8 ; 0x4ece <__udivmodsi4_ep> - 4ec6: a2 1b sub r26, r18 - 4ec8: b3 0b sbc r27, r19 - 4eca: e4 0b sbc r30, r20 - 4ecc: f5 0b sbc r31, r21 +00005246 <__udivmodsi4_loop>: + 5246: aa 1f adc r26, r26 + 5248: bb 1f adc r27, r27 + 524a: ee 1f adc r30, r30 + 524c: ff 1f adc r31, r31 + 524e: a2 17 cp r26, r18 + 5250: b3 07 cpc r27, r19 + 5252: e4 07 cpc r30, r20 + 5254: f5 07 cpc r31, r21 + 5256: 20 f0 brcs .+8 ; 0x5260 <__udivmodsi4_ep> + 5258: a2 1b sub r26, r18 + 525a: b3 0b sbc r27, r19 + 525c: e4 0b sbc r30, r20 + 525e: f5 0b sbc r31, r21 -00004ece <__udivmodsi4_ep>: - 4ece: 66 1f adc r22, r22 - 4ed0: 77 1f adc r23, r23 - 4ed2: 88 1f adc r24, r24 - 4ed4: 99 1f adc r25, r25 - 4ed6: 1a 94 dec r1 - 4ed8: 69 f7 brne .-38 ; 0x4eb4 <__udivmodsi4_loop> - 4eda: 60 95 com r22 - 4edc: 70 95 com r23 - 4ede: 80 95 com r24 - 4ee0: 90 95 com r25 - 4ee2: 9b 01 movw r18, r22 - 4ee4: ac 01 movw r20, r24 - 4ee6: bd 01 movw r22, r26 - 4ee8: cf 01 movw r24, r30 - 4eea: 08 95 ret +00005260 <__udivmodsi4_ep>: + 5260: 66 1f adc r22, r22 + 5262: 77 1f adc r23, r23 + 5264: 88 1f adc r24, r24 + 5266: 99 1f adc r25, r25 + 5268: 1a 94 dec r1 + 526a: 69 f7 brne .-38 ; 0x5246 <__udivmodsi4_loop> + 526c: 60 95 com r22 + 526e: 70 95 com r23 + 5270: 80 95 com r24 + 5272: 90 95 com r25 + 5274: 9b 01 movw r18, r22 + 5276: ac 01 movw r20, r24 + 5278: bd 01 movw r22, r26 + 527a: cf 01 movw r24, r30 + 527c: 08 95 ret -00004eec <_exit>: - 4eec: f8 94 cli +0000527e <_exit>: + 527e: f8 94 cli -00004eee <__stop_program>: - 4eee: ff cf rjmp .-2 ; 0x4eee <__stop_program> +00005280 <__stop_program>: + 5280: ff cf rjmp .-2 ; 0x5280 <__stop_program> diff --git a/Firmware/Chameleon-Mini/Chameleon-Mini.map b/Firmware/Chameleon-Mini/Chameleon-Mini.map index fd61c01..628f16f 100644 --- a/Firmware/Chameleon-Mini/Chameleon-Mini.map +++ b/Firmware/Chameleon-Mini/Chameleon-Mini.map @@ -101,7 +101,6 @@ Discarded input sections .text 0x00000000 0x0 Bin/Common.o .bss 0x00000000 0x0 Bin/Common.o .text 0x00000000 0x0 Bin/Memory.o - .bss 0x00000000 0x0 Bin/Memory.o .text 0x00000000 0x0 Bin/Button.o .text 0x00000000 0x0 Bin/Settings.o .bss 0x00000000 0x0 Bin/Settings.o @@ -658,7 +657,7 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .rela.plt *(.rela.plt) -.text 0x00000000 0x4ef0 +.text 0x00000000 0x5282 *(.vectors) .vectors 0x00000000 0x1fc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o 0x00000000 __vectors @@ -672,45 +671,45 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg 0x00000238 ConfigurationDescriptor 0x00000276 DeviceDescriptor .progmem.data 0x00000288 0x6f Bin/Configuration.o - .progmem.data 0x000002f7 0xe0 Bin/Button.o - .progmem.data 0x000003d7 0x64 Bin/Commands.o - .progmem.data 0x0000043b 0x22c Bin/CommandLine.o - 0x0000043b CommandTable - 0x00000668 . = ALIGN (0x2) - *fill* 0x00000667 0x1 - 0x00000668 __trampolines_start = . + .progmem.data 0x000002f7 0x120 Bin/Button.o + .progmem.data 0x00000417 0x64 Bin/Commands.o + .progmem.data 0x0000047b 0x22c Bin/CommandLine.o + 0x0000047b CommandTable + 0x000006a8 . = ALIGN (0x2) + *fill* 0x000006a7 0x1 + 0x000006a8 __trampolines_start = . *(.trampolines) - .trampolines 0x00000668 0x0 linker stubs + .trampolines 0x000006a8 0x0 linker stubs *(.trampolines*) - 0x00000668 __trampolines_end = . + 0x000006a8 __trampolines_end = . *(.jumptables) *(.jumptables*) *(.lowtext) *(.lowtext*) - 0x00000668 __ctors_start = . + 0x000006a8 __ctors_start = . *(.ctors) - 0x00000668 __ctors_end = . - 0x00000668 __dtors_start = . + 0x000006a8 __ctors_end = . + 0x000006a8 __dtors_start = . *(.dtors) - 0x00000668 __dtors_end = . + 0x000006a8 __dtors_end = . SORT(*)(.ctors) SORT(*)(.dtors) *(.init0) - .init0 0x00000668 0x0 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o - 0x00000668 __init + .init0 0x000006a8 0x0 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + 0x000006a8 __init *(.init0) *(.init1) *(.init1) *(.init2) - .init2 0x00000668 0xc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + .init2 0x000006a8 0xc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o *(.init2) *(.init3) *(.init3) *(.init4) - .init4 0x00000674 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) - 0x00000674 __do_copy_data - .init4 0x0000068a 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) - 0x0000068a __do_clear_bss + .init4 0x000006b4 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + 0x000006b4 __do_copy_data + .init4 0x000006ca 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + 0x000006ca __do_clear_bss *(.init4) *(.init5) *(.init5) @@ -721,632 +720,638 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg *(.init8) *(.init8) *(.init9) - .init9 0x0000069a 0x6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + .init9 0x000006da 0x6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o *(.init9) *(.text) - .text 0x000006a0 0x2 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o - 0x000006a0 __vector_38 - 0x000006a0 __vector_104 - 0x000006a0 __vector_63 - 0x000006a0 __vector_28 - 0x000006a0 __vector_67 - 0x000006a0 __vector_1 - 0x000006a0 __vector_119 - 0x000006a0 __vector_32 - 0x000006a0 __vector_75 - 0x000006a0 __vector_71 - 0x000006a0 __vector_91 - 0x000006a0 __vector_62 - 0x000006a0 __vector_77 - 0x000006a0 __vector_102 - 0x000006a0 __vector_24 - 0x000006a0 __vector_12 - 0x000006a0 __vector_55 - 0x000006a0 __vector_69 - 0x000006a0 __vector_81 - 0x000006a0 __vector_90 - 0x000006a0 __vector_46 - 0x000006a0 __bad_interrupt - 0x000006a0 __vector_122 - 0x000006a0 __vector_72 - 0x000006a0 __vector_114 - 0x000006a0 __vector_6 - 0x000006a0 __vector_110 - 0x000006a0 __vector_31 - 0x000006a0 __vector_92 - 0x000006a0 __vector_35 - 0x000006a0 __vector_78 - 0x000006a0 __vector_74 - 0x000006a0 __vector_117 - 0x000006a0 __vector_39 - 0x000006a0 __vector_107 - 0x000006a0 __vector_3 - 0x000006a0 __vector_105 - 0x000006a0 __vector_98 - 0x000006a0 __vector_23 - 0x000006a0 __vector_68 - 0x000006a0 __vector_30 - 0x000006a0 __vector_73 - 0x000006a0 __vector_45 - 0x000006a0 __vector_25 - 0x000006a0 __vector_93 - 0x000006a0 __vector_61 - 0x000006a0 __vector_11 - 0x000006a0 __vector_54 - 0x000006a0 __vector_99 - 0x000006a0 __vector_13 - 0x000006a0 __vector_17 - 0x000006a0 __vector_19 - 0x000006a0 __vector_56 - 0x000006a0 __vector_7 - 0x000006a0 __vector_49 - 0x000006a0 __vector_123 - 0x000006a0 __vector_41 - 0x000006a0 __vector_86 - 0x000006a0 __vector_100 - 0x000006a0 __vector_101 - 0x000006a0 __vector_64 - 0x000006a0 __vector_88 - 0x000006a0 __vector_109 - 0x000006a0 __vector_43 - 0x000006a0 __vector_27 - 0x000006a0 __vector_5 - 0x000006a0 __vector_113 - 0x000006a0 __vector_33 - 0x000006a0 __vector_76 - 0x000006a0 __vector_115 - 0x000006a0 __vector_47 - 0x000006a0 __vector_52 - 0x000006a0 __vector_37 - 0x000006a0 __vector_95 - 0x000006a0 __vector_103 - 0x000006a0 __vector_96 - 0x000006a0 __vector_89 - 0x000006a0 __vector_108 - 0x000006a0 __vector_4 - 0x000006a0 __vector_44 - 0x000006a0 __vector_82 - 0x000006a0 __vector_106 - 0x000006a0 __vector_118 - 0x000006a0 __vector_51 - 0x000006a0 __vector_9 - 0x000006a0 __vector_2 - 0x000006a0 __vector_21 - 0x000006a0 __vector_15 - 0x000006a0 __vector_66 - 0x000006a0 __vector_36 - 0x000006a0 __vector_79 - 0x000006a0 __vector_58 - 0x000006a0 __vector_70 - 0x000006a0 __vector_29 - 0x000006a0 __vector_60 - 0x000006a0 __vector_121 - 0x000006a0 __vector_40 - 0x000006a0 __vector_85 - 0x000006a0 __vector_94 - 0x000006a0 __vector_126 - 0x000006a0 __vector_8 - 0x000006a0 __vector_26 - 0x000006a0 __vector_48 - 0x000006a0 __vector_124 - 0x000006a0 __vector_116 - 0x000006a0 __vector_112 - 0x000006a0 __vector_111 - 0x000006a0 __vector_80 - 0x000006a0 __vector_14 - 0x000006a0 __vector_84 - 0x000006a0 __vector_57 - 0x000006a0 __vector_53 - 0x000006a0 __vector_10 - 0x000006a0 __vector_50 - 0x000006a0 __vector_16 - 0x000006a0 __vector_59 - 0x000006a0 __vector_18 - 0x000006a0 __vector_97 - 0x000006a0 __vector_20 - 0x000006a0 __vector_42 - 0x000006a0 __vector_87 - 0x000006a0 __vector_65 - 0x000006a0 __vector_120 - 0x000006a2 . = ALIGN (0x2) + .text 0x000006e0 0x2 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + 0x000006e0 __vector_38 + 0x000006e0 __vector_104 + 0x000006e0 __vector_63 + 0x000006e0 __vector_28 + 0x000006e0 __vector_67 + 0x000006e0 __vector_1 + 0x000006e0 __vector_119 + 0x000006e0 __vector_32 + 0x000006e0 __vector_75 + 0x000006e0 __vector_71 + 0x000006e0 __vector_91 + 0x000006e0 __vector_62 + 0x000006e0 __vector_77 + 0x000006e0 __vector_102 + 0x000006e0 __vector_24 + 0x000006e0 __vector_12 + 0x000006e0 __vector_55 + 0x000006e0 __vector_69 + 0x000006e0 __vector_81 + 0x000006e0 __vector_90 + 0x000006e0 __vector_46 + 0x000006e0 __bad_interrupt + 0x000006e0 __vector_122 + 0x000006e0 __vector_72 + 0x000006e0 __vector_114 + 0x000006e0 __vector_6 + 0x000006e0 __vector_110 + 0x000006e0 __vector_31 + 0x000006e0 __vector_92 + 0x000006e0 __vector_35 + 0x000006e0 __vector_78 + 0x000006e0 __vector_74 + 0x000006e0 __vector_117 + 0x000006e0 __vector_39 + 0x000006e0 __vector_107 + 0x000006e0 __vector_3 + 0x000006e0 __vector_105 + 0x000006e0 __vector_98 + 0x000006e0 __vector_23 + 0x000006e0 __vector_68 + 0x000006e0 __vector_30 + 0x000006e0 __vector_73 + 0x000006e0 __vector_45 + 0x000006e0 __vector_25 + 0x000006e0 __vector_93 + 0x000006e0 __vector_61 + 0x000006e0 __vector_11 + 0x000006e0 __vector_54 + 0x000006e0 __vector_99 + 0x000006e0 __vector_13 + 0x000006e0 __vector_17 + 0x000006e0 __vector_19 + 0x000006e0 __vector_56 + 0x000006e0 __vector_7 + 0x000006e0 __vector_49 + 0x000006e0 __vector_123 + 0x000006e0 __vector_41 + 0x000006e0 __vector_86 + 0x000006e0 __vector_100 + 0x000006e0 __vector_101 + 0x000006e0 __vector_64 + 0x000006e0 __vector_88 + 0x000006e0 __vector_109 + 0x000006e0 __vector_43 + 0x000006e0 __vector_27 + 0x000006e0 __vector_5 + 0x000006e0 __vector_113 + 0x000006e0 __vector_33 + 0x000006e0 __vector_76 + 0x000006e0 __vector_115 + 0x000006e0 __vector_47 + 0x000006e0 __vector_52 + 0x000006e0 __vector_37 + 0x000006e0 __vector_95 + 0x000006e0 __vector_103 + 0x000006e0 __vector_96 + 0x000006e0 __vector_89 + 0x000006e0 __vector_108 + 0x000006e0 __vector_4 + 0x000006e0 __vector_44 + 0x000006e0 __vector_82 + 0x000006e0 __vector_106 + 0x000006e0 __vector_118 + 0x000006e0 __vector_51 + 0x000006e0 __vector_9 + 0x000006e0 __vector_2 + 0x000006e0 __vector_21 + 0x000006e0 __vector_15 + 0x000006e0 __vector_66 + 0x000006e0 __vector_36 + 0x000006e0 __vector_79 + 0x000006e0 __vector_58 + 0x000006e0 __vector_70 + 0x000006e0 __vector_29 + 0x000006e0 __vector_60 + 0x000006e0 __vector_121 + 0x000006e0 __vector_40 + 0x000006e0 __vector_85 + 0x000006e0 __vector_94 + 0x000006e0 __vector_126 + 0x000006e0 __vector_8 + 0x000006e0 __vector_26 + 0x000006e0 __vector_48 + 0x000006e0 __vector_124 + 0x000006e0 __vector_116 + 0x000006e0 __vector_112 + 0x000006e0 __vector_111 + 0x000006e0 __vector_80 + 0x000006e0 __vector_14 + 0x000006e0 __vector_84 + 0x000006e0 __vector_57 + 0x000006e0 __vector_53 + 0x000006e0 __vector_10 + 0x000006e0 __vector_50 + 0x000006e0 __vector_16 + 0x000006e0 __vector_59 + 0x000006e0 __vector_18 + 0x000006e0 __vector_97 + 0x000006e0 __vector_20 + 0x000006e0 __vector_42 + 0x000006e0 __vector_87 + 0x000006e0 __vector_65 + 0x000006e0 __vector_120 + 0x000006e2 . = ALIGN (0x2) *(.text.*) .text.startup.main - 0x000006a2 0x6e Bin/Chameleon-Mini.o - 0x000006a2 main + 0x000006e2 0x76 Bin/Chameleon-Mini.o + 0x000006e2 main .text.CALLBACK_USB_GetDescriptor - 0x00000710 0x82 Bin/LUFADescriptors.o - 0x00000710 CALLBACK_USB_GetDescriptor + 0x00000758 0x82 Bin/LUFADescriptors.o + 0x00000758 CALLBACK_USB_GetDescriptor .text.__vector_default - 0x00000792 0xc Bin/System.o - 0x00000792 __vector_default + 0x000007da 0xc Bin/System.o + 0x000007da __vector_default .text.SystemInit - 0x0000079e 0x6e Bin/System.o - 0x0000079e SystemInit + 0x000007e6 0x6e Bin/System.o + 0x000007e6 SystemInit .text.SystemReset - 0x0000080c 0xe Bin/System.o - 0x0000080c SystemReset + 0x00000854 0xe Bin/System.o + 0x00000854 SystemReset .text.SystemEnterBootloader - 0x0000081a 0xc Bin/System.o - 0x0000081a SystemEnterBootloader + 0x00000862 0xc Bin/System.o + 0x00000862 SystemEnterBootloader .text.SystemStartUSBClock - 0x00000826 0x32 Bin/System.o - 0x00000826 SystemStartUSBClock + 0x0000086e 0x32 Bin/System.o + 0x0000086e SystemStartUSBClock .text.SystemStopUSBClock - 0x00000858 0x1c Bin/System.o - 0x00000858 SystemStopUSBClock + 0x000008a0 0x1c Bin/System.o + 0x000008a0 SystemStopUSBClock .text.SystemInterruptInit - 0x00000874 0xc Bin/System.o - 0x00000874 SystemInterruptInit + 0x000008bc 0xc Bin/System.o + 0x000008bc SystemInterruptInit .text.CodecInitDummy - 0x00000880 0x2 Bin/Configuration.o + 0x000008c8 0x2 Bin/Configuration.o .text.CodecTaskDummy - 0x00000882 0x2 Bin/Configuration.o + 0x000008ca 0x2 Bin/Configuration.o .text.ApplicationInitDummy - 0x00000884 0x2 Bin/Configuration.o + 0x000008cc 0x2 Bin/Configuration.o .text.ApplicationResetDummy - 0x00000886 0x2 Bin/Configuration.o + 0x000008ce 0x2 Bin/Configuration.o .text.ApplicationTaskDummy - 0x00000888 0x2 Bin/Configuration.o + 0x000008d0 0x2 Bin/Configuration.o .text.ApplicationProcessDummy - 0x0000088a 0x6 Bin/Configuration.o + 0x000008d2 0x6 Bin/Configuration.o .text.ApplicationGetUidDummy - 0x00000890 0x2 Bin/Configuration.o + 0x000008d8 0x2 Bin/Configuration.o .text.ApplicationSetUidDummy - 0x00000892 0x2 Bin/Configuration.o + 0x000008da 0x2 Bin/Configuration.o .text.ConfigurationSetById - 0x00000894 0x36 Bin/Configuration.o - 0x00000894 ConfigurationSetById + 0x000008dc 0x36 Bin/Configuration.o + 0x000008dc ConfigurationSetById .text.ConfigurationInit - 0x000008ca 0xc Bin/Configuration.o - 0x000008ca ConfigurationInit + 0x00000912 0xc Bin/Configuration.o + 0x00000912 ConfigurationInit .text.ConfigurationSetByName - 0x000008d6 0x82 Bin/Configuration.o - 0x000008d6 ConfigurationSetByName + 0x0000091e 0x82 Bin/Configuration.o + 0x0000091e ConfigurationSetByName .text.ConfigurationGetList - 0x00000958 0x5e Bin/Configuration.o - 0x00000958 ConfigurationGetList + 0x000009a0 0x5e Bin/Configuration.o + 0x000009a0 ConfigurationGetList .text.RandomInit - 0x000009b6 0x2 Bin/Random.o - 0x000009b6 RandomInit + 0x000009fe 0x2 Bin/Random.o + 0x000009fe RandomInit .text.RandomGetByte - 0x000009b8 0x6 Bin/Random.o - 0x000009b8 RandomGetByte + 0x00000a00 0x6 Bin/Random.o + 0x00000a00 RandomGetByte .text.RandomGetBuffer - 0x000009be 0x1e Bin/Random.o - 0x000009be RandomGetBuffer + 0x00000a06 0x1e Bin/Random.o + 0x00000a06 RandomGetBuffer .text.RandomTick - 0x000009dc 0x10 Bin/Random.o - 0x000009dc RandomTick + 0x00000a24 0x10 Bin/Random.o + 0x00000a24 RandomTick .text.BufferToHexString - 0x000009ec 0x84 Bin/Common.o - 0x000009ec BufferToHexString + 0x00000a34 0x84 Bin/Common.o + 0x00000a34 BufferToHexString .text.HexStringToBuffer - 0x00000a70 0x8c Bin/Common.o - 0x00000a70 HexStringToBuffer - .text.MemoryInit - 0x00000afc 0xfc Bin/Memory.o - 0x00000afc MemoryInit + 0x00000ab8 0x8c Bin/Common.o + 0x00000ab8 HexStringToBuffer .text.MemoryReadBlock - 0x00000bf8 0x10a Bin/Memory.o - 0x00000bf8 MemoryReadBlock + 0x00000b44 0x30 Bin/Memory.o + 0x00000b44 MemoryReadBlock .text.MemoryWriteBlock - 0x00000d02 0x286 Bin/Memory.o - 0x00000d02 MemoryWriteBlock + 0x00000b74 0x32 Bin/Memory.o + 0x00000b74 MemoryWriteBlock .text.MemoryClear - 0x00000f88 0xb6 Bin/Memory.o - 0x00000f88 MemoryClear + 0x00000ba6 0x10 Bin/Memory.o + 0x00000ba6 MemoryClear + .text.MemoryRecall + 0x00000bb6 0xec Bin/Memory.o + 0x00000bb6 MemoryRecall + .text.MemoryInit + 0x00000ca2 0xfc Bin/Memory.o + 0x00000ca2 MemoryInit + .text.MemoryStore + 0x00000d9e 0x282 Bin/Memory.o + 0x00000d9e MemoryStore .text.MemoryUploadBlock - 0x0000103e 0x70 Bin/Memory.o - 0x0000103e MemoryUploadBlock + 0x00001020 0x3c2 Bin/Memory.o + 0x00001020 MemoryUploadBlock .text.MemoryDownloadBlock - 0x000010ae 0x72 Bin/Memory.o - 0x000010ae MemoryDownloadBlock + 0x000013e2 0x7a Bin/Memory.o + 0x000013e2 MemoryDownloadBlock .text.ButtonInit - 0x00001120 0xe Bin/Button.o - 0x00001120 ButtonInit + 0x0000145c 0xe Bin/Button.o + 0x0000145c ButtonInit .text.ButtonTick - 0x0000112e 0x1b6 Bin/Button.o - 0x0000112e ButtonTick + 0x0000146a 0x1ca Bin/Button.o + 0x0000146a ButtonTick .text.ButtonGetActionList - 0x000012e4 0x64 Bin/Button.o - 0x000012e4 ButtonGetActionList + 0x00001634 0x64 Bin/Button.o + 0x00001634 ButtonGetActionList .text.ButtonSetActionById - 0x00001348 0xc Bin/Button.o - 0x00001348 ButtonSetActionById + 0x00001698 0xc Bin/Button.o + 0x00001698 ButtonSetActionById .text.ButtonGetActionByName - 0x00001354 0x1c Bin/Button.o - 0x00001354 ButtonGetActionByName + 0x000016a4 0x1c Bin/Button.o + 0x000016a4 ButtonGetActionByName .text.ButtonSetActionByName - 0x00001370 0x92 Bin/Button.o - 0x00001370 ButtonSetActionByName + 0x000016c0 0xb6 Bin/Button.o + 0x000016c0 ButtonSetActionByName .text.SettingsLoad - 0x00001402 0x10 Bin/Settings.o - 0x00001402 SettingsLoad + 0x00001776 0x10 Bin/Settings.o + 0x00001776 SettingsLoad .text.SettingsSave - 0x00001412 0x10 Bin/Settings.o - 0x00001412 SettingsSave + 0x00001786 0x10 Bin/Settings.o + 0x00001786 SettingsSave .text.SettingsSetActiveById - 0x00001422 0x1e Bin/Settings.o - 0x00001422 SettingsSetActiveById + 0x00001796 0x2c Bin/Settings.o + 0x00001796 SettingsSetActiveById .text.SettingsCycle - 0x00001440 0xda Bin/Settings.o - 0x00001440 SettingsCycle + 0x000017c2 0xda Bin/Settings.o + 0x000017c2 SettingsCycle .text.SettingsGetActiveById - 0x0000151a 0x6 Bin/Settings.o - 0x0000151a SettingsGetActiveById + 0x0000189c 0x6 Bin/Settings.o + 0x0000189c SettingsGetActiveById .text.SettingsGetActiveByName - 0x00001520 0x14 Bin/Settings.o - 0x00001520 SettingsGetActiveByName + 0x000018a2 0x14 Bin/Settings.o + 0x000018a2 SettingsGetActiveByName .text.SettingsSetActiveByName - 0x00001534 0x1a Bin/Settings.o - 0x00001534 SettingsSetActiveByName + 0x000018b6 0x1a Bin/Settings.o + 0x000018b6 SettingsSetActiveByName .text.TerminalSendString - 0x0000154e 0xa Bin/Terminal.o - 0x0000154e TerminalSendString + 0x000018d0 0xa Bin/Terminal.o + 0x000018d0 TerminalSendString .text.TerminalSendStringP - 0x00001558 0x28 Bin/Terminal.o - 0x00001558 TerminalSendStringP + 0x000018da 0x28 Bin/Terminal.o + 0x000018da TerminalSendStringP .text.TerminalSendBlock - 0x00001580 0xc Bin/Terminal.o - 0x00001580 TerminalSendBlock + 0x00001902 0xc Bin/Terminal.o + 0x00001902 TerminalSendBlock .text.TerminalInit - 0x0000158c 0xa Bin/Terminal.o - 0x0000158c TerminalInit + 0x0000190e 0xa Bin/Terminal.o + 0x0000190e TerminalInit .text.TerminalTask - 0x00001596 0x3e Bin/Terminal.o - 0x00001596 TerminalTask + 0x00001918 0x3e Bin/Terminal.o + 0x00001918 TerminalTask .text.TerminalTick - 0x000015d4 0x7c Bin/Terminal.o - 0x000015d4 TerminalTick + 0x00001956 0x80 Bin/Terminal.o + 0x00001956 TerminalTick .text.EVENT_USB_Device_Connect - 0x00001650 0xa Bin/Terminal.o - 0x00001650 EVENT_USB_Device_Connect + 0x000019d6 0xa Bin/Terminal.o + 0x000019d6 EVENT_USB_Device_Connect .text.EVENT_USB_Device_Disconnect - 0x0000165a 0xa Bin/Terminal.o - 0x0000165a EVENT_USB_Device_Disconnect + 0x000019e0 0xa Bin/Terminal.o + 0x000019e0 EVENT_USB_Device_Disconnect .text.EVENT_USB_Device_ConfigurationChanged - 0x00001664 0x8 Bin/Terminal.o - 0x00001664 EVENT_USB_Device_ConfigurationChanged + 0x000019ea 0x8 Bin/Terminal.o + 0x000019ea EVENT_USB_Device_ConfigurationChanged .text.EVENT_USB_Device_ControlRequest - 0x0000166c 0x8 Bin/Terminal.o - 0x0000166c EVENT_USB_Device_ControlRequest + 0x000019f2 0x8 Bin/Terminal.o + 0x000019f2 EVENT_USB_Device_ControlRequest .text.CommandGetVersion - 0x00001674 0x3c Bin/Commands.o - 0x00001674 CommandGetVersion + 0x000019fa 0x3c Bin/Commands.o + 0x000019fa CommandGetVersion .text.CommandGetConfig - 0x000016b0 0x2c Bin/Commands.o - 0x000016b0 CommandGetConfig + 0x00001a36 0x2c Bin/Commands.o + 0x00001a36 CommandGetConfig .text.CommandSetConfig - 0x000016dc 0x10 Bin/Commands.o - 0x000016dc CommandSetConfig + 0x00001a62 0x12 Bin/Commands.o + 0x00001a62 CommandSetConfig .text.CommandExecConfig - 0x000016ec 0xa Bin/Commands.o - 0x000016ec CommandExecConfig + 0x00001a74 0xc Bin/Commands.o + 0x00001a74 CommandExecConfig .text.CommandGetUid - 0x000016f6 0x4c Bin/Commands.o - 0x000016f6 CommandGetUid + 0x00001a80 0x4e Bin/Commands.o + 0x00001a80 CommandGetUid .text.CommandSetUid - 0x00001742 0xae Bin/Commands.o - 0x00001742 CommandSetUid + 0x00001ace 0xb2 Bin/Commands.o + 0x00001ace CommandSetUid .text.CommandGetReadOnly - 0x000017f0 0x24 Bin/Commands.o - 0x000017f0 CommandGetReadOnly + 0x00001b80 0x24 Bin/Commands.o + 0x00001b80 CommandGetReadOnly .text.CommandSetReadOnly - 0x00001814 0x28 Bin/Commands.o - 0x00001814 CommandSetReadOnly + 0x00001ba4 0x28 Bin/Commands.o + 0x00001ba4 CommandSetReadOnly .text.CommandExecUpload - 0x0000183c 0xa Bin/Commands.o - 0x0000183c CommandExecUpload + 0x00001bcc 0xa Bin/Commands.o + 0x00001bcc CommandExecUpload .text.CommandExecDownload - 0x00001846 0xa Bin/Commands.o - 0x00001846 CommandExecDownload + 0x00001bd6 0xa Bin/Commands.o + 0x00001bd6 CommandExecDownload .text.CommandExecReset - 0x00001850 0x16 Bin/Commands.o - 0x00001850 CommandExecReset + 0x00001be0 0x16 Bin/Commands.o + 0x00001be0 CommandExecReset .text.CommandExecUpgrade - 0x00001866 0x16 Bin/Commands.o - 0x00001866 CommandExecUpgrade + 0x00001bf6 0x16 Bin/Commands.o + 0x00001bf6 CommandExecUpgrade .text.CommandGetMemSize - 0x0000187c 0x30 Bin/Commands.o - 0x0000187c CommandGetMemSize + 0x00001c0c 0x30 Bin/Commands.o + 0x00001c0c CommandGetMemSize .text.CommandGetUidSize - 0x000018ac 0x2c Bin/Commands.o - 0x000018ac CommandGetUidSize + 0x00001c3c 0x2c Bin/Commands.o + 0x00001c3c CommandGetUidSize .text.CommandExecButton - 0x000018d8 0xa Bin/Commands.o - 0x000018d8 CommandExecButton + 0x00001c68 0xa Bin/Commands.o + 0x00001c68 CommandExecButton .text.CommandGetButton - 0x000018e2 0xa Bin/Commands.o - 0x000018e2 CommandGetButton + 0x00001c72 0xa Bin/Commands.o + 0x00001c72 CommandGetButton .text.CommandSetButton - 0x000018ec 0x10 Bin/Commands.o - 0x000018ec CommandSetButton + 0x00001c7c 0x10 Bin/Commands.o + 0x00001c7c CommandSetButton .text.CommandGetSetting - 0x000018fc 0xa Bin/Commands.o - 0x000018fc CommandGetSetting + 0x00001c8c 0xa Bin/Commands.o + 0x00001c8c CommandGetSetting .text.CommandSetSetting - 0x00001906 0x10 Bin/Commands.o - 0x00001906 CommandSetSetting + 0x00001c96 0x10 Bin/Commands.o + 0x00001c96 CommandSetSetting .text.CommandExecClear - 0x00001916 0x6 Bin/Commands.o - 0x00001916 CommandExecClear + 0x00001ca6 0x8 Bin/Commands.o + 0x00001ca6 CommandExecClear .text.CommandExecHelp - 0x0000191c 0x98 Bin/Commands.o - 0x0000191c CommandExecHelp + 0x00001cae 0x98 Bin/Commands.o + 0x00001cae CommandExecHelp .text.CommandGetRssi - 0x000019b4 0x68 Bin/Commands.o - 0x000019b4 CommandGetRssi + 0x00001d46 0x68 Bin/Commands.o + 0x00001d46 CommandGetRssi .text.CalcChecksum.constprop.0 - 0x00001a1c 0x14 Bin/XModem.o + 0x00001dae 0x14 Bin/XModem.o .text.XModemReceive - 0x00001a30 0x30 Bin/XModem.o - 0x00001a30 XModemReceive + 0x00001dc2 0x30 Bin/XModem.o + 0x00001dc2 XModemReceive .text.XModemSend - 0x00001a60 0x26 Bin/XModem.o - 0x00001a60 XModemSend + 0x00001df2 0x26 Bin/XModem.o + 0x00001df2 XModemSend .text.XModemProcessByte - 0x00001a86 0x284 Bin/XModem.o - 0x00001a86 XModemProcessByte + 0x00001e18 0x284 Bin/XModem.o + 0x00001e18 XModemProcessByte .text.XModemTick - 0x00001d0a 0x5c Bin/XModem.o - 0x00001d0a XModemTick + 0x0000209c 0x5c Bin/XModem.o + 0x0000209c XModemTick .text.CommandLineProcessByte - 0x00001d66 0x342 Bin/CommandLine.o - 0x00001d66 CommandLineProcessByte + 0x000020f8 0x342 Bin/CommandLine.o + 0x000020f8 CommandLineProcessByte .text.CommandLineTick - 0x000020a8 0x2 Bin/CommandLine.o - 0x000020a8 CommandLineTick + 0x0000243a 0x2 Bin/CommandLine.o + 0x0000243a CommandLineTick .text.StartDemod - 0x000020aa 0x3c Bin/ISO14443-2A.o + 0x0000243c 0x3c Bin/ISO14443-2A.o .text.__vector_34 - 0x000020e6 0x88 Bin/ISO14443-2A.o - 0x000020e6 __vector_34 + 0x00002478 0x88 Bin/ISO14443-2A.o + 0x00002478 __vector_34 .text.__vector_22 - 0x0000216e 0x148 Bin/ISO14443-2A.o - 0x0000216e __vector_22 + 0x00002500 0x148 Bin/ISO14443-2A.o + 0x00002500 __vector_22 .text.__vector_83 - 0x000022b6 0x1e2 Bin/ISO14443-2A.o - 0x000022b6 __vector_83 + 0x00002648 0x1e2 Bin/ISO14443-2A.o + 0x00002648 __vector_83 .text.ISO14443ACodecInit - 0x00002498 0x6e Bin/ISO14443-2A.o - 0x00002498 ISO14443ACodecInit + 0x0000282a 0x6e Bin/ISO14443-2A.o + 0x0000282a ISO14443ACodecInit .text.ISO14443ACodecTask - 0x00002506 0xfc Bin/ISO14443-2A.o - 0x00002506 ISO14443ACodecTask + 0x00002898 0xfc Bin/ISO14443-2A.o + 0x00002898 ISO14443ACodecTask .text.MifareClassicAppInit1K - 0x00002602 0x1a Bin/MifareClassic.o - 0x00002602 MifareClassicAppInit1K + 0x00002994 0x1a Bin/MifareClassic.o + 0x00002994 MifareClassicAppInit1K .text.MifareClassicAppInit4K - 0x0000261c 0x1a Bin/MifareClassic.o - 0x0000261c MifareClassicAppInit4K + 0x000029ae 0x1a Bin/MifareClassic.o + 0x000029ae MifareClassicAppInit4K .text.MifareClassicAppReset - 0x00002636 0x8 Bin/MifareClassic.o - 0x00002636 MifareClassicAppReset + 0x000029c8 0x8 Bin/MifareClassic.o + 0x000029c8 MifareClassicAppReset .text.MifareClassicAppTask - 0x0000263e 0x2 Bin/MifareClassic.o - 0x0000263e MifareClassicAppTask + 0x000029d0 0x2 Bin/MifareClassic.o + 0x000029d0 MifareClassicAppTask .text.MifareClassicAppProcess - 0x00002640 0x8fa Bin/MifareClassic.o - 0x00002640 MifareClassicAppProcess + 0x000029d2 0x8fa Bin/MifareClassic.o + 0x000029d2 MifareClassicAppProcess .text.MifareClassicGetUid - 0x00002f3a 0xc Bin/MifareClassic.o - 0x00002f3a MifareClassicGetUid + 0x000032cc 0xc Bin/MifareClassic.o + 0x000032cc MifareClassicGetUid .text.MifareClassicSetUid - 0x00002f46 0x40 Bin/MifareClassic.o - 0x00002f46 MifareClassicSetUid + 0x000032d8 0x40 Bin/MifareClassic.o + 0x000032d8 MifareClassicSetUid .text.ISO14443AAppendCRCA - 0x00002f86 0x5e Bin/ISO14443-3A.o - 0x00002f86 ISO14443AAppendCRCA + 0x00003318 0x5e Bin/ISO14443-3A.o + 0x00003318 ISO14443AAppendCRCA .text.ISO14443ACheckCRCA - 0x00002fe4 0x7e Bin/ISO14443-3A.o - 0x00002fe4 ISO14443ACheckCRCA + 0x00003376 0x7e Bin/ISO14443-3A.o + 0x00003376 ISO14443ACheckCRCA .text.Crypto1LFSR - 0x00003062 0x8c Bin/Crypto1.o + 0x000033f4 0x8c Bin/Crypto1.o .text.Crypto1FilterOutput - 0x000030ee 0x68 Bin/Crypto1.o - 0x000030ee Crypto1FilterOutput + 0x00003480 0x68 Bin/Crypto1.o + 0x00003480 Crypto1FilterOutput .text.Crypto1Setup - 0x00003156 0x340 Bin/Crypto1.o - 0x00003156 Crypto1Setup + 0x000034e8 0x340 Bin/Crypto1.o + 0x000034e8 Crypto1Setup .text.Crypto1Auth - 0x00003496 0x52 Bin/Crypto1.o - 0x00003496 Crypto1Auth + 0x00003828 0x52 Bin/Crypto1.o + 0x00003828 Crypto1Auth .text.Crypto1Byte - 0x000034e8 0x82 Bin/Crypto1.o - 0x000034e8 Crypto1Byte + 0x0000387a 0x82 Bin/Crypto1.o + 0x0000387a Crypto1Byte .text.Crypto1Nibble - 0x0000356a 0x48 Bin/Crypto1.o - 0x0000356a Crypto1Nibble + 0x000038fc 0x48 Bin/Crypto1.o + 0x000038fc Crypto1Nibble .text.Crypto1PRNG - 0x000035b2 0xb6 Bin/Crypto1.o - 0x000035b2 Crypto1PRNG + 0x00003944 0xb6 Bin/Crypto1.o + 0x00003944 Crypto1PRNG .text.USB_Device_ProcessControlRequest - 0x00003668 0x296 Bin/DeviceStandardReq.o - 0x00003668 USB_Device_ProcessControlRequest + 0x000039fa 0x296 Bin/DeviceStandardReq.o + 0x000039fa USB_Device_ProcessControlRequest .text.USB_Event_Stub - 0x000038fe 0x2 Bin/Events.o - 0x000038fe USB_Event_Stub - 0x000038fe EVENT_USB_Device_Suspend - 0x000038fe EVENT_USB_Device_StartOfFrame - 0x000038fe EVENT_USB_Device_Reset - 0x000038fe EVENT_USB_Device_WakeUp + 0x00003c90 0x2 Bin/Events.o + 0x00003c90 USB_Event_Stub + 0x00003c90 EVENT_USB_Device_Suspend + 0x00003c90 EVENT_USB_Device_StartOfFrame + 0x00003c90 EVENT_USB_Device_Reset + 0x00003c90 EVENT_USB_Device_WakeUp .text.USB_USBTask - 0x00003900 0x2a Bin/USBTask.o - 0x00003900 USB_USBTask + 0x00003c92 0x2a Bin/USBTask.o + 0x00003c92 USB_USBTask .text.Endpoint_Write_Stream_LE - 0x0000392a 0xd8 Bin/EndpointStream_XMEGA.o - 0x0000392a Endpoint_Write_Stream_LE + 0x00003cbc 0xd8 Bin/EndpointStream_XMEGA.o + 0x00003cbc Endpoint_Write_Stream_LE .text.Endpoint_Write_Control_Stream_LE - 0x00003a02 0x142 Bin/EndpointStream_XMEGA.o - 0x00003a02 Endpoint_Write_Control_Stream_LE + 0x00003d94 0x142 Bin/EndpointStream_XMEGA.o + 0x00003d94 Endpoint_Write_Control_Stream_LE .text.Endpoint_Write_Control_PStream_LE - 0x00003b44 0x13e Bin/EndpointStream_XMEGA.o - 0x00003b44 Endpoint_Write_Control_PStream_LE + 0x00003ed6 0x13e Bin/EndpointStream_XMEGA.o + 0x00003ed6 Endpoint_Write_Control_PStream_LE .text.Endpoint_ClearIN - 0x00003c82 0x32 Bin/Endpoint_XMEGA.o - 0x00003c82 Endpoint_ClearIN + 0x00004014 0x32 Bin/Endpoint_XMEGA.o + 0x00004014 Endpoint_ClearIN .text.Endpoint_ClearOUT - 0x00003cb4 0x1e Bin/Endpoint_XMEGA.o - 0x00003cb4 Endpoint_ClearOUT + 0x00004046 0x1e Bin/Endpoint_XMEGA.o + 0x00004046 Endpoint_ClearOUT .text.Endpoint_Read_8 - 0x00003cd2 0x1e Bin/Endpoint_XMEGA.o - 0x00003cd2 Endpoint_Read_8 + 0x00004064 0x1e Bin/Endpoint_XMEGA.o + 0x00004064 Endpoint_Read_8 .text.Endpoint_Write_8 - 0x00003cf0 0x1e Bin/Endpoint_XMEGA.o - 0x00003cf0 Endpoint_Write_8 + 0x00004082 0x1e Bin/Endpoint_XMEGA.o + 0x00004082 Endpoint_Write_8 .text.Endpoint_SelectEndpoint - 0x00003d0e 0x72 Bin/Endpoint_XMEGA.o - 0x00003d0e Endpoint_SelectEndpoint + 0x000040a0 0x72 Bin/Endpoint_XMEGA.o + 0x000040a0 Endpoint_SelectEndpoint .text.Endpoint_StallTransaction - 0x00003d80 0x38 Bin/Endpoint_XMEGA.o - 0x00003d80 Endpoint_StallTransaction + 0x00004112 0x38 Bin/Endpoint_XMEGA.o + 0x00004112 Endpoint_StallTransaction .text.Endpoint_ClearSETUP - 0x00003db8 0x58 Bin/Endpoint_XMEGA.o - 0x00003db8 Endpoint_ClearSETUP + 0x0000414a 0x58 Bin/Endpoint_XMEGA.o + 0x0000414a Endpoint_ClearSETUP .text.Endpoint_IsSETUPReceived - 0x00003e10 0x32 Bin/Endpoint_XMEGA.o - 0x00003e10 Endpoint_IsSETUPReceived + 0x000041a2 0x32 Bin/Endpoint_XMEGA.o + 0x000041a2 Endpoint_IsSETUPReceived .text.Endpoint_IsOUTReceived - 0x00003e42 0x32 Bin/Endpoint_XMEGA.o - 0x00003e42 Endpoint_IsOUTReceived + 0x000041d4 0x32 Bin/Endpoint_XMEGA.o + 0x000041d4 Endpoint_IsOUTReceived .text.Endpoint_IsINReady - 0x00003e74 0x18 Bin/Endpoint_XMEGA.o - 0x00003e74 Endpoint_IsINReady + 0x00004206 0x18 Bin/Endpoint_XMEGA.o + 0x00004206 Endpoint_IsINReady .text.Endpoint_ConfigureEndpoint_PRV - 0x00003e8c 0x9a Bin/Endpoint_XMEGA.o - 0x00003e8c Endpoint_ConfigureEndpoint_PRV + 0x0000421e 0x9a Bin/Endpoint_XMEGA.o + 0x0000421e Endpoint_ConfigureEndpoint_PRV .text.Endpoint_ConfigureEndpointTable - 0x00003f26 0xec Bin/Endpoint_XMEGA.o - 0x00003f26 Endpoint_ConfigureEndpointTable + 0x000042b8 0xec Bin/Endpoint_XMEGA.o + 0x000042b8 Endpoint_ConfigureEndpointTable .text.Endpoint_ClearEndpoints - 0x00004012 0x70 Bin/Endpoint_XMEGA.o - 0x00004012 Endpoint_ClearEndpoints + 0x000043a4 0x70 Bin/Endpoint_XMEGA.o + 0x000043a4 Endpoint_ClearEndpoints .text.Endpoint_ClearStatusStage - 0x00004082 0x2c Bin/Endpoint_XMEGA.o - 0x00004082 Endpoint_ClearStatusStage + 0x00004414 0x2c Bin/Endpoint_XMEGA.o + 0x00004414 Endpoint_ClearStatusStage .text.Endpoint_WaitUntilReady - 0x000040ae 0xa6 Bin/Endpoint_XMEGA.o - 0x000040ae Endpoint_WaitUntilReady + 0x00004440 0xa6 Bin/Endpoint_XMEGA.o + 0x00004440 Endpoint_WaitUntilReady .text.USB_Disable - 0x00004154 0x1a Bin/USBController_XMEGA.o - 0x00004154 USB_Disable + 0x000044e6 0x1a Bin/USBController_XMEGA.o + 0x000044e6 USB_Disable .text.USB_ResetInterface - 0x0000416e 0x5c Bin/USBController_XMEGA.o - 0x0000416e USB_ResetInterface + 0x00004500 0x5c Bin/USBController_XMEGA.o + 0x00004500 USB_ResetInterface .text.USB_Init - 0x000041ca 0x52 Bin/USBController_XMEGA.o - 0x000041ca USB_Init + 0x0000455c 0x52 Bin/USBController_XMEGA.o + 0x0000455c USB_Init .text.USB_INT_DisableAllInterrupts - 0x0000421c 0xe Bin/USBInterrupt_XMEGA.o - 0x0000421c USB_INT_DisableAllInterrupts + 0x000045ae 0xe Bin/USBInterrupt_XMEGA.o + 0x000045ae USB_INT_DisableAllInterrupts .text.USB_INT_ClearAllInterrupts - 0x0000422a 0xc Bin/USBInterrupt_XMEGA.o - 0x0000422a USB_INT_ClearAllInterrupts + 0x000045bc 0xc Bin/USBInterrupt_XMEGA.o + 0x000045bc USB_INT_ClearAllInterrupts .text.__vector_125 - 0x00004236 0xda Bin/USBInterrupt_XMEGA.o - 0x00004236 __vector_125 + 0x000045c8 0xda Bin/USBInterrupt_XMEGA.o + 0x000045c8 __vector_125 .text.CDC_Device_ConfigureEndpoints - 0x00004310 0x4a Bin/CDCClassDevice.o - 0x00004310 CDC_Device_ConfigureEndpoints + 0x000046a2 0x4a Bin/CDCClassDevice.o + 0x000046a2 CDC_Device_ConfigureEndpoints .text.CDC_Device_SendString - 0x0000435a 0x52 Bin/CDCClassDevice.o - 0x0000435a CDC_Device_SendString + 0x000046ec 0x52 Bin/CDCClassDevice.o + 0x000046ec CDC_Device_SendString .text.CDC_Device_SendData - 0x000043ac 0x54 Bin/CDCClassDevice.o - 0x000043ac CDC_Device_SendData + 0x0000473e 0x54 Bin/CDCClassDevice.o + 0x0000473e CDC_Device_SendData .text.CDC_Device_SendByte - 0x00004400 0x6e Bin/CDCClassDevice.o - 0x00004400 CDC_Device_SendByte + 0x00004792 0x6e Bin/CDCClassDevice.o + 0x00004792 CDC_Device_SendByte .text.CDC_Device_Flush - 0x0000446e 0x90 Bin/CDCClassDevice.o - 0x0000446e CDC_Device_Flush + 0x00004800 0x90 Bin/CDCClassDevice.o + 0x00004800 CDC_Device_Flush .text.CDC_Device_USBTask - 0x000044fe 0x36 Bin/CDCClassDevice.o - 0x000044fe CDC_Device_USBTask + 0x00004890 0x36 Bin/CDCClassDevice.o + 0x00004890 CDC_Device_USBTask .text.CDC_Device_ReceiveByte - 0x00004534 0xbe Bin/CDCClassDevice.o - 0x00004534 CDC_Device_ReceiveByte + 0x000048c6 0xbe Bin/CDCClassDevice.o + 0x000048c6 CDC_Device_ReceiveByte .text.CDC_Device_Event_Stub - 0x000045f2 0x2 Bin/CDCClassDevice.o - 0x000045f2 EVENT_CDC_Device_ControLineStateChanged - 0x000045f2 EVENT_CDC_Device_BreakSent - 0x000045f2 CDC_Device_Event_Stub - 0x000045f2 EVENT_CDC_Device_LineEncodingChanged + 0x00004984 0x2 Bin/CDCClassDevice.o + 0x00004984 EVENT_CDC_Device_ControLineStateChanged + 0x00004984 EVENT_CDC_Device_BreakSent + 0x00004984 CDC_Device_Event_Stub + 0x00004984 EVENT_CDC_Device_LineEncodingChanged .text.CDC_Device_ProcessControlRequest - 0x000045f4 0x13a Bin/CDCClassDevice.o - 0x000045f4 CDC_Device_ProcessControlRequest + 0x00004986 0x13a Bin/CDCClassDevice.o + 0x00004986 CDC_Device_ProcessControlRequest .text.libgcc.mul - 0x0000472e 0xc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) - 0x0000472e __mulshisi3 - 0x00004732 __mulohisi3 + 0x00004ac0 0xc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + 0x00004ac0 __mulshisi3 + 0x00004ac4 __mulohisi3 .text.libgcc.mul - 0x0000473a 0x14 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) - 0x0000473a __muluhisi3 + 0x00004acc 0x14 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + 0x00004acc __muluhisi3 .text.libgcc.mul - 0x0000474e 0x18 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) - 0x0000474e __umulhisi3 + 0x00004ae0 0x18 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + 0x00004ae0 __umulhisi3 .text.avr-libc - 0x00004766 0xb4 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - 0x000047fc rand_r - 0x000047fe rand - 0x00004804 srand + 0x00004af8 0xb4 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + 0x00004b8e rand_r + 0x00004b90 rand + 0x00004b96 srand .text.avr-libc - 0x0000481a 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) - 0x0000481a memcpy_P + 0x00004bac 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + 0x00004bac memcpy_P .text.avr-libc - 0x0000482c 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) - 0x0000482c strcmp_P + 0x00004bbe 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + 0x00004bbe strcmp_P .text.avr-libc - 0x0000483e 0x1e c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) - 0x0000483e strncpy_P + 0x00004bd0 0x1e c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + 0x00004bd0 strncpy_P .text.avr-libc - 0x0000485c 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) - 0x0000485c memcpy + 0x00004bee 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + 0x00004bee memcpy .text.avr-libc - 0x0000486e 0x5a c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - 0x0000486e snprintf_P + 0x00004c00 0x5a c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + 0x00004c00 snprintf_P .text.avr-libc - 0x000048c8 0x39a c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - 0x000048c8 vfprintf + 0x00004c5a 0x39a c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + 0x00004c5a vfprintf .text.avr-libc - 0x00004c62 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) - 0x00004c62 __eerd_block_x32a4u + 0x00004ff4 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + 0x00004ff4 __eerd_block_x32a4u .text.avr-libc - 0x00004c78 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) - 0x00004c78 __eewr_block_x32a4u + 0x0000500a 0x12 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + 0x0000500a __eewr_block_x32a4u .text.avr-libc - 0x00004c8a 0x46 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) - 0x00004c8a __eewr_byte_x32a4u - 0x00004c8c __eewr_r18_x32a4u + 0x0000501c 0x46 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + 0x0000501c __eewr_byte_x32a4u + 0x0000501e __eewr_r18_x32a4u .text.avr-libc - 0x00004cd0 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) - 0x00004cd0 strnlen_P + 0x00005062 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + 0x00005062 strnlen_P .text.avr-libc - 0x00004ce6 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) - 0x00004ce6 strnlen + 0x00005078 0x16 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + 0x00005078 strnlen .text.avr-libc - 0x00004cfc 0x58 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) - 0x00004cfc fputc + 0x0000508e 0x58 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + 0x0000508e fputc .text.avr-libc - 0x00004d54 0xbc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) - 0x00004d54 __ultoa_invert + 0x000050e6 0xbc c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + 0x000050e6 __ultoa_invert .text.libgcc.div - 0x00004e10 0x36 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) - 0x00004e10 __divmodsi4 + 0x000051a2 0x36 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + 0x000051a2 __divmodsi4 .text.libgcc.prologue - 0x00004e46 0x32 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) - 0x00004e46 __prologue_saves__ + 0x000051d8 0x32 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + 0x000051d8 __prologue_saves__ .text.libgcc.prologue - 0x00004e78 0x30 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) - 0x00004e78 __epilogue_restores__ + 0x0000520a 0x30 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + 0x0000520a __epilogue_restores__ .text.libgcc.div - 0x00004ea8 0x44 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) - 0x00004ea8 __udivmodsi4 - 0x00004eec . = ALIGN (0x2) + 0x0000523a 0x44 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + 0x0000523a __udivmodsi4 + 0x0000527e . = ALIGN (0x2) *(.fini9) - .fini9 0x00004eec 0x0 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) - 0x00004eec _exit - 0x00004eec exit + .fini9 0x0000527e 0x0 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + 0x0000527e _exit + 0x0000527e exit *(.fini9) *(.fini8) *(.fini8) @@ -1365,11 +1370,11 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg *(.fini1) *(.fini1) *(.fini0) - .fini0 0x00004eec 0x4 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .fini0 0x0000527e 0x4 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) *(.fini0) - 0x00004ef0 _etext = . + 0x00005282 _etext = . -.data 0x00802000 0x92 load address 0x00004ef0 +.data 0x00802000 0x92 load address 0x00005282 0x00802000 PROVIDE (__data_start, .) *(.data) .data 0x00802000 0x0 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o @@ -1464,54 +1469,55 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg 0x00802092 _edata = . 0x00802092 PROVIDE (__data_end, .) -.bss 0x00802092 0x60b +.bss 0x00802092 0xa0b 0x00802092 PROVIDE (__bss_start, .) *(.bss) - .bss 0x00802092 0x1 Bin/Button.o - .bss 0x00802093 0x1 Bin/LED.o - 0x00802093 LEDPulseMask - .bss 0x00802094 0x1 Bin/Terminal.o - 0x00802094 TerminalState - .bss 0x00802095 0xe Bin/XModem.o - .bss 0x008020a3 0x2 Bin/CommandLine.o - .bss 0x008020a5 0x10 Bin/ISO14443-2A.o - .bss 0x008020b5 0x1d Bin/MifareClassic.o - .bss 0x008020d2 0x6 Bin/Crypto1.o + .bss 0x00802092 0x400 Bin/Memory.o + .bss 0x00802492 0x1 Bin/Button.o + .bss 0x00802493 0x1 Bin/LED.o + 0x00802493 LEDPulseMask + .bss 0x00802494 0x1 Bin/Terminal.o + 0x00802494 TerminalState + .bss 0x00802495 0xe Bin/XModem.o + .bss 0x008024a3 0x2 Bin/CommandLine.o + .bss 0x008024a5 0x10 Bin/ISO14443-2A.o + .bss 0x008024b5 0x1d Bin/MifareClassic.o + .bss 0x008024d2 0x6 Bin/Crypto1.o *(.bss*) *(COMMON) - COMMON 0x008020d8 0x25 Bin/Configuration.o - 0x008020d8 ActiveConfiguration - COMMON 0x008020fd 0x13 Bin/Settings.o - 0x008020fd GlobalSettings - COMMON 0x00802110 0x100 Bin/Terminal.o - 0x00802110 TerminalBuffer - COMMON 0x00802210 0x100 Bin/Codec.o - 0x00802210 CodecBuffer - COMMON 0x00802310 0x3 Bin/DeviceStandardReq.o - 0x00802310 USB_Device_ConfigurationNumber - 0x00802311 USB_Device_CurrentlySelfPowered - 0x00802312 USB_Device_RemoteWakeupEnabled - COMMON 0x00802313 0xa Bin/USBTask.o - 0x00802313 USB_IsInitialized - 0x00802314 USB_DeviceState - 0x00802315 USB_ControlRequest - COMMON 0x0080231d 0x31d Bin/Endpoint_XMEGA.o - 0x0080231d USB_Endpoint_SelectedFIFO - 0x0080231f USB_Endpoint_SelectedHandle - 0x00802321 USB_Endpoint_SelectedEndpoint - 0x00802322 USB_Endpoint_FIFOs - COMMON 0x0080263a 0x63 Bin/USBController_XMEGA.o - 0x0080263a USB_EndpointTable - 0x0080269d PROVIDE (__bss_end, .) - 0x00004ef0 __data_load_start = LOADADDR (.data) - 0x00004f82 __data_load_end = (__data_load_start + SIZEOF (.data)) + COMMON 0x008024d8 0x25 Bin/Configuration.o + 0x008024d8 ActiveConfiguration + COMMON 0x008024fd 0x13 Bin/Settings.o + 0x008024fd GlobalSettings + COMMON 0x00802510 0x100 Bin/Terminal.o + 0x00802510 TerminalBuffer + COMMON 0x00802610 0x100 Bin/Codec.o + 0x00802610 CodecBuffer + COMMON 0x00802710 0x3 Bin/DeviceStandardReq.o + 0x00802710 USB_Device_ConfigurationNumber + 0x00802711 USB_Device_CurrentlySelfPowered + 0x00802712 USB_Device_RemoteWakeupEnabled + COMMON 0x00802713 0xa Bin/USBTask.o + 0x00802713 USB_IsInitialized + 0x00802714 USB_DeviceState + 0x00802715 USB_ControlRequest + COMMON 0x0080271d 0x31d Bin/Endpoint_XMEGA.o + 0x0080271d USB_Endpoint_SelectedFIFO + 0x0080271f USB_Endpoint_SelectedHandle + 0x00802721 USB_Endpoint_SelectedEndpoint + 0x00802722 USB_Endpoint_FIFOs + COMMON 0x00802a3a 0x63 Bin/USBController_XMEGA.o + 0x00802a3a USB_EndpointTable + 0x00802a9d PROVIDE (__bss_end, .) + 0x00005282 __data_load_start = LOADADDR (.data) + 0x00005314 __data_load_end = (__data_load_start + SIZEOF (.data)) -.noinit 0x0080269d 0x0 - 0x0080269d PROVIDE (__noinit_start, .) +.noinit 0x00802a9d 0x0 + 0x00802a9d PROVIDE (__noinit_start, .) *(.noinit*) - 0x0080269d PROVIDE (__noinit_end, .) - 0x0080269d _end = . - 0x0080269d PROVIDE (__heap_start, .) + 0x00802a9d PROVIDE (__noinit_end, .) + 0x00802a9d _end = . + 0x00802a9d PROVIDE (__heap_start, .) .eeprom 0x00810000 0x13 *(.eeprom*) @@ -1651,7 +1657,7 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_sfnames *(.debug_sfnames) -.debug_aranges 0x00000000 0xbe0 +.debug_aranges 0x00000000 0xbf0 *(.debug_aranges) .debug_aranges 0x00000000 0x20 Bin/Chameleon-Mini.o @@ -1666,161 +1672,161 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_aranges 0x00000140 0x28 Bin/Common.o .debug_aranges - 0x00000168 0x48 Bin/Memory.o + 0x00000168 0x58 Bin/Memory.o .debug_aranges - 0x000001b0 0x48 Bin/Button.o + 0x000001c0 0x48 Bin/Button.o .debug_aranges - 0x000001f8 0x50 Bin/Settings.o + 0x00000208 0x50 Bin/Settings.o .debug_aranges - 0x00000248 0x18 Bin/LED.o + 0x00000258 0x18 Bin/LED.o .debug_aranges - 0x00000260 0x68 Bin/Terminal.o + 0x00000270 0x68 Bin/Terminal.o .debug_aranges - 0x000002c8 0xc8 Bin/Commands.o + 0x000002d8 0xc8 Bin/Commands.o .debug_aranges - 0x00000390 0x40 Bin/XModem.o + 0x000003a0 0x40 Bin/XModem.o .debug_aranges - 0x000003d0 0x30 Bin/CommandLine.o + 0x000003e0 0x30 Bin/CommandLine.o .debug_aranges - 0x00000400 0x18 Bin/Codec.o + 0x00000410 0x18 Bin/Codec.o .debug_aranges - 0x00000418 0x48 Bin/ISO14443-2A.o + 0x00000428 0x48 Bin/ISO14443-2A.o .debug_aranges - 0x00000460 0x50 Bin/MifareClassic.o + 0x00000470 0x50 Bin/MifareClassic.o .debug_aranges - 0x000004b0 0x28 Bin/ISO14443-3A.o + 0x000004c0 0x28 Bin/ISO14443-3A.o .debug_aranges - 0x000004d8 0x50 Bin/Crypto1.o + 0x000004e8 0x50 Bin/Crypto1.o .debug_aranges - 0x00000528 0x38 Bin/HIDParser.o + 0x00000538 0x38 Bin/HIDParser.o .debug_aranges - 0x00000560 0x38 Bin/ConfigDescriptors.o + 0x00000570 0x38 Bin/ConfigDescriptors.o .debug_aranges - 0x00000598 0x20 Bin/DeviceStandardReq.o + 0x000005a8 0x20 Bin/DeviceStandardReq.o .debug_aranges - 0x000005b8 0x20 Bin/Events.o + 0x000005c8 0x20 Bin/Events.o .debug_aranges - 0x000005d8 0x18 Bin/HostStandardReq.o + 0x000005e8 0x18 Bin/HostStandardReq.o .debug_aranges - 0x000005f0 0x20 Bin/USBTask.o + 0x00000600 0x20 Bin/USBTask.o .debug_aranges - 0x00000610 0x20 Bin/Device_XMEGA.o + 0x00000620 0x20 Bin/Device_XMEGA.o .debug_aranges - 0x00000630 0xc8 Bin/EndpointStream_XMEGA.o + 0x00000640 0xc8 Bin/EndpointStream_XMEGA.o .debug_aranges - 0x000006f8 0x90 Bin/Endpoint_XMEGA.o + 0x00000708 0x90 Bin/Endpoint_XMEGA.o .debug_aranges - 0x00000788 0x18 Bin/Host_XMEGA.o + 0x00000798 0x18 Bin/Host_XMEGA.o .debug_aranges - 0x000007a0 0x18 Bin/PipeStream_XMEGA.o + 0x000007b0 0x18 Bin/PipeStream_XMEGA.o .debug_aranges - 0x000007b8 0x18 Bin/Pipe_XMEGA.o + 0x000007c8 0x18 Bin/Pipe_XMEGA.o .debug_aranges - 0x000007d0 0x30 Bin/USBController_XMEGA.o + 0x000007e0 0x30 Bin/USBController_XMEGA.o .debug_aranges - 0x00000800 0x30 Bin/USBInterrupt_XMEGA.o + 0x00000810 0x30 Bin/USBInterrupt_XMEGA.o .debug_aranges - 0x00000830 0x30 Bin/AudioClassDevice.o + 0x00000840 0x30 Bin/AudioClassDevice.o .debug_aranges - 0x00000860 0x98 Bin/CDCClassDevice.o + 0x00000870 0x98 Bin/CDCClassDevice.o .debug_aranges - 0x000008f8 0x30 Bin/HIDClassDevice.o + 0x00000908 0x30 Bin/HIDClassDevice.o .debug_aranges - 0x00000928 0x30 Bin/MassStorageClassDevice.o + 0x00000938 0x30 Bin/MassStorageClassDevice.o .debug_aranges - 0x00000958 0x40 Bin/MIDIClassDevice.o + 0x00000968 0x40 Bin/MIDIClassDevice.o .debug_aranges - 0x00000998 0x90 Bin/PrinterClassDevice.o + 0x000009a8 0x90 Bin/PrinterClassDevice.o .debug_aranges - 0x00000a28 0x48 Bin/RNDISClassDevice.o + 0x00000a38 0x48 Bin/RNDISClassDevice.o .debug_aranges - 0x00000a70 0x18 Bin/AndroidAccessoryClassHost.o + 0x00000a80 0x18 Bin/AndroidAccessoryClassHost.o .debug_aranges - 0x00000a88 0x18 Bin/AudioClassHost.o + 0x00000a98 0x18 Bin/AudioClassHost.o .debug_aranges - 0x00000aa0 0x18 Bin/CDCClassHost.o + 0x00000ab0 0x18 Bin/CDCClassHost.o .debug_aranges - 0x00000ab8 0x18 Bin/HIDClassHost.o + 0x00000ac8 0x18 Bin/HIDClassHost.o .debug_aranges - 0x00000ad0 0x18 Bin/MassStorageClassHost.o + 0x00000ae0 0x18 Bin/MassStorageClassHost.o .debug_aranges - 0x00000ae8 0x18 Bin/MIDIClassHost.o + 0x00000af8 0x18 Bin/MIDIClassHost.o .debug_aranges - 0x00000b00 0x18 Bin/PrinterClassHost.o + 0x00000b10 0x18 Bin/PrinterClassHost.o .debug_aranges - 0x00000b18 0x18 Bin/RNDISClassHost.o + 0x00000b28 0x18 Bin/RNDISClassHost.o .debug_aranges - 0x00000b30 0x18 Bin/StillImageClassHost.o + 0x00000b40 0x18 Bin/StillImageClassHost.o .debug_aranges - 0x00000b48 0x38 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + 0x00000b58 0x38 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) .debug_aranges - 0x00000b80 0x20 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + 0x00000b90 0x20 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) .debug_aranges - 0x00000ba0 0x20 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + 0x00000bb0 0x20 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) .debug_aranges - 0x00000bc0 0x20 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + 0x00000bd0 0x20 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) .debug_pubnames *(.debug_pubnames) -.debug_info 0x00000000 0x19186 +.debug_info 0x00000000 0x19536 *(.debug_info) .debug_info 0x00000000 0x1381 Bin/Chameleon-Mini.o .debug_info 0x00001381 0x962 Bin/LUFADescriptors.o .debug_info 0x00001ce3 0xde5 Bin/System.o - .debug_info 0x00002ac8 0x64a Bin/Configuration.o - .debug_info 0x00003112 0x161 Bin/Random.o - .debug_info 0x00003273 0x1b3 Bin/Common.o - .debug_info 0x00003426 0xfb2 Bin/Memory.o - .debug_info 0x000043d8 0xa19 Bin/Button.o - .debug_info 0x00004df1 0x4e3 Bin/Settings.o - .debug_info 0x000052d4 0x7a Bin/LED.o - .debug_info 0x0000534e 0xb73 Bin/Terminal.o - .debug_info 0x00005ec1 0x17f3 Bin/Commands.o - .debug_info 0x000076b4 0x9a3 Bin/XModem.o - .debug_info 0x00008057 0xb66 Bin/CommandLine.o - .debug_info 0x00008bbd 0x1f1 Bin/Codec.o - .debug_info 0x00008dae 0x187e Bin/ISO14443-2A.o - .debug_info 0x0000a62c 0x101c Bin/MifareClassic.o - .debug_info 0x0000b648 0x179 Bin/ISO14443-3A.o - .debug_info 0x0000b7c1 0x53a Bin/Crypto1.o - .debug_info 0x0000bcfb 0x72e Bin/HIDParser.o - .debug_info 0x0000c429 0x5ed Bin/ConfigDescriptors.o - .debug_info 0x0000ca16 0x11d6 Bin/DeviceStandardReq.o - .debug_info 0x0000dbec 0x7f Bin/Events.o - .debug_info 0x0000dc6b 0x5d Bin/HostStandardReq.o - .debug_info 0x0000dcc8 0x435 Bin/USBTask.o - .debug_info 0x0000e0fd 0x670 Bin/Device_XMEGA.o - .debug_info 0x0000e76d 0x19be Bin/EndpointStream_XMEGA.o - .debug_info 0x0001012b 0xcff Bin/Endpoint_XMEGA.o - .debug_info 0x00010e2a 0x5d Bin/Host_XMEGA.o - .debug_info 0x00010e87 0x5d Bin/PipeStream_XMEGA.o - .debug_info 0x00010ee4 0x5d Bin/Pipe_XMEGA.o - .debug_info 0x00010f41 0xd40 Bin/USBController_XMEGA.o - .debug_info 0x00011c81 0xa7b Bin/USBInterrupt_XMEGA.o - .debug_info 0x000126fc 0xa9d Bin/AudioClassDevice.o - .debug_info 0x00013199 0xf93 Bin/CDCClassDevice.o - .debug_info 0x0001412c 0xf91 Bin/HIDClassDevice.o - .debug_info 0x000150bd 0xaa0 Bin/MassStorageClassDevice.o - .debug_info 0x00015b5d 0x7c6 Bin/MIDIClassDevice.o - .debug_info 0x00016323 0xddd Bin/PrinterClassDevice.o - .debug_info 0x00017100 0x1311 Bin/RNDISClassDevice.o - .debug_info 0x00018411 0x5d Bin/AndroidAccessoryClassHost.o - .debug_info 0x0001846e 0x5d Bin/AudioClassHost.o - .debug_info 0x000184cb 0x5d Bin/CDCClassHost.o - .debug_info 0x00018528 0x5d Bin/HIDClassHost.o - .debug_info 0x00018585 0x5d Bin/MassStorageClassHost.o - .debug_info 0x000185e2 0x5d Bin/MIDIClassHost.o - .debug_info 0x0001863f 0x5d Bin/PrinterClassHost.o - .debug_info 0x0001869c 0x5d Bin/RNDISClassHost.o - .debug_info 0x000186f9 0x5d Bin/StillImageClassHost.o - .debug_info 0x00018756 0x157 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - .debug_info 0x000188ad 0x21c c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - .debug_info 0x00018ac9 0x549 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - .debug_info 0x00019012 0x174 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_info 0x00002ac8 0x656 Bin/Configuration.o + .debug_info 0x0000311e 0x161 Bin/Random.o + .debug_info 0x0000327f 0x1b3 Bin/Common.o + .debug_info 0x00003432 0x126a Bin/Memory.o + .debug_info 0x0000469c 0xa99 Bin/Button.o + .debug_info 0x00005135 0x54f Bin/Settings.o + .debug_info 0x00005684 0x7a Bin/LED.o + .debug_info 0x000056fe 0xb73 Bin/Terminal.o + .debug_info 0x00006271 0x17f3 Bin/Commands.o + .debug_info 0x00007a64 0x9a3 Bin/XModem.o + .debug_info 0x00008407 0xb66 Bin/CommandLine.o + .debug_info 0x00008f6d 0x1f1 Bin/Codec.o + .debug_info 0x0000915e 0x187e Bin/ISO14443-2A.o + .debug_info 0x0000a9dc 0x101c Bin/MifareClassic.o + .debug_info 0x0000b9f8 0x179 Bin/ISO14443-3A.o + .debug_info 0x0000bb71 0x53a Bin/Crypto1.o + .debug_info 0x0000c0ab 0x72e Bin/HIDParser.o + .debug_info 0x0000c7d9 0x5ed Bin/ConfigDescriptors.o + .debug_info 0x0000cdc6 0x11d6 Bin/DeviceStandardReq.o + .debug_info 0x0000df9c 0x7f Bin/Events.o + .debug_info 0x0000e01b 0x5d Bin/HostStandardReq.o + .debug_info 0x0000e078 0x435 Bin/USBTask.o + .debug_info 0x0000e4ad 0x670 Bin/Device_XMEGA.o + .debug_info 0x0000eb1d 0x19be Bin/EndpointStream_XMEGA.o + .debug_info 0x000104db 0xcff Bin/Endpoint_XMEGA.o + .debug_info 0x000111da 0x5d Bin/Host_XMEGA.o + .debug_info 0x00011237 0x5d Bin/PipeStream_XMEGA.o + .debug_info 0x00011294 0x5d Bin/Pipe_XMEGA.o + .debug_info 0x000112f1 0xd40 Bin/USBController_XMEGA.o + .debug_info 0x00012031 0xa7b Bin/USBInterrupt_XMEGA.o + .debug_info 0x00012aac 0xa9d Bin/AudioClassDevice.o + .debug_info 0x00013549 0xf93 Bin/CDCClassDevice.o + .debug_info 0x000144dc 0xf91 Bin/HIDClassDevice.o + .debug_info 0x0001546d 0xaa0 Bin/MassStorageClassDevice.o + .debug_info 0x00015f0d 0x7c6 Bin/MIDIClassDevice.o + .debug_info 0x000166d3 0xddd Bin/PrinterClassDevice.o + .debug_info 0x000174b0 0x1311 Bin/RNDISClassDevice.o + .debug_info 0x000187c1 0x5d Bin/AndroidAccessoryClassHost.o + .debug_info 0x0001881e 0x5d Bin/AudioClassHost.o + .debug_info 0x0001887b 0x5d Bin/CDCClassHost.o + .debug_info 0x000188d8 0x5d Bin/HIDClassHost.o + .debug_info 0x00018935 0x5d Bin/MassStorageClassHost.o + .debug_info 0x00018992 0x5d Bin/MIDIClassHost.o + .debug_info 0x000189ef 0x5d Bin/PrinterClassHost.o + .debug_info 0x00018a4c 0x5d Bin/RNDISClassHost.o + .debug_info 0x00018aa9 0x5d Bin/StillImageClassHost.o + .debug_info 0x00018b06 0x157 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_info 0x00018c5d 0x21c c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_info 0x00018e79 0x549 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_info 0x000193c2 0x174 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) *(.gnu.linkonce.wi.*) -.debug_abbrev 0x00000000 0x597c +.debug_abbrev 0x00000000 0x5a36 *(.debug_abbrev) .debug_abbrev 0x00000000 0x1d2 Bin/Chameleon-Mini.o .debug_abbrev 0x000001d2 0x1bb Bin/LUFADescriptors.o @@ -1828,55 +1834,55 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_abbrev 0x000004d1 0x25f Bin/Configuration.o .debug_abbrev 0x00000730 0xfb Bin/Random.o .debug_abbrev 0x0000082b 0xb2 Bin/Common.o - .debug_abbrev 0x000008dd 0x2bc Bin/Memory.o - .debug_abbrev 0x00000b99 0x2b7 Bin/Button.o - .debug_abbrev 0x00000e50 0x1cb Bin/Settings.o - .debug_abbrev 0x0000101b 0x44 Bin/LED.o - .debug_abbrev 0x0000105f 0x33a Bin/Terminal.o - .debug_abbrev 0x00001399 0x38e Bin/Commands.o - .debug_abbrev 0x00001727 0x2d7 Bin/XModem.o - .debug_abbrev 0x000019fe 0x2db Bin/CommandLine.o - .debug_abbrev 0x00001cd9 0xc4 Bin/Codec.o - .debug_abbrev 0x00001d9d 0x2db Bin/ISO14443-2A.o - .debug_abbrev 0x00002078 0x321 Bin/MifareClassic.o - .debug_abbrev 0x00002399 0xa6 Bin/ISO14443-3A.o - .debug_abbrev 0x0000243f 0x1bd Bin/Crypto1.o - .debug_abbrev 0x000025fc 0x20a Bin/HIDParser.o - .debug_abbrev 0x00002806 0x248 Bin/ConfigDescriptors.o - .debug_abbrev 0x00002a4e 0x37e Bin/DeviceStandardReq.o - .debug_abbrev 0x00002dcc 0x44 Bin/Events.o - .debug_abbrev 0x00002e10 0x26 Bin/HostStandardReq.o - .debug_abbrev 0x00002e36 0x21d Bin/USBTask.o - .debug_abbrev 0x00003053 0x11e Bin/Device_XMEGA.o - .debug_abbrev 0x00003171 0x252 Bin/EndpointStream_XMEGA.o - .debug_abbrev 0x000033c3 0x300 Bin/Endpoint_XMEGA.o - .debug_abbrev 0x000036c3 0x26 Bin/Host_XMEGA.o - .debug_abbrev 0x000036e9 0x26 Bin/PipeStream_XMEGA.o - .debug_abbrev 0x0000370f 0x26 Bin/Pipe_XMEGA.o - .debug_abbrev 0x00003735 0x306 Bin/USBController_XMEGA.o - .debug_abbrev 0x00003a3b 0x266 Bin/USBInterrupt_XMEGA.o - .debug_abbrev 0x00003ca1 0x28b Bin/AudioClassDevice.o - .debug_abbrev 0x00003f2c 0x439 Bin/CDCClassDevice.o - .debug_abbrev 0x00004365 0x2de Bin/HIDClassDevice.o - .debug_abbrev 0x00004643 0x338 Bin/MassStorageClassDevice.o - .debug_abbrev 0x0000497b 0x287 Bin/MIDIClassDevice.o - .debug_abbrev 0x00004c02 0x3e1 Bin/PrinterClassDevice.o - .debug_abbrev 0x00004fe3 0x36d Bin/RNDISClassDevice.o - .debug_abbrev 0x00005350 0x26 Bin/AndroidAccessoryClassHost.o - .debug_abbrev 0x00005376 0x26 Bin/AudioClassHost.o - .debug_abbrev 0x0000539c 0x26 Bin/CDCClassHost.o - .debug_abbrev 0x000053c2 0x26 Bin/HIDClassHost.o - .debug_abbrev 0x000053e8 0x26 Bin/MassStorageClassHost.o - .debug_abbrev 0x0000540e 0x26 Bin/MIDIClassHost.o - .debug_abbrev 0x00005434 0x26 Bin/PrinterClassHost.o - .debug_abbrev 0x0000545a 0x26 Bin/RNDISClassHost.o - .debug_abbrev 0x00005480 0x26 Bin/StillImageClassHost.o - .debug_abbrev 0x000054a6 0xd6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - .debug_abbrev 0x0000557c 0x139 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - .debug_abbrev 0x000056b5 0x1d6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - .debug_abbrev 0x0000588b 0xf1 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_abbrev 0x000008dd 0x346 Bin/Memory.o + .debug_abbrev 0x00000c23 0x2b7 Bin/Button.o + .debug_abbrev 0x00000eda 0x1fb Bin/Settings.o + .debug_abbrev 0x000010d5 0x44 Bin/LED.o + .debug_abbrev 0x00001119 0x33a Bin/Terminal.o + .debug_abbrev 0x00001453 0x38e Bin/Commands.o + .debug_abbrev 0x000017e1 0x2d7 Bin/XModem.o + .debug_abbrev 0x00001ab8 0x2db Bin/CommandLine.o + .debug_abbrev 0x00001d93 0xc4 Bin/Codec.o + .debug_abbrev 0x00001e57 0x2db Bin/ISO14443-2A.o + .debug_abbrev 0x00002132 0x321 Bin/MifareClassic.o + .debug_abbrev 0x00002453 0xa6 Bin/ISO14443-3A.o + .debug_abbrev 0x000024f9 0x1bd Bin/Crypto1.o + .debug_abbrev 0x000026b6 0x20a Bin/HIDParser.o + .debug_abbrev 0x000028c0 0x248 Bin/ConfigDescriptors.o + .debug_abbrev 0x00002b08 0x37e Bin/DeviceStandardReq.o + .debug_abbrev 0x00002e86 0x44 Bin/Events.o + .debug_abbrev 0x00002eca 0x26 Bin/HostStandardReq.o + .debug_abbrev 0x00002ef0 0x21d Bin/USBTask.o + .debug_abbrev 0x0000310d 0x11e Bin/Device_XMEGA.o + .debug_abbrev 0x0000322b 0x252 Bin/EndpointStream_XMEGA.o + .debug_abbrev 0x0000347d 0x300 Bin/Endpoint_XMEGA.o + .debug_abbrev 0x0000377d 0x26 Bin/Host_XMEGA.o + .debug_abbrev 0x000037a3 0x26 Bin/PipeStream_XMEGA.o + .debug_abbrev 0x000037c9 0x26 Bin/Pipe_XMEGA.o + .debug_abbrev 0x000037ef 0x306 Bin/USBController_XMEGA.o + .debug_abbrev 0x00003af5 0x266 Bin/USBInterrupt_XMEGA.o + .debug_abbrev 0x00003d5b 0x28b Bin/AudioClassDevice.o + .debug_abbrev 0x00003fe6 0x439 Bin/CDCClassDevice.o + .debug_abbrev 0x0000441f 0x2de Bin/HIDClassDevice.o + .debug_abbrev 0x000046fd 0x338 Bin/MassStorageClassDevice.o + .debug_abbrev 0x00004a35 0x287 Bin/MIDIClassDevice.o + .debug_abbrev 0x00004cbc 0x3e1 Bin/PrinterClassDevice.o + .debug_abbrev 0x0000509d 0x36d Bin/RNDISClassDevice.o + .debug_abbrev 0x0000540a 0x26 Bin/AndroidAccessoryClassHost.o + .debug_abbrev 0x00005430 0x26 Bin/AudioClassHost.o + .debug_abbrev 0x00005456 0x26 Bin/CDCClassHost.o + .debug_abbrev 0x0000547c 0x26 Bin/HIDClassHost.o + .debug_abbrev 0x000054a2 0x26 Bin/MassStorageClassHost.o + .debug_abbrev 0x000054c8 0x26 Bin/MIDIClassHost.o + .debug_abbrev 0x000054ee 0x26 Bin/PrinterClassHost.o + .debug_abbrev 0x00005514 0x26 Bin/RNDISClassHost.o + .debug_abbrev 0x0000553a 0x26 Bin/StillImageClassHost.o + .debug_abbrev 0x00005560 0xd6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_abbrev 0x00005636 0x139 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_abbrev 0x0000576f 0x1d6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_abbrev 0x00005945 0xf1 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) -.debug_line 0x00000000 0xb338 +.debug_line 0x00000000 0xb5c9 *(.debug_line) .debug_line 0x00000000 0x390 Bin/Chameleon-Mini.o .debug_line 0x00000390 0x30a Bin/LUFADescriptors.o @@ -1884,55 +1890,55 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_line 0x000008eb 0x39e Bin/Configuration.o .debug_line 0x00000c89 0x119 Bin/Random.o .debug_line 0x00000da2 0x219 Bin/Common.o - .debug_line 0x00000fbb 0x7a5 Bin/Memory.o - .debug_line 0x00001760 0x430 Bin/Button.o - .debug_line 0x00001b90 0x2e7 Bin/Settings.o - .debug_line 0x00001e77 0x8b Bin/LED.o - .debug_line 0x00001f02 0x457 Bin/Terminal.o - .debug_line 0x00002359 0x7ea Bin/Commands.o - .debug_line 0x00002b43 0x50b Bin/XModem.o - .debug_line 0x0000304e 0x3db Bin/CommandLine.o - .debug_line 0x00003429 0xaf Bin/Codec.o - .debug_line 0x000034d8 0x636 Bin/ISO14443-2A.o - .debug_line 0x00003b0e 0x734 Bin/MifareClassic.o - .debug_line 0x00004242 0x1a8 Bin/ISO14443-3A.o - .debug_line 0x000043ea 0x72c Bin/Crypto1.o - .debug_line 0x00004b16 0x638 Bin/HIDParser.o - .debug_line 0x0000514e 0x2c5 Bin/ConfigDescriptors.o - .debug_line 0x00005413 0x4d2 Bin/DeviceStandardReq.o - .debug_line 0x000058e5 0x4f Bin/Events.o - .debug_line 0x00005934 0x1a Bin/HostStandardReq.o - .debug_line 0x0000594e 0x209 Bin/USBTask.o - .debug_line 0x00005b57 0x185 Bin/Device_XMEGA.o - .debug_line 0x00005cdc 0x1655 Bin/EndpointStream_XMEGA.o - .debug_line 0x00007331 0x6fd Bin/Endpoint_XMEGA.o - .debug_line 0x00007a2e 0x1a Bin/Host_XMEGA.o - .debug_line 0x00007a48 0x1a Bin/PipeStream_XMEGA.o - .debug_line 0x00007a62 0x1a Bin/Pipe_XMEGA.o - .debug_line 0x00007a7c 0x3b1 Bin/USBController_XMEGA.o - .debug_line 0x00007e2d 0x3b0 Bin/USBInterrupt_XMEGA.o - .debug_line 0x000081dd 0x453 Bin/AudioClassDevice.o - .debug_line 0x00008630 0x832 Bin/CDCClassDevice.o - .debug_line 0x00008e62 0x598 Bin/HIDClassDevice.o - .debug_line 0x000093fa 0x50f Bin/MassStorageClassDevice.o - .debug_line 0x00009909 0x402 Bin/MIDIClassDevice.o - .debug_line 0x00009d0b 0x775 Bin/PrinterClassDevice.o - .debug_line 0x0000a480 0x72a Bin/RNDISClassDevice.o - .debug_line 0x0000abaa 0x1a Bin/AndroidAccessoryClassHost.o - .debug_line 0x0000abc4 0x1a Bin/AudioClassHost.o - .debug_line 0x0000abde 0x1a Bin/CDCClassHost.o - .debug_line 0x0000abf8 0x1a Bin/HIDClassHost.o - .debug_line 0x0000ac12 0x1a Bin/MassStorageClassHost.o - .debug_line 0x0000ac2c 0x1a Bin/MIDIClassHost.o - .debug_line 0x0000ac46 0x1a Bin/PrinterClassHost.o - .debug_line 0x0000ac60 0x1a Bin/RNDISClassHost.o - .debug_line 0x0000ac7a 0x1a Bin/StillImageClassHost.o - .debug_line 0x0000ac94 0xa1 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - .debug_line 0x0000ad35 0x1a6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - .debug_line 0x0000aedb 0x359 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - .debug_line 0x0000b234 0x104 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_line 0x00000fbb 0x9fa Bin/Memory.o + .debug_line 0x000019b5 0x454 Bin/Button.o + .debug_line 0x00001e09 0x2ff Bin/Settings.o + .debug_line 0x00002108 0x8b Bin/LED.o + .debug_line 0x00002193 0x457 Bin/Terminal.o + .debug_line 0x000025ea 0x7ea Bin/Commands.o + .debug_line 0x00002dd4 0x50b Bin/XModem.o + .debug_line 0x000032df 0x3db Bin/CommandLine.o + .debug_line 0x000036ba 0xaf Bin/Codec.o + .debug_line 0x00003769 0x636 Bin/ISO14443-2A.o + .debug_line 0x00003d9f 0x734 Bin/MifareClassic.o + .debug_line 0x000044d3 0x1a8 Bin/ISO14443-3A.o + .debug_line 0x0000467b 0x72c Bin/Crypto1.o + .debug_line 0x00004da7 0x638 Bin/HIDParser.o + .debug_line 0x000053df 0x2c5 Bin/ConfigDescriptors.o + .debug_line 0x000056a4 0x4d2 Bin/DeviceStandardReq.o + .debug_line 0x00005b76 0x4f Bin/Events.o + .debug_line 0x00005bc5 0x1a Bin/HostStandardReq.o + .debug_line 0x00005bdf 0x209 Bin/USBTask.o + .debug_line 0x00005de8 0x185 Bin/Device_XMEGA.o + .debug_line 0x00005f6d 0x1655 Bin/EndpointStream_XMEGA.o + .debug_line 0x000075c2 0x6fd Bin/Endpoint_XMEGA.o + .debug_line 0x00007cbf 0x1a Bin/Host_XMEGA.o + .debug_line 0x00007cd9 0x1a Bin/PipeStream_XMEGA.o + .debug_line 0x00007cf3 0x1a Bin/Pipe_XMEGA.o + .debug_line 0x00007d0d 0x3b1 Bin/USBController_XMEGA.o + .debug_line 0x000080be 0x3b0 Bin/USBInterrupt_XMEGA.o + .debug_line 0x0000846e 0x453 Bin/AudioClassDevice.o + .debug_line 0x000088c1 0x832 Bin/CDCClassDevice.o + .debug_line 0x000090f3 0x598 Bin/HIDClassDevice.o + .debug_line 0x0000968b 0x50f Bin/MassStorageClassDevice.o + .debug_line 0x00009b9a 0x402 Bin/MIDIClassDevice.o + .debug_line 0x00009f9c 0x775 Bin/PrinterClassDevice.o + .debug_line 0x0000a711 0x72a Bin/RNDISClassDevice.o + .debug_line 0x0000ae3b 0x1a Bin/AndroidAccessoryClassHost.o + .debug_line 0x0000ae55 0x1a Bin/AudioClassHost.o + .debug_line 0x0000ae6f 0x1a Bin/CDCClassHost.o + .debug_line 0x0000ae89 0x1a Bin/HIDClassHost.o + .debug_line 0x0000aea3 0x1a Bin/MassStorageClassHost.o + .debug_line 0x0000aebd 0x1a Bin/MIDIClassHost.o + .debug_line 0x0000aed7 0x1a Bin/PrinterClassHost.o + .debug_line 0x0000aef1 0x1a Bin/RNDISClassHost.o + .debug_line 0x0000af0b 0x1a Bin/StillImageClassHost.o + .debug_line 0x0000af25 0xa1 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_line 0x0000afc6 0x1a6 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_line 0x0000b16c 0x359 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_line 0x0000b4c5 0x104 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) -.debug_frame 0x00000000 0x1e88 +.debug_frame 0x00000000 0x1ed0 *(.debug_frame) .debug_frame 0x00000000 0x24 Bin/Chameleon-Mini.o .debug_frame 0x00000024 0x24 Bin/LUFADescriptors.o @@ -1940,40 +1946,40 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_frame 0x000000d8 0xf4 Bin/Configuration.o .debug_frame 0x000001cc 0x64 Bin/Random.o .debug_frame 0x00000230 0x40 Bin/Common.o - .debug_frame 0x00000270 0x134 Bin/Memory.o - .debug_frame 0x000003a4 0xac Bin/Button.o - .debug_frame 0x00000450 0x90 Bin/Settings.o - .debug_frame 0x000004e0 0xcc Bin/Terminal.o - .debug_frame 0x000005ac 0x28c Bin/Commands.o - .debug_frame 0x00000838 0x6c Bin/XModem.o - .debug_frame 0x000008a4 0x54 Bin/CommandLine.o - .debug_frame 0x000008f8 0xf8 Bin/ISO14443-2A.o - .debug_frame 0x000009f0 0xe0 Bin/MifareClassic.o - .debug_frame 0x00000ad0 0x34 Bin/ISO14443-3A.o - .debug_frame 0x00000b04 0x13c Bin/Crypto1.o - .debug_frame 0x00000c40 0x11c Bin/HIDParser.o - .debug_frame 0x00000d5c 0xd0 Bin/ConfigDescriptors.o - .debug_frame 0x00000e2c 0x40 Bin/DeviceStandardReq.o - .debug_frame 0x00000e6c 0x24 Bin/Events.o - .debug_frame 0x00000e90 0x2c Bin/USBTask.o - .debug_frame 0x00000ebc 0x24 Bin/Device_XMEGA.o - .debug_frame 0x00000ee0 0x4f8 Bin/EndpointStream_XMEGA.o - .debug_frame 0x000013d8 0x160 Bin/Endpoint_XMEGA.o - .debug_frame 0x00001538 0x5c Bin/USBController_XMEGA.o - .debug_frame 0x00001594 0x8c Bin/USBInterrupt_XMEGA.o - .debug_frame 0x00001620 0xa4 Bin/AudioClassDevice.o - .debug_frame 0x000016c4 0x1e0 Bin/CDCClassDevice.o - .debug_frame 0x000018a4 0xf0 Bin/HIDClassDevice.o - .debug_frame 0x00001994 0x80 Bin/MassStorageClassDevice.o - .debug_frame 0x00001a14 0xa4 Bin/MIDIClassDevice.o - .debug_frame 0x00001ab8 0x194 Bin/PrinterClassDevice.o - .debug_frame 0x00001c4c 0x100 Bin/RNDISClassDevice.o - .debug_frame 0x00001d4c 0x88 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - .debug_frame 0x00001dd4 0x30 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - .debug_frame 0x00001e04 0x4c c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - .debug_frame 0x00001e50 0x38 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_frame 0x00000270 0x174 Bin/Memory.o + .debug_frame 0x000003e4 0xac Bin/Button.o + .debug_frame 0x00000490 0x98 Bin/Settings.o + .debug_frame 0x00000528 0xcc Bin/Terminal.o + .debug_frame 0x000005f4 0x28c Bin/Commands.o + .debug_frame 0x00000880 0x6c Bin/XModem.o + .debug_frame 0x000008ec 0x54 Bin/CommandLine.o + .debug_frame 0x00000940 0xf8 Bin/ISO14443-2A.o + .debug_frame 0x00000a38 0xe0 Bin/MifareClassic.o + .debug_frame 0x00000b18 0x34 Bin/ISO14443-3A.o + .debug_frame 0x00000b4c 0x13c Bin/Crypto1.o + .debug_frame 0x00000c88 0x11c Bin/HIDParser.o + .debug_frame 0x00000da4 0xd0 Bin/ConfigDescriptors.o + .debug_frame 0x00000e74 0x40 Bin/DeviceStandardReq.o + .debug_frame 0x00000eb4 0x24 Bin/Events.o + .debug_frame 0x00000ed8 0x2c Bin/USBTask.o + .debug_frame 0x00000f04 0x24 Bin/Device_XMEGA.o + .debug_frame 0x00000f28 0x4f8 Bin/EndpointStream_XMEGA.o + .debug_frame 0x00001420 0x160 Bin/Endpoint_XMEGA.o + .debug_frame 0x00001580 0x5c Bin/USBController_XMEGA.o + .debug_frame 0x000015dc 0x8c Bin/USBInterrupt_XMEGA.o + .debug_frame 0x00001668 0xa4 Bin/AudioClassDevice.o + .debug_frame 0x0000170c 0x1e0 Bin/CDCClassDevice.o + .debug_frame 0x000018ec 0xf0 Bin/HIDClassDevice.o + .debug_frame 0x000019dc 0x80 Bin/MassStorageClassDevice.o + .debug_frame 0x00001a5c 0xa4 Bin/MIDIClassDevice.o + .debug_frame 0x00001b00 0x194 Bin/PrinterClassDevice.o + .debug_frame 0x00001c94 0x100 Bin/RNDISClassDevice.o + .debug_frame 0x00001d94 0x88 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_frame 0x00001e1c 0x30 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_frame 0x00001e4c 0x4c c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_frame 0x00001e98 0x38 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) -.debug_str 0x00000000 0x77fe +.debug_str 0x00000000 0x7842 *(.debug_str) .debug_str 0x00000000 0xccd Bin/Chameleon-Mini.o 0xd92 (size before relaxing) @@ -1981,144 +1987,144 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg 0xb1d (size before relaxing) .debug_str 0x00001599 0x748 Bin/System.o 0xb52 (size before relaxing) - .debug_str 0x00001ce1 0x2ce Bin/Configuration.o - 0x53c (size before relaxing) - .debug_str 0x00001faf 0x27 Bin/Random.o + .debug_str 0x00001ce1 0x2ff Bin/Configuration.o + 0x56d (size before relaxing) + .debug_str 0x00001fe0 0x27 Bin/Random.o 0x117 (size before relaxing) - .debug_str 0x00001fd6 0x56 Bin/Common.o + .debug_str 0x00002007 0x56 Bin/Common.o 0x13a (size before relaxing) - .debug_str 0x0000202c 0x21f Bin/Memory.o - 0x6dc (size before relaxing) - .debug_str 0x0000224b 0x1d2 Bin/Button.o - 0x682 (size before relaxing) - .debug_str 0x0000241d 0xc0 Bin/Settings.o - 0x48a (size before relaxing) - .debug_str 0x000024dd 0x6 Bin/LED.o + .debug_str 0x0000205d 0x22d Bin/Memory.o + 0x722 (size before relaxing) + .debug_str 0x0000228a 0x1d2 Bin/Button.o + 0x6cc (size before relaxing) + .debug_str 0x0000245c 0xc0 Bin/Settings.o + 0x4d4 (size before relaxing) + .debug_str 0x0000251c 0x6 Bin/LED.o 0xc8 (size before relaxing) - .debug_str 0x000024e3 0x295 Bin/Terminal.o + .debug_str 0x00002522 0x295 Bin/Terminal.o 0x72c (size before relaxing) - .debug_str 0x00002778 0x3f0 Bin/Commands.o + .debug_str 0x000027b7 0x3f0 Bin/Commands.o 0xcd2 (size before relaxing) - .debug_str 0x00002b68 0x149 Bin/XModem.o + .debug_str 0x00002ba7 0x149 Bin/XModem.o 0x533 (size before relaxing) - .debug_str 0x00002cb1 0xc1 Bin/CommandLine.o + .debug_str 0x00002cf0 0xc1 Bin/CommandLine.o 0x510 (size before relaxing) - .debug_str 0x00002d72 0x1a Bin/Codec.o + .debug_str 0x00002db1 0x1a Bin/Codec.o 0x238 (size before relaxing) - .debug_str 0x00002d8c 0x12b9 Bin/ISO14443-2A.o + .debug_str 0x00002dcb 0x12b9 Bin/ISO14443-2A.o 0x1a20 (size before relaxing) - .debug_str 0x00004045 0x2b0 Bin/MifareClassic.o + .debug_str 0x00004084 0x2b0 Bin/MifareClassic.o 0x545 (size before relaxing) - .debug_str 0x000042f5 0x1a Bin/ISO14443-3A.o + .debug_str 0x00004334 0x1a Bin/ISO14443-3A.o 0x131 (size before relaxing) - .debug_str 0x0000430f 0x95 Bin/Crypto1.o + .debug_str 0x0000434e 0x95 Bin/Crypto1.o 0x1bf (size before relaxing) - .debug_str 0x000043a4 0x48d Bin/HIDParser.o + .debug_str 0x000043e3 0x492 Bin/HIDParser.o 0x5f3 (size before relaxing) - .debug_str 0x00004831 0x22e Bin/ConfigDescriptors.o + .debug_str 0x00004875 0x22e Bin/ConfigDescriptors.o 0x431 (size before relaxing) - .debug_str 0x00004a5f 0xa04 Bin/DeviceStandardReq.o + .debug_str 0x00004aa3 0xa04 Bin/DeviceStandardReq.o 0x112f (size before relaxing) - .debug_str 0x00005463 0x31 Bin/Events.o + .debug_str 0x000054a7 0x31 Bin/Events.o 0xde (size before relaxing) - .debug_str 0x00005494 0x2b Bin/HostStandardReq.o + .debug_str 0x000054d8 0x2b Bin/HostStandardReq.o 0xd8 (size before relaxing) - .debug_str 0x000054bf 0x6d Bin/USBTask.o + .debug_str 0x00005503 0x6d Bin/USBTask.o 0x3aa (size before relaxing) - .debug_str 0x0000552c 0x4a Bin/Device_XMEGA.o + .debug_str 0x00005570 0x4a Bin/Device_XMEGA.o 0x51e (size before relaxing) - .debug_str 0x00005576 0x4d9 Bin/EndpointStream_XMEGA.o + .debug_str 0x000055ba 0x4d9 Bin/EndpointStream_XMEGA.o 0x8c2 (size before relaxing) - .debug_str 0x00005a4f 0x2aa Bin/Endpoint_XMEGA.o + .debug_str 0x00005a93 0x2aa Bin/Endpoint_XMEGA.o 0xa30 (size before relaxing) - .debug_str 0x00005cf9 0x2c Bin/Host_XMEGA.o + .debug_str 0x00005d3d 0x2c Bin/Host_XMEGA.o 0xd9 (size before relaxing) - .debug_str 0x00005d25 0x32 Bin/PipeStream_XMEGA.o + .debug_str 0x00005d69 0x32 Bin/PipeStream_XMEGA.o 0xdf (size before relaxing) - .debug_str 0x00005d57 0x2c Bin/Pipe_XMEGA.o + .debug_str 0x00005d9b 0x2c Bin/Pipe_XMEGA.o 0xd9 (size before relaxing) - .debug_str 0x00005d83 0x1bb Bin/USBController_XMEGA.o + .debug_str 0x00005dc7 0x1bb Bin/USBController_XMEGA.o 0xdc0 (size before relaxing) - .debug_str 0x00005f3e 0xaa Bin/USBInterrupt_XMEGA.o + .debug_str 0x00005f82 0xaa Bin/USBInterrupt_XMEGA.o 0x891 (size before relaxing) - .debug_str 0x00005fe8 0x280 Bin/AudioClassDevice.o + .debug_str 0x0000602c 0x280 Bin/AudioClassDevice.o 0x705 (size before relaxing) - .debug_str 0x00006268 0x286 Bin/CDCClassDevice.o + .debug_str 0x000062ac 0x286 Bin/CDCClassDevice.o 0xa5a (size before relaxing) - .debug_str 0x000064ee 0x248 Bin/HIDClassDevice.o + .debug_str 0x00006532 0x248 Bin/HIDClassDevice.o 0xa75 (size before relaxing) - .debug_str 0x00006736 0x261 Bin/MassStorageClassDevice.o + .debug_str 0x0000677a 0x261 Bin/MassStorageClassDevice.o 0x858 (size before relaxing) - .debug_str 0x00006997 0x115 Bin/MIDIClassDevice.o + .debug_str 0x000069db 0x115 Bin/MIDIClassDevice.o 0x6af (size before relaxing) - .debug_str 0x00006aac 0x269 Bin/PrinterClassDevice.o + .debug_str 0x00006af0 0x269 Bin/PrinterClassDevice.o 0x983 (size before relaxing) - .debug_str 0x00006d15 0x6e5 Bin/RNDISClassDevice.o + .debug_str 0x00006d59 0x6e5 Bin/RNDISClassDevice.o 0xdb8 (size before relaxing) - .debug_str 0x000073fa 0x3b Bin/AndroidAccessoryClassHost.o + .debug_str 0x0000743e 0x3b Bin/AndroidAccessoryClassHost.o 0xe8 (size before relaxing) - .debug_str 0x00007435 0x30 Bin/AudioClassHost.o + .debug_str 0x00007479 0x30 Bin/AudioClassHost.o 0xdd (size before relaxing) - .debug_str 0x00007465 0x2e Bin/CDCClassHost.o + .debug_str 0x000074a9 0x2e Bin/CDCClassHost.o 0xdb (size before relaxing) - .debug_str 0x00007493 0x2e Bin/HIDClassHost.o + .debug_str 0x000074d7 0x2e Bin/HIDClassHost.o 0xdb (size before relaxing) - .debug_str 0x000074c1 0x36 Bin/MassStorageClassHost.o + .debug_str 0x00007505 0x36 Bin/MassStorageClassHost.o 0xe3 (size before relaxing) - .debug_str 0x000074f7 0x2f Bin/MIDIClassHost.o + .debug_str 0x0000753b 0x2f Bin/MIDIClassHost.o 0xdc (size before relaxing) - .debug_str 0x00007526 0x32 Bin/PrinterClassHost.o + .debug_str 0x0000756a 0x32 Bin/PrinterClassHost.o 0xdf (size before relaxing) - .debug_str 0x00007558 0x30 Bin/RNDISClassHost.o + .debug_str 0x0000759c 0x30 Bin/RNDISClassHost.o 0xdd (size before relaxing) - .debug_str 0x00007588 0x35 Bin/StillImageClassHost.o + .debug_str 0x000075cc 0x35 Bin/StillImageClassHost.o 0xe2 (size before relaxing) - .debug_str 0x000075bd 0x81 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_str 0x00007601 0x81 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) 0xba (size before relaxing) - .debug_str 0x0000763e 0x91 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_str 0x00007682 0x91 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) 0x149 (size before relaxing) - .debug_str 0x000076cf 0xcd c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_str 0x00007713 0xcd c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) 0x1ad (size before relaxing) - .debug_str 0x0000779c 0x62 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_str 0x000077e0 0x62 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) 0x10d (size before relaxing) -.debug_loc 0x00000000 0xce27 +.debug_loc 0x00000000 0xd068 *(.debug_loc) .debug_loc 0x00000000 0x277 Bin/LUFADescriptors.o .debug_loc 0x00000277 0x2f Bin/System.o .debug_loc 0x000002a6 0x3cf Bin/Configuration.o .debug_loc 0x00000675 0xaa Bin/Random.o .debug_loc 0x0000071f 0x319 Bin/Common.o - .debug_loc 0x00000a38 0xa25 Bin/Memory.o - .debug_loc 0x0000145d 0x69c Bin/Button.o - .debug_loc 0x00001af9 0x1b1 Bin/Settings.o - .debug_loc 0x00001caa 0x1f9 Bin/Terminal.o - .debug_loc 0x00001ea3 0x9b7 Bin/Commands.o - .debug_loc 0x0000285a 0x313 Bin/XModem.o - .debug_loc 0x00002b6d 0x6be Bin/CommandLine.o - .debug_loc 0x0000322b 0x4a5 Bin/ISO14443-2A.o - .debug_loc 0x000036d0 0xb6a Bin/MifareClassic.o - .debug_loc 0x0000423a 0x231 Bin/ISO14443-3A.o - .debug_loc 0x0000446b 0xa3a Bin/Crypto1.o - .debug_loc 0x00004ea5 0xc34 Bin/HIDParser.o - .debug_loc 0x00005ad9 0x536 Bin/ConfigDescriptors.o - .debug_loc 0x0000600f 0x2d9 Bin/DeviceStandardReq.o - .debug_loc 0x000062e8 0x22 Bin/USBTask.o - .debug_loc 0x0000630a 0x2bf0 Bin/EndpointStream_XMEGA.o - .debug_loc 0x00008efa 0x581 Bin/Endpoint_XMEGA.o - .debug_loc 0x0000947b 0xa3 Bin/USBController_XMEGA.o - .debug_loc 0x0000951e 0x200 Bin/USBInterrupt_XMEGA.o - .debug_loc 0x0000971e 0x3ad Bin/AudioClassDevice.o - .debug_loc 0x00009acb 0x9f6 Bin/CDCClassDevice.o - .debug_loc 0x0000a4c1 0x473 Bin/HIDClassDevice.o - .debug_loc 0x0000a934 0x303 Bin/MassStorageClassDevice.o - .debug_loc 0x0000ac37 0x35f Bin/MIDIClassDevice.o - .debug_loc 0x0000af96 0x8b8 Bin/PrinterClassDevice.o - .debug_loc 0x0000b84e 0xd6d Bin/RNDISClassDevice.o - .debug_loc 0x0000c5bb 0x1e8 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - .debug_loc 0x0000c7a3 0x74 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - .debug_loc 0x0000c817 0x51d c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - .debug_loc 0x0000cd34 0xf3 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_loc 0x00000a38 0xba4 Bin/Memory.o + .debug_loc 0x000015dc 0x740 Bin/Button.o + .debug_loc 0x00001d1c 0x1cf Bin/Settings.o + .debug_loc 0x00001eeb 0x1f9 Bin/Terminal.o + .debug_loc 0x000020e4 0x9b7 Bin/Commands.o + .debug_loc 0x00002a9b 0x313 Bin/XModem.o + .debug_loc 0x00002dae 0x6be Bin/CommandLine.o + .debug_loc 0x0000346c 0x4a5 Bin/ISO14443-2A.o + .debug_loc 0x00003911 0xb6a Bin/MifareClassic.o + .debug_loc 0x0000447b 0x231 Bin/ISO14443-3A.o + .debug_loc 0x000046ac 0xa3a Bin/Crypto1.o + .debug_loc 0x000050e6 0xc34 Bin/HIDParser.o + .debug_loc 0x00005d1a 0x536 Bin/ConfigDescriptors.o + .debug_loc 0x00006250 0x2d9 Bin/DeviceStandardReq.o + .debug_loc 0x00006529 0x22 Bin/USBTask.o + .debug_loc 0x0000654b 0x2bf0 Bin/EndpointStream_XMEGA.o + .debug_loc 0x0000913b 0x581 Bin/Endpoint_XMEGA.o + .debug_loc 0x000096bc 0xa3 Bin/USBController_XMEGA.o + .debug_loc 0x0000975f 0x200 Bin/USBInterrupt_XMEGA.o + .debug_loc 0x0000995f 0x3ad Bin/AudioClassDevice.o + .debug_loc 0x00009d0c 0x9f6 Bin/CDCClassDevice.o + .debug_loc 0x0000a702 0x473 Bin/HIDClassDevice.o + .debug_loc 0x0000ab75 0x303 Bin/MassStorageClassDevice.o + .debug_loc 0x0000ae78 0x35f Bin/MIDIClassDevice.o + .debug_loc 0x0000b1d7 0x8b8 Bin/PrinterClassDevice.o + .debug_loc 0x0000ba8f 0xd6d Bin/RNDISClassDevice.o + .debug_loc 0x0000c7fc 0x1e8 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_loc 0x0000c9e4 0x74 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_loc 0x0000ca58 0x51d c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_loc 0x0000cf75 0xf3 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) .debug_macinfo *(.debug_macinfo) @@ -2126,7 +2132,7 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_pubtypes *(.debug_pubtypes) -.debug_ranges 0x00000000 0x1a08 +.debug_ranges 0x00000000 0x1ae0 *(.debug_ranges) .debug_ranges 0x00000000 0x28 Bin/Chameleon-Mini.o .debug_ranges 0x00000028 0x10 Bin/LUFADescriptors.o @@ -2134,38 +2140,38 @@ LOAD c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmeg .debug_ranges 0x00000078 0xb0 Bin/Configuration.o .debug_ranges 0x00000128 0x28 Bin/Random.o .debug_ranges 0x00000150 0x48 Bin/Common.o - .debug_ranges 0x00000198 0x2b8 Bin/Memory.o - .debug_ranges 0x00000450 0xf8 Bin/Button.o - .debug_ranges 0x00000548 0x40 Bin/Settings.o - .debug_ranges 0x00000588 0xd0 Bin/Terminal.o - .debug_ranges 0x00000658 0x118 Bin/Commands.o - .debug_ranges 0x00000770 0x48 Bin/XModem.o - .debug_ranges 0x000007b8 0x100 Bin/CommandLine.o - .debug_ranges 0x000008b8 0xc0 Bin/ISO14443-2A.o - .debug_ranges 0x00000978 0x1c8 Bin/MifareClassic.o - .debug_ranges 0x00000b40 0x18 Bin/ISO14443-3A.o - .debug_ranges 0x00000b58 0x70 Bin/Crypto1.o - .debug_ranges 0x00000bc8 0x150 Bin/HIDParser.o - .debug_ranges 0x00000d18 0x40 Bin/ConfigDescriptors.o - .debug_ranges 0x00000d58 0x138 Bin/DeviceStandardReq.o - .debug_ranges 0x00000e90 0x10 Bin/Events.o - .debug_ranges 0x00000ea0 0x60 Bin/USBTask.o - .debug_ranges 0x00000f00 0x10 Bin/Device_XMEGA.o - .debug_ranges 0x00000f10 0x4a8 Bin/EndpointStream_XMEGA.o - .debug_ranges 0x000013b8 0x188 Bin/Endpoint_XMEGA.o - .debug_ranges 0x00001540 0x20 Bin/USBController_XMEGA.o - .debug_ranges 0x00001560 0x20 Bin/USBInterrupt_XMEGA.o - .debug_ranges 0x00001580 0x38 Bin/AudioClassDevice.o - .debug_ranges 0x000015b8 0x100 Bin/CDCClassDevice.o - .debug_ranges 0x000016b8 0x20 Bin/HIDClassDevice.o - .debug_ranges 0x000016d8 0xa0 Bin/MassStorageClassDevice.o - .debug_ranges 0x00001778 0x48 Bin/MIDIClassDevice.o - .debug_ranges 0x000017c0 0x128 Bin/PrinterClassDevice.o - .debug_ranges 0x000018e8 0xc8 Bin/RNDISClassDevice.o - .debug_ranges 0x000019b0 0x28 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) - .debug_ranges 0x000019d8 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) - .debug_ranges 0x000019e8 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) - .debug_ranges 0x000019f8 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .debug_ranges 0x00000198 0x378 Bin/Memory.o + .debug_ranges 0x00000510 0xf8 Bin/Button.o + .debug_ranges 0x00000608 0x58 Bin/Settings.o + .debug_ranges 0x00000660 0xd0 Bin/Terminal.o + .debug_ranges 0x00000730 0x118 Bin/Commands.o + .debug_ranges 0x00000848 0x48 Bin/XModem.o + .debug_ranges 0x00000890 0x100 Bin/CommandLine.o + .debug_ranges 0x00000990 0xc0 Bin/ISO14443-2A.o + .debug_ranges 0x00000a50 0x1c8 Bin/MifareClassic.o + .debug_ranges 0x00000c18 0x18 Bin/ISO14443-3A.o + .debug_ranges 0x00000c30 0x70 Bin/Crypto1.o + .debug_ranges 0x00000ca0 0x150 Bin/HIDParser.o + .debug_ranges 0x00000df0 0x40 Bin/ConfigDescriptors.o + .debug_ranges 0x00000e30 0x138 Bin/DeviceStandardReq.o + .debug_ranges 0x00000f68 0x10 Bin/Events.o + .debug_ranges 0x00000f78 0x60 Bin/USBTask.o + .debug_ranges 0x00000fd8 0x10 Bin/Device_XMEGA.o + .debug_ranges 0x00000fe8 0x4a8 Bin/EndpointStream_XMEGA.o + .debug_ranges 0x00001490 0x188 Bin/Endpoint_XMEGA.o + .debug_ranges 0x00001618 0x20 Bin/USBController_XMEGA.o + .debug_ranges 0x00001638 0x20 Bin/USBInterrupt_XMEGA.o + .debug_ranges 0x00001658 0x38 Bin/AudioClassDevice.o + .debug_ranges 0x00001690 0x100 Bin/CDCClassDevice.o + .debug_ranges 0x00001790 0x20 Bin/HIDClassDevice.o + .debug_ranges 0x000017b0 0xa0 Bin/MassStorageClassDevice.o + .debug_ranges 0x00001850 0x48 Bin/MIDIClassDevice.o + .debug_ranges 0x00001898 0x128 Bin/PrinterClassDevice.o + .debug_ranges 0x000019c0 0xc8 Bin/RNDISClassDevice.o + .debug_ranges 0x00001a88 0x28 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_ranges 0x00001ab0 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_ranges 0x00001ac0 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_ranges 0x00001ad0 0x10 c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) .debug_macro *(.debug_macro) @@ -2503,6 +2509,12 @@ MemoryInit Bin/Memory.o Bin/Chameleon-Mini.o MemoryReadBlock Bin/Memory.o Bin/MifareClassic.o +MemoryRecall Bin/Memory.o + Bin/Settings.o + Bin/Button.o +MemoryStore Bin/Memory.o + Bin/Settings.o + Bin/Button.o MemoryUploadBlock Bin/Memory.o Bin/Commands.o MemoryWriteBlock Bin/Memory.o @@ -2703,6 +2715,7 @@ __do_clear_bss c:/programme/atmel/avr tools/a Bin/LED.o Bin/Settings.o Bin/Button.o + Bin/Memory.o Bin/Configuration.o __do_copy_data c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) c:/programme/atmel/avr tools/avr toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) diff --git a/Firmware/Chameleon-Mini/Chameleon-Mini.sym b/Firmware/Chameleon-Mini/Chameleon-Mini.sym index ba804d1..1816f9e 100644 --- a/Firmware/Chameleon-Mini/Chameleon-Mini.sym +++ b/Firmware/Chameleon-Mini/Chameleon-Mini.sym @@ -331,341 +331,343 @@ 00000276 T DeviceDescriptor 00000288 t ConfigurationTable 000002f7 t ButtonActionTable -000003d7 t __c.6287 -00000410 t __c.6289 -00000417 t __c.6291 -0000041e t __c.6293 -00000424 t __c.6298 -00000427 t __c.6316 -0000042e t __c.6343 -00000431 t __c.6348 -00000434 t __c.6387 -0000043b T CommandTable -0000059b t __c.6083 -0000059e t __c.6085 -000005a1 t StatusTable -00000668 T __ctors_end -00000668 T __ctors_start -00000668 T __dtors_end -00000668 T __dtors_start -00000668 W __init -00000668 T __trampolines_end -00000668 T __trampolines_start -00000674 T __do_copy_data -0000068a T __do_clear_bss -00000692 t .do_clear_bss_loop -00000694 t .do_clear_bss_start -000006a0 T __bad_interrupt -000006a0 W __vector_1 -000006a0 W __vector_10 -000006a0 W __vector_100 -000006a0 W __vector_101 -000006a0 W __vector_102 -000006a0 W __vector_103 -000006a0 W __vector_104 -000006a0 W __vector_105 -000006a0 W __vector_106 -000006a0 W __vector_107 -000006a0 W __vector_108 -000006a0 W __vector_109 -000006a0 W __vector_11 -000006a0 W __vector_110 -000006a0 W __vector_111 -000006a0 W __vector_112 -000006a0 W __vector_113 -000006a0 W __vector_114 -000006a0 W __vector_115 -000006a0 W __vector_116 -000006a0 W __vector_117 -000006a0 W __vector_118 -000006a0 W __vector_119 -000006a0 W __vector_12 -000006a0 W __vector_120 -000006a0 W __vector_121 -000006a0 W __vector_122 -000006a0 W __vector_123 -000006a0 W __vector_124 -000006a0 W __vector_126 -000006a0 W __vector_13 -000006a0 W __vector_14 -000006a0 W __vector_15 -000006a0 W __vector_16 -000006a0 W __vector_17 -000006a0 W __vector_18 -000006a0 W __vector_19 -000006a0 W __vector_2 -000006a0 W __vector_20 -000006a0 W __vector_21 -000006a0 W __vector_23 -000006a0 W __vector_24 -000006a0 W __vector_25 -000006a0 W __vector_26 -000006a0 W __vector_27 -000006a0 W __vector_28 -000006a0 W __vector_29 -000006a0 W __vector_3 -000006a0 W __vector_30 -000006a0 W __vector_31 -000006a0 W __vector_32 -000006a0 W __vector_33 -000006a0 W __vector_35 -000006a0 W __vector_36 -000006a0 W __vector_37 -000006a0 W __vector_38 -000006a0 W __vector_39 -000006a0 W __vector_4 -000006a0 W __vector_40 -000006a0 W __vector_41 -000006a0 W __vector_42 -000006a0 W __vector_43 -000006a0 W __vector_44 -000006a0 W __vector_45 -000006a0 W __vector_46 -000006a0 W __vector_47 -000006a0 W __vector_48 -000006a0 W __vector_49 -000006a0 W __vector_5 -000006a0 W __vector_50 -000006a0 W __vector_51 -000006a0 W __vector_52 -000006a0 W __vector_53 -000006a0 W __vector_54 -000006a0 W __vector_55 -000006a0 W __vector_56 -000006a0 W __vector_57 -000006a0 W __vector_58 -000006a0 W __vector_59 -000006a0 W __vector_6 -000006a0 W __vector_60 -000006a0 W __vector_61 -000006a0 W __vector_62 -000006a0 W __vector_63 -000006a0 W __vector_64 -000006a0 W __vector_65 -000006a0 W __vector_66 -000006a0 W __vector_67 -000006a0 W __vector_68 -000006a0 W __vector_69 -000006a0 W __vector_7 -000006a0 W __vector_70 -000006a0 W __vector_71 -000006a0 W __vector_72 -000006a0 W __vector_73 -000006a0 W __vector_74 -000006a0 W __vector_75 -000006a0 W __vector_76 -000006a0 W __vector_77 -000006a0 W __vector_78 -000006a0 W __vector_79 -000006a0 W __vector_8 -000006a0 W __vector_80 -000006a0 W __vector_81 -000006a0 W __vector_82 -000006a0 W __vector_84 -000006a0 W __vector_85 -000006a0 W __vector_86 -000006a0 W __vector_87 -000006a0 W __vector_88 -000006a0 W __vector_89 -000006a0 W __vector_9 -000006a0 W __vector_90 -000006a0 W __vector_91 -000006a0 W __vector_92 -000006a0 W __vector_93 -000006a0 W __vector_94 -000006a0 W __vector_95 -000006a0 W __vector_96 -000006a0 W __vector_97 -000006a0 W __vector_98 -000006a0 W __vector_99 -000006a2 T main -00000710 T CALLBACK_USB_GetDescriptor -00000792 T __vector_default -0000079e T SystemInit -0000080c T SystemReset -0000081a T SystemEnterBootloader -00000826 T SystemStartUSBClock -00000858 T SystemStopUSBClock -00000874 T SystemInterruptInit -00000880 t CodecInitDummy -00000882 t CodecTaskDummy -00000884 t ApplicationInitDummy -00000886 t ApplicationResetDummy -00000888 t ApplicationTaskDummy -0000088a t ApplicationProcessDummy -00000890 t ApplicationGetUidDummy -00000892 t ApplicationSetUidDummy -00000894 T ConfigurationSetById -000008ca T ConfigurationInit -000008d6 T ConfigurationSetByName -00000958 T ConfigurationGetList -000009b6 T RandomInit -000009b8 T RandomGetByte -000009be T RandomGetBuffer -000009dc T RandomTick -000009ec T BufferToHexString -00000a70 T HexStringToBuffer -00000afc T MemoryInit -00000bf8 T MemoryReadBlock -00000d02 T MemoryWriteBlock -00000f88 T MemoryClear -0000103e T MemoryUploadBlock -000010ae T MemoryDownloadBlock -00001120 T ButtonInit -0000112e T ButtonTick -000012e4 T ButtonGetActionList -00001348 T ButtonSetActionById -00001354 T ButtonGetActionByName -00001370 T ButtonSetActionByName -00001402 T SettingsLoad -00001412 T SettingsSave -00001422 T SettingsSetActiveById -00001440 T SettingsCycle -0000151a T SettingsGetActiveById -00001520 T SettingsGetActiveByName -00001534 T SettingsSetActiveByName -0000154e T TerminalSendString -00001558 T TerminalSendStringP -00001580 T TerminalSendBlock -0000158c T TerminalInit -00001596 T TerminalTask -000015d4 T TerminalTick -00001650 T EVENT_USB_Device_Connect -0000165a T EVENT_USB_Device_Disconnect -00001664 T EVENT_USB_Device_ConfigurationChanged -0000166c T EVENT_USB_Device_ControlRequest -00001674 T CommandGetVersion -000016b0 T CommandGetConfig -000016dc T CommandSetConfig -000016ec T CommandExecConfig -000016f6 T CommandGetUid -00001742 T CommandSetUid -000017f0 T CommandGetReadOnly -00001814 T CommandSetReadOnly -0000183c T CommandExecUpload -00001846 T CommandExecDownload -00001850 T CommandExecReset -00001866 T CommandExecUpgrade -0000187c T CommandGetMemSize -000018ac T CommandGetUidSize -000018d8 T CommandExecButton -000018e2 T CommandGetButton -000018ec T CommandSetButton -000018fc T CommandGetSetting -00001906 T CommandSetSetting -00001916 T CommandExecClear -0000191c T CommandExecHelp -000019b4 T CommandGetRssi -00001a1c t CalcChecksum.constprop.0 -00001a30 T XModemReceive -00001a60 T XModemSend -00001a86 T XModemProcessByte -00001d0a T XModemTick -00001d66 T CommandLineProcessByte -000020a8 T CommandLineTick -000020aa t StartDemod -000020e6 T __vector_34 -0000216e T __vector_22 -000022b6 T __vector_83 -00002498 T ISO14443ACodecInit -00002506 T ISO14443ACodecTask -00002602 T MifareClassicAppInit1K -0000261c T MifareClassicAppInit4K -00002636 T MifareClassicAppReset -0000263e T MifareClassicAppTask -00002640 T MifareClassicAppProcess -00002f3a T MifareClassicGetUid -00002f46 T MifareClassicSetUid -00002f86 T ISO14443AAppendCRCA -00002fe4 T ISO14443ACheckCRCA +00000417 t __c.6293 +00000450 t __c.6295 +00000457 t __c.6297 +0000045e t __c.6299 +00000464 t __c.6304 +00000467 t __c.6322 +0000046e t __c.6349 +00000471 t __c.6354 +00000474 t __c.6393 +0000047b T CommandTable +000005db t __c.6083 +000005de t __c.6085 +000005e1 t StatusTable +000006a8 T __ctors_end +000006a8 T __ctors_start +000006a8 T __dtors_end +000006a8 T __dtors_start +000006a8 W __init +000006a8 T __trampolines_end +000006a8 T __trampolines_start +000006b4 T __do_copy_data +000006ca T __do_clear_bss +000006d2 t .do_clear_bss_loop +000006d4 t .do_clear_bss_start +000006e0 T __bad_interrupt +000006e0 W __vector_1 +000006e0 W __vector_10 +000006e0 W __vector_100 +000006e0 W __vector_101 +000006e0 W __vector_102 +000006e0 W __vector_103 +000006e0 W __vector_104 +000006e0 W __vector_105 +000006e0 W __vector_106 +000006e0 W __vector_107 +000006e0 W __vector_108 +000006e0 W __vector_109 +000006e0 W __vector_11 +000006e0 W __vector_110 +000006e0 W __vector_111 +000006e0 W __vector_112 +000006e0 W __vector_113 +000006e0 W __vector_114 +000006e0 W __vector_115 +000006e0 W __vector_116 +000006e0 W __vector_117 +000006e0 W __vector_118 +000006e0 W __vector_119 +000006e0 W __vector_12 +000006e0 W __vector_120 +000006e0 W __vector_121 +000006e0 W __vector_122 +000006e0 W __vector_123 +000006e0 W __vector_124 +000006e0 W __vector_126 +000006e0 W __vector_13 +000006e0 W __vector_14 +000006e0 W __vector_15 +000006e0 W __vector_16 +000006e0 W __vector_17 +000006e0 W __vector_18 +000006e0 W __vector_19 +000006e0 W __vector_2 +000006e0 W __vector_20 +000006e0 W __vector_21 +000006e0 W __vector_23 +000006e0 W __vector_24 +000006e0 W __vector_25 +000006e0 W __vector_26 +000006e0 W __vector_27 +000006e0 W __vector_28 +000006e0 W __vector_29 +000006e0 W __vector_3 +000006e0 W __vector_30 +000006e0 W __vector_31 +000006e0 W __vector_32 +000006e0 W __vector_33 +000006e0 W __vector_35 +000006e0 W __vector_36 +000006e0 W __vector_37 +000006e0 W __vector_38 +000006e0 W __vector_39 +000006e0 W __vector_4 +000006e0 W __vector_40 +000006e0 W __vector_41 +000006e0 W __vector_42 +000006e0 W __vector_43 +000006e0 W __vector_44 +000006e0 W __vector_45 +000006e0 W __vector_46 +000006e0 W __vector_47 +000006e0 W __vector_48 +000006e0 W __vector_49 +000006e0 W __vector_5 +000006e0 W __vector_50 +000006e0 W __vector_51 +000006e0 W __vector_52 +000006e0 W __vector_53 +000006e0 W __vector_54 +000006e0 W __vector_55 +000006e0 W __vector_56 +000006e0 W __vector_57 +000006e0 W __vector_58 +000006e0 W __vector_59 +000006e0 W __vector_6 +000006e0 W __vector_60 +000006e0 W __vector_61 +000006e0 W __vector_62 +000006e0 W __vector_63 +000006e0 W __vector_64 +000006e0 W __vector_65 +000006e0 W __vector_66 +000006e0 W __vector_67 +000006e0 W __vector_68 +000006e0 W __vector_69 +000006e0 W __vector_7 +000006e0 W __vector_70 +000006e0 W __vector_71 +000006e0 W __vector_72 +000006e0 W __vector_73 +000006e0 W __vector_74 +000006e0 W __vector_75 +000006e0 W __vector_76 +000006e0 W __vector_77 +000006e0 W __vector_78 +000006e0 W __vector_79 +000006e0 W __vector_8 +000006e0 W __vector_80 +000006e0 W __vector_81 +000006e0 W __vector_82 +000006e0 W __vector_84 +000006e0 W __vector_85 +000006e0 W __vector_86 +000006e0 W __vector_87 +000006e0 W __vector_88 +000006e0 W __vector_89 +000006e0 W __vector_9 +000006e0 W __vector_90 +000006e0 W __vector_91 +000006e0 W __vector_92 +000006e0 W __vector_93 +000006e0 W __vector_94 +000006e0 W __vector_95 +000006e0 W __vector_96 +000006e0 W __vector_97 +000006e0 W __vector_98 +000006e0 W __vector_99 +000006e2 T main +00000758 T CALLBACK_USB_GetDescriptor +000007da T __vector_default +000007e6 T SystemInit +00000854 T SystemReset +00000862 T SystemEnterBootloader +0000086e T SystemStartUSBClock +000008a0 T SystemStopUSBClock +000008bc T SystemInterruptInit +000008c8 t CodecInitDummy +000008ca t CodecTaskDummy +000008cc t ApplicationInitDummy +000008ce t ApplicationResetDummy +000008d0 t ApplicationTaskDummy +000008d2 t ApplicationProcessDummy +000008d8 t ApplicationGetUidDummy +000008da t ApplicationSetUidDummy +000008dc T ConfigurationSetById +00000912 T ConfigurationInit +0000091e T ConfigurationSetByName +000009a0 T ConfigurationGetList +000009fe T RandomInit +00000a00 T RandomGetByte +00000a06 T RandomGetBuffer +00000a24 T RandomTick +00000a34 T BufferToHexString +00000ab8 T HexStringToBuffer +00000b44 T MemoryReadBlock +00000b74 T MemoryWriteBlock +00000ba6 T MemoryClear +00000bb6 T MemoryRecall +00000ca2 T MemoryInit +00000d9e T MemoryStore +00001020 T MemoryUploadBlock +000013e2 T MemoryDownloadBlock +0000145c T ButtonInit +0000146a T ButtonTick +00001634 T ButtonGetActionList +00001698 T ButtonSetActionById +000016a4 T ButtonGetActionByName +000016c0 T ButtonSetActionByName +00001776 T SettingsLoad +00001786 T SettingsSave +00001796 T SettingsSetActiveById +000017c2 T SettingsCycle +0000189c T SettingsGetActiveById +000018a2 T SettingsGetActiveByName +000018b6 T SettingsSetActiveByName +000018d0 T TerminalSendString +000018da T TerminalSendStringP +00001902 T TerminalSendBlock +0000190e T TerminalInit +00001918 T TerminalTask +00001956 T TerminalTick +000019d6 T EVENT_USB_Device_Connect +000019e0 T EVENT_USB_Device_Disconnect +000019ea T EVENT_USB_Device_ConfigurationChanged +000019f2 T EVENT_USB_Device_ControlRequest +000019fa T CommandGetVersion +00001a36 T CommandGetConfig +00001a62 T CommandSetConfig +00001a74 T CommandExecConfig +00001a80 T CommandGetUid +00001ace T CommandSetUid +00001b80 T CommandGetReadOnly +00001ba4 T CommandSetReadOnly +00001bcc T CommandExecUpload +00001bd6 T CommandExecDownload +00001be0 T CommandExecReset +00001bf6 T CommandExecUpgrade +00001c0c T CommandGetMemSize +00001c3c T CommandGetUidSize +00001c68 T CommandExecButton +00001c72 T CommandGetButton +00001c7c T CommandSetButton +00001c8c T CommandGetSetting +00001c96 T CommandSetSetting +00001ca6 T CommandExecClear +00001cae T CommandExecHelp +00001d46 T CommandGetRssi +00001dae t CalcChecksum.constprop.0 +00001dc2 T XModemReceive +00001df2 T XModemSend +00001e18 T XModemProcessByte +0000209c T XModemTick +000020f8 T CommandLineProcessByte +0000243a T CommandLineTick +0000243c t StartDemod +00002478 T __vector_34 +00002500 T __vector_22 +00002648 T __vector_83 +0000282a T ISO14443ACodecInit +00002898 T ISO14443ACodecTask +00002994 T MifareClassicAppInit1K +000029ae T MifareClassicAppInit4K +000029c8 T MifareClassicAppReset +000029d0 T MifareClassicAppTask +000029d2 T MifareClassicAppProcess 00002fff W __stack -00003062 t Crypto1LFSR -000030ee T Crypto1FilterOutput -00003156 T Crypto1Setup -00003496 T Crypto1Auth -000034e8 T Crypto1Byte -0000356a T Crypto1Nibble -000035b2 T Crypto1PRNG -00003668 T USB_Device_ProcessControlRequest -000038fe W EVENT_USB_Device_Reset -000038fe W EVENT_USB_Device_StartOfFrame -000038fe W EVENT_USB_Device_Suspend -000038fe W EVENT_USB_Device_WakeUp -000038fe T USB_Event_Stub -00003900 T USB_USBTask -0000392a T Endpoint_Write_Stream_LE -00003a02 T Endpoint_Write_Control_Stream_LE -00003b44 T Endpoint_Write_Control_PStream_LE -00003c82 T Endpoint_ClearIN -00003cb4 T Endpoint_ClearOUT -00003cd2 T Endpoint_Read_8 -00003cf0 T Endpoint_Write_8 -00003d0e T Endpoint_SelectEndpoint -00003d80 T Endpoint_StallTransaction -00003db8 T Endpoint_ClearSETUP -00003e10 T Endpoint_IsSETUPReceived -00003e42 T Endpoint_IsOUTReceived -00003e74 T Endpoint_IsINReady -00003e8c T Endpoint_ConfigureEndpoint_PRV -00003f26 T Endpoint_ConfigureEndpointTable -00004012 T Endpoint_ClearEndpoints -00004082 T Endpoint_ClearStatusStage -000040ae T Endpoint_WaitUntilReady -00004154 T USB_Disable -0000416e T USB_ResetInterface -000041ca T USB_Init -0000421c T USB_INT_DisableAllInterrupts -0000422a T USB_INT_ClearAllInterrupts -00004236 T __vector_125 -00004310 T CDC_Device_ConfigureEndpoints -0000435a T CDC_Device_SendString -000043ac T CDC_Device_SendData -00004400 T CDC_Device_SendByte -0000446e T CDC_Device_Flush -000044fe T CDC_Device_USBTask -00004534 T CDC_Device_ReceiveByte -000045f2 T CDC_Device_Event_Stub -000045f2 W EVENT_CDC_Device_BreakSent -000045f2 W EVENT_CDC_Device_ControLineStateChanged -000045f2 W EVENT_CDC_Device_LineEncodingChanged -000045f4 T CDC_Device_ProcessControlRequest -0000472e T __mulshisi3 -00004732 T __mulohisi3 -0000473a T __muluhisi3 -0000474e T __umulhisi3 -00004766 t do_rand -000047fc T rand_r -000047fe T rand -00004804 T srand -0000481a T memcpy_P -0000482c T strcmp_P -0000483e T strncpy_P -0000485c T memcpy -0000486e T snprintf_P -000048c8 T vfprintf -00004c62 T __eerd_block_x32a4u -00004c78 T __eewr_block_x32a4u -00004c8a T __eewr_byte_x32a4u -00004c8c T __eewr_r18_x32a4u -00004cd0 T strnlen_P -00004ce6 T strnlen -00004cfc T fputc -00004d54 T __ultoa_invert -00004e10 T __divmodsi4 -00004e26 t __divmodsi4_neg1 -00004e36 t __divmodsi4_neg2 -00004e44 t __divmodsi4_exit -00004e46 T __prologue_saves__ -00004e78 T __epilogue_restores__ -00004ea8 T __udivmodsi4 -00004eb4 t __udivmodsi4_loop -00004ece t __udivmodsi4_ep -00004eec T _exit -00004eec W exit -00004eee t __stop_program -00004ef0 A __data_load_start -00004ef0 T _etext -00004f82 A __data_load_end +000032cc T MifareClassicGetUid +000032d8 T MifareClassicSetUid +00003318 T ISO14443AAppendCRCA +00003376 T ISO14443ACheckCRCA +000033f4 t Crypto1LFSR +00003480 T Crypto1FilterOutput +000034e8 T Crypto1Setup +00003828 T Crypto1Auth +0000387a T Crypto1Byte +000038fc T Crypto1Nibble +00003944 T Crypto1PRNG +000039fa T USB_Device_ProcessControlRequest +00003c90 W EVENT_USB_Device_Reset +00003c90 W EVENT_USB_Device_StartOfFrame +00003c90 W EVENT_USB_Device_Suspend +00003c90 W EVENT_USB_Device_WakeUp +00003c90 T USB_Event_Stub +00003c92 T USB_USBTask +00003cbc T Endpoint_Write_Stream_LE +00003d94 T Endpoint_Write_Control_Stream_LE +00003ed6 T Endpoint_Write_Control_PStream_LE +00004014 T Endpoint_ClearIN +00004046 T Endpoint_ClearOUT +00004064 T Endpoint_Read_8 +00004082 T Endpoint_Write_8 +000040a0 T Endpoint_SelectEndpoint +00004112 T Endpoint_StallTransaction +0000414a T Endpoint_ClearSETUP +000041a2 T Endpoint_IsSETUPReceived +000041d4 T Endpoint_IsOUTReceived +00004206 T Endpoint_IsINReady +0000421e T Endpoint_ConfigureEndpoint_PRV +000042b8 T Endpoint_ConfigureEndpointTable +000043a4 T Endpoint_ClearEndpoints +00004414 T Endpoint_ClearStatusStage +00004440 T Endpoint_WaitUntilReady +000044e6 T USB_Disable +00004500 T USB_ResetInterface +0000455c T USB_Init +000045ae T USB_INT_DisableAllInterrupts +000045bc T USB_INT_ClearAllInterrupts +000045c8 T __vector_125 +000046a2 T CDC_Device_ConfigureEndpoints +000046ec T CDC_Device_SendString +0000473e T CDC_Device_SendData +00004792 T CDC_Device_SendByte +00004800 T CDC_Device_Flush +00004890 T CDC_Device_USBTask +000048c6 T CDC_Device_ReceiveByte +00004984 T CDC_Device_Event_Stub +00004984 W EVENT_CDC_Device_BreakSent +00004984 W EVENT_CDC_Device_ControLineStateChanged +00004984 W EVENT_CDC_Device_LineEncodingChanged +00004986 T CDC_Device_ProcessControlRequest +00004ac0 T __mulshisi3 +00004ac4 T __mulohisi3 +00004acc T __muluhisi3 +00004ae0 T __umulhisi3 +00004af8 t do_rand +00004b8e T rand_r +00004b90 T rand +00004b96 T srand +00004bac T memcpy_P +00004bbe T strcmp_P +00004bd0 T strncpy_P +00004bee T memcpy +00004c00 T snprintf_P +00004c5a T vfprintf +00004ff4 T __eerd_block_x32a4u +0000500a T __eewr_block_x32a4u +0000501c T __eewr_byte_x32a4u +0000501e T __eewr_r18_x32a4u +00005062 T strnlen_P +00005078 T strnlen +0000508e T fputc +000050e6 T __ultoa_invert +000051a2 T __divmodsi4 +000051b8 t __divmodsi4_neg1 +000051c8 t __divmodsi4_neg2 +000051d6 t __divmodsi4_exit +000051d8 T __prologue_saves__ +0000520a T __epilogue_restores__ +0000523a T __udivmodsi4 +00005246 t __udivmodsi4_loop +00005260 t __udivmodsi4_ep +0000527e T _exit +0000527e W exit +00005280 t __stop_program +00005282 A __data_load_start +00005282 T _etext +00005314 A __data_load_end 00802000 D __data_start 00802000 D TerminalHandle 0080201b d TerminalInitDelay @@ -675,55 +677,56 @@ 00802092 B __bss_start 00802092 D __data_end 00802092 D _edata -00802092 b LastButtonState.4112 -00802093 B LEDPulseMask -00802094 B TerminalState -00802095 b State -00802096 b CurrentFrameNumber -00802097 b RetryCount -00802098 b RetryTimeout -00802099 b BlockAddress -0080209d b CallbackFunc -0080209f b BufferIdx -008020a1 b Checksum -008020a2 b ReceivedFrameNumber -008020a3 b BufferIdx -008020a5 b SamplePosition -008020a6 b LoadModState -008020a7 b LastBit -008020a8 b IsParityBit -008020a9 b SampleRegister -008020aa b DataRegister -008020ab b BitSent -008020ad b BitCount -008020af b Flags -008020b1 b CodecBufferPtr -008020b3 b ParityBufferPtr -008020b5 b State -008020b6 b CardATQAValue -008020b8 b CardSAKValue -008020b9 b ReaderResponse -008020bd b CardResponse -008020c1 b CurrentAddress -008020c2 b BlockBuffer -008020d2 b StateOdd -008020d5 b StateEven -008020d8 B ActiveConfiguration -008020fd B GlobalSettings -00802110 B TerminalBuffer -00802210 B CodecBuffer -00802310 B USB_Device_ConfigurationNumber -00802311 B USB_Device_CurrentlySelfPowered -00802312 B USB_Device_RemoteWakeupEnabled -00802313 B USB_IsInitialized -00802314 B USB_DeviceState -00802315 B USB_ControlRequest -0080231d B USB_Endpoint_SelectedFIFO -0080231f B USB_Endpoint_SelectedHandle -00802321 B USB_Endpoint_SelectedEndpoint -00802322 B USB_Endpoint_FIFOs -0080263a B USB_EndpointTable -0080269d B __bss_end -0080269d B _end +00802092 b Memory +00802492 b LastButtonState.4138 +00802493 B LEDPulseMask +00802494 B TerminalState +00802495 b State +00802496 b CurrentFrameNumber +00802497 b RetryCount +00802498 b RetryTimeout +00802499 b BlockAddress +0080249d b CallbackFunc +0080249f b BufferIdx +008024a1 b Checksum +008024a2 b ReceivedFrameNumber +008024a3 b BufferIdx +008024a5 b SamplePosition +008024a6 b LoadModState +008024a7 b LastBit +008024a8 b IsParityBit +008024a9 b SampleRegister +008024aa b DataRegister +008024ab b BitSent +008024ad b BitCount +008024af b Flags +008024b1 b CodecBufferPtr +008024b3 b ParityBufferPtr +008024b5 b State +008024b6 b CardATQAValue +008024b8 b CardSAKValue +008024b9 b ReaderResponse +008024bd b CardResponse +008024c1 b CurrentAddress +008024c2 b BlockBuffer +008024d2 b StateOdd +008024d5 b StateEven +008024d8 B ActiveConfiguration +008024fd B GlobalSettings +00802510 B TerminalBuffer +00802610 B CodecBuffer +00802710 B USB_Device_ConfigurationNumber +00802711 B USB_Device_CurrentlySelfPowered +00802712 B USB_Device_RemoteWakeupEnabled +00802713 B USB_IsInitialized +00802714 B USB_DeviceState +00802715 B USB_ControlRequest +0080271d B USB_Endpoint_SelectedFIFO +0080271f B USB_Endpoint_SelectedHandle +00802721 B USB_Endpoint_SelectedEndpoint +00802722 B USB_Endpoint_FIFOs +00802a3a B USB_EndpointTable +00802a9d B __bss_end +00802a9d B _end 00810000 D StoredSettings 00810013 D __eeprom_end diff --git a/Firmware/Chameleon-Mini/Memory.c b/Firmware/Chameleon-Mini/Memory.c index 3fc97ac..936f537 100644 --- a/Firmware/Chameleon-Mini/Memory.c +++ b/Firmware/Chameleon-Mini/Memory.c @@ -53,6 +53,7 @@ * policies, either expressed or implied, of the ORIGINAL AUTHORS. */ + #include "Memory.h" #include "Configuration.h" #include "Common.h" @@ -72,6 +73,10 @@ #define FLASH_STATUS_REG_PROTECT_BIT (1<<1) #define FLASH_STATUS_REG_PAGESIZE_BIT (1<<0) +#define FLASH_PAGE_SIZE 256 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + INLINE uint8_t SPITransferByte(uint8_t Data) { MEMORY_FLASH_USART.DATA = Data; @@ -188,9 +193,9 @@ INLINE void FlashRead(void* Buffer, uint32_t Address, uint16_t ByteCount) INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) { while(ByteCount > 0) { - uint16_t PageAddress = Address / MEMORY_PAGE_SIZE; - uint8_t ByteAddress = Address % MEMORY_PAGE_SIZE; - uint16_t PageBytes = MIN(MEMORY_PAGE_SIZE - ByteAddress, ByteCount); + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); FlashMemoryToBuffer(PageAddress); FlashWriteBuffer(Buffer, ByteAddress, PageBytes); @@ -233,32 +238,56 @@ void MemoryInit(void) /* Configure for 256 byte Dataflash if not already done. */ FlashConfigurePageSize(); } + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); } void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) { - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - FlashRead(Buffer, FlashAddress, ByteCount); + uint8_t* SrcPtr = &Memory[Address]; + uint8_t* DstPtr = (uint8_t*) Buffer; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + } } void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) { - uint32_t FlashAddress = (uint32_t) Address + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - FlashWrite(Buffer, FlashAddress, ByteCount); + uint8_t* SrcPtr = (uint8_t*) Buffer; + uint8_t* DstPtr = &Memory[Address]; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + } } void MemoryClear(void) { - uint32_t PageAddress = ((uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING) / MEMORY_PAGE_SIZE; - uint16_t PageCount = MEMORY_SIZE_PER_SETTING / MEMORY_PAGE_SIZE; - - while(PageCount > 0) { - FlashClearPage(PageAddress); - PageCount--; - PageAddress++; + for (uint16_t i=0; i= MEMORY_SIZE_PER_SETTING) { @@ -267,10 +296,23 @@ bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) } else { /* Calculate bytes left in memory and start writing */ uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - MemoryWriteBlock(Buffer, BlockAddress, ByteCount); + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + + /* Store into flash */ + FlashWrite(Buffer, FlashAddress, ByteCount); + + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + uint8_t* SrcPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + } + return true; } + } bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) @@ -281,9 +323,17 @@ bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount } else { /* Calculate bytes left in memory and issue reading */ uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - MemoryReadBlock(Buffer, BlockAddress, ByteCount); + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + uint8_t* SrcPtr = &Memory[BlockAddress]; + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + } + return true; } -} - +} \ No newline at end of file diff --git a/Firmware/Chameleon-Mini/Memory.h b/Firmware/Chameleon-Mini/Memory.h index a367a7a..e492dc7 100644 --- a/Firmware/Chameleon-Mini/Memory.h +++ b/Firmware/Chameleon-Mini/Memory.h @@ -65,16 +65,20 @@ #define MEMORY_FLASH_MISO PIN2_bm #define MEMORY_FLASH_SCK PIN1_bm -#define MEMORY_PAGE_SIZE 256 -#define MEMORY_SIZE_PER_SETTING ((uint32_t) 256 * MEMORY_PAGE_SIZE) /* Multiple of memory page size */ +#define MEMORY_SIZE_PER_SETTING 1024 void MemoryInit(void); void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount); void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount); void MemoryClear(void); + +void MemoryRecall(void); +void MemoryStore(void); + /* For use with XModem */ bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount); bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount); #endif /* MEMORY_H_ */ + diff --git a/Firmware/Chameleon-Mini/ProgramViaBootloader.bat b/Firmware/Chameleon-Mini/ProgramViaBootloader.bat index 6965ae7..7c2e602 100644 --- a/Firmware/Chameleon-Mini/ProgramViaBootloader.bat +++ b/Firmware/Chameleon-Mini/ProgramViaBootloader.bat @@ -1,5 +1,5 @@ @ECHO OFF -SET COMPORT=COM21 +SET COMPORT=COM5 SET BATCHISP=C:\Programme\Atmel\Flip 3.4.7\bin SET TIMEOUT=5 SET COMMAND=UPGRADE diff --git a/Firmware/Chameleon-Mini/Settings.c b/Firmware/Chameleon-Mini/Settings.c index 7f89486..1f2e8d8 100644 --- a/Firmware/Chameleon-Mini/Settings.c +++ b/Firmware/Chameleon-Mini/Settings.c @@ -94,12 +94,18 @@ void SettingsCycle(void) { void SettingsSetActiveById(uint8_t Setting) { if (Setting < SETTINGS_COUNT) { + /* Store current memory contents permanently */ + MemoryStore(); + GlobalSettings.ActiveSetting = Setting; GlobalSettings.ActiveSettingPtr = &GlobalSettings.Settings[GlobalSettings.ActiveSetting]; /* Settings have changed. Progress changes through system */ ConfigurationInit(); + + /* Recall new memory contents */ + MemoryRecall(); } }