diff --git a/.gitignore b/.gitignore index f522cf6..a29dcd3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,7 @@ *.map *.bin *.hex -*.dll \ No newline at end of file +*.dll +*.sym +*.lss +*.DS_Store diff --git a/Firmware/Chameleon-Mini/Application/MifareClassic.c b/Firmware/Chameleon-Mini/Application/MifareClassic.c index a05ab12..1d055ac 100644 --- a/Firmware/Chameleon-Mini/Application/MifareClassic.c +++ b/Firmware/Chameleon-Mini/Application/MifareClassic.c @@ -13,6 +13,7 @@ #include "Crypto1.h" #include "../Random.h" #include "../LED.h" + #define MFCLASSIC_1K_ATQA_VALUE 0x0004 #define MFPlus_ATQA_VALUE 0x0044 #define MFCLASSIC_4K_ATQA_VALUE 0x0002 @@ -78,16 +79,16 @@ Access conditions for the sector trailer Access bits Access condition for Remark KEYA Access bits KEYB -C1 C2 C3 read write read write read write +C1 C2 C3 read write read write read write 0 0 0 never key A key A never key A key A Key B may be read[1] 0 1 0 never never key A never key A never Key B may be read[1] -1 0 0 never key B keyA|B never never key B -1 1 0 never never keyA|B never never never +1 0 0 never key B keyA|B never never key B +1 1 0 never never keyA|B never never never 0 0 1 never key A key A key A key A key A Key B may be read, transport configuration[1] -0 1 1 never key B keyA|B key B never key B -1 0 1 never never keyA|B key B never never -1 1 1 never never keyA|B never never never +0 1 1 never key B keyA|B key B never key B +1 0 1 never never keyA|B key B never never +1 1 1 never never keyA|B never never never [1] For this access condition key B is readable and may be used for data */ @@ -103,9 +104,9 @@ C1 C2 C3 read write read write read write /* Access conditions for data blocks Access bits Access condition for Application -C1 C2 C3 read write increment decrement, - transfer, - restore +C1 C2 C3 read write increment decrement, + transfer, + restore 0 0 0 key A|B key A|B key A|B key A|B transport configuration 0 1 0 key A|B never never never read/write block @@ -125,128 +126,130 @@ C1 C2 C3 read write increment decrement, #define KEY_A 0 #define KEY_B 1 -/* Decoding table for Access conditions of a data block */ +/* +// Decoding table for Access conditions of a data block static const uint8_t abBlockAccessConditions[8][2] = { - /*C1C2C3 */ - /* 0 0 0 R:key A|B W: key A|B I:key A|B D:key A|B transport configuration */ + //C1C2C3 + // 0 0 0 R:key A|B W: key A|B I:key A|B D:key A|B transport configuration { - /* Access with Key A */ + // Access with Key A ACC_BLOCK_READ | ACC_BLOCK_WRITE | ACC_BLOCK_INCREMENT | ACC_BLOCK_DECREMENT, - /* Access with Key B */ + // Access with Key B ACC_BLOCK_READ | ACC_BLOCK_WRITE | ACC_BLOCK_INCREMENT | ACC_BLOCK_DECREMENT }, - /* 1 0 0 R:key A|B W:key B I:never D:never read/write block */ + // 1 0 0 R:key A|B W:key B I:never D:never read/write block { - /* Access with Key A */ + // Access with Key A ACC_BLOCK_READ, - /* Access with Key B */ + // Access with Key B ACC_BLOCK_READ | ACC_BLOCK_WRITE }, - /* 0 1 0 R:key A|B W:never I:never D:never read/write block */ + // 0 1 0 R:key A|B W:never I:never D:never read/write block { - /* Access with Key A */ + // Access with Key A ACC_BLOCK_READ, - /* Access with Key B */ + // Access with Key B ACC_BLOCK_READ }, - /* 1 1 0 R:key A|B W:key B I:key B D:key A|B value block */ + // 1 1 0 R:key A|B W:key B I:key B D:key A|B value block { - /* Access with Key A */ + // Access with Key A ACC_BLOCK_READ | ACC_BLOCK_DECREMENT, - /* Access with Key B */ + // Access with Key B ACC_BLOCK_READ | ACC_BLOCK_WRITE | ACC_BLOCK_INCREMENT | ACC_BLOCK_DECREMENT }, - /* 0 0 1 R:key A|B W:never I:never D:key A|B value block */ + // 0 0 1 R:key A|B W:never I:never D:key A|B value block { - /* Access with Key A */ + // Access with Key A ACC_BLOCK_READ | ACC_BLOCK_DECREMENT, - /* Access with Key B */ + // Access with Key B ACC_BLOCK_READ | ACC_BLOCK_DECREMENT }, - /* 1 0 1 R:key B W:never I:never D:never read/write block */ + // 1 0 1 R:key B W:never I:never D:never read/write block { - /* Access with Key A */ + // Access with Key A 0, - /* Access with Key B */ - ACC_BLOCK_READ + // Access with Key B + ACC_BLOCK_READ }, - /* 0 1 1 R:key B W:key B I:never D:never read/write block */ + // 0 1 1 R:key B W:key B I:never D:never read/write block { - /* Access with Key A */ + // Access with Key A 0, - /* Access with Key B */ - ACC_BLOCK_READ | ACC_BLOCK_WRITE + // Access with Key B + ACC_BLOCK_READ | ACC_BLOCK_WRITE }, - /* 1 1 1 R:never W:never I:never D:never read/write block */ + // 1 1 1 R:never W:never I:never D:never read/write block { - /* Access with Key A */ + // Access with Key A 0, - /* Access with Key B */ + // Access with Key B 0 } }; -/* Decoding table for Access conditions of the sector trailor */ +// Decoding table for Access conditions of the sector trailor static const uint8_t abTrailorAccessConditions[8][2] = { - /* 0 0 0 RdKA:never WrKA:key A RdAcc:key A WrAcc:never RdKB:key A WrKB:key A Key B may be read[1] */ + // 0 0 0 RdKA:never WrKA:key A RdAcc:key A WrAcc:never RdKB:key A WrKB:key A Key B may be read[1] { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_WRITE_KEYA | ACC_TRAILOR_READ_ACC | ACC_TRAILOR_WRITE_ACC | ACC_TRAILOR_READ_KEYB | ACC_TRAILOR_WRITE_KEYB, - /* Access with Key B */ + // Access with Key B 0 }, - /* 1 0 0 RdKA:never WrKA:key B RdAcc:keyA|B WrAcc:never RdKB:never WrKB:key B */ + // 1 0 0 RdKA:never WrKA:key B RdAcc:keyA|B WrAcc:never RdKB:never WrKB:key B { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_READ_ACC, - /* Access with Key B */ + // Access with Key B ACC_TRAILOR_WRITE_KEYA | ACC_TRAILOR_READ_ACC | ACC_TRAILOR_WRITE_KEYB }, - /* 0 1 0 RdKA:never WrKA:never RdAcc:key A WrAcc:never RdKB:key A WrKB:never Key B may be read[1] */ + // 0 1 0 RdKA:never WrKA:never RdAcc:key A WrAcc:never RdKB:key A WrKB:never Key B may be read[1] { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_READ_ACC | ACC_TRAILOR_READ_KEYB, - /* Access with Key B */ + // Access with Key B 0 }, - /* 1 1 0 never never keyA|B never never never */ + // 1 1 0 never never keyA|B never never never { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_READ_ACC, - /* Access with Key B */ + // Access with Key B ACC_TRAILOR_READ_ACC }, - /* 0 0 1 never key A key A key A key A key A Key B may be read,transport configuration[1] */ + // 0 0 1 never key A key A key A key A key A Key B may be read,transport configuration[1] { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_WRITE_KEYA | ACC_TRAILOR_READ_ACC | ACC_TRAILOR_WRITE_ACC | ACC_TRAILOR_READ_KEYB | ACC_TRAILOR_WRITE_KEYB, - /* Access with Key B */ + // Access with Key B 0 }, - /* 0 1 1 never key B keyA|B key B never key B */ + // 0 1 1 never key B keyA|B key B never key B { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_READ_ACC, - /* Access with Key B */ + // Access with Key B ACC_TRAILOR_WRITE_KEYA | ACC_TRAILOR_READ_ACC | ACC_TRAILOR_WRITE_ACC | ACC_TRAILOR_WRITE_KEYB }, - /* 1 0 1 never never keyA|B key B never never */ + // 1 0 1 never never keyA|B key B never never { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_READ_ACC, - /* Access with Key B */ + // Access with Key B ACC_TRAILOR_READ_ACC | ACC_TRAILOR_WRITE_ACC }, - /* 1 1 1 never never keyA|B never never never */ + // 1 1 1 never never keyA|B never never never { - /* Access with Key A */ + // Access with Key A ACC_TRAILOR_READ_ACC, - /* Access with Key B */ + // Access with Key B ACC_TRAILOR_READ_ACC }, }; +*/ static enum { STATE_HALT, @@ -288,7 +291,7 @@ INLINE uint8_t GetAccessCondition(uint8_t Block) uint8_t Acc1 = AccessConditions[1]; uint8_t Acc2 = AccessConditions[2]; uint8_t ResultForBlock = 0; - + InvSAcc0 = ~BYTE_SWAP(Acc0); InvSAcc1 = ~BYTE_SWAP(Acc1); @@ -522,7 +525,7 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { /* Load UID CL1 and perform anticollision */ uint8_t UidCL1[ISO14443A_CL_UID_SIZE]; - + if (_7BUID) { MemoryReadBlock(&UidCL1[1], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); UidCL1[0] = ISO14443A_UID0_CT; @@ -628,11 +631,11 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) Buffer[0] = NAK_CRC_ERROR; return ACK_NAK_FRAME_SIZE; } - } else if ( (Buffer[0] == CMD_READ) || + } else if ( (Buffer[0] == CMD_READ) || (Buffer[0] == CMD_WRITE) || - (Buffer[0] == CMD_DECREMENT) || - (Buffer[0] == CMD_INCREMENT) || - (Buffer[0] == CMD_RESTORE) || + (Buffer[0] == CMD_DECREMENT) || + (Buffer[0] == CMD_INCREMENT) || + (Buffer[0] == CMD_RESTORE) || (Buffer[0] == CMD_TRANSFER) ) { State = STATE_IDLE; Buffer[0] = NAK_NOT_AUTHED; @@ -912,7 +915,7 @@ void MifareClassicSetUid(ConfigurationUidType Uid) void MifareClassicGetAtqa(uint16_t * Atqa) { - *Atqa = CardATQAValue; + *Atqa = CardATQAValue; } void MifareClassicSetAtqa(uint16_t Atqa) diff --git a/Firmware/Chameleon-Mini/Chameleon-Mini.lss b/Firmware/Chameleon-Mini/Chameleon-Mini.lss deleted file mode 100644 index 04500d1..0000000 --- a/Firmware/Chameleon-Mini/Chameleon-Mini.lss +++ /dev/null @@ -1,15840 +0,0 @@ - -Chameleon-Mini.elf: file format elf32-avr - -Sections: -Idx Name Size VMA LMA File off Algn - 0 .text 00005b6c 00000000 00000000 000000b4 2**1 - CONTENTS, ALLOC, LOAD, READONLY, CODE - 1 .data 0000004c 00802000 00005b6c 00005c20 2**0 - CONTENTS, ALLOC, LOAD, DATA - 2 .bss 0000069b 0080204c 0080204c 00005c6c 2**0 - ALLOC - 3 .eeprom 0000002b 00810000 00810000 00005c6c 2**0 - CONTENTS, ALLOC, LOAD, DATA - 4 .comment 00000011 00000000 00000000 00005c97 2**0 - CONTENTS, READONLY - 5 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 00005ca8 2**2 - CONTENTS, READONLY - 6 .debug_aranges 000009f0 00000000 00000000 00005ce8 2**3 - CONTENTS, READONLY, DEBUGGING - 7 .debug_info 00017e29 00000000 00000000 000066d8 2**0 - CONTENTS, READONLY, DEBUGGING - 8 .debug_abbrev 00004b8c 00000000 00000000 0001e501 2**0 - CONTENTS, READONLY, DEBUGGING - 9 .debug_line 000093b7 00000000 00000000 0002308d 2**0 - CONTENTS, READONLY, DEBUGGING - 10 .debug_frame 00001bcc 00000000 00000000 0002c444 2**2 - CONTENTS, READONLY, DEBUGGING - 11 .debug_str 00006680 00000000 00000000 0002e010 2**0 - CONTENTS, READONLY, DEBUGGING - 12 .debug_loc 0000a314 00000000 00000000 00034690 2**0 - CONTENTS, READONLY, DEBUGGING - 13 .debug_ranges 00000db0 00000000 00000000 0003e9a4 2**0 - CONTENTS, READONLY, DEBUGGING - -Disassembly of section .text: - -00000000 <__vectors>: - 0: 07 c5 rjmp .+2574 ; 0xa10 <__ctors_end> - 2: 00 00 nop - 4: 21 c5 rjmp .+2626 ; 0xa48 <__bad_interrupt> - 6: 00 00 nop - 8: 1f c5 rjmp .+2622 ; 0xa48 <__bad_interrupt> - a: 00 00 nop - c: 1d c5 rjmp .+2618 ; 0xa48 <__bad_interrupt> - e: 00 00 nop - 10: 1b c5 rjmp .+2614 ; 0xa48 <__bad_interrupt> - 12: 00 00 nop - 14: 19 c5 rjmp .+2610 ; 0xa48 <__bad_interrupt> - 16: 00 00 nop - 18: 17 c5 rjmp .+2606 ; 0xa48 <__bad_interrupt> - 1a: 00 00 nop - 1c: 15 c5 rjmp .+2602 ; 0xa48 <__bad_interrupt> - 1e: 00 00 nop - 20: 13 c5 rjmp .+2598 ; 0xa48 <__bad_interrupt> - 22: 00 00 nop - 24: 11 c5 rjmp .+2594 ; 0xa48 <__bad_interrupt> - 26: 00 00 nop - 28: 0f c5 rjmp .+2590 ; 0xa48 <__bad_interrupt> - 2a: 00 00 nop - 2c: 0d c5 rjmp .+2586 ; 0xa48 <__bad_interrupt> - 2e: 00 00 nop - 30: 0b c5 rjmp .+2582 ; 0xa48 <__bad_interrupt> - 32: 00 00 nop - 34: 09 c5 rjmp .+2578 ; 0xa48 <__bad_interrupt> - 36: 00 00 nop - 38: 07 c5 rjmp .+2574 ; 0xa48 <__bad_interrupt> - 3a: 00 00 nop - 3c: 05 c5 rjmp .+2570 ; 0xa48 <__bad_interrupt> - 3e: 00 00 nop - 40: 03 c5 rjmp .+2566 ; 0xa48 <__bad_interrupt> - 42: 00 00 nop - 44: 01 c5 rjmp .+2562 ; 0xa48 <__bad_interrupt> - 46: 00 00 nop - 48: ff c4 rjmp .+2558 ; 0xa48 <__bad_interrupt> - 4a: 00 00 nop - 4c: fd c4 rjmp .+2554 ; 0xa48 <__bad_interrupt> - 4e: 00 00 nop - 50: fb c4 rjmp .+2550 ; 0xa48 <__bad_interrupt> - 52: 00 00 nop - 54: f9 c4 rjmp .+2546 ; 0xa48 <__bad_interrupt> - 56: 00 00 nop - 58: 0c 94 7a 13 jmp 0x26f4 ; 0x26f4 <__vector_22> - 5c: f5 c4 rjmp .+2538 ; 0xa48 <__bad_interrupt> - 5e: 00 00 nop - 60: f3 c4 rjmp .+2534 ; 0xa48 <__bad_interrupt> - 62: 00 00 nop - 64: f1 c4 rjmp .+2530 ; 0xa48 <__bad_interrupt> - 66: 00 00 nop - 68: ef c4 rjmp .+2526 ; 0xa48 <__bad_interrupt> - 6a: 00 00 nop - 6c: ed c4 rjmp .+2522 ; 0xa48 <__bad_interrupt> - 6e: 00 00 nop - 70: eb c4 rjmp .+2518 ; 0xa48 <__bad_interrupt> - 72: 00 00 nop - 74: e9 c4 rjmp .+2514 ; 0xa48 <__bad_interrupt> - 76: 00 00 nop - 78: e7 c4 rjmp .+2510 ; 0xa48 <__bad_interrupt> - 7a: 00 00 nop - 7c: e5 c4 rjmp .+2506 ; 0xa48 <__bad_interrupt> - 7e: 00 00 nop - 80: e3 c4 rjmp .+2502 ; 0xa48 <__bad_interrupt> - 82: 00 00 nop - 84: e1 c4 rjmp .+2498 ; 0xa48 <__bad_interrupt> - 86: 00 00 nop - 88: 0c 94 37 13 jmp 0x266e ; 0x266e <__vector_34> - 8c: dd c4 rjmp .+2490 ; 0xa48 <__bad_interrupt> - 8e: 00 00 nop - 90: db c4 rjmp .+2486 ; 0xa48 <__bad_interrupt> - 92: 00 00 nop - 94: d9 c4 rjmp .+2482 ; 0xa48 <__bad_interrupt> - 96: 00 00 nop - 98: d7 c4 rjmp .+2478 ; 0xa48 <__bad_interrupt> - 9a: 00 00 nop - 9c: d5 c4 rjmp .+2474 ; 0xa48 <__bad_interrupt> - 9e: 00 00 nop - a0: d3 c4 rjmp .+2470 ; 0xa48 <__bad_interrupt> - a2: 00 00 nop - a4: d1 c4 rjmp .+2466 ; 0xa48 <__bad_interrupt> - a6: 00 00 nop - a8: cf c4 rjmp .+2462 ; 0xa48 <__bad_interrupt> - aa: 00 00 nop - ac: cd c4 rjmp .+2458 ; 0xa48 <__bad_interrupt> - ae: 00 00 nop - b0: cb c4 rjmp .+2454 ; 0xa48 <__bad_interrupt> - b2: 00 00 nop - b4: c9 c4 rjmp .+2450 ; 0xa48 <__bad_interrupt> - b6: 00 00 nop - b8: c7 c4 rjmp .+2446 ; 0xa48 <__bad_interrupt> - ba: 00 00 nop - bc: c5 c4 rjmp .+2442 ; 0xa48 <__bad_interrupt> - be: 00 00 nop - c0: c3 c4 rjmp .+2438 ; 0xa48 <__bad_interrupt> - c2: 00 00 nop - c4: c1 c4 rjmp .+2434 ; 0xa48 <__bad_interrupt> - c6: 00 00 nop - c8: bf c4 rjmp .+2430 ; 0xa48 <__bad_interrupt> - ca: 00 00 nop - cc: bd c4 rjmp .+2426 ; 0xa48 <__bad_interrupt> - ce: 00 00 nop - d0: bb c4 rjmp .+2422 ; 0xa48 <__bad_interrupt> - d2: 00 00 nop - d4: b9 c4 rjmp .+2418 ; 0xa48 <__bad_interrupt> - d6: 00 00 nop - d8: b7 c4 rjmp .+2414 ; 0xa48 <__bad_interrupt> - da: 00 00 nop - dc: b5 c4 rjmp .+2410 ; 0xa48 <__bad_interrupt> - de: 00 00 nop - e0: b3 c4 rjmp .+2406 ; 0xa48 <__bad_interrupt> - e2: 00 00 nop - e4: b1 c4 rjmp .+2402 ; 0xa48 <__bad_interrupt> - e6: 00 00 nop - e8: 0c 94 01 0d jmp 0x1a02 ; 0x1a02 <__vector_58> - ec: ad c4 rjmp .+2394 ; 0xa48 <__bad_interrupt> - ee: 00 00 nop - f0: ab c4 rjmp .+2390 ; 0xa48 <__bad_interrupt> - f2: 00 00 nop - f4: a9 c4 rjmp .+2386 ; 0xa48 <__bad_interrupt> - f6: 00 00 nop - f8: a7 c4 rjmp .+2382 ; 0xa48 <__bad_interrupt> - fa: 00 00 nop - fc: a5 c4 rjmp .+2378 ; 0xa48 <__bad_interrupt> - fe: 00 00 nop - 100: a3 c4 rjmp .+2374 ; 0xa48 <__bad_interrupt> - 102: 00 00 nop - 104: a1 c4 rjmp .+2370 ; 0xa48 <__bad_interrupt> - 106: 00 00 nop - 108: 9f c4 rjmp .+2366 ; 0xa48 <__bad_interrupt> - 10a: 00 00 nop - 10c: 9d c4 rjmp .+2362 ; 0xa48 <__bad_interrupt> - 10e: 00 00 nop - 110: 9b c4 rjmp .+2358 ; 0xa48 <__bad_interrupt> - 112: 00 00 nop - 114: 99 c4 rjmp .+2354 ; 0xa48 <__bad_interrupt> - 116: 00 00 nop - 118: 97 c4 rjmp .+2350 ; 0xa48 <__bad_interrupt> - 11a: 00 00 nop - 11c: 95 c4 rjmp .+2346 ; 0xa48 <__bad_interrupt> - 11e: 00 00 nop - 120: 93 c4 rjmp .+2342 ; 0xa48 <__bad_interrupt> - 122: 00 00 nop - 124: 91 c4 rjmp .+2338 ; 0xa48 <__bad_interrupt> - 126: 00 00 nop - 128: 8f c4 rjmp .+2334 ; 0xa48 <__bad_interrupt> - 12a: 00 00 nop - 12c: 8d c4 rjmp .+2330 ; 0xa48 <__bad_interrupt> - 12e: 00 00 nop - 130: 8b c4 rjmp .+2326 ; 0xa48 <__bad_interrupt> - 132: 00 00 nop - 134: 89 c4 rjmp .+2322 ; 0xa48 <__bad_interrupt> - 136: 00 00 nop - 138: 87 c4 rjmp .+2318 ; 0xa48 <__bad_interrupt> - 13a: 00 00 nop - 13c: 85 c4 rjmp .+2314 ; 0xa48 <__bad_interrupt> - 13e: 00 00 nop - 140: 83 c4 rjmp .+2310 ; 0xa48 <__bad_interrupt> - 142: 00 00 nop - 144: 81 c4 rjmp .+2306 ; 0xa48 <__bad_interrupt> - 146: 00 00 nop - 148: 7f c4 rjmp .+2302 ; 0xa48 <__bad_interrupt> - 14a: 00 00 nop - 14c: 0c 94 16 14 jmp 0x282c ; 0x282c <__vector_83> - 150: 7b c4 rjmp .+2294 ; 0xa48 <__bad_interrupt> - 152: 00 00 nop - 154: 79 c4 rjmp .+2290 ; 0xa48 <__bad_interrupt> - 156: 00 00 nop - 158: 77 c4 rjmp .+2286 ; 0xa48 <__bad_interrupt> - 15a: 00 00 nop - 15c: 75 c4 rjmp .+2282 ; 0xa48 <__bad_interrupt> - 15e: 00 00 nop - 160: 73 c4 rjmp .+2278 ; 0xa48 <__bad_interrupt> - 162: 00 00 nop - 164: 71 c4 rjmp .+2274 ; 0xa48 <__bad_interrupt> - 166: 00 00 nop - 168: 6f c4 rjmp .+2270 ; 0xa48 <__bad_interrupt> - 16a: 00 00 nop - 16c: 6d c4 rjmp .+2266 ; 0xa48 <__bad_interrupt> - 16e: 00 00 nop - 170: 6b c4 rjmp .+2262 ; 0xa48 <__bad_interrupt> - 172: 00 00 nop - 174: 69 c4 rjmp .+2258 ; 0xa48 <__bad_interrupt> - 176: 00 00 nop - 178: 67 c4 rjmp .+2254 ; 0xa48 <__bad_interrupt> - 17a: 00 00 nop - 17c: 65 c4 rjmp .+2250 ; 0xa48 <__bad_interrupt> - 17e: 00 00 nop - 180: 63 c4 rjmp .+2246 ; 0xa48 <__bad_interrupt> - 182: 00 00 nop - 184: 61 c4 rjmp .+2242 ; 0xa48 <__bad_interrupt> - 186: 00 00 nop - 188: 5f c4 rjmp .+2238 ; 0xa48 <__bad_interrupt> - 18a: 00 00 nop - 18c: 5d c4 rjmp .+2234 ; 0xa48 <__bad_interrupt> - 18e: 00 00 nop - 190: 5b c4 rjmp .+2230 ; 0xa48 <__bad_interrupt> - 192: 00 00 nop - 194: 59 c4 rjmp .+2226 ; 0xa48 <__bad_interrupt> - 196: 00 00 nop - 198: 57 c4 rjmp .+2222 ; 0xa48 <__bad_interrupt> - 19a: 00 00 nop - 19c: 55 c4 rjmp .+2218 ; 0xa48 <__bad_interrupt> - 19e: 00 00 nop - 1a0: 53 c4 rjmp .+2214 ; 0xa48 <__bad_interrupt> - 1a2: 00 00 nop - 1a4: 51 c4 rjmp .+2210 ; 0xa48 <__bad_interrupt> - 1a6: 00 00 nop - 1a8: 4f c4 rjmp .+2206 ; 0xa48 <__bad_interrupt> - 1aa: 00 00 nop - 1ac: 4d c4 rjmp .+2202 ; 0xa48 <__bad_interrupt> - 1ae: 00 00 nop - 1b0: 4b c4 rjmp .+2198 ; 0xa48 <__bad_interrupt> - 1b2: 00 00 nop - 1b4: 49 c4 rjmp .+2194 ; 0xa48 <__bad_interrupt> - 1b6: 00 00 nop - 1b8: 47 c4 rjmp .+2190 ; 0xa48 <__bad_interrupt> - 1ba: 00 00 nop - 1bc: 45 c4 rjmp .+2186 ; 0xa48 <__bad_interrupt> - 1be: 00 00 nop - 1c0: 43 c4 rjmp .+2182 ; 0xa48 <__bad_interrupt> - 1c2: 00 00 nop - 1c4: 41 c4 rjmp .+2178 ; 0xa48 <__bad_interrupt> - 1c6: 00 00 nop - 1c8: 3f c4 rjmp .+2174 ; 0xa48 <__bad_interrupt> - 1ca: 00 00 nop - 1cc: 3d c4 rjmp .+2170 ; 0xa48 <__bad_interrupt> - 1ce: 00 00 nop - 1d0: 3b c4 rjmp .+2166 ; 0xa48 <__bad_interrupt> - 1d2: 00 00 nop - 1d4: 39 c4 rjmp .+2162 ; 0xa48 <__bad_interrupt> - 1d6: 00 00 nop - 1d8: 37 c4 rjmp .+2158 ; 0xa48 <__bad_interrupt> - 1da: 00 00 nop - 1dc: 35 c4 rjmp .+2154 ; 0xa48 <__bad_interrupt> - 1de: 00 00 nop - 1e0: 33 c4 rjmp .+2150 ; 0xa48 <__bad_interrupt> - 1e2: 00 00 nop - 1e4: 31 c4 rjmp .+2146 ; 0xa48 <__bad_interrupt> - 1e6: 00 00 nop - 1e8: 2f c4 rjmp .+2142 ; 0xa48 <__bad_interrupt> - 1ea: 00 00 nop - 1ec: 2d c4 rjmp .+2138 ; 0xa48 <__bad_interrupt> - 1ee: 00 00 nop - 1f0: 2b c4 rjmp .+2134 ; 0xa48 <__bad_interrupt> - 1f2: 00 00 nop - 1f4: 0c 94 3f 27 jmp 0x4e7e ; 0x4e7e <__vector_125> - 1f8: 27 c4 rjmp .+2126 ; 0xa48 <__bad_interrupt> - 1fa: 00 00 nop - -000001fc : - 1fc: 1c 03 4c 00 55 00 46 00 41 00 20 00 43 00 44 00 ..L.U.F.A. .C.D. - 20c: 43 00 20 00 44 00 65 00 6d 00 6f 00 00 00 C. .D.e.m.o... - -0000021a : - 21a: 18 03 44 00 65 00 61 00 6e 00 20 00 43 00 61 00 ..D.e.a.n. .C.a. - 22a: 6d 00 65 00 72 00 61 00 00 00 m.e.r.a... - -00000234 : - 234: 04 03 09 04 .... - -00000238 : - 238: 09 02 3e 00 02 01 00 c0 32 09 04 00 00 01 02 02 ..>.....2....... - 248: 01 00 05 24 00 10 01 04 24 02 06 05 24 06 00 01 ...$....$...$... - 258: 07 05 82 03 08 00 ff 09 04 01 00 02 0a 00 00 00 ................ - 268: 07 05 04 02 10 00 05 07 05 83 02 10 00 05 .............. - -00000276 : - 276: 12 01 10 01 02 00 00 08 eb 03 44 20 01 00 01 02 ..........D .... - 286: dc 01 .. - -00000288 : - 288: 02 07 00 00 03 07 04 07 05 07 06 07 07 07 08 07 ................ - 298: 0b 07 0c 07 00 04 04 01 fa 14 00 00 31 15 eb 15 ............1... - 2a8: 07 16 0b 16 07 07 0c 16 32 19 45 19 40 00 07 00 ........2.E.@... - 2b8: fa 14 00 00 31 15 ff 15 07 16 0b 16 07 07 0c 16 ....1........... - 2c8: 32 19 45 19 50 00 07 00 fa 14 00 00 31 15 03 16 2.E.P.......1... - 2d8: 07 16 0b 16 07 07 0c 16 32 19 45 19 a4 00 07 00 ........2.E..... - 2e8: fa 14 00 00 31 15 84 19 a2 19 a6 19 07 07 a7 19 ....1........... - 2f8: 10 1f 2c 1f 00 04 04 00 fa 14 00 00 31 15 93 19 ..,.........1... - 308: a2 19 a6 19 07 07 a7 19 10 1f 2c 1f 00 10 04 00 ..........,..... - 318: fa 14 00 00 31 15 36 22 43 22 a6 19 07 07 c1 20 ....1.6"C"..... - 328: 10 1f 2c 1f 00 04 04 00 ..,..... - -00000330 : - 330: 00 43 4c 4f 53 45 44 00 00 00 00 00 00 00 00 00 .CLOSED......... - 340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 350: 00 01 4d 46 5f 55 4c 54 52 41 4c 49 47 48 54 00 ..MF_ULTRALIGHT. - 360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 370: 00 00 02 4d 46 5f 55 4c 54 52 41 4c 49 47 48 54 ...MF_ULTRALIGHT - 380: 5f 45 56 31 5f 38 30 42 00 00 00 00 00 00 00 00 _EV1_80B........ - 390: 00 00 00 03 4d 46 5f 55 4c 54 52 41 4c 49 47 48 ....MF_ULTRALIGH - 3a0: 54 5f 45 56 31 5f 31 36 34 42 00 00 00 00 00 00 T_EV1_164B...... - 3b0: 00 00 00 00 04 4d 46 5f 43 4c 41 53 53 49 43 5f .....MF_CLASSIC_ - 3c0: 31 4b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1K.............. - 3d0: 00 00 00 00 00 05 4d 46 5f 43 4c 41 53 53 49 43 ......MF_CLASSIC - 3e0: 5f 34 4b 00 00 00 00 00 00 00 00 00 00 00 00 00 _4K............. - 3f0: 00 00 00 00 00 00 06 4d 46 5f 44 45 54 45 43 54 .......MF_DETECT - 400: 49 4f 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 ION............. - 410: 00 00 00 00 00 00 00 ....... - -00000417 : - 417: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 427: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 437: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 447: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 457: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 467: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 477: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 487: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 497: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 4a7: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 4b7: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 4c7: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 4d7: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - 4e7: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 4f7: 00 01 01 00 01 00 00 01 01 00 00 01 00 01 01 00 ................ - 507: 01 00 00 01 00 01 01 00 00 01 01 00 01 00 00 01 ................ - -00000517 : - 517: 00 80 40 c0 20 a0 60 e0 10 90 50 d0 30 b0 70 f0 ..@. .`...P.0.p. - 527: 08 88 48 c8 28 a8 68 e8 18 98 58 d8 38 b8 78 f8 ..H.(.h...X.8.x. - 537: 04 84 44 c4 24 a4 64 e4 14 94 54 d4 34 b4 74 f4 ..D.$.d...T.4.t. - 547: 0c 8c 4c cc 2c ac 6c ec 1c 9c 5c dc 3c bc 7c fc ..L.,.l...\.<.|. - 557: 02 82 42 c2 22 a2 62 e2 12 92 52 d2 32 b2 72 f2 ..B.".b...R.2.r. - 567: 0a 8a 4a ca 2a aa 6a ea 1a 9a 5a da 3a ba 7a fa ..J.*.j...Z.:.z. - 577: 06 86 46 c6 26 a6 66 e6 16 96 56 d6 36 b6 76 f6 ..F.&.f...V.6.v. - 587: 0e 8e 4e ce 2e ae 6e ee 1e 9e 5e de 3e be 7e fe ..N...n...^.>.~. - 597: 01 81 41 c1 21 a1 61 e1 11 91 51 d1 31 b1 71 f1 ..A.!.a...Q.1.q. - 5a7: 09 89 49 c9 29 a9 69 e9 19 99 59 d9 39 b9 79 f9 ..I.).i...Y.9.y. - 5b7: 05 85 45 c5 25 a5 65 e5 15 95 55 d5 35 b5 75 f5 ..E.%.e...U.5.u. - 5c7: 0d 8d 4d cd 2d ad 6d ed 1d 9d 5d dd 3d bd 7d fd ..M.-.m...].=.}. - 5d7: 03 83 43 c3 23 a3 63 e3 13 93 53 d3 33 b3 73 f3 ..C.#.c...S.3.s. - 5e7: 0b 8b 4b cb 2b ab 6b eb 1b 9b 5b db 3b bb 7b fb ..K.+.k...[.;.{. - 5f7: 07 87 47 c7 27 a7 67 e7 17 97 57 d7 37 b7 77 f7 ..G.'.g...W.7.w. - 607: 0f 8f 4f cf 2f af 6f ef 1f 9f 5f df 3f bf 7f ff ..O./.o..._.?... - -00000617 : - 617: 43 4c 4f 53 45 44 00 00 00 00 00 00 00 00 00 00 CLOSED.......... - 627: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 637: 52 41 4e 44 4f 4d 5f 55 49 44 00 00 00 00 00 00 RANDOM_UID...... - 647: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 657: 55 49 44 5f 4c 45 46 54 5f 49 4e 43 52 45 4d 45 UID_LEFT_INCREME - 667: 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 NT.............. - 677: 55 49 44 5f 52 49 47 48 54 5f 49 4e 43 52 45 4d UID_RIGHT_INCREM - 687: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. - 697: 55 49 44 5f 4c 45 46 54 5f 44 45 43 52 45 4d 45 UID_LEFT_DECREME - 6a7: 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 NT.............. - 6b7: 55 49 44 5f 52 49 47 48 54 5f 44 45 43 52 45 4d UID_RIGHT_DECREM - 6c7: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. - 6d7: 53 57 49 54 43 48 43 41 52 44 00 00 00 00 00 00 SWITCHCARD...... - 6e7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - -000006f7 <__c.6795>: - 6f7: 25 30 32 78 25 30 32 78 25 30 32 78 25 30 32 78 %02x%02x%02x%02x - 707: 00 . - -00000708 <__c.6789>: - 708: 25 35 75 20 6d 56 00 %5u mV. - -0000070f <__c.6738>: - 70f: 25 75 00 %u. - -00000712 <__c.6733>: - 712: 25 75 00 %u. - -00000715 <__c.6705>: - 715: 52 41 4e 44 4f 4d 4d 59 00 RANDOMMY. - -0000071e <__c.6682>: - 71e: 43 68 61 6d 65 6c 65 6f 6e 2d 6e 65 77 2d 31 2e Chameleon-new-1. - 72e: 30 00 0. - -00000730 <__c.6671>: - 730: 0d 0a 00 ... - -00000733 <__c.6659>: - 733: 0d 0a 00 ... - -00000736 <__c.6657>: - 736: 0d 0a 00 ... - -00000739 <__c.6645>: - 739: 0d 0a 00 ... - -0000073c <__c.6634>: - 73c: 0d 0a 00 ... - -0000073f <__c.6632>: - 73f: 0d 0a 00 ... - -00000742 : - 742: 64 31 30 30 3a 4f 4b 00 00 00 00 00 00 00 00 00 d100:OK......... - 752: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 762: 00 65 31 30 31 3a 4f 4b 20 57 49 54 48 20 54 45 .e101:OK WITH TE - 772: 58 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XT.............. - 782: 00 00 6e 31 31 30 3a 57 41 49 54 49 4e 47 20 46 ..n110:WAITING F - 792: 4f 52 20 58 4d 4f 44 45 4d 00 00 00 00 00 00 00 OR XMODEM....... - 7a2: 00 00 00 c8 32 30 30 3a 55 4e 4b 4e 4f 57 4e 20 ....200:UNKNOWN - 7b2: 43 4f 4d 4d 41 4e 44 00 00 00 00 00 00 00 00 00 COMMAND......... - 7c2: 00 00 00 00 c9 32 30 31 3a 49 4e 56 41 4c 49 44 .....201:INVALID - 7d2: 20 43 4f 4d 4d 41 4e 44 20 55 53 41 47 45 00 00 COMMAND USAGE.. - 7e2: 00 00 00 00 00 ca 32 30 32 3a 49 4e 56 41 4c 49 ......202:INVALI - 7f2: 44 20 50 41 52 41 4d 45 54 45 52 00 00 00 00 00 D PARAMETER..... - 802: 00 00 00 00 00 00 ...... - -00000808 : - 808: 56 45 52 53 49 4f 4e 4d 59 00 00 00 00 00 00 00 VERSIONMY....... - 818: 00 00 00 00 00 00 a1 0d 43 4f 4e 46 49 47 4d 59 ........CONFIGMY - 828: 00 00 00 00 00 00 00 00 c2 0d 00 00 b9 0d b4 0d ................ - 838: 55 49 44 4d 59 00 00 00 00 00 00 00 00 00 00 00 UIDMY........... - 848: 00 00 00 00 f0 0d c7 0d 52 45 41 44 4f 4e 4c 59 ........READONLY - 858: 4d 59 00 00 00 00 00 00 00 00 00 00 41 0e 35 0e MY..........A.5. - 868: 55 50 4c 4f 41 44 4d 59 00 00 00 00 00 00 00 00 UPLOADMY........ - 878: 54 0e 00 00 00 00 00 00 44 4f 57 4e 4c 4f 41 44 T.......DOWNLOAD - 888: 4d 59 00 00 00 00 00 00 59 0e 00 00 00 00 00 00 MY......Y....... - 898: 52 45 53 45 54 4d 59 00 00 00 00 00 00 00 00 00 RESETMY......... - 8a8: 5e 0e 00 00 00 00 00 00 55 50 47 52 41 44 45 4d ^.......UPGRADEM - 8b8: 59 00 00 00 00 00 00 00 68 0e 00 00 00 00 00 00 Y.......h....... - 8c8: 4d 45 4d 53 49 5a 45 4d 59 00 00 00 00 00 00 00 MEMSIZEMY....... - 8d8: 00 00 00 00 00 00 72 0e 55 49 44 53 49 5a 45 4d ......r.UIDSIZEM - 8e8: 59 00 00 00 00 00 00 00 00 00 00 00 00 00 8a 0e Y............... - 8f8: 42 55 54 54 4f 4e 4d 59 00 00 00 00 00 00 00 00 BUTTONMY........ - 908: a0 0e 00 00 ac 0e a5 0e 42 55 54 54 4f 4e 5f 4c ........BUTTON_L - 918: 4f 4e 47 4d 59 00 00 00 b5 0e 00 00 c1 0e ba 0e ONGMY........... - 928: 53 45 54 54 49 4e 47 4d 59 00 00 00 00 00 00 00 SETTINGMY....... - 938: 00 00 00 00 cf 0e ca 0e 43 4c 45 41 52 4d 59 00 ........CLEARMY. - 948: 00 00 00 00 00 00 00 00 d8 0e 00 00 00 00 00 00 ................ - 958: 48 45 4c 50 4d 59 00 00 00 00 00 00 00 00 00 00 HELPMY.......... - 968: db 0e 00 00 00 00 00 00 52 53 53 49 4d 59 00 00 ........RSSIMY.. - 978: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 0f ................ - 988: 50 57 44 4d 59 00 00 00 00 00 00 00 00 00 00 00 PWDMY........... - 998: 00 00 00 00 00 00 46 0f 44 45 54 45 43 54 49 4f ......F.DETECTIO - 9a8: 4e 4d 59 00 00 00 00 00 00 00 00 00 00 10 ca 0f NMY............. - 9b8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 9c8: 00 00 00 00 00 00 00 00 ........ - -000009d0 : - 9d0: 00 00 00 01 01 01 00 00 01 00 00 01 01 00 01 01 ................ - 9e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - -000009f0 : - 9f0: 00 00 01 01 00 01 00 00 00 01 00 00 01 01 01 01 ................ - a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - -00000a10 <__ctors_end>: - a10: 11 24 eor r1, r1 - a12: 1f be out 0x3f, r1 ; 63 - a14: cf ef ldi r28, 0xFF ; 255 - a16: cd bf out 0x3d, r28 ; 61 - a18: df e2 ldi r29, 0x2F ; 47 - a1a: de bf out 0x3e, r29 ; 62 - -00000a1c <__do_copy_data>: - a1c: 10 e2 ldi r17, 0x20 ; 32 - a1e: a0 e0 ldi r26, 0x00 ; 0 - a20: b0 e2 ldi r27, 0x20 ; 32 - a22: ec e6 ldi r30, 0x6C ; 108 - a24: fb e5 ldi r31, 0x5B ; 91 - a26: 02 c0 rjmp .+4 ; 0xa2c <__do_copy_data+0x10> - a28: 05 90 lpm r0, Z+ - a2a: 0d 92 st X+, r0 - a2c: ac 34 cpi r26, 0x4C ; 76 - a2e: b1 07 cpc r27, r17 - a30: d9 f7 brne .-10 ; 0xa28 <__do_copy_data+0xc> - -00000a32 <__do_clear_bss>: - a32: 26 e2 ldi r18, 0x26 ; 38 - a34: ac e4 ldi r26, 0x4C ; 76 - a36: b0 e2 ldi r27, 0x20 ; 32 - a38: 01 c0 rjmp .+2 ; 0xa3c <.do_clear_bss_start> - -00000a3a <.do_clear_bss_loop>: - a3a: 1d 92 st X+, r1 - -00000a3c <.do_clear_bss_start>: - a3c: a7 3e cpi r26, 0xE7 ; 231 - a3e: b2 07 cpc r27, r18 - a40: e1 f7 brne .-8 ; 0xa3a <.do_clear_bss_loop> - a42: f3 d0 rcall .+486 ; 0xc2a
- a44: 0c 94 b4 2d jmp 0x5b68 ; 0x5b68 <_exit> - -00000a48 <__bad_interrupt>: - a48: 68 c1 rjmp .+720 ; 0xd1a <__vector_default> - -00000a4a : -.global Crypto1FilterOutput -.global Crypto1Bit -.global Crypto1Proceed - -Crypto1FilterOutput: ; sped up filter function for crypto1 - push r18 - a4a: 2f 93 push r18 - push r17 ; push registers we want to use - these need to be preserved, try and switch to better ones later - a4c: 1f 93 push r17 - push r16 - a4e: 0f 93 push r16 - lds r22, StateOdd - a50: 60 91 56 23 lds r22, 0x2356 ; 0x802356 - lds r23, StateOdd+1 - a54: 70 91 57 23 lds r23, 0x2357 ; 0x802357 - lds r24, StateOdd+2 - a58: 80 91 58 23 lds r24, 0x2358 ; 0x802358 - mov r21, r22 ; set up each shift value into register - a5c: 56 2f mov r21, r22 - andi r22, 0xf - a5e: 6f 70 andi r22, 0x0F ; 15 - mov r20, r23 - a60: 47 2f mov r20, r23 - andi r23, 0xf - a62: 7f 70 andi r23, 0x0F ; 15 - andi r24, 0xf - a64: 8f 70 andi r24, 0x0F ; 15 - swap r21 - a66: 52 95 swap r21 - andi r21, 0x0f - a68: 5f 70 andi r21, 0x0F ; 15 - swap r20 - a6a: 42 95 swap r20 - andi r20, 0x0f - a6c: 4f 70 andi r20, 0x0F ; 15 - ldi r17, 0x0a ; set shift constant 0xEC57E80A - not using reserved registers to save push and pop cycles hence the weird choices - a6e: 1a e0 ldi r17, 0x0A ; 10 - ldi r16, 0xe8 - a70: 08 ee ldi r16, 0xE8 ; 232 - ldi r27, 0x57 - a72: b7 e5 ldi r27, 0x57 ; 87 - ldi r26, 0xec - a74: ac ee ldi r26, 0xEC ; 236 - ldi ZH, hi8(TableA) ; set up first space for lookup - a76: f9 e0 ldi r31, 0x09 ; 9 - ldi ZL, lo8(TableA) - a78: e0 ef ldi r30, 0xF0 ; 240 - add ZL, r22 - a7a: e6 0f add r30, r22 - adc ZH, r1 - a7c: f1 1d adc r31, r1 - lpm r22, Z - a7e: 64 91 lpm r22, Z - cpi r22, 0 - a80: 60 30 cpi r22, 0x00 ; 0 - breq Crypto1FilterOutputEndShiftSixteenBit - a82: 11 f0 breq .+4 ; 0xa88 - mov r16, r26 ; this will shift 16 bits in two operations rather than the ton it usually takes - a84: 0a 2f mov r16, r26 - mov r17, r27 - a86: 1b 2f mov r17, r27 - -00000a88 : -Crypto1FilterOutputEndShiftSixteenBit: - ldi ZH, hi8(TableB) ; set up first space for lookup - a88: f9 e0 ldi r31, 0x09 ; 9 - ldi ZL, lo8(TableB) - a8a: e0 ed ldi r30, 0xD0 ; 208 - add ZL, r21 - a8c: e5 0f add r30, r21 - adc ZH, r1 - a8e: f1 1d adc r31, r1 - lpm r21, Z - a90: 54 91 lpm r21, Z - cpi r21, 0 - a92: 50 30 cpi r21, 0x00 ; 0 - breq Crypto1FilterOutputEndShiftEightBit - a94: 09 f0 breq .+2 ; 0xa98 - mov r17, r16 - a96: 10 2f mov r17, r16 - -00000a98 : -Crypto1FilterOutputEndShiftEightBit: - ldi ZH, hi8(TableA) ; set up first space for lookup - a98: f9 e0 ldi r31, 0x09 ; 9 - ldi ZL, lo8(TableA) - a9a: e0 ef ldi r30, 0xF0 ; 240 - add ZL, r23 - a9c: e7 0f add r30, r23 - adc ZH, r1 - a9e: f1 1d adc r31, r1 - lpm r23, Z - aa0: 74 91 lpm r23, Z - cpi r23, 0 - aa2: 70 30 cpi r23, 0x00 ; 0 - breq Crypto1FilterOutputEndShiftFourBit - aa4: 11 f0 breq .+4 ; 0xaaa - swap r17 - aa6: 12 95 swap r17 - andi r17, 0x0f ; may not be necessary - aa8: 1f 70 andi r17, 0x0F ; 15 - -00000aaa : -Crypto1FilterOutputEndShiftFourBit: - ldi ZH, hi8(TableA) - aaa: f9 e0 ldi r31, 0x09 ; 9 - ldi ZL, lo8(TableA) - aac: e0 ef ldi r30, 0xF0 ; 240 - add ZL, r20 - aae: e4 0f add r30, r20 - adc ZH, r1 - ab0: f1 1d adc r31, r1 - lpm r20, Z - ab2: 44 91 lpm r20, Z - cpi r20, 0 ; if its zero, skip - ab4: 40 30 cpi r20, 0x00 ; 0 - breq Crypto1FilterOutputEndShiftTwoBit - ab6: 11 f0 breq .+4 ; 0xabc - lsr r17 - ab8: 16 95 lsr r17 - lsr r17 - aba: 16 95 lsr r17 - -00000abc : -Crypto1FilterOutputEndShiftTwoBit: - ldi ZH, hi8(TableB) - abc: f9 e0 ldi r31, 0x09 ; 9 - ldi ZL, lo8(TableB) - abe: e0 ed ldi r30, 0xD0 ; 208 - add ZL, r24 - ac0: e8 0f add r30, r24 - adc ZH, r1 - ac2: f1 1d adc r31, r1 - lpm r24, Z - ac4: 84 91 lpm r24, Z - cpi r24, 0 - ac6: 80 30 cpi r24, 0x00 ; 0 - breq Crypto1FilterOutputEndShiftOneBit - ac8: 09 f0 breq .+2 ; 0xacc - lsr r17 - aca: 16 95 lsr r17 - -00000acc : -Crypto1FilterOutputEndShiftOneBit: - andi r17, 0x01 - acc: 11 70 andi r17, 0x01 ; 1 - mov r24, r17 - ace: 81 2f mov r24, r17 - pop r16 - ad0: 0f 91 pop r16 - pop r17 - ad2: 1f 91 pop r17 - pop r18 - ad4: 2f 91 pop r18 - ret - ad6: 08 95 ret - -00000ad8 : - -Crypto1Proceed: - # 16 bit shift - eor r22, r24 - ad8: 68 27 eor r22, r24 - # 8 bit shift - eor r22, r23 - ada: 67 27 eor r22, r23 - # 4 bit shift - mov r23, r22 - adc: 76 2f mov r23, r22 - swap r23 - ade: 72 95 swap r23 - eor r22, r23 - ae0: 67 27 eor r22, r23 - andi r22, 0x0f - ae2: 6f 70 andi r22, 0x0F ; 15 - # load shift value - endianness different to above to save an operation - ldi r24, 0x96 - ae4: 86 e9 ldi r24, 0x96 ; 150 - ldi r23, 0x69 - ae6: 79 e6 ldi r23, 0x69 ; 105 - # shift value loop - cpi r22, 0 ; if its zero, skip - ae8: 60 30 cpi r22, 0x00 ; 0 - breq Crypto1ProceedSixteenBitShiftDone - aea: 29 f0 breq .+10 ; 0xaf6 - -00000aec : -Crypto1ProceedSixteenBitShiftCheck: - lsr r23 - aec: 76 95 lsr r23 - ror r24 - aee: 87 95 ror r24 - dec r22 - af0: 6a 95 dec r22 - cpi r22, 0 - af2: 60 30 cpi r22, 0x00 ; 0 - brne Crypto1ProceedSixteenBitShiftCheck - af4: d9 f7 brne .-10 ; 0xaec - -00000af6 : -Crypto1ProceedSixteenBitShiftDone: - andi r24, 0x01 - af6: 81 70 andi r24, 0x01 ; 1 - ret - af8: 08 95 ret - -00000afa : - -Crypto1Bit: - push r24 ; first param - afa: 8f 93 push r24 - push r22 ; second param - afc: 6f 93 push r22 - lds r22, (StateOdd) - afe: 60 91 56 23 lds r22, 0x2356 ; 0x802356 - lds r23, (StateOdd+1) - b02: 70 91 57 23 lds r23, 0x2357 ; 0x802357 - lds r24, (StateOdd+2) - b06: 80 91 58 23 lds r24, 0x2358 ; 0x802358 - rcall Crypto1FilterOutput - b0a: 9f df rcall .-194 ; 0xa4a - mov r25, r24 ; r25 contains filter output - r30 and r31 upper bits for calculations - b0c: 98 2f mov r25, r24 - mov r0, r24 - b0e: 08 2e mov r0, r24 - ldi r30, 0x00 - b10: e0 e0 ldi r30, 0x00 ; 0 - ldi r31, 0x00 - b12: f0 e0 ldi r31, 0x00 ; 0 - lds r18, (StateEven) - b14: 20 91 52 23 lds r18, 0x2352 ; 0x802352 - lds r19, (StateEven+1) - b18: 30 91 53 23 lds r19, 0x2353 ; 0x802353 - lds r20, (StateEven+2) - b1c: 40 91 54 23 lds r20, 0x2354 ; 0x802354 - lds r22, (StateOdd) - b20: 60 91 56 23 lds r22, 0x2356 ; 0x802356 - lds r23, (StateOdd+1) - b24: 70 91 57 23 lds r23, 0x2357 ; 0x802357 - lds r24, (StateOdd+2) - b28: 80 91 58 23 lds r24, 0x2358 ; 0x802358 - pop r26 ; second param - b2c: af 91 pop r26 - pop r27 ; first param - b2e: bf 91 pop r27 - - and r25, r26 - b30: 9a 23 and r25, r26 - eor r25, r27 - b32: 9b 27 eor r25, r27 - - push r16 - b34: 0f 93 push r16 - ; and xor state 1 with 0x29CE5C - ldi r16, 0x5c - b36: 0c e5 ldi r16, 0x5C ; 92 - and r22, r16 - b38: 60 23 and r22, r16 - ldi r16, 0xce - b3a: 0e ec ldi r16, 0xCE ; 206 - and r23, r16 - b3c: 70 23 and r23, r16 - ldi r16, 0x29 - b3e: 09 e2 ldi r16, 0x29 ; 41 - and r24, r16 - b40: 80 23 and r24, r16 - eor r25, r22 - b42: 96 27 eor r25, r22 - eor r30, r23 - b44: e7 27 eor r30, r23 - eor r31, r24 - b46: f8 27 eor r31, r24 - - ; and xor state 0 with 0x0x870804 - ldi r16, 0x04 - b48: 04 e0 ldi r16, 0x04 ; 4 - and r18, r16 - b4a: 20 23 and r18, r16 - ldi r16, 0x08 - b4c: 08 e0 ldi r16, 0x08 ; 8 - and r19, r16 - b4e: 30 23 and r19, r16 - ldi r16, 0x87 - b50: 07 e8 ldi r16, 0x87 ; 135 - and r20, r16 - b52: 40 23 and r20, r16 - - eor r25, r18 - b54: 92 27 eor r25, r18 - eor r30, r19 - b56: e3 27 eor r30, r19 - eor r31, r20 - b58: f4 27 eor r31, r20 - - ; reload again, seriously need to improve this - lds r18, (StateEven) - b5a: 20 91 52 23 lds r18, 0x2352 ; 0x802352 - lds r19, (StateEven+1) - b5e: 30 91 53 23 lds r19, 0x2353 ; 0x802353 - lds r20, (StateEven+2) - b62: 40 91 54 23 lds r20, 0x2354 ; 0x802354 - - lsl r18 - b66: 22 0f add r18, r18 - rol r19 - b68: 33 1f adc r19, r19 - rol r20 - b6a: 44 1f adc r20, r20 - - ; use parity function - r22,r23,r24 - push r24 - b6c: 8f 93 push r24 - push r23 - b6e: 7f 93 push r23 - push r22 - b70: 6f 93 push r22 - mov r22, r25 - b72: 69 2f mov r22, r25 - mov r23, r30 - b74: 7e 2f mov r23, r30 - mov r24, r31 - b76: 8f 2f mov r24, r31 - rcall Crypto1Proceed - b78: af df rcall .-162 ; 0xad8 - mov r16, r24 - b7a: 08 2f mov r16, r24 - pop r22 - b7c: 6f 91 pop r22 - pop r23 - b7e: 7f 91 pop r23 - pop r24 - b80: 8f 91 pop r24 - or r18,r16 - b82: 20 2b or r18, r16 - pop r16 - b84: 0f 91 pop r16 - lds r22, (StateOdd) - b86: 60 91 56 23 lds r22, 0x2356 ; 0x802356 - lds r23, (StateOdd+1) - b8a: 70 91 57 23 lds r23, 0x2357 ; 0x802357 - lds r24, (StateOdd+2) - b8e: 80 91 58 23 lds r24, 0x2358 ; 0x802358 - - ; store in opposite registers - sts (StateEven), r22 - b92: 60 93 52 23 sts 0x2352, r22 ; 0x802352 - sts (StateEven+1), r23 - b96: 70 93 53 23 sts 0x2353, r23 ; 0x802353 - sts (StateEven+2), r24 - b9a: 80 93 54 23 sts 0x2354, r24 ; 0x802354 - - sts(StateOdd), r18 - b9e: 20 93 56 23 sts 0x2356, r18 ; 0x802356 - sts(StateOdd+1), r19 - ba2: 30 93 57 23 sts 0x2357, r19 ; 0x802357 - sts(StateOdd+2), r20 - ba6: 40 93 58 23 sts 0x2358, r20 ; 0x802358 - - mov r24, r0 - baa: 80 2d mov r24, r0 - bac: 08 95 ret - -00000bae : - LED_LOW_PORT.OUTSET = Mask; -} - -static inline -void CARDHEIGHSetOff(uint8_t Mask) { - LED_HEIGH_PORT.OUTCLR = Mask; - bae: 60 e2 ldi r22, 0x20 ; 32 - bb0: 60 93 06 06 sts 0x0606, r22 ; 0x800606 <__TEXT_REGION_LENGTH__+0x700606> - bb4: 50 e1 ldi r21, 0x10 ; 16 - bb6: 50 93 06 06 sts 0x0606, r21 ; 0x800606 <__TEXT_REGION_LENGTH__+0x700606> - bba: 28 e0 ldi r18, 0x08 ; 8 - bbc: 20 93 06 06 sts 0x0606, r18 ; 0x800606 <__TEXT_REGION_LENGTH__+0x700606> - bc0: 94 e0 ldi r25, 0x04 ; 4 - bc2: 90 93 06 06 sts 0x0606, r25 ; 0x800606 <__TEXT_REGION_LENGTH__+0x700606> -} - -static inline -void CARDLOWSetOff(uint8_t Mask) { - LED_LOW_PORT.OUTCLR = Mask; - bc6: 20 93 86 06 sts 0x0686, r18 ; 0x800686 <__TEXT_REGION_LENGTH__+0x700686> - bca: 90 93 86 06 sts 0x0686, r25 ; 0x800686 <__TEXT_REGION_LENGTH__+0x700686> - bce: 42 e0 ldi r20, 0x02 ; 2 - bd0: 40 93 86 06 sts 0x0686, r20 ; 0x800686 <__TEXT_REGION_LENGTH__+0x700686> - bd4: 31 e0 ldi r19, 0x01 ; 1 - bd6: 30 93 86 06 sts 0x0686, r19 ; 0x800686 <__TEXT_REGION_LENGTH__+0x700686> - CARDLOWSetOff(LED_FIVE); - CARDLOWSetOff(LED_SIX); - CARDLOWSetOff(LED_SEVEN); - CARDLOWSetOff(LED_EIGHT); - - switch(GlobalSettings.ActiveSetting) { - bda: 80 91 00 20 lds r24, 0x2000 ; 0x802000 - bde: 83 30 cpi r24, 0x03 ; 3 - be0: a9 f0 breq .+42 ; 0xc0c - be2: 30 f4 brcc .+12 ; 0xbf0 - be4: 81 30 cpi r24, 0x01 ; 1 - be6: 61 f0 breq .+24 ; 0xc00 - be8: 70 f4 brcc .+28 ; 0xc06 - LED_LOW_PORT.DIRSET = LED_LOW_MASK; -} - -static inline -void CARDHEIGHSetOn(uint8_t Mask) { - LED_HEIGH_PORT.OUTSET = Mask; - bea: 60 93 05 06 sts 0x0605, r22 ; 0x800605 <__TEXT_REGION_LENGTH__+0x700605> - bee: 08 95 ret - bf0: 85 30 cpi r24, 0x05 ; 5 - bf2: 91 f0 breq .+36 ; 0xc18 - bf4: 70 f0 brcs .+28 ; 0xc12 - bf6: 86 30 cpi r24, 0x06 ; 6 - bf8: 91 f0 breq .+36 ; 0xc1e - bfa: 87 30 cpi r24, 0x07 ; 7 - bfc: 99 f0 breq .+38 ; 0xc24 - bfe: 08 95 ret - c00: 50 93 05 06 sts 0x0605, r21 ; 0x800605 <__TEXT_REGION_LENGTH__+0x700605> - c04: 08 95 ret - c06: 20 93 05 06 sts 0x0605, r18 ; 0x800605 <__TEXT_REGION_LENGTH__+0x700605> - c0a: 08 95 ret - c0c: 90 93 05 06 sts 0x0605, r25 ; 0x800605 <__TEXT_REGION_LENGTH__+0x700605> - c10: 08 95 ret -} - -static inline -void CARDLOWSetOn(uint8_t Mask) { - LED_LOW_PORT.OUTSET = Mask; - c12: 20 93 85 06 sts 0x0685, r18 ; 0x800685 <__TEXT_REGION_LENGTH__+0x700685> - c16: 08 95 ret - c18: 90 93 85 06 sts 0x0685, r25 ; 0x800685 <__TEXT_REGION_LENGTH__+0x700685> - c1c: 08 95 ret - c1e: 40 93 85 06 sts 0x0685, r20 ; 0x800685 <__TEXT_REGION_LENGTH__+0x700685> - c22: 08 95 ret - c24: 30 93 85 06 sts 0x0685, r19 ; 0x800685 <__TEXT_REGION_LENGTH__+0x700685> - c28: 08 95 ret - -00000c2a
: - default: break; - } -} - -int main(void) { - SystemInit(); - c2a: 7d d0 rcall .+250 ; 0xd26 - MemoryInit(); - c2c: e6 d1 rcall .+972 ; 0xffa - SettingsLoad(); - c2e: 18 d6 rcall .+3120 ; 0x1860 - -extern uint8_t LEDHighPulseMask, LEDLowPulseMask; - -static inline -void LEDInit(void) { - LED_LOW_PORT.DIRSET = LED_LOW_MASK; - c30: 8f e0 ldi r24, 0x0F ; 15 - c32: 80 93 81 06 sts 0x0681, r24 ; 0x800681 <__TEXT_REGION_LENGTH__+0x700681> - LED_HEIGH_PORT.DIRSET = LED_HEIGH_MASK; - c36: 9c e3 ldi r25, 0x3C ; 60 - c38: 90 93 01 06 sts 0x0601, r25 ; 0x800601 <__TEXT_REGION_LENGTH__+0x700601> - LEDHighPulseMask = 0; -} - -static inline -void CARDInit(void) { - LED_HEIGH_PORT.DIRSET = LED_HEIGH_MASK; - c3c: 90 93 01 06 sts 0x0601, r25 ; 0x800601 <__TEXT_REGION_LENGTH__+0x700601> - LED_LOW_PORT.DIRSET = LED_LOW_MASK; - c40: 80 93 81 06 sts 0x0681, r24 ; 0x800681 <__TEXT_REGION_LENGTH__+0x700681> - LEDInit(); - CARDInit(); - ConfigurationInit(); - c44: 07 d1 rcall .+526 ; 0xe54 - TerminalInit(); - c46: 1e d7 rcall .+3644 ; 0x1a84 - RandomInit(); - c48: 42 d1 rcall .+644 ; 0xece - ButtonInit(); - c4a: 67 d5 rcall .+2766 ; 0x171a -#define ANTENNA_LEVEL_NUMERATOR ((uint32_t) (ANTENNA_LEVEL_MILLIVOLT * ANTENNA_LEVEL_FACTOR * ANTENNA_LEVEL_SCALE + .5)) -#define ANTENNA_LEVEL_DENOMINATOR (ANTENNA_LEVEL_SCALE) - -static inline void AntennaLevelInit(void) -{ - ADCA.CTRLA = ADC_ENABLE_bm; - c4c: 81 e0 ldi r24, 0x01 ; 1 - c4e: 80 93 00 02 sts 0x0200, r24 ; 0x800200 <__TEXT_REGION_LENGTH__+0x700200> - ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc; - c52: 10 92 01 02 sts 0x0201, r1 ; 0x800201 <__TEXT_REGION_LENGTH__+0x700201> - ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm; - c56: 92 e0 ldi r25, 0x02 ; 2 - c58: 90 93 02 02 sts 0x0202, r25 ; 0x800202 <__TEXT_REGION_LENGTH__+0x700202> - ADCA.PRESCALER = ADC_PRESCALER_DIV32_gc; - c5c: 93 e0 ldi r25, 0x03 ; 3 - c5e: 90 93 04 02 sts 0x0204, r25 ; 0x800204 <__TEXT_REGION_LENGTH__+0x700204> - ADCA.CH0.CTRL = ADC_CH_INPUTMODE_SINGLEENDED_gc; - c62: 80 93 20 02 sts 0x0220, r24 ; 0x800220 <__TEXT_REGION_LENGTH__+0x700220> - ADCA.CH0.MUXCTRL = ADC_CH_MUXPOS_PIN7_gc; - c66: 88 e3 ldi r24, 0x38 ; 56 - c68: 80 93 21 02 sts 0x0221, r24 ; 0x800221 <__TEXT_REGION_LENGTH__+0x700221> - AntennaLevelInit(); - SystemInterruptInit(); - c6c: c6 d0 rcall .+396 ; 0xdfa - led_mode(); - c6e: 9f df rcall .-194 ; 0xbae -} - -INLINE bool SystemTick100ms(void) -{ - if (TCE0.INTFLAGS & TC0_OVFIF_bm) { - TCE0.INTFLAGS = TC0_OVFIF_bm; - c70: c1 e0 ldi r28, 0x01 ; 1 - - while(1) { - TerminalTask(); - c72: 0c d7 rcall .+3608 ; 0x1a8c -INLINE void CodecInit(void) { - ActiveConfiguration.CodecInitFunc(); -} - -INLINE void CodecTask(void) { - ActiveConfiguration.CodecTaskFunc(); - c74: e0 91 3e 21 lds r30, 0x213E ; 0x80213e - c78: f0 91 3f 21 lds r31, 0x213F ; 0x80213f - c7c: 09 95 icall -INLINE void ApplicationInit(void) { - ActiveConfiguration.ApplicationInitFunc(); -} - -INLINE void ApplicationTask(void) { - ActiveConfiguration.ApplicationTaskFunc(); - c7e: e0 91 44 21 lds r30, 0x2144 ; 0x802144 - c82: f0 91 45 21 lds r31, 0x2145 ; 0x802145 - c86: 09 95 icall - return RTC.CNT; -} - -INLINE bool SystemTick100ms(void) -{ - if (TCE0.INTFLAGS & TC0_OVFIF_bm) { - c88: 80 91 0c 0a lds r24, 0x0A0C ; 0x800a0c <__TEXT_REGION_LENGTH__+0x700a0c> - c8c: 80 ff sbrs r24, 0 - c8e: f1 cf rjmp .-30 ; 0xc72 - TCE0.INTFLAGS = TC0_OVFIF_bm; - c90: c0 93 0c 0a sts 0x0A0C, r28 ; 0x800a0c <__TEXT_REGION_LENGTH__+0x700a0c> - CodecTask(); - ApplicationTask(); - - if (SystemTick100ms()) { - RandomTick(); - c94: 31 d1 rcall .+610 ; 0xef8 - TerminalTick(); - c96: 13 d7 rcall .+3622 ; 0x1abe - ButtonTick(); - c98: 47 d5 rcall .+2702 ; 0x1728 - led_mode(); - c9a: 89 df rcall .-238 ; 0xbae - LED_LOW_PORT.OUTSET = Mask; -} - -static inline -void LEDTick(void) { - LED_HEIGH_PORT.OUTCLR = LEDLowPulseMask; - c9c: 80 91 4e 20 lds r24, 0x204E ; 0x80204e - ca0: 80 93 06 06 sts 0x0606, r24 ; 0x800606 <__TEXT_REGION_LENGTH__+0x700606> - LEDLowPulseMask = 0; - ca4: 10 92 4e 20 sts 0x204E, r1 ; 0x80204e - LED_LOW_PORT.OUTCLR = LEDHighPulseMask; - ca8: 80 91 4d 20 lds r24, 0x204D ; 0x80204d - cac: 80 93 86 06 sts 0x0686, r24 ; 0x800686 <__TEXT_REGION_LENGTH__+0x700686> - LEDHighPulseMask = 0; - cb0: 10 92 4d 20 sts 0x204D, r1 ; 0x80204d - cb4: de cf rjmp .-68 ; 0xc72 - -00000cb6 : - */ -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress) -{ - const uint8_t DescriptorType = (wValue >> 8); - cb6: 29 2f mov r18, r25 - cb8: 33 27 eor r19, r19 - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - cba: 22 30 cpi r18, 0x02 ; 2 - cbc: 31 05 cpc r19, r1 - cbe: 59 f0 breq .+22 ; 0xcd6 - cc0: 23 30 cpi r18, 0x03 ; 3 - cc2: 31 05 cpc r19, r1 - cc4: 69 f0 breq .+26 ; 0xce0 - cc6: 21 30 cpi r18, 0x01 ; 1 - cc8: 31 05 cpc r19, r1 - cca: f9 f4 brne .+62 ; 0xd0a - { - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - ccc: 82 e1 ldi r24, 0x12 ; 18 - cce: 90 e0 ldi r25, 0x00 ; 0 - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - { - case DTYPE_Device: - Address = &DeviceDescriptor; - cd0: 26 e7 ldi r18, 0x76 ; 118 - cd2: 32 e0 ldi r19, 0x02 ; 2 - cd4: 1e c0 rjmp .+60 ; 0xd12 - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - Size = sizeof(USB_Descriptor_Configuration_t); - cd6: 8e e3 ldi r24, 0x3E ; 62 - cd8: 90 e0 ldi r25, 0x00 ; 0 - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - cda: 28 e3 ldi r18, 0x38 ; 56 - cdc: 32 e0 ldi r19, 0x02 ; 2 - Size = sizeof(USB_Descriptor_Configuration_t); - break; - cde: 19 c0 rjmp .+50 ; 0xd12 - ce0: 99 27 eor r25, r25 - case DTYPE_String: - switch (DescriptorNumber) - ce2: 81 30 cpi r24, 0x01 ; 1 - ce4: 91 05 cpc r25, r1 - ce6: 41 f0 breq .+16 ; 0xcf8 - ce8: 82 30 cpi r24, 0x02 ; 2 - cea: 91 05 cpc r25, r1 - cec: 41 f0 breq .+16 ; 0xcfe - cee: 89 2b or r24, r25 - cf0: 61 f4 brne .+24 ; 0xd0a - { - case 0x00: - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - cf2: e4 e3 ldi r30, 0x34 ; 52 - cf4: f2 e0 ldi r31, 0x02 ; 2 - cf6: 05 c0 rjmp .+10 ; 0xd02 - break; - case 0x01: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - cf8: ea e1 ldi r30, 0x1A ; 26 - cfa: f2 e0 ldi r31, 0x02 ; 2 - cfc: 02 c0 rjmp .+4 ; 0xd02 - break; - case 0x02: - Address = &ProductString; - Size = pgm_read_byte(&ProductString.Header.Size); - cfe: ec ef ldi r30, 0xFC ; 252 - d00: f1 e0 ldi r31, 0x01 ; 1 - d02: 84 91 lpm r24, Z - d04: 90 e0 ldi r25, 0x00 ; 0 - case 0x01: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - break; - case 0x02: - Address = &ProductString; - d06: 9f 01 movw r18, r30 - Size = pgm_read_byte(&ProductString.Header.Size); - break; - d08: 04 c0 rjmp .+8 ; 0xd12 -{ - const uint8_t DescriptorType = (wValue >> 8); - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - d0a: 80 e0 ldi r24, 0x00 ; 0 - d0c: 90 e0 ldi r25, 0x00 ; 0 - const void** const DescriptorAddress) -{ - const uint8_t DescriptorType = (wValue >> 8); - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - d0e: 20 e0 ldi r18, 0x00 ; 0 - d10: 30 e0 ldi r19, 0x00 ; 0 - } - - break; - } - - *DescriptorAddress = Address; - d12: fa 01 movw r30, r20 - d14: 20 83 st Z, r18 - d16: 31 83 std Z+1, r19 ; 0x01 - return Size; -} - d18: 08 95 ret - -00000d1a <__vector_default>: - -#include "System.h" -#include "LED.h" - -ISR(BADISR_vect) -{ - d1a: 1f 92 push r1 - d1c: 0f 92 push r0 - d1e: 0f b6 in r0, 0x3f ; 63 - d20: 0f 92 push r0 - d22: 11 24 eor r1, r1 - while(1); - d24: ff cf rjmp .-2 ; 0xd24 <__vector_default+0xa> - -00000d26 : -} - -void SystemInit(void) -{ - if (RST.STATUS & RST_WDRF_bm) { - d26: 80 91 78 00 lds r24, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x700078> - d2a: 83 ff sbrs r24, 3 - d2c: 0a c0 rjmp .+20 ; 0xd42 - /* On Watchdog reset clear WDRF bit, disable watchdog - * and jump into bootloader */ - RST.STATUS = RST_WDRF_bm; - d2e: 88 e0 ldi r24, 0x08 ; 8 - d30: 80 93 78 00 sts 0x0078, r24 ; 0x800078 <__TEXT_REGION_LENGTH__+0x700078> - - CCP = CCP_IOREG_gc; - d34: 88 ed ldi r24, 0xD8 ; 216 - d36: 84 bf out 0x34, r24 ; 52 - WDT.CTRL = WDT_CEN_bm; - d38: 81 e0 ldi r24, 0x01 ; 1 - d3a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x700080> - - asm volatile ("jmp %0"::"i" (BOOT_SECTION_START + 0x1FC)); - d3e: fd 95 fe c0 jmp 0x7f81fc ; 0x7f81fc <__TEXT_REGION_LENGTH__+0x6f81fc> - } - - /* 32MHz system clock using internal RC and 32K DFLL*/ - OSC.CTRL |= OSC_RC32MEN_bm | OSC_RC32KEN_bm; - d42: 80 91 50 00 lds r24, 0x0050 ; 0x800050 <__TEXT_REGION_LENGTH__+0x700050> - d46: 86 60 ori r24, 0x06 ; 6 - d48: 80 93 50 00 sts 0x0050, r24 ; 0x800050 <__TEXT_REGION_LENGTH__+0x700050> - while(!(OSC.STATUS & OSC_RC32MRDY_bm)) - d4c: 80 91 51 00 lds r24, 0x0051 ; 0x800051 <__TEXT_REGION_LENGTH__+0x700051> - d50: 81 ff sbrs r24, 1 - d52: fc cf rjmp .-8 ; 0xd4c - ; - while(!(OSC.STATUS & OSC_RC32KRDY_bm)) - d54: 80 91 51 00 lds r24, 0x0051 ; 0x800051 <__TEXT_REGION_LENGTH__+0x700051> - d58: 82 ff sbrs r24, 2 - d5a: fc cf rjmp .-8 ; 0xd54 - ; - - OSC.DFLLCTRL = OSC_RC32MCREF_RC32K_gc; - d5c: 10 92 56 00 sts 0x0056, r1 ; 0x800056 <__TEXT_REGION_LENGTH__+0x700056> - DFLLRC32M.CTRL = DFLL_ENABLE_bm; - d60: 81 e0 ldi r24, 0x01 ; 1 - d62: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x700060> - - CCP = CCP_IOREG_gc; - d66: 98 ed ldi r25, 0xD8 ; 216 - d68: 94 bf out 0x34, r25 ; 52 - CLK.CTRL = CLK_SCLKSEL_RC32M_gc; - d6a: 80 93 40 00 sts 0x0040, r24 ; 0x800040 <__TEXT_REGION_LENGTH__+0x700040> - - /* Use TCE0 as system tick */ - TCE0.PER = F_CPU / 256 / SYSTEM_TICK_FREQ - 1; - d6e: 23 ed ldi r18, 0xD3 ; 211 - d70: 30 e3 ldi r19, 0x30 ; 48 - d72: 20 93 26 0a sts 0x0A26, r18 ; 0x800a26 <__TEXT_REGION_LENGTH__+0x700a26> - d76: 30 93 27 0a sts 0x0A27, r19 ; 0x800a27 <__TEXT_REGION_LENGTH__+0x700a27> - TCE0.CTRLA = TC_CLKSEL_DIV256_gc; - d7a: 96 e0 ldi r25, 0x06 ; 6 - d7c: 90 93 00 0a sts 0x0A00, r25 ; 0x800a00 <__TEXT_REGION_LENGTH__+0x700a00> - - /* Enable RTC with roughly 1kHz clock */ - CLK.RTCCTRL = CLK_RTCSRC_ULP_gc | CLK_RTCEN_bm; - d80: 80 93 43 00 sts 0x0043, r24 ; 0x800043 <__TEXT_REGION_LENGTH__+0x700043> - RTC.CTRL = RTC_PRESCALER_DIV1_gc; - d84: 80 93 00 04 sts 0x0400, r24 ; 0x800400 <__TEXT_REGION_LENGTH__+0x700400> - - /* Enable EEPROM data memory mapping */ - NVM.CTRLB |= NVM_EEMAPEN_bm; - d88: 80 91 cc 01 lds r24, 0x01CC ; 0x8001cc <__TEXT_REGION_LENGTH__+0x7001cc> - d8c: 88 60 ori r24, 0x08 ; 8 - d8e: 80 93 cc 01 sts 0x01CC, r24 ; 0x8001cc <__TEXT_REGION_LENGTH__+0x7001cc> - d92: 08 95 ret - -00000d94 : -} - -void SystemReset(void) -{ - CCP = CCP_IOREG_gc; - d94: 88 ed ldi r24, 0xD8 ; 216 - d96: 84 bf out 0x34, r24 ; 52 - RST.CTRL = RST_SWRST_bm; - d98: 81 e0 ldi r24, 0x01 ; 1 - d9a: 80 93 79 00 sts 0x0079, r24 ; 0x800079 <__TEXT_REGION_LENGTH__+0x700079> - d9e: 08 95 ret - -00000da0 : -} - -void SystemEnterBootloader(void) -{ - /* Use Watchdog timer to reset into bootloader. */ - CCP = CCP_IOREG_gc; - da0: 88 ed ldi r24, 0xD8 ; 216 - da2: 84 bf out 0x34, r24 ; 52 - WDT.CTRL = WDT_PER_512CLK_gc | WDT_ENABLE_bm | WDT_CEN_bm; - da4: 8b e1 ldi r24, 0x1B ; 27 - da6: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x700080> - daa: 08 95 ret - -00000dac : - - -void SystemStartUSBClock(void) -{ - /* 48MHz USB Clock using 12MHz XTAL */ - OSC.XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; - dac: 8b ec ldi r24, 0xCB ; 203 - dae: 80 93 52 00 sts 0x0052, r24 ; 0x800052 <__TEXT_REGION_LENGTH__+0x700052> - OSC.CTRL |= OSC_XOSCEN_bm; - db2: 80 91 50 00 lds r24, 0x0050 ; 0x800050 <__TEXT_REGION_LENGTH__+0x700050> - db6: 88 60 ori r24, 0x08 ; 8 - db8: 80 93 50 00 sts 0x0050, r24 ; 0x800050 <__TEXT_REGION_LENGTH__+0x700050> - while(!(OSC.STATUS & OSC_XOSCRDY_bm)) - dbc: 80 91 51 00 lds r24, 0x0051 ; 0x800051 <__TEXT_REGION_LENGTH__+0x700051> - dc0: 83 ff sbrs r24, 3 - dc2: fc cf rjmp .-8 ; 0xdbc - ; - - OSC.PLLCTRL = OSC_PLLSRC_XOSC_gc | (4 << OSC_PLLFAC_gp); - dc4: 84 ec ldi r24, 0xC4 ; 196 - dc6: 80 93 55 00 sts 0x0055, r24 ; 0x800055 <__TEXT_REGION_LENGTH__+0x700055> - - OSC.CTRL |= OSC_PLLEN_bm; - dca: 80 91 50 00 lds r24, 0x0050 ; 0x800050 <__TEXT_REGION_LENGTH__+0x700050> - dce: 80 61 ori r24, 0x10 ; 16 - dd0: 80 93 50 00 sts 0x0050, r24 ; 0x800050 <__TEXT_REGION_LENGTH__+0x700050> - while(!(OSC.STATUS & OSC_PLLRDY_bm)) - dd4: 80 91 51 00 lds r24, 0x0051 ; 0x800051 <__TEXT_REGION_LENGTH__+0x700051> - dd8: 84 ff sbrs r24, 4 - dda: fc cf rjmp .-8 ; 0xdd4 - ; -} - ddc: 08 95 ret - -00000dde : - -void SystemStopUSBClock(void) -{ - /* Disable USB Clock to minimize power consumption */ - CLK.USBCTRL &= ~CLK_USBSEN_bm; - dde: e0 e4 ldi r30, 0x40 ; 64 - de0: f0 e0 ldi r31, 0x00 ; 0 - de2: 84 81 ldd r24, Z+4 ; 0x04 - de4: 8e 7f andi r24, 0xFE ; 254 - de6: 84 83 std Z+4, r24 ; 0x04 - OSC.CTRL &= ~OSC_PLLEN_bm; - de8: e0 e5 ldi r30, 0x50 ; 80 - dea: f0 e0 ldi r31, 0x00 ; 0 - dec: 80 81 ld r24, Z - dee: 8f 7e andi r24, 0xEF ; 239 - df0: 80 83 st Z, r24 - OSC.CTRL &= ~OSC_XOSCEN_bm; - df2: 80 81 ld r24, Z - df4: 87 7f andi r24, 0xF7 ; 247 - df6: 80 83 st Z, r24 - df8: 08 95 ret - -00000dfa : -} - -void SystemInterruptInit(void) -{ - /* Enable all interrupt levels */ - PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; - dfa: 87 e0 ldi r24, 0x07 ; 7 - dfc: 80 93 a2 00 sts 0x00A2, r24 ; 0x8000a2 <__TEXT_REGION_LENGTH__+0x7000a2> - sei(); - e00: 78 94 sei - e02: 08 95 ret - -00000e04 : - -/* Include all Codecs and Applications */ -#include "Codec/Codec.h" -#include "Application/Application.h" - -static void CodecInitDummy(void) { } - e04: 08 95 ret - -00000e06 : -static void CodecTaskDummy(void) { } - e06: 08 95 ret - -00000e08 : -static void ApplicationInitDummy(void) {} - e08: 08 95 ret - -00000e0a : -static void ApplicationResetDummy(void) {} - e0a: 08 95 ret - -00000e0c : -static void ApplicationTaskDummy(void) {} - e0c: 08 95 ret - -00000e0e : -static void ApplicationTickDummy(void) {} - e0e: 08 95 ret - -00000e10 : -static uint16_t ApplicationProcessDummy(uint8_t* ByteBuffer, uint16_t ByteCount) { return 0; } - e10: 80 e0 ldi r24, 0x00 ; 0 - e12: 90 e0 ldi r25, 0x00 ; 0 - e14: 08 95 ret - -00000e16 : -static void ApplicationGetUidDummy(ConfigurationUidType Uid) { } - e16: 08 95 ret - -00000e18 : -static void ApplicationSetUidDummy(ConfigurationUidType Uid) { } - e18: 08 95 ret - -00000e1a : -{ - ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); -} - -void ConfigurationSetById( ConfigurationEnum Configuration ) -{ - e1a: cf 93 push r28 - e1c: df 93 push r29 - GlobalSettings.ActiveSettingPtr->Configuration = Configuration; - e1e: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - e22: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - e26: 82 83 std Z+2, r24 ; 0x02 - - /* Copy struct from PROGMEM to RAM */ - memcpy_P(&ActiveConfiguration, &ConfigurationTable[Configuration], sizeof(ConfigurationType)); - e28: 98 e1 ldi r25, 0x18 ; 24 - e2a: 89 9f mul r24, r25 - e2c: b0 01 movw r22, r0 - e2e: 11 24 eor r1, r1 - e30: 68 57 subi r22, 0x78 ; 120 - e32: 7d 4f sbci r23, 0xFD ; 253 - e34: 48 e1 ldi r20, 0x18 ; 24 - e36: 50 e0 ldi r21, 0x00 ; 0 - e38: 8a e3 ldi r24, 0x3A ; 58 - e3a: 91 e2 ldi r25, 0x21 ; 33 - e3c: 0e 94 56 2a call 0x54ac ; 0x54ac -#define CODEC_CARRIER_FREQ 13560000 - -extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE]; - -INLINE void CodecInit(void) { - ActiveConfiguration.CodecInitFunc(); - e40: ca e3 ldi r28, 0x3A ; 58 - e42: d1 e2 ldi r29, 0x21 ; 33 - e44: e8 81 ld r30, Y - e46: f9 81 ldd r31, Y+1 ; 0x01 - e48: 09 95 icall -#include "MifareUltralight.h" -#include "Detection.h" - -/* Function wrappers */ -INLINE void ApplicationInit(void) { - ActiveConfiguration.ApplicationInitFunc(); - e4a: ee 81 ldd r30, Y+6 ; 0x06 - e4c: ff 81 ldd r31, Y+7 ; 0x07 - - CodecInit(); - ApplicationInit(); -} - e4e: df 91 pop r29 - e50: cf 91 pop r28 - e52: 09 94 ijmp - -00000e54 : - -ConfigurationType ActiveConfiguration; - -void ConfigurationInit(void) -{ - ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); - e54: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - e58: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - e5c: 82 81 ldd r24, Z+2 ; 0x02 - e5e: dd cf rjmp .-70 ; 0xe1a - -00000e60 : - CodecInit(); - ApplicationInit(); -} - -void ConfigurationGetByName(char* Configuration, uint16_t BufferSize) -{ - e60: 0f 93 push r16 - e62: 1f 93 push r17 - MapIdToText(ConfigurationMap, ARRAY_COUNT(ConfigurationMap), GlobalSettings.ActiveSettingPtr->Configuration, Configuration, BufferSize); - e64: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - e68: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - e6c: 8b 01 movw r16, r22 - e6e: 9c 01 movw r18, r24 - e70: 42 81 ldd r20, Z+2 ; 0x02 - e72: 67 e0 ldi r22, 0x07 ; 7 - e74: 80 e3 ldi r24, 0x30 ; 48 - e76: 93 e0 ldi r25, 0x03 ; 3 - e78: 4c d5 rcall .+2712 ; 0x1912 -} - e7a: 1f 91 pop r17 - e7c: 0f 91 pop r16 - e7e: 08 95 ret - -00000e80 : - -bool ConfigurationSetByName(const char* Configuration) -{ - e80: 1f 93 push r17 - e82: cf 93 push r28 - e84: df 93 push r29 - e86: 1f 92 push r1 - e88: cd b7 in r28, 0x3d ; 61 - e8a: de b7 in r29, 0x3e ; 62 - MapIdType Id; - - if (MapTextToId(ConfigurationMap, ARRAY_COUNT(ConfigurationMap), Configuration, &Id)) { - e8c: 9e 01 movw r18, r28 - e8e: 2f 5f subi r18, 0xFF ; 255 - e90: 3f 4f sbci r19, 0xFF ; 255 - e92: ac 01 movw r20, r24 - e94: 67 e0 ldi r22, 0x07 ; 7 - e96: 80 e3 ldi r24, 0x30 ; 48 - e98: 93 e0 ldi r25, 0x03 ; 3 - e9a: 53 d5 rcall .+2726 ; 0x1942 - e9c: 18 2f mov r17, r24 - e9e: 88 23 and r24, r24 - ea0: 51 f0 breq .+20 ; 0xeb6 -#ifdef CONFIG_MF_CLASSIC_4K_SUPPORT - if (Id == CONFIG_MF_CLASSIC_4K && GlobalSettings.ActiveSetting != 0) - ea2: 89 81 ldd r24, Y+1 ; 0x01 - ea4: 85 30 cpi r24, 0x05 ; 5 - ea6: 21 f4 brne .+8 ; 0xeb0 - ea8: 90 91 00 20 lds r25, 0x2000 ; 0x802000 - eac: 91 11 cpse r25, r1 - eae: 02 c0 rjmp .+4 ; 0xeb4 - { - return false; - } -#endif - ConfigurationSetById(Id); - eb0: b4 df rcall .-152 ; 0xe1a - return true; - eb2: 01 c0 rjmp .+2 ; 0xeb6 - } else { - return false; - eb4: 10 e0 ldi r17, 0x00 ; 0 - } -} - eb6: 81 2f mov r24, r17 - eb8: 0f 90 pop r0 - eba: df 91 pop r29 - ebc: cf 91 pop r28 - ebe: 1f 91 pop r17 - ec0: 08 95 ret - -00000ec2 : - -void ConfigurationGetList(char* List, uint16_t BufferSize) -{ - ec2: 9b 01 movw r18, r22 - MapToString(ConfigurationMap, ARRAY_COUNT(ConfigurationMap), List, BufferSize); - ec4: ac 01 movw r20, r24 - ec6: 67 e0 ldi r22, 0x07 ; 7 - ec8: 80 e3 ldi r24, 0x30 ; 48 - eca: 93 e0 ldi r25, 0x03 ; 3 - ecc: 61 c5 rjmp .+2754 ; 0x1990 - -00000ece : -#include "Random.h" - -#include - -void RandomInit(void) -{ - ece: 08 95 ret - -00000ed0 : - -} - -uint8_t RandomGetByte(void) -{ - return rand() & 0xFF; - ed0: 0c 94 48 2a jmp 0x5490 ; 0x5490 -} - ed4: 08 95 ret - -00000ed6 : - -void RandomGetBuffer(void* Buffer, uint8_t ByteCount) -{ - ed6: 1f 93 push r17 - ed8: cf 93 push r28 - eda: df 93 push r29 - uint8_t* BufferPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - edc: c8 2f mov r28, r24 - ede: d9 2f mov r29, r25 - ee0: 16 2f mov r17, r22 - ee2: 18 0f add r17, r24 - ee4: 1c 17 cp r17, r28 - ee6: 21 f0 breq .+8 ; 0xef0 - -} - -uint8_t RandomGetByte(void) -{ - return rand() & 0xFF; - ee8: 0e 94 48 2a call 0x5490 ; 0x5490 -void RandomGetBuffer(void* Buffer, uint8_t ByteCount) -{ - uint8_t* BufferPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - *BufferPtr++ = RandomGetByte(); - eec: 89 93 st Y+, r24 - eee: fa cf rjmp .-12 ; 0xee4 - } -} - ef0: df 91 pop r29 - ef2: cf 91 pop r28 - ef4: 1f 91 pop r17 - ef6: 08 95 ret - -00000ef8 : - -void RandomTick(void) -{ - rand(); - ef8: 0e 94 48 2a call 0x5490 ; 0x5490 - rand(); - efc: 0e 94 48 2a call 0x5490 ; 0x5490 - rand(); - f00: 0e 94 48 2a call 0x5490 ; 0x5490 - rand(); - f04: 0c 94 48 2a jmp 0x5490 ; 0x5490 - -00000f08 : - 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, -}; - -uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) -{ - f08: ef 92 push r14 - f0a: ff 92 push r15 - f0c: 0f 93 push r16 - f0e: 1f 93 push r17 - f10: cf 93 push r28 - f12: df 93 push r29 - f14: 7c 01 movw r14, r24 - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t CharCount = 0; - - /* Account for '\0' at the end */ - MaxChars--; - f16: 61 50 subi r22, 0x01 ; 1 - f18: 71 09 sbc r23, r1 - f1a: fa 01 movw r30, r20 - f1c: 8a 01 movw r16, r20 - f1e: 02 0f add r16, r18 - f20: 13 1f adc r17, r19 - - while( (ByteCount > 0) && (MaxChars >= 2) ) { - f22: dc 01 movw r26, r24 -}; - -uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t CharCount = 0; - f24: 40 e0 ldi r20, 0x00 ; 0 - f26: 50 e0 ldi r21, 0x00 ; 0 - - /* Account for '\0' at the end */ - MaxChars--; - - while( (ByteCount > 0) && (MaxChars >= 2) ) { - f28: e0 17 cp r30, r16 - f2a: f1 07 cpc r31, r17 - f2c: f1 f0 breq .+60 ; 0xf6a - f2e: 62 30 cpi r22, 0x02 ; 2 - f30: 71 05 cpc r23, r1 - f32: d8 f0 brcs .+54 ; 0xf6a - uint8_t Byte = *ByteBuffer; - f34: 91 91 ld r25, Z+ - - HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); - f36: 39 2f mov r19, r25 - f38: 32 95 swap r19 - f3a: 3f 70 andi r19, 0x0F ; 15 - f3c: 3a 30 cpi r19, 0x0A ; 10 - f3e: 10 f4 brcc .+4 ; 0xf44 - f40: 30 5d subi r19, 0xD0 ; 208 - f42: 01 c0 rjmp .+2 ; 0xf46 - f44: 39 5c subi r19, 0xC9 ; 201 - f46: 3c 93 st X, r19 - HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); - f48: 9f 70 andi r25, 0x0F ; 15 - f4a: 9a 30 cpi r25, 0x0A ; 10 - f4c: 10 f4 brcc .+4 ; 0xf52 - f4e: 90 5d subi r25, 0xD0 ; 208 - f50: 01 c0 rjmp .+2 ; 0xf54 - f52: 99 5c subi r25, 0xC9 ; 201 - f54: 97 01 movw r18, r14 - f56: 24 0f add r18, r20 - f58: 35 1f adc r19, r21 - f5a: e9 01 movw r28, r18 - f5c: 99 83 std Y+1, r25 ; 0x01 - - HexOut += 2; - f5e: 12 96 adiw r26, 0x02 ; 2 - MaxChars -= 2; - f60: 62 50 subi r22, 0x02 ; 2 - f62: 71 09 sbc r23, r1 - CharCount += 2; - f64: 4e 5f subi r20, 0xFE ; 254 - f66: 5f 4f sbci r21, 0xFF ; 255 - f68: df cf rjmp .-66 ; 0xf28 - ByteBuffer++; - ByteCount -= 1; - } - - *HexOut = '\0'; - f6a: 1c 92 st X, r1 - - return CharCount; -} - f6c: ca 01 movw r24, r20 - f6e: df 91 pop r29 - f70: cf 91 pop r28 - f72: 1f 91 pop r17 - f74: 0f 91 pop r16 - f76: ff 90 pop r15 - f78: ef 90 pop r14 - f7a: 08 95 ret - -00000f7c : - -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - f7c: cf 93 push r28 - f7e: df 93 push r29 - f80: ec 01 movw r28, r24 - f82: da 01 movw r26, r20 - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - f84: e0 e0 ldi r30, 0x00 ; 0 - f86: f0 e0 ldi r31, 0x00 ; 0 - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - f88: 4c 91 ld r20, X - f8a: 44 23 and r20, r20 - f8c: 91 f1 breq .+100 ; 0xff2 - f8e: 11 96 adiw r26, 0x01 ; 1 - f90: 9c 91 ld r25, X - f92: 11 97 sbiw r26, 0x01 ; 1 - f94: 99 23 and r25, r25 - f96: 39 f1 breq .+78 ; 0xfe6 - f98: e6 17 cp r30, r22 - f9a: f7 07 cpc r31, r23 - f9c: 21 f1 breq .+72 ; 0xfe6 - if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { - f9e: 80 ed ldi r24, 0xD0 ; 208 - fa0: 84 0f add r24, r20 - fa2: 8a 30 cpi r24, 0x0A ; 10 - fa4: 20 f0 brcs .+8 ; 0xfae - fa6: 8f eb ldi r24, 0xBF ; 191 - fa8: 84 0f add r24, r20 - faa: 86 30 cpi r24, 0x06 ; 6 - fac: d0 f4 brcc .+52 ; 0xfe2 - fae: 80 ed ldi r24, 0xD0 ; 208 - fb0: 89 0f add r24, r25 - fb2: 8a 30 cpi r24, 0x0A ; 10 - fb4: 20 f0 brcs .+8 ; 0xfbe - fb6: 2f eb ldi r18, 0xBF ; 191 - fb8: 29 0f add r18, r25 - fba: 26 30 cpi r18, 0x06 ; 6 - fbc: 90 f4 brcc .+36 ; 0xfe2 - fbe: 24 2f mov r18, r20 - fc0: 30 e0 ldi r19, 0x00 ; 0 - uint8_t Byte = 0; - - Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; - fc2: 41 34 cpi r20, 0x41 ; 65 - fc4: 10 f0 brcs .+4 ; 0xfca - fc6: 27 53 subi r18, 0x37 ; 55 - fc8: 31 09 sbc r19, r1 - fca: 22 95 swap r18 - fcc: 20 7f andi r18, 0xF0 ; 240 - Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; - fce: 91 34 cpi r25, 0x41 ; 65 - fd0: 10 f4 brcc .+4 ; 0xfd6 - fd2: 98 2f mov r25, r24 - fd4: 01 c0 rjmp .+2 ; 0xfd8 - fd6: 97 53 subi r25, 0x37 ; 55 - fd8: 29 2b or r18, r25 - - *ByteBuffer = Byte; - fda: 29 93 st Y+, r18 - - ByteBuffer++; - MaxBytes--; - ByteCount++; - fdc: 31 96 adiw r30, 0x01 ; 1 - HexIn += 2; - fde: 12 96 adiw r26, 0x02 ; 2 -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { - fe0: d3 cf rjmp .-90 ; 0xf88 - MaxBytes--; - ByteCount++; - HexIn += 2; - } else { - /* HEX chars only */ - return 0; - fe2: 80 e0 ldi r24, 0x00 ; 0 - fe4: 04 c0 rjmp .+8 ; 0xfee - } - } - - if ( (HexIn[0] != '\0') && (HexIn[1] == '\0') ) { - fe6: 11 96 adiw r26, 0x01 ; 1 - fe8: 8c 91 ld r24, X - fea: 81 11 cpse r24, r1 - fec: 02 c0 rjmp .+4 ; 0xff2 - MaxBytes--; - ByteCount++; - HexIn += 2; - } else { - /* HEX chars only */ - return 0; - fee: 90 e0 ldi r25, 0x00 ; 0 - ff0: 01 c0 rjmp .+2 ; 0xff4 -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) ) { - ff2: cf 01 movw r24, r30 - /* Odd number of characters */ - return 0; - } - - return ByteCount; -} - ff4: df 91 pop r29 - ff6: cf 91 pop r28 - ff8: 08 95 ret - -00000ffa : -void MemoryRecall(void) { - /* Recall memory from permanent flash */ - //FlashRead(Memory, (uint16_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); -} - -void MemoryStore(void) { - ffa: cf 93 push r28 - ffc: df 93 push r29 - ffe: 00 d0 rcall .+0 ; 0x1000 - 1000: 00 d0 rcall .+0 ; 0x1002 - 1002: cd b7 in r28, 0x3d ; 61 - 1004: de b7 in r29, 0x3e ; 62 - 1006: 80 e1 ldi r24, 0x10 ; 16 - 1008: 80 93 65 06 sts 0x0665, r24 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 100c: 92 e0 ldi r25, 0x02 ; 2 - 100e: 90 93 66 06 sts 0x0666, r25 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1012: 98 e0 ldi r25, 0x08 ; 8 - 1014: 90 93 65 06 sts 0x0665, r25 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 1018: 9a e1 ldi r25, 0x1A ; 26 - 101a: 90 93 61 06 sts 0x0661, r25 ; 0x800661 <__TEXT_REGION_LENGTH__+0x700661> - 101e: 10 92 a6 09 sts 0x09A6, r1 ; 0x8009a6 <__TEXT_REGION_LENGTH__+0x7009a6> - 1022: 10 92 a7 09 sts 0x09A7, r1 ; 0x8009a7 <__TEXT_REGION_LENGTH__+0x7009a7> - 1026: 90 ec ldi r25, 0xC0 ; 192 - 1028: 90 93 a5 09 sts 0x09A5, r25 ; 0x8009a5 <__TEXT_REGION_LENGTH__+0x7009a5> - 102c: 98 e1 ldi r25, 0x18 ; 24 - 102e: 90 93 a4 09 sts 0x09A4, r25 ; 0x8009a4 <__TEXT_REGION_LENGTH__+0x7009a4> - 1032: 80 93 66 06 sts 0x0666, r24 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1036: 87 ed ldi r24, 0xD7 ; 215 - 1038: 80 93 a0 09 sts 0x09A0, r24 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 103c: 80 91 a1 09 lds r24, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1040: 86 ff sbrs r24, 6 - 1042: fc cf rjmp .-8 ; 0x103c - 1044: 80 e4 ldi r24, 0x40 ; 64 - 1046: 80 93 a1 09 sts 0x09A1, r24 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 104a: 80 91 a0 09 lds r24, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 104e: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1052: 80 91 a1 09 lds r24, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1056: 86 ff sbrs r24, 6 - 1058: fc cf rjmp .-8 ; 0x1052 - 105a: 80 e4 ldi r24, 0x40 ; 64 - 105c: 80 93 a1 09 sts 0x09A1, r24 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1060: 80 91 a0 09 lds r24, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1064: 90 e1 ldi r25, 0x10 ; 16 - 1066: 90 93 65 06 sts 0x0665, r25 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 106a: 80 fd sbrc r24, 0 - 106c: 3f c0 rjmp .+126 ; 0x10ec - 106e: 8d e3 ldi r24, 0x3D ; 61 - 1070: 89 83 std Y+1, r24 ; 0x01 - 1072: 8a e2 ldi r24, 0x2A ; 42 - 1074: 8a 83 std Y+2, r24 ; 0x02 - 1076: 80 e8 ldi r24, 0x80 ; 128 - 1078: 8b 83 std Y+3, r24 ; 0x03 - 107a: 86 ea ldi r24, 0xA6 ; 166 - 107c: 8c 83 std Y+4, r24 ; 0x04 - 107e: 80 e1 ldi r24, 0x10 ; 16 - 1080: 37 ed ldi r19, 0xD7 ; 215 - 1082: 90 e4 ldi r25, 0x40 ; 64 - 1084: 80 93 66 06 sts 0x0666, r24 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1088: 30 93 a0 09 sts 0x09A0, r19 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 108c: 20 91 a1 09 lds r18, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1090: 26 ff sbrs r18, 6 - 1092: fc cf rjmp .-8 ; 0x108c - 1094: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1098: 20 91 a0 09 lds r18, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 109c: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 10a0: 20 91 a1 09 lds r18, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 10a4: 26 ff sbrs r18, 6 - 10a6: fc cf rjmp .-8 ; 0x10a0 - 10a8: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 10ac: 20 91 a0 09 lds r18, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 10b0: 80 93 65 06 sts 0x0665, r24 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 10b4: 27 ff sbrs r18, 7 - 10b6: e6 cf rjmp .-52 ; 0x1084 - 10b8: 80 e1 ldi r24, 0x10 ; 16 - 10ba: 80 93 66 06 sts 0x0666, r24 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 10be: fe 01 movw r30, r28 - 10c0: 31 96 adiw r30, 0x01 ; 1 - 10c2: ce 01 movw r24, r28 - 10c4: 05 96 adiw r24, 0x05 ; 5 - 10c6: 20 e4 ldi r18, 0x40 ; 64 - 10c8: e8 17 cp r30, r24 - 10ca: f9 07 cpc r31, r25 - 10cc: 61 f0 breq .+24 ; 0x10e6 - 10ce: 31 91 ld r19, Z+ - 10d0: 30 93 a0 09 sts 0x09A0, r19 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 10d4: 30 91 a1 09 lds r19, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 10d8: 36 ff sbrs r19, 6 - 10da: fc cf rjmp .-8 ; 0x10d4 - 10dc: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 10e0: 30 91 a0 09 lds r19, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 10e4: f1 cf rjmp .-30 ; 0x10c8 - 10e6: 80 e1 ldi r24, 0x10 ; 16 - 10e8: 80 93 65 06 sts 0x0665, r24 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 10ec: 24 96 adiw r28, 0x04 ; 4 - 10ee: cd bf out 0x3d, r28 ; 61 - 10f0: de bf out 0x3e, r29 ; 62 - 10f2: df 91 pop r29 - 10f4: cf 91 pop r28 - 10f6: 08 95 ret - -000010f8 : - 10f8: cf 92 push r12 - 10fa: df 92 push r13 - 10fc: ef 92 push r14 - 10fe: ff 92 push r15 - 1100: 0f 93 push r16 - 1102: 1f 93 push r17 - 1104: dc 01 movw r26, r24 - 1106: 41 15 cp r20, r1 - 1108: 51 05 cpc r21, r1 - 110a: 09 f4 brne .+2 ; 0x110e - 110c: 79 c0 rjmp .+242 ; 0x1200 - 110e: 00 91 00 20 lds r16, 0x2000 ; 0x802000 - 1112: 6b 01 movw r12, r22 - 1114: e1 2c mov r14, r1 - 1116: f1 2c mov r15, r1 - 1118: 00 23 and r16, r16 - 111a: 71 f0 breq .+28 ; 0x1138 - 111c: 10 e0 ldi r17, 0x00 ; 0 - 111e: 20 e0 ldi r18, 0x00 ; 0 - 1120: 30 e0 ldi r19, 0x00 ; 0 - 1122: 8a e0 ldi r24, 0x0A ; 10 - 1124: 00 0f add r16, r16 - 1126: 11 1f adc r17, r17 - 1128: 22 1f adc r18, r18 - 112a: 33 1f adc r19, r19 - 112c: 8a 95 dec r24 - 112e: d1 f7 brne .-12 ; 0x1124 - 1130: c0 0e add r12, r16 - 1132: d1 1e adc r13, r17 - 1134: e2 1e adc r14, r18 - 1136: f3 1e adc r15, r19 - 1138: ed 2d mov r30, r13 - 113a: 20 e1 ldi r18, 0x10 ; 16 - 113c: 17 ed ldi r17, 0xD7 ; 215 - 113e: 30 e4 ldi r19, 0x40 ; 64 - 1140: 20 93 66 06 sts 0x0666, r18 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1144: 10 93 a0 09 sts 0x09A0, r17 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1148: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 114c: f6 ff sbrs r31, 6 - 114e: fc cf rjmp .-8 ; 0x1148 - 1150: 30 93 a1 09 sts 0x09A1, r19 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1154: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1158: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 115c: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1160: f6 ff sbrs r31, 6 - 1162: fc cf rjmp .-8 ; 0x115c - 1164: 30 93 a1 09 sts 0x09A1, r19 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1168: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 116c: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 1170: f7 ff sbrs r31, 7 - 1172: e6 cf rjmp .-52 ; 0x1140 - 1174: 20 e1 ldi r18, 0x10 ; 16 - 1176: 20 93 66 06 sts 0x0666, r18 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 117a: 23 e0 ldi r18, 0x03 ; 3 - 117c: 20 93 a0 09 sts 0x09A0, r18 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1180: 20 91 a1 09 lds r18, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1184: 26 ff sbrs r18, 6 - 1186: fc cf rjmp .-8 ; 0x1180 - 1188: 20 e4 ldi r18, 0x40 ; 64 - 118a: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 118e: 20 91 a0 09 lds r18, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1192: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1196: 20 91 a1 09 lds r18, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 119a: 26 ff sbrs r18, 6 - 119c: fc cf rjmp .-8 ; 0x1196 - 119e: 20 e4 ldi r18, 0x40 ; 64 - 11a0: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11a4: 20 91 a0 09 lds r18, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11a8: e0 93 a0 09 sts 0x09A0, r30 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11ac: 20 91 a1 09 lds r18, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11b0: 26 ff sbrs r18, 6 - 11b2: fc cf rjmp .-8 ; 0x11ac - 11b4: 20 e4 ldi r18, 0x40 ; 64 - 11b6: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11ba: 20 91 a0 09 lds r18, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11be: c0 92 a0 09 sts 0x09A0, r12 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11c2: 80 91 a1 09 lds r24, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11c6: 86 ff sbrs r24, 6 - 11c8: fc cf rjmp .-8 ; 0x11c2 - 11ca: 80 e4 ldi r24, 0x40 ; 64 - 11cc: 80 93 a1 09 sts 0x09A1, r24 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11d0: 80 91 a0 09 lds r24, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11d4: fd 01 movw r30, r26 - 11d6: 4a 0f add r20, r26 - 11d8: 5b 1f adc r21, r27 - 11da: 80 e4 ldi r24, 0x40 ; 64 - 11dc: e4 17 cp r30, r20 - 11de: f5 07 cpc r31, r21 - 11e0: 61 f0 breq .+24 ; 0x11fa - 11e2: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11e6: 90 91 a1 09 lds r25, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11ea: 96 ff sbrs r25, 6 - 11ec: fc cf rjmp .-8 ; 0x11e6 - 11ee: 80 93 a1 09 sts 0x09A1, r24 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 11f2: 90 91 a0 09 lds r25, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 11f6: 91 93 st Z+, r25 - 11f8: f1 cf rjmp .-30 ; 0x11dc - 11fa: 80 e1 ldi r24, 0x10 ; 16 - 11fc: 80 93 65 06 sts 0x0665, r24 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 1200: 1f 91 pop r17 - 1202: 0f 91 pop r16 - 1204: ff 90 pop r15 - 1206: ef 90 pop r14 - 1208: df 90 pop r13 - 120a: cf 90 pop r12 - 120c: 08 95 ret - -0000120e : - 120e: 8f 92 push r8 - 1210: 9f 92 push r9 - 1212: af 92 push r10 - 1214: bf 92 push r11 - 1216: cf 92 push r12 - 1218: df 92 push r13 - 121a: ef 92 push r14 - 121c: ff 92 push r15 - 121e: 0f 93 push r16 - 1220: 1f 93 push r17 - 1222: cf 93 push r28 - 1224: df 93 push r29 - 1226: dc 01 movw r26, r24 - 1228: 41 15 cp r20, r1 - 122a: 51 05 cpc r21, r1 - 122c: 09 f4 brne .+2 ; 0x1230 - 122e: 0f c1 rjmp .+542 ; 0x144e - 1230: 20 91 00 20 lds r18, 0x2000 ; 0x802000 - 1234: 22 23 and r18, r18 - 1236: 39 f0 breq .+14 ; 0x1246 - 1238: 30 e0 ldi r19, 0x00 ; 0 - 123a: 32 2f mov r19, r18 - 123c: 22 27 eor r18, r18 - 123e: 33 0f add r19, r19 - 1240: 33 0f add r19, r19 - 1242: 62 0f add r22, r18 - 1244: 73 1f adc r23, r19 - 1246: e1 2c mov r14, r1 - 1248: ff 24 eor r15, r15 - 124a: f3 94 inc r15 - 124c: 20 e1 ldi r18, 0x10 ; 16 - 124e: 87 ed ldi r24, 0xD7 ; 215 - 1250: 90 e4 ldi r25, 0x40 ; 64 - 1252: 30 e1 ldi r19, 0x10 ; 16 - 1254: 07 ed ldi r16, 0xD7 ; 215 - 1256: e3 e5 ldi r30, 0x53 ; 83 - 1258: be 2e mov r11, r30 - 125a: f4 e8 ldi r31, 0x84 ; 132 - 125c: af 2e mov r10, r31 - 125e: c3 e8 ldi r28, 0x83 ; 131 - 1260: 9c 2e mov r9, r28 - 1262: 17 2f mov r17, r23 - 1264: c6 2f mov r28, r22 - 1266: f7 01 movw r30, r14 - 1268: e6 1b sub r30, r22 - 126a: f1 09 sbc r31, r1 - 126c: 4e 17 cp r20, r30 - 126e: 5f 07 cpc r21, r31 - 1270: 08 f4 brcc .+2 ; 0x1274 - 1272: fa 01 movw r30, r20 - 1274: 30 93 66 06 sts 0x0666, r19 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1278: 00 93 a0 09 sts 0x09A0, r16 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 127c: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1280: d6 ff sbrs r29, 6 - 1282: fc cf rjmp .-8 ; 0x127c - 1284: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1288: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 128c: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1290: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1294: d6 ff sbrs r29, 6 - 1296: fc cf rjmp .-8 ; 0x1290 - 1298: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 129c: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12a0: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 12a4: d7 ff sbrs r29, 7 - 12a6: e6 cf rjmp .-52 ; 0x1274 - 12a8: 30 93 66 06 sts 0x0666, r19 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 12ac: b0 92 a0 09 sts 0x09A0, r11 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12b0: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12b4: d6 ff sbrs r29, 6 - 12b6: fc cf rjmp .-8 ; 0x12b0 - 12b8: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12bc: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12c0: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12c4: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12c8: d6 ff sbrs r29, 6 - 12ca: fc cf rjmp .-8 ; 0x12c4 - 12cc: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12d0: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12d4: 10 93 a0 09 sts 0x09A0, r17 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12d8: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12dc: d6 ff sbrs r29, 6 - 12de: fc cf rjmp .-8 ; 0x12d8 - 12e0: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12e4: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12e8: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12ec: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12f0: d6 ff sbrs r29, 6 - 12f2: fc cf rjmp .-8 ; 0x12ec - 12f4: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 12f8: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 12fc: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 1300: 20 93 66 06 sts 0x0666, r18 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1304: 80 93 a0 09 sts 0x09A0, r24 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1308: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 130c: d6 ff sbrs r29, 6 - 130e: fc cf rjmp .-8 ; 0x1308 - 1310: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1314: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1318: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 131c: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1320: d6 ff sbrs r29, 6 - 1322: fc cf rjmp .-8 ; 0x131c - 1324: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1328: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 132c: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 1330: d7 ff sbrs r29, 7 - 1332: e6 cf rjmp .-52 ; 0x1300 - 1334: 30 93 66 06 sts 0x0666, r19 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 1338: a0 92 a0 09 sts 0x09A0, r10 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 133c: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1340: d6 ff sbrs r29, 6 - 1342: fc cf rjmp .-8 ; 0x133c - 1344: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1348: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 134c: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1350: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1354: d6 ff sbrs r29, 6 - 1356: fc cf rjmp .-8 ; 0x1350 - 1358: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 135c: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1360: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1364: d0 91 a1 09 lds r29, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1368: d6 ff sbrs r29, 6 - 136a: fc cf rjmp .-8 ; 0x1364 - 136c: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1370: d0 91 a0 09 lds r29, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1374: c0 93 a0 09 sts 0x09A0, r28 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1378: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 137c: c6 ff sbrs r28, 6 - 137e: fc cf rjmp .-8 ; 0x1378 - 1380: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1384: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1388: ed 01 movw r28, r26 - 138a: 6d 01 movw r12, r26 - 138c: ce 0e add r12, r30 - 138e: df 1e adc r13, r31 - 1390: cc 15 cp r28, r12 - 1392: dd 05 cpc r29, r13 - 1394: 61 f0 breq .+24 ; 0x13ae - 1396: 89 90 ld r8, Y+ - 1398: 80 92 a0 09 sts 0x09A0, r8 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 139c: 80 90 a1 09 lds r8, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13a0: 86 fe sbrs r8, 6 - 13a2: fc cf rjmp .-8 ; 0x139c - 13a4: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13a8: 80 90 a0 09 lds r8, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13ac: f1 cf rjmp .-30 ; 0x1390 - 13ae: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 13b2: 20 93 66 06 sts 0x0666, r18 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 13b6: 80 93 a0 09 sts 0x09A0, r24 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13ba: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13be: c6 ff sbrs r28, 6 - 13c0: fc cf rjmp .-8 ; 0x13ba - 13c2: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13c6: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13ca: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13ce: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13d2: c6 ff sbrs r28, 6 - 13d4: fc cf rjmp .-8 ; 0x13ce - 13d6: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13da: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13de: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 13e2: c7 ff sbrs r28, 7 - 13e4: e6 cf rjmp .-52 ; 0x13b2 - 13e6: 30 93 66 06 sts 0x0666, r19 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 13ea: 90 92 a0 09 sts 0x09A0, r9 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13ee: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13f2: c6 ff sbrs r28, 6 - 13f4: fc cf rjmp .-8 ; 0x13ee - 13f6: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 13fa: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 13fe: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1402: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1406: c6 ff sbrs r28, 6 - 1408: fc cf rjmp .-8 ; 0x1402 - 140a: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 140e: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1412: 10 93 a0 09 sts 0x09A0, r17 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1416: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 141a: c6 ff sbrs r28, 6 - 141c: fc cf rjmp .-8 ; 0x1416 - 141e: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1422: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 1426: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 142a: c0 91 a1 09 lds r28, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 142e: c6 ff sbrs r28, 6 - 1430: fc cf rjmp .-8 ; 0x142a - 1432: 90 93 a1 09 sts 0x09A1, r25 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1436: c0 91 a0 09 lds r28, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 143a: 20 93 65 06 sts 0x0665, r18 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 143e: 4e 1b sub r20, r30 - 1440: 5f 0b sbc r21, r31 - 1442: 6e 0f add r22, r30 - 1444: 7f 1f adc r23, r31 - 1446: 41 15 cp r20, r1 - 1448: 51 05 cpc r21, r1 - 144a: 09 f0 breq .+2 ; 0x144e - 144c: 0a cf rjmp .-492 ; 0x1262 - 144e: df 91 pop r29 - 1450: cf 91 pop r28 - 1452: 1f 91 pop r17 - 1454: 0f 91 pop r16 - 1456: ff 90 pop r15 - 1458: ef 90 pop r14 - 145a: df 90 pop r13 - 145c: cf 90 pop r12 - 145e: bf 90 pop r11 - 1460: af 90 pop r10 - 1462: 9f 90 pop r9 - 1464: 8f 90 pop r8 - 1466: 08 95 ret - -00001468 : - 1468: 20 91 00 20 lds r18, 0x2000 ; 0x802000 - 146c: 22 23 and r18, r18 - 146e: 39 f0 breq .+14 ; 0x147e - 1470: 82 2f mov r24, r18 - 1472: 88 0f add r24, r24 - 1474: 88 0f add r24, r24 - 1476: 90 e0 ldi r25, 0x00 ; 0 - 1478: 24 e0 ldi r18, 0x04 ; 4 - 147a: 30 e0 ldi r19, 0x00 ; 0 - 147c: 04 c0 rjmp .+8 ; 0x1486 - 147e: 20 e1 ldi r18, 0x10 ; 16 - 1480: 30 e0 ldi r19, 0x00 ; 0 - 1482: 80 e0 ldi r24, 0x00 ; 0 - 1484: 90 e0 ldi r25, 0x00 ; 0 - 1486: bc 01 movw r22, r24 - 1488: 62 0f add r22, r18 - 148a: 73 1f adc r23, r19 - 148c: 30 e1 ldi r19, 0x10 ; 16 - 148e: 20 e4 ldi r18, 0x40 ; 64 - 1490: 40 e1 ldi r20, 0x10 ; 16 - 1492: 57 ed ldi r21, 0xD7 ; 215 - 1494: e1 e8 ldi r30, 0x81 ; 129 - 1496: 40 93 66 06 sts 0x0666, r20 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 149a: 50 93 a0 09 sts 0x09A0, r21 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 149e: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14a2: f6 ff sbrs r31, 6 - 14a4: fc cf rjmp .-8 ; 0x149e - 14a6: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14aa: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14ae: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14b2: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14b6: f6 ff sbrs r31, 6 - 14b8: fc cf rjmp .-8 ; 0x14b2 - 14ba: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14be: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14c2: 30 93 65 06 sts 0x0665, r19 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 14c6: f7 ff sbrs r31, 7 - 14c8: e6 cf rjmp .-52 ; 0x1496 - 14ca: 40 93 66 06 sts 0x0666, r20 ; 0x800666 <__TEXT_REGION_LENGTH__+0x700666> - 14ce: e0 93 a0 09 sts 0x09A0, r30 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14d2: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14d6: f6 ff sbrs r31, 6 - 14d8: fc cf rjmp .-8 ; 0x14d2 - 14da: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14de: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14e2: 90 93 a0 09 sts 0x09A0, r25 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14e6: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14ea: f6 ff sbrs r31, 6 - 14ec: fc cf rjmp .-8 ; 0x14e6 - 14ee: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14f2: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14f6: 80 93 a0 09 sts 0x09A0, r24 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 14fa: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 14fe: f6 ff sbrs r31, 6 - 1500: fc cf rjmp .-8 ; 0x14fa - 1502: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1506: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 150a: 10 92 a0 09 sts 0x09A0, r1 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 150e: f0 91 a1 09 lds r31, 0x09A1 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 1512: f6 ff sbrs r31, 6 - 1514: fc cf rjmp .-8 ; 0x150e - 1516: 20 93 a1 09 sts 0x09A1, r18 ; 0x8009a1 <__TEXT_REGION_LENGTH__+0x7009a1> - 151a: f0 91 a0 09 lds r31, 0x09A0 ; 0x8009a0 <__TEXT_REGION_LENGTH__+0x7009a0> - 151e: 30 93 65 06 sts 0x0665, r19 ; 0x800665 <__TEXT_REGION_LENGTH__+0x700665> - 1522: 01 96 adiw r24, 0x01 ; 1 - 1524: 86 17 cp r24, r22 - 1526: 97 07 cpc r25, r23 - 1528: 09 f0 breq .+2 ; 0x152c - 152a: b5 cf rjmp .-150 ; 0x1496 - 152c: 08 95 ret - -0000152e : - - // LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); - // LEDTrigger(LED_MEMORY_STORED, LED_PULSE); -} - -bool MemoryUploadBlock(void* Buffer, uint16_t BlockAddress, uint16_t ByteCount) { - 152e: fa 01 movw r30, r20 - if ( GlobalSettings.ActiveSetting == 0 ) { - 1530: 20 91 00 20 lds r18, 0x2000 ; 0x802000 - 1534: 21 11 cpse r18, r1 - 1536: 07 c0 rjmp .+14 ; 0x1546 - if (BlockAddress >= MEMORY_SIZE_PER_SETTING_4K) { - 1538: 61 15 cp r22, r1 - 153a: 20 e1 ldi r18, 0x10 ; 16 - 153c: 72 07 cpc r23, r18 - 153e: 88 f4 brcc .+34 ; 0x1562 - /* Prevent writing out of bounds by silently ignoring it */ - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint16_t BytesLeft = MEMORY_SIZE_PER_SETTING_4K - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - 1540: 20 e0 ldi r18, 0x00 ; 0 - 1542: 30 e1 ldi r19, 0x10 ; 16 - 1544: 06 c0 rjmp .+12 ; 0x1552 - MemoryWriteBlock(Buffer, BlockAddress, ByteCount); - return true; - } - } else { - if (BlockAddress >= MEMORY_SIZE_PER_SETTING_1K) { - 1546: 61 15 cp r22, r1 - 1548: 24 e0 ldi r18, 0x04 ; 4 - 154a: 72 07 cpc r23, r18 - 154c: 50 f4 brcc .+20 ; 0x1562 - /* Prevent writing out of bounds by silently ignoring it */ - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint16_t BytesLeft = MEMORY_SIZE_PER_SETTING_1K - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - 154e: 20 e0 ldi r18, 0x00 ; 0 - 1550: 34 e0 ldi r19, 0x04 ; 4 - 1552: a9 01 movw r20, r18 - 1554: 46 1b sub r20, r22 - 1556: 57 0b sbc r21, r23 - 1558: e4 17 cp r30, r20 - 155a: f5 07 cpc r31, r21 - 155c: 08 f4 brcc .+2 ; 0x1560 - 155e: af 01 movw r20, r30 - MemoryWriteBlock(Buffer, BlockAddress, ByteCount); - 1560: 56 de rcall .-852 ; 0x120e - return true; - } - } -} - 1562: 81 e0 ldi r24, 0x01 ; 1 - 1564: 08 95 ret - -00001566 : - -bool MemoryDownloadBlock(void* Buffer, uint16_t BlockAddress, uint16_t ByteCount) { - 1566: fa 01 movw r30, r20 - if ( GlobalSettings.ActiveSetting == 0 ) { - 1568: 20 91 00 20 lds r18, 0x2000 ; 0x802000 - 156c: 21 11 cpse r18, r1 - 156e: 07 c0 rjmp .+14 ; 0x157e - if (BlockAddress >= MEMORY_SIZE_PER_SETTING_4K) { - 1570: 61 15 cp r22, r1 - 1572: 20 e1 ldi r18, 0x10 ; 16 - 1574: 72 07 cpc r23, r18 - 1576: 98 f4 brcc .+38 ; 0x159e - /* 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 */ - uint16_t BytesLeft = MEMORY_SIZE_PER_SETTING_4K - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - 1578: 20 e0 ldi r18, 0x00 ; 0 - 157a: 30 e1 ldi r19, 0x10 ; 16 - 157c: 06 c0 rjmp .+12 ; 0x158a - MemoryReadBlock(Buffer, BlockAddress, ByteCount); - return true; - } - } else { - if (BlockAddress >= MEMORY_SIZE_PER_SETTING_1K) { - 157e: 61 15 cp r22, r1 - 1580: 24 e0 ldi r18, 0x04 ; 4 - 1582: 72 07 cpc r23, r18 - 1584: 60 f4 brcc .+24 ; 0x159e - /* 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 */ - uint16_t BytesLeft = MEMORY_SIZE_PER_SETTING_1K - BlockAddress; - ByteCount = MIN(ByteCount, BytesLeft); - 1586: 20 e0 ldi r18, 0x00 ; 0 - 1588: 34 e0 ldi r19, 0x04 ; 4 - 158a: a9 01 movw r20, r18 - 158c: 46 1b sub r20, r22 - 158e: 57 0b sbc r21, r23 - 1590: e4 17 cp r30, r20 - 1592: f5 07 cpc r31, r21 - 1594: 08 f4 brcc .+2 ; 0x1598 - 1596: af 01 movw r20, r30 - MemoryReadBlock(Buffer, BlockAddress, ByteCount); - 1598: af dd rcall .-1186 ; 0x10f8 - return true; - 159a: 81 e0 ldi r24, 0x01 ; 1 - 159c: 08 95 ret - -bool MemoryDownloadBlock(void* Buffer, uint16_t BlockAddress, uint16_t ByteCount) { - if ( GlobalSettings.ActiveSetting == 0 ) { - if (BlockAddress >= MEMORY_SIZE_PER_SETTING_4K) { - /* There are bytes out of bounds to be read. Notify that we are done. */ - return false; - 159e: 80 e0 ldi r24, 0x00 ; 0 - ByteCount = MIN(ByteCount, BytesLeft); - MemoryReadBlock(Buffer, BlockAddress, ByteCount); - return true; - } - } -} - 15a0: 08 95 ret - -000015a2 : - BUTTON_PORT.DIRCLR = BUTTON_MASK; - BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; -} - -static void ExecuteButtonAction(ButtonActionEnum ButtonAction) -{ - 15a2: 0f 93 push r16 - 15a4: 1f 93 push r17 - 15a6: cf 93 push r28 - 15a8: df 93 push r29 - 15aa: cd b7 in r28, 0x3d ; 61 - 15ac: de b7 in r29, 0x3e ; 62 - 15ae: a0 97 sbiw r28, 0x20 ; 32 - 15b0: cd bf out 0x3d, r28 ; 61 - 15b2: de bf out 0x3e, r29 ; 62 - uint8_t UidBuffer[32]; - - if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { - 15b4: 81 30 cpi r24, 0x01 ; 1 - 15b6: 81 f4 brne .+32 ; 0x15d8 - 15b8: 10 e0 ldi r17, 0x00 ; 0 - for (uint8_t i=0; i - 15be: 18 17 cp r17, r24 - 15c0: 08 f0 brcs .+2 ; 0x15c4 - 15c2: 99 c0 rjmp .+306 ; 0x16f6 - UidBuffer[i] = RandomGetByte(); - 15c4: 85 dc rcall .-1782 ; 0xed0 - 15c6: e1 e0 ldi r30, 0x01 ; 1 - 15c8: f0 e0 ldi r31, 0x00 ; 0 - 15ca: ec 0f add r30, r28 - 15cc: fd 1f adc r31, r29 - 15ce: e1 0f add r30, r17 - 15d0: f1 1d adc r31, r1 - 15d2: 80 83 st Z, r24 -static void ExecuteButtonAction(ButtonActionEnum ButtonAction) -{ - uint8_t UidBuffer[32]; - - if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { - for (uint8_t i=0; i - UidBuffer[i] = RandomGetByte(); - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { - 15d8: 82 30 cpi r24, 0x02 ; 2 - 15da: b9 f5 brne .+110 ; 0x164a -INLINE void ApplicationReset(void) { - ActiveConfiguration.ApplicationResetFunc(); -} - -INLINE void ApplicationGetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationGetUidFunc(Uid); - 15dc: e0 91 4a 21 lds r30, 0x214A ; 0x80214a - 15e0: f0 91 4b 21 lds r31, 0x214B ; 0x80214b - 15e4: 8e 01 movw r16, r28 - 15e6: 0f 5f subi r16, 0xFF ; 255 - 15e8: 1f 4f sbci r17, 0xFF ; 255 - 15ea: c8 01 movw r24, r16 - 15ec: 09 95 icall - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i; - - for (i=0; i - 15f2: f8 01 movw r30, r16 - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - 15f4: 91 e0 ldi r25, 0x01 ; 1 - 15f6: 8e 2f mov r24, r30 - 15f8: 80 1b sub r24, r16 - uint8_t i; - - for (i=0; i - if (Carry) { - 15fe: 99 23 and r25, r25 - 1600: 39 f0 breq .+14 ; 0x1610 - if (UidBuffer[i] == 0xFF) { - 1602: 80 81 ld r24, Z - 1604: 91 e0 ldi r25, 0x01 ; 1 - 1606: 8f 3f cpi r24, 0xFF ; 255 - 1608: 09 f0 breq .+2 ; 0x160c - 160a: 90 e0 ldi r25, 0x00 ; 0 - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - 160c: 8f 5f subi r24, 0xFF ; 255 - 160e: 80 83 st Z, r24 - 1610: 31 96 adiw r30, 0x01 ; 1 - 1612: f1 cf rjmp .-30 ; 0x15f6 - UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - } - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - 1614: 84 30 cpi r24, 0x04 ; 4 - 1616: 09 f0 breq .+2 ; 0x161a - 1618: 49 c0 rjmp .+146 ; 0x16ac - 161a: e0 91 4a 21 lds r30, 0x214A ; 0x80214a - 161e: f0 91 4b 21 lds r31, 0x214B ; 0x80214b - 1622: 8e 01 movw r16, r28 - 1624: 0f 5f subi r16, 0xFF ; 255 - 1626: 1f 4f sbci r17, 0xFF ; 255 - 1628: c8 01 movw r24, r16 - 162a: 09 95 icall - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i; - - for (i=0; i - 1630: f8 01 movw r30, r16 - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - 1632: 91 e0 ldi r25, 0x01 ; 1 - 1634: 8e 2f mov r24, r30 - 1636: 80 1b sub r24, r16 - uint8_t i; - - for (i=0; i -} - -INLINE void ApplicationSetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationSetUidFunc(Uid); - 163c: e0 91 4c 21 lds r30, 0x214C ; 0x80214c - 1640: f0 91 4d 21 lds r31, 0x214D ; 0x80214d - 1644: c8 01 movw r24, r16 - 1646: 09 95 icall - 1648: 60 c0 rjmp .+192 ; 0x170a - UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - } - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { - 164a: 83 30 cpi r24, 0x03 ; 3 - 164c: 19 f7 brne .-58 ; 0x1614 -INLINE void ApplicationReset(void) { - ActiveConfiguration.ApplicationResetFunc(); -} - -INLINE void ApplicationGetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationGetUidFunc(Uid); - 164e: e0 91 4a 21 lds r30, 0x214A ; 0x80214a - 1652: f0 91 4b 21 lds r31, 0x214B ; 0x80214b - 1656: ce 01 movw r24, r28 - 1658: 01 96 adiw r24, 0x01 ; 1 - 165a: 09 95 icall - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i = ActiveConfiguration.UidSize; - 165c: 80 91 50 21 lds r24, 0x2150 ; 0x802150 - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - 1660: 41 e0 ldi r20, 0x01 ; 1 - uint8_t i = ActiveConfiguration.UidSize; - - while(i-- > 0) { - 1662: 81 50 subi r24, 0x01 ; 1 - 1664: 08 f4 brcc .+2 ; 0x1668 - 1666: 47 c0 rjmp .+142 ; 0x16f6 - if (Carry) { - 1668: 44 23 and r20, r20 - 166a: d9 f3 breq .-10 ; 0x1662 - if (UidBuffer[i] == 0xFF) { - 166c: 28 2f mov r18, r24 - 166e: 30 e0 ldi r19, 0x00 ; 0 - 1670: e1 e0 ldi r30, 0x01 ; 1 - 1672: f0 e0 ldi r31, 0x00 ; 0 - 1674: ec 0f add r30, r28 - 1676: fd 1f adc r31, r29 - 1678: e2 0f add r30, r18 - 167a: f3 1f adc r31, r19 - 167c: 90 81 ld r25, Z - 167e: 41 e0 ldi r20, 0x01 ; 1 - 1680: 9f 3f cpi r25, 0xFF ; 255 - 1682: 09 f0 breq .+2 ; 0x1686 - 1684: 40 e0 ldi r20, 0x00 ; 0 - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - 1686: e1 e0 ldi r30, 0x01 ; 1 - 1688: f0 e0 ldi r31, 0x00 ; 0 - 168a: ec 0f add r30, r28 - 168c: fd 1f adc r31, r29 - 168e: e2 0f add r30, r18 - 1690: f3 1f adc r31, r19 - 1692: 9f 5f subi r25, 0xFF ; 255 - 1694: 90 83 st Z, r25 - 1696: e5 cf rjmp .-54 ; 0x1662 - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i; - - for (i=0; i - if (UidBuffer[i] == 0x00) { - 169c: 80 81 ld r24, Z - 169e: 91 e0 ldi r25, 0x01 ; 1 - 16a0: 81 11 cpse r24, r1 - 16a2: 90 e0 ldi r25, 0x00 ; 0 - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; - 16a4: 81 50 subi r24, 0x01 ; 1 - 16a6: 80 83 st Z, r24 - 16a8: 31 96 adiw r30, 0x01 ; 1 - 16aa: c4 cf rjmp .-120 ; 0x1634 - } - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { - 16ac: 85 30 cpi r24, 0x05 ; 5 - 16ae: 51 f5 brne .+84 ; 0x1704 - 16b0: e0 91 4a 21 lds r30, 0x214A ; 0x80214a - 16b4: f0 91 4b 21 lds r31, 0x214B ; 0x80214b - 16b8: ce 01 movw r24, r28 - 16ba: 01 96 adiw r24, 0x01 ; 1 - 16bc: 09 95 icall - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i = ActiveConfiguration.UidSize; - 16be: 80 91 50 21 lds r24, 0x2150 ; 0x802150 - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - 16c2: 41 e0 ldi r20, 0x01 ; 1 - uint8_t i = ActiveConfiguration.UidSize; - - while(i-- > 0) { - 16c4: 81 50 subi r24, 0x01 ; 1 - 16c6: b8 f0 brcs .+46 ; 0x16f6 - if (Carry) { - 16c8: 44 23 and r20, r20 - 16ca: e1 f3 breq .-8 ; 0x16c4 - if (UidBuffer[i] == 0x00) { - 16cc: 28 2f mov r18, r24 - 16ce: 30 e0 ldi r19, 0x00 ; 0 - 16d0: e1 e0 ldi r30, 0x01 ; 1 - 16d2: f0 e0 ldi r31, 0x00 ; 0 - 16d4: ec 0f add r30, r28 - 16d6: fd 1f adc r31, r29 - 16d8: e2 0f add r30, r18 - 16da: f3 1f adc r31, r19 - 16dc: 90 81 ld r25, Z - 16de: 41 e0 ldi r20, 0x01 ; 1 - 16e0: 91 11 cpse r25, r1 - 16e2: 40 e0 ldi r20, 0x00 ; 0 - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; - 16e4: e1 e0 ldi r30, 0x01 ; 1 - 16e6: f0 e0 ldi r31, 0x00 ; 0 - 16e8: ec 0f add r30, r28 - 16ea: fd 1f adc r31, r29 - 16ec: e2 0f add r30, r18 - 16ee: f3 1f adc r31, r19 - 16f0: 91 50 subi r25, 0x01 ; 1 - 16f2: 90 83 st Z, r25 - 16f4: e7 cf rjmp .-50 ; 0x16c4 -} - -INLINE void ApplicationSetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationSetUidFunc(Uid); - 16f6: e0 91 4c 21 lds r30, 0x214C ; 0x80214c - 16fa: f0 91 4d 21 lds r31, 0x214D ; 0x80214d - 16fe: ce 01 movw r24, r28 - 1700: 01 96 adiw r24, 0x01 ; 1 - 1702: a1 cf rjmp .-190 ; 0x1646 - } - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { - 1704: 86 30 cpi r24, 0x06 ; 6 - 1706: 09 f4 brne .+2 ; 0x170a - SettingsCycle(); - 1708: ce d0 rcall .+412 ; 0x18a6 - } -} - 170a: a0 96 adiw r28, 0x20 ; 32 - 170c: cd bf out 0x3d, r28 ; 61 - 170e: de bf out 0x3e, r29 ; 62 - 1710: df 91 pop r29 - 1712: cf 91 pop r28 - 1714: 1f 91 pop r17 - 1716: 0f 91 pop r16 - 1718: 08 95 ret - -0000171a : - [BUTTON_ACTION_CYCLE_SETTINGS] = "SWITCHCARD" -}; - -void ButtonInit(void) -{ - BUTTON_PORT.DIRCLR = BUTTON_MASK; - 171a: e0 e0 ldi r30, 0x00 ; 0 - 171c: f6 e0 ldi r31, 0x06 ; 6 - 171e: 80 e4 ldi r24, 0x40 ; 64 - 1720: 82 83 std Z+2, r24 ; 0x02 - BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; - 1722: 88 e1 ldi r24, 0x18 ; 24 - 1724: 86 8b std Z+22, r24 ; 0x16 - 1726: 08 95 ret - -00001728 : - -void ButtonTick(void) -{ - //static uint8_t LastButtonState = 0; - static uint8_t PressTickCounter = 0; - uint8_t ThisButtonState = ~BUTTON_PORT.IN; - 1728: 90 91 08 06 lds r25, 0x0608 ; 0x800608 <__TEXT_REGION_LENGTH__+0x700608> - 172c: 80 91 4c 20 lds r24, 0x204C ; 0x80204c <__data_end> - //uint8_t ThisButtonChange = ThisButtonState ^ LastButtonState; - //uint8_t ThisButtonPress = ThisButtonChange & ThisButtonState; - //LastButtonState = ThisButtonState; - - if (ThisButtonState & BUTTON_MASK) { - 1730: 96 fd sbrc r25, 6 - 1732: 10 c0 rjmp .+32 ; 0x1754 - /* Button is currently pressed */ - if (PressTickCounter < LONG_PRESS_TICK_COUNT) { - 1734: 8a 30 cpi r24, 0x0A ; 10 - 1736: 50 f0 brcs .+20 ; 0x174c - /* Count ticks while button is being pressed */ - PressTickCounter++; - } else if (PressTickCounter == LONG_PRESS_TICK_COUNT) { - 1738: 8a 30 cpi r24, 0x0A ; 10 - 173a: b9 f4 brne .+46 ; 0x176a - /* Long button press detected execute button action and advance PressTickCounter - * to an invalid state. */ - ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonLongAction); - 173c: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 1740: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 1744: 81 81 ldd r24, Z+1 ; 0x01 - 1746: 2d df rcall .-422 ; 0x15a2 - PressTickCounter++; - 1748: 80 91 4c 20 lds r24, 0x204C ; 0x80204c <__data_end> - 174c: 8f 5f subi r24, 0xFF ; 255 - 174e: 80 93 4c 20 sts 0x204C, r24 ; 0x80204c <__data_end> - 1752: 08 95 ret - /* Button is still pressed, ignore */ - } - } else if (!(ThisButtonState & BUTTON_MASK)) { - /* Button is currently not being pressed. Check if PressTickCounter contains - * a recent short button press. */ - if ( (PressTickCounter > 0) && (PressTickCounter <= LONG_PRESS_TICK_COUNT) ) { - 1754: 81 50 subi r24, 0x01 ; 1 - 1756: 8a 30 cpi r24, 0x0A ; 10 - 1758: 30 f4 brcc .+12 ; 0x1766 - /* We have a short button press */ - ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonAction); - 175a: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 175e: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 1762: 80 81 ld r24, Z - 1764: 1e df rcall .-452 ; 0x15a2 - } - - PressTickCounter = 0; - 1766: 10 92 4c 20 sts 0x204C, r1 ; 0x80204c <__data_end> - 176a: 08 95 ret - -0000176c : - } -} - -void ButtonGetActionList(char* ListOut, uint16_t BufferSize) -{ - 176c: cf 93 push r28 - uint8_t i; - - /* Account for '\0' */ - BufferSize--; - 176e: 61 50 subi r22, 0x01 ; 1 - 1770: 71 09 sbc r23, r1 - 1772: 47 e1 ldi r20, 0x17 ; 23 - 1774: 56 e0 ldi r21, 0x06 ; 6 - - for (i=0; i sizeof(ButtonActionTable[i]) ) { - 1780: 34 91 lpm r19, Z - 1782: 31 11 cpse r19, r1 - 1784: 08 c0 rjmp .+16 ; 0x1796 - *ListOut++ = c; - ActionName++; - BufferSize--; - } - - if ( i < (BUTTON_ACTION_COUNT - 1) ) { - 1786: 26 30 cpi r18, 0x06 ; 6 - 1788: 71 f0 breq .+28 ; 0x17a6 - /* No comma on last configuration */ - *ListOut++ = ','; - 178a: cd 01 movw r24, r26 - 178c: 01 96 adiw r24, 0x01 ; 1 - 178e: cc 93 st X, r28 - BufferSize--; - 1790: 61 50 subi r22, 0x01 ; 1 - 1792: 71 09 sbc r23, r1 - 1794: 08 c0 rjmp .+16 ; 0x17a6 - - for (i=0; i sizeof(ButtonActionTable[i]) ) { - 1796: 61 32 cpi r22, 0x21 ; 33 - 1798: 71 05 cpc r23, r1 - 179a: a8 f3 brcs .-22 ; 0x1786 - /* While not end-of-string and enough buffer to - * put a complete configuration name */ - *ListOut++ = c; - 179c: 3d 93 st X+, r19 - ActionName++; - 179e: 31 96 adiw r30, 0x01 ; 1 - BufferSize--; - 17a0: 61 50 subi r22, 0x01 ; 1 - 17a2: 71 09 sbc r23, r1 - 17a4: ec cf rjmp .-40 ; 0x177e - uint8_t i; - - /* Account for '\0' */ - BufferSize--; - - for (i=0; i - *ListOut++ = ','; - BufferSize--; - } - } - - *ListOut = '\0'; - 17b0: fc 01 movw r30, r24 - 17b2: 10 82 st Z, r1 -} - 17b4: cf 91 pop r28 - 17b6: 08 95 ret - -000017b8 : - -void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action) -{ - #ifndef BUTTON_SETTING_GLOBAL - if (Type == BUTTON_PRESS_SHORT) { - 17b8: 81 11 cpse r24, r1 - 17ba: 06 c0 rjmp .+12 ; 0x17c8 - GlobalSettings.ActiveSettingPtr->ButtonAction = Action; - 17bc: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 17c0: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 17c4: 60 83 st Z, r22 - 17c6: 08 95 ret - } else if (Type == BUTTON_PRESS_LONG) { - 17c8: 81 30 cpi r24, 0x01 ; 1 - 17ca: 29 f4 brne .+10 ; 0x17d6 - GlobalSettings.ActiveSettingPtr->ButtonLongAction = Action; - 17cc: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 17d0: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 17d4: 61 83 std Z+1, r22 ; 0x01 - 17d6: 08 95 ret - -000017d8 : - } - #endif -} - -void ButtonGetActionByName(ButtonTypeEnum Type, char* ActionOut, uint16_t BufferSize) -{ - 17d8: 28 2f mov r18, r24 - 17da: cb 01 movw r24, r22 - if (Type == BUTTON_PRESS_SHORT) { - 17dc: 21 11 cpse r18, r1 - 17de: 0a c0 rjmp .+20 ; 0x17f4 - strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonAction], BufferSize); - 17e0: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 17e4: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 17e8: 20 81 ld r18, Z - 17ea: 60 e2 ldi r22, 0x20 ; 32 - 17ec: 26 9f mul r18, r22 - 17ee: 90 01 movw r18, r0 - 17f0: 11 24 eor r1, r1 - 17f2: 0b c0 rjmp .+22 ; 0x180a - } else if (Type == BUTTON_PRESS_LONG) { - 17f4: 21 30 cpi r18, 0x01 ; 1 - 17f6: 71 f4 brne .+28 ; 0x1814 - strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonLongAction], BufferSize); - 17f8: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 17fc: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 1800: 21 81 ldd r18, Z+1 ; 0x01 - 1802: e0 e2 ldi r30, 0x20 ; 32 - 1804: 2e 9f mul r18, r30 - 1806: 90 01 movw r18, r0 - 1808: 11 24 eor r1, r1 - 180a: b9 01 movw r22, r18 - 180c: 69 5e subi r22, 0xE9 ; 233 - 180e: 79 4f sbci r23, 0xF9 ; 249 - 1810: 0c 94 68 2a jmp 0x54d0 ; 0x54d0 - } else { - /* Should not happen (TM) */ - *ActionOut = '\0'; - 1814: fb 01 movw r30, r22 - 1816: 10 82 st Z, r1 - 1818: 08 95 ret - -0000181a : - } -} - -bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action) -{ - 181a: ef 92 push r14 - 181c: ff 92 push r15 - 181e: 0f 93 push r16 - 1820: 1f 93 push r17 - 1822: cf 93 push r28 - 1824: df 93 push r29 - 1826: d8 2f mov r29, r24 - 1828: 7b 01 movw r14, r22 - 182a: 07 e1 ldi r16, 0x17 ; 23 - 182c: 16 e0 ldi r17, 0x06 ; 6 - uint8_t i; - - for (i=0; i - 1838: 89 2b or r24, r25 - 183a: 29 f4 brne .+10 ; 0x1846 - ButtonSetActionById(Type, i); - 183c: 6c 2f mov r22, r28 - 183e: 8d 2f mov r24, r29 - 1840: bb df rcall .-138 ; 0x17b8 - return true; - 1842: 81 e0 ldi r24, 0x01 ; 1 - 1844: 06 c0 rjmp .+12 ; 0x1852 - -bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action) -{ - uint8_t i; - - for (i=0; i - return true; - } - } - - /* Button action not found */ - return false; - 1850: 80 e0 ldi r24, 0x00 ; 0 -} - 1852: df 91 pop r29 - 1854: cf 91 pop r28 - 1856: 1f 91 pop r17 - 1858: 0f 91 pop r16 - 185a: ff 90 pop r15 - 185c: ef 90 pop r14 - 185e: 08 95 ret - -00001860 : - } -} - -uint8_t SettingsGetActiveById(void) { - return GlobalSettings.ActiveSetting; -} - 1860: 4b e2 ldi r20, 0x2B ; 43 - 1862: 50 e0 ldi r21, 0x00 ; 0 - 1864: 60 e0 ldi r22, 0x00 ; 0 - 1866: 70 e0 ldi r23, 0x00 ; 0 - 1868: 80 e0 ldi r24, 0x00 ; 0 - 186a: 90 e2 ldi r25, 0x20 ; 32 - 186c: 0c 94 30 2d jmp 0x5a60 ; 0x5a60 - -00001870 : - 1870: 4b e2 ldi r20, 0x2B ; 43 - 1872: 50 e0 ldi r21, 0x00 ; 0 - 1874: 60 e0 ldi r22, 0x00 ; 0 - 1876: 70 e0 ldi r23, 0x00 ; 0 - 1878: 80 e0 ldi r24, 0x00 ; 0 - 187a: 90 e2 ldi r25, 0x20 ; 32 - 187c: 0c 94 3b 2d jmp 0x5a76 ; 0x5a76 - -00001880 : - 1880: 88 30 cpi r24, 0x08 ; 8 - 1882: 78 f4 brcc .+30 ; 0x18a2 - 1884: 80 93 00 20 sts 0x2000, r24 ; 0x802000 - 1888: 25 e0 ldi r18, 0x05 ; 5 - 188a: 82 9f mul r24, r18 - 188c: c0 01 movw r24, r0 - 188e: 11 24 eor r1, r1 - 1890: 8d 5f subi r24, 0xFD ; 253 - 1892: 9f 4d sbci r25, 0xDF ; 223 - 1894: 80 93 01 20 sts 0x2001, r24 ; 0x802001 - 1898: 90 93 02 20 sts 0x2002, r25 ; 0x802002 - 189c: db da rcall .-2634 ; 0xe54 - 189e: 81 e0 ldi r24, 0x01 ; 1 - 18a0: 08 95 ret - 18a2: 80 e0 ldi r24, 0x00 ; 0 - 18a4: 08 95 ret - -000018a6 : - 18a6: 30 91 00 20 lds r19, 0x2000 ; 0x802000 - 18aa: 29 e0 ldi r18, 0x09 ; 9 - 18ac: 45 e0 ldi r20, 0x05 ; 5 - 18ae: 21 50 subi r18, 0x01 ; 1 - 18b0: b1 f0 breq .+44 ; 0x18de - 18b2: 83 2f mov r24, r19 - 18b4: 90 e0 ldi r25, 0x00 ; 0 - 18b6: 01 96 adiw r24, 0x01 ; 1 - 18b8: 87 70 andi r24, 0x07 ; 7 - 18ba: 99 27 eor r25, r25 - 18bc: 38 2f mov r19, r24 - 18be: bc 01 movw r22, r24 - 18c0: 6f 5f subi r22, 0xFF ; 255 - 18c2: 7f 4f sbci r23, 0xFF ; 255 - 18c4: 46 9f mul r20, r22 - 18c6: f0 01 movw r30, r0 - 18c8: 47 9f mul r20, r23 - 18ca: f0 0d add r31, r0 - 18cc: 11 24 eor r1, r1 - 18ce: e0 50 subi r30, 0x00 ; 0 - 18d0: f0 4e sbci r31, 0xE0 ; 224 - 18d2: 50 81 ld r21, Z - 18d4: 55 23 and r21, r21 - 18d6: 59 f3 breq .-42 ; 0x18ae - 18d8: d3 df rcall .-90 ; 0x1880 - 18da: 81 11 cpse r24, r1 - 18dc: c9 cf rjmp .-110 ; 0x1870 - 18de: 08 95 ret - -000018e0 : - -void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize) { - 18e0: fc 01 movw r30, r24 - SettingOut[0] = 'N'; - 18e2: 8e e4 ldi r24, 0x4E ; 78 - 18e4: 80 83 st Z, r24 - SettingOut[1] = 'O'; - 18e6: 8f e4 ldi r24, 0x4F ; 79 - 18e8: 81 83 std Z+1, r24 ; 0x01 - SettingOut[2] = '.'; - 18ea: 8e e2 ldi r24, 0x2E ; 46 - 18ec: 82 83 std Z+2, r24 ; 0x02 - SettingOut[3] = SettingsGetActiveById() + '0'; - 18ee: 80 91 00 20 lds r24, 0x2000 ; 0x802000 - 18f2: 80 5d subi r24, 0xD0 ; 208 - 18f4: 83 83 std Z+3, r24 ; 0x03 - SettingOut[4] = '\0'; - 18f6: 14 82 std Z+4, r1 ; 0x04 - 18f8: 08 95 ret - -000018fa : -} - -bool SettingsSetActiveByName(const char* Setting) { - 18fa: fc 01 movw r30, r24 - uint8_t SettingNr = Setting[0] - '0'; - 18fc: 90 81 ld r25, Z - - if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - 18fe: 81 81 ldd r24, Z+1 ; 0x01 - 1900: 81 11 cpse r24, r1 - 1902: 05 c0 rjmp .+10 ; 0x190e - SettingOut[3] = SettingsGetActiveById() + '0'; - SettingOut[4] = '\0'; -} - -bool SettingsSetActiveByName(const char* Setting) { - uint8_t SettingNr = Setting[0] - '0'; - 1904: 80 ed ldi r24, 0xD0 ; 208 - 1906: 89 0f add r24, r25 - - if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - 1908: 88 30 cpi r24, 0x08 ; 8 - 190a: 08 f4 brcc .+2 ; 0x190e - return SettingsSetActiveById(SettingNr); - 190c: b9 cf rjmp .-142 ; 0x1880 - } else { - return false; - } -} - 190e: 80 e0 ldi r24, 0x00 ; 0 - 1910: 08 95 ret - -00001912 : -#include "Map.h" - -bool MapIdToText(const MapEntryType* MapPtr, uint8_t MapSize, MapIdType Id, char* Text, uint16_t MaxBufferSize) -{ - 1912: 0f 93 push r16 - 1914: 1f 93 push r17 - 1916: fc 01 movw r30, r24 - while (MapSize--) { - 1918: 66 23 and r22, r22 - 191a: 79 f0 breq .+30 ; 0x193a - if (pgm_read_byte(&MapPtr->Id) == Id) { - 191c: 94 91 lpm r25, Z - 191e: 61 50 subi r22, 0x01 ; 1 - 1920: 94 13 cpse r25, r20 - 1922: 09 c0 rjmp .+18 ; 0x1936 - strncpy_P(Text, MapPtr->Text, MaxBufferSize); - 1924: bf 01 movw r22, r30 - 1926: 6f 5f subi r22, 0xFF ; 255 - 1928: 7f 4f sbci r23, 0xFF ; 255 - 192a: a8 01 movw r20, r16 - 192c: c9 01 movw r24, r18 - 192e: 0e 94 68 2a call 0x54d0 ; 0x54d0 - return true; - 1932: 81 e0 ldi r24, 0x01 ; 1 - 1934: 03 c0 rjmp .+6 ; 0x193c - } - - MapPtr++; - 1936: b1 96 adiw r30, 0x21 ; 33 - 1938: ef cf rjmp .-34 ; 0x1918 - } - - return false; - 193a: 80 e0 ldi r24, 0x00 ; 0 -} - 193c: 1f 91 pop r17 - 193e: 0f 91 pop r16 - 1940: 08 95 ret - -00001942 : - -bool MapTextToId(const MapEntryType* MapPtr, uint8_t MapSize, MapTextPtrType Text, MapIdType* IdPtr) -{ - 1942: cf 92 push r12 - 1944: df 92 push r13 - 1946: ef 92 push r14 - 1948: ff 92 push r15 - 194a: 1f 93 push r17 - 194c: cf 93 push r28 - 194e: df 93 push r29 - 1950: ec 01 movw r28, r24 - 1952: 7a 01 movw r14, r20 - 1954: 69 01 movw r12, r18 - while (MapSize--) { - 1956: 16 2f mov r17, r22 - 1958: 11 23 and r17, r17 - 195a: 89 f0 breq .+34 ; 0x197e - 195c: be 01 movw r22, r28 - 195e: 6f 5f subi r22, 0xFF ; 255 - 1960: 7f 4f sbci r23, 0xFF ; 255 - if (strcmp_P(Text, MapPtr->Text) == 0) { - 1962: c7 01 movw r24, r14 - 1964: 0e 94 5f 2a call 0x54be ; 0x54be - 1968: 11 50 subi r17, 0x01 ; 1 - 196a: 89 2b or r24, r25 - 196c: 31 f4 brne .+12 ; 0x197a - if (sizeof(MapIdType) == 1) { - *IdPtr = pgm_read_byte(&MapPtr->Id); - 196e: fe 01 movw r30, r28 - 1970: c4 91 lpm r28, Z - 1972: f6 01 movw r30, r12 - 1974: c0 83 st Z, r28 - } else if (sizeof(MapIdType) == 2) { - *IdPtr = pgm_read_word(&MapPtr->Id); - } - return true; - 1976: 81 e0 ldi r24, 0x01 ; 1 - 1978: 03 c0 rjmp .+6 ; 0x1980 - } - - MapPtr++; - 197a: a1 96 adiw r28, 0x21 ; 33 - 197c: ed cf rjmp .-38 ; 0x1958 - } - - return false; - 197e: 80 e0 ldi r24, 0x00 ; 0 -} - 1980: df 91 pop r29 - 1982: cf 91 pop r28 - 1984: 1f 91 pop r17 - 1986: ff 90 pop r15 - 1988: ef 90 pop r14 - 198a: df 90 pop r13 - 198c: cf 90 pop r12 - 198e: 08 95 ret - -00001990 : - -void MapToString(MapEntryType* MapPtr, uint8_t MapSize, char* String, uint16_t MaxBufferSize) -{ - 1990: cf 93 push r28 - 1992: 01 96 adiw r24, 0x01 ; 1 - /* More than one map entries left */ - if (BytesLeft == 0) { - return; - } - - *String++ = ','; - 1994: cc e2 ldi r28, 0x2C ; 44 -void MapToString(MapEntryType* MapPtr, uint8_t MapSize, char* String, uint16_t MaxBufferSize) -{ - uint8_t EntriesLeft = MapSize; - uint16_t BytesLeft = MaxBufferSize; - - while (EntriesLeft > 0) { - 1996: 66 23 and r22, r22 - 1998: c9 f0 breq .+50 ; 0x19cc - const char* Text = MapPtr->Text; - 199a: fc 01 movw r30, r24 - 199c: da 01 movw r26, r20 - 199e: ad 01 movw r20, r26 - char c; - - while( (c = pgm_read_byte(Text)) != '\0') { - 19a0: 74 91 lpm r23, Z - 19a2: 77 23 and r23, r23 - 19a4: 41 f0 breq .+16 ; 0x19b6 - if (BytesLeft == 0) { - 19a6: 21 15 cp r18, r1 - 19a8: 31 05 cpc r19, r1 - 19aa: a1 f0 breq .+40 ; 0x19d4 - return; - } - - *String++ = c; - 19ac: 7d 93 st X+, r23 - Text++; - 19ae: 31 96 adiw r30, 0x01 ; 1 - BytesLeft--; - 19b0: 21 50 subi r18, 0x01 ; 1 - 19b2: 31 09 sbc r19, r1 - 19b4: f4 cf rjmp .-24 ; 0x199e - } - - if (EntriesLeft > 1) { - 19b6: 62 30 cpi r22, 0x02 ; 2 - 19b8: 30 f0 brcs .+12 ; 0x19c6 - /* More than one map entries left */ - if (BytesLeft == 0) { - 19ba: 21 15 cp r18, r1 - 19bc: 31 05 cpc r19, r1 - 19be: 51 f0 breq .+20 ; 0x19d4 - return; - } - - *String++ = ','; - 19c0: 4f 5f subi r20, 0xFF ; 255 - 19c2: 5f 4f sbci r21, 0xFF ; 255 - 19c4: cc 93 st X, r28 - } - - MapPtr++; - EntriesLeft--; - 19c6: 61 50 subi r22, 0x01 ; 1 - 19c8: 81 96 adiw r24, 0x21 ; 33 - 19ca: e5 cf rjmp .-54 ; 0x1996 - } - - /* Terminate string */ - if (BytesLeft > 0) { - 19cc: 23 2b or r18, r19 - 19ce: 11 f0 breq .+4 ; 0x19d4 - *String++ = '\0'; - 19d0: fa 01 movw r30, r20 - 19d2: 10 82 st Z, r1 - BytesLeft--; - } -} - 19d4: cf 91 pop r28 - 19d6: 08 95 ret - -000019d8 : - /* USART ʹÄܽÓÊÕ*/ - USART_Rx_Enable(&USART); - - ///* USART ½ÓÊÕÖжϼ¶±ð*/ - //USART_RxdInterruptLevel_Set(&USART,USART_RXCINTLVL_LO_gc); - USART_RxdInterruptLevel_Set(&USART,USART_RXCINTLVL_HI_gc); - 19d8: ef e4 ldi r30, 0x4F ; 79 - 19da: f0 e2 ldi r31, 0x20 ; 32 - 19dc: a2 81 ldd r26, Z+2 ; 0x02 - 19de: b3 81 ldd r27, Z+3 ; 0x03 - 19e0: a1 5b subi r26, 0xB1 ; 177 - 19e2: bf 4d sbci r27, 0xDF ; 223 - 19e4: 16 96 adiw r26, 0x06 ; 6 - 19e6: 8c 93 st X, r24 - 19e8: 82 81 ldd r24, Z+2 ; 0x02 - 19ea: 93 81 ldd r25, Z+3 ; 0x03 - 19ec: 01 96 adiw r24, 0x01 ; 1 - 19ee: 8f 77 andi r24, 0x7F ; 127 - 19f0: 99 27 eor r25, r25 - 19f2: 82 83 std Z+2, r24 ; 0x02 - 19f4: 93 83 std Z+3, r25 ; 0x03 - 19f6: 80 81 ld r24, Z - 19f8: 91 81 ldd r25, Z+1 ; 0x01 - 19fa: 01 96 adiw r24, 0x01 ; 1 - 19fc: 80 83 st Z, r24 - 19fe: 91 83 std Z+1, r25 ; 0x01 - 1a00: 08 95 ret - -00001a02 <__vector_58>: -+------------------------------------------------------------------------------ -| Description : USART½ÓÊÕÖжϺ¯Êý ÊÕµ½µÄÊý¾Ý·¢ËÍ»ØÈ¥USART -+------------------------------------------------------------------------------ -*/ -ISR(USARTE0_RXC_vect) -{ - 1a02: 1f 92 push r1 - 1a04: 0f 92 push r0 - 1a06: 0f b6 in r0, 0x3f ; 63 - 1a08: 0f 92 push r0 - 1a0a: 11 24 eor r1, r1 - 1a0c: 2f 93 push r18 - 1a0e: 3f 93 push r19 - 1a10: 4f 93 push r20 - 1a12: 5f 93 push r21 - 1a14: 6f 93 push r22 - 1a16: 7f 93 push r23 - 1a18: 8f 93 push r24 - 1a1a: 9f 93 push r25 - 1a1c: af 93 push r26 - 1a1e: bf 93 push r27 - 1a20: ef 93 push r30 - 1a22: ff 93 push r31 - fifo_buffer_input(USART_GetChar(&USART)); - 1a24: 80 91 a0 0a lds r24, 0x0AA0 ; 0x800aa0 <__TEXT_REGION_LENGTH__+0x700aa0> - 1a28: d7 df rcall .-82 ; 0x19d8 - 1a2a: ff 91 pop r31 - 1a2c: ef 91 pop r30 - 1a2e: bf 91 pop r27 - 1a30: af 91 pop r26 - 1a32: 9f 91 pop r25 - 1a34: 8f 91 pop r24 - 1a36: 7f 91 pop r23 - 1a38: 6f 91 pop r22 - 1a3a: 5f 91 pop r21 - 1a3c: 4f 91 pop r20 - 1a3e: 3f 91 pop r19 - 1a40: 2f 91 pop r18 - 1a42: 0f 90 pop r0 - 1a44: 0f be out 0x3f, r0 ; 63 - 1a46: 0f 90 pop r0 - 1a48: 1f 90 pop r1 - 1a4a: 18 95 reti - -00001a4c : -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); - 1a4c: bc 01 movw r22, r24 - 1a4e: 8c e2 ldi r24, 0x2C ; 44 - 1a50: 90 e2 ldi r25, 0x20 ; 32 - 1a52: 0c 94 cd 27 jmp 0x4f9a ; 0x4f9a - -00001a56 : -} - -void TerminalSendStringP(const char* s) { - 1a56: cf 93 push r28 - 1a58: df 93 push r29 - char c; - - while( (c = pgm_read_byte(s++)) != '\0' ) { - 1a5a: fc 01 movw r30, r24 - 1a5c: 64 91 lpm r22, Z - 1a5e: ec 01 movw r28, r24 - 1a60: 21 96 adiw r28, 0x01 ; 1 - 1a62: 66 23 and r22, r22 - 1a64: 31 f0 breq .+12 ; 0x1a72 -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); } - 1a66: 8c e2 ldi r24, 0x2C ; 44 - 1a68: 90 e2 ldi r25, 0x20 ; 32 - 1a6a: 0e 94 1b 28 call 0x5036 ; 0x5036 - 1a6e: ce 01 movw r24, r28 - 1a70: f4 cf rjmp .-24 ; 0x1a5a - TerminalSendChar(c); - } -} - 1a72: df 91 pop r29 - 1a74: cf 91 pop r28 - 1a76: 08 95 ret - -00001a78 : -#endif - - - -void TerminalSendBlock(const void* Buffer, uint16_t ByteCount) -{ - 1a78: ab 01 movw r20, r22 - CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); - 1a7a: bc 01 movw r22, r24 - 1a7c: 8c e2 ldi r24, 0x2C ; 44 - 1a7e: 90 e2 ldi r25, 0x20 ; 32 - 1a80: 0c 94 f7 27 jmp 0x4fee ; 0x4fee - -00001a84 : - } -} - -void TerminalInit(void) -{ - TERMINAL_VBUS_PORT.DIRCLR = TERMINAL_VBUS_MASK; - 1a84: 80 e2 ldi r24, 0x20 ; 32 - 1a86: 80 93 62 06 sts 0x0662, r24 ; 0x800662 <__TEXT_REGION_LENGTH__+0x700662> - 1a8a: 08 95 ret - -00001a8c : -} - -void TerminalTask(void) -{ - 1a8c: cf 93 push r28 - 1a8e: df 93 push r29 - CDC_Device_USBTask(&TerminalHandle); - 1a90: 8c e2 ldi r24, 0x2C ; 44 - 1a92: 90 e2 ldi r25, 0x20 ; 32 - 1a94: 0e 94 80 28 call 0x5100 ; 0x5100 - USB_USBTask(); - 1a98: 0e 94 65 23 call 0x46ca ; 0x46ca - CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); -} - - -static void ProcessByte(void) { - int16_t Byte = CDC_Device_ReceiveByte(&TerminalHandle); - 1a9c: 8c e2 ldi r24, 0x2C ; 44 - 1a9e: 90 e2 ldi r25, 0x20 ; 32 - 1aa0: 0e 94 9c 28 call 0x5138 ; 0x5138 - 1aa4: ec 01 movw r28, r24 - - if (Byte >= 0) { - 1aa6: 97 fd sbrc r25, 7 - 1aa8: 07 c0 rjmp .+14 ; 0x1ab8 - /* Byte received */ - //LEDPulse(LED_RED); - - if (XModemProcessByte(Byte)) { - 1aaa: fa d2 rcall .+1524 ; 0x20a0 - 1aac: 81 11 cpse r24, r1 - 1aae: 04 c0 rjmp .+8 ; 0x1ab8 - /* XModem handled the byte */ - } else if (CommandLineProcessByte(Byte)) { - 1ab0: 8c 2f mov r24, r28 -{ - CDC_Device_USBTask(&TerminalHandle); - USB_USBTask(); - - ProcessByte(); -} - 1ab2: df 91 pop r29 - 1ab4: cf 91 pop r28 - /* Byte received */ - //LEDPulse(LED_RED); - - if (XModemProcessByte(Byte)) { - /* XModem handled the byte */ - } else if (CommandLineProcessByte(Byte)) { - 1ab6: 8a c4 rjmp .+2324 ; 0x23cc -{ - CDC_Device_USBTask(&TerminalHandle); - USB_USBTask(); - - ProcessByte(); -} - 1ab8: df 91 pop r29 - 1aba: cf 91 pop r28 - 1abc: 08 95 ret - -00001abe : - } -} - -static void SenseVBus(void) -{ - switch(TerminalState) { - 1abe: 80 91 d5 20 lds r24, 0x20D5 ; 0x8020d5 - 1ac2: 81 30 cpi r24, 0x01 ; 1 - 1ac4: 79 f0 breq .+30 ; 0x1ae4 - 1ac6: 28 f0 brcs .+10 ; 0x1ad2 - 1ac8: 82 30 cpi r24, 0x02 ; 2 - 1aca: d1 f0 breq .+52 ; 0x1b00 - 1acc: 83 30 cpi r24, 0x03 ; 3 - 1ace: 09 f1 breq .+66 ; 0x1b12 - 1ad0: 2c c0 rjmp .+88 ; 0x1b2a - case TERMINAL_UNINITIALIZED: - if (TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK) { - 1ad2: 80 91 68 06 lds r24, 0x0668 ; 0x800668 <__TEXT_REGION_LENGTH__+0x700668> - 1ad6: 85 ff sbrs r24, 5 - 1ad8: 28 c0 rjmp .+80 ; 0x1b2a - /* Not initialized and VBUS sense high */ - TerminalInitDelay = INIT_DELAY; - 1ada: 84 e1 ldi r24, 0x14 ; 20 - 1adc: 80 93 2b 20 sts 0x202B, r24 ; 0x80202b - TerminalState = TERMINAL_INITIALIZING; - 1ae0: 81 e0 ldi r24, 0x01 ; 1 - 1ae2: 0b c0 rjmp .+22 ; 0x1afa - } - break; - - case TERMINAL_INITIALIZING: - if (--TerminalInitDelay == 0) { - 1ae4: 80 91 2b 20 lds r24, 0x202B ; 0x80202b - 1ae8: 81 50 subi r24, 0x01 ; 1 - 1aea: 80 93 2b 20 sts 0x202B, r24 ; 0x80202b - 1aee: 81 11 cpse r24, r1 - 1af0: 1c c0 rjmp .+56 ; 0x1b2a - SystemStartUSBClock(); - 1af2: 5c d9 rcall .-3400 ; 0xdac - USB_Init(); - 1af4: 0e 94 09 27 call 0x4e12 ; 0x4e12 - TerminalState = TERMINAL_INITIALIZED; - 1af8: 82 e0 ldi r24, 0x02 ; 2 - 1afa: 80 93 d5 20 sts 0x20D5, r24 ; 0x8020d5 - 1afe: 15 c0 rjmp .+42 ; 0x1b2a - } - break; - - case TERMINAL_INITIALIZED: - if (!(TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK)) { - 1b00: 80 91 68 06 lds r24, 0x0668 ; 0x800668 <__TEXT_REGION_LENGTH__+0x700668> - 1b04: 85 fd sbrc r24, 5 - 1b06: 11 c0 rjmp .+34 ; 0x1b2a - /* Initialized and VBUS sense low */ - TerminalInitDelay = INIT_DELAY; - 1b08: 84 e1 ldi r24, 0x14 ; 20 - 1b0a: 80 93 2b 20 sts 0x202B, r24 ; 0x80202b - TerminalState = TERMINAL_UNITIALIZING; - 1b0e: 83 e0 ldi r24, 0x03 ; 3 - 1b10: f4 cf rjmp .-24 ; 0x1afa - } - break; - - case TERMINAL_UNITIALIZING: - if (--TerminalInitDelay == 0) { - 1b12: 80 91 2b 20 lds r24, 0x202B ; 0x80202b - 1b16: 81 50 subi r24, 0x01 ; 1 - 1b18: 80 93 2b 20 sts 0x202B, r24 ; 0x80202b - 1b1c: 81 11 cpse r24, r1 - 1b1e: 05 c0 rjmp .+10 ; 0x1b2a - USB_Disable(); - 1b20: 0e 94 ce 26 call 0x4d9c ; 0x4d9c - SystemStopUSBClock(); - 1b24: 5c d9 rcall .-3400 ; 0xdde - TerminalState = TERMINAL_UNINITIALIZED; - 1b26: 10 92 d5 20 sts 0x20D5, r1 ; 0x8020d5 - -void TerminalTick(void) -{ - SenseVBus(); - - XModemTick(); - 1b2a: fc d3 rcall .+2040 ; 0x2324 - CommandLineTick(); - 1b2c: 4c c5 rjmp .+2712 ; 0x25c6 - -00001b2e : -} - -/** Event handler for the library USB Connection event. */ -void EVENT_USB_Device_Connect(void) -{ - 1b2e: 08 95 ret - -00001b30 : - //LEDSetOn(LED_GREEN); -} - -/** Event handler for the library USB Disconnection event. */ -void EVENT_USB_Device_Disconnect(void) -{ - 1b30: 08 95 ret - -00001b32 : - - -/** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_Device_ConfigurationChanged(void) -{ - CDC_Device_ConfigureEndpoints(&TerminalHandle); - 1b32: 8c e2 ldi r24, 0x2C ; 44 - 1b34: 90 e2 ldi r25, 0x20 ; 32 - 1b36: 0c 94 a8 27 jmp 0x4f50 ; 0x4f50 - -00001b3a : -} - -/** Event handler for the library USB Control Request reception event. */ -void EVENT_USB_Device_ControlRequest(void) -{ - CDC_Device_ProcessControlRequest(&TerminalHandle); - 1b3a: 8c e2 ldi r24, 0x2C ; 44 - 1b3c: 90 e2 ldi r25, 0x20 ; 32 - 1b3e: 0c 94 ef 28 jmp 0x51de ; 0x51de - -00001b42 : -#include "../Application/MifareUltralight.h" - -extern const PROGMEM CommandEntryType CommandTable[]; - -CommandStatusIdType CommandGetVersion(char* OutParam) { - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Chameleon-new-1.0")); - 1b42: 2e e1 ldi r18, 0x1E ; 30 - 1b44: 37 e0 ldi r19, 0x07 ; 7 - 1b46: 3f 93 push r19 - 1b48: 2f 93 push r18 - 1b4a: 21 e0 ldi r18, 0x01 ; 1 - 1b4c: 2f 93 push r18 - 1b4e: 1f 92 push r1 - 1b50: 9f 93 push r25 - 1b52: 8f 93 push r24 - 1b54: 0e 94 94 2a call 0x5528 ; 0x5528 - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1b58: 0f 90 pop r0 - 1b5a: 0f 90 pop r0 - 1b5c: 0f 90 pop r0 - 1b5e: 0f 90 pop r0 - 1b60: 0f 90 pop r0 - 1b62: 0f 90 pop r0 -} - 1b64: 85 e6 ldi r24, 0x65 ; 101 - 1b66: 08 95 ret - -00001b68 : - -CommandStatusIdType CommandGetConfig(char* OutParam) { - ConfigurationGetByName(OutParam, TERMINAL_BUFFER_SIZE); - 1b68: 60 e0 ldi r22, 0x00 ; 0 - 1b6a: 71 e0 ldi r23, 0x01 ; 1 - 1b6c: 79 d9 rcall .-3342 ; 0xe60 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1b6e: 85 e6 ldi r24, 0x65 ; 101 - 1b70: 08 95 ret - -00001b72 : - -CommandStatusIdType CommandSetConfig(char* OutMessage, const char* InParam) { - 1b72: cb 01 movw r24, r22 - if (ConfigurationSetByName(InParam)) { - 1b74: 85 d9 rcall .-3318 ; 0xe80 - 1b76: 88 23 and r24, r24 - 1b78: 19 f0 breq .+6 ; 0x1b80 - SettingsSave(); - 1b7a: 7a de rcall .-780 ; 0x1870 - return COMMAND_INFO_OK_ID; - 1b7c: 84 e6 ldi r24, 0x64 ; 100 - 1b7e: 08 95 ret - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1b80: 8a ec ldi r24, 0xCA ; 202 - } -} - 1b82: 08 95 ret - -00001b84 : - -CommandStatusIdType CommandExecConfig(char* OutMessage) { - ConfigurationGetList(OutMessage, TERMINAL_BUFFER_SIZE); - 1b84: 60 e0 ldi r22, 0x00 ; 0 - 1b86: 71 e0 ldi r23, 0x01 ; 1 - 1b88: 9c d9 rcall .-3272 ; 0xec2 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1b8a: 85 e6 ldi r24, 0x65 ; 101 - 1b8c: 08 95 ret - -00001b8e : - -CommandStatusIdType CommandGetUid(char* OutParam) { - 1b8e: ef 92 push r14 - 1b90: ff 92 push r15 - 1b92: 0f 93 push r16 - 1b94: 1f 93 push r17 - 1b96: cf 93 push r28 - 1b98: df 93 push r29 - 1b9a: cd b7 in r28, 0x3d ; 61 - 1b9c: de b7 in r29, 0x3e ; 62 - 1b9e: a0 97 sbiw r28, 0x20 ; 32 - 1ba0: cd bf out 0x3d, r28 ; 61 - 1ba2: de bf out 0x3e, r29 ; 62 - 1ba4: 7c 01 movw r14, r24 - uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; - uint16_t UidSize = ActiveConfiguration.UidSize; - 1ba6: ea e3 ldi r30, 0x3A ; 58 - 1ba8: f1 e2 ldi r31, 0x21 ; 33 - 1baa: 06 89 ldd r16, Z+22 ; 0x16 - 1bac: 10 e0 ldi r17, 0x00 ; 0 -INLINE void ApplicationReset(void) { - ActiveConfiguration.ApplicationResetFunc(); -} - -INLINE void ApplicationGetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationGetUidFunc(Uid); - 1bae: 00 88 ldd r0, Z+16 ; 0x10 - 1bb0: f1 89 ldd r31, Z+17 ; 0x11 - 1bb2: e0 2d mov r30, r0 - 1bb4: ce 01 movw r24, r28 - 1bb6: 01 96 adiw r24, 0x01 ; 1 - 1bb8: 09 95 icall - - ApplicationGetUid(UidBuffer); - BufferToHexString(OutParam, TERMINAL_BUFFER_SIZE, UidBuffer, UidSize); - 1bba: 98 01 movw r18, r16 - 1bbc: ae 01 movw r20, r28 - 1bbe: 4f 5f subi r20, 0xFF ; 255 - 1bc0: 5f 4f sbci r21, 0xFF ; 255 - 1bc2: 60 e0 ldi r22, 0x00 ; 0 - 1bc4: 71 e0 ldi r23, 0x01 ; 1 - 1bc6: c7 01 movw r24, r14 - 1bc8: 9f d9 rcall .-3266 ; 0xf08 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1bca: 85 e6 ldi r24, 0x65 ; 101 - 1bcc: a0 96 adiw r28, 0x20 ; 32 - 1bce: cd bf out 0x3d, r28 ; 61 - 1bd0: de bf out 0x3e, r29 ; 62 - 1bd2: df 91 pop r29 - 1bd4: cf 91 pop r28 - 1bd6: 1f 91 pop r17 - 1bd8: 0f 91 pop r16 - 1bda: ff 90 pop r15 - 1bdc: ef 90 pop r14 - 1bde: 08 95 ret - -00001be0 : - -CommandStatusIdType CommandSetUid(char* OutMessage, const char* InParam) { - 1be0: df 92 push r13 - 1be2: ef 92 push r14 - 1be4: ff 92 push r15 - 1be6: 0f 93 push r16 - 1be8: 1f 93 push r17 - 1bea: cf 93 push r28 - 1bec: df 93 push r29 - 1bee: cd b7 in r28, 0x3d ; 61 - 1bf0: de b7 in r29, 0x3e ; 62 - 1bf2: a0 97 sbiw r28, 0x20 ; 32 - 1bf4: cd bf out 0x3d, r28 ; 61 - 1bf6: de bf out 0x3e, r29 ; 62 - 1bf8: 7b 01 movw r14, r22 - uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; - uint16_t UidSize = ActiveConfiguration.UidSize; - 1bfa: 00 91 50 21 lds r16, 0x2150 ; 0x802150 - 1bfe: 10 e0 ldi r17, 0x00 ; 0 - - if (strcmp_P(InParam, PSTR(COMMAND_UID_RANDOM)) == 0) { - 1c00: 65 e1 ldi r22, 0x15 ; 21 - 1c02: 77 e0 ldi r23, 0x07 ; 7 - 1c04: c7 01 movw r24, r14 - 1c06: 0e 94 5f 2a call 0x54be ; 0x54be - 1c0a: 89 2b or r24, r25 - 1c0c: c9 f4 brne .+50 ; 0x1c40 - 1c0e: d1 2c mov r13, r1 - /* Load with random bytes */ - for (uint8_t i=0; i - UidBuffer[i] = RandomGetByte(); - 1c1a: 5a d9 rcall .-3404 ; 0xed0 - 1c1c: e1 e0 ldi r30, 0x01 ; 1 - 1c1e: f0 e0 ldi r31, 0x00 ; 0 - 1c20: ec 0f add r30, r28 - 1c22: fd 1f adc r31, r29 - 1c24: ee 0d add r30, r14 - 1c26: ff 1d adc r31, r15 - 1c28: 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 -} - -INLINE void ApplicationSetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationSetUidFunc(Uid); - 1c2e: e0 91 4c 21 lds r30, 0x214C ; 0x80214c - 1c32: f0 91 4d 21 lds r31, 0x214D ; 0x80214d - 1c36: ce 01 movw r24, r28 - 1c38: 01 96 adiw r24, 0x01 ; 1 - 1c3a: 09 95 icall - return COMMAND_ERR_INVALID_PARAM_ID; - } - } - - ApplicationSetUid(UidBuffer); - return COMMAND_INFO_OK_ID; - 1c3c: 84 e6 ldi r24, 0x64 ; 100 - 1c3e: 0a c0 rjmp .+20 ; 0x1c54 - for (uint8_t i=0; i - 1c4c: 80 17 cp r24, r16 - 1c4e: 91 07 cpc r25, r17 - 1c50: 71 f3 breq .-36 ; 0x1c2e - /* Malformed input. Abort */ - return COMMAND_ERR_INVALID_PARAM_ID; - 1c52: 8a ec ldi r24, 0xCA ; 202 - } - } - - ApplicationSetUid(UidBuffer); - return COMMAND_INFO_OK_ID; -} - 1c54: a0 96 adiw r28, 0x20 ; 32 - 1c56: cd bf out 0x3d, r28 ; 61 - 1c58: de bf out 0x3e, r29 ; 62 - 1c5a: df 91 pop r29 - 1c5c: cf 91 pop r28 - 1c5e: 1f 91 pop r17 - 1c60: 0f 91 pop r16 - 1c62: ff 90 pop r15 - 1c64: ef 90 pop r14 - 1c66: df 90 pop r13 - 1c68: 08 95 ret - -00001c6a : - -CommandStatusIdType CommandGetReadOnly(char* OutParam) -{ - 1c6a: fc 01 movw r30, r24 - if (ActiveConfiguration.ReadOnly) { - 1c6c: 80 91 51 21 lds r24, 0x2151 ; 0x802151 - 1c70: 88 23 and r24, r24 - 1c72: 11 f0 breq .+4 ; 0x1c78 - OutParam[0] = COMMAND_CHAR_TRUE; - 1c74: 81 e3 ldi r24, 0x31 ; 49 - 1c76: 01 c0 rjmp .+2 ; 0x1c7a - } else { - OutParam[0] = COMMAND_CHAR_FALSE; - 1c78: 80 e3 ldi r24, 0x30 ; 48 - 1c7a: 80 83 st Z, r24 - } - - OutParam[1] = '\0'; - 1c7c: 11 82 std Z+1, r1 ; 0x01 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1c7e: 85 e6 ldi r24, 0x65 ; 101 - 1c80: 08 95 ret - -00001c82 : - -CommandStatusIdType CommandSetReadOnly(char* OutMessage, const char* InParam) -{ - if (InParam[1] == '\0') { - 1c82: fb 01 movw r30, r22 - 1c84: 81 81 ldd r24, Z+1 ; 0x01 - 1c86: 81 11 cpse r24, r1 - 1c88: 0d c0 rjmp .+26 ; 0x1ca4 - if (InParam[0] == COMMAND_CHAR_TRUE) { - 1c8a: 80 81 ld r24, Z - 1c8c: 81 33 cpi r24, 0x31 ; 49 - 1c8e: 21 f4 brne .+8 ; 0x1c98 - ActiveConfiguration.ReadOnly = true; - 1c90: 81 e0 ldi r24, 0x01 ; 1 - 1c92: 80 93 51 21 sts 0x2151, r24 ; 0x802151 - 1c96: 04 c0 rjmp .+8 ; 0x1ca0 - return COMMAND_INFO_OK_ID; - } else if (InParam[0] == COMMAND_CHAR_FALSE) { - 1c98: 80 33 cpi r24, 0x30 ; 48 - 1c9a: 21 f4 brne .+8 ; 0x1ca4 - ActiveConfiguration.ReadOnly = false; - 1c9c: 10 92 51 21 sts 0x2151, r1 ; 0x802151 - return COMMAND_INFO_OK_ID; - 1ca0: 84 e6 ldi r24, 0x64 ; 100 - 1ca2: 08 95 ret - } - } - - return COMMAND_ERR_INVALID_PARAM_ID; - 1ca4: 8a ec ldi r24, 0xCA ; 202 -} - 1ca6: 08 95 ret - -00001ca8 : - -CommandStatusIdType CommandExecUpload(char* OutMessage) { - XModemReceive(MemoryUploadBlock); - 1ca8: 87 e9 ldi r24, 0x97 ; 151 - 1caa: 9a e0 ldi r25, 0x0A ; 10 - 1cac: c8 d1 rcall .+912 ; 0x203e - return COMMAND_INFO_XMODEM_WAIT_ID; -} - 1cae: 8e e6 ldi r24, 0x6E ; 110 - 1cb0: 08 95 ret - -00001cb2 : - -CommandStatusIdType CommandExecDownload(char* OutMessage) { - XModemSend(MemoryDownloadBlock); - 1cb2: 83 eb ldi r24, 0xB3 ; 179 - 1cb4: 9a e0 ldi r25, 0x0A ; 10 - 1cb6: de d1 rcall .+956 ; 0x2074 - return COMMAND_INFO_XMODEM_WAIT_ID; -} - 1cb8: 8e e6 ldi r24, 0x6E ; 110 - 1cba: 08 95 ret - -00001cbc : - * 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; - 1cbc: e0 ec ldi r30, 0xC0 ; 192 - 1cbe: f4 e0 ldi r31, 0x04 ; 4 - 1cc0: 81 81 ldd r24, Z+1 ; 0x01 - 1cc2: 8e 7f andi r24, 0xFE ; 254 - 1cc4: 81 83 std Z+1, r24 ; 0x01 - -CommandStatusIdType CommandExecReset(char* OutMessage) { - USB_Detach(); - USB_Disable(); - 1cc6: 0e 94 ce 26 call 0x4d9c ; 0x4d9c - SystemReset(); - 1cca: 64 d8 rcall .-3896 ; 0xd94 - return COMMAND_INFO_OK_ID; -} - 1ccc: 84 e6 ldi r24, 0x64 ; 100 - 1cce: 08 95 ret - -00001cd0 : - 1cd0: e0 ec ldi r30, 0xC0 ; 192 - 1cd2: f4 e0 ldi r31, 0x04 ; 4 - 1cd4: 81 81 ldd r24, Z+1 ; 0x01 - 1cd6: 8e 7f andi r24, 0xFE ; 254 - 1cd8: 81 83 std Z+1, r24 ; 0x01 - -#ifdef SUPPORT_FIRMWARE_UPGRADE -CommandStatusIdType CommandExecUpgrade(char* OutMessage) { - USB_Detach(); - USB_Disable(); - 1cda: 0e 94 ce 26 call 0x4d9c ; 0x4d9c - SystemEnterBootloader(); - 1cde: 60 d8 rcall .-3904 ; 0xda0 - return COMMAND_INFO_OK_ID; -} - 1ce0: 84 e6 ldi r24, 0x64 ; 100 - 1ce2: 08 95 ret - -00001ce4 : -#endif - -CommandStatusIdType CommandGetMemSize(char* OutParam) { - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.MemorySize); - 1ce4: ea e3 ldi r30, 0x3A ; 58 - 1ce6: f1 e2 ldi r31, 0x21 ; 33 - 1ce8: 25 89 ldd r18, Z+21 ; 0x15 - 1cea: 2f 93 push r18 - 1cec: 24 89 ldd r18, Z+20 ; 0x14 - 1cee: 2f 93 push r18 - 1cf0: 22 e1 ldi r18, 0x12 ; 18 - 1cf2: 37 e0 ldi r19, 0x07 ; 7 - 1cf4: 3f 93 push r19 - 1cf6: 2f 93 push r18 - 1cf8: 21 e0 ldi r18, 0x01 ; 1 - 1cfa: 2f 93 push r18 - 1cfc: 1f 92 push r1 - 1cfe: 9f 93 push r25 - 1d00: 8f 93 push r24 - 1d02: 0e 94 94 2a call 0x5528 ; 0x5528 - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1d06: 8d b7 in r24, 0x3d ; 61 - 1d08: 9e b7 in r25, 0x3e ; 62 - 1d0a: 08 96 adiw r24, 0x08 ; 8 - 1d0c: 8d bf out 0x3d, r24 ; 61 - 1d0e: 9e bf out 0x3e, r25 ; 62 -} - 1d10: 85 e6 ldi r24, 0x65 ; 101 - 1d12: 08 95 ret - -00001d14 : - -CommandStatusIdType CommandGetUidSize(char* OutParam) { - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.UidSize); - 1d14: 20 91 50 21 lds r18, 0x2150 ; 0x802150 - 1d18: 1f 92 push r1 - 1d1a: 2f 93 push r18 - 1d1c: 2f e0 ldi r18, 0x0F ; 15 - 1d1e: 37 e0 ldi r19, 0x07 ; 7 - 1d20: 3f 93 push r19 - 1d22: 2f 93 push r18 - 1d24: 21 e0 ldi r18, 0x01 ; 1 - 1d26: 2f 93 push r18 - 1d28: 1f 92 push r1 - 1d2a: 9f 93 push r25 - 1d2c: 8f 93 push r24 - 1d2e: 0e 94 94 2a call 0x5528 ; 0x5528 - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1d32: 8d b7 in r24, 0x3d ; 61 - 1d34: 9e b7 in r25, 0x3e ; 62 - 1d36: 08 96 adiw r24, 0x08 ; 8 - 1d38: 8d bf out 0x3d, r24 ; 61 - 1d3a: 9e bf out 0x3e, r25 ; 62 -} - 1d3c: 85 e6 ldi r24, 0x65 ; 101 - 1d3e: 08 95 ret - -00001d40 : - -CommandStatusIdType CommandExecButton(char* OutMessage) -{ - ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); - 1d40: 60 e0 ldi r22, 0x00 ; 0 - 1d42: 71 e0 ldi r23, 0x01 ; 1 - 1d44: 13 dd rcall .-1498 ; 0x176c - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1d46: 85 e6 ldi r24, 0x65 ; 101 - 1d48: 08 95 ret - -00001d4a : - -CommandStatusIdType CommandGetButton(char* OutParam) -{ - ButtonGetActionByName(BUTTON_PRESS_SHORT, OutParam, TERMINAL_BUFFER_SIZE); - 1d4a: 40 e0 ldi r20, 0x00 ; 0 - 1d4c: 51 e0 ldi r21, 0x01 ; 1 - 1d4e: bc 01 movw r22, r24 - 1d50: 80 e0 ldi r24, 0x00 ; 0 - 1d52: 42 dd rcall .-1404 ; 0x17d8 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1d54: 85 e6 ldi r24, 0x65 ; 101 - 1d56: 08 95 ret - -00001d58 : - -CommandStatusIdType CommandSetButton(char* OutMessage, const char* InParam) -{ - if (ButtonSetActionByName(BUTTON_PRESS_SHORT, InParam)) { - 1d58: 80 e0 ldi r24, 0x00 ; 0 - 1d5a: 5f dd rcall .-1346 ; 0x181a - 1d5c: 88 23 and r24, r24 - 1d5e: 19 f0 breq .+6 ; 0x1d66 - SettingsSave(); - 1d60: 87 dd rcall .-1266 ; 0x1870 - return COMMAND_INFO_OK_ID; - 1d62: 84 e6 ldi r24, 0x64 ; 100 - 1d64: 08 95 ret - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1d66: 8a ec ldi r24, 0xCA ; 202 - } -} - 1d68: 08 95 ret - -00001d6a : - -CommandStatusIdType CommandExecButtonLong(char* OutMessage) -{ - ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); - 1d6a: 60 e0 ldi r22, 0x00 ; 0 - 1d6c: 71 e0 ldi r23, 0x01 ; 1 - 1d6e: fe dc rcall .-1540 ; 0x176c - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1d70: 85 e6 ldi r24, 0x65 ; 101 - 1d72: 08 95 ret - -00001d74 : - -CommandStatusIdType CommandGetButtonLong(char* OutParam) -{ - ButtonGetActionByName(BUTTON_PRESS_LONG, OutParam, TERMINAL_BUFFER_SIZE); - 1d74: 40 e0 ldi r20, 0x00 ; 0 - 1d76: 51 e0 ldi r21, 0x01 ; 1 - 1d78: bc 01 movw r22, r24 - 1d7a: 81 e0 ldi r24, 0x01 ; 1 - 1d7c: 2d dd rcall .-1446 ; 0x17d8 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1d7e: 85 e6 ldi r24, 0x65 ; 101 - 1d80: 08 95 ret - -00001d82 : - -CommandStatusIdType CommandSetButtonLong(char* OutMessage, const char* InParam) -{ - if (ButtonSetActionByName(BUTTON_PRESS_LONG, InParam)) { - 1d82: 81 e0 ldi r24, 0x01 ; 1 - 1d84: 4a dd rcall .-1388 ; 0x181a - 1d86: 88 23 and r24, r24 - 1d88: 19 f0 breq .+6 ; 0x1d90 - SettingsSave(); - 1d8a: 72 dd rcall .-1308 ; 0x1870 - return COMMAND_INFO_OK_ID; - 1d8c: 84 e6 ldi r24, 0x64 ; 100 - 1d8e: 08 95 ret - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1d90: 8a ec ldi r24, 0xCA ; 202 - } -} - 1d92: 08 95 ret - -00001d94 : - -CommandStatusIdType CommandGetSetting(char* OutParam) { - SettingsGetActiveByName(OutParam, TERMINAL_BUFFER_SIZE); - 1d94: 60 e0 ldi r22, 0x00 ; 0 - 1d96: 71 e0 ldi r23, 0x01 ; 1 - 1d98: a3 dd rcall .-1210 ; 0x18e0 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1d9a: 85 e6 ldi r24, 0x65 ; 101 - 1d9c: 08 95 ret - -00001d9e : - -CommandStatusIdType CommandSetSetting(char* OutMessage, const char* InParam) { - 1d9e: cb 01 movw r24, r22 - if (SettingsSetActiveByName(InParam)) { - 1da0: ac dd rcall .-1192 ; 0x18fa - 1da2: 88 23 and r24, r24 - 1da4: 19 f0 breq .+6 ; 0x1dac - SettingsSave(); - 1da6: 64 dd rcall .-1336 ; 0x1870 - return COMMAND_INFO_OK_ID; - 1da8: 84 e6 ldi r24, 0x64 ; 100 - 1daa: 08 95 ret - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1dac: 8a ec ldi r24, 0xCA ; 202 - } -} - 1dae: 08 95 ret - -00001db0 : - -CommandStatusIdType CommandExecClear(char* OutParam) { - MemoryClear(); - 1db0: 5b db rcall .-2378 ; 0x1468 - return COMMAND_INFO_OK_ID; -} - 1db2: 84 e6 ldi r24, 0x64 ; 100 - 1db4: 08 95 ret - -00001db6 : - -CommandStatusIdType CommandExecHelp(char* OutMessage) { - 1db6: df 92 push r13 - 1db8: ef 92 push r14 - 1dba: ff 92 push r15 - 1dbc: 0f 93 push r16 - 1dbe: 1f 93 push r17 - 1dc0: cf 93 push r28 - 1dc2: df 93 push r29 - 1dc4: ec 01 movw r28, r24 - const CommandEntryType* EntryPtr = CommandTable; - uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ - 1dc6: ee 24 eor r14, r14 - 1dc8: ea 94 dec r14 - 1dca: f1 2c mov r15, r1 - MemoryClear(); - return COMMAND_INFO_OK_ID; -} - -CommandStatusIdType CommandExecHelp(char* OutMessage) { - const CommandEntryType* EntryPtr = CommandTable; - 1dcc: 08 e0 ldi r16, 0x08 ; 8 - 1dce: 18 e0 ldi r17, 0x08 ; 8 - *OutMessage++ = c; - CommandName++; - ByteCount--; - } - - *OutMessage++ = ','; - 1dd0: 9c e2 ldi r25, 0x2C ; 44 - 1dd2: d9 2e mov r13, r25 - -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) { - 1dd4: b8 01 movw r22, r16 - 1dd6: 8b e4 ldi r24, 0x4B ; 75 - 1dd8: 90 e2 ldi r25, 0x20 ; 32 - 1dda: 0e 94 5f 2a call 0x54be ; 0x54be - 1dde: 89 2b or r24, r25 - 1de0: b9 f0 breq .+46 ; 0x1e10 - 1de2: de 01 movw r26, r28 - 1de4: f8 01 movw r30, r16 - const char* CommandName = EntryPtr->Command; - char c; - - while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { - 1de6: 24 91 lpm r18, Z - 1de8: ed 01 movw r28, r26 - 1dea: 21 96 adiw r28, 0x01 ; 1 - 1dec: c7 01 movw r24, r14 - 1dee: 01 97 sbiw r24, 0x01 ; 1 - 1df0: 22 23 and r18, r18 - 1df2: 49 f0 breq .+18 ; 0x1e06 - 1df4: 31 e2 ldi r19, 0x21 ; 33 - 1df6: e3 16 cp r14, r19 - 1df8: f1 04 cpc r15, r1 - 1dfa: 28 f0 brcs .+10 ; 0x1e06 - *OutMessage++ = c; - 1dfc: 2c 93 st X, r18 - 1dfe: de 01 movw r26, r28 - CommandName++; - 1e00: 31 96 adiw r30, 0x01 ; 1 - ByteCount--; - 1e02: 7c 01 movw r14, r24 - 1e04: f0 cf rjmp .-32 ; 0x1de6 - } - - *OutMessage++ = ','; - 1e06: dc 92 st X, r13 - ByteCount--; - 1e08: 7c 01 movw r14, r24 - - EntryPtr++; - 1e0a: 08 5e subi r16, 0xE8 ; 232 - 1e0c: 1f 4f sbci r17, 0xFF ; 255 - 1e0e: e2 cf rjmp .-60 ; 0x1dd4 - } - - *--OutMessage = '\0'; - 1e10: 21 97 sbiw r28, 0x01 ; 1 - 1e12: 18 82 st Y, r1 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1e14: 85 e6 ldi r24, 0x65 ; 101 - 1e16: df 91 pop r29 - 1e18: cf 91 pop r28 - 1e1a: 1f 91 pop r17 - 1e1c: 0f 91 pop r16 - 1e1e: ff 90 pop r15 - 1e20: ef 90 pop r14 - 1e22: df 90 pop r13 - 1e24: 08 95 ret - -00001e26 : - -CommandStatusIdType CommandGetRssi(char* OutParam) { - 1e26: fc 01 movw r30, r24 - -} - -static inline uint16_t AntennaLevelGet(void) -{ - ADCA.CH0.CTRL |= ADC_CH_START_bm; - 1e28: 20 91 20 02 lds r18, 0x0220 ; 0x800220 <__TEXT_REGION_LENGTH__+0x700220> - 1e2c: 20 68 ori r18, 0x80 ; 128 - 1e2e: 20 93 20 02 sts 0x0220, r18 ; 0x800220 <__TEXT_REGION_LENGTH__+0x700220> - while( !(ADCA.CH0.INTFLAGS & ADC_CH_CHIF_bm) ); - 1e32: 80 91 23 02 lds r24, 0x0223 ; 0x800223 <__TEXT_REGION_LENGTH__+0x700223> - 1e36: 80 ff sbrs r24, 0 - 1e38: fc cf rjmp .-8 ; 0x1e32 - - ADCA.CH0.INTFLAGS = ADC_CH_CHIF_bm; - 1e3a: 81 e0 ldi r24, 0x01 ; 1 - 1e3c: 80 93 23 02 sts 0x0223, r24 ; 0x800223 <__TEXT_REGION_LENGTH__+0x700223> - - int16_t Result = ADCA.CH0RES - ANTENNA_LEVEL_OFFSET; - 1e40: a0 91 10 02 lds r26, 0x0210 ; 0x800210 <__TEXT_REGION_LENGTH__+0x700210> - 1e44: b0 91 11 02 lds r27, 0x0211 ; 0x800211 <__TEXT_REGION_LENGTH__+0x700211> - 1e48: ae 5b subi r26, 0xBE ; 190 - 1e4a: b1 09 sbc r27, r1 - 1e4c: b7 ff sbrs r27, 7 - 1e4e: 02 c0 rjmp .+4 ; 0x1e54 - 1e50: a0 e0 ldi r26, 0x00 ; 0 - 1e52: b0 e0 ldi r27, 0x00 ; 0 - if (Result < 0) Result = 0; - - return (uint16_t) (((uint32_t) Result * ANTENNA_LEVEL_NUMERATOR) / ANTENNA_LEVEL_DENOMINATOR); - 1e54: 29 e6 ldi r18, 0x69 ; 105 - 1e56: 37 e5 ldi r19, 0x57 ; 87 - 1e58: 4b e0 ldi r20, 0x0B ; 11 - 1e5a: 50 e0 ldi r21, 0x00 ; 0 - 1e5c: 0e 94 ec 29 call 0x53d8 ; 0x53d8 <__mulshisi3> - 1e60: aa 27 eor r26, r26 - 1e62: bb 27 eor r27, r27 - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%5u mV"), AntennaLevelGet()); - 1e64: 9f 93 push r25 - 1e66: 8f 93 push r24 - 1e68: 28 e0 ldi r18, 0x08 ; 8 - 1e6a: 37 e0 ldi r19, 0x07 ; 7 - 1e6c: 3f 93 push r19 - 1e6e: 2f 93 push r18 - 1e70: 81 e0 ldi r24, 0x01 ; 1 - 1e72: 8f 93 push r24 - 1e74: 1f 92 push r1 - 1e76: ff 93 push r31 - 1e78: ef 93 push r30 - 1e7a: 0e 94 94 2a call 0x5528 ; 0x5528 - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1e7e: 8d b7 in r24, 0x3d ; 61 - 1e80: 9e b7 in r25, 0x3e ; 62 - 1e82: 08 96 adiw r24, 0x08 ; 8 - 1e84: 8d bf out 0x3d, r24 ; 61 - 1e86: 9e bf out 0x3e, r25 ; 62 -} - 1e88: 85 e6 ldi r24, 0x65 ; 101 - 1e8a: 08 95 ret - -00001e8c : -CommandStatusIdType CommandGetUltralightPassword(char* OutParam) { - 1e8c: 0f 93 push r16 - 1e8e: 1f 93 push r17 - 1e90: cf 93 push r28 - 1e92: df 93 push r29 - 1e94: 00 d0 rcall .+0 ; 0x1e96 - 1e96: 00 d0 rcall .+0 ; 0x1e98 - 1e98: cd b7 in r28, 0x3d ; 61 - 1e9a: de b7 in r29, 0x3e ; 62 - 1e9c: 18 2f mov r17, r24 - 1e9e: 09 2f mov r16, r25 - uint8_t pwd[4]; - /* Read saved password from authentication */ - MemoryReadBlock(pwd, MIFARE_ULTRALIGHT_PWD_ADDRESS, sizeof(pwd)); - 1ea0: 44 e0 ldi r20, 0x04 ; 4 - 1ea2: 50 e0 ldi r21, 0x00 ; 0 - 1ea4: 68 e0 ldi r22, 0x08 ; 8 - 1ea6: 71 e0 ldi r23, 0x01 ; 1 - 1ea8: ce 01 movw r24, r28 - 1eaa: 01 96 adiw r24, 0x01 ; 1 - 1eac: 25 d9 rcall .-3510 ; 0x10f8 - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%02x%02x%02x%02x"), pwd[0], pwd[1], pwd[2], pwd[3]); - 1eae: 8c 81 ldd r24, Y+4 ; 0x04 - 1eb0: 1f 92 push r1 - 1eb2: 8f 93 push r24 - 1eb4: 8b 81 ldd r24, Y+3 ; 0x03 - 1eb6: 1f 92 push r1 - 1eb8: 8f 93 push r24 - 1eba: 8a 81 ldd r24, Y+2 ; 0x02 - 1ebc: 1f 92 push r1 - 1ebe: 8f 93 push r24 - 1ec0: 89 81 ldd r24, Y+1 ; 0x01 - 1ec2: 1f 92 push r1 - 1ec4: 8f 93 push r24 - 1ec6: 27 ef ldi r18, 0xF7 ; 247 - 1ec8: 36 e0 ldi r19, 0x06 ; 6 - 1eca: 3f 93 push r19 - 1ecc: 2f 93 push r18 - 1ece: 81 e0 ldi r24, 0x01 ; 1 - 1ed0: 8f 93 push r24 - 1ed2: 1f 92 push r1 - 1ed4: 0f 93 push r16 - 1ed6: 1f 93 push r17 - 1ed8: 0e 94 94 2a call 0x5528 ; 0x5528 - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1edc: cd bf out 0x3d, r28 ; 61 - 1ede: de bf out 0x3e, r29 ; 62 -} - 1ee0: 85 e6 ldi r24, 0x65 ; 101 - 1ee2: 24 96 adiw r28, 0x04 ; 4 - 1ee4: cd bf out 0x3d, r28 ; 61 - 1ee6: de bf out 0x3e, r29 ; 62 - 1ee8: df 91 pop r29 - 1eea: cf 91 pop r28 - 1eec: 1f 91 pop r17 - 1eee: 0f 91 pop r16 - 1ef0: 08 95 ret - -00001ef2 : - #define MEM_OFFSET_DETECTION_DATA 4096 + 16 - #define MEM_LEN_DETECTION_DATA 192 - - /* Function to encrypt the transfer for collected data */ - void ComPass(char *toBeEncFileName, int key, int len) - { - 1ef2: 8f 92 push r8 - 1ef4: 9f 92 push r9 - 1ef6: af 92 push r10 - 1ef8: bf 92 push r11 - 1efa: cf 92 push r12 - 1efc: df 92 push r13 - 1efe: ef 92 push r14 - 1f00: ff 92 push r15 - 1f02: 0f 93 push r16 - 1f04: 1f 93 push r17 - 1f06: cf 93 push r28 - 1f08: df 93 push r29 - 1f0a: cd b7 in r28, 0x3d ; 61 - 1f0c: de b7 in r29, 0x3e ; 62 - 1f0e: c3 51 subi r28, 0x13 ; 19 - 1f10: d1 40 sbci r29, 0x01 ; 1 - 1f12: cd bf out 0x3d, r28 ; 61 - 1f14: de bf out 0x3e, r29 ; 62 - 1f16: 7c 01 movw r14, r24 - 1f18: 5b 01 movw r10, r22 - 1f1a: 8a 01 movw r16, r20 - char newFileName[275] = { 0 }; - 1f1c: 9e 01 movw r18, r28 - 1f1e: 2f 5f subi r18, 0xFF ; 255 - 1f20: 3f 4f sbci r19, 0xFF ; 255 - 1f22: 69 01 movw r12, r18 - 1f24: 83 e1 ldi r24, 0x13 ; 19 - 1f26: 91 e0 ldi r25, 0x01 ; 1 - 1f28: d9 01 movw r26, r18 - 1f2a: fc 01 movw r30, r24 - 1f2c: 1d 92 st X+, r1 - 1f2e: 31 97 sbiw r30, 0x01 ; 1 - 1f30: e9 f7 brne .-6 ; 0x1f2c - memcpy(newFileName, toBeEncFileName, len); - 1f32: b7 01 movw r22, r14 - 1f34: c9 01 movw r24, r18 - 1f36: 0e 94 84 2a call 0x5508 ; 0x5508 - 1f3a: f6 01 movw r30, r12 - int i, s, t, size = len; - for (i = 0; i < size; i++) - 1f3c: 67 01 movw r12, r14 - 1f3e: 48 01 movw r8, r16 - 1f40: 8e 18 sub r8, r14 - 1f42: 9f 08 sbc r9, r15 - 1f44: 8a 0c add r8, r10 - 1f46: 9b 1c adc r9, r11 - 1f48: c6 01 movw r24, r12 - 1f4a: 8e 19 sub r24, r14 - 1f4c: 9f 09 sbc r25, r15 - 1f4e: 80 17 cp r24, r16 - 1f50: 91 07 cpc r25, r17 - 1f52: 7c f4 brge .+30 ; 0x1f72 - { - s = newFileName[i]; - 1f54: 41 91 ld r20, Z+ - 1f56: 94 01 movw r18, r8 - 1f58: 2c 0d add r18, r12 - 1f5a: 3d 1d adc r19, r13 - t = (size + key + i - size / key) ^ s; - 1f5c: c8 01 movw r24, r16 - 1f5e: b5 01 movw r22, r10 - 1f60: 0e 94 ad 29 call 0x535a ; 0x535a <__divmodhi4> - 1f64: 26 1b sub r18, r22 - 1f66: 37 0b sbc r19, r23 - 1f68: 24 27 eor r18, r20 - toBeEncFileName[i] = t; - 1f6a: d6 01 movw r26, r12 - 1f6c: 2d 93 st X+, r18 - 1f6e: 6d 01 movw r12, r26 - 1f70: eb cf rjmp .-42 ; 0x1f48 - } - } - 1f72: cd 5e subi r28, 0xED ; 237 - 1f74: de 4f sbci r29, 0xFE ; 254 - 1f76: cd bf out 0x3d, r28 ; 61 - 1f78: de bf out 0x3e, r29 ; 62 - 1f7a: df 91 pop r29 - 1f7c: cf 91 pop r28 - 1f7e: 1f 91 pop r17 - 1f80: 0f 91 pop r16 - 1f82: ff 90 pop r15 - 1f84: ef 90 pop r14 - 1f86: df 90 pop r13 - 1f88: cf 90 pop r12 - 1f8a: bf 90 pop r11 - 1f8c: af 90 pop r10 - 1f8e: 9f 90 pop r9 - 1f90: 8f 90 pop r8 - 1f92: 08 95 ret - -00001f94 : - - CommandStatusIdType CommandGetDetection(char* OutParam) - { - 1f94: ef 92 push r14 - 1f96: ff 92 push r15 - 1f98: 0f 93 push r16 - 1f9a: 1f 93 push r17 - 1f9c: cf 93 push r28 - 1f9e: df 93 push r29 - 1fa0: ec 01 movw r28, r24 - /* Read UID / s0-b0 */ - MemoryReadBlock(OutParam, 0, 16); - 1fa2: 40 e1 ldi r20, 0x10 ; 16 - 1fa4: 50 e0 ldi r21, 0x00 ; 0 - 1fa6: 60 e0 ldi r22, 0x00 ; 0 - 1fa8: 70 e0 ldi r23, 0x00 ; 0 - 1faa: a6 d8 rcall .-3764 ; 0x10f8 - - /* Read saved nonce data from authentication */ - MemoryReadBlock(OutParam+16, MEM_OFFSET_DETECTION_DATA, MEM_LEN_DETECTION_DATA); - 1fac: 40 ec ldi r20, 0xC0 ; 192 - 1fae: 50 e0 ldi r21, 0x00 ; 0 - 1fb0: 60 e1 ldi r22, 0x10 ; 16 - 1fb2: 70 e1 ldi r23, 0x10 ; 16 - 1fb4: ce 01 movw r24, r28 - 1fb6: 40 96 adiw r24, 0x10 ; 16 - 1fb8: 9f d8 rcall .-3778 ; 0x10f8 - - /* add file integrity to byte !! 209, 210 !! */ - ISO14443AAppendCRCA(OutParam, 208); - 1fba: 60 ed ldi r22, 0xD0 ; 208 - 1fbc: 70 e0 ldi r23, 0x00 ; 0 - 1fbe: ce 01 movw r24, r28 - 1fc0: 0e 94 56 1f call 0x3eac ; 0x3eac - - /* encrypt data , but not CRC*/ - ComPass(OutParam, (int)123321, 208); - 1fc4: 40 ed ldi r20, 0xD0 ; 208 - 1fc6: 50 e0 ldi r21, 0x00 ; 0 - 1fc8: 69 eb ldi r22, 0xB9 ; 185 - 1fca: 71 ee ldi r23, 0xE1 ; 225 - 1fcc: ce 01 movw r24, r28 - 1fce: 91 df rcall .-222 ; 0x1ef2 - 1fd0: 8e 01 movw r16, r28 - 1fd2: 7e 01 movw r14, r28 - 1fd4: 82 ed ldi r24, 0xD2 ; 210 - 1fd6: e8 0e add r14, r24 - 1fd8: f1 1c adc r15, r1 - - /* send data + CRC */ - for(uint16_t num=0; num < 208+2; num++) - TerminalSendChar(OutParam[num]); - 1fda: f8 01 movw r30, r16 - 1fdc: 61 91 ld r22, Z+ - 1fde: 8f 01 movw r16, r30 -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); } - 1fe0: 8c e2 ldi r24, 0x2C ; 44 - 1fe2: 90 e2 ldi r25, 0x20 ; 32 - 1fe4: 0e 94 1b 28 call 0x5036 ; 0x5036 - - /* encrypt data , but not CRC*/ - ComPass(OutParam, (int)123321, 208); - - /* send data + CRC */ - for(uint16_t num=0; num < 208+2; num++) - 1fe8: 0e 15 cp r16, r14 - 1fea: 1f 05 cpc r17, r15 - 1fec: b1 f7 brne .-20 ; 0x1fda - TerminalSendChar(OutParam[num]); - - OutParam[0]=0; - 1fee: 18 82 st Y, r1 - return COMMAND_INFO_OK_ID; - } - 1ff0: 84 e6 ldi r24, 0x64 ; 100 - 1ff2: df 91 pop r29 - 1ff4: cf 91 pop r28 - 1ff6: 1f 91 pop r17 - 1ff8: 0f 91 pop r16 - 1ffa: ff 90 pop r15 - 1ffc: ef 90 pop r14 - 1ffe: 08 95 ret - -00002000 : - - CommandStatusIdType CommandSetDetection(char* OutMessage, const char* InParam) - { - 2000: cf 93 push r28 - 2002: df 93 push r29 - 2004: cd b7 in r28, 0x3d ; 61 - 2006: de b7 in r29, 0x3e ; 62 - 2008: c8 5c subi r28, 0xC8 ; 200 - 200a: d1 09 sbc r29, r1 - 200c: cd bf out 0x3d, r28 ; 61 - 200e: de bf out 0x3e, r29 ; 62 - /* Fill memory for detection with 0xFF, clearing it */ - uint8_t t[200]; - memset(t, 0xff, 200); - 2010: 48 ec ldi r20, 0xC8 ; 200 - 2012: 50 e0 ldi r21, 0x00 ; 0 - 2014: 6f ef ldi r22, 0xFF ; 255 - 2016: 70 e0 ldi r23, 0x00 ; 0 - 2018: ce 01 movw r24, r28 - 201a: 01 96 adiw r24, 0x01 ; 1 - 201c: 0e 94 8d 2a call 0x551a ; 0x551a - MemoryWriteBlock(t, MEM_OFFSET_DETECTION_DATA, MEM_LEN_DETECTION_DATA); - 2020: 40 ec ldi r20, 0xC0 ; 192 - 2022: 50 e0 ldi r21, 0x00 ; 0 - 2024: 60 e1 ldi r22, 0x10 ; 16 - 2026: 70 e1 ldi r23, 0x10 ; 16 - 2028: ce 01 movw r24, r28 - 202a: 01 96 adiw r24, 0x01 ; 1 - 202c: f0 d8 rcall .-3616 ; 0x120e - return COMMAND_INFO_OK_ID; - } - 202e: 84 e6 ldi r24, 0x64 ; 100 - 2030: c8 53 subi r28, 0x38 ; 56 - 2032: df 4f sbci r29, 0xFF ; 255 - 2034: cd bf out 0x3d, r28 ; 61 - 2036: de bf out 0x3e, r29 ; 62 - 2038: df 91 pop r29 - 203a: cf 91 pop r28 - 203c: 08 95 ret - -0000203e : - return Checksum; -} - -void XModemReceive(XModemCallbackType TheCallbackFunc) -{ - State = STATE_RECEIVE_INIT; - 203e: 21 e0 ldi r18, 0x01 ; 1 - 2040: 20 93 e4 20 sts 0x20E4, r18 ; 0x8020e4 - CurrentFrameNumber = FIRST_FRAME_NUMBER; - 2044: 20 93 e3 20 sts 0x20E3, r18 ; 0x8020e3 - RetryCount = RECV_INIT_COUNT; - 2048: 24 e1 ldi r18, 0x14 ; 20 - 204a: 20 93 e0 20 sts 0x20E0, r18 ; 0x8020e0 - RetryTimeout = RECV_INIT_TIMEOUT; - 204e: 25 e0 ldi r18, 0x05 ; 5 - 2050: 30 e0 ldi r19, 0x00 ; 0 - 2052: 20 93 de 20 sts 0x20DE, r18 ; 0x8020de - 2056: 30 93 df 20 sts 0x20DF, r19 ; 0x8020df - BlockAddress = 0; - 205a: 10 92 d8 20 sts 0x20D8, r1 ; 0x8020d8 - 205e: 10 92 d9 20 sts 0x20D9, r1 ; 0x8020d9 - 2062: 10 92 da 20 sts 0x20DA, r1 ; 0x8020da - 2066: 10 92 db 20 sts 0x20DB, r1 ; 0x8020db - - CallbackFunc = TheCallbackFunc; - 206a: 80 93 d6 20 sts 0x20D6, r24 ; 0x8020d6 - 206e: 90 93 d7 20 sts 0x20D7, r25 ; 0x8020d7 - 2072: 08 95 ret - -00002074 : -} - -void XModemSend(XModemCallbackType TheCallbackFunc) -{ - State = STATE_SEND_INIT; - 2074: 27 e0 ldi r18, 0x07 ; 7 - 2076: 20 93 e4 20 sts 0x20E4, r18 ; 0x8020e4 - RetryTimeout = SEND_INIT_TIMEOUT; - 207a: 24 e6 ldi r18, 0x64 ; 100 - 207c: 30 e0 ldi r19, 0x00 ; 0 - 207e: 20 93 de 20 sts 0x20DE, r18 ; 0x8020de - 2082: 30 93 df 20 sts 0x20DF, r19 ; 0x8020df - BlockAddress = 0; - 2086: 10 92 d8 20 sts 0x20D8, r1 ; 0x8020d8 - 208a: 10 92 d9 20 sts 0x20D9, r1 ; 0x8020d9 - 208e: 10 92 da 20 sts 0x20DA, r1 ; 0x8020da - 2092: 10 92 db 20 sts 0x20DB, r1 ; 0x8020db - - CallbackFunc = TheCallbackFunc; - 2096: 80 93 d6 20 sts 0x20D6, r24 ; 0x8020d6 - 209a: 90 93 d7 20 sts 0x20D7, r25 ; 0x8020d7 - 209e: 08 95 ret - -000020a0 : -} - -bool XModemProcessByte(uint8_t Byte) -{ - 20a0: cf 93 push r28 - switch(State) { - 20a2: 90 91 e4 20 lds r25, 0x20E4 ; 0x8020e4 - 20a6: 95 30 cpi r25, 0x05 ; 5 - 20a8: c9 f1 breq .+114 ; 0x211c - 20aa: 30 f4 brcc .+12 ; 0x20b8 - 20ac: 93 30 cpi r25, 0x03 ; 3 - 20ae: 11 f1 breq .+68 ; 0x20f4 - 20b0: 28 f5 brcc .+74 ; 0x20fc - 20b2: 91 30 cpi r25, 0x01 ; 1 - 20b4: 68 f4 brcc .+26 ; 0x20d0 - 20b6: 32 c1 rjmp .+612 ; 0x231c - 20b8: 97 30 cpi r25, 0x07 ; 7 - 20ba: 09 f4 brne .+2 ; 0x20be - 20bc: a0 c0 rjmp .+320 ; 0x21fe - 20be: 08 f4 brcc .+2 ; 0x20c2 - 20c0: 42 c0 rjmp .+132 ; 0x2146 - 20c2: 98 30 cpi r25, 0x08 ; 8 - 20c4: 09 f4 brne .+2 ; 0x20c8 - 20c6: a0 c0 rjmp .+320 ; 0x2208 - 20c8: 99 30 cpi r25, 0x09 ; 9 - 20ca: 09 f4 brne .+2 ; 0x20ce - 20cc: 24 c1 rjmp .+584 ; 0x2316 - 20ce: 26 c1 rjmp .+588 ; 0x231c - case STATE_RECEIVE_INIT: - case STATE_RECEIVE_WAIT: - if (Byte == BYTE_SOH) { - 20d0: 81 30 cpi r24, 0x01 ; 1 - 20d2: 41 f4 brne .+16 ; 0x20e4 - /* Next frame incoming */ - BufferIdx = 0; - 20d4: 10 92 dc 20 sts 0x20DC, r1 ; 0x8020dc - 20d8: 10 92 dd 20 sts 0x20DD, r1 ; 0x8020dd - Checksum = CHECKSUM_INIT_VALUE; - 20dc: 10 92 e1 20 sts 0x20E1, r1 ; 0x8020e1 - State = STATE_RECEIVE_FRAMENUM1; - 20e0: 83 e0 ldi r24, 0x03 ; 3 - 20e2: ed c0 rjmp .+474 ; 0x22be - } else if (Byte == BYTE_EOT) { - 20e4: 84 30 cpi r24, 0x04 ; 4 - 20e6: 11 f4 brne .+4 ; 0x20ec -INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } - 20e8: 66 e0 ldi r22, 0x06 ; 6 - 20ea: 84 c0 rjmp .+264 ; 0x21f4 - /* Transmission finished */ - TerminalSendByte(BYTE_ACK); - State = STATE_OFF; - } else if (Byte == BYTE_CAN) { - 20ec: 88 31 cpi r24, 0x18 ; 24 - 20ee: 09 f0 breq .+2 ; 0x20f2 - 20f0: e8 c0 rjmp .+464 ; 0x22c2 - 20f2: 11 c1 rjmp .+546 ; 0x2316 - - break; - - case STATE_RECEIVE_FRAMENUM1: - /* Store frame number */ - ReceivedFrameNumber = Byte; - 20f4: 80 93 e2 20 sts 0x20E2, r24 ; 0x8020e2 - State = STATE_RECEIVE_FRAMENUM2; - 20f8: 84 e0 ldi r24, 0x04 ; 4 - 20fa: e1 c0 rjmp .+450 ; 0x22be - break; - - case STATE_RECEIVE_FRAMENUM2: - if (Byte == (255 - ReceivedFrameNumber)) { - 20fc: 90 e0 ldi r25, 0x00 ; 0 - 20fe: 40 91 e2 20 lds r20, 0x20E2 ; 0x8020e2 - 2102: 2f ef ldi r18, 0xFF ; 255 - 2104: 30 e0 ldi r19, 0x00 ; 0 - 2106: 24 1b sub r18, r20 - 2108: 31 09 sbc r19, r1 - 210a: 82 17 cp r24, r18 - 210c: 93 07 cpc r25, r19 - 210e: 21 f4 brne .+8 ; 0x2118 - /* frame-number check passed. */ - State = STATE_RECEIVE_DATA; - 2110: 85 e0 ldi r24, 0x05 ; 5 - 2112: d5 c0 rjmp .+426 ; 0x22be - - case STATE_RECEIVE_PROCESS: - if (ReceivedFrameNumber == CurrentFrameNumber) { - /* This is the expected frame. Calculate and verify checksum */ - - if (CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE) == Byte) { - 2114: 98 17 cp r25, r24 - 2116: 39 f1 breq .+78 ; 0x2166 - 2118: 65 e1 ldi r22, 0x15 ; 21 - 211a: 65 c0 rjmp .+202 ; 0x21e6 - - break; - - case STATE_RECEIVE_DATA: - /* Process byte and update checksum */ - TerminalBuffer[BufferIdx++] = Byte; - 211c: 20 91 dc 20 lds r18, 0x20DC ; 0x8020dc - 2120: 30 91 dd 20 lds r19, 0x20DD ; 0x8020dd - 2124: a9 01 movw r20, r18 - 2126: 4f 5f subi r20, 0xFF ; 255 - 2128: 5f 4f sbci r21, 0xFF ; 255 - 212a: 40 93 dc 20 sts 0x20DC, r20 ; 0x8020dc - 212e: 50 93 dd 20 sts 0x20DD, r21 ; 0x8020dd - 2132: f9 01 movw r30, r18 - 2134: ee 5a subi r30, 0xAE ; 174 - 2136: fe 4d sbci r31, 0xDE ; 222 - 2138: 80 83 st Z, r24 - - if (BufferIdx == XMODEM_BLOCK_SIZE) { - 213a: 40 38 cpi r20, 0x80 ; 128 - 213c: 51 05 cpc r21, r1 - 213e: 09 f0 breq .+2 ; 0x2142 - 2140: c0 c0 rjmp .+384 ; 0x22c2 - /* Block full */ - State = STATE_RECEIVE_PROCESS; - 2142: 86 e0 ldi r24, 0x06 ; 6 - 2144: bc c0 rjmp .+376 ; 0x22be - } - - break; - - case STATE_RECEIVE_PROCESS: - if (ReceivedFrameNumber == CurrentFrameNumber) { - 2146: 20 91 e2 20 lds r18, 0x20E2 ; 0x8020e2 - 214a: 90 91 e3 20 lds r25, 0x20E3 ; 0x8020e3 - 214e: 29 13 cpse r18, r25 - 2150: 42 c0 rjmp .+132 ; 0x21d6 - 2152: e2 e5 ldi r30, 0x52 ; 82 - 2154: f1 e2 ldi r31, 0x21 ; 33 - 2156: 90 e0 ldi r25, 0x00 ; 0 - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 2158: 21 e2 ldi r18, 0x21 ; 33 - 215a: e2 3d cpi r30, 0xD2 ; 210 - 215c: f2 07 cpc r31, r18 - 215e: d1 f2 breq .-76 ; 0x2114 - Checksum += *DataPtr++; - 2160: 21 91 ld r18, Z+ - 2162: 92 0f add r25, r18 - 2164: f9 cf rjmp .-14 ; 0x2158 - if (ReceivedFrameNumber == CurrentFrameNumber) { - /* This is the expected frame. Calculate and verify checksum */ - - if (CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE) == Byte) { - /* Checksum is valid. Pass received data to callback function */ - if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { - 2166: 60 91 d8 20 lds r22, 0x20D8 ; 0x8020d8 - 216a: 70 91 d9 20 lds r23, 0x20D9 ; 0x8020d9 - 216e: e0 91 d6 20 lds r30, 0x20D6 ; 0x8020d6 - 2172: f0 91 d7 20 lds r31, 0x20D7 ; 0x8020d7 - 2176: 40 e8 ldi r20, 0x80 ; 128 - 2178: 50 e0 ldi r21, 0x00 ; 0 - 217a: 82 e5 ldi r24, 0x52 ; 82 - 217c: 91 e2 ldi r25, 0x21 ; 33 - 217e: 09 95 icall - 2180: c8 2f mov r28, r24 - 2182: 88 23 and r24, r24 - 2184: 11 f1 breq .+68 ; 0x21ca - /* Proceed to next frame and send ACK */ - CurrentFrameNumber++; - 2186: 80 91 e3 20 lds r24, 0x20E3 ; 0x8020e3 - 218a: 8f 5f subi r24, 0xFF ; 255 - 218c: 80 93 e3 20 sts 0x20E3, r24 ; 0x8020e3 - BlockAddress += XMODEM_BLOCK_SIZE; - 2190: 80 91 d8 20 lds r24, 0x20D8 ; 0x8020d8 - 2194: 90 91 d9 20 lds r25, 0x20D9 ; 0x8020d9 - 2198: a0 91 da 20 lds r26, 0x20DA ; 0x8020da - 219c: b0 91 db 20 lds r27, 0x20DB ; 0x8020db - 21a0: 80 58 subi r24, 0x80 ; 128 - 21a2: 9f 4f sbci r25, 0xFF ; 255 - 21a4: af 4f sbci r26, 0xFF ; 255 - 21a6: bf 4f sbci r27, 0xFF ; 255 - 21a8: 80 93 d8 20 sts 0x20D8, r24 ; 0x8020d8 - 21ac: 90 93 d9 20 sts 0x20D9, r25 ; 0x8020d9 - 21b0: a0 93 da 20 sts 0x20DA, r26 ; 0x8020da - 21b4: b0 93 db 20 sts 0x20DB, r27 ; 0x8020db -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); } - 21b8: 66 e0 ldi r22, 0x06 ; 6 - 21ba: 8c e2 ldi r24, 0x2C ; 44 - 21bc: 90 e2 ldi r25, 0x20 ; 32 - 21be: 0e 94 1b 28 call 0x5036 ; 0x5036 - TerminalSendChar(BYTE_ACK); - State = STATE_RECEIVE_WAIT; - 21c2: 82 e0 ldi r24, 0x02 ; 2 - 21c4: 80 93 e4 20 sts 0x20E4, r24 ; 0x8020e4 - 21c8: aa c0 rjmp .+340 ; 0x231e -INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } - 21ca: 68 e1 ldi r22, 0x18 ; 24 - 21cc: 8c e2 ldi r24, 0x2C ; 44 - 21ce: 90 e2 ldi r25, 0x20 ; 32 - 21d0: 0e 94 1b 28 call 0x5036 ; 0x5036 - 21d4: 0e c0 rjmp .+28 ; 0x21f2 - } else { - /* Data seems to be damaged */ - TerminalSendByte(BYTE_NAK); - State = STATE_RECEIVE_WAIT; - } - } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { - 21d6: 30 e0 ldi r19, 0x00 ; 0 - 21d8: 89 2f mov r24, r25 - 21da: 90 e0 ldi r25, 0x00 ; 0 - 21dc: 01 97 sbiw r24, 0x01 ; 1 - 21de: 28 17 cp r18, r24 - 21e0: 39 07 cpc r19, r25 - 21e2: 39 f4 brne .+14 ; 0x21f2 - 21e4: 66 e0 ldi r22, 0x06 ; 6 - 21e6: 8c e2 ldi r24, 0x2C ; 44 - 21e8: 90 e2 ldi r25, 0x20 ; 32 - 21ea: 0e 94 1b 28 call 0x5036 ; 0x5036 - /* This is a retransmission */ - TerminalSendByte(BYTE_ACK); - State = STATE_RECEIVE_WAIT; - 21ee: 82 e0 ldi r24, 0x02 ; 2 - 21f0: 66 c0 rjmp .+204 ; 0x22be - 21f2: 68 e1 ldi r22, 0x18 ; 24 - 21f4: 8c e2 ldi r24, 0x2C ; 44 - 21f6: 90 e2 ldi r25, 0x20 ; 32 - 21f8: 0e 94 1b 28 call 0x5036 ; 0x5036 - 21fc: 8c c0 rjmp .+280 ; 0x2316 - - break; - - case STATE_SEND_INIT: - /* Start sending on NAK */ - if (Byte == BYTE_NAK) { - 21fe: 85 31 cpi r24, 0x15 ; 21 - 2200: 19 f4 brne .+6 ; 0x2208 - CurrentFrameNumber = FIRST_FRAME_NUMBER - 1; - 2202: 10 92 e3 20 sts 0x20E3, r1 ; 0x8020e3 - 2206: 06 c0 rjmp .+12 ; 0x2214 - } - - /* Fallthrough */ - - case STATE_SEND_WAIT: - if (Byte == BYTE_CAN) { - 2208: 88 31 cpi r24, 0x18 ; 24 - 220a: 09 f4 brne .+2 ; 0x220e - 220c: 6d cf rjmp .-294 ; 0x20e8 - /* Cancel */ - TerminalSendByte(BYTE_ACK); - State = STATE_OFF; - } else if (Byte == BYTE_ACK) { - 220e: 86 30 cpi r24, 0x06 ; 6 - 2210: 09 f0 breq .+2 ; 0x2214 - 2212: 59 c0 rjmp .+178 ; 0x22c6 - /* Acknowledge. Proceed to next frame, get data and calc checksum */ - CurrentFrameNumber++; - 2214: 80 91 e3 20 lds r24, 0x20E3 ; 0x8020e3 - 2218: 8f 5f subi r24, 0xFF ; 255 - 221a: 80 93 e3 20 sts 0x20E3, r24 ; 0x8020e3 - - if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { - 221e: 60 91 d8 20 lds r22, 0x20D8 ; 0x8020d8 - 2222: 70 91 d9 20 lds r23, 0x20D9 ; 0x8020d9 - 2226: e0 91 d6 20 lds r30, 0x20D6 ; 0x8020d6 - 222a: f0 91 d7 20 lds r31, 0x20D7 ; 0x8020d7 - 222e: 40 e8 ldi r20, 0x80 ; 128 - 2230: 50 e0 ldi r21, 0x00 ; 0 - 2232: 82 e5 ldi r24, 0x52 ; 82 - 2234: 91 e2 ldi r25, 0x21 ; 33 - 2236: 09 95 icall - 2238: c8 2f mov r28, r24 - 223a: 88 23 and r24, r24 - 223c: d1 f1 breq .+116 ; 0x22b2 - 223e: 61 e0 ldi r22, 0x01 ; 1 - 2240: 8c e2 ldi r24, 0x2C ; 44 - 2242: 90 e2 ldi r25, 0x20 ; 32 - 2244: 0e 94 1b 28 call 0x5036 ; 0x5036 - 2248: 60 91 e3 20 lds r22, 0x20E3 ; 0x8020e3 - 224c: 8c e2 ldi r24, 0x2C ; 44 - 224e: 90 e2 ldi r25, 0x20 ; 32 - 2250: 0e 94 1b 28 call 0x5036 ; 0x5036 - TerminalSendByte(BYTE_SOH); - TerminalSendByte(CurrentFrameNumber); - TerminalSendByte(255 - CurrentFrameNumber); - 2254: 60 91 e3 20 lds r22, 0x20E3 ; 0x8020e3 - 2258: 60 95 com r22 - 225a: 8c e2 ldi r24, 0x2C ; 44 - 225c: 90 e2 ldi r25, 0x20 ; 32 - 225e: 0e 94 1b 28 call 0x5036 ; 0x5036 - TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - 2262: 60 e8 ldi r22, 0x80 ; 128 - 2264: 70 e0 ldi r23, 0x00 ; 0 - 2266: 82 e5 ldi r24, 0x52 ; 82 - 2268: 91 e2 ldi r25, 0x21 ; 33 - 226a: 06 dc rcall .-2036 ; 0x1a78 - 226c: e2 e5 ldi r30, 0x52 ; 82 - 226e: f1 e2 ldi r31, 0x21 ; 33 -static uint32_t BlockAddress; - -static XModemCallbackType CallbackFunc; - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - 2270: 60 e0 ldi r22, 0x00 ; 0 - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 2272: 81 e2 ldi r24, 0x21 ; 33 - 2274: e2 3d cpi r30, 0xD2 ; 210 - 2276: f8 07 cpc r31, r24 - 2278: 19 f0 breq .+6 ; 0x2280 - Checksum += *DataPtr++; - 227a: 81 91 ld r24, Z+ - 227c: 68 0f add r22, r24 - 227e: f9 cf rjmp .-14 ; 0x2272 - 2280: 8c e2 ldi r24, 0x2C ; 44 - 2282: 90 e2 ldi r25, 0x20 ; 32 - 2284: 0e 94 1b 28 call 0x5036 ; 0x5036 - TerminalSendByte(CurrentFrameNumber); - TerminalSendByte(255 - CurrentFrameNumber); - TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); - - BlockAddress += XMODEM_BLOCK_SIZE; - 2288: 80 91 d8 20 lds r24, 0x20D8 ; 0x8020d8 - 228c: 90 91 d9 20 lds r25, 0x20D9 ; 0x8020d9 - 2290: a0 91 da 20 lds r26, 0x20DA ; 0x8020da - 2294: b0 91 db 20 lds r27, 0x20DB ; 0x8020db - 2298: 80 58 subi r24, 0x80 ; 128 - 229a: 9f 4f sbci r25, 0xFF ; 255 - 229c: af 4f sbci r26, 0xFF ; 255 - 229e: bf 4f sbci r27, 0xFF ; 255 - 22a0: 80 93 d8 20 sts 0x20D8, r24 ; 0x8020d8 - 22a4: 90 93 d9 20 sts 0x20D9, r25 ; 0x8020d9 - 22a8: a0 93 da 20 sts 0x20DA, r26 ; 0x8020da - 22ac: b0 93 db 20 sts 0x20DB, r27 ; 0x8020db - 22b0: 36 c0 rjmp .+108 ; 0x231e - 22b2: 64 e0 ldi r22, 0x04 ; 4 - 22b4: 8c e2 ldi r24, 0x2C ; 44 - 22b6: 90 e2 ldi r25, 0x20 ; 32 - 22b8: 0e 94 1b 28 call 0x5036 ; 0x5036 - } else { - TerminalSendByte(BYTE_EOT); - State = STATE_SEND_EOT; - 22bc: 89 e0 ldi r24, 0x09 ; 9 - 22be: 80 93 e4 20 sts 0x20E4, r24 ; 0x8020e4 - default: - return false; - break; - } - - return true; - 22c2: c1 e0 ldi r28, 0x01 ; 1 - 22c4: 2c c0 rjmp .+88 ; 0x231e - BlockAddress += XMODEM_BLOCK_SIZE; - } else { - TerminalSendByte(BYTE_EOT); - State = STATE_SEND_EOT; - } - } else if (Byte == BYTE_NAK){ - 22c6: 85 31 cpi r24, 0x15 ; 21 - 22c8: e1 f7 brne .-8 ; 0x22c2 - 22ca: 61 e0 ldi r22, 0x01 ; 1 - 22cc: 8c e2 ldi r24, 0x2C ; 44 - 22ce: 90 e2 ldi r25, 0x20 ; 32 - 22d0: 0e 94 1b 28 call 0x5036 ; 0x5036 - 22d4: 60 91 e3 20 lds r22, 0x20E3 ; 0x8020e3 - 22d8: 8c e2 ldi r24, 0x2C ; 44 - 22da: 90 e2 ldi r25, 0x20 ; 32 - 22dc: 0e 94 1b 28 call 0x5036 ; 0x5036 - /* Resend frame */ - TerminalSendByte(BYTE_SOH); - TerminalSendByte(CurrentFrameNumber); - TerminalSendByte(255 - CurrentFrameNumber); - 22e0: 60 91 e3 20 lds r22, 0x20E3 ; 0x8020e3 - 22e4: 60 95 com r22 - 22e6: 8c e2 ldi r24, 0x2C ; 44 - 22e8: 90 e2 ldi r25, 0x20 ; 32 - 22ea: 0e 94 1b 28 call 0x5036 ; 0x5036 - TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - 22ee: 60 e8 ldi r22, 0x80 ; 128 - 22f0: 70 e0 ldi r23, 0x00 ; 0 - 22f2: 82 e5 ldi r24, 0x52 ; 82 - 22f4: 91 e2 ldi r25, 0x21 ; 33 - 22f6: c0 db rcall .-2176 ; 0x1a78 - 22f8: e2 e5 ldi r30, 0x52 ; 82 - 22fa: f1 e2 ldi r31, 0x21 ; 33 -static uint32_t BlockAddress; - -static XModemCallbackType CallbackFunc; - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - 22fc: 60 e0 ldi r22, 0x00 ; 0 - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 22fe: 21 e2 ldi r18, 0x21 ; 33 - 2300: e2 3d cpi r30, 0xD2 ; 210 - 2302: f2 07 cpc r31, r18 - 2304: 19 f0 breq .+6 ; 0x230c - Checksum += *DataPtr++; - 2306: 81 91 ld r24, Z+ - 2308: 68 0f add r22, r24 - 230a: f9 cf rjmp .-14 ; 0x22fe - 230c: 8c e2 ldi r24, 0x2C ; 44 - 230e: 90 e2 ldi r25, 0x20 ; 32 - 2310: 0e 94 1b 28 call 0x5036 ; 0x5036 - 2314: d6 cf rjmp .-84 ; 0x22c2 - - break; - - case STATE_SEND_EOT: - /* Receive Ack */ - State = STATE_OFF; - 2316: 10 92 e4 20 sts 0x20E4, r1 ; 0x8020e4 - 231a: d3 cf rjmp .-90 ; 0x22c2 - break; - - default: - return false; - 231c: c0 e0 ldi r28, 0x00 ; 0 - break; - } - - return true; -} - 231e: 8c 2f mov r24, r28 - 2320: cf 91 pop r28 - 2322: 08 95 ret - -00002324 : - -void XModemTick(void) -{ - /* Timeouts go here */ - switch(State) { - 2324: 80 91 e4 20 lds r24, 0x20E4 ; 0x8020e4 - 2328: 81 30 cpi r24, 0x01 ; 1 - 232a: 19 f0 breq .+6 ; 0x2332 - 232c: 87 30 cpi r24, 0x07 ; 7 - 232e: 29 f1 breq .+74 ; 0x237a - 2330: 08 95 ret - case STATE_RECEIVE_INIT: - if (RetryTimeout-- == 0) { - 2332: 80 91 de 20 lds r24, 0x20DE ; 0x8020de - 2336: 90 91 df 20 lds r25, 0x20DF ; 0x8020df - 233a: 9c 01 movw r18, r24 - 233c: 21 50 subi r18, 0x01 ; 1 - 233e: 31 09 sbc r19, r1 - 2340: 20 93 de 20 sts 0x20DE, r18 ; 0x8020de - 2344: 30 93 df 20 sts 0x20DF, r19 ; 0x8020df - 2348: 89 2b or r24, r25 - 234a: 31 f5 brne .+76 ; 0x2398 - if (RetryCount-- > 0) { - 234c: 80 91 e0 20 lds r24, 0x20E0 ; 0x8020e0 - 2350: 9f ef ldi r25, 0xFF ; 255 - 2352: 98 0f add r25, r24 - 2354: 90 93 e0 20 sts 0x20E0, r25 ; 0x8020e0 - 2358: 88 23 and r24, r24 - 235a: 31 f0 breq .+12 ; 0x2368 -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); } - 235c: 65 e1 ldi r22, 0x15 ; 21 - 235e: 8c e2 ldi r24, 0x2C ; 44 - 2360: 90 e2 ldi r25, 0x20 ; 32 - 2362: 0e 94 1b 28 call 0x5036 ; 0x5036 - 2366: 02 c0 rjmp .+4 ; 0x236c - /* Put out communication request */ - TerminalSendChar(BYTE_NAK); - } else { - /* Just shut off after some time. */ - State = STATE_OFF; - 2368: 10 92 e4 20 sts 0x20E4, r1 ; 0x8020e4 - } - - RetryTimeout = RECV_INIT_TIMEOUT; - 236c: 85 e0 ldi r24, 0x05 ; 5 - 236e: 90 e0 ldi r25, 0x00 ; 0 - 2370: 80 93 de 20 sts 0x20DE, r24 ; 0x8020de - 2374: 90 93 df 20 sts 0x20DF, r25 ; 0x8020df - 2378: 08 95 ret - } - break; - - case STATE_SEND_INIT: - if (RetryTimeout-- == 0) { - 237a: 80 91 de 20 lds r24, 0x20DE ; 0x8020de - 237e: 90 91 df 20 lds r25, 0x20DF ; 0x8020df - 2382: 9c 01 movw r18, r24 - 2384: 21 50 subi r18, 0x01 ; 1 - 2386: 31 09 sbc r19, r1 - 2388: 20 93 de 20 sts 0x20DE, r18 ; 0x8020de - 238c: 30 93 df 20 sts 0x20DF, r19 ; 0x8020df - 2390: 89 2b or r24, r25 - 2392: 11 f4 brne .+4 ; 0x2398 - /* Abort */ - State = STATE_OFF; - 2394: 10 92 e4 20 sts 0x20E4, r1 ; 0x8020e4 - 2398: 08 95 ret - -0000239a : - TerminalSendStringP(PSTR(OPTIONAL_ANSWER_TRAILER)); - } -} - -void CommandLineInit(void) { - BufferIdx = 0; - 239a: e2 e4 ldi r30, 0x42 ; 66 - 239c: f7 e0 ldi r31, 0x07 ; 7 - 239e: 20 e0 ldi r18, 0x00 ; 0 - 23a0: 30 e0 ldi r19, 0x00 ; 0 - 23a2: 94 91 lpm r25, Z - 23a4: 98 13 cpse r25, r24 - 23a6: 09 c0 rjmp .+18 ; 0x23ba - 23a8: 41 e2 ldi r20, 0x21 ; 33 - 23aa: 42 9f mul r20, r18 - 23ac: c0 01 movw r24, r0 - 23ae: 43 9f mul r20, r19 - 23b0: 90 0d add r25, r0 - 23b2: 11 24 eor r1, r1 - 23b4: 8d 5b subi r24, 0xBD ; 189 - 23b6: 98 4f sbci r25, 0xF8 ; 248 - 23b8: 08 95 ret - 23ba: 2f 5f subi r18, 0xFF ; 255 - 23bc: 3f 4f sbci r19, 0xFF ; 255 - 23be: b1 96 adiw r30, 0x21 ; 33 - 23c0: 26 30 cpi r18, 0x06 ; 6 - 23c2: 31 05 cpc r19, r1 - 23c4: 71 f7 brne .-36 ; 0x23a2 - 23c6: 80 e0 ldi r24, 0x00 ; 0 - 23c8: 90 e0 ldi r25, 0x00 ; 0 - 23ca: 08 95 ret - -000023cc : -} - -bool CommandLineProcessByte(uint8_t b) { - 23cc: cf 92 push r12 - 23ce: df 92 push r13 - 23d0: ef 92 push r14 - 23d2: ff 92 push r15 - 23d4: 0f 93 push r16 - 23d6: 1f 93 push r17 - 23d8: cf 93 push r28 - if (IS_CHARACTER(b)) { - 23da: 98 2f mov r25, r24 - 23dc: 9f 7d andi r25, 0xDF ; 223 - 23de: 91 54 subi r25, 0x41 ; 65 - 23e0: 9a 31 cpi r25, 0x1A ; 26 - 23e2: 60 f0 brcs .+24 ; 0x23fc - 23e4: 90 ed ldi r25, 0xD0 ; 208 - 23e6: 98 0f add r25, r24 - 23e8: 9a 30 cpi r25, 0x0A ; 10 - 23ea: 40 f0 brcs .+16 ; 0x23fc - 23ec: 8f 35 cpi r24, 0x5F ; 95 - 23ee: 31 f0 breq .+12 ; 0x23fc - 23f0: 98 2f mov r25, r24 - 23f2: 9d 7f andi r25, 0xFD ; 253 - 23f4: 9d 33 cpi r25, 0x3D ; 61 - 23f6: 11 f0 breq .+4 ; 0x23fc - 23f8: 80 32 cpi r24, 0x20 ; 32 - 23fa: c9 f4 brne .+50 ; 0x242e - - /* Store uppercase character */ - if (IS_LOWERCASE(b)) - 23fc: 9f e9 ldi r25, 0x9F ; 159 - 23fe: 98 0f add r25, r24 - 2400: 9a 31 cpi r25, 0x1A ; 26 - 2402: 08 f4 brcc .+2 ; 0x2406 - b = TO_UPPERCASE(b); - 2404: 80 52 subi r24, 0x20 ; 32 - - /* Prevent buffer overflow and account for '\0' */ - if (BufferIdx < TERMINAL_BUFFER_SIZE - 1) - 2406: 20 91 ea 20 lds r18, 0x20EA ; 0x8020ea - 240a: 30 91 eb 20 lds r19, 0x20EB ; 0x8020eb - 240e: 2f 3f cpi r18, 0xFF ; 255 - 2410: 31 05 cpc r19, r1 - 2412: 08 f0 brcs .+2 ; 0x2416 - 2414: cf c0 rjmp .+414 ; 0x25b4 - TerminalBuffer[BufferIdx++] = b; - 2416: a9 01 movw r20, r18 - 2418: 4f 5f subi r20, 0xFF ; 255 - 241a: 5f 4f sbci r21, 0xFF ; 255 - 241c: 40 93 ea 20 sts 0x20EA, r20 ; 0x8020ea - 2420: 50 93 eb 20 sts 0x20EB, r21 ; 0x8020eb - 2424: f9 01 movw r30, r18 - 2426: ee 5a subi r30, 0xAE ; 174 - 2428: fe 4d sbci r31, 0xDE ; 222 - 242a: 80 83 st Z, r24 - 242c: c3 c0 rjmp .+390 ; 0x25b4 - - } else if (b == '\r') { - 242e: 8d 30 cpi r24, 0x0D ; 13 - 2430: 09 f0 breq .+2 ; 0x2434 - 2432: 95 c0 rjmp .+298 ; 0x255e - /* Process on \r. Terminate string and decode. */ - TerminalBuffer[BufferIdx] = '\0'; - 2434: e0 91 ea 20 lds r30, 0x20EA ; 0x8020ea - 2438: f0 91 eb 20 lds r31, 0x20EB ; 0x8020eb - 243c: ee 5a subi r30, 0xAE ; 174 - 243e: fe 4d sbci r31, 0xDE ; 222 - 2440: 10 82 st Z, r1 - BufferIdx = 0; - 2442: 10 92 ea 20 sts 0x20EA, r1 ; 0x8020ea - 2446: 10 92 eb 20 sts 0x20EB, r1 ; 0x8020eb - - if (!TaskPending) - 244a: 80 91 e9 20 lds r24, 0x20E9 ; 0x8020e9 - 244e: 81 11 cpse r24, r1 - 2450: b1 c0 rjmp .+354 ; 0x25b4 - 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])) { - 2452: 80 91 52 21 lds r24, 0x2152 ; 0x802152 - 2456: 98 2f mov r25, r24 - 2458: 9f 7d andi r25, 0xDF ; 223 - 245a: 09 f4 brne .+2 ; 0x245e - 245c: 95 c0 rjmp .+298 ; 0x2588 - 245e: 8d 7f andi r24, 0xFD ; 253 - 2460: 8d 33 cpi r24, 0x3D ; 61 - 2462: 09 f4 brne .+2 ; 0x2466 - 2464: 91 c0 rjmp .+290 ; 0x2588 - 2466: e2 e5 ldi r30, 0x52 ; 82 - 2468: f1 e2 ldi r31, 0x21 ; 33 - 246a: 7f 01 movw r14, r30 - char* pCommandDelimiter = pTerminalBuffer; - char CommandDelimiter = '\0'; - - /* Search for command delimiter, store it and replace with '\0' */ - while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) - 246c: c1 91 ld r28, Z+ - 246e: cc 23 and r28, r28 - 2470: 31 f0 breq .+12 ; 0x247e - 2472: cf 33 cpi r28, 0x3F ; 63 - 2474: 21 f0 breq .+8 ; 0x247e - 2476: cd 33 cpi r28, 0x3D ; 61 - 2478: 11 f0 breq .+4 ; 0x247e - 247a: c0 32 cpi r28, 0x20 ; 32 - 247c: b1 f7 brne .-20 ; 0x246a - pCommandDelimiter++; - - CommandDelimiter = *pCommandDelimiter; - *pCommandDelimiter = '\0'; - 247e: f7 01 movw r30, r14 - 2480: 10 82 st Z, r1 - 2482: 88 e0 ldi r24, 0x08 ; 8 - 2484: c8 2e mov r12, r24 - 2486: 88 e0 ldi r24, 0x08 ; 8 - 2488: d8 2e mov r13, r24 - 248a: 00 e0 ldi r16, 0x00 ; 0 - 248c: 10 e0 ldi r17, 0x00 ; 0 - - /* Search in command table */ - for (i = 0; i < ARRAY_COUNT(CommandTable); i++) { - if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 248e: b6 01 movw r22, r12 - 2490: 82 e5 ldi r24, 0x52 ; 82 - 2492: 91 e2 ldi r25, 0x21 ; 33 - 2494: 0e 94 5f 2a call 0x54be ; 0x54be - 2498: 89 2b or r24, r25 - 249a: 09 f0 breq .+2 ; 0x249e - 249c: 56 c0 rjmp .+172 ; 0x254a - - /* Command found. Clear buffer, and call appropriate function */ - char* pParam = ++pCommandDelimiter; - 249e: b7 01 movw r22, r14 - 24a0: 6f 5f subi r22, 0xFF ; 255 - 24a2: 7f 4f sbci r23, 0xFF ; 255 - pTerminalBuffer[0] = '\0'; - 24a4: 10 92 52 21 sts 0x2152, r1 ; 0x802152 -static CommandStatusIdType CallCommandFunc( const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { - char* pTerminalBuffer = (char*) TerminalBuffer; - CommandStatusIdType Status = COMMAND_ERR_INVALID_USAGE_ID; - - /* Call appropriate function depending on CommandDelimiter */ - if (CommandDelimiter == CHAR_GET_MODE) { - 24a8: cf 33 cpi r28, 0x3F ; 63 - 24aa: 49 f4 brne .+18 ; 0x24be - CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); - 24ac: 88 e1 ldi r24, 0x18 ; 24 - 24ae: 80 9f mul r24, r16 - 24b0: f0 01 movw r30, r0 - 24b2: 81 9f mul r24, r17 - 24b4: f0 0d add r31, r0 - 24b6: 11 24 eor r1, r1 - 24b8: e2 5e subi r30, 0xE2 ; 226 - 24ba: f7 4f sbci r31, 0xF7 ; 247 - 24bc: 15 c0 rjmp .+42 ; 0x24e8 - if (GetFunc != NO_FUNCTION) { - Status = GetFunc(pTerminalBuffer); - } - } else if (CommandDelimiter == CHAR_SET_MODE) { - 24be: cd 33 cpi r28, 0x3D ; 61 - 24c0: 49 f4 brne .+18 ; 0x24d4 - CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); - 24c2: 88 e1 ldi r24, 0x18 ; 24 - 24c4: 80 9f mul r24, r16 - 24c6: f0 01 movw r30, r0 - 24c8: 81 9f mul r24, r17 - 24ca: f0 0d add r31, r0 - 24cc: 11 24 eor r1, r1 - 24ce: e4 5e subi r30, 0xE4 ; 228 - 24d0: f7 4f sbci r31, 0xF7 ; 247 - 24d2: 20 c0 rjmp .+64 ; 0x2514 - if (SetFunc != NO_FUNCTION) { - Status = SetFunc(pTerminalBuffer, pParam); - } - } else if (CommandDelimiter == CHAR_EXEC_MODE){ - 24d4: c1 11 cpse r28, r1 - 24d6: 13 c0 rjmp .+38 ; 0x24fe - CommandExecFuncType ExecFunc = pgm_read_ptr(&CommandEntry->ExecFunc); - 24d8: 88 e1 ldi r24, 0x18 ; 24 - 24da: 80 9f mul r24, r16 - 24dc: f0 01 movw r30, r0 - 24de: 81 9f mul r24, r17 - 24e0: f0 0d add r31, r0 - 24e2: 11 24 eor r1, r1 - 24e4: e8 5e subi r30, 0xE8 ; 232 - 24e6: f7 4f sbci r31, 0xF7 ; 247 - 24e8: 25 91 lpm r18, Z+ - 24ea: 34 91 lpm r19, Z - if (ExecFunc != NO_FUNCTION) { - 24ec: 21 15 cp r18, r1 - 24ee: 31 05 cpc r19, r1 - 24f0: 09 f4 brne .+2 ; 0x24f4 - 24f2: 4d c0 rjmp .+154 ; 0x258e - Status = ExecFunc(pTerminalBuffer); - 24f4: 82 e5 ldi r24, 0x52 ; 82 - 24f6: 91 e2 ldi r25, 0x21 ; 33 - 24f8: f9 01 movw r30, r18 - 24fa: 09 95 icall - 24fc: 14 c0 rjmp .+40 ; 0x2526 - } - } else if (CommandDelimiter == CHAR_EXEC_MODE_PARAM) { - 24fe: c0 32 cpi r28, 0x20 ; 32 - 2500: 09 f0 breq .+2 ; 0x2504 - 2502: 45 c0 rjmp .+138 ; 0x258e - CommandExecParamFuncType ExecParamFunc = pgm_read_ptr(&CommandEntry->ExecParamFunc); - 2504: 88 e1 ldi r24, 0x18 ; 24 - 2506: 80 9f mul r24, r16 - 2508: f0 01 movw r30, r0 - 250a: 81 9f mul r24, r17 - 250c: f0 0d add r31, r0 - 250e: 11 24 eor r1, r1 - 2510: e6 5e subi r30, 0xE6 ; 230 - 2512: f7 4f sbci r31, 0xF7 ; 247 - 2514: 25 91 lpm r18, Z+ - 2516: 34 91 lpm r19, Z - if (ExecParamFunc != NO_FUNCTION) { - 2518: 21 15 cp r18, r1 - 251a: 31 05 cpc r19, r1 - 251c: c1 f1 breq .+112 ; 0x258e - Status = ExecParamFunc(pTerminalBuffer, pParam); - 251e: 82 e5 ldi r24, 0x52 ; 82 - 2520: 91 e2 ldi r25, 0x21 ; 33 - 2522: f9 01 movw r30, r18 - 2524: 09 95 icall - } - } else { - /* This should not happen (TM) */ - } - - if (Status == TIMEOUT_COMMAND) { - 2526: 8f 3f cpi r24, 0xFF ; 255 - 2528: 99 f5 brne .+102 ; 0x2590 - TaskPending = true; - 252a: 81 e0 ldi r24, 0x01 ; 1 - 252c: 80 93 e9 20 sts 0x20E9, r24 ; 0x8020e9 - - return false; -} - -INLINE uint16_t SystemGetSysTick(void) { - return SYSTEM_TICK_REGISTER | RTC.CNT; - 2530: 8e b1 in r24, 0x0e ; 14 - 2532: 9f b1 in r25, 0x0f ; 15 - 2534: 20 91 08 04 lds r18, 0x0408 ; 0x800408 <__TEXT_REGION_LENGTH__+0x700408> - 2538: 30 91 09 04 lds r19, 0x0409 ; 0x800409 <__TEXT_REGION_LENGTH__+0x700409> - 253c: 82 2b or r24, r18 - 253e: 93 2b or r25, r19 - TaskPendingSince = SystemGetSysTick(); - 2540: 80 93 e7 20 sts 0x20E7, r24 ; 0x8020e7 - 2544: 90 93 e8 20 sts 0x20E8, r25 ; 0x8020e8 - 2548: 35 c0 rjmp .+106 ; 0x25b4 - 254a: 0f 5f subi r16, 0xFF ; 255 - 254c: 1f 4f sbci r17, 0xFF ; 255 - 254e: f8 e1 ldi r31, 0x18 ; 24 - 2550: cf 0e add r12, r31 - 2552: d1 1c adc r13, r1 - - CommandDelimiter = *pCommandDelimiter; - *pCommandDelimiter = '\0'; - - /* Search in command table */ - for (i = 0; i < ARRAY_COUNT(CommandTable); i++) { - 2554: 03 31 cpi r16, 0x13 ; 19 - 2556: 11 05 cpc r17, r1 - 2558: 09 f0 breq .+2 ; 0x255c - 255a: 99 cf rjmp .-206 ; 0x248e - 255c: 15 c0 rjmp .+42 ; 0x2588 - BufferIdx = 0; - - if (!TaskPending) - DecodeCommand(); - - } else if (b == '\b') { - 255e: 88 30 cpi r24, 0x08 ; 8 - 2560: 61 f4 brne .+24 ; 0x257a - /* Backspace. Delete last character in buffer. */ - if (BufferIdx > 0) - 2562: 80 91 ea 20 lds r24, 0x20EA ; 0x8020ea - 2566: 90 91 eb 20 lds r25, 0x20EB ; 0x8020eb - 256a: 00 97 sbiw r24, 0x00 ; 0 - 256c: 19 f1 breq .+70 ; 0x25b4 - BufferIdx--; - 256e: 01 97 sbiw r24, 0x01 ; 1 - 2570: 80 93 ea 20 sts 0x20EA, r24 ; 0x8020ea - 2574: 90 93 eb 20 sts 0x20EB, r25 ; 0x8020eb - 2578: 1d c0 rjmp .+58 ; 0x25b4 - - } else if (b == 0x1B) { - 257a: 8b 31 cpi r24, 0x1B ; 27 - 257c: d9 f4 brne .+54 ; 0x25b4 - /* Drop buffer on escape */ - BufferIdx = 0; - 257e: 10 92 ea 20 sts 0x20EA, r1 ; 0x8020ea - 2582: 10 92 eb 20 sts 0x20EB, r1 ; 0x8020eb - 2586: 16 c0 rjmp .+44 ; 0x25b4 -} - -static void DecodeCommand(void) { - uint8_t i; - bool CommandFound = false; - CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; - 2588: 88 ec ldi r24, 0xC8 ; 200 - return Status; -} - -static void DecodeCommand(void) { - uint8_t i; - bool CommandFound = false; - 258a: c0 e0 ldi r28, 0x00 ; 0 - 258c: 02 c0 rjmp .+4 ; 0x2592 - if (ExecFunc != NO_FUNCTION) { - Status = ExecFunc(pTerminalBuffer); - } - } else if (CommandDelimiter == CHAR_EXEC_MODE_PARAM) { - CommandExecParamFuncType ExecParamFunc = pgm_read_ptr(&CommandEntry->ExecParamFunc); - if (ExecParamFunc != NO_FUNCTION) { - 258e: 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; - 2590: c1 e0 ldi r28, 0x01 ; 1 - - if (StatusId == TIMEOUT_COMMAND) // it is a timeout command, so we return - return; - - /* Send command status message */ - TerminalSendStringP(GetStatusMessageP(StatusId)); - 2592: 03 df rcall .-506 ; 0x239a - 2594: 60 da rcall .-2880 ; 0x1a56 - TerminalSendStringP(PSTR(STATUS_MESSAGE_TRAILER)); - 2596: 8f e3 ldi r24, 0x3F ; 63 - 2598: 97 e0 ldi r25, 0x07 ; 7 - 259a: 5d da rcall .-2886 ; 0x1a56 - - if (CommandFound && (pTerminalBuffer[0] != '\0') ) { - 259c: cc 23 and r28, r28 - 259e: 51 f0 breq .+20 ; 0x25b4 - 25a0: 80 91 52 21 lds r24, 0x2152 ; 0x802152 - 25a4: 88 23 and r24, r24 - 25a6: 31 f0 breq .+12 ; 0x25b4 - /* Send optional answer */ - TerminalSendString(pTerminalBuffer); - 25a8: 82 e5 ldi r24, 0x52 ; 82 - 25aa: 91 e2 ldi r25, 0x21 ; 33 - 25ac: 4f da rcall .-2914 ; 0x1a4c - TerminalSendStringP(PSTR(OPTIONAL_ANSWER_TRAILER)); - 25ae: 8c e3 ldi r24, 0x3C ; 60 - 25b0: 97 e0 ldi r25, 0x07 ; 7 - 25b2: 51 da rcall .-2910 ; 0x1a56 - BufferIdx = 0; - } else { - /* Ignore other chars */ - } - return true; -} - 25b4: 81 e0 ldi r24, 0x01 ; 1 - 25b6: cf 91 pop r28 - 25b8: 1f 91 pop r17 - 25ba: 0f 91 pop r16 - 25bc: ff 90 pop r15 - 25be: ef 90 pop r14 - 25c0: df 90 pop r13 - 25c2: cf 90 pop r12 - 25c4: 08 95 ret - -000025c6 : - CommandLinePendingTaskTimeout = NO_FUNCTION; - } -} - -void CommandLineTick(void) { - if (TaskPending - 25c6: 80 91 e9 20 lds r24, 0x20E9 ; 0x8020e9 - 25ca: 88 23 and r24, r24 - 25cc: 89 f1 breq .+98 ; 0x2630 - && GlobalSettings.ActiveSettingPtr->PendingTaskTimeout != 0 // 0 means no timeout - 25ce: e0 91 01 20 lds r30, 0x2001 ; 0x802001 - 25d2: f0 91 02 20 lds r31, 0x2002 ; 0x802002 - 25d6: 23 81 ldd r18, Z+3 ; 0x03 - 25d8: 34 81 ldd r19, Z+4 ; 0x04 - 25da: 21 15 cp r18, r1 - 25dc: 31 05 cpc r19, r1 - 25de: 41 f1 breq .+80 ; 0x2630 - 25e0: 8e b1 in r24, 0x0e ; 14 - 25e2: 9f b1 in r25, 0x0f ; 15 - 25e4: 40 91 08 04 lds r20, 0x0408 ; 0x800408 <__TEXT_REGION_LENGTH__+0x700408> - 25e8: 50 91 09 04 lds r21, 0x0409 ; 0x800409 <__TEXT_REGION_LENGTH__+0x700409> - 25ec: 84 2b or r24, r20 - 25ee: 95 2b or r25, r21 - && SYSTICK_DIFF_100MS(TaskPendingSince) >= GlobalSettings.ActiveSettingPtr->PendingTaskTimeout) { // timeout expired - 25f0: 40 91 e7 20 lds r20, 0x20E7 ; 0x8020e7 - 25f4: 50 91 e8 20 lds r21, 0x20E8 ; 0x8020e8 - 25f8: 84 1b sub r24, r20 - 25fa: 95 0b sbc r25, r21 - 25fc: 64 e6 ldi r22, 0x64 ; 100 - 25fe: 70 e0 ldi r23, 0x00 ; 0 - 2600: 0e 94 99 29 call 0x5332 ; 0x5332 <__udivmodhi4> - 2604: 62 17 cp r22, r18 - 2606: 73 07 cpc r23, r19 - 2608: 98 f0 brcs .+38 ; 0x2630 - } - return true; -} - -INLINE void Timeout(void) { - TaskPending = false; - 260a: 10 92 e9 20 sts 0x20E9, r1 ; 0x8020e9 - TerminalSendStringP(GetStatusMessageP(COMMAND_ERR_TIMEOUT_ID)); - 260e: 8b ec ldi r24, 0xCB ; 203 - 2610: c4 de rcall .-632 ; 0x239a - 2612: 21 da rcall .-3006 ; 0x1a56 - TerminalSendStringP(PSTR(STATUS_MESSAGE_TRAILER)); - 2614: 89 e3 ldi r24, 0x39 ; 57 - 2616: 97 e0 ldi r25, 0x07 ; 7 - 2618: 1e da rcall .-3012 ; 0x1a56 - - if (CommandLinePendingTaskTimeout != NO_FUNCTION) { - 261a: e0 91 e5 20 lds r30, 0x20E5 ; 0x8020e5 - 261e: f0 91 e6 20 lds r31, 0x20E6 ; 0x8020e6 - 2622: 30 97 sbiw r30, 0x00 ; 0 - 2624: 29 f0 breq .+10 ; 0x2630 - CommandLinePendingTaskTimeout(); // call the function that ends the task - 2626: 09 95 icall - CommandLinePendingTaskTimeout = NO_FUNCTION; - 2628: 10 92 e5 20 sts 0x20E5, r1 ; 0x8020e5 - 262c: 10 92 e6 20 sts 0x20E6, r1 ; 0x8020e6 - 2630: 08 95 ret - -00002632 : -INLINE void CodecTask(void) { - ActiveConfiguration.CodecTaskFunc(); -} - -INLINE void CodecSetDemodPower(bool bOnOff) { - CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; - 2632: a0 e2 ldi r26, 0x20 ; 32 - 2634: b6 e0 ldi r27, 0x06 ; 6 - 2636: 82 e0 ldi r24, 0x02 ; 2 - 2638: 11 96 adiw r26, 0x01 ; 1 - 263a: 8c 93 st X, r24 - 263c: 11 97 sbiw r26, 0x01 ; 1 - - if (bOnOff) { - CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; - 263e: 15 96 adiw r26, 0x05 ; 5 - 2640: 8c 93 st X, r24 - 2642: 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; - 2644: e0 e4 ldi r30, 0x40 ; 64 - 2646: f8 e0 ldi r31, 0x08 ; 8 - 2648: 10 a2 std Z+32, r1 ; 0x20 - 264a: 11 a2 std Z+33, r1 ; 0x21 - CODEC_TIMER_SAMPLING.PER = SAMPLE_RATE_SYSTEM_CYCLES - 1; - 264c: 8d e2 ldi r24, 0x2D ; 45 - 264e: 91 e0 ldi r25, 0x01 ; 1 - 2650: 86 a3 std Z+38, r24 ; 0x26 - 2652: 97 a3 std Z+39, r25 ; 0x27 - CODEC_TIMER_SAMPLING.CCA = 0xFFFF; /* CCA Interrupt is not active! */ - 2654: 8f ef ldi r24, 0xFF ; 255 - 2656: 9f ef ldi r25, 0xFF ; 255 - 2658: 80 a7 std Z+40, r24 ; 0x28 - 265a: 91 a7 std Z+41, r25 ; 0x29 - CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_DIV1_gc; - 265c: 81 e0 ldi r24, 0x01 ; 1 - 265e: 80 83 st Z, r24 - CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; - 2660: 98 e8 ldi r25, 0x88 ; 136 - 2662: 93 83 std Z+3, r25 ; 0x03 - CODEC_TIMER_SAMPLING.INTCTRLB = TC_CCAINTLVL_HI_gc; - 2664: 93 e0 ldi r25, 0x03 ; 3 - 2666: 97 83 std Z+7, r25 ; 0x07 - - /* Start looking out for modulation pause via interrupt. */ - CODEC_DEMOD_IN_PORT.INT0MASK = CODEC_DEMOD_IN_MASK0; - 2668: 1a 96 adiw r26, 0x0a ; 10 - 266a: 8c 93 st X, r24 - 266c: 08 95 ret - -0000266e <__vector_34>: -} - -ISR(CODEC_DEMOD_IN_INT0_VECT) { - 266e: 1f 92 push r1 - 2670: 0f 92 push r0 - 2672: 0f b6 in r0, 0x3f ; 63 - 2674: 0f 92 push r0 - 2676: 11 24 eor r1, r1 - 2678: 8f 93 push r24 - 267a: 9f 93 push r25 - 267c: ef 93 push r30 - 267e: 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; - 2680: 82 e5 ldi r24, 0x52 ; 82 - 2682: 92 e2 ldi r25, 0x22 ; 34 - 2684: 80 93 f8 20 sts 0x20F8, r24 ; 0x8020f8 - 2688: 90 93 f9 20 sts 0x20F9, r25 ; 0x8020f9 - ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - 268c: 82 ed ldi r24, 0xD2 ; 210 - 268e: 92 e2 ldi r25, 0x22 ; 34 - 2690: 80 93 f6 20 sts 0x20F6, r24 ; 0x8020f6 - 2694: 90 93 f7 20 sts 0x20F7, r25 ; 0x8020f7 - DataRegister = 0; - 2698: 10 92 f1 20 sts 0x20F1, r1 ; 0x8020f1 - SampleRegister = 0; - 269c: 10 92 f0 20 sts 0x20F0, r1 ; 0x8020f0 - SamplePosition = 0; - 26a0: 10 92 ec 20 sts 0x20EC, r1 ; 0x8020ec - BitCount = 0; - 26a4: 10 92 f4 20 sts 0x20F4, r1 ; 0x8020f4 - 26a8: 10 92 f5 20 sts 0x20F5, r1 ; 0x8020f5 - IsParityBit = false; - 26ac: 10 92 ef 20 sts 0x20EF, r1 ; 0x8020ef - * 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; - 26b0: e0 e4 ldi r30, 0x40 ; 64 - 26b2: f8 e0 ldi r31, 0x08 ; 8 - 26b4: 13 82 std Z+3, r1 ; 0x03 - CODEC_TIMER_SAMPLING.PERBUF = SAMPLE_RATE_SYSTEM_CYCLES/2 - 1; /* Half bit width */ - 26b6: 86 e9 ldi r24, 0x96 ; 150 - 26b8: 90 e0 ldi r25, 0x00 ; 0 - 26ba: 86 ab std Z+54, r24 ; 0x36 - 26bc: 97 ab std Z+55, r25 ; 0x37 - CODEC_TIMER_SAMPLING.CCABUF = SAMPLE_RATE_SYSTEM_CYCLES/8 - 10 - 1; /* Compensate for DIGFILT and ISR prolog */ - 26be: 8a e1 ldi r24, 0x1A ; 26 - 26c0: 90 e0 ldi r25, 0x00 ; 0 - 26c2: 80 af std Z+56, r24 ; 0x38 - 26c4: 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; - 26c6: e0 e4 ldi r30, 0x40 ; 64 - 26c8: f9 e0 ldi r31, 0x09 ; 9 - 26ca: 10 a2 std Z+32, r1 ; 0x20 - 26cc: 11 a2 std Z+33, r1 ; 0x21 - CODEC_TIMER_LOADMOD.PER = 0xFFFF; - 26ce: 8f ef ldi r24, 0xFF ; 255 - 26d0: 9f ef ldi r25, 0xFF ; 255 - 26d2: 86 a3 std Z+38, r24 ; 0x26 - 26d4: 97 a3 std Z+39, r25 ; 0x27 - CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH1_gc; - 26d6: 89 e8 ldi r24, 0x89 ; 137 - 26d8: 83 83 std Z+3, r24 ; 0x03 - CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_EVCH6_gc; - 26da: 8e e0 ldi r24, 0x0E ; 14 - 26dc: 80 83 st Z, r24 - - /* Disable this interrupt */ - CODEC_DEMOD_IN_PORT.INT0MASK = 0; - 26de: 10 92 2a 06 sts 0x062A, r1 ; 0x80062a <__TEXT_REGION_LENGTH__+0x70062a> -} - 26e2: ff 91 pop r31 - 26e4: ef 91 pop r30 - 26e6: 9f 91 pop r25 - 26e8: 8f 91 pop r24 - 26ea: 0f 90 pop r0 - 26ec: 0f be out 0x3f, r0 ; 63 - 26ee: 0f 90 pop r0 - 26f0: 1f 90 pop r1 - 26f2: 18 95 reti - -000026f4 <__vector_22>: - -ISR(CODEC_TIMER_SAMPLING_CCA_VECT) { - 26f4: 1f 92 push r1 - 26f6: 0f 92 push r0 - 26f8: 0f b6 in r0, 0x3f ; 63 - 26fa: 0f 92 push r0 - 26fc: 11 24 eor r1, r1 - 26fe: 2f 93 push r18 - 2700: 3f 93 push r19 - 2702: 8f 93 push r24 - 2704: 9f 93 push r25 - 2706: ef 93 push r30 - 2708: 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; - 270a: 90 91 28 06 lds r25, 0x0628 ; 0x800628 <__TEXT_REGION_LENGTH__+0x700628> - uint8_t NewSampleRegister; - - /* Shift sampled bit into sampling register and hold a local copy for fast access. */ - NewSampleRegister = SampleRegister << 1; - 270e: 80 91 f0 20 lds r24, 0x20F0 ; 0x8020f0 - 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; - 2712: 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); - 2714: 21 e0 ldi r18, 0x01 ; 1 - 2716: 09 f0 breq .+2 ; 0x271a <__vector_22+0x26> - 2718: 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; - 271a: 88 0f add r24, r24 - NewSampleRegister |= (!SamplePin ? 0x01 : 0x00); - 271c: 82 2b or r24, r18 - SampleRegister = NewSampleRegister; - 271e: 80 93 f0 20 sts 0x20F0, r24 ; 0x8020f0 - - if (SamplePosition) { - 2722: 90 91 ec 20 lds r25, 0x20EC ; 0x8020ec - 2726: 99 23 and r25, r25 - 2728: 09 f4 brne .+2 ; 0x272c <__vector_22+0x38> - 272a: 6c c0 rjmp .+216 ; 0x2804 <__vector_22+0x110> - /* Analyze the sampling register after 2 samples. */ - if ((NewSampleRegister & 0x07) == 0x07) { - 272c: 98 2f mov r25, r24 - 272e: 97 70 andi r25, 0x07 ; 7 - 2730: 97 30 cpi r25, 0x07 ; 7 - 2732: 91 f5 brne .+100 ; 0x2798 <__vector_22+0xa4> - /* No carrier modulation for 3 sample points. EOC! */ - CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_OFF_gc; - 2734: 10 92 40 08 sts 0x0840, r1 ; 0x800840 <__TEXT_REGION_LENGTH__+0x700840> - CODEC_TIMER_SAMPLING.INTFLAGS = TC0_CCAIF_bm; - 2738: 80 e1 ldi r24, 0x10 ; 16 - 273a: 80 93 4c 08 sts 0x084C, r24 ; 0x80084c <__TEXT_REGION_LENGTH__+0x70084c> - - /* 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; - 273e: 10 92 43 09 sts 0x0943, r1 ; 0x800943 <__TEXT_REGION_LENGTH__+0x700943> - - if (LastBit) { - 2742: 80 91 ee 20 lds r24, 0x20EE ; 0x8020ee - 2746: 88 23 and r24, r24 - 2748: 19 f0 breq .+6 ; 0x2750 <__vector_22+0x5c> - CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; - 274a: 8c eb ldi r24, 0xBC ; 188 - 274c: 94 e0 ldi r25, 0x04 ; 4 - 274e: 02 c0 rjmp .+4 ; 0x2754 <__vector_22+0x60> - } else { - CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; - 2750: 8c e7 ldi r24, 0x7C ; 124 - 2752: 94 e0 ldi r25, 0x04 ; 4 - 2754: 80 93 66 09 sts 0x0966, r24 ; 0x800966 <__TEXT_REGION_LENGTH__+0x700966> - 2758: 90 93 67 09 sts 0x0967, r25 ; 0x800967 <__TEXT_REGION_LENGTH__+0x700967> - } - - LoadModState = LOADMOD_FDT; - 275c: 10 92 ed 20 sts 0x20ED, r1 ; 0x8020ed - - CODEC_TIMER_LOADMOD.INTFLAGS = TC1_OVFIF_bm; - 2760: 81 e0 ldi r24, 0x01 ; 1 - 2762: 80 93 4c 09 sts 0x094C, r24 ; 0x80094c <__TEXT_REGION_LENGTH__+0x70094c> - CODEC_TIMER_LOADMOD.INTCTRLA = TC_OVFINTLVL_HI_gc; - 2766: 83 e0 ldi r24, 0x03 ; 3 - 2768: 80 93 46 09 sts 0x0946, r24 ; 0x800946 <__TEXT_REGION_LENGTH__+0x700946> - - /* 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; - 276c: 80 91 f4 20 lds r24, 0x20F4 ; 0x8020f4 - 2770: 90 91 f5 20 lds r25, 0x20F5 ; 0x8020f5 - 2774: 87 70 andi r24, 0x07 ; 7 - if (RemainingBits != 0) { - 2776: 61 f0 breq .+24 ; 0x2790 <__vector_22+0x9c> - uint8_t NewDataRegister = DataRegister; - 2778: 90 91 f1 20 lds r25, 0x20F1 ; 0x8020f1 - - while (RemainingBits++ < 8) { - 277c: 8f 5f subi r24, 0xFF ; 255 - 277e: 89 30 cpi r24, 0x09 ; 9 - 2780: 11 f0 breq .+4 ; 0x2786 <__vector_22+0x92> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 2782: 96 95 lsr r25 - 2784: fb cf rjmp .-10 ; 0x277c <__vector_22+0x88> - } - - /* TODO: Prevent buffer overflow */ - *CodecBufferPtr = NewDataRegister; - 2786: e0 91 f8 20 lds r30, 0x20F8 ; 0x8020f8 - 278a: f0 91 f9 20 lds r31, 0x20F9 ; 0x8020f9 - 278e: 90 83 st Z, r25 - } - - /* Signal, that we have finished sampling */ - Flags.DemodFinished = 1; - 2790: 81 e0 ldi r24, 0x01 ; 1 - 2792: 80 93 fa 20 sts 0x20FA, r24 ; 0x8020fa - 2796: 36 c0 rjmp .+108 ; 0x2804 <__vector_22+0x110> - } else { - /* Otherwise, we check the two sample bits from the bit before. */ - uint8_t BitSample = NewSampleRegister & 0xC; - 2798: 98 2f mov r25, r24 - 279a: 9c 70 andi r25, 0x0C ; 12 - uint8_t Bit = 0; - - if (BitSample != (0x0 << 2)) { - 279c: 99 f1 breq .+102 ; 0x2804 <__vector_22+0x110> - /* We have a valid bit. decode and process it. */ - if (BitSample & (0x1 << 2)) { - 279e: 82 fb bst r24, 2 - 27a0: 88 27 eor r24, r24 - 27a2: 80 f9 bld r24, 0 - 27a4: 91 e0 ldi r25, 0x01 ; 1 - 27a6: 89 27 eor r24, r25 - } else { - /* 10 sequence -> This is a one bit */ - Bit = 1; - } - - LastBit = Bit; - 27a8: 80 93 ee 20 sts 0x20EE, r24 ; 0x8020ee - - if (!IsParityBit) { - 27ac: 90 91 ef 20 lds r25, 0x20EF ; 0x8020ef - 27b0: 91 11 cpse r25, r1 - 27b2: 26 c0 rjmp .+76 ; 0x2800 <__vector_22+0x10c> - /* This is a data bit, so shift it into the data register and - * hold a local copy of it. */ - uint8_t NewDataRegister = DataRegister >> 1; - 27b4: 90 91 f1 20 lds r25, 0x20F1 ; 0x8020f1 - 27b8: 96 95 lsr r25 - NewDataRegister |= (Bit ? 0x80 : 0x00); - 27ba: 81 11 cpse r24, r1 - 27bc: 80 e8 ldi r24, 0x80 ; 128 - 27be: 89 2b or r24, r25 - DataRegister = NewDataRegister; - 27c0: 80 93 f1 20 sts 0x20F1, r24 ; 0x8020f1 - - /* Update bitcount */ - uint16_t NewBitCount = ++BitCount; - 27c4: 20 91 f4 20 lds r18, 0x20F4 ; 0x8020f4 - 27c8: 30 91 f5 20 lds r19, 0x20F5 ; 0x8020f5 - 27cc: 2f 5f subi r18, 0xFF ; 255 - 27ce: 3f 4f sbci r19, 0xFF ; 255 - 27d0: 20 93 f4 20 sts 0x20F4, r18 ; 0x8020f4 - 27d4: 30 93 f5 20 sts 0x20F5, r19 ; 0x8020f5 - if ((NewBitCount & 0x07) == 0) { - 27d8: 27 70 andi r18, 0x07 ; 7 - 27da: 33 27 eor r19, r19 - 27dc: 23 2b or r18, r19 - 27de: 91 f4 brne .+36 ; 0x2804 <__vector_22+0x110> - /* We have reached a byte boundary! Store the data register. */ - /* TODO: Prevent buffer overflow */ - *CodecBufferPtr++ = NewDataRegister; - 27e0: e0 91 f8 20 lds r30, 0x20F8 ; 0x8020f8 - 27e4: f0 91 f9 20 lds r31, 0x20F9 ; 0x8020f9 - 27e8: 9f 01 movw r18, r30 - 27ea: 2f 5f subi r18, 0xFF ; 255 - 27ec: 3f 4f sbci r19, 0xFF ; 255 - 27ee: 20 93 f8 20 sts 0x20F8, r18 ; 0x8020f8 - 27f2: 30 93 f9 20 sts 0x20F9, r19 ; 0x8020f9 - 27f6: 80 83 st Z, r24 - - /* Store bit for determining FDT at EOC and enable parity - * handling on next bit. */ - IsParityBit = true; - 27f8: 81 e0 ldi r24, 0x01 ; 1 - 27fa: 80 93 ef 20 sts 0x20EF, r24 ; 0x8020ef - 27fe: 02 c0 rjmp .+4 ; 0x2804 <__vector_22+0x110> - - } else { - /* This is a parity bit. Store it */ - /* TODO: Store parity and prevent overflow */ - //*ParityBufferPtr++ = Bit; - IsParityBit = false; - 2800: 10 92 ef 20 sts 0x20EF, r1 ; 0x8020ef - } - } else { - /* On odd sample position just sample. */ - } - - SamplePosition = !SamplePosition; - 2804: 90 91 ec 20 lds r25, 0x20EC ; 0x8020ec - 2808: 81 e0 ldi r24, 0x01 ; 1 - 280a: 89 27 eor r24, r25 - 280c: 80 93 ec 20 sts 0x20EC, r24 ; 0x8020ec - - /* 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; - 2810: 88 e8 ldi r24, 0x88 ; 136 - 2812: 80 93 43 08 sts 0x0843, r24 ; 0x800843 <__TEXT_REGION_LENGTH__+0x700843> -} - 2816: ff 91 pop r31 - 2818: ef 91 pop r30 - 281a: 9f 91 pop r25 - 281c: 8f 91 pop r24 - 281e: 3f 91 pop r19 - 2820: 2f 91 pop r18 - 2822: 0f 90 pop r0 - 2824: 0f be out 0x3f, r0 ; 63 - 2826: 0f 90 pop r0 - 2828: 1f 90 pop r1 - 282a: 18 95 reti - -0000282c <__vector_83>: - -ISR(CODEC_TIMER_OVF_VECT) { - 282c: 1f 92 push r1 - 282e: 0f 92 push r0 - 2830: 0f b6 in r0, 0x3f ; 63 - 2832: 0f 92 push r0 - 2834: 11 24 eor r1, r1 - 2836: 2f 93 push r18 - 2838: 3f 93 push r19 - 283a: 8f 93 push r24 - 283c: 9f 93 push r25 - 283e: ef 93 push r30 - 2840: ff 93 push r31 - /* Bit rate timer. Output a half bit on the output. */ - uint8_t Temp8; - uint16_t Temp16; - - switch (LoadModState) { - 2842: 80 91 ed 20 lds r24, 0x20ED ; 0x8020ed - 2846: 85 30 cpi r24, 0x05 ; 5 - 2848: 09 f4 brne .+2 ; 0x284c <__vector_83+0x20> - 284a: 5a c0 rjmp .+180 ; 0x2900 <__vector_83+0xd4> - 284c: b8 f4 brcc .+46 ; 0x287c <__vector_83+0x50> - 284e: 82 30 cpi r24, 0x02 ; 2 - 2850: b9 f1 breq .+110 ; 0x28c0 <__vector_83+0x94> - 2852: 78 f4 brcc .+30 ; 0x2872 <__vector_83+0x46> - 2854: 88 23 and r24, r24 - 2856: 69 f1 breq .+90 ; 0x28b2 <__vector_83+0x86> - 2858: 81 30 cpi r24, 0x01 ; 1 - 285a: 09 f0 breq .+2 ; 0x285e <__vector_83+0x32> - 285c: c0 c0 rjmp .+384 ; 0x29de <__vector_83+0x1b2> - 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; - 285e: 8f e3 ldi r24, 0x3F ; 63 - 2860: 90 e0 ldi r25, 0x00 ; 0 - 2862: 80 93 66 09 sts 0x0966, r24 ; 0x800966 <__TEXT_REGION_LENGTH__+0x700966> - 2866: 90 93 67 09 sts 0x0967, r25 ; 0x800967 <__TEXT_REGION_LENGTH__+0x700967> - CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_EVCH6_gc; - 286a: 8e e0 ldi r24, 0x0E ; 14 - 286c: 80 93 00 08 sts 0x0800, r24 ; 0x800800 <__TEXT_REGION_LENGTH__+0x700800> - 2870: 27 c0 rjmp .+78 ; 0x28c0 <__vector_83+0x94> -ISR(CODEC_TIMER_OVF_VECT) { - /* Bit rate timer. Output a half bit on the output. */ - uint8_t Temp8; - uint16_t Temp16; - - switch (LoadModState) { - 2872: 83 30 cpi r24, 0x03 ; 3 - 2874: 51 f1 breq .+84 ; 0x28ca <__vector_83+0x9e> - 2876: 84 30 cpi r24, 0x04 ; 4 - 2878: b1 f1 breq .+108 ; 0x28e6 <__vector_83+0xba> - 287a: b1 c0 rjmp .+354 ; 0x29de <__vector_83+0x1b2> - 287c: 88 30 cpi r24, 0x08 ; 8 - 287e: 09 f4 brne .+2 ; 0x2882 <__vector_83+0x56> - 2880: a3 c0 rjmp .+326 ; 0x29c8 <__vector_83+0x19c> - 2882: 38 f4 brcc .+14 ; 0x2892 <__vector_83+0x66> - 2884: 86 30 cpi r24, 0x06 ; 6 - 2886: 09 f4 brne .+2 ; 0x288a <__vector_83+0x5e> - 2888: 60 c0 rjmp .+192 ; 0x294a <__vector_83+0x11e> - 288a: 87 30 cpi r24, 0x07 ; 7 - 288c: 09 f4 brne .+2 ; 0x2890 <__vector_83+0x64> - 288e: 6d c0 rjmp .+218 ; 0x296a <__vector_83+0x13e> - 2890: a6 c0 rjmp .+332 ; 0x29de <__vector_83+0x1b2> - 2892: 89 30 cpi r24, 0x09 ; 9 - 2894: 09 f4 brne .+2 ; 0x2898 <__vector_83+0x6c> - 2896: 9d c0 rjmp .+314 ; 0x29d2 <__vector_83+0x1a6> - 2898: 8a 30 cpi r24, 0x0A ; 10 - 289a: 09 f0 breq .+2 ; 0x289e <__vector_83+0x72> - 289c: a0 c0 rjmp .+320 ; 0x29de <__vector_83+0x1b2> - - 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; - 289e: 10 92 40 09 sts 0x0940, r1 ; 0x800940 <__TEXT_REGION_LENGTH__+0x700940> - CODEC_TIMER_LOADMOD.INTCTRLA = 0; - 28a2: 10 92 46 09 sts 0x0946, r1 ; 0x800946 <__TEXT_REGION_LENGTH__+0x700946> - CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_OFF_gc; - 28a6: 10 92 00 08 sts 0x0800, r1 ; 0x800800 <__TEXT_REGION_LENGTH__+0x700800> - - /* Signal application that we have finished loadmod */ - Flags.LoadmodFinished = 1; - 28aa: 81 e0 ldi r24, 0x01 ; 1 - 28ac: 80 93 fb 20 sts 0x20FB, r24 ; 0x8020fb - break; - 28b0: 96 c0 rjmp .+300 ; 0x29de <__vector_83+0x1b2> - 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; - 28b2: 8f e7 ldi r24, 0x7F ; 127 - 28b4: 90 e0 ldi r25, 0x00 ; 0 - 28b6: 80 93 66 09 sts 0x0966, r24 ; 0x800966 <__TEXT_REGION_LENGTH__+0x700966> - 28ba: 90 93 67 09 sts 0x0967, r25 ; 0x800967 <__TEXT_REGION_LENGTH__+0x700967> - break; - 28be: 8f c0 rjmp .+286 ; 0x29de <__vector_83+0x1b2> - CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_EVCH6_gc; - - /* Fallthrough to first bit */ - - case LOADMOD_START_BIT0: - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 28c0: 80 e4 ldi r24, 0x40 ; 64 - 28c2: 80 93 45 06 sts 0x0645, r24 ; 0x800645 <__TEXT_REGION_LENGTH__+0x700645> - LoadModState = LOADMOD_START_BIT1; - 28c6: 83 e0 ldi r24, 0x03 ; 3 - 28c8: 88 c0 rjmp .+272 ; 0x29da <__vector_83+0x1ae> - break; - - case LOADMOD_START_BIT1: - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 28ca: 80 e4 ldi r24, 0x40 ; 64 - 28cc: 80 93 46 06 sts 0x0646, r24 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - LoadModState = LOADMOD_DATA0; - 28d0: 84 e0 ldi r24, 0x04 ; 4 - 28d2: 80 93 ed 20 sts 0x20ED, r24 ; 0x8020ed - - /* Fetch first byte */ - DataRegister = *CodecBufferPtr; - 28d6: e0 91 f8 20 lds r30, 0x20F8 ; 0x8020f8 - 28da: f0 91 f9 20 lds r31, 0x20F9 ; 0x8020f9 - 28de: 80 81 ld r24, Z - 28e0: 80 93 f1 20 sts 0x20F1, r24 ; 0x8020f1 - break; - 28e4: 7c c0 rjmp .+248 ; 0x29de <__vector_83+0x1b2> - - case LOADMOD_DATA0: - if (DataRegister & 1) { - 28e6: 80 91 f1 20 lds r24, 0x20F1 ; 0x8020f1 - 28ea: 80 ff sbrs r24, 0 - 28ec: 04 c0 rjmp .+8 ; 0x28f6 <__vector_83+0xca> - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 28ee: 80 e4 ldi r24, 0x40 ; 64 - 28f0: 80 93 45 06 sts 0x0645, r24 ; 0x800645 <__TEXT_REGION_LENGTH__+0x700645> - 28f4: 03 c0 rjmp .+6 ; 0x28fc <__vector_83+0xd0> - } else { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 28f6: 80 e4 ldi r24, 0x40 ; 64 - 28f8: 80 93 46 06 sts 0x0646, r24 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - } - - LoadModState = LOADMOD_DATA1; - 28fc: 85 e0 ldi r24, 0x05 ; 5 - 28fe: 6d c0 rjmp .+218 ; 0x29da <__vector_83+0x1ae> - break; - - case LOADMOD_DATA1: - Temp8 = DataRegister; - 2900: 80 91 f1 20 lds r24, 0x20F1 ; 0x8020f1 - - if (Temp8 & 1) { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2904: 90 e4 ldi r25, 0x40 ; 64 - break; - - case LOADMOD_DATA1: - Temp8 = DataRegister; - - if (Temp8 & 1) { - 2906: 80 ff sbrs r24, 0 - 2908: 03 c0 rjmp .+6 ; 0x2910 <__vector_83+0xe4> - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 290a: 90 93 46 06 sts 0x0646, r25 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - 290e: 02 c0 rjmp .+4 ; 0x2914 <__vector_83+0xe8> - } else { - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2910: 90 93 45 06 sts 0x0645, r25 ; 0x800645 <__TEXT_REGION_LENGTH__+0x700645> - } - - DataRegister = Temp8 >> 1; - 2914: 86 95 lsr r24 - 2916: 80 93 f1 20 sts 0x20F1, r24 ; 0x8020f1 - - Temp16 = BitSent; - 291a: 80 91 f2 20 lds r24, 0x20F2 ; 0x8020f2 - 291e: 90 91 f3 20 lds r25, 0x20F3 ; 0x8020f3 - BitSent = ++Temp16; - 2922: 01 96 adiw r24, 0x01 ; 1 - 2924: 80 93 f2 20 sts 0x20F2, r24 ; 0x8020f2 - 2928: 90 93 f3 20 sts 0x20F3, r25 ; 0x8020f3 - - if ((Temp16 & 0x07) == 0) { - 292c: 9c 01 movw r18, r24 - 292e: 27 70 andi r18, 0x07 ; 7 - 2930: 33 27 eor r19, r19 - 2932: 23 2b or r18, r19 - 2934: 11 f4 brne .+4 ; 0x293a <__vector_83+0x10e> - /* Byte boundary. Load parity bit and output it later. */ - LoadModState = LOADMOD_PARITY0; - 2936: 86 e0 ldi r24, 0x06 ; 6 - 2938: 50 c0 rjmp .+160 ; 0x29da <__vector_83+0x1ae> - break; - } - - if (Temp16 == BitCount) { - 293a: 20 91 f4 20 lds r18, 0x20F4 ; 0x8020f4 - 293e: 30 91 f5 20 lds r19, 0x20F5 ; 0x8020f5 - 2942: 82 17 cp r24, r18 - 2944: 93 07 cpc r25, r19 - 2946: f1 f5 brne .+124 ; 0x29c4 <__vector_83+0x198> - 2948: 29 c0 rjmp .+82 ; 0x299c <__vector_83+0x170> - LoadModState = LOADMOD_DATA0; - - break; - - case LOADMOD_PARITY0: - if (*ParityBufferPtr) { - 294a: e0 91 f6 20 lds r30, 0x20F6 ; 0x8020f6 - 294e: f0 91 f7 20 lds r31, 0x20F7 ; 0x8020f7 - 2952: 80 81 ld r24, Z - 2954: 88 23 and r24, r24 - 2956: 21 f0 breq .+8 ; 0x2960 <__vector_83+0x134> - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2958: 80 e4 ldi r24, 0x40 ; 64 - 295a: 80 93 45 06 sts 0x0645, r24 ; 0x800645 <__TEXT_REGION_LENGTH__+0x700645> - 295e: 03 c0 rjmp .+6 ; 0x2966 <__vector_83+0x13a> - } else { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2960: 80 e4 ldi r24, 0x40 ; 64 - 2962: 80 93 46 06 sts 0x0646, r24 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - } - - LoadModState = LOADMOD_PARITY1; - 2966: 87 e0 ldi r24, 0x07 ; 7 - 2968: 38 c0 rjmp .+112 ; 0x29da <__vector_83+0x1ae> - break; - - case LOADMOD_PARITY1: - if (*ParityBufferPtr) { - 296a: e0 91 f6 20 lds r30, 0x20F6 ; 0x8020f6 - 296e: f0 91 f7 20 lds r31, 0x20F7 ; 0x8020f7 - 2972: 80 81 ld r24, Z - 2974: 88 23 and r24, r24 - 2976: 21 f0 breq .+8 ; 0x2980 <__vector_83+0x154> - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2978: 80 e4 ldi r24, 0x40 ; 64 - 297a: 80 93 46 06 sts 0x0646, r24 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - 297e: 03 c0 rjmp .+6 ; 0x2986 <__vector_83+0x15a> - } else { - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2980: 80 e4 ldi r24, 0x40 ; 64 - 2982: 80 93 45 06 sts 0x0645, r24 ; 0x800645 <__TEXT_REGION_LENGTH__+0x700645> - } - - if (BitSent == BitCount) { - 2986: 20 91 f2 20 lds r18, 0x20F2 ; 0x8020f2 - 298a: 30 91 f3 20 lds r19, 0x20F3 ; 0x8020f3 - 298e: 80 91 f4 20 lds r24, 0x20F4 ; 0x8020f4 - 2992: 90 91 f5 20 lds r25, 0x20F5 ; 0x8020f5 - 2996: 28 17 cp r18, r24 - 2998: 39 07 cpc r19, r25 - 299a: 11 f4 brne .+4 ; 0x29a0 <__vector_83+0x174> - /* No data left */ - LoadModState = LOADMOD_STOP_BIT0; - 299c: 88 e0 ldi r24, 0x08 ; 8 - 299e: 1d c0 rjmp .+58 ; 0x29da <__vector_83+0x1ae> - } else { - /* Fetch next data and continue sending bits. */ - ParityBufferPtr++; - 29a0: 31 96 adiw r30, 0x01 ; 1 - 29a2: e0 93 f6 20 sts 0x20F6, r30 ; 0x8020f6 - 29a6: f0 93 f7 20 sts 0x20F7, r31 ; 0x8020f7 - DataRegister = *++CodecBufferPtr; - 29aa: e0 91 f8 20 lds r30, 0x20F8 ; 0x8020f8 - 29ae: f0 91 f9 20 lds r31, 0x20F9 ; 0x8020f9 - 29b2: cf 01 movw r24, r30 - 29b4: 01 96 adiw r24, 0x01 ; 1 - 29b6: 80 93 f8 20 sts 0x20F8, r24 ; 0x8020f8 - 29ba: 90 93 f9 20 sts 0x20F9, r25 ; 0x8020f9 - 29be: 81 81 ldd r24, Z+1 ; 0x01 - 29c0: 80 93 f1 20 sts 0x20F1, r24 ; 0x8020f1 - LoadModState = LOADMOD_DATA0; - 29c4: 84 e0 ldi r24, 0x04 ; 4 - 29c6: 09 c0 rjmp .+18 ; 0x29da <__vector_83+0x1ae> - } - - break; - - case LOADMOD_STOP_BIT0: - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 29c8: 80 e4 ldi r24, 0x40 ; 64 - 29ca: 80 93 46 06 sts 0x0646, r24 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - LoadModState = LOADMOD_STOP_BIT1; - 29ce: 89 e0 ldi r24, 0x09 ; 9 - 29d0: 04 c0 rjmp .+8 ; 0x29da <__vector_83+0x1ae> - break; - - case LOADMOD_STOP_BIT1: - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 29d2: 80 e4 ldi r24, 0x40 ; 64 - 29d4: 80 93 46 06 sts 0x0646, r24 ; 0x800646 <__TEXT_REGION_LENGTH__+0x700646> - LoadModState = LOADMOD_FINISHED; - 29d8: 8a e0 ldi r24, 0x0A ; 10 - 29da: 80 93 ed 20 sts 0x20ED, r24 ; 0x8020ed - break; - - default: - break; - } -} - 29de: ff 91 pop r31 - 29e0: ef 91 pop r30 - 29e2: 9f 91 pop r25 - 29e4: 8f 91 pop r24 - 29e6: 3f 91 pop r19 - 29e8: 2f 91 pop r18 - 29ea: 0f 90 pop r0 - 29ec: 0f be out 0x3f, r0 ; 63 - 29ee: 0f 90 pop r0 - 29f0: 1f 90 pop r1 - 29f2: 18 95 reti - -000029f4 : - -void ISO14443ACodecInit(void) { - 29f4: cf 93 push r28 - 29f6: 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; - 29f8: e0 e4 ldi r30, 0x40 ; 64 - 29fa: f6 e0 ldi r31, 0x06 ; 6 - 29fc: 84 e0 ldi r24, 0x04 ; 4 - 29fe: 82 83 std Z+2, r24 ; 0x02 - CODEC_CARRIER_IN_PORT.CODEC_CARRIER_IN_PINCTRL = PORT_ISC_BOTHEDGES_gc; - 2a00: 12 8a std Z+18, r1 ; 0x12 - EVSYS.CH6MUX = CODEC_CARRIER_IN_EVMUX; - 2a02: c0 e8 ldi r28, 0x80 ; 128 - 2a04: d1 e0 ldi r29, 0x01 ; 1 - 2a06: 82 e6 ldi r24, 0x62 ; 98 - 2a08: 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; - 2a0a: a0 e2 ldi r26, 0x20 ; 32 - 2a0c: b6 e0 ldi r27, 0x06 ; 6 - 2a0e: 85 e0 ldi r24, 0x05 ; 5 - 2a10: 12 96 adiw r26, 0x02 ; 2 - 2a12: 8c 93 st X, r24 - 2a14: 12 97 sbiw r26, 0x02 ; 2 - CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL0 = PORT_ISC_RISING_gc; - 2a16: 81 e0 ldi r24, 0x01 ; 1 - 2a18: 50 96 adiw r26, 0x10 ; 16 - 2a1a: 8c 93 st X, r24 - 2a1c: 50 97 sbiw r26, 0x10 ; 16 - CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL1 = PORT_ISC_FALLING_gc; - 2a1e: 82 e0 ldi r24, 0x02 ; 2 - 2a20: 52 96 adiw r26, 0x12 ; 18 - 2a22: 8c 93 st X, r24 - 2a24: 52 97 sbiw r26, 0x12 ; 18 - CODEC_DEMOD_IN_PORT.INT0MASK = 0; - 2a26: 1a 96 adiw r26, 0x0a ; 10 - 2a28: 1c 92 st X, r1 - 2a2a: 1a 97 sbiw r26, 0x0a ; 10 - CODEC_DEMOD_IN_PORT.INTCTRL = PORT_INT0LVL_HI_gc; - 2a2c: 83 e0 ldi r24, 0x03 ; 3 - 2a2e: 19 96 adiw r26, 0x09 ; 9 - 2a30: 8c 93 st X, r24 - EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0; - 2a32: 98 e5 ldi r25, 0x58 ; 88 - 2a34: 98 83 st Y, r25 - EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1; - 2a36: 9a e5 ldi r25, 0x5A ; 90 - 2a38: 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; - 2a3a: 90 e4 ldi r25, 0x40 ; 64 - 2a3c: 91 83 std Z+1, r25 ; 0x01 - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2a3e: 96 83 std Z+6, r25 ; 0x06 - CODEC_SUBCARRIER_PORT.DIRSET = CODEC_SUBCARRIER_MASK; - 2a40: 81 83 std Z+1, r24 ; 0x01 - CODEC_SUBCARRIER_PORT.OUTCLR = CODEC_SUBCARRIER_MASK; - 2a42: 86 83 std Z+6, r24 ; 0x06 - - /* Configure subcarrier generation with 50% DC output using OOK */ - CODEC_SUBCARRIER_TIMER.PER = ISO14443A_SUBCARRIER_DIVIDER - 1; - 2a44: e0 e0 ldi r30, 0x00 ; 0 - 2a46: f8 e0 ldi r31, 0x08 ; 8 - 2a48: 8f e0 ldi r24, 0x0F ; 15 - 2a4a: 90 e0 ldi r25, 0x00 ; 0 - 2a4c: 86 a3 std Z+38, r24 ; 0x26 - 2a4e: 97 a3 std Z+39, r25 ; 0x27 - CODEC_SUBCARRIER_TIMER.CODEC_SUBCARRIER_CC_OOK = ISO14443A_SUBCARRIER_DIVIDER/2; - 2a50: 88 e0 ldi r24, 0x08 ; 8 - 2a52: 90 e0 ldi r25, 0x00 ; 0 - 2a54: 82 a7 std Z+42, r24 ; 0x2a - 2a56: 93 a7 std Z+43, r25 ; 0x2b - CODEC_SUBCARRIER_TIMER.CTRLB = CODEC_SUBCARRIER_CCEN_OOK | TC_WGMODE_SINGLESLOPE_gc; - 2a58: 83 e2 ldi r24, 0x23 ; 35 - 2a5a: 81 83 std Z+1, r24 ; 0x01 -void ISO14443ACodecInit(void) { - /* Initialize common peripherals and start listening - * for incoming data. */ - Initialize(); - StartDemod(); -} - 2a5c: df 91 pop r29 - 2a5e: cf 91 pop r28 - -void ISO14443ACodecInit(void) { - /* Initialize common peripherals and start listening - * for incoming data. */ - Initialize(); - StartDemod(); - 2a60: e8 cd rjmp .-1072 ; 0x2632 - -00002a62 : -} - -void ISO14443ACodecTask(void) { - 2a62: cf 93 push r28 - 2a64: df 93 push r29 - if (Flags.DemodFinished) { - 2a66: 80 91 fa 20 lds r24, 0x20FA ; 0x8020fa - 2a6a: 88 23 and r24, r24 - 2a6c: 09 f4 brne .+2 ; 0x2a70 - 2a6e: 5c c0 rjmp .+184 ; 0x2b28 - Flags.DemodFinished = 0; - 2a70: 10 92 fa 20 sts 0x20FA, r1 ; 0x8020fa -INLINE void CodecTask(void) { - ActiveConfiguration.CodecTaskFunc(); -} - -INLINE void CodecSetDemodPower(bool bOnOff) { - CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; - 2a74: 82 e0 ldi r24, 0x02 ; 2 - 2a76: 80 93 21 06 sts 0x0621, r24 ; 0x800621 <__TEXT_REGION_LENGTH__+0x700621> - - if (bOnOff) { - CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; - } else { - CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK; - 2a7a: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <__TEXT_REGION_LENGTH__+0x700626> - /* Reception finished. Process the received bytes */ - CodecSetDemodPower(false); - - uint16_t DemodBitCount = BitCount; - 2a7e: 60 91 f4 20 lds r22, 0x20F4 ; 0x8020f4 - 2a82: 70 91 f5 20 lds r23, 0x20F5 ; 0x8020f5 - uint16_t AnswerBitCount = ISO14443A_APP_NO_RESPONSE; - - if (DemodBitCount > 0) { - 2a86: 61 15 cp r22, r1 - 2a88: 71 05 cpc r23, r1 - 2a8a: 49 f1 breq .+82 ; 0x2ade -INLINE void ApplicationTick(void) { - ActiveConfiguration.ApplicationTickFunc(); -} - -INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { - return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); - 2a8c: e0 91 48 21 lds r30, 0x2148 ; 0x802148 - 2a90: f0 91 49 21 lds r31, 0x2149 ; 0x802149 - 2a94: 82 e5 ldi r24, 0x52 ; 82 - 2a96: 92 e2 ldi r25, 0x22 ; 34 - 2a98: 09 95 icall - - /* Call application if we received data */ - AnswerBitCount = ApplicationProcess(CodecBuffer, DemodBitCount); - //for(uint16_t i=0;i<=DemodBitCount/8;i++) - //uart_putc_hex(CodecBuffer[i]); - if (AnswerBitCount & ISO14443A_APP_CUSTOM_PARITY) { - 2a9a: 94 fd sbrc r25, 4 - 2a9c: 08 c0 rjmp .+16 ; 0x2aae - /* 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++) { - 2a9e: dc 01 movw r26, r24 - 2aa0: 23 e0 ldi r18, 0x03 ; 3 - 2aa2: b6 95 lsr r27 - 2aa4: a7 95 ror r26 - 2aa6: 2a 95 dec r18 - 2aa8: e1 f7 brne .-8 ; 0x2aa2 - 2aaa: 40 e0 ldi r20, 0x00 ; 0 - 2aac: 02 c0 rjmp .+4 ; 0x2ab2 - //for(uint16_t i=0;i<=DemodBitCount/8;i++) - //uart_putc_hex(CodecBuffer[i]); - if (AnswerBitCount & ISO14443A_APP_CUSTOM_PARITY) { - /* Application has generated it's own parity bits. - * Clear this option bit. */ - AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; - 2aae: 9f 7e andi r25, 0xEF ; 239 - 2ab0: 1c c0 rjmp .+56 ; 0x2aea - } else { - /* We have to generate the parity bits ourself */ - for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { - 2ab2: 24 2f mov r18, r20 - 2ab4: 30 e0 ldi r19, 0x00 ; 0 - 2ab6: 2a 17 cp r18, r26 - 2ab8: 3b 07 cpc r19, r27 - 2aba: b8 f4 brcc .+46 ; 0x2aea - /* For each whole byte, generate a parity bit. */ - CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CodecBuffer[i]); - 2abc: b9 01 movw r22, r18 - 2abe: 60 58 subi r22, 0x80 ; 128 - 2ac0: 7f 4f sbci r23, 0xFF ; 255 - 2ac2: f9 01 movw r30, r18 - 2ac4: ee 5a subi r30, 0xAE ; 174 - 2ac6: fd 4d sbci r31, 0xDD ; 221 - -INLINE uint8_t OddParityBit(uint8_t Byte) -{ - extern const uint8_t PROGMEM OddParityByteTable[]; - - return pgm_read_byte(&OddParityByteTable[Byte]); - 2ac8: e0 81 ld r30, Z - 2aca: f0 e0 ldi r31, 0x00 ; 0 - 2acc: e9 5e subi r30, 0xE9 ; 233 - 2ace: fb 4f sbci r31, 0xFB ; 251 - 2ad0: e4 91 lpm r30, Z - 2ad2: eb 01 movw r28, r22 - 2ad4: ce 5a subi r28, 0xAE ; 174 - 2ad6: dd 4d sbci r29, 0xDD ; 221 - 2ad8: e8 83 st Y, r30 - /* 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++) { - 2ada: 4f 5f subi r20, 0xFF ; 255 - 2adc: ea cf rjmp .-44 ; 0x2ab2 -} - -INLINE void ApplicationReset(void) { - ActiveConfiguration.ApplicationResetFunc(); - 2ade: e0 91 42 21 lds r30, 0x2142 ; 0x802142 - 2ae2: f0 91 43 21 lds r31, 0x2143 ; 0x802143 - 2ae6: 09 95 icall - 2ae8: 1a c0 rjmp .+52 ; 0x2b1e - } - } else { - ApplicationReset(); - } - - if (AnswerBitCount != ISO14443A_APP_NO_RESPONSE) { - 2aea: 00 97 sbiw r24, 0x00 ; 0 - 2aec: c1 f0 breq .+48 ; 0x2b1e - BitCount = AnswerBitCount; - 2aee: 80 93 f4 20 sts 0x20F4, r24 ; 0x8020f4 - 2af2: 90 93 f5 20 sts 0x20F5, r25 ; 0x8020f5 - BitSent = 0; - 2af6: 10 92 f2 20 sts 0x20F2, r1 ; 0x8020f2 - 2afa: 10 92 f3 20 sts 0x20F3, r1 ; 0x8020f3 - CodecBufferPtr = CodecBuffer; - 2afe: 82 e5 ldi r24, 0x52 ; 82 - 2b00: 92 e2 ldi r25, 0x22 ; 34 - 2b02: 80 93 f8 20 sts 0x20F8, r24 ; 0x8020f8 - 2b06: 90 93 f9 20 sts 0x20F9, r25 ; 0x8020f9 - ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - 2b0a: 82 ed ldi r24, 0xD2 ; 210 - 2b0c: 92 e2 ldi r25, 0x22 ; 34 - 2b0e: 80 93 f6 20 sts 0x20F6, r24 ; 0x8020f6 - 2b12: 90 93 f7 20 sts 0x20F7, r25 ; 0x8020f7 - LoadModState = LOADMOD_START; - 2b16: 81 e0 ldi r24, 0x01 ; 1 - 2b18: 80 93 ed 20 sts 0x20ED, r24 ; 0x8020ed - 2b1c: 05 c0 rjmp .+10 ; 0x2b28 - } else { - /* No data to be processed. Disable loadmodding and start listening again */ - CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_OFF_gc; - 2b1e: 10 92 40 09 sts 0x0940, r1 ; 0x800940 <__TEXT_REGION_LENGTH__+0x700940> - CODEC_TIMER_LOADMOD.INTCTRLA = 0; - 2b22: 10 92 46 09 sts 0x0946, r1 ; 0x800946 <__TEXT_REGION_LENGTH__+0x700946> - - StartDemod(); - 2b26: 85 dd rcall .-1270 ; 0x2632 - } - } - - if (Flags.LoadmodFinished) { - 2b28: 80 91 fb 20 lds r24, 0x20FB ; 0x8020fb - 2b2c: 88 23 and r24, r24 - 2b2e: 29 f0 breq .+10 ; 0x2b3a - Flags.LoadmodFinished = 0; - 2b30: 10 92 fb 20 sts 0x20FB, r1 ; 0x8020fb - /* Load modulation has been finished. Stop it and start to listen - * for incoming data again. */ - StartDemod(); - } -} - 2b34: df 91 pop r29 - 2b36: 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(); - 2b38: 7c cd rjmp .-1288 ; 0x2632 - } -} - 2b3a: df 91 pop r29 - 2b3c: cf 91 pop r28 - 2b3e: 08 95 ret - -00002b40 : -{ - -} - -static bool VerifyAuthentication(uint8_t PageAddress) -{ - 2b40: 28 2f mov r18, r24 - /* No authentication for EV0 cards; always pass */ - if (Flavor < UL_EV1) { - 2b42: 80 91 04 21 lds r24, 0x2104 ; 0x802104 - 2b46: 88 23 and r24, r24 - 2b48: 59 f0 breq .+22 ; 0x2b60 - return true; - } - /* If authenticated, no verification needed */ - if (Authenticated) { - 2b4a: 80 91 fe 20 lds r24, 0x20FE ; 0x8020fe - 2b4e: 81 11 cpse r24, r1 - 2b50: 08 c0 rjmp .+16 ; 0x2b62 - return true; - } - /* Otherwise, verify the accessed page is below the limit */ - return PageAddress < FirstAuthenticatedPage; - 2b52: 81 e0 ldi r24, 0x01 ; 1 - 2b54: 90 91 fd 20 lds r25, 0x20FD ; 0x8020fd - 2b58: 29 17 cp r18, r25 - 2b5a: 18 f0 brcs .+6 ; 0x2b62 - 2b5c: 80 e0 ldi r24, 0x00 ; 0 - 2b5e: 08 95 ret - -static bool VerifyAuthentication(uint8_t PageAddress) -{ - /* No authentication for EV0 cards; always pass */ - if (Flavor < UL_EV1) { - return true; - 2b60: 81 e0 ldi r24, 0x01 ; 1 - if (Authenticated) { - return true; - } - /* Otherwise, verify the accessed page is below the limit */ - return PageAddress < FirstAuthenticatedPage; -} - 2b62: 08 95 ret - -00002b64 : - ReadAccessProtected = false; - AppInitCommon(); -} - -static void AppInitEV1Common(void) -{ - 2b64: ff 92 push r15 - 2b66: 0f 93 push r16 - 2b68: 1f 93 push r17 - 2b6a: cf 93 push r28 - 2b6c: df 93 push r29 - 2b6e: 1f 92 push r1 - 2b70: cd b7 in r28, 0x3d ; 61 - 2b72: de b7 in r29, 0x3e ; 62 - uint8_t ConfigAreaAddress = PageCount * MIFARE_ULTRALIGHT_PAGE_SIZE - CONFIG_AREA_SIZE; - 2b74: 00 91 01 21 lds r16, 0x2101 ; 0x802101 - 2b78: 00 0f add r16, r16 - 2b7a: 00 0f add r16, r16 - 2b7c: 00 51 subi r16, 0x10 ; 16 - uint8_t Access; - - /* Set up the emulation flavor */ - Flavor = UL_EV1; - 2b7e: ff 24 eor r15, r15 - 2b80: f3 94 inc r15 - 2b82: f0 92 04 21 sts 0x2104, r15 ; 0x802104 - /* Fetch some of the configuration into RAM */ - MemoryReadBlock(&FirstAuthenticatedPage, ConfigAreaAddress + CONF_AUTH0_OFFSET, 1); - 2b86: 10 e0 ldi r17, 0x00 ; 0 - 2b88: b8 01 movw r22, r16 - 2b8a: 6d 5f subi r22, 0xFD ; 253 - 2b8c: 7f 4f sbci r23, 0xFF ; 255 - 2b8e: 41 e0 ldi r20, 0x01 ; 1 - 2b90: 50 e0 ldi r21, 0x00 ; 0 - 2b92: 8d ef ldi r24, 0xFD ; 253 - 2b94: 90 e2 ldi r25, 0x20 ; 32 - 2b96: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - MemoryReadBlock(&Access, ConfigAreaAddress + CONF_ACCESS_OFFSET, 1); - 2b9a: b8 01 movw r22, r16 - 2b9c: 6c 5f subi r22, 0xFC ; 252 - 2b9e: 7f 4f sbci r23, 0xFF ; 255 - 2ba0: 41 e0 ldi r20, 0x01 ; 1 - 2ba2: 50 e0 ldi r21, 0x00 ; 0 - 2ba4: ce 01 movw r24, r28 - 2ba6: 01 96 adiw r24, 0x01 ; 1 - 2ba8: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - ReadAccessProtected = !!(Access & CONF_ACCESS_PROT); - 2bac: 89 81 ldd r24, Y+1 ; 0x01 - 2bae: 88 1f adc r24, r24 - 2bb0: 88 27 eor r24, r24 - 2bb2: 88 1f adc r24, r24 - 2bb4: 80 93 fc 20 sts 0x20FC, r24 ; 0x8020fc -static uint8_t FirstAuthenticatedPage; -static bool ReadAccessProtected; - -static void AppInitCommon(void) -{ - State = STATE_IDLE; - 2bb8: f0 92 03 21 sts 0x2103, r15 ; 0x802103 - FromHalt = false; - 2bbc: 10 92 02 21 sts 0x2102, r1 ; 0x802102 - Authenticated = false; - 2bc0: 10 92 fe 20 sts 0x20FE, r1 ; 0x8020fe - ArmedForCompatWrite = false; - 2bc4: 10 92 00 21 sts 0x2100, r1 ; 0x802100 - /* Fetch some of the configuration into RAM */ - MemoryReadBlock(&FirstAuthenticatedPage, ConfigAreaAddress + CONF_AUTH0_OFFSET, 1); - MemoryReadBlock(&Access, ConfigAreaAddress + CONF_ACCESS_OFFSET, 1); - ReadAccessProtected = !!(Access & CONF_ACCESS_PROT); - AppInitCommon(); -} - 2bc8: 0f 90 pop r0 - 2bca: df 91 pop r29 - 2bcc: cf 91 pop r28 - 2bce: 1f 91 pop r17 - 2bd0: 0f 91 pop r16 - 2bd2: ff 90 pop r15 - 2bd4: 08 95 ret - -00002bd6 : -} - -void MifareUltralightAppInit(void) -{ - /* Set up the emulation flavor */ - Flavor = UL_EV0; - 2bd6: 10 92 04 21 sts 0x2104, r1 ; 0x802104 - /* EV0 cards have fixed size */ - PageCount = MIFARE_ULTRALIGHT_PAGES; - 2bda: 80 e1 ldi r24, 0x10 ; 16 - 2bdc: 80 93 01 21 sts 0x2101, r24 ; 0x802101 - /* Default values */ - FirstAuthenticatedPage = 0xFF; - 2be0: 8f ef ldi r24, 0xFF ; 255 - 2be2: 80 93 fd 20 sts 0x20FD, r24 ; 0x8020fd - ReadAccessProtected = false; - 2be6: 10 92 fc 20 sts 0x20FC, r1 ; 0x8020fc -static uint8_t FirstAuthenticatedPage; -static bool ReadAccessProtected; - -static void AppInitCommon(void) -{ - State = STATE_IDLE; - 2bea: 81 e0 ldi r24, 0x01 ; 1 - 2bec: 80 93 03 21 sts 0x2103, r24 ; 0x802103 - FromHalt = false; - 2bf0: 10 92 02 21 sts 0x2102, r1 ; 0x802102 - Authenticated = false; - 2bf4: 10 92 fe 20 sts 0x20FE, r1 ; 0x8020fe - ArmedForCompatWrite = false; - 2bf8: 10 92 00 21 sts 0x2100, r1 ; 0x802100 - 2bfc: 08 95 ret - -00002bfe : - AppInitCommon(); -} - -void MifareUltralightEV11AppInit(void) -{ - PageCount = MIFARE_ULTRALIGHT_EV11_PAGES; - 2bfe: 84 e1 ldi r24, 0x14 ; 20 - 2c00: 80 93 01 21 sts 0x2101, r24 ; 0x802101 - AppInitEV1Common(); - 2c04: af cf rjmp .-162 ; 0x2b64 - -00002c06 : -} - -void MifareUltralightEV12AppInit(void) -{ - PageCount = MIFARE_ULTRALIGHT_EV12_PAGES; - 2c06: 89 e2 ldi r24, 0x29 ; 41 - 2c08: 80 93 01 21 sts 0x2101, r24 ; 0x802101 - AppInitEV1Common(); - 2c0c: ab cf rjmp .-170 ; 0x2b64 - -00002c0e : -} - -void MifareUltralightAppReset(void) -{ - State = STATE_IDLE; - 2c0e: 81 e0 ldi r24, 0x01 ; 1 - 2c10: 80 93 03 21 sts 0x2103, r24 ; 0x802103 - 2c14: 08 95 ret - -00002c16 : -} - -void MifareUltralightAppTask(void) -{ - 2c16: 08 95 ret - -00002c18 : - State = STATE_IDLE; - return ISO14443A_APP_NO_RESPONSE; -} - -uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - 2c18: 8f 92 push r8 - 2c1a: 9f 92 push r9 - 2c1c: af 92 push r10 - 2c1e: bf 92 push r11 - 2c20: cf 92 push r12 - 2c22: df 92 push r13 - 2c24: ef 92 push r14 - 2c26: ff 92 push r15 - 2c28: 0f 93 push r16 - 2c2a: 1f 93 push r17 - 2c2c: cf 93 push r28 - 2c2e: df 93 push r29 - 2c30: cd b7 in r28, 0x3d ; 61 - 2c32: de b7 in r29, 0x3e ; 62 - 2c34: 25 97 sbiw r28, 0x05 ; 5 - 2c36: cd bf out 0x3d, r28 ; 61 - 2c38: de bf out 0x3e, r29 ; 62 - 2c3a: 8c 01 movw r16, r24 - uint8_t Cmd = Buffer[0]; - 2c3c: fc 01 movw r30, r24 - 2c3e: 80 81 ld r24, Z - uint16_t ByteCount; - - switch(State) { - 2c40: 90 91 03 21 lds r25, 0x2103 ; 0x802103 - 2c44: 92 30 cpi r25, 0x02 ; 2 - 2c46: e9 f0 breq .+58 ; 0x2c82 - 2c48: 28 f0 brcs .+10 ; 0x2c54 - 2c4a: 93 30 cpi r25, 0x03 ; 3 - 2c4c: 19 f1 breq .+70 ; 0x2c94 - 2c4e: 94 30 cpi r25, 0x04 ; 4 - 2c50: 59 f1 breq .+86 ; 0x2ca8 - 2c52: 4f c0 rjmp .+158 ; 0x2cf2 - 2c54: 21 e0 ldi r18, 0x01 ; 1 - 2c56: 92 27 eor r25, r18 - case STATE_IDLE: - case STATE_HALT: - FromHalt = State == STATE_HALT; - 2c58: 29 2f mov r18, r25 - 2c5a: 21 70 andi r18, 0x01 ; 1 - 2c5c: 20 93 02 21 sts 0x2102, r18 ; 0x802102 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) || - 2c60: 91 11 cpse r25, r1 - 2c62: 02 c0 rjmp .+4 ; 0x2c68 - 2c64: 86 32 cpi r24, 0x26 ; 38 - 2c66: 19 f0 breq .+6 ; 0x2c6e - 2c68: 82 35 cpi r24, 0x52 ; 82 - 2c6a: 09 f0 breq .+2 ; 0x2c6e - 2c6c: 42 c0 rjmp .+132 ; 0x2cf2 - (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 2c6e: 84 e4 ldi r24, 0x44 ; 68 - 2c70: f8 01 movw r30, r16 - 2c72: 80 83 st Z, r24 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 2c74: 11 82 std Z+1, r1 ; 0x01 - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - /* We received a REQA or WUPA command, so wake up. */ - State = STATE_READY1; - 2c76: 82 e0 ldi r24, 0x02 ; 2 - 2c78: 80 93 03 21 sts 0x2103, r24 ; 0x802103 - - *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 2c7c: 80 e1 ldi r24, 0x10 ; 16 - 2c7e: 90 e0 ldi r25, 0x00 ; 0 - return BitCount; - 2c80: e1 c2 rjmp .+1474 ; 0x3244 <__stack+0x245> - } - break; - - case STATE_READY1: - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - 2c82: 90 91 02 21 lds r25, 0x2102 ; 0x802102 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) || - 2c86: 91 11 cpse r25, r1 - 2c88: 02 c0 rjmp .+4 ; 0x2c8e - 2c8a: 86 32 cpi r24, 0x26 ; 38 - 2c8c: b1 f0 breq .+44 ; 0x2cba - 2c8e: 82 35 cpi r24, 0x52 ; 82 - 2c90: 99 f5 brne .+102 ; 0x2cf8 - 2c92: 13 c0 rjmp .+38 ; 0x2cba - State = STATE_IDLE; - } - break; - - case STATE_READY2: - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - 2c94: 90 91 02 21 lds r25, 0x2102 ; 0x802102 - 2c98: 91 11 cpse r25, r1 - 2c9a: 02 c0 rjmp .+4 ; 0x2ca0 - 2c9c: 86 32 cpi r24, 0x26 ; 38 - 2c9e: 69 f0 breq .+26 ; 0x2cba - 2ca0: 82 35 cpi r24, 0x52 ; 82 - 2ca2: 09 f0 breq .+2 ; 0x2ca6 - 2ca4: 5b c0 rjmp .+182 ; 0x2d5c - 2ca6: 09 c0 rjmp .+18 ; 0x2cba - break; - - case STATE_ACTIVE: - /* Preserve incoming data length */ - ByteCount = (BitCount + 7) >> 3; - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - 2ca8: 90 91 02 21 lds r25, 0x2102 ; 0x802102 - 2cac: 91 11 cpse r25, r1 - 2cae: 02 c0 rjmp .+4 ; 0x2cb4 - 2cb0: 86 32 cpi r24, 0x26 ; 38 - 2cb2: 19 f0 breq .+6 ; 0x2cba - 2cb4: 82 35 cpi r24, 0x52 ; 82 - 2cb6: 09 f0 breq .+2 ; 0x2cba - 2cb8: f2 c0 rjmp .+484 ; 0x2e9e - (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 2cba: 84 e4 ldi r24, 0x44 ; 68 - 2cbc: f8 01 movw r30, r16 - 2cbe: 80 83 st Z, r24 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 2cc0: 11 82 std Z+1, r1 ; 0x01 - State = FromHalt ? STATE_HALT : STATE_IDLE; - 2cc2: 81 e0 ldi r24, 0x01 ; 1 - 2cc4: 89 27 eor r24, r25 - 2cc6: 13 c0 rjmp .+38 ; 0x2cee -} - -/* Handles processing of MF commands */ -static uint16_t AppProcess(uint8_t* const Buffer, uint16_t ByteCount) -{ - uint8_t Cmd = Buffer[0]; - 2cc8: f8 01 movw r30, r16 - 2cca: 80 81 ld r24, Z - - /* Handle the compatibility write command */ - if (ArmedForCompatWrite) { - 2ccc: 90 91 00 21 lds r25, 0x2100 ; 0x802100 - 2cd0: 91 11 cpse r25, r1 - 2cd2: f9 c0 rjmp .+498 ; 0x2ec6 - Buffer[0] = ACK_VALUE; - return ACK_FRAME_SIZE; - } - - /* Handle EV0 commands */ - switch (Cmd) { - 2cd4: 80 35 cpi r24, 0x50 ; 80 - 2cd6: 09 f4 brne .+2 ; 0x2cda - 2cd8: 74 c1 rjmp .+744 ; 0x2fc2 - 2cda: 08 f0 brcs .+2 ; 0x2cde - 2cdc: 05 c1 rjmp .+522 ; 0x2ee8 - 2cde: 80 33 cpi r24, 0x30 ; 48 - 2ce0: 09 f4 brne .+2 ; 0x2ce4 - 2ce2: 08 c1 rjmp .+528 ; 0x2ef4 - } - default: - break; - } - /* Handle EV1 commands */ - if (Flavor >= UL_EV1) { - 2ce4: 90 91 04 21 lds r25, 0x2104 ; 0x802104 - 2ce8: 91 11 cpse r25, r1 - 2cea: 72 c1 rjmp .+740 ; 0x2fd0 - default: - break; - } - } - /* Command not handled. Switch to idle. */ - State = STATE_IDLE; - 2cec: 81 e0 ldi r24, 0x01 ; 1 - 2cee: 80 93 03 21 sts 0x2103, r24 ; 0x802103 - /* Unknown state? Should never happen. */ - break; - } - - /* No response has been sent, when we reach here */ - return ISO14443A_APP_NO_RESPONSE; - 2cf2: 80 e0 ldi r24, 0x00 ; 0 - 2cf4: 90 e0 ldi r25, 0x00 ; 0 - 2cf6: a6 c2 rjmp .+1356 ; 0x3244 <__stack+0x245> - - case STATE_READY1: - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - State = FromHalt ? STATE_HALT : STATE_IDLE; - return ISO14443A_APP_NO_RESPONSE; - } else if (Cmd == ISO14443A_CMD_SELECT_CL1) { - 2cf8: 83 39 cpi r24, 0x93 ; 147 - 2cfa: c1 f7 brne .-16 ; 0x2cec - /* Load UID CL1 and perform anticollision. Since - * MF Ultralight use a double-sized UID, the first byte - * of CL1 has to be the cascade-tag byte. */ - uint8_t UidCL1[ISO14443A_CL_UID_SIZE] = { [0] = ISO14443A_UID0_CT }; - 2cfc: 19 82 std Y+1, r1 ; 0x01 - 2cfe: 1a 82 std Y+2, r1 ; 0x02 - 2d00: 1b 82 std Y+3, r1 ; 0x03 - 2d02: 1c 82 std Y+4, r1 ; 0x04 - 2d04: 88 e8 ldi r24, 0x88 ; 136 - 2d06: 89 83 std Y+1, r24 ; 0x01 - - MemoryReadBlock(&UidCL1[1], UID_CL1_ADDRESS, UID_CL1_SIZE); - 2d08: 43 e0 ldi r20, 0x03 ; 3 - 2d0a: 50 e0 ldi r21, 0x00 ; 0 - 2d0c: 60 e0 ldi r22, 0x00 ; 0 - 2d0e: 70 e0 ldi r23, 0x00 ; 0 - 2d10: ce 01 movw r24, r28 - 2d12: 02 96 adiw r24, 0x02 ; 2 - 2d14: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - -INLINE -bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - uint8_t NVB = DataPtr[1]; - 2d18: f8 01 movw r30, r16 - 2d1a: 81 81 ldd r24, Z+1 ; 0x01 - //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; - //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; - - switch (NVB) { - 2d1c: 80 32 cpi r24, 0x20 ; 32 - 2d1e: 09 f4 brne .+2 ; 0x2d22 - 2d20: aa c0 rjmp .+340 ; 0x2e76 - 2d22: 80 37 cpi r24, 0x70 ; 112 - 2d24: 09 f0 breq .+2 ; 0x2d28 - 2d26: 47 c0 rjmp .+142 ; 0x2db6 - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 2d28: f8 01 movw r30, r16 - 2d2a: 92 81 ldd r25, Z+2 ; 0x02 - 2d2c: 89 81 ldd r24, Y+1 ; 0x01 - 2d2e: 98 13 cpse r25, r24 - 2d30: b1 c0 rjmp .+354 ; 0x2e94 - 2d32: 93 81 ldd r25, Z+3 ; 0x03 - 2d34: 8a 81 ldd r24, Y+2 ; 0x02 - 2d36: 98 13 cpse r25, r24 - 2d38: ad c0 rjmp .+346 ; 0x2e94 - (DataPtr[3] == UidCL[1]) && - 2d3a: 94 81 ldd r25, Z+4 ; 0x04 - 2d3c: 8b 81 ldd r24, Y+3 ; 0x03 - 2d3e: 98 13 cpse r25, r24 - 2d40: a9 c0 rjmp .+338 ; 0x2e94 - (DataPtr[4] == UidCL[2]) && - 2d42: 95 81 ldd r25, Z+5 ; 0x05 - 2d44: 8c 81 ldd r24, Y+4 ; 0x04 - 2d46: 98 13 cpse r25, r24 - 2d48: a5 c0 rjmp .+330 ; 0x2e94 - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 2d4a: 84 e0 ldi r24, 0x04 ; 4 - 2d4c: 80 83 st Z, r24 - ISO14443AAppendCRCA(Buffer, 1); - 2d4e: 61 e0 ldi r22, 0x01 ; 1 - 2d50: 70 e0 ldi r23, 0x00 ; 0 - 2d52: c8 01 movw r24, r16 - 2d54: 0e 94 56 1f call 0x3eac ; 0x3eac - - if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) { - /* CL1 stage has ended successfully */ - State = STATE_READY2; - 2d58: 83 e0 ldi r24, 0x03 ; 3 - 2d5a: 29 c0 rjmp .+82 ; 0x2dae - - case STATE_READY2: - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - State = FromHalt ? STATE_HALT : STATE_IDLE; - return ISO14443A_APP_NO_RESPONSE; - } else if (Cmd == ISO14443A_CMD_SELECT_CL2) { - 2d5c: 85 39 cpi r24, 0x95 ; 149 - 2d5e: 31 f6 brne .-116 ; 0x2cec - /* Load UID CL2 and perform anticollision */ - uint8_t UidCL2[ISO14443A_CL_UID_SIZE]; - - MemoryReadBlock(UidCL2, UID_CL2_ADDRESS, UID_CL2_SIZE); - 2d60: 44 e0 ldi r20, 0x04 ; 4 - 2d62: 50 e0 ldi r21, 0x00 ; 0 - 2d64: 64 e0 ldi r22, 0x04 ; 4 - 2d66: 70 e0 ldi r23, 0x00 ; 0 - 2d68: ce 01 movw r24, r28 - 2d6a: 01 96 adiw r24, 0x01 ; 1 - 2d6c: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - -INLINE -bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - uint8_t NVB = DataPtr[1]; - 2d70: f8 01 movw r30, r16 - 2d72: 81 81 ldd r24, Z+1 ; 0x01 - //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; - //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; - - switch (NVB) { - 2d74: 80 32 cpi r24, 0x20 ; 32 - 2d76: 09 f4 brne .+2 ; 0x2d7a - 2d78: 7e c0 rjmp .+252 ; 0x2e76 - 2d7a: 80 37 cpi r24, 0x70 ; 112 - 2d7c: e1 f4 brne .+56 ; 0x2db6 - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 2d7e: f8 01 movw r30, r16 - 2d80: 92 81 ldd r25, Z+2 ; 0x02 - 2d82: 89 81 ldd r24, Y+1 ; 0x01 - 2d84: 98 13 cpse r25, r24 - 2d86: 86 c0 rjmp .+268 ; 0x2e94 - 2d88: 93 81 ldd r25, Z+3 ; 0x03 - 2d8a: 8a 81 ldd r24, Y+2 ; 0x02 - 2d8c: 98 13 cpse r25, r24 - 2d8e: 82 c0 rjmp .+260 ; 0x2e94 - (DataPtr[3] == UidCL[1]) && - 2d90: 94 81 ldd r25, Z+4 ; 0x04 - 2d92: 8b 81 ldd r24, Y+3 ; 0x03 - 2d94: 98 13 cpse r25, r24 - 2d96: 7e c0 rjmp .+252 ; 0x2e94 - (DataPtr[4] == UidCL[2]) && - 2d98: 95 81 ldd r25, Z+5 ; 0x05 - 2d9a: 8c 81 ldd r24, Y+4 ; 0x04 - 2d9c: 98 13 cpse r25, r24 - 2d9e: 7a c0 rjmp .+244 ; 0x2e94 - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 2da0: 10 82 st Z, r1 - ISO14443AAppendCRCA(Buffer, 1); - 2da2: 61 e0 ldi r22, 0x01 ; 1 - 2da4: 70 e0 ldi r23, 0x00 ; 0 - 2da6: c8 01 movw r24, r16 - 2da8: 0e 94 56 1f call 0x3eac ; 0x3eac - - if (ISO14443ASelect(Buffer, &BitCount, UidCL2, SAK_CL2_VALUE)) { - /* CL2 stage has ended successfully. This means - * our complete UID has been sent to the reader. */ - State = STATE_ACTIVE; - 2dac: 84 e0 ldi r24, 0x04 ; 4 - 2dae: 80 93 03 21 sts 0x2103, r24 ; 0x802103 - 2db2: 38 e1 ldi r19, 0x18 ; 24 - 2db4: 70 c0 rjmp .+224 ; 0x2e96 - *BitCount = 0; - return false; - } - default: - { - uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2; - 2db6: e8 2e mov r14, r24 - 2db8: e2 94 swap r14 - 2dba: bf e0 ldi r27, 0x0F ; 15 - 2dbc: eb 22 and r14, r27 - 2dbe: 2e ef ldi r18, 0xFE ; 254 - 2dc0: 2e 0d add r18, r14 - uint8_t CollisionBitCount = (NVB >> 0) & 0x0f; - 2dc2: 8f 70 andi r24, 0x0F ; 15 - 2dc4: f8 2e mov r15, r24 - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - 2dc6: 88 e0 ldi r24, 0x08 ; 8 - 2dc8: 90 e0 ldi r25, 0x00 ; 0 - 2dca: 8f 19 sub r24, r15 - 2dcc: 91 09 sbc r25, r1 - 2dce: 4f ef ldi r20, 0xFF ; 255 - 2dd0: 50 e0 ldi r21, 0x00 ; 0 - 2dd2: 6a 01 movw r12, r20 - 2dd4: 02 c0 rjmp .+4 ; 0x2dda - 2dd6: d5 94 asr r13 - 2dd8: c7 94 ror r12 - 2dda: 8a 95 dec r24 - 2ddc: e2 f7 brpl .-8 ; 0x2dd6 - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - 2dde: 25 30 cpi r18, 0x05 ; 5 - 2de0: 21 f0 breq .+8 ; 0x2dea - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - 2de2: 24 30 cpi r18, 0x04 ; 4 - 2de4: 59 f5 brne .+86 ; 0x2e3c - 2de6: ff 20 and r15, r15 - 2de8: e9 f0 breq .+58 ; 0x2e24 - 2dea: 44 e0 ldi r20, 0x04 ; 4 - 2dec: 50 e0 ldi r21, 0x00 ; 0 - 2dee: b8 01 movw r22, r16 - 2df0: 6e 5f subi r22, 0xFE ; 254 - 2df2: 7f 4f sbci r23, 0xFF ; 255 - 2df4: ce 01 movw r24, r28 - 2df6: 01 96 adiw r24, 0x01 ; 1 - 2df8: 2d 83 std Y+5, r18 ; 0x05 - 2dfa: 0e 94 77 2a call 0x54ee ; 0x54ee - 2dfe: 2d 81 ldd r18, Y+5 ; 0x05 - 2e00: 89 2b or r24, r25 - 2e02: 61 f4 brne .+24 ; 0x2e1c - 2e04: 9a 81 ldd r25, Y+2 ; 0x02 - 2e06: 89 81 ldd r24, Y+1 ; 0x01 - 2e08: 89 27 eor r24, r25 - 2e0a: 9b 81 ldd r25, Y+3 ; 0x03 - 2e0c: 89 27 eor r24, r25 - 2e0e: 9c 81 ldd r25, Y+4 ; 0x04 - 2e10: 89 27 eor r24, r25 - 2e12: f8 01 movw r30, r16 - 2e14: 96 81 ldd r25, Z+6 ; 0x06 - 2e16: 89 27 eor r24, r25 - 2e18: 8c 21 and r24, r12 - 2e1a: 69 f1 breq .+90 ; 0x2e76 - || - 2e1c: 24 30 cpi r18, 0x04 ; 4 - 2e1e: 71 f4 brne .+28 ; 0x2e3c - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - 2e20: f1 10 cpse r15, r1 - 2e22: 38 c0 rjmp .+112 ; 0x2e94 - 2e24: 44 e0 ldi r20, 0x04 ; 4 - 2e26: 50 e0 ldi r21, 0x00 ; 0 - 2e28: b8 01 movw r22, r16 - 2e2a: 6e 5f subi r22, 0xFE ; 254 - 2e2c: 7f 4f sbci r23, 0xFF ; 255 - 2e2e: ce 01 movw r24, r28 - 2e30: 01 96 adiw r24, 0x01 ; 1 - 2e32: 0e 94 77 2a call 0x54ee ; 0x54ee - 2e36: 89 2b or r24, r25 - 2e38: f1 f0 breq .+60 ; 0x2e76 - 2e3a: 2c c0 rjmp .+88 ; 0x2e94 - || - 2e3c: 24 30 cpi r18, 0x04 ; 4 - 2e3e: 50 f5 brcc .+84 ; 0x2e94 - (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask)) - 2e40: e2 2e mov r14, r18 - 2e42: f1 2c mov r15, r1 - 2e44: a7 01 movw r20, r14 - 2e46: b8 01 movw r22, r16 - 2e48: 6e 5f subi r22, 0xFE ; 254 - 2e4a: 7f 4f sbci r23, 0xFF ; 255 - 2e4c: ce 01 movw r24, r28 - 2e4e: 01 96 adiw r24, 0x01 ; 1 - 2e50: 0e 94 77 2a call 0x54ee ; 0x54ee - 2e54: 89 2b or r24, r25 - 2e56: f1 f4 brne .+60 ; 0x2e94 - 2e58: d8 01 movw r26, r16 - 2e5a: ae 0d add r26, r14 - 2e5c: bf 1d adc r27, r15 - 2e5e: e1 e0 ldi r30, 0x01 ; 1 - 2e60: f0 e0 ldi r31, 0x00 ; 0 - 2e62: ec 0f add r30, r28 - 2e64: fd 1f adc r31, r29 - 2e66: ee 0d add r30, r14 - 2e68: ff 1d adc r31, r15 - 2e6a: 12 96 adiw r26, 0x02 ; 2 - 2e6c: 9c 91 ld r25, X - 2e6e: 80 81 ld r24, Z - 2e70: 89 27 eor r24, r25 - 2e72: c8 22 and r12, r24 - 2e74: 79 f4 brne .+30 ; 0x2e94 - ) - { - DataPtr[0] = UidCL[0]; - 2e76: 29 81 ldd r18, Y+1 ; 0x01 - 2e78: f8 01 movw r30, r16 - 2e7a: 20 83 st Z, r18 - DataPtr[1] = UidCL[1]; - 2e7c: 3a 81 ldd r19, Y+2 ; 0x02 - 2e7e: 31 83 std Z+1, r19 ; 0x01 - DataPtr[2] = UidCL[2]; - 2e80: 9b 81 ldd r25, Y+3 ; 0x03 - 2e82: 92 83 std Z+2, r25 ; 0x02 - DataPtr[3] = UidCL[3]; - 2e84: 8c 81 ldd r24, Y+4 ; 0x04 - 2e86: 83 83 std Z+3, r24 ; 0x03 - DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 2e88: 23 27 eor r18, r19 - 2e8a: 92 27 eor r25, r18 - 2e8c: 89 27 eor r24, r25 - 2e8e: 84 83 std Z+4, r24 ; 0x04 - - *BitCount = ISO14443A_CL_FRAME_SIZE; - 2e90: 38 e2 ldi r19, 0x28 ; 40 - 2e92: 01 c0 rjmp .+2 ; 0x2e96 - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - || - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - 2e94: 30 e0 ldi r19, 0x00 ; 0 - 2e96: 20 e0 ldi r18, 0x00 ; 0 - 2e98: 83 2f mov r24, r19 - 2e9a: 92 2f mov r25, r18 - 2e9c: d3 c1 rjmp .+934 ; 0x3244 <__stack+0x245> - } - break; - - case STATE_ACTIVE: - /* Preserve incoming data length */ - ByteCount = (BitCount + 7) >> 3; - 2e9e: 69 5f subi r22, 0xF9 ; 249 - 2ea0: 7f 4f sbci r23, 0xFF ; 255 - 2ea2: 83 e0 ldi r24, 0x03 ; 3 - 2ea4: 76 95 lsr r23 - 2ea6: 67 95 ror r22 - 2ea8: 8a 95 dec r24 - 2eaa: e1 f7 brne .-8 ; 0x2ea4 - if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE, FromHalt)) { - State = FromHalt ? STATE_HALT : STATE_IDLE; - return ISO14443A_APP_NO_RESPONSE; - } - /* At the very least, there should be 3 bytes in the buffer. */ - if (ByteCount < (1 + ISO14443A_CRCA_SIZE)) { - 2eac: 63 30 cpi r22, 0x03 ; 3 - 2eae: 71 05 cpc r23, r1 - 2eb0: 08 f4 brcc .+2 ; 0x2eb4 - 2eb2: 1c cf rjmp .-456 ; 0x2cec - State = STATE_IDLE; - return ISO14443A_APP_NO_RESPONSE; - } - /* All commands here have CRCA appended; verify it right away */ - ByteCount -= 2; - 2eb4: 62 50 subi r22, 0x02 ; 2 - 2eb6: 71 09 sbc r23, r1 - if (!ISO14443ACheckCRCA(Buffer, ByteCount)) { - 2eb8: c8 01 movw r24, r16 - 2eba: 0e 94 81 1f call 0x3f02 ; 0x3f02 - 2ebe: 81 11 cpse r24, r1 - 2ec0: 03 cf rjmp .-506 ; 0x2cc8 - Buffer[0] = NAK_CRC_ERROR; - 2ec2: 81 e0 ldi r24, 0x01 ; 1 - 2ec4: 99 c1 rjmp .+818 ; 0x31f8 <__stack+0x1f9> -{ - uint8_t Cmd = Buffer[0]; - - /* Handle the compatibility write command */ - if (ArmedForCompatWrite) { - ArmedForCompatWrite = false; - 2ec6: 10 92 00 21 sts 0x2100, r1 ; 0x802100 - AppWritePage(CompatWritePageAddress, &Buffer[2]); - 2eca: 60 91 ff 20 lds r22, 0x20FF ; 0x8020ff -} - -/* Perform access verification and commit data if passed */ -static uint8_t AppWritePage(uint8_t PageAddress, uint8_t* const Buffer) -{ - if (!ActiveConfiguration.ReadOnly) { - 2ece: 80 91 51 21 lds r24, 0x2151 ; 0x802151 - 2ed2: 81 11 cpse r24, r1 - 2ed4: 90 c1 rjmp .+800 ; 0x31f6 <__stack+0x1f7> - MemoryWriteBlock(Buffer, PageAddress * MIFARE_ULTRALIGHT_PAGE_SIZE, MIFARE_ULTRALIGHT_PAGE_SIZE); - 2ed6: f4 e0 ldi r31, 0x04 ; 4 - 2ed8: 6f 9f mul r22, r31 - 2eda: b0 01 movw r22, r0 - 2edc: 11 24 eor r1, r1 - 2ede: 44 e0 ldi r20, 0x04 ; 4 - 2ee0: 50 e0 ldi r21, 0x00 ; 0 - 2ee2: c8 01 movw r24, r16 - 2ee4: 02 96 adiw r24, 0x02 ; 2 - 2ee6: 85 c1 rjmp .+778 ; 0x31f2 <__stack+0x1f3> - Buffer[0] = ACK_VALUE; - return ACK_FRAME_SIZE; - } - - /* Handle EV0 commands */ - switch (Cmd) { - 2ee8: 80 3a cpi r24, 0xA0 ; 160 - 2eea: 09 f4 brne .+2 ; 0x2eee - 2eec: 54 c0 rjmp .+168 ; 0x2f96 - 2eee: 82 3a cpi r24, 0xA2 ; 162 - 2ef0: b9 f1 breq .+110 ; 0x2f60 - 2ef2: f8 ce rjmp .-528 ; 0x2ce4 - - case CMD_READ: { - uint8_t PageAddress = Buffer[1]; - 2ef4: f8 01 movw r30, r16 - 2ef6: f1 80 ldd r15, Z+1 ; 0x01 - uint8_t PageLimit; - uint8_t Offset; - /* For EV1+ cards, ensure the wraparound is at the first protected page */ - if (Flavor >= UL_EV1 && ReadAccessProtected && !Authenticated) { - 2ef8: 80 91 04 21 lds r24, 0x2104 ; 0x802104 - 2efc: 88 23 and r24, r24 - 2efe: 59 f0 breq .+22 ; 0x2f16 - 2f00: 80 91 fc 20 lds r24, 0x20FC ; 0x8020fc - 2f04: 88 23 and r24, r24 - 2f06: 39 f0 breq .+14 ; 0x2f16 - 2f08: 80 91 fe 20 lds r24, 0x20FE ; 0x8020fe - 2f0c: 81 11 cpse r24, r1 - 2f0e: 03 c0 rjmp .+6 ; 0x2f16 - PageLimit = FirstAuthenticatedPage; - 2f10: e0 90 fd 20 lds r14, 0x20FD ; 0x8020fd - 2f14: 02 c0 rjmp .+4 ; 0x2f1a - } else { - PageLimit = PageCount; - 2f16: e0 90 01 21 lds r14, 0x2101 ; 0x802101 - } - /* Validation */ - if (PageAddress >= PageLimit) { - 2f1a: fe 14 cp r15, r14 - 2f1c: 10 f0 brcs .+4 ; 0x2f22 - Buffer[0] = NAK_INVALID_ARG; - 2f1e: f8 01 movw r30, r16 - 2f20: 36 c1 rjmp .+620 ; 0x318e <__stack+0x18f> - PageLimit = FirstAuthenticatedPage; - } else { - PageLimit = PageCount; - } - /* Validation */ - if (PageAddress >= PageLimit) { - 2f22: c1 2c mov r12, r1 - 2f24: d1 2c mov r13, r1 - Buffer[0] = NAK_INVALID_ARG; - return NAK_FRAME_SIZE; - } - /* Read out, emulating the wraparound */ - for (Offset = 0; Offset < BYTES_PER_READ; Offset += 4) { - MemoryReadBlock(&Buffer[Offset], PageAddress * MIFARE_ULTRALIGHT_PAGE_SIZE, MIFARE_ULTRALIGHT_PAGE_SIZE); - 2f26: f4 e0 ldi r31, 0x04 ; 4 - 2f28: ff 9e mul r15, r31 - 2f2a: b0 01 movw r22, r0 - 2f2c: 11 24 eor r1, r1 - 2f2e: 44 e0 ldi r20, 0x04 ; 4 - 2f30: 50 e0 ldi r21, 0x00 ; 0 - 2f32: c8 01 movw r24, r16 - 2f34: 8c 0d add r24, r12 - 2f36: 9d 1d adc r25, r13 - 2f38: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - PageAddress++; - 2f3c: f3 94 inc r15 - if (PageAddress == PageLimit) { - 2f3e: fe 10 cpse r15, r14 - 2f40: 01 c0 rjmp .+2 ; 0x2f44 - PageAddress = 0; - 2f42: f1 2c mov r15, r1 - 2f44: 24 e0 ldi r18, 0x04 ; 4 - 2f46: c2 0e add r12, r18 - 2f48: d1 1c adc r13, r1 - if (PageAddress >= PageLimit) { - Buffer[0] = NAK_INVALID_ARG; - return NAK_FRAME_SIZE; - } - /* Read out, emulating the wraparound */ - for (Offset = 0; Offset < BYTES_PER_READ; Offset += 4) { - 2f4a: 80 e1 ldi r24, 0x10 ; 16 - 2f4c: c8 16 cp r12, r24 - 2f4e: d1 04 cpc r13, r1 - 2f50: 51 f7 brne .-44 ; 0x2f26 - PageAddress++; - if (PageAddress == PageLimit) { - PageAddress = 0; - } - } - ISO14443AAppendCRCA(Buffer, BYTES_PER_READ); - 2f52: 60 e1 ldi r22, 0x10 ; 16 - 2f54: 70 e0 ldi r23, 0x00 ; 0 - 2f56: c8 01 movw r24, r16 - 2f58: a9 d7 rcall .+3922 ; 0x3eac - return (BYTES_PER_READ + ISO14443A_CRCA_SIZE) * 8; - 2f5a: 80 e9 ldi r24, 0x90 ; 144 - 2f5c: 90 e0 ldi r25, 0x00 ; 0 - 2f5e: 72 c1 rjmp .+740 ; 0x3244 <__stack+0x245> - } - - case CMD_WRITE: { - /* This is a write command containing 4 bytes of data that - * should be written to the given page address. */ - uint8_t PageAddress = Buffer[1]; - 2f60: f8 01 movw r30, r16 - 2f62: f1 80 ldd r15, Z+1 ; 0x01 - /* Validation */ - if ((PageAddress < PAGE_WRITE_MIN) || (PageAddress >= PageCount)) { - 2f64: f1 e0 ldi r31, 0x01 ; 1 - 2f66: ff 15 cp r31, r15 - 2f68: d0 f6 brcc .-76 ; 0x2f1e - 2f6a: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 2f6e: f8 16 cp r15, r24 - 2f70: b0 f6 brcc .-84 ; 0x2f1e - Buffer[0] = NAK_INVALID_ARG; - return NAK_FRAME_SIZE; - } - if (!VerifyAuthentication(PageAddress)) { - 2f72: 8f 2d mov r24, r15 - 2f74: e5 dd rcall .-1078 ; 0x2b40 - 2f76: 88 23 and r24, r24 - 2f78: 09 f4 brne .+2 ; 0x2f7c - 2f7a: ca c0 rjmp .+404 ; 0x3110 <__stack+0x111> - Buffer[0] = NAK_AUTH_REQUIRED; - return NAK_FRAME_SIZE; - } - AppWritePage(PageAddress, &Buffer[2]); - 2f7c: c8 01 movw r24, r16 - 2f7e: 02 96 adiw r24, 0x02 ; 2 -} - -/* Perform access verification and commit data if passed */ -static uint8_t AppWritePage(uint8_t PageAddress, uint8_t* const Buffer) -{ - if (!ActiveConfiguration.ReadOnly) { - 2f80: 20 91 51 21 lds r18, 0x2151 ; 0x802151 - 2f84: 21 11 cpse r18, r1 - 2f86: 37 c1 rjmp .+622 ; 0x31f6 <__stack+0x1f7> - MemoryWriteBlock(Buffer, PageAddress * MIFARE_ULTRALIGHT_PAGE_SIZE, MIFARE_ULTRALIGHT_PAGE_SIZE); - 2f88: f4 e0 ldi r31, 0x04 ; 4 - 2f8a: ff 9e mul r15, r31 - 2f8c: b0 01 movw r22, r0 - 2f8e: 11 24 eor r1, r1 - 2f90: 44 e0 ldi r20, 0x04 ; 4 - 2f92: 50 e0 ldi r21, 0x00 ; 0 - 2f94: 2e c1 rjmp .+604 ; 0x31f2 <__stack+0x1f3> - Buffer[0] = ACK_VALUE; - return ACK_FRAME_SIZE; - } - - case CMD_COMPAT_WRITE: { - uint8_t PageAddress = Buffer[1]; - 2f96: f8 01 movw r30, r16 - 2f98: f1 80 ldd r15, Z+1 ; 0x01 - /* Validation */ - if ((PageAddress < PAGE_WRITE_MIN) || (PageAddress >= PageCount)) { - 2f9a: f1 e0 ldi r31, 0x01 ; 1 - 2f9c: ff 15 cp r31, r15 - 2f9e: 08 f0 brcs .+2 ; 0x2fa2 - 2fa0: be cf rjmp .-132 ; 0x2f1e - 2fa2: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 2fa6: f8 16 cp r15, r24 - 2fa8: 08 f0 brcs .+2 ; 0x2fac - 2faa: b9 cf rjmp .-142 ; 0x2f1e - Buffer[0] = NAK_INVALID_ARG; - return NAK_FRAME_SIZE; - } - if (!VerifyAuthentication(PageAddress)) { - 2fac: 8f 2d mov r24, r15 - 2fae: c8 dd rcall .-1136 ; 0x2b40 - 2fb0: 88 23 and r24, r24 - 2fb2: 09 f4 brne .+2 ; 0x2fb6 - 2fb4: ad c0 rjmp .+346 ; 0x3110 <__stack+0x111> - Buffer[0] = NAK_AUTH_REQUIRED; - return NAK_FRAME_SIZE; - } - /* CRC check passed and page-address is within bounds. - * Store address and proceed to receiving the data. */ - CompatWritePageAddress = PageAddress; - 2fb6: f0 92 ff 20 sts 0x20FF, r15 ; 0x8020ff - ArmedForCompatWrite = true; - 2fba: 81 e0 ldi r24, 0x01 ; 1 - 2fbc: 80 93 00 21 sts 0x2100, r24 ; 0x802100 - 2fc0: 1a c1 rjmp .+564 ; 0x31f6 <__stack+0x1f7> - } - - case CMD_HALT: { - /* Halts the tag. According to the ISO14443, the second - * byte is supposed to be 0. */ - if (Buffer[1] == 0) { - 2fc2: f8 01 movw r30, r16 - 2fc4: 81 81 ldd r24, Z+1 ; 0x01 - 2fc6: 81 11 cpse r24, r1 - 2fc8: aa cf rjmp .-172 ; 0x2f1e - /* According to ISO14443, we must not send anything - * in order to acknowledge the HALT command. */ - State = STATE_HALT; - 2fca: 10 92 03 21 sts 0x2103, r1 ; 0x802103 - 2fce: 91 ce rjmp .-734 ; 0x2cf2 - default: - break; - } - /* Handle EV1 commands */ - if (Flavor >= UL_EV1) { - switch (Cmd) { - 2fd0: 8c 33 cpi r24, 0x3C ; 60 - 2fd2: 09 f4 brne .+2 ; 0x2fd6 - 2fd4: 16 c1 rjmp .+556 ; 0x3202 <__stack+0x203> - 2fd6: 48 f4 brcc .+18 ; 0x2fea - 2fd8: 89 33 cpi r24, 0x39 ; 57 - 2fda: 09 f4 brne .+2 ; 0x2fde - 2fdc: ad c0 rjmp .+346 ; 0x3138 <__stack+0x139> - 2fde: 8a 33 cpi r24, 0x3A ; 58 - 2fe0: 89 f1 breq .+98 ; 0x3044 <__stack+0x45> - 2fe2: 8b 31 cpi r24, 0x1B ; 27 - 2fe4: 09 f0 breq .+2 ; 0x2fe8 - 2fe6: 82 ce rjmp .-764 ; 0x2cec - 2fe8: 68 c0 rjmp .+208 ; 0x30ba <__stack+0xbb> - 2fea: 8b 34 cpi r24, 0x4B ; 75 - 2fec: 09 f4 brne .+2 ; 0x2ff0 - 2fee: 17 c1 rjmp .+558 ; 0x321e <__stack+0x21f> - 2ff0: 38 f4 brcc .+14 ; 0x3000 <__stack+0x1> - 2ff2: 8e 33 cpi r24, 0x3E ; 62 - 2ff4: 09 f0 breq .+2 ; 0x2ff8 - 2ff6: 7a ce rjmp .-780 ; 0x2cec - ISO14443AAppendCRCA(Buffer, SIGNATURE_LENGTH); - return (SIGNATURE_LENGTH + ISO14443A_CRCA_SIZE) * 8; - - case CMD_CHECK_TEARING_EVENT: - /* Hardcoded response */ - Buffer[0] = 0xBD; - 2ff8: 8d eb ldi r24, 0xBD ; 189 - 2ffa: f8 01 movw r30, r16 - 2ffc: 80 83 st Z, r24 - 2ffe: 1c c1 rjmp .+568 ; 0x3238 <__stack+0x239> - default: - break; - } - /* Handle EV1 commands */ - if (Flavor >= UL_EV1) { - switch (Cmd) { - 3000: 80 36 cpi r24, 0x60 ; 96 - 3002: 21 f0 breq .+8 ; 0x300c <__stack+0xd> - 3004: 85 3a cpi r24, 0xA5 ; 165 - 3006: 09 f4 brne .+2 ; 0x300a <__stack+0xb> - 3008: b1 c0 rjmp .+354 ; 0x316c <__stack+0x16d> - 300a: 70 ce rjmp .-800 ; 0x2cec - - case CMD_GET_VERSION: { - /* Provide hardcoded version response */ - Buffer[0] = 0x00; - 300c: f8 01 movw r30, r16 - 300e: 10 82 st Z, r1 - Buffer[1] = 0x04; - 3010: 84 e0 ldi r24, 0x04 ; 4 - 3012: 81 83 std Z+1, r24 ; 0x01 - Buffer[2] = 0x03; - 3014: 83 e0 ldi r24, 0x03 ; 3 - 3016: 82 83 std Z+2, r24 ; 0x02 - Buffer[3] = 0x01; /**/ - 3018: 81 e0 ldi r24, 0x01 ; 1 - 301a: 83 83 std Z+3, r24 ; 0x03 - Buffer[4] = 0x01; - 301c: 84 83 std Z+4, r24 ; 0x04 - Buffer[5] = 0x00; - 301e: 15 82 std Z+5, r1 ; 0x05 - Buffer[6] = PageCount == MIFARE_ULTRALIGHT_EV11_PAGES ? 0x0B : 0x0E; - 3020: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 3024: 84 31 cpi r24, 0x14 ; 20 - 3026: 11 f0 breq .+4 ; 0x302c <__stack+0x2d> - 3028: 8e e0 ldi r24, 0x0E ; 14 - 302a: 01 c0 rjmp .+2 ; 0x302e <__stack+0x2f> - 302c: 8b e0 ldi r24, 0x0B ; 11 - 302e: f8 01 movw r30, r16 - 3030: 86 83 std Z+6, r24 ; 0x06 - Buffer[7] = 0x03; - 3032: 83 e0 ldi r24, 0x03 ; 3 - 3034: 87 83 std Z+7, r24 ; 0x07 - ISO14443AAppendCRCA(Buffer, VERSION_INFO_LENGTH); - 3036: 68 e0 ldi r22, 0x08 ; 8 - 3038: 70 e0 ldi r23, 0x00 ; 0 - 303a: c8 01 movw r24, r16 - 303c: 37 d7 rcall .+3694 ; 0x3eac - return (VERSION_INFO_LENGTH + ISO14443A_CRCA_SIZE) * 8; - 303e: 80 e5 ldi r24, 0x50 ; 80 - 3040: 90 e0 ldi r25, 0x00 ; 0 - 3042: 00 c1 rjmp .+512 ; 0x3244 <__stack+0x245> - } - - case CMD_FAST_READ: { - uint8_t StartPageAddress = Buffer[1]; - 3044: f8 01 movw r30, r16 - 3046: d1 80 ldd r13, Z+1 ; 0x01 - uint8_t EndPageAddress = Buffer[2]; - 3048: e2 80 ldd r14, Z+2 ; 0x02 - /* Validation */ - if ((StartPageAddress > EndPageAddress) || (StartPageAddress >= PageCount) || (EndPageAddress >= PageCount)) { - 304a: ed 14 cp r14, r13 - 304c: 08 f4 brcc .+2 ; 0x3050 <__stack+0x51> - 304e: 67 cf rjmp .-306 ; 0x2f1e - 3050: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 3054: d8 16 cp r13, r24 - 3056: 08 f0 brcs .+2 ; 0x305a <__stack+0x5b> - 3058: 62 cf rjmp .-316 ; 0x2f1e - 305a: e8 16 cp r14, r24 - 305c: 08 f0 brcs .+2 ; 0x3060 <__stack+0x61> - 305e: 5f cf rjmp .-322 ; 0x2f1e - Buffer[0] = NAK_INVALID_ARG; - return NAK_FRAME_SIZE; - } - /* Check authentication only if protection is read&write */ - if (ReadAccessProtected) { - 3060: 80 91 fc 20 lds r24, 0x20FC ; 0x8020fc - 3064: 88 23 and r24, r24 - 3066: 51 f0 breq .+20 ; 0x307c <__stack+0x7d> - if (!VerifyAuthentication(StartPageAddress) || !VerifyAuthentication(EndPageAddress)) { - 3068: 8d 2d mov r24, r13 - 306a: 6a dd rcall .-1324 ; 0x2b40 - 306c: 88 23 and r24, r24 - 306e: 09 f4 brne .+2 ; 0x3072 <__stack+0x73> - 3070: 4f c0 rjmp .+158 ; 0x3110 <__stack+0x111> - 3072: 8e 2d mov r24, r14 - 3074: 65 dd rcall .-1334 ; 0x2b40 - 3076: 88 23 and r24, r24 - 3078: 09 f4 brne .+2 ; 0x307c <__stack+0x7d> - 307a: 4a c0 rjmp .+148 ; 0x3110 <__stack+0x111> - Buffer[0] = NAK_AUTH_REQUIRED; - return NAK_FRAME_SIZE; - } - } - /* NOTE: With the current implementation, reading the password out is possible. */ - ByteCount = (EndPageAddress - StartPageAddress + 1) * MIFARE_ULTRALIGHT_PAGE_SIZE; - 307c: f1 2c mov r15, r1 - 307e: 6d 2d mov r22, r13 - 3080: 70 e0 ldi r23, 0x00 ; 0 - 3082: e6 1a sub r14, r22 - 3084: f7 0a sbc r15, r23 - 3086: ff ef ldi r31, 0xFF ; 255 - 3088: ef 1a sub r14, r31 - 308a: ff 0a sbc r15, r31 - 308c: ee 0c add r14, r14 - 308e: ff 1c adc r15, r15 - 3090: ee 0c add r14, r14 - 3092: ff 1c adc r15, r15 - MemoryReadBlock(Buffer, StartPageAddress * MIFARE_ULTRALIGHT_PAGE_SIZE, ByteCount); - 3094: 66 0f add r22, r22 - 3096: 77 1f adc r23, r23 - 3098: 66 0f add r22, r22 - 309a: 77 1f adc r23, r23 - 309c: a7 01 movw r20, r14 - 309e: c8 01 movw r24, r16 - 30a0: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - ISO14443AAppendCRCA(Buffer, ByteCount); - 30a4: b7 01 movw r22, r14 - 30a6: c8 01 movw r24, r16 - 30a8: 01 d7 rcall .+3586 ; 0x3eac - return (ByteCount + ISO14443A_CRCA_SIZE) * 8; - 30aa: c7 01 movw r24, r14 - 30ac: 02 96 adiw r24, 0x02 ; 2 - 30ae: a3 e0 ldi r26, 0x03 ; 3 - 30b0: 88 0f add r24, r24 - 30b2: 99 1f adc r25, r25 - 30b4: aa 95 dec r26 - 30b6: e1 f7 brne .-8 ; 0x30b0 <__stack+0xb1> - 30b8: c5 c0 rjmp .+394 ; 0x3244 <__stack+0x245> - } - - case CMD_PWD_AUTH: { - uint8_t ConfigAreaAddress = PageCount * MIFARE_ULTRALIGHT_PAGE_SIZE - CONFIG_AREA_SIZE; - 30ba: e0 90 01 21 lds r14, 0x2101 ; 0x802101 - 30be: 8e 2d mov r24, r14 - 30c0: 88 0f add r24, r24 - 30c2: 88 0f add r24, r24 - 30c4: 50 ef ldi r21, 0xF0 ; 240 - 30c6: e5 2e mov r14, r21 - 30c8: e8 0e add r14, r24 - uint8_t Password[4]; - - /* Save password */ - MemoryWriteBlock(Buffer+1, MIFARE_ULTRALIGHT_PWD_ADDRESS, 4); - 30ca: 44 e0 ldi r20, 0x04 ; 4 - 30cc: 50 e0 ldi r21, 0x00 ; 0 - 30ce: 68 e0 ldi r22, 0x08 ; 8 - 30d0: 71 e0 ldi r23, 0x01 ; 1 - 30d2: c8 01 movw r24, r16 - 30d4: 01 96 adiw r24, 0x01 ; 1 - 30d6: 0e 94 07 09 call 0x120e ; 0x120e - /* Too many failed attempts */ - Buffer[0] = NAK_AUTH_FAILED; - return NAK_FRAME_SIZE; - } - /* Read and compare the password */ - MemoryReadBlock(Password, ConfigAreaAddress + CONF_PASSWORD_OFFSET, 4); - 30da: f1 2c mov r15, r1 - 30dc: b7 01 movw r22, r14 - 30de: 68 5f subi r22, 0xF8 ; 248 - 30e0: 7f 4f sbci r23, 0xFF ; 255 - 30e2: 44 e0 ldi r20, 0x04 ; 4 - 30e4: 50 e0 ldi r21, 0x00 ; 0 - 30e6: ce 01 movw r24, r28 - 30e8: 01 96 adiw r24, 0x01 ; 1 - 30ea: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - if (Password[0] != Buffer[1] || Password[1] != Buffer[2] || Password[2] != Buffer[3] || Password[3] != Buffer[4]) { - 30ee: 99 81 ldd r25, Y+1 ; 0x01 - 30f0: f8 01 movw r30, r16 - 30f2: 81 81 ldd r24, Z+1 ; 0x01 - 30f4: 98 13 cpse r25, r24 - 30f6: 0c c0 rjmp .+24 ; 0x3110 <__stack+0x111> - 30f8: 9a 81 ldd r25, Y+2 ; 0x02 - 30fa: 82 81 ldd r24, Z+2 ; 0x02 - 30fc: 98 13 cpse r25, r24 - 30fe: 08 c0 rjmp .+16 ; 0x3110 <__stack+0x111> - 3100: 9b 81 ldd r25, Y+3 ; 0x03 - 3102: 83 81 ldd r24, Z+3 ; 0x03 - 3104: 98 13 cpse r25, r24 - 3106: 04 c0 rjmp .+8 ; 0x3110 <__stack+0x111> - 3108: 9c 81 ldd r25, Y+4 ; 0x04 - 310a: 84 81 ldd r24, Z+4 ; 0x04 - 310c: 98 17 cp r25, r24 - 310e: 11 f0 breq .+4 ; 0x3114 <__stack+0x115> - Buffer[0] = NAK_AUTH_FAILED; - 3110: 86 e0 ldi r24, 0x06 ; 6 - 3112: 72 c0 rjmp .+228 ; 0x31f8 <__stack+0x1f9> - return NAK_FRAME_SIZE; - } - /* Authenticate the user */ - AuthCounterReset(); - Authenticated = 1; - 3114: 81 e0 ldi r24, 0x01 ; 1 - 3116: 80 93 fe 20 sts 0x20FE, r24 ; 0x8020fe - /* Send the PACK value back */ - MemoryReadBlock(Buffer, ConfigAreaAddress + CONF_PACK_OFFSET, 2); - 311a: b7 01 movw r22, r14 - 311c: 64 5f subi r22, 0xF4 ; 244 - 311e: 7f 4f sbci r23, 0xFF ; 255 - 3120: 42 e0 ldi r20, 0x02 ; 2 - 3122: 50 e0 ldi r21, 0x00 ; 0 - 3124: c8 01 movw r24, r16 - 3126: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - ISO14443AAppendCRCA(Buffer, 2); - 312a: 62 e0 ldi r22, 0x02 ; 2 - 312c: 70 e0 ldi r23, 0x00 ; 0 - 312e: c8 01 movw r24, r16 - 3130: bd d6 rcall .+3450 ; 0x3eac - return (2 + ISO14443A_CRCA_SIZE) * 8; - 3132: 80 e2 ldi r24, 0x20 ; 32 - 3134: 90 e0 ldi r25, 0x00 ; 0 - 3136: 86 c0 rjmp .+268 ; 0x3244 <__stack+0x245> - } - - case CMD_READ_CNT: { - uint8_t CounterId = Buffer[1]; - 3138: f8 01 movw r30, r16 - 313a: 61 81 ldd r22, Z+1 ; 0x01 - /* Validation */ - if (CounterId > CNT_MAX) { - 313c: 63 30 cpi r22, 0x03 ; 3 - 313e: 08 f0 brcs .+2 ; 0x3142 <__stack+0x143> - 3140: ee ce rjmp .-548 ; 0x2f1e - Buffer[0] = NAK_INVALID_ARG; - return NAK_FRAME_SIZE; - } - /* Returned counter length is 3 bytes */ - MemoryReadBlock(Buffer, (PageCount + CounterId) * MIFARE_ULTRALIGHT_PAGE_SIZE, 3); - 3142: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 3146: 70 e0 ldi r23, 0x00 ; 0 - 3148: 68 0f add r22, r24 - 314a: 71 1d adc r23, r1 - 314c: 66 0f add r22, r22 - 314e: 77 1f adc r23, r23 - 3150: 66 0f add r22, r22 - 3152: 77 1f adc r23, r23 - 3154: 43 e0 ldi r20, 0x03 ; 3 - 3156: 50 e0 ldi r21, 0x00 ; 0 - 3158: c8 01 movw r24, r16 - 315a: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - ISO14443AAppendCRCA(Buffer, 3); - 315e: 63 e0 ldi r22, 0x03 ; 3 - 3160: 70 e0 ldi r23, 0x00 ; 0 - 3162: c8 01 movw r24, r16 - 3164: a3 d6 rcall .+3398 ; 0x3eac - return (3 + ISO14443A_CRCA_SIZE) * 8; - 3166: 88 e2 ldi r24, 0x28 ; 40 - 3168: 90 e0 ldi r25, 0x00 ; 0 - 316a: 6c c0 rjmp .+216 ; 0x3244 <__stack+0x245> - } - - case CMD_INCREMENT_CNT: { - uint8_t CounterId = Buffer[1]; - 316c: f8 01 movw r30, r16 - 316e: 21 81 ldd r18, Z+1 ; 0x01 - uint32_t Addend = (Buffer[0]) | (Buffer[1] << 8) | ((uint32_t)Buffer[2] << 16); - 3170: e2 2e mov r14, r18 - 3172: f1 2c mov r15, r1 - 3174: 9e 2d mov r25, r14 - 3176: 88 27 eor r24, r24 - 3178: 85 6a ori r24, 0xA5 ; 165 - 317a: 09 2e mov r0, r25 - 317c: 00 0c add r0, r0 - 317e: aa 0b sbc r26, r26 - 3180: bb 0b sbc r27, r27 - 3182: 32 81 ldd r19, Z+2 ; 0x02 - 3184: 4c 01 movw r8, r24 - 3186: 5d 01 movw r10, r26 - 3188: a3 2a or r10, r19 - uint32_t Counter; - /* Validation */ - if (CounterId > CNT_MAX) { - 318a: 23 30 cpi r18, 0x03 ; 3 - 318c: 10 f0 brcs .+4 ; 0x3192 <__stack+0x193> - Buffer[0] = NAK_INVALID_ARG; - 318e: 10 82 st Z, r1 - 3190: 35 c0 rjmp .+106 ; 0x31fc <__stack+0x1fd> - return NAK_FRAME_SIZE; - } - /* Read the value out */ - MemoryReadBlock(&Counter, (PageCount + CounterId) * MIFARE_ULTRALIGHT_PAGE_SIZE, MIFARE_ULTRALIGHT_PAGE_SIZE); - 3192: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 3196: b7 01 movw r22, r14 - 3198: 68 0f add r22, r24 - 319a: 71 1d adc r23, r1 - 319c: 66 0f add r22, r22 - 319e: 77 1f adc r23, r23 - 31a0: 66 0f add r22, r22 - 31a2: 77 1f adc r23, r23 - 31a4: 44 e0 ldi r20, 0x04 ; 4 - 31a6: 50 e0 ldi r21, 0x00 ; 0 - 31a8: ce 01 movw r24, r28 - 31aa: 01 96 adiw r24, 0x01 ; 1 - 31ac: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - /* Add and check for overflow */ - Counter += Addend; - 31b0: 49 81 ldd r20, Y+1 ; 0x01 - 31b2: 5a 81 ldd r21, Y+2 ; 0x02 - 31b4: 6b 81 ldd r22, Y+3 ; 0x03 - 31b6: 7c 81 ldd r23, Y+4 ; 0x04 - 31b8: d5 01 movw r26, r10 - 31ba: c4 01 movw r24, r8 - 31bc: 84 0f add r24, r20 - 31be: 95 1f adc r25, r21 - 31c0: a6 1f adc r26, r22 - 31c2: b7 1f adc r27, r23 - 31c4: 89 83 std Y+1, r24 ; 0x01 - 31c6: 9a 83 std Y+2, r25 ; 0x02 - 31c8: ab 83 std Y+3, r26 ; 0x03 - 31ca: bc 83 std Y+4, r27 ; 0x04 - if (Counter > CNT_MAX_VALUE) { - 31cc: 00 97 sbiw r24, 0x00 ; 0 - 31ce: a1 05 cpc r26, r1 - 31d0: b1 40 sbci r27, 0x01 ; 1 - 31d2: 10 f0 brcs .+4 ; 0x31d8 <__stack+0x1d9> - Buffer[0] = NAK_CTR_ERROR; - 31d4: 84 e0 ldi r24, 0x04 ; 4 - 31d6: 10 c0 rjmp .+32 ; 0x31f8 <__stack+0x1f9> - return NAK_FRAME_SIZE; - } - /* Update memory */ - MemoryWriteBlock(&Counter, (PageCount + CounterId) * MIFARE_ULTRALIGHT_PAGE_SIZE, MIFARE_ULTRALIGHT_PAGE_SIZE); - 31d8: 80 91 01 21 lds r24, 0x2101 ; 0x802101 - 31dc: b7 01 movw r22, r14 - 31de: 68 0f add r22, r24 - 31e0: 71 1d adc r23, r1 - 31e2: 66 0f add r22, r22 - 31e4: 77 1f adc r23, r23 - 31e6: 66 0f add r22, r22 - 31e8: 77 1f adc r23, r23 - 31ea: 44 e0 ldi r20, 0x04 ; 4 - 31ec: 50 e0 ldi r21, 0x00 ; 0 - 31ee: ce 01 movw r24, r28 - 31f0: 01 96 adiw r24, 0x01 ; 1 - 31f2: 0e 94 07 09 call 0x120e ; 0x120e - Buffer[0] = ACK_VALUE; - 31f6: 8a e0 ldi r24, 0x0A ; 10 - 31f8: f8 01 movw r30, r16 - 31fa: 80 83 st Z, r24 - 31fc: 84 e0 ldi r24, 0x04 ; 4 - 31fe: 90 e0 ldi r25, 0x00 ; 0 - 3200: 21 c0 rjmp .+66 ; 0x3244 <__stack+0x245> - return ACK_FRAME_SIZE; - } - - case CMD_READ_SIG: - /* Hardcoded response */ - memset(Buffer, 0xCA, SIGNATURE_LENGTH); - 3202: 40 e2 ldi r20, 0x20 ; 32 - 3204: 50 e0 ldi r21, 0x00 ; 0 - 3206: 6a ec ldi r22, 0xCA ; 202 - 3208: 70 e0 ldi r23, 0x00 ; 0 - 320a: c8 01 movw r24, r16 - 320c: 0e 94 8d 2a call 0x551a ; 0x551a - ISO14443AAppendCRCA(Buffer, SIGNATURE_LENGTH); - 3210: 60 e2 ldi r22, 0x20 ; 32 - 3212: 70 e0 ldi r23, 0x00 ; 0 - 3214: c8 01 movw r24, r16 - 3216: 4a d6 rcall .+3220 ; 0x3eac - return (SIGNATURE_LENGTH + ISO14443A_CRCA_SIZE) * 8; - 3218: 80 e1 ldi r24, 0x10 ; 16 - 321a: 91 e0 ldi r25, 0x01 ; 1 - 321c: 13 c0 rjmp .+38 ; 0x3244 <__stack+0x245> - Buffer[0] = 0xBD; - ISO14443AAppendCRCA(Buffer, 1); - return (1 + ISO14443A_CRCA_SIZE) * 8; - - case CMD_VCSL: { - uint8_t ConfigAreaAddress = PageCount * MIFARE_ULTRALIGHT_PAGE_SIZE - CONFIG_AREA_SIZE; - 321e: 60 91 01 21 lds r22, 0x2101 ; 0x802101 - 3222: 66 0f add r22, r22 - 3224: 66 0f add r22, r22 - 3226: 60 51 subi r22, 0x10 ; 16 - /* Input is ignored completely */ - /* Read out the value */ - MemoryReadBlock(Buffer, ConfigAreaAddress + CONF_VCTID_OFFSET, 1); - 3228: 70 e0 ldi r23, 0x00 ; 0 - 322a: 6b 5f subi r22, 0xFB ; 251 - 322c: 7f 4f sbci r23, 0xFF ; 255 - 322e: 41 e0 ldi r20, 0x01 ; 1 - 3230: 50 e0 ldi r21, 0x00 ; 0 - 3232: c8 01 movw r24, r16 - 3234: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - ISO14443AAppendCRCA(Buffer, 1); - 3238: 61 e0 ldi r22, 0x01 ; 1 - 323a: 70 e0 ldi r23, 0x00 ; 0 - 323c: c8 01 movw r24, r16 - 323e: 36 d6 rcall .+3180 ; 0x3eac - return (1 + ISO14443A_CRCA_SIZE) * 8; - 3240: 88 e1 ldi r24, 0x18 ; 24 - 3242: 90 e0 ldi r25, 0x00 ; 0 - break; - } - - /* No response has been sent, when we reach here */ - return ISO14443A_APP_NO_RESPONSE; -} - 3244: 25 96 adiw r28, 0x05 ; 5 - 3246: cd bf out 0x3d, r28 ; 61 - 3248: de bf out 0x3e, r29 ; 62 - 324a: df 91 pop r29 - 324c: cf 91 pop r28 - 324e: 1f 91 pop r17 - 3250: 0f 91 pop r16 - 3252: ff 90 pop r15 - 3254: ef 90 pop r14 - 3256: df 90 pop r13 - 3258: cf 90 pop r12 - 325a: bf 90 pop r11 - 325c: af 90 pop r10 - 325e: 9f 90 pop r9 - 3260: 8f 90 pop r8 - 3262: 08 95 ret - -00003264 : - -void MifareUltralightGetUid(ConfigurationUidType Uid) -{ - 3264: cf 93 push r28 - 3266: df 93 push r29 - 3268: ec 01 movw r28, r24 - /* Read UID from memory */ - MemoryReadBlock(&Uid[0], UID_CL1_ADDRESS, UID_CL1_SIZE); - 326a: 43 e0 ldi r20, 0x03 ; 3 - 326c: 50 e0 ldi r21, 0x00 ; 0 - 326e: 60 e0 ldi r22, 0x00 ; 0 - 3270: 70 e0 ldi r23, 0x00 ; 0 - 3272: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - MemoryReadBlock(&Uid[UID_CL1_SIZE], UID_CL2_ADDRESS, UID_CL2_SIZE); - 3276: 44 e0 ldi r20, 0x04 ; 4 - 3278: 50 e0 ldi r21, 0x00 ; 0 - 327a: 64 e0 ldi r22, 0x04 ; 4 - 327c: 70 e0 ldi r23, 0x00 ; 0 - 327e: ce 01 movw r24, r28 - 3280: 03 96 adiw r24, 0x03 ; 3 -} - 3282: df 91 pop r29 - 3284: cf 91 pop r28 - -void MifareUltralightGetUid(ConfigurationUidType Uid) -{ - /* Read UID from memory */ - MemoryReadBlock(&Uid[0], UID_CL1_ADDRESS, UID_CL1_SIZE); - MemoryReadBlock(&Uid[UID_CL1_SIZE], UID_CL2_ADDRESS, UID_CL2_SIZE); - 3286: 0c 94 7c 08 jmp 0x10f8 ; 0x10f8 - -0000328a : -} - -void MifareUltralightSetUid(ConfigurationUidType Uid) -{ - 328a: 0f 93 push r16 - 328c: 1f 93 push r17 - 328e: cf 93 push r28 - 3290: df 93 push r29 - 3292: 00 d0 rcall .+0 ; 0x3294 - 3294: cd b7 in r28, 0x3d ; 61 - 3296: de b7 in r29, 0x3e ; 62 - 3298: 8c 01 movw r16, r24 - /* Calculate check bytes and write everything into memory */ - uint8_t BCC1 = ISO14443A_UID0_CT ^ Uid[0] ^ Uid[1] ^ Uid[2]; - 329a: fc 01 movw r30, r24 - 329c: 90 81 ld r25, Z - 329e: 81 81 ldd r24, Z+1 ; 0x01 - 32a0: 89 27 eor r24, r25 - 32a2: 98 e8 ldi r25, 0x88 ; 136 - 32a4: 89 27 eor r24, r25 - 32a6: 92 81 ldd r25, Z+2 ; 0x02 - 32a8: 89 27 eor r24, r25 - 32aa: 8a 83 std Y+2, r24 ; 0x02 - uint8_t BCC2 = Uid[3] ^ Uid[4] ^ Uid[5] ^ Uid[6]; - 32ac: 94 81 ldd r25, Z+4 ; 0x04 - 32ae: 83 81 ldd r24, Z+3 ; 0x03 - 32b0: 89 27 eor r24, r25 - 32b2: 95 81 ldd r25, Z+5 ; 0x05 - 32b4: 89 27 eor r24, r25 - 32b6: 96 81 ldd r25, Z+6 ; 0x06 - 32b8: 89 27 eor r24, r25 - 32ba: 89 83 std Y+1, r24 ; 0x01 - - MemoryWriteBlock(&Uid[0], UID_CL1_ADDRESS, UID_CL1_SIZE); - 32bc: 43 e0 ldi r20, 0x03 ; 3 - 32be: 50 e0 ldi r21, 0x00 ; 0 - 32c0: 60 e0 ldi r22, 0x00 ; 0 - 32c2: 70 e0 ldi r23, 0x00 ; 0 - 32c4: c8 01 movw r24, r16 - 32c6: 0e 94 07 09 call 0x120e ; 0x120e - MemoryWriteBlock(&BCC1, UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); - 32ca: 41 e0 ldi r20, 0x01 ; 1 - 32cc: 50 e0 ldi r21, 0x00 ; 0 - 32ce: 63 e0 ldi r22, 0x03 ; 3 - 32d0: 70 e0 ldi r23, 0x00 ; 0 - 32d2: ce 01 movw r24, r28 - 32d4: 02 96 adiw r24, 0x02 ; 2 - 32d6: 0e 94 07 09 call 0x120e ; 0x120e - MemoryWriteBlock(&Uid[UID_CL1_SIZE], UID_CL2_ADDRESS, UID_CL2_SIZE); - 32da: 44 e0 ldi r20, 0x04 ; 4 - 32dc: 50 e0 ldi r21, 0x00 ; 0 - 32de: 64 e0 ldi r22, 0x04 ; 4 - 32e0: 70 e0 ldi r23, 0x00 ; 0 - 32e2: c8 01 movw r24, r16 - 32e4: 03 96 adiw r24, 0x03 ; 3 - 32e6: 0e 94 07 09 call 0x120e ; 0x120e - MemoryWriteBlock(&BCC2, UID_BCC2_ADDRESS, ISO14443A_CL_BCC_SIZE); - 32ea: 41 e0 ldi r20, 0x01 ; 1 - 32ec: 50 e0 ldi r21, 0x00 ; 0 - 32ee: 68 e0 ldi r22, 0x08 ; 8 - 32f0: 70 e0 ldi r23, 0x00 ; 0 - 32f2: ce 01 movw r24, r28 - 32f4: 01 96 adiw r24, 0x01 ; 1 - 32f6: 0e 94 07 09 call 0x120e ; 0x120e -} - 32fa: 0f 90 pop r0 - 32fc: 0f 90 pop r0 - 32fe: df 91 pop r29 - 3300: cf 91 pop r28 - 3302: 1f 91 pop r17 - 3304: 0f 91 pop r16 - 3306: 08 95 ret - -00003308 : -{ - State = STATE_IDLE; - CardATQAValue = MFPlus_ATQA_VALUE; - CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; - uint8_t UidSize = ActiveConfiguration.UidSize; - _7BUID = (UidSize == 7); - 3308: 81 e0 ldi r24, 0x01 ; 1 - 330a: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - 330e: 84 e0 ldi r24, 0x04 ; 4 - 3310: 90 e0 ldi r25, 0x00 ; 0 - 3312: 80 93 07 21 sts 0x2107, r24 ; 0x802107 - 3316: 90 93 08 21 sts 0x2108, r25 ; 0x802108 - 331a: 88 e0 ldi r24, 0x08 ; 8 - 331c: 80 93 06 21 sts 0x2106, r24 ; 0x802106 - 3320: 10 92 05 21 sts 0x2105, r1 ; 0x802105 <_7BUID> - 3324: 08 95 ret - -00003326 : -} - -void MifareClassicAppInit4K(void) -{ - State = STATE_IDLE; - 3326: 81 e0 ldi r24, 0x01 ; 1 - 3328: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - CardATQAValue = MFCLASSIC_4K_ATQA_VALUE; - 332c: 82 e0 ldi r24, 0x02 ; 2 - 332e: 90 e0 ldi r25, 0x00 ; 0 - 3330: 80 93 07 21 sts 0x2107, r24 ; 0x802107 - 3334: 90 93 08 21 sts 0x2108, r25 ; 0x802108 - CardSAKValue = MFCLASSIC_4K_SAK_CL1_VALUE; - 3338: 88 e1 ldi r24, 0x18 ; 24 - 333a: 80 93 06 21 sts 0x2106, r24 ; 0x802106 - _7BUID = 0x00; - 333e: 10 92 05 21 sts 0x2105, r1 ; 0x802105 <_7BUID> - 3342: 08 95 ret - -00003344 : -} - -void MifareClassicAppReset(void) -{ - State = STATE_IDLE; - 3344: 81 e0 ldi r24, 0x01 ; 1 - 3346: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - 334a: 08 95 ret - -0000334c : -} - -void MifareClassicAppTask(void) -{ - 334c: 08 95 ret - -0000334e : - -} - - -uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - 334e: af 92 push r10 - 3350: bf 92 push r11 - 3352: cf 92 push r12 - 3354: df 92 push r13 - 3356: ef 92 push r14 - 3358: ff 92 push r15 - 335a: 0f 93 push r16 - 335c: 1f 93 push r17 - 335e: cf 93 push r28 - 3360: df 93 push r29 - 3362: cd b7 in r28, 0x3d ; 61 - 3364: de b7 in r29, 0x3e ; 62 - 3366: 2f 97 sbiw r28, 0x0f ; 15 - 3368: cd bf out 0x3d, r28 ; 61 - 336a: de bf out 0x3e, r29 ; 62 - 336c: 8c 01 movw r16, r24 - switch(State) { - 336e: 80 91 22 21 lds r24, 0x2122 ; 0x802122 - 3372: 86 30 cpi r24, 0x06 ; 6 - 3374: 09 f4 brne .+2 ; 0x3378 - 3376: 4a c0 rjmp .+148 ; 0x340c - 3378: 30 f4 brcc .+12 ; 0x3386 - 337a: 84 30 cpi r24, 0x04 ; 4 - 337c: 59 f1 breq .+86 ; 0x33d4 - 337e: b0 f5 brcc .+108 ; 0x33ec - 3380: 82 30 cpi r24, 0x02 ; 2 - 3382: d8 f0 brcs .+54 ; 0x33ba - 3384: b7 c4 rjmp .+2414 ; 0x3cf4 - 3386: 89 30 cpi r24, 0x09 ; 9 - 3388: 09 f4 brne .+2 ; 0x338c - 338a: ce c1 rjmp .+924 ; 0x3728 - 338c: 68 f4 brcc .+26 ; 0x33a8 - 338e: 87 30 cpi r24, 0x07 ; 7 - 3390: 09 f4 brne .+2 ; 0x3394 - 3392: 4f c0 rjmp .+158 ; 0x3432 - 3394: 88 30 cpi r24, 0x08 ; 8 - 3396: 09 f0 breq .+2 ; 0x339a - 3398: ad c4 rjmp .+2394 ; 0x3cf4 - 339a: 78 01 movw r14, r16 - 339c: 58 01 movw r10, r16 - 339e: b4 e0 ldi r27, 0x04 ; 4 - 33a0: ab 0e add r10, r27 - 33a2: b1 1c adc r11, r1 - 33a4: 68 01 movw r12, r16 - 33a6: 9b c0 rjmp .+310 ; 0x34de - 33a8: 8d 30 cpi r24, 0x0D ; 13 - 33aa: 08 f0 brcs .+2 ; 0x33ae - 33ac: a3 c4 rjmp .+2374 ; 0x3cf4 - 33ae: 78 01 movw r14, r16 - 33b0: 68 01 movw r12, r16 - 33b2: f6 e0 ldi r31, 0x06 ; 6 - 33b4: cf 0e add r12, r31 - 33b6: d1 1c adc r13, r1 - 33b8: e8 c1 rjmp .+976 ; 0x378a - case STATE_IDLE: - case STATE_HALT: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, true)) { - 33ba: 90 91 07 21 lds r25, 0x2107 ; 0x802107 - 33be: 80 91 08 21 lds r24, 0x2108 ; 0x802108 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) || - 33c2: d8 01 movw r26, r16 - 33c4: 2c 91 ld r18, X - 33c6: 22 35 cpi r18, 0x52 ; 82 - 33c8: 09 f0 breq .+2 ; 0x33cc - 33ca: 94 c4 rjmp .+2344 ; 0x3cf4 - (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 33cc: 9c 93 st X, r25 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 33ce: 11 96 adiw r26, 0x01 ; 1 - 33d0: 8c 93 st X, r24 - 33d2: 2a c0 rjmp .+84 ; 0x3428 - - return ACK_NAK_FRAME_SIZE; -#endif - - case STATE_READY1: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) { - 33d4: 20 91 07 21 lds r18, 0x2107 ; 0x802107 - 33d8: 90 91 08 21 lds r25, 0x2108 ; 0x802108 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) || - 33dc: f8 01 movw r30, r16 - 33de: 80 81 ld r24, Z - 33e0: 86 32 cpi r24, 0x26 ; 38 - 33e2: 79 f0 breq .+30 ; 0x3402 - 33e4: 82 35 cpi r24, 0x52 ; 82 - 33e6: 09 f0 breq .+2 ; 0x33ea - 33e8: 83 c2 rjmp .+1286 ; 0x38f0 - 33ea: 0b c0 rjmp .+22 ; 0x3402 - State = STATE_HALT; - } - break; - - case STATE_READY2: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) { - 33ec: 20 91 07 21 lds r18, 0x2107 ; 0x802107 - 33f0: 90 91 08 21 lds r25, 0x2108 ; 0x802108 - 33f4: f8 01 movw r30, r16 - 33f6: 80 81 ld r24, Z - 33f8: 86 32 cpi r24, 0x26 ; 38 - 33fa: 19 f0 breq .+6 ; 0x3402 - 33fc: 82 35 cpi r24, 0x52 ; 82 - 33fe: 09 f0 breq .+2 ; 0x3402 - 3400: c5 c3 rjmp .+1930 ; 0x3b8c - (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 3402: d8 01 movw r26, r16 - 3404: 2c 93 st X, r18 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 3406: 11 96 adiw r26, 0x01 ; 1 - 3408: 9c 93 st X, r25 - 340a: 0e c0 rjmp .+28 ; 0x3428 - State = STATE_HALT; - } - break; - - case STATE_ACTIVE: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) { - 340c: 20 91 07 21 lds r18, 0x2107 ; 0x802107 - 3410: 90 91 08 21 lds r25, 0x2108 ; 0x802108 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) || - 3414: d8 01 movw r26, r16 - 3416: 8c 91 ld r24, X - 3418: 86 32 cpi r24, 0x26 ; 38 - 341a: 19 f0 breq .+6 ; 0x3422 - 341c: 82 35 cpi r24, 0x52 ; 82 - 341e: 09 f0 breq .+2 ; 0x3422 - 3420: a3 c3 rjmp .+1862 ; 0x3b68 - (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 3422: f8 01 movw r30, r16 - 3424: 20 83 st Z, r18 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 3426: 91 83 std Z+1, r25 ; 0x01 - State = STATE_READY1; - 3428: 84 e0 ldi r24, 0x04 ; 4 - 342a: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - - *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 342e: 80 e1 ldi r24, 0x10 ; 16 - 3430: 62 c4 rjmp .+2244 ; 0x3cf6 - - 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]); - 3432: c8 01 movw r24, r16 - 3434: 47 d6 rcall .+3214 ; 0x40c4 - 3436: 78 01 movw r14, r16 - 3438: b4 e0 ldi r27, 0x04 ; 4 - 343a: eb 0e add r14, r27 - 343c: f1 1c adc r15, r1 - 343e: 68 01 movw r12, r16 - 3440: e8 e0 ldi r30, 0x08 ; 8 - 3442: ce 0e add r12, r30 - 3444: d1 1c adc r13, r1 - - for (uint8_t i=0; i<4; i++) - Buffer[i+4] ^= Crypto1Byte(); - 3446: 51 d6 rcall .+3234 ; 0x40ea - 3448: d7 01 movw r26, r14 - 344a: 9c 91 ld r25, X - 344c: 89 27 eor r24, r25 - 344e: f7 01 movw r30, r14 - 3450: 81 93 st Z+, r24 - 3452: 7f 01 movw r14, r30 - /* 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]); - - for (uint8_t i=0; i<4; i++) - 3454: ec 15 cp r30, r12 - 3456: fd 05 cpc r31, r13 - 3458: b1 f7 brne .-20 ; 0x3446 - Buffer[i+4] ^= Crypto1Byte(); - - if ((Buffer[4] == ReaderResponse[0]) && - 345a: d8 01 movw r26, r16 - 345c: 14 96 adiw r26, 0x04 ; 4 - 345e: 9c 91 ld r25, X - 3460: 14 97 sbiw r26, 0x04 ; 4 - 3462: 80 91 1a 21 lds r24, 0x211A ; 0x80211a - 3466: 98 17 cp r25, r24 - 3468: 11 f0 breq .+4 ; 0x346e - State = STATE_IDLE; - Buffer[0] = NAK_NOT_AUTHED; - return ACK_NAK_FRAME_SIZE; - } else { - /* Unknown command. Enter HALT state. */ - State = STATE_IDLE; - 346a: 81 e0 ldi r24, 0x01 ; 1 - 346c: 38 c2 rjmp .+1136 ; 0x38de - Crypto1Auth(&Buffer[0]); - - for (uint8_t i=0; i<4; i++) - Buffer[i+4] ^= Crypto1Byte(); - - if ((Buffer[4] == ReaderResponse[0]) && - 346e: 15 96 adiw r26, 0x05 ; 5 - 3470: 9c 91 ld r25, X - 3472: 15 97 sbiw r26, 0x05 ; 5 - 3474: 80 91 1b 21 lds r24, 0x211B ; 0x80211b - 3478: 98 13 cpse r25, r24 - 347a: f7 cf rjmp .-18 ; 0x346a - (Buffer[5] == ReaderResponse[1]) && - 347c: 16 96 adiw r26, 0x06 ; 6 - 347e: 9c 91 ld r25, X - 3480: 16 97 sbiw r26, 0x06 ; 6 - 3482: 80 91 1c 21 lds r24, 0x211C ; 0x80211c - 3486: 98 13 cpse r25, r24 - 3488: f0 cf rjmp .-32 ; 0x346a - (Buffer[6] == ReaderResponse[2]) && - 348a: 17 96 adiw r26, 0x07 ; 7 - 348c: 9c 91 ld r25, X - 348e: 80 91 1d 21 lds r24, 0x211D ; 0x80211d - 3492: 98 13 cpse r25, r24 - 3494: ea cf rjmp .-44 ; 0x346a - 3496: 78 01 movw r14, r16 - 3498: 6e e1 ldi r22, 0x1E ; 30 - 349a: c6 2e mov r12, r22 - 349c: 61 e2 ldi r22, 0x21 ; 33 - 349e: d6 2e mov r13, r22 - 34a0: 04 e0 ldi r16, 0x04 ; 4 - 34a2: 0c 0d add r16, r12 - 34a4: 56 01 movw r10, r12 - (Buffer[7] == ReaderResponse[3])) { - /* Reader is authenticated. Encrypt the precalculated card response - * and generate the parity bits. */ - for (uint8_t i=0; i - 34ae: 81 27 eor r24, r17 - 34b0: d7 01 movw r26, r14 - 34b2: 8d 93 st X+, r24 - 34b4: 7d 01 movw r14, r26 - -INLINE uint8_t OddParityBit(uint8_t Byte) -{ - extern const uint8_t PROGMEM OddParityByteTable[]; - - return pgm_read_byte(&OddParityByteTable[Byte]); - 34b6: d5 01 movw r26, r10 - 34b8: ec 91 ld r30, X - 34ba: f0 e0 ldi r31, 0x00 ; 0 - 34bc: e9 5e subi r30, 0xE9 ; 233 - 34be: fb 4f sbci r31, 0xFB ; 251 - 34c0: 14 91 lpm r17, Z - Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - 34c2: 0e 94 25 05 call 0xa4a ; 0xa4a - 34c6: d7 01 movw r26, r14 - 34c8: a1 58 subi r26, 0x81 ; 129 - 34ca: bf 4f sbci r27, 0xFF ; 255 - 34cc: 81 27 eor r24, r17 - 34ce: 8c 93 st X, r24 - (Buffer[5] == ReaderResponse[1]) && - (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 - Buffer[i] = CardResponse[i] ^ Crypto1Byte(); - Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - } - - State = STATE_AUTHED_IDLE; - 34d4: 88 e0 ldi r24, 0x08 ; 8 - 34d6: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - - return (CMD_AUTH_BA_FRAME_SIZE * BITS_PER_BYTE) | ISO14443A_APP_CUSTOM_PARITY; - 34da: 80 e2 ldi r24, 0x20 ; 32 - 34dc: 40 c0 rjmp .+128 ; 0x355e - - 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(); - 34de: 05 d6 rcall .+3082 ; 0x40ea - 34e0: f6 01 movw r30, r12 - 34e2: 90 81 ld r25, Z - 34e4: 89 27 eor r24, r25 - 34e6: d6 01 movw r26, r12 - 34e8: 8d 93 st X+, r24 - 34ea: 6d 01 movw r12, r26 - break; - - 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++) - 34ec: aa 15 cp r26, r10 - 34ee: bb 05 cpc r27, r11 - 34f0: b1 f7 brne .-20 ; 0x34de - Buffer[i] ^= Crypto1Byte(); - - if (Buffer[0] == CMD_READ) { - 34f2: f8 01 movw r30, r16 - 34f4: 80 81 ld r24, Z - 34f6: 80 33 cpi r24, 0x30 ; 48 - 34f8: a1 f5 brne .+104 ; 0x3562 - if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { - 34fa: 62 e0 ldi r22, 0x02 ; 2 - 34fc: 70 e0 ldi r23, 0x00 ; 0 - 34fe: c8 01 movw r24, r16 - 3500: 00 d5 rcall .+2560 ; 0x3f02 - 3502: 88 23 and r24, r24 - 3504: 09 f4 brne .+2 ; 0x3508 - 3506: 81 c0 rjmp .+258 ; 0x360a - /* Read command. Read data from memory and append CRCA. */ - MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 3508: d8 01 movw r26, r16 - 350a: 11 96 adiw r26, 0x01 ; 1 - 350c: 6c 91 ld r22, X - 350e: b0 e1 ldi r27, 0x10 ; 16 - 3510: 6b 9f mul r22, r27 - 3512: b0 01 movw r22, r0 - 3514: 11 24 eor r1, r1 - 3516: 40 e1 ldi r20, 0x10 ; 16 - 3518: 50 e0 ldi r21, 0x00 ; 0 - 351a: c8 01 movw r24, r16 - 351c: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); - 3520: 60 e1 ldi r22, 0x10 ; 16 - 3522: 70 e0 ldi r23, 0x00 ; 0 - 3524: c8 01 movw r24, r16 - 3526: c2 d4 rcall .+2436 ; 0x3eac - 3528: 68 01 movw r12, r16 - 352a: e2 e1 ldi r30, 0x12 ; 18 - 352c: ce 0e add r12, r30 - 352e: d1 1c adc r13, r1 - - /* Encrypt and calculate parity bits. */ - for (uint8_t i=0; i<(ISO14443A_CRCA_SIZE + MEM_BYTES_PER_BLOCK); i++) { - uint8_t Plain = Buffer[i]; - 3530: d7 01 movw r26, r14 - 3532: 1c 91 ld r17, X - Buffer[i] = Plain ^ Crypto1Byte(); - 3534: da d5 rcall .+2996 ; 0x40ea - 3536: 81 27 eor r24, r17 - 3538: f7 01 movw r30, r14 - 353a: 81 93 st Z+, r24 - 353c: 7f 01 movw r14, r30 - 353e: e1 2f mov r30, r17 - 3540: f0 e0 ldi r31, 0x00 ; 0 - 3542: e9 5e subi r30, 0xE9 ; 233 - 3544: fb 4f sbci r31, 0xFB ; 251 - 3546: 14 91 lpm r17, Z - Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(Plain) ^ Crypto1FilterOutput(); - 3548: 0e 94 25 05 call 0xa4a ; 0xa4a - 354c: d7 01 movw r26, r14 - 354e: a1 58 subi r26, 0x81 ; 129 - 3550: bf 4f sbci r27, 0xFF ; 255 - 3552: 81 27 eor r24, r17 - 3554: 8c 93 st X, r24 - /* 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++) { - 3556: ec 14 cp r14, r12 - 3558: fd 04 cpc r15, r13 - 355a: 51 f7 brne .-44 ; 0x3530 - 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 ) - 355c: 80 e9 ldi r24, 0x90 ; 144 - 355e: 90 e1 ldi r25, 0x10 ; 16 - 3560: 51 c4 rjmp .+2210 ; 0x3e04 - * 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) { - 3562: 80 3a cpi r24, 0xA0 ; 160 - 3564: 71 f4 brne .+28 ; 0x3582 - if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { - 3566: 62 e0 ldi r22, 0x02 ; 2 - 3568: 70 e0 ldi r23, 0x00 ; 0 - 356a: c8 01 movw r24, r16 - 356c: ca d4 rcall .+2452 ; 0x3f02 - 356e: 88 23 and r24, r24 - 3570: b9 f0 breq .+46 ; 0x35a0 - /* Write command. Store the address and prepare for the upcoming data. - * Respond with ACK. */ - CurrentAddress = Buffer[1]; - 3572: f8 01 movw r30, r16 - 3574: 81 81 ldd r24, Z+1 ; 0x01 - 3576: 80 93 19 21 sts 0x2119, r24 ; 0x802119 - State = STATE_WRITE; - 357a: 89 e0 ldi r24, 0x09 ; 9 - 357c: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - 3580: 57 c0 rjmp .+174 ; 0x3630 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_DECREMENT) { - 3582: 80 3c cpi r24, 0xC0 ; 192 - 3584: 99 f0 breq .+38 ; 0x35ac - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_INCREMENT) { - 3586: 81 3c cpi r24, 0xC1 ; 193 - 3588: f1 f0 breq .+60 ; 0x35c6 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_RESTORE) { - 358a: 82 3c cpi r24, 0xC2 ; 194 - 358c: 69 f1 breq .+90 ; 0x35e8 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - }else if (Buffer[0] == CMD_TRANSFER) { - 358e: 80 3b cpi r24, 0xB0 ; 176 - 3590: 09 f0 breq .+2 ; 0x3594 - 3592: 54 c0 rjmp .+168 ; 0x363c - /* Write back the global block buffer to the desired block address */ - if (ISO14443ACheckCRCA(Buffer, CMD_TRANSFER_FRAME_SIZE)) { - 3594: 62 e0 ldi r22, 0x02 ; 2 - 3596: 70 e0 ldi r23, 0x00 ; 0 - 3598: c8 01 movw r24, r16 - 359a: b3 d4 rcall .+2406 ; 0x3f02 - 359c: 81 11 cpse r24, r1 - 359e: 38 c0 rjmp .+112 ; 0x3610 - * Respond with ACK. */ - CurrentAddress = Buffer[1]; - State = STATE_WRITE; - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 35a0: b5 d5 rcall .+2922 ; 0x410c - 35a2: 91 e0 ldi r25, 0x01 ; 1 - 35a4: 89 27 eor r24, r25 - 35a6: f8 01 movw r30, r16 - 35a8: 80 83 st Z, r24 - 35aa: ed c0 rjmp .+474 ; 0x3786 - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_DECREMENT) { - if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { - 35ac: 62 e0 ldi r22, 0x02 ; 2 - 35ae: 70 e0 ldi r23, 0x00 ; 0 - 35b0: c8 01 movw r24, r16 - 35b2: a7 d4 rcall .+2382 ; 0x3f02 - 35b4: 88 23 and r24, r24 - 35b6: 49 f1 breq .+82 ; 0x360a - CurrentAddress = Buffer[1]; - 35b8: d8 01 movw r26, r16 - 35ba: 11 96 adiw r26, 0x01 ; 1 - 35bc: 8c 91 ld r24, X - 35be: 80 93 19 21 sts 0x2119, r24 ; 0x802119 - State = STATE_DECREMENT; - 35c2: 8b e0 ldi r24, 0x0B ; 11 - 35c4: 1d c0 rjmp .+58 ; 0x3600 - } 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)) { - 35c6: 62 e0 ldi r22, 0x02 ; 2 - 35c8: 70 e0 ldi r23, 0x00 ; 0 - 35ca: c8 01 movw r24, r16 - 35cc: 9a d4 rcall .+2356 ; 0x3f02 - 35ce: 88 23 and r24, r24 - 35d0: 39 f3 breq .-50 ; 0x35a0 - CurrentAddress = Buffer[1]; - 35d2: f8 01 movw r30, r16 - 35d4: 81 81 ldd r24, Z+1 ; 0x01 - 35d6: 80 93 19 21 sts 0x2119, r24 ; 0x802119 - State = STATE_INCREMENT; - 35da: 5a e0 ldi r21, 0x0A ; 10 - 35dc: f5 2e mov r15, r21 - 35de: f0 92 22 21 sts 0x2122, r15 ; 0x802122 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 35e2: 94 d5 rcall .+2856 ; 0x410c - 35e4: 8f 25 eor r24, r15 - 35e6: 27 c0 rjmp .+78 ; 0x3636 - } 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)) { - 35e8: 62 e0 ldi r22, 0x02 ; 2 - 35ea: 70 e0 ldi r23, 0x00 ; 0 - 35ec: c8 01 movw r24, r16 - 35ee: 89 d4 rcall .+2322 ; 0x3f02 - 35f0: 88 23 and r24, r24 - 35f2: 59 f0 breq .+22 ; 0x360a - CurrentAddress = Buffer[1]; - 35f4: d8 01 movw r26, r16 - 35f6: 11 96 adiw r26, 0x01 ; 1 - 35f8: 8c 91 ld r24, X - 35fa: 80 93 19 21 sts 0x2119, r24 ; 0x802119 - State = STATE_RESTORE; - 35fe: 8c e0 ldi r24, 0x0C ; 12 - 3600: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 3604: 83 d5 rcall .+2822 ; 0x410c - 3606: 9a e0 ldi r25, 0x0A ; 10 - 3608: cd cf rjmp .-102 ; 0x35a4 - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 360a: 80 d5 rcall .+2816 ; 0x410c - 360c: 91 e0 ldi r25, 0x01 ; 1 - 360e: 12 c0 rjmp .+36 ; 0x3634 - } - 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)) { - if (!ActiveConfiguration.ReadOnly) { - 3610: 80 91 51 21 lds r24, 0x2151 ; 0x802151 - 3614: 81 11 cpse r24, r1 - 3616: 0c c0 rjmp .+24 ; 0x3630 - MemoryWriteBlock(BlockBuffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK ); - 3618: f8 01 movw r30, r16 - 361a: 61 81 ldd r22, Z+1 ; 0x01 - 361c: f0 e1 ldi r31, 0x10 ; 16 - 361e: 6f 9f mul r22, r31 - 3620: b0 01 movw r22, r0 - 3622: 11 24 eor r1, r1 - 3624: 40 e1 ldi r20, 0x10 ; 16 - 3626: 50 e0 ldi r21, 0x00 ; 0 - 3628: 89 e0 ldi r24, 0x09 ; 9 - 362a: 91 e2 ldi r25, 0x21 ; 33 - 362c: 0e 94 07 09 call 0x120e ; 0x120e - } else { - /* In read only mode, silently ignore the write */ - } - - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 3630: 6d d5 rcall .+2778 ; 0x410c - 3632: 9a e0 ldi r25, 0x0A ; 10 - 3634: 89 27 eor r24, r25 - 3636: d8 01 movw r26, r16 - 3638: 8c 93 st X, r24 - 363a: a5 c0 rjmp .+330 ; 0x3786 - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - - return ACK_NAK_FRAME_SIZE; - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { - 363c: 80 56 subi r24, 0x60 ; 96 - 363e: 82 30 cpi r24, 0x02 ; 2 - 3640: 08 f0 brcs .+2 ; 0x3644 - 3642: 13 cf rjmp .-474 ; 0x346a - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 3644: 62 e0 ldi r22, 0x02 ; 2 - 3646: 70 e0 ldi r23, 0x00 ; 0 - 3648: c8 01 movw r24, r16 - 364a: 5b d4 rcall .+2230 ; 0x3f02 - 364c: 88 23 and r24, r24 - 364e: 09 f4 brne .+2 ; 0x3652 - 3650: a7 cf rjmp .-178 ; 0x35a0 - /* Nested authentication. */ - uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - 3652: d8 01 movw r26, r16 - 3654: 11 96 adiw r26, 0x01 ; 1 - 3656: 8c 91 ld r24, X - 3658: 11 97 sbiw r26, 0x01 ; 1 - 365a: 8c 73 andi r24, 0x3C ; 60 - uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 365c: 9c 91 ld r25, X - 365e: 90 36 cpi r25, 0x60 ; 96 - 3660: 11 f0 breq .+4 ; 0x3666 - 3662: 9a e3 ldi r25, 0x3A ; 58 - 3664: 01 c0 rjmp .+2 ; 0x3668 - 3666: 90 e3 ldi r25, 0x30 ; 48 - uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; - 3668: b0 e1 ldi r27, 0x10 ; 16 - 366a: 8b 9f mul r24, r27 - 366c: 80 01 movw r16, r0 - 366e: 11 24 eor r1, r1 - 3670: 09 0f add r16, r25 - 3672: 11 1d adc r17, r1 - uint8_t Key[6]; - uint8_t Uid[4]; - uint8_t CardNonce[4]={0x01}; - 3674: 1f 82 std Y+7, r1 ; 0x07 - 3676: 18 86 std Y+8, r1 ; 0x08 - 3678: 19 86 std Y+9, r1 ; 0x09 - 367a: 1a 86 std Y+10, r1 ; 0x0a - 367c: 81 e0 ldi r24, 0x01 ; 1 - 367e: 8f 83 std Y+7, r24 ; 0x07 - - /* Generate a random nonce and read UID and key from memory */ - //RandomGetBuffer(CardNonce, sizeof(CardNonce)); - if (_7BUID) - 3680: 80 91 05 21 lds r24, 0x2105 ; 0x802105 <_7BUID> - MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - 3684: 44 e0 ldi r20, 0x04 ; 4 - 3686: 50 e0 ldi r21, 0x00 ; 0 - uint8_t Uid[4]; - uint8_t CardNonce[4]={0x01}; - - /* Generate a random nonce and read UID and key from memory */ - //RandomGetBuffer(CardNonce, sizeof(CardNonce)); - if (_7BUID) - 3688: 88 23 and r24, r24 - 368a: 19 f0 breq .+6 ; 0x3692 - MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - 368c: 63 e0 ldi r22, 0x03 ; 3 - 368e: 70 e0 ldi r23, 0x00 ; 0 - 3690: 02 c0 rjmp .+4 ; 0x3696 - else - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 3692: 60 e0 ldi r22, 0x00 ; 0 - 3694: 70 e0 ldi r23, 0x00 ; 0 - 3696: ce 01 movw r24, r28 - 3698: 0b 96 adiw r24, 0x0b ; 11 - 369a: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); - 369e: 46 e0 ldi r20, 0x06 ; 6 - 36a0: 50 e0 ldi r21, 0x00 ; 0 - 36a2: b8 01 movw r22, r16 - 36a4: ce 01 movw r24, r28 - 36a6: 01 96 adiw r24, 0x01 ; 1 - 36a8: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - - /* Precalculate the reader response from card-nonce */ - for (uint8_t i=0; i - 36b2: 88 85 ldd r24, Y+8 ; 0x08 - 36b4: 80 93 1b 21 sts 0x211B, r24 ; 0x80211b - 36b8: 89 85 ldd r24, Y+9 ; 0x09 - 36ba: 80 93 1c 21 sts 0x211C, r24 ; 0x80211c - 36be: 8a 85 ldd r24, Y+10 ; 0x0a - 36c0: 80 93 1d 21 sts 0x211D, r24 ; 0x80211d - - Crypto1PRNG(ReaderResponse, 64); - 36c4: 60 e4 ldi r22, 0x40 ; 64 - 36c6: 70 e0 ldi r23, 0x00 ; 0 - 36c8: 8a e1 ldi r24, 0x1A ; 26 - 36ca: 91 e2 ldi r25, 0x21 ; 33 - 36cc: 30 d5 rcall .+2656 ; 0x412e - - /* Precalculate our response from the reader response */ - for (uint8_t i=0; i - 36d2: 80 93 1e 21 sts 0x211E, r24 ; 0x80211e - 36d6: 80 91 1b 21 lds r24, 0x211B ; 0x80211b - 36da: 80 93 1f 21 sts 0x211F, r24 ; 0x80211f - 36de: 80 91 1c 21 lds r24, 0x211C ; 0x80211c - 36e2: 80 93 20 21 sts 0x2120, r24 ; 0x802120 - 36e6: 80 91 1d 21 lds r24, 0x211D ; 0x80211d - 36ea: 80 93 21 21 sts 0x2121, r24 ; 0x802121 - - Crypto1PRNG(CardResponse, 32); - 36ee: 60 e2 ldi r22, 0x20 ; 32 - 36f0: 70 e0 ldi r23, 0x00 ; 0 - 36f2: 8e e1 ldi r24, 0x1E ; 30 - 36f4: 91 e2 ldi r25, 0x21 ; 33 - 36f6: 1b d5 rcall .+2614 ; 0x412e - - /* Setup crypto1 cipher. */ - Crypto1Setup(Key, Uid, CardNonce); - 36f8: ae 01 movw r20, r28 - 36fa: 49 5f subi r20, 0xF9 ; 249 - 36fc: 5f 4f sbci r21, 0xFF ; 255 - 36fe: be 01 movw r22, r28 - 3700: 65 5f subi r22, 0xF5 ; 245 - 3702: 7f 4f sbci r23, 0xFF ; 255 - 3704: ce 01 movw r24, r28 - 3706: 01 96 adiw r24, 0x01 ; 1 - 3708: 46 d4 rcall .+2188 ; 0x3f96 - 370a: fe 01 movw r30, r28 - 370c: 37 96 adiw r30, 0x07 ; 7 - 370e: 84 e0 ldi r24, 0x04 ; 4 - 3710: 8e 0f add r24, r30 - - for (uint8_t i=0; i - Buffer[i] = CardNonce[i]; - - /* Respond with the encrypted random card nonce and expect further authentication - * form the reader in the next frame. */ - State = STATE_AUTHING; - 371e: 87 e0 ldi r24, 0x07 ; 7 - 3720: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - - return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; - 3724: 80 e2 ldi r24, 0x20 ; 32 - 3726: e7 c2 rjmp .+1486 ; 0x3cf6 - 3728: 78 01 movw r14, r16 - 372a: 68 01 movw r12, r16 - 372c: f2 e1 ldi r31, 0x12 ; 18 - 372e: cf 0e add r12, r31 - 3730: d1 1c adc r13, r1 - * 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(); - 3732: db d4 rcall .+2486 ; 0x40ea - 3734: d7 01 movw r26, r14 - 3736: 9c 91 ld r25, X - 3738: 89 27 eor r24, r25 - 373a: f7 01 movw r30, r14 - 373c: 81 93 st Z+, r24 - 373e: 7f 01 movw r14, r30 - * 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++) - 3740: ec 15 cp r30, r12 - 3742: fd 05 cpc r31, r13 - 3744: b1 f7 brne .-20 ; 0x3732 - Buffer[i] ^= Crypto1Byte(); - - if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { - 3746: 60 e1 ldi r22, 0x10 ; 16 - 3748: 70 e0 ldi r23, 0x00 ; 0 - 374a: c8 01 movw r24, r16 - 374c: da d3 rcall .+1972 ; 0x3f02 - 374e: 88 23 and r24, r24 - 3750: 91 f0 breq .+36 ; 0x3776 - if (!ActiveConfiguration.ReadOnly) { - 3752: 80 91 51 21 lds r24, 0x2151 ; 0x802151 - 3756: 81 11 cpse r24, r1 - 3758: 0b c0 rjmp .+22 ; 0x3770 - MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 375a: 60 91 19 21 lds r22, 0x2119 ; 0x802119 - 375e: f0 e1 ldi r31, 0x10 ; 16 - 3760: 6f 9f mul r22, r31 - 3762: b0 01 movw r22, r0 - 3764: 11 24 eor r1, r1 - 3766: 40 e1 ldi r20, 0x10 ; 16 - 3768: 50 e0 ldi r21, 0x00 ; 0 - 376a: c8 01 movw r24, r16 - 376c: 0e 94 07 09 call 0x120e ; 0x120e - } else { - /* Silently ignore in ReadOnly mode */ - } - - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 3770: cd d4 rcall .+2458 ; 0x410c - 3772: 9a e0 ldi r25, 0x0A ; 10 - 3774: b9 c0 rjmp .+370 ; 0x38e8 - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 3776: ca d4 rcall .+2452 ; 0x410c - 3778: 91 e0 ldi r25, 0x01 ; 1 - 377a: 89 27 eor r24, r25 - 377c: f8 01 movw r30, r16 - 377e: 80 83 st Z, r24 - } - - State = STATE_AUTHED_IDLE; - 3780: 88 e0 ldi r24, 0x08 ; 8 - 3782: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - return ACK_NAK_FRAME_SIZE; - 3786: 84 e0 ldi r24, 0x04 ; 4 - 3788: b6 c2 rjmp .+1388 ; 0x3cf6 - * 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(); - 378a: af d4 rcall .+2398 ; 0x40ea - 378c: d7 01 movw r26, r14 - 378e: 9c 91 ld r25, X - 3790: 89 27 eor r24, r25 - 3792: f7 01 movw r30, r14 - 3794: 81 93 st Z+, r24 - 3796: 7f 01 movw r14, r30 - * been issued earlier and the reader is now sending the data. First, - * 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++) - 3798: ec 15 cp r30, r12 - 379a: fd 05 cpc r31, r13 - 379c: b1 f7 brne .-20 ; 0x378a - Buffer[i] ^= Crypto1Byte(); - - if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { - 379e: 64 e0 ldi r22, 0x04 ; 4 - 37a0: 70 e0 ldi r23, 0x00 ; 0 - 37a2: c8 01 movw r24, r16 - 37a4: ae d3 rcall .+1884 ; 0x3f02 - 37a6: 88 23 and r24, r24 - 37a8: 09 f4 brne .+2 ; 0x37ac - 37aa: 9c c0 rjmp .+312 ; 0x38e4 - MemoryReadBlock(BlockBuffer, (uint16_t) CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 37ac: 60 91 19 21 lds r22, 0x2119 ; 0x802119 - 37b0: f0 e1 ldi r31, 0x10 ; 16 - 37b2: 6f 9f mul r22, r31 - 37b4: b0 01 movw r22, r0 - 37b6: 11 24 eor r1, r1 - 37b8: 40 e1 ldi r20, 0x10 ; 16 - 37ba: 50 e0 ldi r21, 0x00 ; 0 - 37bc: 89 e0 ldi r24, 0x09 ; 9 - 37be: 91 e2 ldi r25, 0x21 ; 33 - 37c0: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - -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]) - 37c4: 30 91 09 21 lds r19, 0x2109 ; 0x802109 - 37c8: 80 91 0d 21 lds r24, 0x210D ; 0x80210d - 37cc: 80 95 com r24 - 37ce: 38 13 cpse r19, r24 - 37d0: 0e c3 rjmp .+1564 ; 0x3dee - 37d2: 80 91 11 21 lds r24, 0x2111 ; 0x802111 - 37d6: 38 13 cpse r19, r24 - 37d8: 0a c3 rjmp .+1556 ; 0x3dee - && (Block[1] == (uint8_t) ~Block[5]) && (Block[1] == Block[9]) - 37da: e0 91 0a 21 lds r30, 0x210A ; 0x80210a - 37de: 80 91 0e 21 lds r24, 0x210E ; 0x80210e - 37e2: 80 95 com r24 - 37e4: e8 13 cpse r30, r24 - 37e6: 03 c3 rjmp .+1542 ; 0x3dee - 37e8: 80 91 12 21 lds r24, 0x2112 ; 0x802112 - 37ec: e8 13 cpse r30, r24 - 37ee: ff c2 rjmp .+1534 ; 0x3dee - && (Block[2] == (uint8_t) ~Block[6]) && (Block[2] == Block[10]) - 37f0: 80 91 0b 21 lds r24, 0x210B ; 0x80210b - 37f4: 90 91 0f 21 lds r25, 0x210F ; 0x80210f - 37f8: 90 95 com r25 - 37fa: 89 13 cpse r24, r25 - 37fc: f8 c2 rjmp .+1520 ; 0x3dee - 37fe: 90 91 13 21 lds r25, 0x2113 ; 0x802113 - 3802: 89 13 cpse r24, r25 - 3804: f4 c2 rjmp .+1512 ; 0x3dee - && (Block[3] == (uint8_t) ~Block[7]) && (Block[3] == Block[11]) - 3806: 20 91 0c 21 lds r18, 0x210C ; 0x80210c - 380a: 90 91 10 21 lds r25, 0x2110 ; 0x802110 - 380e: 90 95 com r25 - 3810: 29 13 cpse r18, r25 - 3812: ed c2 rjmp .+1498 ; 0x3dee - 3814: 90 91 14 21 lds r25, 0x2114 ; 0x802114 - 3818: 29 13 cpse r18, r25 - 381a: e9 c2 rjmp .+1490 ; 0x3dee - && (Block[12] == (uint8_t) ~Block[13]) - 381c: 40 91 15 21 lds r20, 0x2115 ; 0x802115 - 3820: 90 91 16 21 lds r25, 0x2116 ; 0x802116 - 3824: 90 95 com r25 - 3826: 49 13 cpse r20, r25 - 3828: e2 c2 rjmp .+1476 ; 0x3dee - && (Block[12] == Block[14]) - 382a: 90 91 17 21 lds r25, 0x2117 ; 0x802117 - 382e: 49 13 cpse r20, r25 - 3830: de c2 rjmp .+1468 ; 0x3dee - && (Block[14] == (uint8_t) ~Block[15])) { - 3832: 90 91 18 21 lds r25, 0x2118 ; 0x802118 - 3836: 90 95 com r25 - 3838: 49 13 cpse r20, r25 - 383a: d9 c2 rjmp .+1458 ; 0x3dee -} - -INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) -{ - *Value = 0; - *Value |= ((uint32_t) Block[0] << 0); - 383c: d8 01 movw r26, r16 - 383e: 9c 91 ld r25, X - *Value |= ((uint32_t) Block[1] << 8); - 3840: 11 96 adiw r26, 0x01 ; 1 - 3842: fc 91 ld r31, X - 3844: 11 97 sbiw r26, 0x01 ; 1 - *Value |= ((uint32_t) Block[2] << 16); - 3846: 12 96 adiw r26, 0x02 ; 2 - 3848: 4c 91 ld r20, X - 384a: 12 97 sbiw r26, 0x02 ; 2 - 384c: 50 e0 ldi r21, 0x00 ; 0 - 384e: 60 e0 ldi r22, 0x00 ; 0 - 3850: 70 e0 ldi r23, 0x00 ; 0 - 3852: ba 01 movw r22, r20 - 3854: 55 27 eor r21, r21 - 3856: 44 27 eor r20, r20 - 3858: 5f 2b or r21, r31 - 385a: 49 2b or r20, r25 - *Value |= ((uint32_t) Block[3] << 24); - 385c: 13 96 adiw r26, 0x03 ; 3 - 385e: 9c 91 ld r25, X - 3860: 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); - 3862: 90 e0 ldi r25, 0x00 ; 0 - 3864: a0 e0 ldi r26, 0x00 ; 0 - 3866: b0 e0 ldi r27, 0x00 ; 0 - 3868: dc 01 movw r26, r24 - 386a: 99 27 eor r25, r25 - 386c: 88 27 eor r24, r24 - 386e: 9e 2b or r25, r30 - 3870: 83 2b or r24, r19 - *Value |= ((uint32_t) Block[3] << 24); - 3872: b2 2b or r27, r18 - uint32_t BlockValue; - - ValueFromBlock(&ParamValue, Buffer); - ValueFromBlock(&BlockValue, BlockBuffer); - - if (State == STATE_DECREMENT) { - 3874: 20 91 22 21 lds r18, 0x2122 ; 0x802122 - 3878: 2b 30 cpi r18, 0x0B ; 11 - 387a: 09 f0 breq .+2 ; 0x387e - 387c: bb c2 rjmp .+1398 ; 0x3df4 - BlockValue -= ParamValue; - 387e: 84 1b sub r24, r20 - 3880: 95 0b sbc r25, r21 - 3882: a6 0b sbc r26, r22 - 3884: b7 0b sbc r27, r23 - *Value |= ((uint32_t) Block[3] << 24); -} - -INLINE void ValueToBlock(uint8_t* Block, uint32_t Value) -{ - Block[0] = (uint8_t) (Value >> 0); - 3886: 80 93 09 21 sts 0x2109, r24 ; 0x802109 - Block[1] = (uint8_t) (Value >> 8); - 388a: c9 2e mov r12, r25 - 388c: da 2e mov r13, r26 - 388e: eb 2e mov r14, r27 - 3890: ff 24 eor r15, r15 - 3892: c0 92 0a 21 sts 0x210A, r12 ; 0x80210a - Block[2] = (uint8_t) (Value >> 16); - 3896: 8d 01 movw r16, r26 - 3898: 22 27 eor r18, r18 - 389a: 33 27 eor r19, r19 - 389c: 00 93 0b 21 sts 0x210B, r16 ; 0x80210b - Block[3] = (uint8_t) (Value >> 24); - 38a0: 4b 2f mov r20, r27 - 38a2: 55 27 eor r21, r21 - 38a4: 66 27 eor r22, r22 - 38a6: 77 27 eor r23, r23 - 38a8: 40 93 0c 21 sts 0x210C, r20 ; 0x80210c - Block[4] = ~Block[0]; - 38ac: e8 2f mov r30, r24 - 38ae: e0 95 com r30 - 38b0: e0 93 0d 21 sts 0x210D, r30 ; 0x80210d - Block[5] = ~Block[1]; - 38b4: ec 2d mov r30, r12 - 38b6: e0 95 com r30 - 38b8: e0 93 0e 21 sts 0x210E, r30 ; 0x80210e - Block[6] = ~Block[2]; - 38bc: e0 2f mov r30, r16 - 38be: e0 95 com r30 - 38c0: e0 93 0f 21 sts 0x210F, r30 ; 0x80210f - Block[7] = ~Block[3]; - 38c4: e4 2f mov r30, r20 - 38c6: e0 95 com r30 - 38c8: e0 93 10 21 sts 0x2110, r30 ; 0x802110 - Block[8] = Block[0]; - 38cc: 80 93 11 21 sts 0x2111, r24 ; 0x802111 - Block[9] = Block[1]; - 38d0: c0 92 12 21 sts 0x2112, r12 ; 0x802112 - Block[10] = Block[2]; - 38d4: 00 93 13 21 sts 0x2113, r16 ; 0x802113 - Block[11] = Block[3]; - 38d8: 40 93 14 21 sts 0x2114, r20 ; 0x802114 - /* Do nothing */ - } - - ValueToBlock(BlockBuffer, BlockValue); - - State = STATE_AUTHED_IDLE; - 38dc: 88 e0 ldi r24, 0x08 ; 8 - 38de: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - 38e2: 08 c2 rjmp .+1040 ; 0x3cf4 - /* Not sure if this is the correct error code.. */ - Buffer[0] = NAK_OTHER_ERROR ^ Crypto1Nibble(); - } - } else { - /* CRC Error. */ - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 38e4: 13 d4 rcall .+2086 ; 0x410c - 38e6: 91 e0 ldi r25, 0x01 ; 1 - 38e8: 89 27 eor r24, r25 - 38ea: d8 01 movw r26, r16 - 38ec: 8c 93 st X, r24 - 38ee: 48 cf rjmp .-368 ; 0x3780 - - case STATE_READY1: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) { - State = STATE_READY1; - return BitCount; - } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { - 38f0: 83 39 cpi r24, 0x93 ; 147 - 38f2: 09 f0 breq .+2 ; 0x38f6 - 38f4: 48 c1 rjmp .+656 ; 0x3b86 - /* Load UID CL1 and perform anticollision */ - uint8_t UidCL1[ISO14443A_CL_UID_SIZE]; - - if (_7BUID) { - 38f6: 80 91 05 21 lds r24, 0x2105 ; 0x802105 <_7BUID> - 38fa: 88 23 and r24, r24 - 38fc: 09 f4 brne .+2 ; 0x3900 - 38fe: a1 c0 rjmp .+322 ; 0x3a42 - MemoryReadBlock(&UidCL1[1], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); - 3900: 43 e0 ldi r20, 0x03 ; 3 - 3902: 50 e0 ldi r21, 0x00 ; 0 - 3904: 60 e0 ldi r22, 0x00 ; 0 - 3906: 70 e0 ldi r23, 0x00 ; 0 - 3908: ce 01 movw r24, r28 - 390a: 02 96 adiw r24, 0x02 ; 2 - 390c: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - UidCL1[0] = ISO14443A_UID0_CT; - 3910: 88 e8 ldi r24, 0x88 ; 136 - 3912: 89 83 std Y+1, r24 ; 0x01 - -INLINE -bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - uint8_t NVB = DataPtr[1]; - 3914: f8 01 movw r30, r16 - 3916: 91 81 ldd r25, Z+1 ; 0x01 - //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; - //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; - - switch (NVB) { - 3918: 90 32 cpi r25, 0x20 ; 32 - 391a: 19 f0 breq .+6 ; 0x3922 - 391c: 90 37 cpi r25, 0x70 ; 112 - 391e: 61 f0 breq .+24 ; 0x3938 - 3920: 24 c0 rjmp .+72 ; 0x396a - case ISO14443A_NVB_AC_START: - /* Start of anticollision procedure. - * Send whole UID CLn + BCC */ - DataPtr[0] = UidCL[0]; - 3922: d8 01 movw r26, r16 - 3924: 80 83 st Z, r24 - DataPtr[1] = UidCL[1]; - 3926: 3a 81 ldd r19, Y+2 ; 0x02 - 3928: 31 83 std Z+1, r19 ; 0x01 - DataPtr[2] = UidCL[2]; - 392a: 2b 81 ldd r18, Y+3 ; 0x03 - 392c: 22 83 std Z+2, r18 ; 0x02 - DataPtr[3] = UidCL[3]; - 392e: 9c 81 ldd r25, Y+4 ; 0x04 - 3930: 93 83 std Z+3, r25 ; 0x03 - 3932: 23 27 eor r18, r19 - DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 3934: 82 27 eor r24, r18 - 3936: 4b c1 rjmp .+662 ; 0x3bce - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 3938: f8 01 movw r30, r16 - 393a: 82 81 ldd r24, Z+2 ; 0x02 - 393c: 88 38 cpi r24, 0x88 ; 136 - 393e: 09 f0 breq .+2 ; 0x3942 - 3940: d9 c1 rjmp .+946 ; 0x3cf4 - 3942: 93 81 ldd r25, Z+3 ; 0x03 - 3944: 8a 81 ldd r24, Y+2 ; 0x02 - 3946: 98 13 cpse r25, r24 - 3948: d5 c1 rjmp .+938 ; 0x3cf4 - (DataPtr[3] == UidCL[1]) && - 394a: 94 81 ldd r25, Z+4 ; 0x04 - 394c: 8b 81 ldd r24, Y+3 ; 0x03 - 394e: 98 13 cpse r25, r24 - 3950: d1 c1 rjmp .+930 ; 0x3cf4 - (DataPtr[4] == UidCL[2]) && - 3952: 95 81 ldd r25, Z+5 ; 0x05 - 3954: 8c 81 ldd r24, Y+4 ; 0x04 - 3956: 98 13 cpse r25, r24 - 3958: cd c1 rjmp .+922 ; 0x3cf4 - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 395a: 84 e0 ldi r24, 0x04 ; 4 - 395c: 80 83 st Z, r24 - ISO14443AAppendCRCA(Buffer, 1); - 395e: 61 e0 ldi r22, 0x01 ; 1 - 3960: 70 e0 ldi r23, 0x00 ; 0 - 3962: c8 01 movw r24, r16 - 3964: a3 d2 rcall .+1350 ; 0x3eac - if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) - State = STATE_READY2; - 3966: 85 e0 ldi r24, 0x05 ; 5 - 3968: 4f c1 rjmp .+670 ; 0x3c08 - *BitCount = 0; - return false; - } - default: - { - uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2; - 396a: e9 2e mov r14, r25 - 396c: e2 94 swap r14 - 396e: ff e0 ldi r31, 0x0F ; 15 - 3970: ef 22 and r14, r31 - 3972: 2e ef ldi r18, 0xFE ; 254 - 3974: 2e 0d add r18, r14 - uint8_t CollisionBitCount = (NVB >> 0) & 0x0f; - 3976: 9f 70 andi r25, 0x0F ; 15 - 3978: f9 2e mov r15, r25 - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - 397a: 88 e0 ldi r24, 0x08 ; 8 - 397c: 90 e0 ldi r25, 0x00 ; 0 - 397e: 8f 19 sub r24, r15 - 3980: 91 09 sbc r25, r1 - 3982: 4f ef ldi r20, 0xFF ; 255 - 3984: 50 e0 ldi r21, 0x00 ; 0 - 3986: 6a 01 movw r12, r20 - 3988: 02 c0 rjmp .+4 ; 0x398e - 398a: d5 94 asr r13 - 398c: c7 94 ror r12 - 398e: 8a 95 dec r24 - 3990: e2 f7 brpl .-8 ; 0x398a - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - 3992: 25 30 cpi r18, 0x05 ; 5 - 3994: 21 f0 breq .+8 ; 0x399e - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - 3996: 24 30 cpi r18, 0x04 ; 4 - 3998: 61 f5 brne .+88 ; 0x39f2 - 399a: ff 20 and r15, r15 - 399c: f1 f0 breq .+60 ; 0x39da - 399e: 44 e0 ldi r20, 0x04 ; 4 - 39a0: 50 e0 ldi r21, 0x00 ; 0 - 39a2: b8 01 movw r22, r16 - 39a4: 6e 5f subi r22, 0xFE ; 254 - 39a6: 7f 4f sbci r23, 0xFF ; 255 - 39a8: ce 01 movw r24, r28 - 39aa: 01 96 adiw r24, 0x01 ; 1 - 39ac: 2f 87 std Y+15, r18 ; 0x0f - 39ae: 0e 94 77 2a call 0x54ee ; 0x54ee - 39b2: 2f 85 ldd r18, Y+15 ; 0x0f - 39b4: 89 2b or r24, r25 - 39b6: 69 f4 brne .+26 ; 0x39d2 - 39b8: 9a 81 ldd r25, Y+2 ; 0x02 - 39ba: 8b 81 ldd r24, Y+3 ; 0x03 - 39bc: 89 27 eor r24, r25 - 39be: 98 e8 ldi r25, 0x88 ; 136 - 39c0: 89 27 eor r24, r25 - 39c2: 9c 81 ldd r25, Y+4 ; 0x04 - 39c4: 89 27 eor r24, r25 - 39c6: d8 01 movw r26, r16 - 39c8: 16 96 adiw r26, 0x06 ; 6 - 39ca: 9c 91 ld r25, X - 39cc: 89 27 eor r24, r25 - 39ce: 8c 21 and r24, r12 - 39d0: 81 f1 breq .+96 ; 0x3a32 - || - 39d2: 24 30 cpi r18, 0x04 ; 4 - 39d4: 71 f4 brne .+28 ; 0x39f2 - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - 39d6: f1 10 cpse r15, r1 - 39d8: 8d c1 rjmp .+794 ; 0x3cf4 - 39da: 44 e0 ldi r20, 0x04 ; 4 - 39dc: 50 e0 ldi r21, 0x00 ; 0 - 39de: b8 01 movw r22, r16 - 39e0: 6e 5f subi r22, 0xFE ; 254 - 39e2: 7f 4f sbci r23, 0xFF ; 255 - 39e4: ce 01 movw r24, r28 - 39e6: 01 96 adiw r24, 0x01 ; 1 - 39e8: 0e 94 77 2a call 0x54ee ; 0x54ee - 39ec: 89 2b or r24, r25 - 39ee: 09 f1 breq .+66 ; 0x3a32 - 39f0: 81 c1 rjmp .+770 ; 0x3cf4 - || - 39f2: 24 30 cpi r18, 0x04 ; 4 - 39f4: 08 f0 brcs .+2 ; 0x39f8 - 39f6: 7e c1 rjmp .+764 ; 0x3cf4 - (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask)) - 39f8: e2 2e mov r14, r18 - 39fa: f1 2c mov r15, r1 - 39fc: a7 01 movw r20, r14 - 39fe: b8 01 movw r22, r16 - 3a00: 6e 5f subi r22, 0xFE ; 254 - 3a02: 7f 4f sbci r23, 0xFF ; 255 - 3a04: ce 01 movw r24, r28 - 3a06: 01 96 adiw r24, 0x01 ; 1 - 3a08: 0e 94 77 2a call 0x54ee ; 0x54ee - 3a0c: 89 2b or r24, r25 - 3a0e: 09 f0 breq .+2 ; 0x3a12 - 3a10: 71 c1 rjmp .+738 ; 0x3cf4 - 3a12: d8 01 movw r26, r16 - 3a14: ae 0d add r26, r14 - 3a16: bf 1d adc r27, r15 - 3a18: e1 e0 ldi r30, 0x01 ; 1 - 3a1a: f0 e0 ldi r31, 0x00 ; 0 - 3a1c: ec 0f add r30, r28 - 3a1e: fd 1f adc r31, r29 - 3a20: ee 0d add r30, r14 - 3a22: ff 1d adc r31, r15 - 3a24: 12 96 adiw r26, 0x02 ; 2 - 3a26: 9c 91 ld r25, X - 3a28: 80 81 ld r24, Z - 3a2a: 89 27 eor r24, r25 - 3a2c: c8 22 and r12, r24 - 3a2e: 09 f0 breq .+2 ; 0x3a32 - 3a30: 61 c1 rjmp .+706 ; 0x3cf4 - ) - { - DataPtr[0] = UidCL[0]; - 3a32: 98 e8 ldi r25, 0x88 ; 136 - 3a34: f8 01 movw r30, r16 - 3a36: 90 83 st Z, r25 - DataPtr[1] = UidCL[1]; - 3a38: 3a 81 ldd r19, Y+2 ; 0x02 - 3a3a: 31 83 std Z+1, r19 ; 0x01 - DataPtr[2] = UidCL[2]; - 3a3c: 2b 81 ldd r18, Y+3 ; 0x03 - 3a3e: 22 83 std Z+2, r18 ; 0x02 - 3a40: 1e c1 rjmp .+572 ; 0x3c7e - } else { - MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 3a42: 44 e0 ldi r20, 0x04 ; 4 - 3a44: 50 e0 ldi r21, 0x00 ; 0 - 3a46: 60 e0 ldi r22, 0x00 ; 0 - 3a48: 70 e0 ldi r23, 0x00 ; 0 - 3a4a: ce 01 movw r24, r28 - 3a4c: 01 96 adiw r24, 0x01 ; 1 - 3a4e: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) - 3a52: 90 91 06 21 lds r25, 0x2106 ; 0x802106 - -INLINE -bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - uint8_t NVB = DataPtr[1]; - 3a56: d8 01 movw r26, r16 - 3a58: 11 96 adiw r26, 0x01 ; 1 - 3a5a: 8c 91 ld r24, X - //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; - //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; - - switch (NVB) { - 3a5c: 80 32 cpi r24, 0x20 ; 32 - 3a5e: 09 f4 brne .+2 ; 0x3a62 - 3a60: 07 c1 rjmp .+526 ; 0x3c70 - 3a62: 80 37 cpi r24, 0x70 ; 112 - 3a64: d9 f4 brne .+54 ; 0x3a9c - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 3a66: d8 01 movw r26, r16 - 3a68: 12 96 adiw r26, 0x02 ; 2 - 3a6a: 2c 91 ld r18, X - 3a6c: 12 97 sbiw r26, 0x02 ; 2 - 3a6e: 89 81 ldd r24, Y+1 ; 0x01 - 3a70: 28 13 cpse r18, r24 - 3a72: 40 c1 rjmp .+640 ; 0x3cf4 - 3a74: 13 96 adiw r26, 0x03 ; 3 - 3a76: 2c 91 ld r18, X - 3a78: 13 97 sbiw r26, 0x03 ; 3 - 3a7a: 8a 81 ldd r24, Y+2 ; 0x02 - 3a7c: 28 13 cpse r18, r24 - 3a7e: 3a c1 rjmp .+628 ; 0x3cf4 - (DataPtr[3] == UidCL[1]) && - 3a80: 14 96 adiw r26, 0x04 ; 4 - 3a82: 2c 91 ld r18, X - 3a84: 14 97 sbiw r26, 0x04 ; 4 - 3a86: 8b 81 ldd r24, Y+3 ; 0x03 - 3a88: 28 13 cpse r18, r24 - 3a8a: 34 c1 rjmp .+616 ; 0x3cf4 - (DataPtr[4] == UidCL[2]) && - 3a8c: 15 96 adiw r26, 0x05 ; 5 - 3a8e: 2c 91 ld r18, X - 3a90: 15 97 sbiw r26, 0x05 ; 5 - 3a92: 8c 81 ldd r24, Y+4 ; 0x04 - 3a94: 28 13 cpse r18, r24 - 3a96: 2e c1 rjmp .+604 ; 0x3cf4 - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 3a98: 9c 93 st X, r25 - 3a9a: b1 c0 rjmp .+354 ; 0x3bfe - *BitCount = 0; - return false; - } - default: - { - uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2; - 3a9c: e8 2e mov r14, r24 - 3a9e: e2 94 swap r14 - 3aa0: ef e0 ldi r30, 0x0F ; 15 - 3aa2: ee 22 and r14, r30 - 3aa4: 2e ef ldi r18, 0xFE ; 254 - 3aa6: 2e 0d add r18, r14 - uint8_t CollisionBitCount = (NVB >> 0) & 0x0f; - 3aa8: 8f 70 andi r24, 0x0F ; 15 - 3aaa: f8 2e mov r15, r24 - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - 3aac: 88 e0 ldi r24, 0x08 ; 8 - 3aae: 90 e0 ldi r25, 0x00 ; 0 - 3ab0: 8f 19 sub r24, r15 - 3ab2: 91 09 sbc r25, r1 - 3ab4: 4f ef ldi r20, 0xFF ; 255 - 3ab6: 50 e0 ldi r21, 0x00 ; 0 - 3ab8: 6a 01 movw r12, r20 - 3aba: 02 c0 rjmp .+4 ; 0x3ac0 - 3abc: d5 94 asr r13 - 3abe: c7 94 ror r12 - 3ac0: 8a 95 dec r24 - 3ac2: e2 f7 brpl .-8 ; 0x3abc - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - 3ac4: 25 30 cpi r18, 0x05 ; 5 - 3ac6: 21 f0 breq .+8 ; 0x3ad0 - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - 3ac8: 24 30 cpi r18, 0x04 ; 4 - 3aca: 69 f5 brne .+90 ; 0x3b26 - 3acc: ff 20 and r15, r15 - 3ace: f1 f0 breq .+60 ; 0x3b0c - 3ad0: 44 e0 ldi r20, 0x04 ; 4 - 3ad2: 50 e0 ldi r21, 0x00 ; 0 - 3ad4: b8 01 movw r22, r16 - 3ad6: 6e 5f subi r22, 0xFE ; 254 - 3ad8: 7f 4f sbci r23, 0xFF ; 255 - 3ada: ce 01 movw r24, r28 - 3adc: 01 96 adiw r24, 0x01 ; 1 - 3ade: 2f 87 std Y+15, r18 ; 0x0f - 3ae0: 0e 94 77 2a call 0x54ee ; 0x54ee - 3ae4: 2f 85 ldd r18, Y+15 ; 0x0f - 3ae6: 89 2b or r24, r25 - 3ae8: 69 f4 brne .+26 ; 0x3b04 - 3aea: 9a 81 ldd r25, Y+2 ; 0x02 - 3aec: 89 81 ldd r24, Y+1 ; 0x01 - 3aee: 89 27 eor r24, r25 - 3af0: 9b 81 ldd r25, Y+3 ; 0x03 - 3af2: 89 27 eor r24, r25 - 3af4: 9c 81 ldd r25, Y+4 ; 0x04 - 3af6: 89 27 eor r24, r25 - 3af8: f8 01 movw r30, r16 - 3afa: 96 81 ldd r25, Z+6 ; 0x06 - 3afc: 89 27 eor r24, r25 - 3afe: 8c 21 and r24, r12 - 3b00: 09 f4 brne .+2 ; 0x3b04 - 3b02: 54 c0 rjmp .+168 ; 0x3bac - || - 3b04: 24 30 cpi r18, 0x04 ; 4 - 3b06: 79 f4 brne .+30 ; 0x3b26 - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - 3b08: f1 10 cpse r15, r1 - 3b0a: f4 c0 rjmp .+488 ; 0x3cf4 - 3b0c: 44 e0 ldi r20, 0x04 ; 4 - 3b0e: 50 e0 ldi r21, 0x00 ; 0 - 3b10: b8 01 movw r22, r16 - 3b12: 6e 5f subi r22, 0xFE ; 254 - 3b14: 7f 4f sbci r23, 0xFF ; 255 - 3b16: ce 01 movw r24, r28 - 3b18: 01 96 adiw r24, 0x01 ; 1 - 3b1a: 0e 94 77 2a call 0x54ee ; 0x54ee - 3b1e: 89 2b or r24, r25 - 3b20: 09 f4 brne .+2 ; 0x3b24 - 3b22: 44 c0 rjmp .+136 ; 0x3bac - 3b24: e7 c0 rjmp .+462 ; 0x3cf4 - || - 3b26: 24 30 cpi r18, 0x04 ; 4 - 3b28: 08 f0 brcs .+2 ; 0x3b2c - 3b2a: e4 c0 rjmp .+456 ; 0x3cf4 - (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask)) - 3b2c: e2 2e mov r14, r18 - 3b2e: f1 2c mov r15, r1 - 3b30: a7 01 movw r20, r14 - 3b32: b8 01 movw r22, r16 - 3b34: 6e 5f subi r22, 0xFE ; 254 - 3b36: 7f 4f sbci r23, 0xFF ; 255 - 3b38: ce 01 movw r24, r28 - 3b3a: 01 96 adiw r24, 0x01 ; 1 - 3b3c: 0e 94 77 2a call 0x54ee ; 0x54ee - 3b40: 89 2b or r24, r25 - 3b42: 09 f0 breq .+2 ; 0x3b46 - 3b44: d7 c0 rjmp .+430 ; 0x3cf4 - 3b46: d8 01 movw r26, r16 - 3b48: ae 0d add r26, r14 - 3b4a: bf 1d adc r27, r15 - 3b4c: e1 e0 ldi r30, 0x01 ; 1 - 3b4e: f0 e0 ldi r31, 0x00 ; 0 - 3b50: ec 0f add r30, r28 - 3b52: fd 1f adc r31, r29 - 3b54: ee 0d add r30, r14 - 3b56: ff 1d adc r31, r15 - 3b58: 12 96 adiw r26, 0x02 ; 2 - 3b5a: 9c 91 ld r25, X - 3b5c: 80 81 ld r24, Z - 3b5e: 89 27 eor r24, r25 - 3b60: c8 22 and r12, r24 - 3b62: 09 f0 breq .+2 ; 0x3b66 - 3b64: c7 c0 rjmp .+398 ; 0x3cf4 - 3b66: 22 c0 rjmp .+68 ; 0x3bac - - case STATE_ACTIVE: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) { - State = STATE_READY1; - return BitCount; - } else if (Buffer[0] == CMD_HALT) { - 3b68: 80 35 cpi r24, 0x50 ; 80 - 3b6a: 09 f0 breq .+2 ; 0x3b6e - 3b6c: c6 c0 rjmp .+396 ; 0x3cfa - /* Halts the tag. According to the ISO14443, the second - * byte is supposed to be 0. */ - if (Buffer[1] == 0) { - 3b6e: d8 01 movw r26, r16 - 3b70: 11 96 adiw r26, 0x01 ; 1 - 3b72: 8c 91 ld r24, X - 3b74: 81 11 cpse r24, r1 - 3b76: ce c0 rjmp .+412 ; 0x3d14 - if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { - 3b78: 62 e0 ldi r22, 0x02 ; 2 - 3b7a: 70 e0 ldi r23, 0x00 ; 0 - 3b7c: c8 01 movw r24, r16 - 3b7e: c1 d1 rcall .+898 ; 0x3f02 - 3b80: 88 23 and r24, r24 - 3b82: 09 f4 brne .+2 ; 0x3b86 - 3b84: c5 c0 rjmp .+394 ; 0x3d10 - } - - return BitCount; - } else { - /* Unknown command. Enter HALT state. */ - State = STATE_HALT; - 3b86: 10 92 22 21 sts 0x2122, r1 ; 0x802122 - 3b8a: b4 c0 rjmp .+360 ; 0x3cf4 - - case STATE_READY2: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) { - State = STATE_READY1; - return BitCount; - } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL2) { - 3b8c: 85 39 cpi r24, 0x95 ; 149 - 3b8e: d9 f7 brne .-10 ; 0x3b86 - /* Load UID CL2 and perform anticollision */ - uint8_t UidCL2[ISO14443A_CL_UID_SIZE]; - MemoryReadBlock(UidCL2, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - 3b90: 44 e0 ldi r20, 0x04 ; 4 - 3b92: 50 e0 ldi r21, 0x00 ; 0 - 3b94: 63 e0 ldi r22, 0x03 ; 3 - 3b96: 70 e0 ldi r23, 0x00 ; 0 - 3b98: ce 01 movw r24, r28 - 3b9a: 01 96 adiw r24, 0x01 ; 1 - 3b9c: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - - if (ISO14443ASelect(Buffer, &BitCount, UidCL2, CardSAKValue)) { - 3ba0: 90 91 06 21 lds r25, 0x2106 ; 0x802106 - -INLINE -bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - uint8_t NVB = DataPtr[1]; - 3ba4: f8 01 movw r30, r16 - 3ba6: 81 81 ldd r24, Z+1 ; 0x01 - //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; - //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; - - switch (NVB) { - 3ba8: 80 32 cpi r24, 0x20 ; 32 - 3baa: a9 f4 brne .+42 ; 0x3bd6 - case ISO14443A_NVB_AC_START: - /* Start of anticollision procedure. - * Send whole UID CLn + BCC */ - DataPtr[0] = UidCL[0]; - 3bac: 29 81 ldd r18, Y+1 ; 0x01 - 3bae: d8 01 movw r26, r16 - 3bb0: 2c 93 st X, r18 - DataPtr[1] = UidCL[1]; - 3bb2: 3a 81 ldd r19, Y+2 ; 0x02 - 3bb4: 11 96 adiw r26, 0x01 ; 1 - 3bb6: 3c 93 st X, r19 - 3bb8: 11 97 sbiw r26, 0x01 ; 1 - DataPtr[2] = UidCL[2]; - 3bba: 9b 81 ldd r25, Y+3 ; 0x03 - 3bbc: 12 96 adiw r26, 0x02 ; 2 - 3bbe: 9c 93 st X, r25 - 3bc0: 12 97 sbiw r26, 0x02 ; 2 - DataPtr[3] = UidCL[3]; - 3bc2: 8c 81 ldd r24, Y+4 ; 0x04 - 3bc4: 13 96 adiw r26, 0x03 ; 3 - 3bc6: 8c 93 st X, r24 - 3bc8: 13 97 sbiw r26, 0x03 ; 3 - DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 3bca: 23 27 eor r18, r19 - 3bcc: 92 27 eor r25, r18 - 3bce: 89 27 eor r24, r25 - 3bd0: 14 96 adiw r26, 0x04 ; 4 - 3bd2: 8c 93 st X, r24 - 3bd4: 5a c0 rjmp .+180 ; 0x3c8a - 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) { - 3bd6: 80 37 cpi r24, 0x70 ; 112 - 3bd8: d9 f4 brne .+54 ; 0x3c10 - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 3bda: f8 01 movw r30, r16 - 3bdc: 22 81 ldd r18, Z+2 ; 0x02 - 3bde: 89 81 ldd r24, Y+1 ; 0x01 - 3be0: 28 13 cpse r18, r24 - 3be2: 88 c0 rjmp .+272 ; 0x3cf4 - 3be4: 23 81 ldd r18, Z+3 ; 0x03 - 3be6: 8a 81 ldd r24, Y+2 ; 0x02 - 3be8: 28 13 cpse r18, r24 - 3bea: 84 c0 rjmp .+264 ; 0x3cf4 - (DataPtr[3] == UidCL[1]) && - 3bec: 24 81 ldd r18, Z+4 ; 0x04 - 3bee: 8b 81 ldd r24, Y+3 ; 0x03 - 3bf0: 28 13 cpse r18, r24 - 3bf2: 80 c0 rjmp .+256 ; 0x3cf4 - (DataPtr[4] == UidCL[2]) && - 3bf4: 25 81 ldd r18, Z+5 ; 0x05 - 3bf6: 8c 81 ldd r24, Y+4 ; 0x04 - 3bf8: 28 13 cpse r18, r24 - 3bfa: 7c c0 rjmp .+248 ; 0x3cf4 - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 3bfc: 90 83 st Z, r25 - ISO14443AAppendCRCA(Buffer, 1); - 3bfe: 61 e0 ldi r22, 0x01 ; 1 - 3c00: 70 e0 ldi r23, 0x00 ; 0 - 3c02: c8 01 movw r24, r16 - 3c04: 53 d1 rcall .+678 ; 0x3eac - State = STATE_ACTIVE; - 3c06: 86 e0 ldi r24, 0x06 ; 6 - 3c08: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - 3c0c: 88 e1 ldi r24, 0x18 ; 24 - 3c0e: 73 c0 rjmp .+230 ; 0x3cf6 - *BitCount = 0; - return false; - } - default: - { - uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2; - 3c10: e8 2e mov r14, r24 - 3c12: e2 94 swap r14 - 3c14: 7f e0 ldi r23, 0x0F ; 15 - 3c16: e7 22 and r14, r23 - 3c18: 2e ef ldi r18, 0xFE ; 254 - 3c1a: 2e 0d add r18, r14 - uint8_t CollisionBitCount = (NVB >> 0) & 0x0f; - 3c1c: 8f 70 andi r24, 0x0F ; 15 - 3c1e: f8 2e mov r15, r24 - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - 3c20: 88 e0 ldi r24, 0x08 ; 8 - 3c22: 90 e0 ldi r25, 0x00 ; 0 - 3c24: 8f 19 sub r24, r15 - 3c26: 91 09 sbc r25, r1 - 3c28: 4f ef ldi r20, 0xFF ; 255 - 3c2a: 50 e0 ldi r21, 0x00 ; 0 - 3c2c: 6a 01 movw r12, r20 - 3c2e: 02 c0 rjmp .+4 ; 0x3c34 - 3c30: d5 94 asr r13 - 3c32: c7 94 ror r12 - 3c34: 8a 95 dec r24 - 3c36: e2 f7 brpl .-8 ; 0x3c30 - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - 3c38: 25 30 cpi r18, 0x05 ; 5 - 3c3a: 49 f5 brne .+82 ; 0x3c8e - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - 3c3c: 44 e0 ldi r20, 0x04 ; 4 - 3c3e: 50 e0 ldi r21, 0x00 ; 0 - 3c40: b8 01 movw r22, r16 - 3c42: 6e 5f subi r22, 0xFE ; 254 - 3c44: 7f 4f sbci r23, 0xFF ; 255 - 3c46: ce 01 movw r24, r28 - 3c48: 01 96 adiw r24, 0x01 ; 1 - 3c4a: 2f 87 std Y+15, r18 ; 0x0f - 3c4c: 0e 94 77 2a call 0x54ee ; 0x54ee - 3c50: 2f 85 ldd r18, Y+15 ; 0x0f - 3c52: 89 2b or r24, r25 - 3c54: 09 f5 brne .+66 ; 0x3c98 - 3c56: 9a 81 ldd r25, Y+2 ; 0x02 - 3c58: 89 81 ldd r24, Y+1 ; 0x01 - 3c5a: 89 27 eor r24, r25 - 3c5c: 9b 81 ldd r25, Y+3 ; 0x03 - 3c5e: 89 27 eor r24, r25 - 3c60: 9c 81 ldd r25, Y+4 ; 0x04 - 3c62: 89 27 eor r24, r25 - 3c64: d8 01 movw r26, r16 - 3c66: 16 96 adiw r26, 0x06 ; 6 - 3c68: 9c 91 ld r25, X - 3c6a: 89 27 eor r24, r25 - 3c6c: 8c 21 and r24, r12 - 3c6e: a1 f4 brne .+40 ; 0x3c98 - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - || - (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask)) - ) - { - DataPtr[0] = UidCL[0]; - 3c70: 29 81 ldd r18, Y+1 ; 0x01 - 3c72: f8 01 movw r30, r16 - 3c74: 20 83 st Z, r18 - DataPtr[1] = UidCL[1]; - 3c76: 3a 81 ldd r19, Y+2 ; 0x02 - 3c78: 31 83 std Z+1, r19 ; 0x01 - DataPtr[2] = UidCL[2]; - 3c7a: 9b 81 ldd r25, Y+3 ; 0x03 - 3c7c: 92 83 std Z+2, r25 ; 0x02 - DataPtr[3] = UidCL[3]; - 3c7e: 8c 81 ldd r24, Y+4 ; 0x04 - 3c80: 83 83 std Z+3, r24 ; 0x03 - DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 3c82: 23 27 eor r18, r19 - 3c84: 92 27 eor r25, r18 - 3c86: 89 27 eor r24, r25 - 3c88: 84 83 std Z+4, r24 ; 0x04 - - *BitCount = ISO14443A_CL_FRAME_SIZE; - 3c8a: 88 e2 ldi r24, 0x28 ; 40 - 3c8c: 34 c0 rjmp .+104 ; 0x3cf6 - uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2; - uint8_t CollisionBitCount = (NVB >> 0) & 0x0f; - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - 3c8e: 24 30 cpi r18, 0x04 ; 4 - 3c90: 99 f4 brne .+38 ; 0x3cb8 - 3c92: ff 20 and r15, r15 - 3c94: 29 f0 breq .+10 ; 0x3ca0 - 3c96: d2 cf rjmp .-92 ; 0x3c3c - || - 3c98: 24 30 cpi r18, 0x04 ; 4 - 3c9a: 71 f4 brne .+28 ; 0x3cb8 - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - 3c9c: f1 10 cpse r15, r1 - 3c9e: 2a c0 rjmp .+84 ; 0x3cf4 - 3ca0: 44 e0 ldi r20, 0x04 ; 4 - 3ca2: 50 e0 ldi r21, 0x00 ; 0 - 3ca4: b8 01 movw r22, r16 - 3ca6: 6e 5f subi r22, 0xFE ; 254 - 3ca8: 7f 4f sbci r23, 0xFF ; 255 - 3caa: ce 01 movw r24, r28 - 3cac: 01 96 adiw r24, 0x01 ; 1 - 3cae: 0e 94 77 2a call 0x54ee ; 0x54ee - 3cb2: 89 2b or r24, r25 - 3cb4: e9 f2 breq .-70 ; 0x3c70 - 3cb6: 1e c0 rjmp .+60 ; 0x3cf4 - || - 3cb8: 24 30 cpi r18, 0x04 ; 4 - 3cba: e0 f4 brcc .+56 ; 0x3cf4 - (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask)) - 3cbc: e2 2e mov r14, r18 - 3cbe: f1 2c mov r15, r1 - 3cc0: a7 01 movw r20, r14 - 3cc2: b8 01 movw r22, r16 - 3cc4: 6e 5f subi r22, 0xFE ; 254 - 3cc6: 7f 4f sbci r23, 0xFF ; 255 - 3cc8: ce 01 movw r24, r28 - 3cca: 01 96 adiw r24, 0x01 ; 1 - 3ccc: 0e 94 77 2a call 0x54ee ; 0x54ee - 3cd0: 89 2b or r24, r25 - 3cd2: 81 f4 brne .+32 ; 0x3cf4 - 3cd4: d8 01 movw r26, r16 - 3cd6: ae 0d add r26, r14 - 3cd8: bf 1d adc r27, r15 - 3cda: e1 e0 ldi r30, 0x01 ; 1 - 3cdc: f0 e0 ldi r31, 0x00 ; 0 - 3cde: ec 0f add r30, r28 - 3ce0: fd 1f adc r31, r29 - 3ce2: ee 0d add r30, r14 - 3ce4: ff 1d adc r31, r15 - 3ce6: 12 96 adiw r26, 0x02 ; 2 - 3ce8: 9c 91 ld r25, X - 3cea: 80 81 ld r24, Z - 3cec: 89 27 eor r24, r25 - 3cee: c8 22 and r12, r24 - 3cf0: 09 f4 brne .+2 ; 0x3cf4 - 3cf2: be cf rjmp .-132 ; 0x3c70 - - *BitCount = ISO14443A_SAK_FRAME_SIZE; - return true; - } else { - /* We have not been selected. Don't send anything. */ - *BitCount = 0; - 3cf4: 80 e0 ldi r24, 0x00 ; 0 - 3cf6: 90 e0 ldi r25, 0x00 ; 0 - 3cf8: 85 c0 rjmp .+266 ; 0x3e04 - } - } else { - Buffer[0] = NAK_INVALID_ARG; - return ACK_NAK_FRAME_SIZE; - } - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { - 3cfa: 90 ea ldi r25, 0xA0 ; 160 - 3cfc: 98 0f add r25, r24 - 3cfe: 92 30 cpi r25, 0x02 ; 2 - 3d00: 08 f0 brcs .+2 ; 0x3d04 - 3d02: 64 c0 rjmp .+200 ; 0x3dcc - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 3d04: 62 e0 ldi r22, 0x02 ; 2 - 3d06: 70 e0 ldi r23, 0x00 ; 0 - 3d08: c8 01 movw r24, r16 - 3d0a: fb d0 rcall .+502 ; 0x3f02 - 3d0c: 81 11 cpse r24, r1 - 3d0e: 05 c0 rjmp .+10 ; 0x3d1a - /* According to ISO14443, we must not send anything - * in order to acknowledge the HALT command. */ - State = STATE_HALT; - return ISO14443A_APP_NO_RESPONSE; - } else { - Buffer[0] = NAK_CRC_ERROR; - 3d10: 81 e0 ldi r24, 0x01 ; 1 - 3d12: 49 cc rjmp .-1902 ; 0x35a6 - return ACK_NAK_FRAME_SIZE; - } - } else { - Buffer[0] = NAK_INVALID_ARG; - 3d14: d8 01 movw r26, r16 - 3d16: 1c 92 st X, r1 - 3d18: 36 cd rjmp .-1428 ; 0x3786 - 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; - 3d1a: f8 01 movw r30, r16 - 3d1c: 81 81 ldd r24, Z+1 ; 0x01 - 3d1e: 8c 73 andi r24, 0x3C ; 60 - uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 3d20: 90 81 ld r25, Z - 3d22: 90 36 cpi r25, 0x60 ; 96 - 3d24: 11 f0 breq .+4 ; 0x3d2a - 3d26: 9a e3 ldi r25, 0x3A ; 58 - 3d28: 01 c0 rjmp .+2 ; 0x3d2c - 3d2a: 90 e3 ldi r25, 0x30 ; 48 - uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; - 3d2c: f0 e1 ldi r31, 0x10 ; 16 - 3d2e: 8f 9f mul r24, r31 - 3d30: 70 01 movw r14, r0 - 3d32: 11 24 eor r1, r1 - 3d34: e9 0e add r14, r25 - 3d36: f1 1c adc r15, r1 - uint8_t Key[6]; - uint8_t Uid[4]; - uint8_t CardNonce[4]={0x01,0x20,0x01,0x45}; - 3d38: 81 e0 ldi r24, 0x01 ; 1 - 3d3a: 8f 83 std Y+7, r24 ; 0x07 - 3d3c: 90 e2 ldi r25, 0x20 ; 32 - 3d3e: 98 87 std Y+8, r25 ; 0x08 - 3d40: 89 87 std Y+9, r24 ; 0x09 - 3d42: 85 e4 ldi r24, 0x45 ; 69 - 3d44: 8a 87 std Y+10, r24 ; 0x0a - uint8_t CardNonceSuccessor1[4]={0x63, 0xe5, 0xbc, 0xa7}; - uint8_t CardNonceSuccessor2[4]={0x99, 0x37, 0x30, 0xbd}; - - /* Generate a random nonce and read UID and key from memory */ - //RandomGetBuffer(CardNonce, sizeof(CardNonce)); - if (_7BUID) - 3d46: 80 91 05 21 lds r24, 0x2105 ; 0x802105 <_7BUID> - MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - 3d4a: 44 e0 ldi r20, 0x04 ; 4 - 3d4c: 50 e0 ldi r21, 0x00 ; 0 - uint8_t CardNonceSuccessor1[4]={0x63, 0xe5, 0xbc, 0xa7}; - uint8_t CardNonceSuccessor2[4]={0x99, 0x37, 0x30, 0xbd}; - - /* Generate a random nonce and read UID and key from memory */ - //RandomGetBuffer(CardNonce, sizeof(CardNonce)); - if (_7BUID) - 3d4e: 88 23 and r24, r24 - 3d50: 19 f0 breq .+6 ; 0x3d58 - MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - 3d52: 63 e0 ldi r22, 0x03 ; 3 - 3d54: 70 e0 ldi r23, 0x00 ; 0 - 3d56: 02 c0 rjmp .+4 ; 0x3d5c - else - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 3d58: 60 e0 ldi r22, 0x00 ; 0 - 3d5a: 70 e0 ldi r23, 0x00 ; 0 - 3d5c: ce 01 movw r24, r28 - 3d5e: 0b 96 adiw r24, 0x0b ; 11 - 3d60: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); - 3d64: 46 e0 ldi r20, 0x06 ; 6 - 3d66: 50 e0 ldi r21, 0x00 ; 0 - 3d68: b7 01 movw r22, r14 - 3d6a: ce 01 movw r24, r28 - 3d6c: 01 96 adiw r24, 0x01 ; 1 - 3d6e: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - - /* Precalculate the reader response from card-nonce */ - memcpy(ReaderResponse,CardNonceSuccessor1,4); - 3d72: 83 e6 ldi r24, 0x63 ; 99 - 3d74: 80 93 1a 21 sts 0x211A, r24 ; 0x80211a - 3d78: 85 ee ldi r24, 0xE5 ; 229 - 3d7a: 80 93 1b 21 sts 0x211B, r24 ; 0x80211b - 3d7e: 8c eb ldi r24, 0xBC ; 188 - 3d80: 80 93 1c 21 sts 0x211C, r24 ; 0x80211c - 3d84: 87 ea ldi r24, 0xA7 ; 167 - 3d86: 80 93 1d 21 sts 0x211D, r24 ; 0x80211d - - /* Precalculate our response from the reader response */ - memcpy(CardResponse,CardNonceSuccessor2,4); - 3d8a: 89 e9 ldi r24, 0x99 ; 153 - 3d8c: 80 93 1e 21 sts 0x211E, r24 ; 0x80211e - 3d90: 87 e3 ldi r24, 0x37 ; 55 - 3d92: 80 93 1f 21 sts 0x211F, r24 ; 0x80211f - 3d96: 80 e3 ldi r24, 0x30 ; 48 - 3d98: 80 93 20 21 sts 0x2120, r24 ; 0x802120 - 3d9c: 8d eb ldi r24, 0xBD ; 189 - 3d9e: 80 93 21 21 sts 0x2121, r24 ; 0x802121 - - /* Respond with the random card nonce and expect further authentication - * form the reader in the next frame. */ - State = STATE_AUTHING; - 3da2: 87 e0 ldi r24, 0x07 ; 7 - 3da4: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - 3da8: ae 01 movw r20, r28 - 3daa: 49 5f subi r20, 0xF9 ; 249 - 3dac: 5f 4f sbci r21, 0xFF ; 255 - 3dae: d8 01 movw r26, r16 - 3db0: fa 01 movw r30, r20 - 3db2: 84 e0 ldi r24, 0x04 ; 4 - 3db4: 84 0f add r24, r20 - - for (uint8_t i=0; i - Buffer[i] = CardNonce[i]; - - /* Setup crypto1 cipher. Discard in-place encrypted CardNonce. */ - Crypto1Setup(Key, Uid, CardNonce); - 3dbe: be 01 movw r22, r28 - 3dc0: 65 5f subi r22, 0xF5 ; 245 - 3dc2: 7f 4f sbci r23, 0xFF ; 255 - 3dc4: ce 01 movw r24, r28 - 3dc6: 01 96 adiw r24, 0x01 ; 1 - 3dc8: e6 d0 rcall .+460 ; 0x3f96 - 3dca: ac cc rjmp .-1704 ; 0x3724 - 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) - 3dcc: 98 2f mov r25, r24 - 3dce: 9f 77 andi r25, 0x7F ; 127 - 3dd0: 90 33 cpi r25, 0x30 ; 48 - 3dd2: 31 f0 breq .+12 ; 0x3de0 - 3dd4: 80 3a cpi r24, 0xA0 ; 160 - 3dd6: 21 f0 breq .+8 ; 0x3de0 - 3dd8: 80 5c subi r24, 0xC0 ; 192 - 3dda: 83 30 cpi r24, 0x03 ; 3 - 3ddc: 08 f0 brcs .+2 ; 0x3de0 - 3dde: 45 cb rjmp .-2422 ; 0x346a - || (Buffer[0] == CMD_INCREMENT) || (Buffer[0] == CMD_RESTORE) || (Buffer[0] == CMD_TRANSFER) ) { - State = STATE_IDLE; - 3de0: 81 e0 ldi r24, 0x01 ; 1 - 3de2: 80 93 22 21 sts 0x2122, r24 ; 0x802122 - Buffer[0] = NAK_NOT_AUTHED; - 3de6: 84 e0 ldi r24, 0x04 ; 4 - 3de8: d8 01 movw r26, r16 - 3dea: 8c 93 st X, r24 - 3dec: 84 cf rjmp .-248 ; 0x3cf6 - 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(); - 3dee: 8e d1 rcall .+796 ; 0x410c - 3df0: 96 e0 ldi r25, 0x06 ; 6 - 3df2: c3 cc rjmp .-1658 ; 0x377a - ValueFromBlock(&ParamValue, Buffer); - ValueFromBlock(&BlockValue, BlockBuffer); - - if (State == STATE_DECREMENT) { - BlockValue -= ParamValue; - } else if (State == STATE_INCREMENT) { - 3df4: 2a 30 cpi r18, 0x0A ; 10 - 3df6: 09 f0 breq .+2 ; 0x3dfa - 3df8: 46 cd rjmp .-1396 ; 0x3886 - BlockValue += ParamValue; - 3dfa: 84 0f add r24, r20 - 3dfc: 95 1f adc r25, r21 - 3dfe: a6 1f adc r26, r22 - 3e00: b7 1f adc r27, r23 - 3e02: 41 cd rjmp .-1406 ; 0x3886 - break; - } - - /* No response has been sent, when we reach here */ - return ISO14443A_APP_NO_RESPONSE; -} - 3e04: 2f 96 adiw r28, 0x0f ; 15 - 3e06: cd bf out 0x3d, r28 ; 61 - 3e08: de bf out 0x3e, r29 ; 62 - 3e0a: df 91 pop r29 - 3e0c: cf 91 pop r28 - 3e0e: 1f 91 pop r17 - 3e10: 0f 91 pop r16 - 3e12: ff 90 pop r15 - 3e14: ef 90 pop r14 - 3e16: df 90 pop r13 - 3e18: cf 90 pop r12 - 3e1a: bf 90 pop r11 - 3e1c: af 90 pop r10 - 3e1e: 08 95 ret - -00003e20 : - -void MifareClassicGetUid(ConfigurationUidType Uid) -{ - 3e20: cf 93 push r28 - 3e22: df 93 push r29 - if (_7BUID) { - 3e24: 20 91 05 21 lds r18, 0x2105 ; 0x802105 <_7BUID> - 3e28: 22 23 and r18, r18 - 3e2a: 71 f0 breq .+28 ; 0x3e48 - 3e2c: ec 01 movw r28, r24 - //Uid[0]=0x88; - MemoryReadBlock(&Uid[0], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); - 3e2e: 43 e0 ldi r20, 0x03 ; 3 - 3e30: 50 e0 ldi r21, 0x00 ; 0 - 3e32: 60 e0 ldi r22, 0x00 ; 0 - 3e34: 70 e0 ldi r23, 0x00 ; 0 - 3e36: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - MemoryReadBlock(&Uid[3], MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - 3e3a: 44 e0 ldi r20, 0x04 ; 4 - 3e3c: 50 e0 ldi r21, 0x00 ; 0 - 3e3e: 63 e0 ldi r22, 0x03 ; 3 - 3e40: 70 e0 ldi r23, 0x00 ; 0 - 3e42: ce 01 movw r24, r28 - 3e44: 03 96 adiw r24, 0x03 ; 3 - 3e46: 04 c0 rjmp .+8 ; 0x3e50 - } - else - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 3e48: 44 e0 ldi r20, 0x04 ; 4 - 3e4a: 50 e0 ldi r21, 0x00 ; 0 - 3e4c: 60 e0 ldi r22, 0x00 ; 0 - 3e4e: 70 e0 ldi r23, 0x00 ; 0 -} - 3e50: df 91 pop r29 - 3e52: cf 91 pop r28 - //Uid[0]=0x88; - MemoryReadBlock(&Uid[0], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); - MemoryReadBlock(&Uid[3], MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); - } - else - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 3e54: 0c 94 7c 08 jmp 0x10f8 ; 0x10f8 - -00003e58 : -} - -void MifareClassicSetUid(ConfigurationUidType Uid) -{ - 3e58: cf 93 push r28 - 3e5a: df 93 push r29 - 3e5c: 1f 92 push r1 - 3e5e: cd b7 in r28, 0x3d ; 61 - 3e60: de b7 in r29, 0x3e ; 62 - if (_7BUID) { - 3e62: 20 91 05 21 lds r18, 0x2105 ; 0x802105 <_7BUID> - 3e66: 22 23 and r18, r18 - 3e68: 31 f0 breq .+12 ; 0x3e76 - //Uid[0]=0x88; - MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, ActiveConfiguration.UidSize); - 3e6a: 40 91 50 21 lds r20, 0x2150 ; 0x802150 - 3e6e: 50 e0 ldi r21, 0x00 ; 0 - 3e70: 60 e0 ldi r22, 0x00 ; 0 - 3e72: 70 e0 ldi r23, 0x00 ; 0 - 3e74: 15 c0 rjmp .+42 ; 0x3ea0 - } - else { - uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; - 3e76: fc 01 movw r30, r24 - 3e78: 31 81 ldd r19, Z+1 ; 0x01 - 3e7a: 20 81 ld r18, Z - 3e7c: 23 27 eor r18, r19 - 3e7e: 32 81 ldd r19, Z+2 ; 0x02 - 3e80: 23 27 eor r18, r19 - 3e82: 33 81 ldd r19, Z+3 ; 0x03 - 3e84: 23 27 eor r18, r19 - 3e86: 29 83 std Y+1, r18 ; 0x01 - - MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 3e88: 44 e0 ldi r20, 0x04 ; 4 - 3e8a: 50 e0 ldi r21, 0x00 ; 0 - 3e8c: 60 e0 ldi r22, 0x00 ; 0 - 3e8e: 70 e0 ldi r23, 0x00 ; 0 - 3e90: 0e 94 07 09 call 0x120e ; 0x120e - MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); - 3e94: 41 e0 ldi r20, 0x01 ; 1 - 3e96: 50 e0 ldi r21, 0x00 ; 0 - 3e98: 64 e0 ldi r22, 0x04 ; 4 - 3e9a: 70 e0 ldi r23, 0x00 ; 0 - 3e9c: ce 01 movw r24, r28 - 3e9e: 01 96 adiw r24, 0x01 ; 1 - 3ea0: 0e 94 07 09 call 0x120e ; 0x120e - } -} - 3ea4: 0f 90 pop r0 - 3ea6: df 91 pop r29 - 3ea8: cf 91 pop r28 - 3eaa: 08 95 ret - -00003eac : -#ifdef USE_HW_CRC -void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - CRC.CTRL = CRC_RESET0_bm; - 3eac: 20 e4 ldi r18, 0x40 ; 64 - 3eae: 20 93 d0 00 sts 0x00D0, r18 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7000d0> - CRC.CHECKSUM1 = (CRC_INIT_R >> 8) & 0xFF; - 3eb2: 26 ec ldi r18, 0xC6 ; 198 - 3eb4: 20 93 d5 00 sts 0x00D5, r18 ; 0x8000d5 <__TEXT_REGION_LENGTH__+0x7000d5> - CRC.CHECKSUM0 = (CRC_INIT_R >> 0) & 0xFF; - 3eb8: 20 93 d4 00 sts 0x00D4, r18 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7000d4> - CRC.CTRL = CRC_SOURCE_IO_gc; - 3ebc: 21 e0 ldi r18, 0x01 ; 1 - 3ebe: 20 93 d0 00 sts 0x00D0, r18 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7000d0> - 3ec2: dc 01 movw r26, r24 - 3ec4: 68 0f add r22, r24 - 3ec6: 79 1f adc r23, r25 - - while(ByteCount--) { - 3ec8: a6 17 cp r26, r22 - 3eca: b7 07 cpc r27, r23 - 3ecc: 41 f0 breq .+16 ; 0x3ede - uint8_t Byte = *DataPtr++; - 3ece: ed 91 ld r30, X+ - -INLINE uint8_t BitReverseByte(uint8_t Byte) -{ - extern const uint8_t PROGMEM BitReverseByteTable[]; - - return pgm_read_byte(&BitReverseByteTable[Byte]); - 3ed0: f0 e0 ldi r31, 0x00 ; 0 - 3ed2: e9 5e subi r30, 0xE9 ; 233 - 3ed4: fa 4f sbci r31, 0xFA ; 250 - 3ed6: e4 91 lpm r30, Z - Byte = BitReverseByte(Byte); - - CRC.DATAIN = Byte; - 3ed8: e0 93 d3 00 sts 0x00D3, r30 ; 0x8000d3 <__TEXT_REGION_LENGTH__+0x7000d3> - 3edc: f5 cf rjmp .-22 ; 0x3ec8 - } - - DataPtr[0] = BitReverseByte(CRC.CHECKSUM1); - 3ede: e0 91 d5 00 lds r30, 0x00D5 ; 0x8000d5 <__TEXT_REGION_LENGTH__+0x7000d5> - 3ee2: f0 e0 ldi r31, 0x00 ; 0 - 3ee4: e9 5e subi r30, 0xE9 ; 233 - 3ee6: fa 4f sbci r31, 0xFA ; 250 - 3ee8: e4 91 lpm r30, Z - 3eea: ec 93 st X, r30 - DataPtr[1] = BitReverseByte(CRC.CHECKSUM0); - 3eec: e0 91 d4 00 lds r30, 0x00D4 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7000d4> - 3ef0: f0 e0 ldi r31, 0x00 ; 0 - 3ef2: e9 5e subi r30, 0xE9 ; 233 - 3ef4: fa 4f sbci r31, 0xFA ; 250 - 3ef6: e4 91 lpm r30, Z - 3ef8: 11 96 adiw r26, 0x01 ; 1 - 3efa: ec 93 st X, r30 - - CRC.CTRL = CRC_SOURCE_DISABLE_gc; - 3efc: 10 92 d0 00 sts 0x00D0, r1 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7000d0> - 3f00: 08 95 ret - -00003f02 : -#ifdef USE_HW_CRC -bool ISO14443ACheckCRCA(const void* Buffer, uint16_t ByteCount) -{ - const uint8_t* DataPtr = (const uint8_t*) Buffer; - - CRC.CTRL = CRC_RESET0_bm; - 3f02: 20 e4 ldi r18, 0x40 ; 64 - 3f04: 20 93 d0 00 sts 0x00D0, r18 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7000d0> - CRC.CHECKSUM1 = (CRC_INIT_R >> 8) & 0xFF; - 3f08: 26 ec ldi r18, 0xC6 ; 198 - 3f0a: 20 93 d5 00 sts 0x00D5, r18 ; 0x8000d5 <__TEXT_REGION_LENGTH__+0x7000d5> - CRC.CHECKSUM0 = (CRC_INIT_R >> 0) & 0xFF; - 3f0e: 20 93 d4 00 sts 0x00D4, r18 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7000d4> - CRC.CTRL = CRC_SOURCE_IO_gc; - 3f12: 21 e0 ldi r18, 0x01 ; 1 - 3f14: 20 93 d0 00 sts 0x00D0, r18 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7000d0> - 3f18: dc 01 movw r26, r24 - 3f1a: 68 0f add r22, r24 - 3f1c: 79 1f adc r23, r25 - - while(ByteCount--) { - 3f1e: a6 17 cp r26, r22 - 3f20: b7 07 cpc r27, r23 - 3f22: 41 f0 breq .+16 ; 0x3f34 - uint8_t Byte = *DataPtr++; - 3f24: ed 91 ld r30, X+ - 3f26: f0 e0 ldi r31, 0x00 ; 0 - 3f28: e9 5e subi r30, 0xE9 ; 233 - 3f2a: fa 4f sbci r31, 0xFA ; 250 - 3f2c: e4 91 lpm r30, Z - Byte = BitReverseByte(Byte); - - CRC.DATAIN = Byte; - 3f2e: e0 93 d3 00 sts 0x00D3, r30 ; 0x8000d3 <__TEXT_REGION_LENGTH__+0x7000d3> - 3f32: f5 cf rjmp .-22 ; 0x3f1e - } - - bool Result = (DataPtr[0] == BitReverseByte(CRC.CHECKSUM1)) && (DataPtr[1] == BitReverseByte(CRC.CHECKSUM0)); - 3f34: e0 91 d5 00 lds r30, 0x00D5 ; 0x8000d5 <__TEXT_REGION_LENGTH__+0x7000d5> - 3f38: f0 e0 ldi r31, 0x00 ; 0 - 3f3a: e9 5e subi r30, 0xE9 ; 233 - 3f3c: fa 4f sbci r31, 0xFA ; 250 - 3f3e: e4 91 lpm r30, Z - 3f40: 8c 91 ld r24, X - 3f42: 8e 13 cpse r24, r30 - 3f44: 0a c0 rjmp .+20 ; 0x3f5a - 3f46: e0 91 d4 00 lds r30, 0x00D4 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7000d4> - 3f4a: f0 e0 ldi r31, 0x00 ; 0 - 3f4c: e9 5e subi r30, 0xE9 ; 233 - 3f4e: fa 4f sbci r31, 0xFA ; 250 - 3f50: e4 91 lpm r30, Z - 3f52: 81 e0 ldi r24, 0x01 ; 1 - 3f54: 11 96 adiw r26, 0x01 ; 1 - 3f56: 9c 91 ld r25, X - 3f58: 9e 13 cpse r25, r30 - 3f5a: 80 e0 ldi r24, 0x00 ; 0 - - CRC.CTRL = CRC_SOURCE_DISABLE_gc; - 3f5c: 10 92 d0 00 sts 0x00D0, r1 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7000d0> - - return Result; -} - 3f60: 81 70 andi r24, 0x01 ; 1 - 3f62: 08 95 ret - -00003f64 : - -uint32_t StateOdd; -uint32_t StateEven; - -static uint8_t Crypto1ByteAuth(uint8_t In, uint8_t AuthSet) -{ - 3f64: 0f 93 push r16 - 3f66: 1f 93 push r17 - 3f68: cf 93 push r28 - 3f6a: df 93 push r29 - 3f6c: 18 2f mov r17, r24 - 3f6e: 06 2f mov r16, r22 - 3f70: d8 e0 ldi r29, 0x08 ; 8 - uint8_t KeyStream = 0; - 3f72: c0 e0 ldi r28, 0x00 ; 0 - - /* Generate 8 keystream-bits */ - for (i=0; i<8; i++) { - - /* Calculate next bit and add to KeyStream */ - uint8_t Out = Crypto1Bit(In&1,AuthSet); - 3f74: 60 2f mov r22, r16 - 3f76: 81 2f mov r24, r17 - 3f78: 81 70 andi r24, 0x01 ; 1 - 3f7a: 0e 94 7d 05 call 0xafa ; 0xafa - - In>>=1; - 3f7e: 16 95 lsr r17 - KeyStream>>=1; - 3f80: c6 95 lsr r28 - if(Out) { - 3f82: 81 11 cpse r24, r1 - KeyStream |= (1<<7); - 3f84: c0 68 ori r28, 0x80 ; 128 - 3f86: d1 50 subi r29, 0x01 ; 1 -{ - uint8_t KeyStream = 0; - uint8_t i; - - /* Generate 8 keystream-bits */ - for (i=0; i<8; i++) { - 3f88: a9 f7 brne .-22 ; 0x3f74 - } - - } - - return KeyStream; -} - 3f8a: 8c 2f mov r24, r28 - 3f8c: df 91 pop r29 - 3f8e: cf 91 pop r28 - 3f90: 1f 91 pop r17 - 3f92: 0f 91 pop r16 - 3f94: 08 95 ret - -00003f96 : - -void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]) -{ - 3f96: cf 92 push r12 - 3f98: df 92 push r13 - 3f9a: ef 92 push r14 - 3f9c: ff 92 push r15 - 3f9e: 0f 93 push r16 - 3fa0: 1f 93 push r17 - 3fa2: cf 93 push r28 - 3fa4: df 93 push r29 - - StateOdd = 0; - 3fa6: 10 92 56 23 sts 0x2356, r1 ; 0x802356 - 3faa: 10 92 57 23 sts 0x2357, r1 ; 0x802357 - 3fae: 10 92 58 23 sts 0x2358, r1 ; 0x802358 - 3fb2: 10 92 59 23 sts 0x2359, r1 ; 0x802359 - StateEven = 0; - 3fb6: 10 92 52 23 sts 0x2352, r1 ; 0x802352 - 3fba: 10 92 53 23 sts 0x2353, r1 ; 0x802353 - 3fbe: 10 92 54 23 sts 0x2354, r1 ; 0x802354 - 3fc2: 10 92 55 23 sts 0x2355, r1 ; 0x802355 - 3fc6: dc 01 movw r26, r24 - 3fc8: 16 96 adiw r26, 0x06 ; 6 - - return KeyStream; -} - -void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]) -{ - 3fca: e7 e0 ldi r30, 0x07 ; 7 - 3fcc: f0 e0 ldi r31, 0x00 ; 0 - - int i = 0, j = 0; - for(i = 0 ; i < 6 ; i++) { - - for(j = 7 ; j > 0 ; j -= 2) { - StateOdd = StateOdd << 1 | (Key[i]>>((j-1) ^ 7)&1); - 3fce: ec 01 movw r28, r24 - 3fd0: 08 81 ld r16, Y - 3fd2: 10 e0 ldi r17, 0x00 ; 0 - 3fd4: 9f 01 movw r18, r30 - 3fd6: 21 50 subi r18, 0x01 ; 1 - 3fd8: 31 09 sbc r19, r1 - 3fda: d7 e0 ldi r29, 0x07 ; 7 - 3fdc: 2d 27 eor r18, r29 - 3fde: 02 c0 rjmp .+4 ; 0x3fe4 - 3fe0: 15 95 asr r17 - 3fe2: 07 95 ror r16 - 3fe4: 2a 95 dec r18 - 3fe6: e2 f7 brpl .-8 ; 0x3fe0 - 3fe8: 01 70 andi r16, 0x01 ; 1 - 3fea: 11 27 eor r17, r17 - 3fec: 01 2e mov r0, r17 - 3fee: 00 0c add r0, r0 - 3ff0: 22 0b sbc r18, r18 - 3ff2: 33 0b sbc r19, r19 - 3ff4: c0 90 56 23 lds r12, 0x2356 ; 0x802356 - 3ff8: d0 90 57 23 lds r13, 0x2357 ; 0x802357 - 3ffc: e0 90 58 23 lds r14, 0x2358 ; 0x802358 - 4000: f0 90 59 23 lds r15, 0x2359 ; 0x802359 - 4004: cc 0c add r12, r12 - 4006: dd 1c adc r13, r13 - 4008: ee 1c adc r14, r14 - 400a: ff 1c adc r15, r15 - 400c: 0c 29 or r16, r12 - 400e: 1d 29 or r17, r13 - 4010: 2e 29 or r18, r14 - 4012: 3f 29 or r19, r15 - 4014: 00 93 56 23 sts 0x2356, r16 ; 0x802356 - 4018: 10 93 57 23 sts 0x2357, r17 ; 0x802357 - 401c: 20 93 58 23 sts 0x2358, r18 ; 0x802358 - 4020: 30 93 59 23 sts 0x2359, r19 ; 0x802359 - StateEven = StateEven << 1 | (Key[i]>>((j) ^ 7)&1); - 4024: ec 01 movw r28, r24 - 4026: 08 81 ld r16, Y - 4028: 10 e0 ldi r17, 0x00 ; 0 - 402a: 9f 01 movw r18, r30 - 402c: d7 e0 ldi r29, 0x07 ; 7 - 402e: 2d 27 eor r18, r29 - 4030: 02 c0 rjmp .+4 ; 0x4036 - 4032: 15 95 asr r17 - 4034: 07 95 ror r16 - 4036: 2a 95 dec r18 - 4038: e2 f7 brpl .-8 ; 0x4032 - 403a: 01 70 andi r16, 0x01 ; 1 - 403c: 11 27 eor r17, r17 - 403e: 01 2e mov r0, r17 - 4040: 00 0c add r0, r0 - 4042: 22 0b sbc r18, r18 - 4044: 33 0b sbc r19, r19 - 4046: c0 90 52 23 lds r12, 0x2352 ; 0x802352 - 404a: d0 90 53 23 lds r13, 0x2353 ; 0x802353 - 404e: e0 90 54 23 lds r14, 0x2354 ; 0x802354 - 4052: f0 90 55 23 lds r15, 0x2355 ; 0x802355 - 4056: cc 0c add r12, r12 - 4058: dd 1c adc r13, r13 - 405a: ee 1c adc r14, r14 - 405c: ff 1c adc r15, r15 - 405e: 0c 29 or r16, r12 - 4060: 1d 29 or r17, r13 - 4062: 2e 29 or r18, r14 - 4064: 3f 29 or r19, r15 - 4066: 00 93 52 23 sts 0x2352, r16 ; 0x802352 - 406a: 10 93 53 23 sts 0x2353, r17 ; 0x802353 - 406e: 20 93 54 23 sts 0x2354, r18 ; 0x802354 - 4072: 30 93 55 23 sts 0x2355, r19 ; 0x802355 - StateEven = 0; - - int i = 0, j = 0; - for(i = 0 ; i < 6 ; i++) { - - for(j = 7 ; j > 0 ; j -= 2) { - 4076: 32 97 sbiw r30, 0x02 ; 2 - 4078: ef 3f cpi r30, 0xFF ; 255 - 407a: 2f ef ldi r18, 0xFF ; 255 - 407c: f2 07 cpc r31, r18 - 407e: 09 f0 breq .+2 ; 0x4082 - 4080: a6 cf rjmp .-180 ; 0x3fce - 4082: 01 96 adiw r24, 0x01 ; 1 - - StateOdd = 0; - StateEven = 0; - - int i = 0, j = 0; - for(i = 0 ; i < 6 ; i++) { - 4084: 8a 17 cp r24, r26 - 4086: 9b 07 cpc r25, r27 - 4088: 09 f0 breq .+2 ; 0x408c - 408a: 9f cf rjmp .-194 ; 0x3fca - 408c: 8b 01 movw r16, r22 - 408e: ea 01 movw r28, r20 - 4090: 7a 01 movw r14, r20 - 4092: 84 e0 ldi r24, 0x04 ; 4 - 4094: e8 0e add r14, r24 - 4096: f1 1c adc r15, r1 - StateEven = StateEven << 1 | (Key[i]>>((j) ^ 7)&1); - } - } - - for(i=0; i<4; i++) { - CardNonce[i] ^= Crypto1ByteAuth(Uid[i] ^ CardNonce[i], 0); - 4098: f8 01 movw r30, r16 - 409a: 91 91 ld r25, Z+ - 409c: 8f 01 movw r16, r30 - 409e: 88 81 ld r24, Y - 40a0: 60 e0 ldi r22, 0x00 ; 0 - 40a2: 89 27 eor r24, r25 - 40a4: 5f df rcall .-322 ; 0x3f64 - 40a6: 98 81 ld r25, Y - 40a8: 89 27 eor r24, r25 - 40aa: 89 93 st Y+, r24 - StateOdd = StateOdd << 1 | (Key[i]>>((j-1) ^ 7)&1); - StateEven = StateEven << 1 | (Key[i]>>((j) ^ 7)&1); - } - } - - for(i=0; i<4; i++) { - 40ac: ce 15 cp r28, r14 - 40ae: df 05 cpc r29, r15 - 40b0: 99 f7 brne .-26 ; 0x4098 - CardNonce[i] ^= Crypto1ByteAuth(Uid[i] ^ CardNonce[i], 0); - } - -} - 40b2: df 91 pop r29 - 40b4: cf 91 pop r28 - 40b6: 1f 91 pop r17 - 40b8: 0f 91 pop r16 - 40ba: ff 90 pop r15 - 40bc: ef 90 pop r14 - 40be: df 90 pop r13 - 40c0: cf 90 pop r12 - 40c2: 08 95 ret - -000040c4 : - -void Crypto1Auth(uint8_t EncryptedReaderNonce[4]) -{ - 40c4: 0f 93 push r16 - 40c6: 1f 93 push r17 - 40c8: cf 93 push r28 - 40ca: df 93 push r29 - 40cc: ec 01 movw r28, r24 - 40ce: 8c 01 movw r16, r24 - 40d0: 0c 5f subi r16, 0xFC ; 252 - 40d2: 1f 4f sbci r17, 0xFF ; 255 - uint8_t i; - - /* Calculate Authentication on Nonce */ - for(i = 0 ; i < 4 ; i++) { - Crypto1ByteAuth(EncryptedReaderNonce[i],1); - 40d4: 61 e0 ldi r22, 0x01 ; 1 - 40d6: 89 91 ld r24, Y+ - 40d8: 45 df rcall .-374 ; 0x3f64 -void Crypto1Auth(uint8_t EncryptedReaderNonce[4]) -{ - uint8_t i; - - /* Calculate Authentication on Nonce */ - for(i = 0 ; i < 4 ; i++) { - 40da: c0 17 cp r28, r16 - 40dc: d1 07 cpc r29, r17 - 40de: d1 f7 brne .-12 ; 0x40d4 - Crypto1ByteAuth(EncryptedReaderNonce[i],1); - } -} - 40e0: df 91 pop r29 - 40e2: cf 91 pop r28 - 40e4: 1f 91 pop r17 - 40e6: 0f 91 pop r16 - 40e8: 08 95 ret - -000040ea : - -uint8_t Crypto1Byte(void) -{ - 40ea: cf 93 push r28 - 40ec: df 93 push r29 - 40ee: d8 e0 ldi r29, 0x08 ; 8 - uint8_t KeyStream = 0; - 40f0: c0 e0 ldi r28, 0x00 ; 0 - - /* Generate 8 keystream-bits */ - for (i=0; i<8; i++) { - - /* Calculate next bit and add to KeyStream */ - uint8_t Out = Crypto1Bit(0,0); - 40f2: 60 e0 ldi r22, 0x00 ; 0 - 40f4: 80 e0 ldi r24, 0x00 ; 0 - 40f6: 0e 94 7d 05 call 0xafa ; 0xafa - - KeyStream>>=1; - 40fa: c6 95 lsr r28 - if(Out) { - 40fc: 81 11 cpse r24, r1 - KeyStream |= (1<<7); - 40fe: c0 68 ori r28, 0x80 ; 128 - 4100: d1 50 subi r29, 0x01 ; 1 -{ - uint8_t KeyStream = 0; - uint8_t i; - - /* Generate 8 keystream-bits */ - for (i=0; i<8; i++) { - 4102: b9 f7 brne .-18 ; 0x40f2 - } - - } - - return KeyStream; -} - 4104: 8c 2f mov r24, r28 - 4106: df 91 pop r29 - 4108: cf 91 pop r28 - 410a: 08 95 ret - -0000410c : - -uint8_t Crypto1Nibble(void) -{ - 410c: cf 93 push r28 - 410e: df 93 push r29 - 4110: d4 e0 ldi r29, 0x04 ; 4 - uint8_t KeyStream = 0; - 4112: c0 e0 ldi r28, 0x00 ; 0 - - /* Generate 4 keystream-bits */ - for (i=0; i<4; i++) { - - /* Calculate next bit and add to KeyStream */ - uint8_t Out = Crypto1Bit(0,0); - 4114: 60 e0 ldi r22, 0x00 ; 0 - 4116: 80 e0 ldi r24, 0x00 ; 0 - 4118: 0e 94 7d 05 call 0xafa ; 0xafa - - KeyStream>>=1; - 411c: c6 95 lsr r28 - if(Out) { - 411e: 81 11 cpse r24, r1 - KeyStream |= (1<<7); - 4120: c0 68 ori r28, 0x80 ; 128 - 4122: d1 50 subi r29, 0x01 ; 1 -{ - uint8_t KeyStream = 0; - uint8_t i; - - /* Generate 4 keystream-bits */ - for (i=0; i<4; i++) { - 4124: b9 f7 brne .-18 ; 0x4114 - } - - } - - return KeyStream; -} - 4126: 8c 2f mov r24, r28 - 4128: df 91 pop r29 - 412a: cf 91 pop r28 - 412c: 08 95 ret - -0000412e : - -void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) -{ - 412e: fc 01 movw r30, r24 - 4130: cb 01 movw r24, r22 - while(ClockCount--) { - 4132: 01 97 sbiw r24, 0x01 ; 1 - 4134: 28 f1 brcs .+74 ; 0x4180 - * 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); - 4136: 42 81 ldd r20, Z+2 ; 0x02 - 4138: 24 2f mov r18, r20 - 413a: 2d 72 andi r18, 0x2D ; 45 - Feedback ^= State[3] & (uint8_t) (PRNG_MASK >> 24); - - Feedback ^= Feedback >> 4; - 413c: 32 2f mov r19, r18 - 413e: 32 95 swap r19 - 4140: 3f 70 andi r19, 0x0F ; 15 - 4142: 23 27 eor r18, r19 - Feedback ^= Feedback >> 2; - 4144: 32 2f mov r19, r18 - 4146: 36 95 lsr r19 - 4148: 36 95 lsr r19 - 414a: 23 27 eor r18, r19 - Feedback ^= Feedback >> 1; - 414c: 32 2f mov r19, r18 - 414e: 36 95 lsr r19 - - /* 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; - 4150: a1 81 ldd r26, Z+1 ; 0x01 - Temp |= (uint32_t) State[2] << 16; - 4152: 50 e0 ldi r21, 0x00 ; 0 - 4154: 60 e0 ldi r22, 0x00 ; 0 - 4156: 70 e0 ldi r23, 0x00 ; 0 - 4158: ba 01 movw r22, r20 - 415a: 55 27 eor r21, r21 - 415c: 44 27 eor r20, r20 - 415e: 5a 2b or r21, r26 - Feedback ^= Feedback >> 1; - - /* For ease of processing convert the state into a 32 bit integer first */ - uint32_t Temp = 0; - - Temp |= (uint32_t) State[0] << 0; - 4160: a0 81 ld r26, Z - Temp |= (uint32_t) State[1] << 8; - Temp |= (uint32_t) State[2] << 16; - 4162: 4a 2b or r20, r26 - Temp |= (uint32_t) State[3] << 24; - 4164: a3 81 ldd r26, Z+3 ; 0x03 - 4166: 7a 2b or r23, r26 - - /* Cycle LFSR and feed back. */ - Temp >>= 1; - 4168: 76 95 lsr r23 - 416a: 67 95 ror r22 - 416c: 57 95 ror r21 - 416e: 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; - 4170: 23 27 eor r18, r19 - Temp |= (uint32_t) State[3] << 24; - - /* Cycle LFSR and feed back. */ - Temp >>= 1; - - if (Feedback & 0x01) { - 4172: 20 fd sbrc r18, 0 - Temp |= (uint32_t) 1 << (8 * PRNG_SIZE - 1); - 4174: 70 68 ori r23, 0x80 ; 128 - } - - /* Store back state */ - State[0] = (uint8_t) (Temp >> 0); - 4176: 40 83 st Z, r20 - State[1] = (uint8_t) (Temp >> 8); - 4178: 51 83 std Z+1, r21 ; 0x01 - State[2] = (uint8_t) (Temp >> 16); - 417a: 62 83 std Z+2, r22 ; 0x02 - State[3] = (uint8_t) (Temp >> 24); - 417c: 73 83 std Z+3, r23 ; 0x03 - 417e: d9 cf rjmp .-78 ; 0x4132 - } - - -} - 4180: 08 95 ret - -00004182 : -static uint8_t turn_falga = 0; -static uint8_t turn_falgb = 0; -static uint8_t keyb_falg = 0; - -uint16_t MifareDetectionAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - 4182: cf 92 push r12 - 4184: df 92 push r13 - 4186: ef 92 push r14 - 4188: ff 92 push r15 - 418a: 0f 93 push r16 - 418c: 1f 93 push r17 - 418e: cf 93 push r28 - 4190: df 93 push r29 - 4192: cd b7 in r28, 0x3d ; 61 - 4194: de b7 in r29, 0x3e ; 62 - 4196: 25 97 sbiw r28, 0x05 ; 5 - 4198: cd bf out 0x3d, r28 ; 61 - 419a: de bf out 0x3e, r29 ; 62 - 419c: 8c 01 movw r16, r24 - /* 0x26 / 0x52 Wakeup */ - if ( (BitCount == 7) && - 419e: 67 30 cpi r22, 0x07 ; 7 - 41a0: 71 05 cpc r23, r1 - 41a2: d9 f4 brne .+54 ; 0x41da - /* precheck of WUP/REQ because ISO14443AWakeUp destroys BitCount */ - ((Buffer[0] == ISO14443A_CMD_REQA) || (Buffer[0] == ISO14443A_CMD_WUPA)) ) { - 41a4: fc 01 movw r30, r24 - 41a6: 80 81 ld r24, Z -static uint8_t keyb_falg = 0; - -uint16_t MifareDetectionAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - /* 0x26 / 0x52 Wakeup */ - if ( (BitCount == 7) && - 41a8: 86 32 cpi r24, 0x26 ; 38 - 41aa: 19 f0 breq .+6 ; 0x41b2 - /* precheck of WUP/REQ because ISO14443AWakeUp destroys BitCount */ - ((Buffer[0] == ISO14443A_CMD_REQA) || (Buffer[0] == ISO14443A_CMD_WUPA)) ) { - 41ac: 82 35 cpi r24, 0x52 ; 82 - 41ae: 09 f0 breq .+2 ; 0x41b2 - 41b0: bc c0 rjmp .+376 ; 0x432a - - State = STATE_HALT; - 41b2: 10 92 39 21 sts 0x2139, r1 ; 0x802139 - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue, false)) - 41b6: 20 91 37 21 lds r18, 0x2137 ; 0x802137 - 41ba: 90 91 38 21 lds r25, 0x2138 ; 0x802138 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue, bool FromHalt) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( ((! FromHalt) && (DataPtr[0] == ISO14443A_CMD_REQA)) || - 41be: 86 32 cpi r24, 0x26 ; 38 - 41c0: 19 f0 breq .+6 ; 0x41c8 - 41c2: 82 35 cpi r24, 0x52 ; 82 - 41c4: 09 f0 breq .+2 ; 0x41c8 - 41c6: af c0 rjmp .+350 ; 0x4326 - (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 41c8: f8 01 movw r30, r16 - 41ca: 20 83 st Z, r18 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 41cc: 91 83 std Z+1, r25 ; 0x01 - { - State = STATE_READY; - 41ce: 82 e0 ldi r24, 0x02 ; 2 - 41d0: 80 93 39 21 sts 0x2139, r24 ; 0x802139 - - *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 41d4: 80 e1 ldi r24, 0x10 ; 16 - 41d6: 90 e0 ldi r25, 0x00 ; 0 - return BitCount; - 41d8: 3d c1 rjmp .+634 ; 0x4454 - } - } - - //0x93 0x20 & 0x93 0x70 (select anticol) - if (BitCount==16 || BitCount==72) { - 41da: 60 31 cpi r22, 0x10 ; 16 - 41dc: 71 05 cpc r23, r1 - 41de: 21 f0 breq .+8 ; 0x41e8 - 41e0: 68 34 cpi r22, 0x48 ; 72 - 41e2: 71 05 cpc r23, r1 - 41e4: 09 f0 breq .+2 ; 0x41e8 - 41e6: a1 c0 rjmp .+322 ; 0x432a - if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { - 41e8: f8 01 movw r30, r16 - 41ea: 80 81 ld r24, Z - 41ec: 83 39 cpi r24, 0x93 ; 147 - 41ee: 09 f0 breq .+2 ; 0x41f2 - 41f0: 9c c0 rjmp .+312 ; 0x432a - uint8_t UidCL1[4]; - MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 41f2: 44 e0 ldi r20, 0x04 ; 4 - 41f4: 50 e0 ldi r21, 0x00 ; 0 - 41f6: 60 e0 ldi r22, 0x00 ; 0 - 41f8: 70 e0 ldi r23, 0x00 ; 0 - 41fa: ce 01 movw r24, r28 - 41fc: 01 96 adiw r24, 0x01 ; 1 - 41fe: 0e 94 7c 08 call 0x10f8 ; 0x10f8 - if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) - 4202: 90 91 36 21 lds r25, 0x2136 ; 0x802136 - -INLINE -bool ISO14443ASelect(void* Buffer, uint16_t* BitCount, uint8_t* UidCL, uint8_t SAKValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - uint8_t NVB = DataPtr[1]; - 4206: f8 01 movw r30, r16 - 4208: 81 81 ldd r24, Z+1 ; 0x01 - //uint8_t CollisionByteCount = (NVB >> 4) & 0x0F; - //uint8_t CollisionBitCount = (NVB >> 0) & 0x0F; - - switch (NVB) { - 420a: 80 32 cpi r24, 0x20 ; 32 - 420c: 09 f4 brne .+2 ; 0x4210 - 420e: 7b c0 rjmp .+246 ; 0x4306 - 4210: 80 37 cpi r24, 0x70 ; 112 - 4212: c9 f4 brne .+50 ; 0x4246 - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 4214: f8 01 movw r30, r16 - 4216: 22 81 ldd r18, Z+2 ; 0x02 - 4218: 89 81 ldd r24, Y+1 ; 0x01 - 421a: 28 13 cpse r18, r24 - 421c: 84 c0 rjmp .+264 ; 0x4326 - 421e: 23 81 ldd r18, Z+3 ; 0x03 - 4220: 8a 81 ldd r24, Y+2 ; 0x02 - 4222: 28 13 cpse r18, r24 - 4224: 80 c0 rjmp .+256 ; 0x4326 - (DataPtr[3] == UidCL[1]) && - 4226: 24 81 ldd r18, Z+4 ; 0x04 - 4228: 8b 81 ldd r24, Y+3 ; 0x03 - 422a: 28 13 cpse r18, r24 - 422c: 7c c0 rjmp .+248 ; 0x4326 - (DataPtr[4] == UidCL[2]) && - 422e: 25 81 ldd r18, Z+5 ; 0x05 - 4230: 8c 81 ldd r24, Y+4 ; 0x04 - 4232: 28 13 cpse r18, r24 - 4234: 78 c0 rjmp .+240 ; 0x4326 - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 4236: 90 83 st Z, r25 - ISO14443AAppendCRCA(Buffer, 1); - 4238: 61 e0 ldi r22, 0x01 ; 1 - 423a: 70 e0 ldi r23, 0x00 ; 0 - 423c: c8 01 movw r24, r16 - 423e: 36 de rcall .-916 ; 0x3eac - return BitCount; - 4240: 88 e1 ldi r24, 0x18 ; 24 - 4242: 90 e0 ldi r25, 0x00 ; 0 - 4244: 07 c1 rjmp .+526 ; 0x4454 - *BitCount = 0; - return false; - } - default: - { - uint8_t CollisionByteCount = ((NVB >> 4) & 0x0f) - 2; - 4246: e8 2e mov r14, r24 - 4248: e2 94 swap r14 - 424a: 2f e0 ldi r18, 0x0F ; 15 - 424c: e2 22 and r14, r18 - 424e: 2e ef ldi r18, 0xFE ; 254 - 4250: 2e 0d add r18, r14 - uint8_t CollisionBitCount = (NVB >> 0) & 0x0f; - 4252: 8f 70 andi r24, 0x0F ; 15 - 4254: f8 2e mov r15, r24 - uint8_t mask = 0xFF >> (8 - CollisionBitCount); - 4256: 88 e0 ldi r24, 0x08 ; 8 - 4258: 90 e0 ldi r25, 0x00 ; 0 - 425a: 8f 19 sub r24, r15 - 425c: 91 09 sbc r25, r1 - 425e: 4f ef ldi r20, 0xFF ; 255 - 4260: 50 e0 ldi r21, 0x00 ; 0 - 4262: 6a 01 movw r12, r20 - 4264: 02 c0 rjmp .+4 ; 0x426a - 4266: d5 94 asr r13 - 4268: c7 94 ror r12 - 426a: 8a 95 dec r24 - 426c: e2 f7 brpl .-8 ; 0x4266 - // Since the UidCL does not contain the BCC, we have to distinguish here - if ( - 426e: 25 30 cpi r18, 0x05 ; 5 - 4270: 21 f0 breq .+8 ; 0x427a - ((CollisionByteCount == 5 || (CollisionByteCount == 4 && CollisionBitCount > 0)) && memcmp(UidCL, &DataPtr[2], 4) == 0 && (ISO14443A_CALC_BCC(UidCL) & mask) == (DataPtr[6] & mask)) - 4272: 24 30 cpi r18, 0x04 ; 4 - 4274: 59 f5 brne .+86 ; 0x42cc - 4276: ff 20 and r15, r15 - 4278: e9 f0 breq .+58 ; 0x42b4 - 427a: 44 e0 ldi r20, 0x04 ; 4 - 427c: 50 e0 ldi r21, 0x00 ; 0 - 427e: b8 01 movw r22, r16 - 4280: 6e 5f subi r22, 0xFE ; 254 - 4282: 7f 4f sbci r23, 0xFF ; 255 - 4284: ce 01 movw r24, r28 - 4286: 01 96 adiw r24, 0x01 ; 1 - 4288: 2d 83 std Y+5, r18 ; 0x05 - 428a: 0e 94 77 2a call 0x54ee ; 0x54ee - 428e: 2d 81 ldd r18, Y+5 ; 0x05 - 4290: 89 2b or r24, r25 - 4292: 61 f4 brne .+24 ; 0x42ac - 4294: 9a 81 ldd r25, Y+2 ; 0x02 - 4296: 89 81 ldd r24, Y+1 ; 0x01 - 4298: 89 27 eor r24, r25 - 429a: 9b 81 ldd r25, Y+3 ; 0x03 - 429c: 89 27 eor r24, r25 - 429e: 9c 81 ldd r25, Y+4 ; 0x04 - 42a0: 89 27 eor r24, r25 - 42a2: f8 01 movw r30, r16 - 42a4: 96 81 ldd r25, Z+6 ; 0x06 - 42a6: 89 27 eor r24, r25 - 42a8: 8c 21 and r24, r12 - 42aa: 69 f1 breq .+90 ; 0x4306 - || - 42ac: 24 30 cpi r18, 0x04 ; 4 - 42ae: 71 f4 brne .+28 ; 0x42cc - (CollisionByteCount == 4 && CollisionBitCount == 0 && memcmp(UidCL, &DataPtr[2], 4) == 0) - 42b0: f1 10 cpse r15, r1 - 42b2: 39 c0 rjmp .+114 ; 0x4326 - 42b4: 44 e0 ldi r20, 0x04 ; 4 - 42b6: 50 e0 ldi r21, 0x00 ; 0 - 42b8: b8 01 movw r22, r16 - 42ba: 6e 5f subi r22, 0xFE ; 254 - 42bc: 7f 4f sbci r23, 0xFF ; 255 - 42be: ce 01 movw r24, r28 - 42c0: 01 96 adiw r24, 0x01 ; 1 - 42c2: 0e 94 77 2a call 0x54ee ; 0x54ee - 42c6: 89 2b or r24, r25 - 42c8: f1 f0 breq .+60 ; 0x4306 - 42ca: 2d c0 rjmp .+90 ; 0x4326 - || - 42cc: 24 30 cpi r18, 0x04 ; 4 - 42ce: 58 f5 brcc .+86 ; 0x4326 - (CollisionByteCount < 4 && memcmp(UidCL, &DataPtr[2], CollisionByteCount) == 0 && (UidCL[CollisionByteCount] & mask) == (DataPtr[CollisionByteCount + 2] & mask)) - 42d0: e2 2e mov r14, r18 - 42d2: f1 2c mov r15, r1 - 42d4: a7 01 movw r20, r14 - 42d6: b8 01 movw r22, r16 - 42d8: 6e 5f subi r22, 0xFE ; 254 - 42da: 7f 4f sbci r23, 0xFF ; 255 - 42dc: ce 01 movw r24, r28 - 42de: 01 96 adiw r24, 0x01 ; 1 - 42e0: 0e 94 77 2a call 0x54ee ; 0x54ee - 42e4: 89 2b or r24, r25 - 42e6: f9 f4 brne .+62 ; 0x4326 - 42e8: d8 01 movw r26, r16 - 42ea: ae 0d add r26, r14 - 42ec: bf 1d adc r27, r15 - 42ee: e1 e0 ldi r30, 0x01 ; 1 - 42f0: f0 e0 ldi r31, 0x00 ; 0 - 42f2: ec 0f add r30, r28 - 42f4: fd 1f adc r31, r29 - 42f6: ee 0d add r30, r14 - 42f8: ff 1d adc r31, r15 - 42fa: 12 96 adiw r26, 0x02 ; 2 - 42fc: 9c 91 ld r25, X - 42fe: 80 81 ld r24, Z - 4300: 89 27 eor r24, r25 - 4302: c8 22 and r12, r24 - 4304: 81 f4 brne .+32 ; 0x4326 - ) - { - DataPtr[0] = UidCL[0]; - 4306: 29 81 ldd r18, Y+1 ; 0x01 - 4308: f8 01 movw r30, r16 - 430a: 20 83 st Z, r18 - DataPtr[1] = UidCL[1]; - 430c: 3a 81 ldd r19, Y+2 ; 0x02 - 430e: 31 83 std Z+1, r19 ; 0x01 - DataPtr[2] = UidCL[2]; - 4310: 9b 81 ldd r25, Y+3 ; 0x03 - 4312: 92 83 std Z+2, r25 ; 0x02 - DataPtr[3] = UidCL[3]; - 4314: 8c 81 ldd r24, Y+4 ; 0x04 - 4316: 83 83 std Z+3, r24 ; 0x03 - DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 4318: 23 27 eor r18, r19 - 431a: 92 27 eor r25, r18 - 431c: 89 27 eor r24, r25 - 431e: 84 83 std Z+4, r24 ; 0x04 - - *BitCount = ISO14443A_CL_FRAME_SIZE; - 4320: 68 e2 ldi r22, 0x28 ; 40 - 4322: 70 e0 ldi r23, 0x00 ; 0 - 4324: 02 c0 rjmp .+4 ; 0x432a - - *BitCount = ISO14443A_ATQA_FRAME_SIZE; - - return true; - } else { - *BitCount = 0; - 4326: 60 e0 ldi r22, 0x00 ; 0 - 4328: 70 e0 ldi r23, 0x00 ; 0 - } - } - - if (State != STATE_AUTHED_IDLE) { - 432a: 80 91 39 21 lds r24, 0x2139 ; 0x802139 - 432e: 85 30 cpi r24, 0x05 ; 5 - 4330: 09 f4 brne .+2 ; 0x4334 - 4332: 8e c0 rjmp .+284 ; 0x4450 - if (BitCount==32) { - 4334: 60 32 cpi r22, 0x20 ; 32 - 4336: 71 05 cpc r23, r1 - 4338: 09 f0 breq .+2 ; 0x433c - 433a: 49 c0 rjmp .+146 ; 0x43ce - if ((Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { - 433c: f8 01 movw r30, r16 - 433e: 80 81 ld r24, Z - 4340: 80 56 subi r24, 0x60 ; 96 - 4342: 82 30 cpi r24, 0x02 ; 2 - 4344: 08 f0 brcs .+2 ; 0x4348 - 4346: 84 c0 rjmp .+264 ; 0x4450 - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 4348: 62 e0 ldi r22, 0x02 ; 2 - 434a: 70 e0 ldi r23, 0x00 ; 0 - 434c: c8 01 movw r24, r16 - 434e: d9 dd rcall .-1102 ; 0x3f02 - 4350: 88 23 and r24, r24 - 4352: 09 f4 brne .+2 ; 0x4356 - 4354: 7d c0 rjmp .+250 ; 0x4450 - - uint8_t CardNonce[4]={0x01, 0x20, 0x01, 0x45}; - 4356: ff 24 eor r15, r15 - 4358: f3 94 inc r15 - 435a: f9 82 std Y+1, r15 ; 0x01 - 435c: 80 e2 ldi r24, 0x20 ; 32 - 435e: 8a 83 std Y+2, r24 ; 0x02 - 4360: fb 82 std Y+3, r15 ; 0x03 - 4362: 85 e4 ldi r24, 0x45 ; 69 - 4364: 8c 83 std Y+4, r24 ; 0x04 - - /* Generate a random nonce and read UID and key from memory */ - RandomGetBuffer(CardNonce, sizeof(CardNonce)); - 4366: 64 e0 ldi r22, 0x04 ; 4 - 4368: ce 01 movw r24, r28 - 436a: 01 96 adiw r24, 0x01 ; 1 - 436c: 0e 94 6b 07 call 0xed6 ; 0xed6 - memcpy(data_svae, Buffer, 4); - 4370: f8 01 movw r30, r16 - 4372: 80 81 ld r24, Z - 4374: 91 81 ldd r25, Z+1 ; 0x01 - 4376: a2 81 ldd r26, Z+2 ; 0x02 - 4378: b3 81 ldd r27, Z+3 ; 0x03 - 437a: 80 93 23 21 sts 0x2123, r24 ; 0x802123 - 437e: 90 93 24 21 sts 0x2124, r25 ; 0x802124 - 4382: a0 93 25 21 sts 0x2125, r26 ; 0x802125 - 4386: b0 93 26 21 sts 0x2126, r27 ; 0x802126 - memcpy(data_svae+4, CardNonce, 4); - 438a: 89 81 ldd r24, Y+1 ; 0x01 - 438c: 9a 81 ldd r25, Y+2 ; 0x02 - 438e: ab 81 ldd r26, Y+3 ; 0x03 - 4390: bc 81 ldd r27, Y+4 ; 0x04 - 4392: 80 93 27 21 sts 0x2127, r24 ; 0x802127 - 4396: 90 93 28 21 sts 0x2128, r25 ; 0x802128 - 439a: a0 93 29 21 sts 0x2129, r26 ; 0x802129 - 439e: b0 93 2a 21 sts 0x212A, r27 ; 0x80212a - - if (Buffer[0] == CMD_AUTH_B) - 43a2: 80 81 ld r24, Z - 43a4: 81 36 cpi r24, 0x61 ; 97 - 43a6: 19 f4 brne .+6 ; 0x43ae - keyb_falg = 1; - 43a8: f0 92 33 21 sts 0x2133, r15 ; 0x802133 - 43ac: 02 c0 rjmp .+4 ; 0x43b2 - else - keyb_falg = 0; - 43ae: 10 92 33 21 sts 0x2133, r1 ; 0x802133 - - State = STATE_AUTHING; - 43b2: 84 e0 ldi r24, 0x04 ; 4 - 43b4: 80 93 39 21 sts 0x2139, r24 ; 0x802139 - 43b8: d8 01 movw r26, r16 - 43ba: fe 01 movw r30, r28 - 43bc: 31 96 adiw r30, 0x01 ; 1 - 43be: 8e 0f add r24, r30 - - for (uint8_t i=0; i - Buffer[i] = CardNonce[i]; - - return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; - 43c8: 80 e2 ldi r24, 0x20 ; 32 - 43ca: 90 e0 ldi r25, 0x00 ; 0 - 43cc: 43 c0 rjmp .+134 ; 0x4454 - } - } - } - ////返回8ä½åŠ å¯† - if (BitCount==64 && State == STATE_AUTHING) { - 43ce: 60 34 cpi r22, 0x40 ; 64 - 43d0: 71 05 cpc r23, r1 - 43d2: 09 f0 breq .+2 ; 0x43d6 - 43d4: 3d c0 rjmp .+122 ; 0x4450 - 43d6: 84 30 cpi r24, 0x04 ; 4 - 43d8: d9 f5 brne .+118 ; 0x4450 - //å‚¨å­˜ä¿¡æ¯ - memcpy(data_svae+8, Buffer, 8); - 43da: 88 e0 ldi r24, 0x08 ; 8 - 43dc: f8 01 movw r30, r16 - 43de: ab e2 ldi r26, 0x2B ; 43 - 43e0: b1 e2 ldi r27, 0x21 ; 33 - 43e2: 01 90 ld r0, Z+ - 43e4: 0d 92 st X+, r0 - 43e6: 8a 95 dec r24 - 43e8: e1 f7 brne .-8 ; 0x43e2 - - if (!keyb_falg) { - 43ea: 80 91 33 21 lds r24, 0x2133 ; 0x802133 - 43ee: 81 11 cpse r24, r1 - 43f0: 18 c0 rjmp .+48 ; 0x4422 - MemoryWriteBlock(data_svae, (turn_falga+1) * MEM_BYTES_PER_BLOCK+4096, MEM_BYTES_PER_BLOCK); - 43f2: 60 91 35 21 lds r22, 0x2135 ; 0x802135 - 43f6: 70 e0 ldi r23, 0x00 ; 0 - 43f8: 6f 5f subi r22, 0xFF ; 255 - 43fa: 7e 4f sbci r23, 0xFE ; 254 - 43fc: 94 e0 ldi r25, 0x04 ; 4 - 43fe: 66 0f add r22, r22 - 4400: 77 1f adc r23, r23 - 4402: 9a 95 dec r25 - 4404: e1 f7 brne .-8 ; 0x43fe - 4406: 40 e1 ldi r20, 0x10 ; 16 - 4408: 50 e0 ldi r21, 0x00 ; 0 - 440a: 83 e2 ldi r24, 0x23 ; 35 - 440c: 91 e2 ldi r25, 0x21 ; 33 - 440e: 0e 94 07 09 call 0x120e ; 0x120e - turn_falga++; - 4412: 80 91 35 21 lds r24, 0x2135 ; 0x802135 - 4416: 8f 5f subi r24, 0xFF ; 255 - turn_falga = turn_falga % 6; - 4418: 66 e0 ldi r22, 0x06 ; 6 - 441a: 7f d7 rcall .+3838 ; 0x531a <__udivmodqi4> - 441c: 90 93 35 21 sts 0x2135, r25 ; 0x802135 - 4420: 17 c0 rjmp .+46 ; 0x4450 - } else { - MemoryWriteBlock(data_svae, (turn_falgb) * MEM_BYTES_PER_BLOCK + 112+4096, MEM_BYTES_PER_BLOCK); - 4422: 60 91 34 21 lds r22, 0x2134 ; 0x802134 - 4426: 70 e0 ldi r23, 0x00 ; 0 - 4428: 69 5f subi r22, 0xF9 ; 249 - 442a: 7e 4f sbci r23, 0xFE ; 254 - 442c: 84 e0 ldi r24, 0x04 ; 4 - 442e: 66 0f add r22, r22 - 4430: 77 1f adc r23, r23 - 4432: 8a 95 dec r24 - 4434: e1 f7 brne .-8 ; 0x442e - 4436: 40 e1 ldi r20, 0x10 ; 16 - 4438: 50 e0 ldi r21, 0x00 ; 0 - 443a: 83 e2 ldi r24, 0x23 ; 35 - 443c: 91 e2 ldi r25, 0x21 ; 33 - 443e: 0e 94 07 09 call 0x120e ; 0x120e - turn_falgb++; - 4442: 80 91 34 21 lds r24, 0x2134 ; 0x802134 - 4446: 8f 5f subi r24, 0xFF ; 255 - turn_falgb = turn_falgb % 6; - 4448: 66 e0 ldi r22, 0x06 ; 6 - 444a: 67 d7 rcall .+3790 ; 0x531a <__udivmodqi4> - 444c: 90 93 34 21 sts 0x2134, r25 ; 0x802134 - - } - } - - /* No response has been sent, when we reach here */ - return ISO14443A_APP_NO_RESPONSE; - 4450: 80 e0 ldi r24, 0x00 ; 0 - 4452: 90 e0 ldi r25, 0x00 ; 0 - } - 4454: 25 96 adiw r28, 0x05 ; 5 - 4456: cd bf out 0x3d, r28 ; 61 - 4458: de bf out 0x3e, r29 ; 62 - 445a: df 91 pop r29 - 445c: cf 91 pop r28 - 445e: 1f 91 pop r17 - 4460: 0f 91 pop r16 - 4462: ff 90 pop r15 - 4464: ef 90 pop r14 - 4466: df 90 pop r13 - 4468: cf 90 pop r12 - 446a: 08 95 ret - -0000446c : - - void MifareDetectionInit(void) { - State = STATE_IDLE; - 446c: 81 e0 ldi r24, 0x01 ; 1 - 446e: 80 93 39 21 sts 0x2139, r24 ; 0x802139 - CardATQAValue = MFCLASSIC_1K_ATQA_VALUE; - 4472: 84 e0 ldi r24, 0x04 ; 4 - 4474: 90 e0 ldi r25, 0x00 ; 0 - 4476: 80 93 37 21 sts 0x2137, r24 ; 0x802137 - 447a: 90 93 38 21 sts 0x2138, r25 ; 0x802138 - CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; - 447e: 88 e0 ldi r24, 0x08 ; 8 - 4480: 80 93 36 21 sts 0x2136, r24 ; 0x802136 - 4484: 08 95 ret - -00004486 : - } - - void MifareDetectionReset(void) - { - 4486: 08 95 ret - -00004488 : -#if !defined(NO_DEVICE_REMOTE_WAKEUP) -bool USB_Device_RemoteWakeupEnabled; -#endif - -void USB_Device_ProcessControlRequest(void) -{ - 4488: ff 92 push r15 - 448a: 0f 93 push r16 - 448c: 1f 93 push r17 - 448e: cf 93 push r28 - 4490: df 93 push r29 - 4492: cd b7 in r28, 0x3d ; 61 - 4494: de b7 in r29, 0x3e ; 62 - 4496: ea 97 sbiw r28, 0x3a ; 58 - 4498: cd bf out 0x3d, r28 ; 61 - 449a: de bf out 0x3e, r29 ; 62 - 449c: 0f e5 ldi r16, 0x5F ; 95 - 449e: 13 e2 ldi r17, 0x23 ; 35 - 44a0: 88 e0 ldi r24, 0x08 ; 8 - 44a2: f8 2e mov r15, r24 - 44a4: f0 0e add r15, r16 - 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(); - 44a6: 8b d2 rcall .+1302 ; 0x49be - 44a8: f8 01 movw r30, r16 - 44aa: 81 93 st Z+, r24 - 44ac: 8f 01 movw r16, r30 - USB_ControlRequest.wIndex = Endpoint_Read_16_LE(); - 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++) - 44ae: fe 12 cpse r15, r30 - 44b0: fa cf rjmp .-12 ; 0x44a6 - *(RequestHeader++) = Endpoint_Read_8(); - #endif - - EVENT_USB_Device_ControlRequest(); - 44b2: 0e 94 9d 0d call 0x1b3a ; 0x1b3a - - if (Endpoint_IsSETUPReceived()) - 44b6: fe d2 rcall .+1532 ; 0x4ab4 - 44b8: 88 23 and r24, r24 - 44ba: 09 f4 brne .+2 ; 0x44be - 44bc: f7 c0 rjmp .+494 ; 0x46ac - { - uint8_t bmRequestType = USB_ControlRequest.bmRequestType; - 44be: 80 91 5f 23 lds r24, 0x235F ; 0x80235f - - switch (USB_ControlRequest.bRequest) - 44c2: 90 91 60 23 lds r25, 0x2360 ; 0x802360 - 44c6: 95 30 cpi r25, 0x05 ; 5 - 44c8: 09 f4 brne .+2 ; 0x44cc - 44ca: 6f c0 rjmp .+222 ; 0x45aa - 44cc: 30 f4 brcc .+12 ; 0x44da - 44ce: 91 30 cpi r25, 0x01 ; 1 - 44d0: 69 f1 breq .+90 ; 0x452c - 44d2: 68 f0 brcs .+26 ; 0x44ee - 44d4: 93 30 cpi r25, 0x03 ; 3 - 44d6: 51 f1 breq .+84 ; 0x452c - 44d8: e9 c0 rjmp .+466 ; 0x46ac - 44da: 98 30 cpi r25, 0x08 ; 8 - 44dc: 09 f4 brne .+2 ; 0x44e0 - 44de: c2 c0 rjmp .+388 ; 0x4664 - 44e0: 99 30 cpi r25, 0x09 ; 9 - 44e2: 09 f4 brne .+2 ; 0x44e6 - 44e4: c8 c0 rjmp .+400 ; 0x4676 - 44e6: 96 30 cpi r25, 0x06 ; 6 - 44e8: 09 f0 breq .+2 ; 0x44ec - 44ea: e0 c0 rjmp .+448 ; 0x46ac - 44ec: 72 c0 rjmp .+228 ; 0x45d2 - { - case REQ_GetStatus: - if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || - 44ee: 80 38 cpi r24, 0x80 ; 128 - 44f0: 91 f0 breq .+36 ; 0x4516 - 44f2: 82 38 cpi r24, 0x82 ; 130 - 44f4: 09 f0 breq .+2 ; 0x44f8 - 44f6: da c0 rjmp .+436 ; 0x46ac - 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); - 44f8: 80 91 63 23 lds r24, 0x2363 ; 0x802363 - 44fc: 8f 70 andi r24, 0x0F ; 15 - 44fe: 7f d2 rcall .+1278 ; 0x49fe - * \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); - 4500: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4504: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4508: 11 81 ldd r17, Z+1 ; 0x01 - 450a: 12 fb bst r17, 2 - 450c: 11 27 eor r17, r17 - 450e: 10 f9 bld r17, 0 - - CurrentStatus = Endpoint_IsStalled(); - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 4510: 80 e0 ldi r24, 0x00 ; 0 - 4512: 75 d2 rcall .+1258 ; 0x49fe - 4514: 06 c0 rjmp .+12 ; 0x4522 - Endpoint_ClearOUT(); -} - -static void USB_Device_GetStatus(void) -{ - uint8_t CurrentStatus = 0; - 4516: 10 91 5b 23 lds r17, 0x235B ; 0x80235b - if (USB_Device_CurrentlySelfPowered) - CurrentStatus |= FEATURE_SELFPOWERED_ENABLED; - #endif - - #if !defined(NO_DEVICE_REMOTE_WAKEUP) - if (USB_Device_RemoteWakeupEnabled) - 451a: 80 91 5c 23 lds r24, 0x235C ; 0x80235c - 451e: 81 11 cpse r24, r1 - CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; - 4520: 12 60 ori r17, 0x02 ; 2 - break; - default: - return; - } - - Endpoint_ClearSETUP(); - 4522: e2 d2 rcall .+1476 ; 0x4ae8 - * \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); - 4524: 81 2f mov r24, r17 - 4526: 5b d2 rcall .+1206 ; 0x49de - Endpoint_Write_8(Data >> 8); - 4528: 80 e0 ldi r24, 0x00 ; 0 - 452a: a1 c0 rjmp .+322 ; 0x466e - } - - break; - case REQ_ClearFeature: - case REQ_SetFeature: - if ((bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) || - 452c: 28 2f mov r18, r24 - 452e: 2d 7f andi r18, 0xFD ; 253 - 4530: 09 f0 breq .+2 ; 0x4534 - 4532: bc c0 rjmp .+376 ; 0x46ac - Endpoint_ClearStatusStage(); -} - -static void USB_Device_ClearSetFeature(void) -{ - switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) - 4534: 88 23 and r24, r24 - 4536: 19 f0 breq .+6 ; 0x453e - 4538: 82 30 cpi r24, 0x02 ; 2 - 453a: 61 f0 breq .+24 ; 0x4554 - 453c: b7 c0 rjmp .+366 ; 0x46ac - { - #if !defined(NO_DEVICE_REMOTE_WAKEUP) - case REQREC_DEVICE: - if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup) - 453e: 80 91 61 23 lds r24, 0x2361 ; 0x802361 - 4542: 81 30 cpi r24, 0x01 ; 1 - 4544: 09 f0 breq .+2 ; 0x4548 - 4546: b2 c0 rjmp .+356 ; 0x46ac - USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature); - 4548: 93 30 cpi r25, 0x03 ; 3 - 454a: 09 f0 breq .+2 ; 0x454e - 454c: 80 e0 ldi r24, 0x00 ; 0 - 454e: 80 93 5c 23 sts 0x235C, r24 ; 0x80235c - 4552: 27 c0 rjmp .+78 ; 0x45a2 - - break; - #endif - #if !defined(CONTROL_ONLY_DEVICE) - case REQREC_ENDPOINT: - if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt) - 4554: 80 91 61 23 lds r24, 0x2361 ; 0x802361 - 4558: 81 11 cpse r24, r1 - 455a: 23 c0 rjmp .+70 ; 0x45a2 - { - uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); - 455c: e0 91 63 23 lds r30, 0x2363 ; 0x802363 - 4560: 1e 2f mov r17, r30 - 4562: 1f 70 andi r17, 0x0F ; 15 - - if (EndpointIndex == ENDPOINT_CONTROLEP) - 4564: 09 f4 brne .+2 ; 0x4568 - 4566: a2 c0 rjmp .+324 ; 0x46ac - return; - - Endpoint_SelectEndpoint(EndpointIndex); - 4568: 81 2f mov r24, r17 - 456a: 49 d2 rcall .+1170 ; 0x49fe - - if (Endpoint_IsEnabled()) - { - if (USB_ControlRequest.bRequest == REQ_SetFeature) - 456c: 80 91 60 23 lds r24, 0x2360 ; 0x802360 - 4570: 83 30 cpi r24, 0x03 ; 3 - 4572: 11 f4 brne .+4 ; 0x4578 - { - Endpoint_StallTransaction(); - 4574: e5 d2 rcall .+1482 ; 0x4b40 - 4576: 15 c0 rjmp .+42 ; 0x45a2 - * \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; - 4578: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 457c: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4580: 81 81 ldd r24, Z+1 ; 0x01 - 4582: 8b 7f andi r24, 0xFB ; 251 - 4584: 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; - 4586: 24 e8 ldi r18, 0x84 ; 132 - 4588: 12 9f mul r17, r18 - 458a: f0 01 movw r30, r0 - 458c: 11 24 eor r1, r1 - 458e: e3 55 subi r30, 0x53 ; 83 - 4590: fc 4d sbci r31, 0xDC ; 220 - 4592: 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; - 4594: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4598: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 459c: 80 81 ld r24, Z - 459e: 8e 7f andi r24, 0xFE ; 254 - 45a0: 80 83 st Z, r24 - #endif - default: - return; - } - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 45a2: 80 e0 ldi r24, 0x00 ; 0 - 45a4: 2c d2 rcall .+1112 ; 0x49fe - - Endpoint_ClearSETUP(); - 45a6: a0 d2 rcall .+1344 ; 0x4ae8 - 45a8: 64 c0 rjmp .+200 ; 0x4672 - USB_Device_ClearSetFeature(); - } - - break; - case REQ_SetAddress: - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - 45aa: 81 11 cpse r24, r1 - 45ac: 7f c0 rjmp .+254 ; 0x46ac - } -} - -static void USB_Device_SetAddress(void) -{ - uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F); - 45ae: 10 91 61 23 lds r17, 0x2361 ; 0x802361 - 45b2: 1f 77 andi r17, 0x7F ; 127 - - USB_Device_SetDeviceAddress(DeviceAddress); - - Endpoint_ClearSETUP(); - 45b4: 99 d2 rcall .+1330 ; 0x4ae8 - - Endpoint_ClearStatusStage(); - 45b6: 9a d3 rcall .+1844 ; 0x4cec - - while (!(Endpoint_IsINReady())); - 45b8: 57 d2 rcall .+1198 ; 0x4a68 - 45ba: 88 23 and r24, r24 - 45bc: e9 f3 breq .-6 ; 0x45b8 - } - - 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; - 45be: 10 93 c3 04 sts 0x04C3, r17 ; 0x8004c3 <__TEXT_REGION_LENGTH__+0x7004c3> - - USB_Device_EnableDeviceAddress(DeviceAddress); - - USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; - 45c2: 11 11 cpse r17, r1 - 45c4: 02 c0 rjmp .+4 ; 0x45ca - 45c6: 82 e0 ldi r24, 0x02 ; 2 - 45c8: 01 c0 rjmp .+2 ; 0x45cc - 45ca: 83 e0 ldi r24, 0x03 ; 3 - 45cc: 80 93 5e 23 sts 0x235E, r24 ; 0x80235e - 45d0: 6d c0 rjmp .+218 ; 0x46ac - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - USB_Device_SetAddress(); - - break; - case REQ_GetDescriptor: - if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || - 45d2: 80 58 subi r24, 0x80 ; 128 - 45d4: 82 30 cpi r24, 0x02 ; 2 - 45d6: 08 f0 brcs .+2 ; 0x45da - 45d8: 69 c0 rjmp .+210 ; 0x46ac - !(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)) - 45da: 80 91 61 23 lds r24, 0x2361 ; 0x802361 - 45de: 90 91 62 23 lds r25, 0x2362 ; 0x802362 - 45e2: 8c 3d cpi r24, 0xDC ; 220 - 45e4: e3 e0 ldi r30, 0x03 ; 3 - 45e6: 9e 07 cpc r25, r30 - 45e8: 61 f5 brne .+88 ; 0x4642 - { - USB_Descriptor_Header_t Header; - uint16_t UnicodeString[INTERNAL_SERIAL_LENGTH_BITS / 4]; - } SignatureDescriptor; - - SignatureDescriptor.Header.Type = DTYPE_String; - 45ea: 83 e0 ldi r24, 0x03 ; 3 - 45ec: 8a 83 std Y+2, r24 ; 0x02 - SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4); - 45ee: 8a e3 ldi r24, 0x3A ; 58 - 45f0: 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; - 45f2: 4f b7 in r20, 0x3f ; 63 - #if (ARCH == ARCH_AVR8) - cli(); - #elif (ARCH == ARCH_UC3) - __builtin_ssrf(AVR32_SR_GM_OFFSET); - #elif (ARCH == ARCH_XMEGA) - cli(); - 45f4: f8 94 cli - #endif - - GCC_MEMORY_BARRIER(); - 45f6: de 01 movw r26, r28 - 45f8: 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++) - 45fa: 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; - 45fc: 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; - 45fe: 52 e0 ldi r21, 0x02 ; 2 - 4600: 50 93 ca 01 sts 0x01CA, r21 ; 0x8001ca <__TEXT_REGION_LENGTH__+0x7001ca> - SerialByte = pgm_read_byte(SigReadAddress); - 4604: e3 2f mov r30, r19 - 4606: f0 e0 ldi r31, 0x00 ; 0 - 4608: e4 91 lpm r30, Z - NVM.CMD = 0; - 460a: 10 92 ca 01 sts 0x01CA, r1 ; 0x8001ca <__TEXT_REGION_LENGTH__+0x7001ca> - - if (SerialCharNum & 0x01) - 460e: 20 ff sbrs r18, 0 - 4610: 03 c0 rjmp .+6 ; 0x4618 - { - SerialByte >>= 4; - 4612: e2 95 swap r30 - 4614: ef 70 andi r30, 0x0F ; 15 - SigReadAddress++; - 4616: 3f 5f subi r19, 0xFF ; 255 - } - - SerialByte &= 0x0F; - 4618: ef 70 andi r30, 0x0F ; 15 - 461a: 8e 2f mov r24, r30 - 461c: 90 e0 ldi r25, 0x00 ; 0 - - UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? - 461e: ea 30 cpi r30, 0x0A ; 10 - 4620: 10 f0 brcs .+4 ; 0x4626 - 4622: c7 96 adiw r24, 0x37 ; 55 - 4624: 01 c0 rjmp .+2 ; 0x4628 - 4626: c0 96 adiw r24, 0x30 ; 48 - 4628: 8d 93 st X+, r24 - 462a: 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++) - 462c: 2f 5f subi r18, 0xFF ; 255 - 462e: 2c 31 cpi r18, 0x1C ; 28 - 4630: 39 f7 brne .-50 ; 0x4600 - if (GlobalIntState & AVR32_SR_GM) - __builtin_ssrf(AVR32_SR_GM_OFFSET); - else - __builtin_csrf(AVR32_SR_GM_OFFSET); - #elif (ARCH == ARCH_XMEGA) - SREG = GlobalIntState; - 4632: 4f bf out 0x3f, r20 ; 63 - - USB_Device_GetSerialString(SignatureDescriptor.UnicodeString); - - Endpoint_ClearSETUP(); - 4634: 59 d2 rcall .+1202 ; 0x4ae8 - - Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor)); - 4636: 6a e3 ldi r22, 0x3A ; 58 - 4638: 70 e0 ldi r23, 0x00 ; 0 - 463a: ce 01 movw r24, r28 - 463c: 01 96 adiw r24, 0x01 ; 1 - 463e: a3 d0 rcall .+326 ; 0x4786 - 4640: 0f c0 rjmp .+30 ; 0x4660 - USB_Device_GetInternalSerialDescriptor(); - return; - } - #endif - - if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, - 4642: ae 01 movw r20, r28 - 4644: 4f 5f subi r20, 0xFF ; 255 - 4646: 5f 4f sbci r21, 0xFF ; 255 - 4648: 60 91 63 23 lds r22, 0x2363 ; 0x802363 - 464c: 0e 94 5b 06 call 0xcb6 ; 0xcb6 - 4650: 8c 01 movw r16, r24 - 4652: 89 2b or r24, r25 - 4654: 59 f1 breq .+86 ; 0x46ac - )) == NO_DESCRIPTOR) - { - return; - } - - Endpoint_ClearSETUP(); - 4656: 48 d2 rcall .+1168 ; 0x4ae8 - #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); - 4658: b8 01 movw r22, r16 - 465a: 89 81 ldd r24, Y+1 ; 0x01 - 465c: 9a 81 ldd r25, Y+2 ; 0x02 - 465e: 0c d1 rcall .+536 ; 0x4878 - Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize); - else - Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize); - #endif - - Endpoint_ClearOUT(); - 4660: 9f d1 rcall .+830 ; 0x49a0 - 4662: 24 c0 rjmp .+72 ; 0x46ac - USB_Device_GetDescriptor(); - } - - break; - case REQ_GetConfiguration: - if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) - 4664: 80 38 cpi r24, 0x80 ; 128 - 4666: 11 f5 brne .+68 ; 0x46ac - EVENT_USB_Device_ConfigurationChanged(); -} - -static void USB_Device_GetConfiguration(void) -{ - Endpoint_ClearSETUP(); - 4668: 3f d2 rcall .+1150 ; 0x4ae8 - - Endpoint_Write_8(USB_Device_ConfigurationNumber); - 466a: 80 91 5a 23 lds r24, 0x235A ; 0x80235a - 466e: b7 d1 rcall .+878 ; 0x49de - Endpoint_ClearIN(); - 4670: 7e d1 rcall .+764 ; 0x496e - - Endpoint_ClearStatusStage(); - 4672: 3c d3 rcall .+1656 ; 0x4cec - 4674: 1b c0 rjmp .+54 ; 0x46ac - if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) - USB_Device_GetConfiguration(); - - break; - case REQ_SetConfiguration: - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - 4676: 81 11 cpse r24, r1 - 4678: 19 c0 rjmp .+50 ; 0x46ac -} - -static void USB_Device_SetConfiguration(void) -{ - #if defined(FIXED_NUM_CONFIGURATIONS) - if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS) - 467a: 80 91 61 23 lds r24, 0x2361 ; 0x802361 - 467e: 82 30 cpi r24, 0x02 ; 2 - 4680: a8 f4 brcc .+42 ; 0x46ac - if ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations) - return; - #endif - #endif - - Endpoint_ClearSETUP(); - 4682: 32 d2 rcall .+1124 ; 0x4ae8 - - USB_Device_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue; - 4684: 80 91 61 23 lds r24, 0x2361 ; 0x802361 - 4688: 80 93 5a 23 sts 0x235A, r24 ; 0x80235a - - Endpoint_ClearStatusStage(); - 468c: 2f d3 rcall .+1630 ; 0x4cec - - if (USB_Device_ConfigurationNumber) - 468e: 80 91 5a 23 lds r24, 0x235A ; 0x80235a - 4692: 81 11 cpse r24, r1 - 4694: 06 c0 rjmp .+12 ; 0x46a2 - } - - 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); - 4696: 80 91 c3 04 lds r24, 0x04C3 ; 0x8004c3 <__TEXT_REGION_LENGTH__+0x7004c3> - USB_DeviceState = DEVICE_STATE_Configured; - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; - 469a: 81 11 cpse r24, r1 - 469c: 02 c0 rjmp .+4 ; 0x46a2 - 469e: 81 e0 ldi r24, 0x01 ; 1 - 46a0: 01 c0 rjmp .+2 ; 0x46a4 - 46a2: 84 e0 ldi r24, 0x04 ; 4 - 46a4: 80 93 5e 23 sts 0x235E, r24 ; 0x80235e - - EVENT_USB_Device_ConfigurationChanged(); - 46a8: 0e 94 99 0d call 0x1b32 ; 0x1b32 - default: - break; - } - } - - if (Endpoint_IsSETUPReceived()) - 46ac: 03 d2 rcall .+1030 ; 0x4ab4 - 46ae: 88 23 and r24, r24 - 46b0: 11 f0 breq .+4 ; 0x46b6 - { - Endpoint_ClearSETUP(); - 46b2: 1a d2 rcall .+1076 ; 0x4ae8 - Endpoint_StallTransaction(); - 46b4: 45 d2 rcall .+1162 ; 0x4b40 - } -} - 46b6: ea 96 adiw r28, 0x3a ; 58 - 46b8: cd bf out 0x3d, r28 ; 61 - 46ba: de bf out 0x3e, r29 ; 62 - 46bc: df 91 pop r29 - 46be: cf 91 pop r28 - 46c0: 1f 91 pop r17 - 46c2: 0f 91 pop r16 - 46c4: ff 90 pop r15 - 46c6: 08 95 ret - -000046c8 : -#define __INCLUDE_FROM_EVENTS_C -#define __INCLUDE_FROM_USB_DRIVER -#include "Events.h" - -void USB_Event_Stub(void) -{ - 46c8: 08 95 ret - -000046ca : -#if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) -volatile uint8_t USB_DeviceState; -#endif - -void USB_USBTask(void) -{ - 46ca: cf 93 push r28 -} - -#if defined(USB_CAN_BE_DEVICE) -static void USB_DeviceTask(void) -{ - if (USB_DeviceState == DEVICE_STATE_Unattached) - 46cc: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 46d0: 88 23 and r24, r24 - 46d2: 51 f0 breq .+20 ; 0x46e8 - * \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; - 46d4: c0 91 6b 23 lds r28, 0x236B ; 0x80236b - return; - - uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 46d8: 80 e0 ldi r24, 0x00 ; 0 - 46da: 91 d1 rcall .+802 ; 0x49fe - - if (Endpoint_IsSETUPReceived()) - 46dc: eb d1 rcall .+982 ; 0x4ab4 - 46de: 81 11 cpse r24, r1 - USB_Device_ProcessControlRequest(); - 46e0: d3 de rcall .-602 ; 0x4488 - - Endpoint_SelectEndpoint(PrevEndpoint); - 46e2: 8c 2f mov r24, r28 - #elif defined(USB_CAN_BE_HOST) - USB_HostTask(); - #elif defined(USB_CAN_BE_DEVICE) - USB_DeviceTask(); - #endif -} - 46e4: cf 91 pop r28 - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - - if (Endpoint_IsSETUPReceived()) - USB_Device_ProcessControlRequest(); - - Endpoint_SelectEndpoint(PrevEndpoint); - 46e6: 8b c1 rjmp .+790 ; 0x49fe - #elif defined(USB_CAN_BE_HOST) - USB_HostTask(); - #elif defined(USB_CAN_BE_DEVICE) - USB_DeviceTask(); - #endif -} - 46e8: cf 91 pop r28 - 46ea: 08 95 ret - -000046ec : - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; -} - 46ec: cf 92 push r12 - 46ee: df 92 push r13 - 46f0: ef 92 push r14 - 46f2: ff 92 push r15 - 46f4: 0f 93 push r16 - 46f6: 1f 93 push r17 - 46f8: cf 93 push r28 - 46fa: df 93 push r29 - 46fc: ec 01 movw r28, r24 - 46fe: 8b 01 movw r16, r22 - 4700: 7a 01 movw r14, r20 - 4702: 0a d3 rcall .+1556 ; 0x4d18 - 4704: 81 11 cpse r24, r1 - 4706: 36 c0 rjmp .+108 ; 0x4774 - 4708: e1 14 cp r14, r1 - 470a: f1 04 cpc r15, r1 - 470c: 39 f0 breq .+14 ; 0x471c - 470e: f7 01 movw r30, r14 - 4710: 80 81 ld r24, Z - 4712: 91 81 ldd r25, Z+1 ; 0x01 - 4714: 08 1b sub r16, r24 - 4716: 19 0b sbc r17, r25 - 4718: c8 0f add r28, r24 - 471a: d9 1f adc r29, r25 - 471c: c1 2c mov r12, r1 - 471e: d1 2c mov r13, r1 - 4720: 01 15 cp r16, r1 - 4722: 11 05 cpc r17, r1 - 4724: 31 f1 breq .+76 ; 0x4772 - 4726: 80 91 67 23 lds r24, 0x2367 ; 0x802367 - 472a: 90 91 68 23 lds r25, 0x2368 ; 0x802368 - 472e: fc 01 movw r30, r24 - 4730: ef 5b subi r30, 0xBF ; 191 - 4732: ff 4f sbci r31, 0xFF ; 255 - 4734: 20 81 ld r18, Z - 4736: 31 97 sbiw r30, 0x01 ; 1 - 4738: 80 81 ld r24, Z - 473a: 28 17 cp r18, r24 - 473c: 90 f0 brcs .+36 ; 0x4762 - 473e: 17 d1 rcall .+558 ; 0x496e - 4740: c4 df rcall .-120 ; 0x46ca - 4742: e1 14 cp r14, r1 - 4744: f1 04 cpc r15, r1 - 4746: 49 f0 breq .+18 ; 0x475a - 4748: f7 01 movw r30, r14 - 474a: 80 81 ld r24, Z - 474c: 91 81 ldd r25, Z+1 ; 0x01 - 474e: c8 0e add r12, r24 - 4750: d9 1e adc r13, r25 - 4752: c0 82 st Z, r12 - 4754: d1 82 std Z+1, r13 ; 0x01 - 4756: 85 e0 ldi r24, 0x05 ; 5 - 4758: 0d c0 rjmp .+26 ; 0x4774 - 475a: de d2 rcall .+1468 ; 0x4d18 - 475c: 88 23 and r24, r24 - 475e: 01 f3 breq .-64 ; 0x4720 - 4760: 09 c0 rjmp .+18 ; 0x4774 - 4762: 89 91 ld r24, Y+ - 4764: 3c d1 rcall .+632 ; 0x49de - 4766: 01 50 subi r16, 0x01 ; 1 - 4768: 11 09 sbc r17, r1 - 476a: ff ef ldi r31, 0xFF ; 255 - 476c: cf 1a sub r12, r31 - 476e: df 0a sbc r13, r31 - 4770: d7 cf rjmp .-82 ; 0x4720 - 4772: 80 e0 ldi r24, 0x00 ; 0 - 4774: df 91 pop r29 - 4776: cf 91 pop r28 - 4778: 1f 91 pop r17 - 477a: 0f 91 pop r16 - 477c: ff 90 pop r15 - 477e: ef 90 pop r14 - 4780: df 90 pop r13 - 4782: cf 90 pop r12 - 4784: 08 95 ret - -00004786 : - 4786: df 92 push r13 - 4788: ef 92 push r14 - 478a: ff 92 push r15 - 478c: 0f 93 push r16 - 478e: 1f 93 push r17 - 4790: cf 93 push r28 - 4792: df 93 push r29 - 4794: d8 2f mov r29, r24 - 4796: c9 2f mov r28, r25 - 4798: 8b 01 movw r16, r22 - 479a: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 479e: 80 68 ori r24, 0x80 ; 128 - 47a0: 2e d1 rcall .+604 ; 0x49fe - 47a2: 20 91 65 23 lds r18, 0x2365 ; 0x802365 - 47a6: 30 91 66 23 lds r19, 0x2366 ; 0x802366 - 47aa: 20 17 cp r18, r16 - 47ac: 31 07 cpc r19, r17 - 47ae: 28 f0 brcs .+10 ; 0x47ba - 47b0: 01 15 cp r16, r1 - 47b2: 11 05 cpc r17, r1 - 47b4: 19 f4 brne .+6 ; 0x47bc - 47b6: db d0 rcall .+438 ; 0x496e - 47b8: 01 c0 rjmp .+2 ; 0x47bc - 47ba: 89 01 movw r16, r18 - 47bc: ed 2e mov r14, r29 - 47be: fc 2e mov r15, r28 - 47c0: d1 2c mov r13, r1 - 47c2: 01 15 cp r16, r1 - 47c4: 11 05 cpc r17, r1 - 47c6: 09 f4 brne .+2 ; 0x47ca - 47c8: 3e c0 rjmp .+124 ; 0x4846 - 47ca: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 47ce: 81 11 cpse r24, r1 - 47d0: 02 c0 rjmp .+4 ; 0x47d6 - 47d2: 82 e0 ldi r24, 0x02 ; 2 - 47d4: 49 c0 rjmp .+146 ; 0x4868 - 47d6: 85 30 cpi r24, 0x05 ; 5 - 47d8: 11 f4 brne .+4 ; 0x47de - 47da: 83 e0 ldi r24, 0x03 ; 3 - 47dc: 45 c0 rjmp .+138 ; 0x4868 - 47de: 6a d1 rcall .+724 ; 0x4ab4 - 47e0: 81 11 cpse r24, r1 - 47e2: 41 c0 rjmp .+130 ; 0x4866 - 47e4: 4d d1 rcall .+666 ; 0x4a80 - 47e6: 81 11 cpse r24, r1 - 47e8: 39 c0 rjmp .+114 ; 0x485c - 47ea: 3e d1 rcall .+636 ; 0x4a68 - 47ec: 88 23 and r24, r24 - 47ee: 49 f3 breq .-46 ; 0x47c2 - 47f0: 20 91 6b 23 lds r18, 0x236B ; 0x80236b - 47f4: 80 91 67 23 lds r24, 0x2367 ; 0x802367 - 47f8: 90 91 68 23 lds r25, 0x2368 ; 0x802368 - 47fc: fc 01 movw r30, r24 - 47fe: 27 ff sbrs r18, 7 - 4800: 05 c0 rjmp .+10 ; 0x480c - 4802: ef 5b subi r30, 0xBF ; 191 - 4804: ff 4f sbci r31, 0xFF ; 255 - 4806: c0 81 ld r28, Z - 4808: d0 e0 ldi r29, 0x00 ; 0 - 480a: 13 c0 rjmp .+38 ; 0x4832 - 480c: e0 5c subi r30, 0xC0 ; 192 - 480e: ff 4f sbci r31, 0xFF ; 255 - 4810: c0 81 ld r28, Z - 4812: 31 96 adiw r30, 0x01 ; 1 - 4814: 80 81 ld r24, Z - 4816: d0 e0 ldi r29, 0x00 ; 0 - 4818: c8 1b sub r28, r24 - 481a: d1 09 sbc r29, r1 - 481c: 0a c0 rjmp .+20 ; 0x4832 - 481e: c8 30 cpi r28, 0x08 ; 8 - 4820: d1 05 cpc r29, r1 - 4822: 50 f4 brcc .+20 ; 0x4838 - 4824: f7 01 movw r30, r14 - 4826: 81 91 ld r24, Z+ - 4828: 7f 01 movw r14, r30 - 482a: d9 d0 rcall .+434 ; 0x49de - 482c: 01 50 subi r16, 0x01 ; 1 - 482e: 11 09 sbc r17, r1 - 4830: 21 96 adiw r28, 0x01 ; 1 - 4832: 01 15 cp r16, r1 - 4834: 11 05 cpc r17, r1 - 4836: 99 f7 brne .-26 ; 0x481e - 4838: dd 24 eor r13, r13 - 483a: d3 94 inc r13 - 483c: 28 97 sbiw r28, 0x08 ; 8 - 483e: 09 f0 breq .+2 ; 0x4842 - 4840: d1 2c mov r13, r1 - 4842: 95 d0 rcall .+298 ; 0x496e - 4844: be cf rjmp .-132 ; 0x47c2 - 4846: d1 10 cpse r13, r1 - 4848: c0 cf rjmp .-128 ; 0x47ca - 484a: 08 c0 rjmp .+16 ; 0x485c - 484c: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 4850: 88 23 and r24, r24 - 4852: 09 f4 brne .+2 ; 0x4856 - 4854: be cf rjmp .-132 ; 0x47d2 - 4856: 85 30 cpi r24, 0x05 ; 5 - 4858: 09 f4 brne .+2 ; 0x485c - 485a: bf cf rjmp .-130 ; 0x47da - 485c: 11 d1 rcall .+546 ; 0x4a80 - 485e: 88 23 and r24, r24 - 4860: a9 f3 breq .-22 ; 0x484c - 4862: 80 e0 ldi r24, 0x00 ; 0 - 4864: 01 c0 rjmp .+2 ; 0x4868 - 4866: 81 e0 ldi r24, 0x01 ; 1 - 4868: df 91 pop r29 - 486a: cf 91 pop r28 - 486c: 1f 91 pop r17 - 486e: 0f 91 pop r16 - 4870: ff 90 pop r15 - 4872: ef 90 pop r14 - 4874: df 90 pop r13 - 4876: 08 95 ret - -00004878 : - -#if defined(TEMPLATE_FUNC_NAME) - -uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, - uint16_t Length) -{ - 4878: df 92 push r13 - 487a: ef 92 push r14 - 487c: ff 92 push r15 - 487e: 0f 93 push r16 - 4880: 1f 93 push r17 - 4882: cf 93 push r28 - 4884: df 93 push r29 - 4886: d8 2f mov r29, r24 - 4888: c9 2f mov r28, r25 - 488a: 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); - 488c: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4890: 80 68 ori r24, 0x80 ; 128 - 4892: b5 d0 rcall .+362 ; 0x49fe - - if (Length > USB_ControlRequest.wLength) - 4894: 20 91 65 23 lds r18, 0x2365 ; 0x802365 - 4898: 30 91 66 23 lds r19, 0x2366 ; 0x802366 - 489c: 20 17 cp r18, r16 - 489e: 31 07 cpc r19, r17 - 48a0: 28 f0 brcs .+10 ; 0x48ac - Length = USB_ControlRequest.wLength; - else if (!(Length)) - 48a2: 01 15 cp r16, r1 - 48a4: 11 05 cpc r17, r1 - 48a6: 19 f4 brne .+6 ; 0x48ae - Endpoint_ClearIN(); - 48a8: 62 d0 rcall .+196 ; 0x496e - 48aa: 01 c0 rjmp .+2 ; 0x48ae - 48ac: 89 01 movw r16, r18 - 48ae: ed 2e mov r14, r29 - 48b0: fc 2e mov r15, r28 - 48b2: d1 2c mov r13, r1 - - while (Length || LastPacketFull) - 48b4: 01 15 cp r16, r1 - 48b6: 11 05 cpc r17, r1 - 48b8: 09 f4 brne .+2 ; 0x48bc - 48ba: 40 c0 rjmp .+128 ; 0x493c - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 48bc: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 48c0: 81 11 cpse r24, r1 - 48c2: 02 c0 rjmp .+4 ; 0x48c8 - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - 48c4: 82 e0 ldi r24, 0x02 ; 2 - 48c6: 4b c0 rjmp .+150 ; 0x495e - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 48c8: 85 30 cpi r24, 0x05 ; 5 - 48ca: 11 f4 brne .+4 ; 0x48d0 - return ENDPOINT_RWCSTREAM_BusSuspended; - 48cc: 83 e0 ldi r24, 0x03 ; 3 - 48ce: 47 c0 rjmp .+142 ; 0x495e - else if (Endpoint_IsSETUPReceived()) - 48d0: f1 d0 rcall .+482 ; 0x4ab4 - 48d2: 81 11 cpse r24, r1 - 48d4: 43 c0 rjmp .+134 ; 0x495c - return ENDPOINT_RWCSTREAM_HostAborted; - else if (Endpoint_IsOUTReceived()) - 48d6: d4 d0 rcall .+424 ; 0x4a80 - 48d8: 81 11 cpse r24, r1 - 48da: 3b c0 rjmp .+118 ; 0x4952 - break; - - if (Endpoint_IsINReady()) - 48dc: c5 d0 rcall .+394 ; 0x4a68 - 48de: 88 23 and r24, r24 - 48e0: 49 f3 breq .-46 ; 0x48b4 - * \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) - 48e2: 20 91 6b 23 lds r18, 0x236B ; 0x80236b - 48e6: 80 91 67 23 lds r24, 0x2367 ; 0x802367 - 48ea: 90 91 68 23 lds r25, 0x2368 ; 0x802368 - return USB_Endpoint_SelectedFIFO->Position; - 48ee: fc 01 movw r30, r24 - * \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) - 48f0: 27 ff sbrs r18, 7 - 48f2: 05 c0 rjmp .+10 ; 0x48fe - return USB_Endpoint_SelectedFIFO->Position; - 48f4: ef 5b subi r30, 0xBF ; 191 - 48f6: ff 4f sbci r31, 0xFF ; 255 - 48f8: c0 81 ld r28, Z - 48fa: d0 e0 ldi r29, 0x00 ; 0 - 48fc: 15 c0 rjmp .+42 ; 0x4928 - else - return (USB_Endpoint_SelectedFIFO->Length - USB_Endpoint_SelectedFIFO->Position); - 48fe: e0 5c subi r30, 0xC0 ; 192 - 4900: ff 4f sbci r31, 0xFF ; 255 - 4902: c0 81 ld r28, Z - 4904: 31 96 adiw r30, 0x01 ; 1 - 4906: 80 81 ld r24, Z - 4908: d0 e0 ldi r29, 0x00 ; 0 - 490a: c8 1b sub r28, r24 - 490c: d1 09 sbc r29, r1 - 490e: 0c c0 rjmp .+24 ; 0x4928 - { - uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); - - while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) - 4910: c8 30 cpi r28, 0x08 ; 8 - 4912: d1 05 cpc r29, r1 - 4914: 60 f4 brcc .+24 ; 0x492e - { - TEMPLATE_TRANSFER_BYTE(DataStream); - 4916: f7 01 movw r30, r14 - 4918: 84 91 lpm r24, Z - 491a: 61 d0 rcall .+194 ; 0x49de - TEMPLATE_BUFFER_MOVE(DataStream, 1); - 491c: ff ef ldi r31, 0xFF ; 255 - 491e: ef 1a sub r14, r31 - 4920: ff 0a sbc r15, r31 - Length--; - 4922: 01 50 subi r16, 0x01 ; 1 - 4924: 11 09 sbc r17, r1 - BytesInEndpoint++; - 4926: 21 96 adiw r28, 0x01 ; 1 - - if (Endpoint_IsINReady()) - { - uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); - - while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) - 4928: 01 15 cp r16, r1 - 492a: 11 05 cpc r17, r1 - 492c: 89 f7 brne .-30 ; 0x4910 - TEMPLATE_BUFFER_MOVE(DataStream, 1); - Length--; - BytesInEndpoint++; - } - - LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); - 492e: dd 24 eor r13, r13 - 4930: d3 94 inc r13 - 4932: 28 97 sbiw r28, 0x08 ; 8 - 4934: 09 f0 breq .+2 ; 0x4938 - 4936: d1 2c mov r13, r1 - Endpoint_ClearIN(); - 4938: 1a d0 rcall .+52 ; 0x496e - 493a: bc cf rjmp .-136 ; 0x48b4 - if (Length > USB_ControlRequest.wLength) - Length = USB_ControlRequest.wLength; - else if (!(Length)) - Endpoint_ClearIN(); - - while (Length || LastPacketFull) - 493c: d1 10 cpse r13, r1 - 493e: be cf rjmp .-132 ; 0x48bc - 4940: 08 c0 rjmp .+16 ; 0x4952 - } - } - - while (!(Endpoint_IsOUTReceived())) - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 4942: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 4946: 88 23 and r24, r24 - 4948: 09 f4 brne .+2 ; 0x494c - 494a: bc cf rjmp .-136 ; 0x48c4 - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 494c: 85 30 cpi r24, 0x05 ; 5 - 494e: 09 f4 brne .+2 ; 0x4952 - 4950: bd cf rjmp .-134 ; 0x48cc - LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); - Endpoint_ClearIN(); - } - } - - while (!(Endpoint_IsOUTReceived())) - 4952: 96 d0 rcall .+300 ; 0x4a80 - 4954: 88 23 and r24, r24 - 4956: a9 f3 breq .-22 ; 0x4942 - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; - 4958: 80 e0 ldi r24, 0x00 ; 0 - 495a: 01 c0 rjmp .+2 ; 0x495e - 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; - 495c: 81 e0 ldi r24, 0x01 ; 1 - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; -} - 495e: df 91 pop r29 - 4960: cf 91 pop r28 - 4962: 1f 91 pop r17 - 4964: 0f 91 pop r16 - 4966: ff 90 pop r15 - 4968: ef 90 pop r14 - 496a: df 90 pop r13 - 496c: 08 95 ret - -0000496e : - USB_Endpoint_SelectedFIFO->Position = 0; -} - -void Endpoint_ClearIN(void) -{ - USB_Endpoint_SelectedHandle->CNT = USB_Endpoint_SelectedFIFO->Position; - 496e: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4972: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4976: a0 91 67 23 lds r26, 0x2367 ; 0x802367 - 497a: b0 91 68 23 lds r27, 0x2368 ; 0x802368 - 497e: af 5b subi r26, 0xBF ; 191 - 4980: bf 4f sbci r27, 0xFF ; 255 - 4982: 8c 91 ld r24, X - 4984: 90 e0 ldi r25, 0x00 ; 0 - 4986: 82 83 std Z+2, r24 ; 0x02 - 4988: 93 83 std Z+3, r25 ; 0x03 - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 498a: 80 81 ld r24, Z - 498c: 8d 79 andi r24, 0x9D ; 157 - 498e: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 4990: e0 91 67 23 lds r30, 0x2367 ; 0x802367 - 4994: f0 91 68 23 lds r31, 0x2368 ; 0x802368 - 4998: ef 5b subi r30, 0xBF ; 191 - 499a: ff 4f sbci r31, 0xFF ; 255 - 499c: 10 82 st Z, r1 - 499e: 08 95 ret - -000049a0 : -} - -void Endpoint_ClearOUT(void) -{ - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 49a0: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 49a4: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 49a8: 80 81 ld r24, Z - 49aa: 8d 79 andi r24, 0x9D ; 157 - 49ac: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 49ae: e0 91 67 23 lds r30, 0x2367 ; 0x802367 - 49b2: f0 91 68 23 lds r31, 0x2368 ; 0x802368 - 49b6: ef 5b subi r30, 0xBF ; 191 - 49b8: ff 4f sbci r31, 0xFF ; 255 - 49ba: 10 82 st Z, r1 - 49bc: 08 95 ret - -000049be : - } -} - -uint8_t Endpoint_Read_8(void) -{ - return USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++]; - 49be: 80 91 67 23 lds r24, 0x2367 ; 0x802367 - 49c2: 90 91 68 23 lds r25, 0x2368 ; 0x802368 - 49c6: fc 01 movw r30, r24 - 49c8: ef 5b subi r30, 0xBF ; 191 - 49ca: ff 4f sbci r31, 0xFF ; 255 - 49cc: 20 81 ld r18, Z - 49ce: 31 e0 ldi r19, 0x01 ; 1 - 49d0: 32 0f add r19, r18 - 49d2: 30 83 st Z, r19 - 49d4: fc 01 movw r30, r24 - 49d6: e2 0f add r30, r18 - 49d8: f1 1d adc r31, r1 - 49da: 80 81 ld r24, Z -} - 49dc: 08 95 ret - -000049de : - -void Endpoint_Write_8(const uint8_t Data) -{ - USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; - 49de: 20 91 67 23 lds r18, 0x2367 ; 0x802367 - 49e2: 30 91 68 23 lds r19, 0x2368 ; 0x802368 - 49e6: f9 01 movw r30, r18 - 49e8: ef 5b subi r30, 0xBF ; 191 - 49ea: ff 4f sbci r31, 0xFF ; 255 - 49ec: 90 81 ld r25, Z - 49ee: 41 e0 ldi r20, 0x01 ; 1 - 49f0: 49 0f add r20, r25 - 49f2: 40 83 st Z, r20 - 49f4: f9 01 movw r30, r18 - 49f6: e9 0f add r30, r25 - 49f8: f1 1d adc r31, r1 - 49fa: 80 83 st Z, r24 - 49fc: 08 95 ret - -000049fe : - -void Endpoint_SelectEndpoint(const uint8_t Address) -{ - uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); - - USB_Endpoint_SelectedEndpoint = Address; - 49fe: 80 93 6b 23 sts 0x236B, r24 ; 0x80236b - USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; -} - -void Endpoint_SelectEndpoint(const uint8_t Address) -{ - uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); - 4a02: 48 2f mov r20, r24 - 4a04: 4f 70 andi r20, 0x0F ; 15 - - USB_Endpoint_SelectedEndpoint = Address; - - Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; - 4a06: 50 e0 ldi r21, 0x00 ; 0 - USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; - 4a08: 60 91 c6 04 lds r22, 0x04C6 ; 0x8004c6 <__TEXT_REGION_LENGTH__+0x7004c6> - 4a0c: 70 91 c7 04 lds r23, 0x04C7 ; 0x8004c7 <__TEXT_REGION_LENGTH__+0x7004c7> - 4a10: 9a 01 movw r18, r20 - 4a12: 94 e0 ldi r25, 0x04 ; 4 - 4a14: 22 0f add r18, r18 - 4a16: 33 1f adc r19, r19 - 4a18: 9a 95 dec r25 - 4a1a: e1 f7 brne .-8 ; 0x4a14 - - if (Address & ENDPOINT_DIR_IN) - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; - 4a1c: e4 e8 ldi r30, 0x84 ; 132 - USB_Endpoint_SelectedEndpoint = Address; - - Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; - USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; - - if (Address & ENDPOINT_DIR_IN) - 4a1e: 87 ff sbrs r24, 7 - 4a20: 11 c0 rjmp .+34 ; 0x4a44 - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; - 4a22: e4 9f mul r30, r20 - 4a24: c0 01 movw r24, r0 - 4a26: e5 9f mul r30, r21 - 4a28: 90 0d add r25, r0 - 4a2a: 11 24 eor r1, r1 - 4a2c: 82 55 subi r24, 0x52 ; 82 - 4a2e: 9c 4d sbci r25, 0xDC ; 220 - 4a30: 80 93 67 23 sts 0x2367, r24 ; 0x802367 - 4a34: 90 93 68 23 sts 0x2368, r25 ; 0x802368 - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; - 4a38: c9 01 movw r24, r18 - 4a3a: 08 96 adiw r24, 0x08 ; 8 - 4a3c: 9b 01 movw r18, r22 - 4a3e: 28 0f add r18, r24 - 4a40: 39 1f adc r19, r25 - 4a42: 0d c0 rjmp .+26 ; 0x4a5e - } - else - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; - 4a44: e4 9f mul r30, r20 - 4a46: c0 01 movw r24, r0 - 4a48: e5 9f mul r30, r21 - 4a4a: 90 0d add r25, r0 - 4a4c: 11 24 eor r1, r1 - 4a4e: 84 59 subi r24, 0x94 ; 148 - 4a50: 9c 4d sbci r25, 0xDC ; 220 - 4a52: 80 93 67 23 sts 0x2367, r24 ; 0x802367 - 4a56: 90 93 68 23 sts 0x2368, r25 ; 0x802368 - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; - 4a5a: 26 0f add r18, r22 - 4a5c: 37 1f adc r19, r23 - 4a5e: 20 93 69 23 sts 0x2369, r18 ; 0x802369 - 4a62: 30 93 6a 23 sts 0x236A, r19 ; 0x80236a - 4a66: 08 95 ret - -00004a68 : -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); - 4a68: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4a6c: 80 68 ori r24, 0x80 ; 128 - 4a6e: c7 df rcall .-114 ; 0x49fe - - return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); - 4a70: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4a74: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4a78: 80 81 ld r24, Z -} - 4a7a: 86 95 lsr r24 - 4a7c: 81 70 andi r24, 0x01 ; 1 - 4a7e: 08 95 ret - -00004a80 : - -bool Endpoint_IsOUTReceived(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 4a80: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4a84: 8f 77 andi r24, 0x7F ; 127 - 4a86: bb df rcall .-138 ; 0x49fe - - if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_TRNCOMPL0_bm) - 4a88: a0 91 69 23 lds r26, 0x2369 ; 0x802369 - 4a8c: b0 91 6a 23 lds r27, 0x236A ; 0x80236a - 4a90: 8c 91 ld r24, X - 4a92: 85 ff sbrs r24, 5 - 4a94: 0d c0 rjmp .+26 ; 0x4ab0 - { - USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; - 4a96: e0 91 67 23 lds r30, 0x2367 ; 0x802367 - 4a9a: f0 91 68 23 lds r31, 0x2368 ; 0x802368 - 4a9e: 12 96 adiw r26, 0x02 ; 2 - 4aa0: 8d 91 ld r24, X+ - 4aa2: 9c 91 ld r25, X - 4aa4: 13 97 sbiw r26, 0x03 ; 3 - 4aa6: e0 5c subi r30, 0xC0 ; 192 - 4aa8: ff 4f sbci r31, 0xFF ; 255 - 4aaa: 80 83 st Z, r24 - return true; - 4aac: 81 e0 ldi r24, 0x01 ; 1 - 4aae: 08 95 ret - } - - return false; - 4ab0: 80 e0 ldi r24, 0x00 ; 0 -} - 4ab2: 08 95 ret - -00004ab4 : - -bool Endpoint_IsSETUPReceived(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 4ab4: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4ab8: 8f 77 andi r24, 0x7F ; 127 - 4aba: a1 df rcall .-190 ; 0x49fe - - if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_SETUP_bm) - 4abc: a0 91 69 23 lds r26, 0x2369 ; 0x802369 - 4ac0: b0 91 6a 23 lds r27, 0x236A ; 0x80236a - 4ac4: 8c 91 ld r24, X - 4ac6: 84 ff sbrs r24, 4 - 4ac8: 0d c0 rjmp .+26 ; 0x4ae4 - { - USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; - 4aca: e0 91 67 23 lds r30, 0x2367 ; 0x802367 - 4ace: f0 91 68 23 lds r31, 0x2368 ; 0x802368 - 4ad2: 12 96 adiw r26, 0x02 ; 2 - 4ad4: 8d 91 ld r24, X+ - 4ad6: 9c 91 ld r25, X - 4ad8: 13 97 sbiw r26, 0x03 ; 3 - 4ada: e0 5c subi r30, 0xC0 ; 192 - 4adc: ff 4f sbci r31, 0xFF ; 255 - 4ade: 80 83 st Z, r24 - return true; - 4ae0: 81 e0 ldi r24, 0x01 ; 1 - 4ae2: 08 95 ret - } - - return false; - 4ae4: 80 e0 ldi r24, 0x00 ; 0 -} - 4ae6: 08 95 ret - -00004ae8 : - -void Endpoint_ClearSETUP(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 4ae8: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4aec: 8f 77 andi r24, 0x7F ; 127 - 4aee: 87 df rcall .-242 ; 0x49fe - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 4af0: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4af4: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4af8: 80 81 ld r24, Z - 4afa: 8d 78 andi r24, 0x8D ; 141 - 4afc: 80 83 st Z, r24 - USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; - 4afe: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b02: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b06: 80 81 ld r24, Z - 4b08: 81 60 ori r24, 0x01 ; 1 - 4b0a: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 4b0c: e0 91 67 23 lds r30, 0x2367 ; 0x802367 - 4b10: f0 91 68 23 lds r31, 0x2368 ; 0x802368 - 4b14: ef 5b subi r30, 0xBF ; 191 - 4b16: ff 4f sbci r31, 0xFF ; 255 - 4b18: 10 82 st Z, r1 - - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - 4b1a: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4b1e: 80 68 ori r24, 0x80 ; 128 - 4b20: 6e df rcall .-292 ; 0x49fe - USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; - 4b22: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b26: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b2a: 80 81 ld r24, Z - 4b2c: 81 60 ori r24, 0x01 ; 1 - 4b2e: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 4b30: e0 91 67 23 lds r30, 0x2367 ; 0x802367 - 4b34: f0 91 68 23 lds r31, 0x2368 ; 0x802368 - 4b38: ef 5b subi r30, 0xBF ; 191 - 4b3a: ff 4f sbci r31, 0xFF ; 255 - 4b3c: 10 82 st Z, r1 - 4b3e: 08 95 ret - -00004b40 : - USB_Endpoint_SelectedFIFO->Position = 0; -} - -void Endpoint_StallTransaction(void) -{ - USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; - 4b40: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b44: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b48: 81 81 ldd r24, Z+1 ; 0x01 - 4b4a: 84 60 ori r24, 0x04 ; 4 - 4b4c: 81 83 std Z+1, r24 ; 0x01 - - if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc) - 4b4e: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b52: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b56: 81 81 ldd r24, Z+1 ; 0x01 - 4b58: 80 7c andi r24, 0xC0 ; 192 - 4b5a: 80 34 cpi r24, 0x40 ; 64 - 4b5c: 59 f4 brne .+22 ; 0x4b74 - { - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN); - 4b5e: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 4b62: 80 58 subi r24, 0x80 ; 128 - 4b64: 4c df rcall .-360 ; 0x49fe - USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; - 4b66: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b6a: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b6e: 81 81 ldd r24, Z+1 ; 0x01 - 4b70: 84 60 ori r24, 0x04 ; 4 - 4b72: 81 83 std Z+1, r24 ; 0x01 - 4b74: 08 95 ret - -00004b76 : -} - -bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address, - const uint8_t Config, - const uint8_t Size) -{ - 4b76: 1f 93 push r17 - 4b78: cf 93 push r28 - 4b7a: df 93 push r29 - 4b7c: 00 d0 rcall .+0 ; 0x4b7e - 4b7e: cd b7 in r28, 0x3d ; 61 - 4b80: de b7 in r29, 0x3e ; 62 - 4b82: 18 2f mov r17, r24 - Endpoint_SelectEndpoint(Address); - 4b84: 4a 83 std Y+2, r20 ; 0x02 - 4b86: 69 83 std Y+1, r22 ; 0x01 - 4b88: 3a df rcall .-396 ; 0x49fe - - USB_Endpoint_SelectedHandle->CTRL = 0; - 4b8a: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b8e: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b92: 11 82 std Z+1, r1 ; 0x01 - USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; - 4b94: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4b98: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4b9c: 81 2f mov r24, r17 - 4b9e: 88 1f adc r24, r24 - 4ba0: 88 27 eor r24, r24 - 4ba2: 88 1f adc r24, r24 - 4ba4: 88 0f add r24, r24 - 4ba6: 80 83 st Z, r24 - USB_Endpoint_SelectedHandle->CTRL = Config; - 4ba8: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4bac: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4bb0: 69 81 ldd r22, Y+1 ; 0x01 - 4bb2: 61 83 std Z+1, r22 ; 0x01 - USB_Endpoint_SelectedHandle->CNT = 0; - 4bb4: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4bb8: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4bbc: 12 82 std Z+2, r1 ; 0x02 - 4bbe: 13 82 std Z+3, r1 ; 0x03 - USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; - 4bc0: 20 91 67 23 lds r18, 0x2367 ; 0x802367 - 4bc4: 30 91 68 23 lds r19, 0x2368 ; 0x802368 - 4bc8: 24 83 std Z+4, r18 ; 0x04 - 4bca: 35 83 std Z+5, r19 ; 0x05 - - USB_Endpoint_SelectedFIFO->Length = (Address & ENDPOINT_DIR_IN) ? Size : 0; - 4bcc: 11 0f add r17, r17 - 4bce: 11 0b sbc r17, r17 - 4bd0: 4a 81 ldd r20, Y+2 ; 0x02 - 4bd2: 41 23 and r20, r17 - 4bd4: f9 01 movw r30, r18 - 4bd6: e0 5c subi r30, 0xC0 ; 192 - 4bd8: ff 4f sbci r31, 0xFF ; 255 - 4bda: 40 83 st Z, r20 - USB_Endpoint_SelectedFIFO->Position = 0; - 4bdc: 31 96 adiw r30, 0x01 ; 1 - 4bde: 10 82 st Z, r1 - - return true; -} - 4be0: 81 e0 ldi r24, 0x01 ; 1 - 4be2: 0f 90 pop r0 - 4be4: 0f 90 pop r0 - 4be6: df 91 pop r29 - 4be8: cf 91 pop r28 - 4bea: 1f 91 pop r17 - 4bec: 08 95 ret - -00004bee : - } -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - const uint8_t Entries) -{ - 4bee: af 92 push r10 - 4bf0: bf 92 push r11 - 4bf2: cf 92 push r12 - 4bf4: df 92 push r13 - 4bf6: ef 92 push r14 - 4bf8: ff 92 push r15 - 4bfa: 0f 93 push r16 - 4bfc: 1f 93 push r17 - 4bfe: cf 93 push r28 - 4c00: df 93 push r29 - 4c02: a6 2e mov r10, r22 - 4c04: 8c 01 movw r16, r24 - 4c06: 7c 01 movw r14, r24 - 4c08: 84 e0 ldi r24, 0x04 ; 4 - 4c0a: e8 0e add r14, r24 - 4c0c: f1 1c adc r15, r1 - for (uint8_t i = 0; i < Entries; i++) - 4c0e: b1 2c mov r11, r1 - 4c10: ba 14 cp r11, r10 - 4c12: 09 f4 brne .+2 ; 0x4c16 - 4c14: 43 c0 rjmp .+134 ; 0x4c9c - { - if (!(Table[i].Address)) - 4c16: f8 01 movw r30, r16 - 4c18: d0 81 ld r29, Z - 4c1a: dd 23 and r29, r29 - 4c1c: c1 f1 breq .+112 ; 0x4c8e - continue; - - if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) - 4c1e: c1 80 ldd r12, Z+1 ; 0x01 - 4c20: d2 80 ldd r13, Z+2 ; 0x02 - 4c22: f7 01 movw r30, r14 - 4c24: 31 97 sbiw r30, 0x01 ; 1 - 4c26: 80 81 ld r24, Z - 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)); - 4c28: f7 01 movw r30, r14 - 4c2a: 90 81 ld r25, Z - 4c2c: 92 30 cpi r25, 0x02 ; 2 - 4c2e: 10 f4 brcc .+4 ; 0x4c34 - 4c30: 98 e0 ldi r25, 0x08 ; 8 - 4c32: 01 c0 rjmp .+2 ; 0x4c36 - 4c34: 98 e1 ldi r25, 0x18 ; 24 - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST - ATTR_ALWAYS_INLINE; - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) - { - uint8_t MaskVal = 0; - uint16_t CheckBytes = 8; - 4c36: 28 e0 ldi r18, 0x08 ; 8 - 4c38: 30 e0 ldi r19, 0x00 ; 0 - /* Inline Functions: */ - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST - ATTR_ALWAYS_INLINE; - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) - { - uint8_t MaskVal = 0; - 4c3a: c0 e0 ldi r28, 0x00 ; 0 - uint16_t CheckBytes = 8; - - while (CheckBytes < Bytes) - 4c3c: 2c 15 cp r18, r12 - 4c3e: 3d 05 cpc r19, r13 - 4c40: 20 f4 brcc .+8 ; 0x4c4a - { - MaskVal++; - 4c42: cf 5f subi r28, 0xFF ; 255 - CheckBytes <<= 1; - 4c44: 22 0f add r18, r18 - 4c46: 33 1f adc r19, r19 - 4c48: f9 cf rjmp .-14 ; 0x4c3c - 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)); - 4c4a: c9 2b or r28, r25 - - if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) - 4c4c: 9d 2f mov r25, r29 - 4c4e: 9f 70 andi r25, 0x0F ; 15 - 4c50: 96 30 cpi r25, 0x06 ; 6 - 4c52: 10 f0 brcs .+4 ; 0x4c58 - { - return false; - 4c54: 80 e0 ldi r24, 0x00 ; 0 - 4c56: 23 c0 rjmp .+70 ; 0x4c9e - return false; - - // TODO - Fix once limitations are lifted - EPConfigMask &= ~USB_EP_PINGPONG_bm; - 4c58: cf 7e andi r28, 0xEF ; 239 - if (Size > 64) - 4c5a: f1 e4 ldi r31, 0x41 ; 65 - 4c5c: cf 16 cp r12, r31 - 4c5e: d1 04 cpc r13, r1 - 4c60: c8 f7 brcc .-14 ; 0x4c54 - return false; - - switch (Type) - 4c62: 88 23 and r24, r24 - 4c64: 21 f0 breq .+8 ; 0x4c6e - 4c66: 81 30 cpi r24, 0x01 ; 1 - 4c68: 21 f4 brne .+8 ; 0x4c72 - { - case EP_TYPE_CONTROL: - EPConfigMask |= USB_EP_TYPE_CONTROL_gc; - break; - case EP_TYPE_ISOCHRONOUS: - EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; - 4c6a: c0 6c ori r28, 0xC0 ; 192 - 4c6c: 0a c0 rjmp .+20 ; 0x4c82 - return false; - - switch (Type) - { - case EP_TYPE_CONTROL: - EPConfigMask |= USB_EP_TYPE_CONTROL_gc; - 4c6e: c0 64 ori r28, 0x40 ; 64 - 4c70: 03 c0 rjmp .+6 ; 0x4c78 - break; - case EP_TYPE_ISOCHRONOUS: - EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; - break; - default: - EPConfigMask |= USB_EP_TYPE_BULK_gc; - 4c72: c0 68 ori r28, 0x80 ; 128 - break; - } - - if (Type == EP_TYPE_CONTROL) - 4c74: 81 11 cpse r24, r1 - 4c76: 05 c0 rjmp .+10 ; 0x4c82 - Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 4c78: 4c 2d mov r20, r12 - 4c7a: 6c 2f mov r22, r28 - 4c7c: 80 e8 ldi r24, 0x80 ; 128 - 4c7e: 8d 0f add r24, r29 - 4c80: 7a df rcall .-268 ; 0x4b76 - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 4c82: 4c 2d mov r20, r12 - 4c84: 6c 2f mov r22, r28 - 4c86: 8d 2f mov r24, r29 - 4c88: 76 df rcall .-276 ; 0x4b76 - 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))) - 4c8a: 88 23 and r24, r24 - 4c8c: 19 f3 breq .-58 ; 0x4c54 -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - const uint8_t Entries) -{ - for (uint8_t i = 0; i < Entries; i++) - 4c8e: b3 94 inc r11 - 4c90: 0b 5f subi r16, 0xFB ; 251 - 4c92: 1f 4f sbci r17, 0xFF ; 255 - 4c94: 85 e0 ldi r24, 0x05 ; 5 - 4c96: e8 0e add r14, r24 - 4c98: f1 1c adc r15, r1 - 4c9a: ba cf rjmp .-140 ; 0x4c10 - { - return false; - } - } - - return true; - 4c9c: 81 e0 ldi r24, 0x01 ; 1 -} - 4c9e: df 91 pop r29 - 4ca0: cf 91 pop r28 - 4ca2: 1f 91 pop r17 - 4ca4: 0f 91 pop r16 - 4ca6: ff 90 pop r15 - 4ca8: ef 90 pop r14 - 4caa: df 90 pop r13 - 4cac: cf 90 pop r12 - 4cae: bf 90 pop r11 - 4cb0: af 90 pop r10 - 4cb2: 08 95 ret - -00004cb4 : - - return true; -} - -void Endpoint_ClearEndpoints(void) -{ - 4cb4: 80 e0 ldi r24, 0x00 ; 0 - 4cb6: 90 e0 ldi r25, 0x00 ; 0 - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4cb8: e0 91 c6 04 lds r30, 0x04C6 ; 0x8004c6 <__TEXT_REGION_LENGTH__+0x7004c6> - 4cbc: f0 91 c7 04 lds r31, 0x04C7 ; 0x8004c7 <__TEXT_REGION_LENGTH__+0x7004c7> - 4cc0: 9c 01 movw r18, r24 - 4cc2: 44 e0 ldi r20, 0x04 ; 4 - 4cc4: 22 0f add r18, r18 - 4cc6: 33 1f adc r19, r19 - 4cc8: 4a 95 dec r20 - 4cca: e1 f7 brne .-8 ; 0x4cc4 - 4ccc: e2 0f add r30, r18 - 4cce: f3 1f adc r31, r19 - 4cd0: 11 86 std Z+9, r1 ; 0x09 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4cd2: 40 91 c6 04 lds r20, 0x04C6 ; 0x8004c6 <__TEXT_REGION_LENGTH__+0x7004c6> - 4cd6: 50 91 c7 04 lds r21, 0x04C7 ; 0x8004c7 <__TEXT_REGION_LENGTH__+0x7004c7> - 4cda: fa 01 movw r30, r20 - 4cdc: e2 0f add r30, r18 - 4cde: f3 1f adc r31, r19 - 4ce0: 11 82 std Z+1, r1 ; 0x01 - 4ce2: 01 96 adiw r24, 0x01 ; 1 - return true; -} - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - 4ce4: 86 30 cpi r24, 0x06 ; 6 - 4ce6: 91 05 cpc r25, r1 - 4ce8: 39 f7 brne .-50 ; 0x4cb8 - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - } -} - 4cea: 08 95 ret - -00004cec : - -void Endpoint_ClearStatusStage(void) -{ - if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) - 4cec: 80 91 5f 23 lds r24, 0x235F ; 0x80235f - 4cf0: 87 ff sbrs r24, 7 - 4cf2: 0d c0 rjmp .+26 ; 0x4d0e - { - while (!(Endpoint_IsOUTReceived())) - 4cf4: c5 de rcall .-630 ; 0x4a80 - 4cf6: 81 11 cpse r24, r1 - 4cf8: 05 c0 rjmp .+10 ; 0x4d04 - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - 4cfa: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 4cfe: 81 11 cpse r24, r1 - 4d00: f9 cf rjmp .-14 ; 0x4cf4 - 4d02: 09 c0 rjmp .+18 ; 0x4d16 - return; - } - - Endpoint_ClearOUT(); - 4d04: 4d ce rjmp .-870 ; 0x49a0 - } - else - { - while (!(Endpoint_IsINReady())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - 4d06: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 4d0a: 88 23 and r24, r24 - 4d0c: 21 f0 breq .+8 ; 0x4d16 - - Endpoint_ClearOUT(); - } - else - { - while (!(Endpoint_IsINReady())) - 4d0e: ac de rcall .-680 ; 0x4a68 - 4d10: 88 23 and r24, r24 - 4d12: c9 f3 breq .-14 ; 0x4d06 - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - - Endpoint_ClearIN(); - 4d14: 2c ce rjmp .-936 ; 0x496e - 4d16: 08 95 ret - -00004d18 : - } -} - -#if !defined(CONTROL_ONLY_DEVICE) -uint8_t Endpoint_WaitUntilReady(void) -{ - 4d18: 0f 93 push r16 - 4d1a: 1f 93 push r17 - 4d1c: cf 93 push r28 - * \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; - 4d1e: e0 91 c6 04 lds r30, 0x04C6 ; 0x8004c6 <__TEXT_REGION_LENGTH__+0x7004c6> - 4d22: f0 91 c7 04 lds r31, 0x04C7 ; 0x8004c7 <__TEXT_REGION_LENGTH__+0x7004c7> - 4d26: e0 5a subi r30, 0xA0 ; 160 - 4d28: ff 4f sbci r31, 0xFF ; 255 - 4d2a: 00 81 ld r16, Z - 4d2c: 11 81 ldd r17, Z+1 ; 0x01 - #if (USB_STREAM_TIMEOUT_MS < 0xFF) - uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS; - 4d2e: c4 e6 ldi r28, 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); - 4d30: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - - uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); - - for (;;) - { - if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) - 4d34: 87 ff sbrs r24, 7 - 4d36: 0a c0 rjmp .+20 ; 0x4d4c - { - if (Endpoint_IsINReady()) - 4d38: 97 de rcall .-722 ; 0x4a68 - 4d3a: 81 11 cpse r24, r1 - 4d3c: 05 c0 rjmp .+10 ; 0x4d48 - { - if (Endpoint_IsOUTReceived()) - return ENDPOINT_READYWAIT_NoError; - } - - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 4d3e: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 4d42: 81 11 cpse r24, r1 - 4d44: 05 c0 rjmp .+10 ; 0x4d50 - 4d46: 21 c0 rjmp .+66 ; 0x4d8a - for (;;) - { - if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) - { - if (Endpoint_IsINReady()) - return ENDPOINT_READYWAIT_NoError; - 4d48: 80 e0 ldi r24, 0x00 ; 0 - 4d4a: 24 c0 rjmp .+72 ; 0x4d94 - } - else - { - if (Endpoint_IsOUTReceived()) - 4d4c: 99 de rcall .-718 ; 0x4a80 - 4d4e: f5 cf rjmp .-22 ; 0x4d3a - - 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) - 4d50: 85 30 cpi r24, 0x05 ; 5 - 4d52: e9 f0 breq .+58 ; 0x4d8e - * \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); - 4d54: e0 91 69 23 lds r30, 0x2369 ; 0x802369 - 4d58: f0 91 6a 23 lds r31, 0x236A ; 0x80236a - 4d5c: 81 81 ldd r24, Z+1 ; 0x01 - return ENDPOINT_READYWAIT_BusSuspended; - else if (Endpoint_IsStalled()) - 4d5e: 82 fd sbrc r24, 2 - 4d60: 18 c0 rjmp .+48 ; 0x4d92 - 4d62: e0 91 c6 04 lds r30, 0x04C6 ; 0x8004c6 <__TEXT_REGION_LENGTH__+0x7004c6> - 4d66: f0 91 c7 04 lds r31, 0x04C7 ; 0x8004c7 <__TEXT_REGION_LENGTH__+0x7004c7> - 4d6a: e0 5a subi r30, 0xA0 ; 160 - 4d6c: ff 4f sbci r31, 0xFF ; 255 - 4d6e: 80 81 ld r24, Z - 4d70: 91 81 ldd r25, Z+1 ; 0x01 - return ENDPOINT_READYWAIT_EndpointStalled; - - uint16_t CurrentFrameNumber = USB_Device_GetFrameNumber(); - - if (CurrentFrameNumber != PreviousFrameNumber) - 4d72: 80 17 cp r24, r16 - 4d74: 91 07 cpc r25, r17 - 4d76: e1 f2 breq .-72 ; 0x4d30 - { - PreviousFrameNumber = CurrentFrameNumber; - - if (!(TimeoutMSRem--)) - 4d78: 2f ef ldi r18, 0xFF ; 255 - 4d7a: 2c 0f add r18, r28 - 4d7c: cc 23 and r28, r28 - 4d7e: 19 f0 breq .+6 ; 0x4d86 - 4d80: 8c 01 movw r16, r24 - 4d82: c2 2f mov r28, r18 - 4d84: d5 cf rjmp .-86 ; 0x4d30 - return ENDPOINT_READYWAIT_Timeout; - 4d86: 84 e0 ldi r24, 0x04 ; 4 - 4d88: 05 c0 rjmp .+10 ; 0x4d94 - } - - uint8_t USB_DeviceState_LCL = USB_DeviceState; - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_READYWAIT_DeviceDisconnected; - 4d8a: 82 e0 ldi r24, 0x02 ; 2 - 4d8c: 03 c0 rjmp .+6 ; 0x4d94 - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_READYWAIT_BusSuspended; - 4d8e: 83 e0 ldi r24, 0x03 ; 3 - 4d90: 01 c0 rjmp .+2 ; 0x4d94 - else if (Endpoint_IsStalled()) - return ENDPOINT_READYWAIT_EndpointStalled; - 4d92: 81 e0 ldi r24, 0x01 ; 1 - - if (!(TimeoutMSRem--)) - return ENDPOINT_READYWAIT_Timeout; - } - } -} - 4d94: cf 91 pop r28 - 4d96: 1f 91 pop r17 - 4d98: 0f 91 pop r16 - 4d9a: 08 95 ret - -00004d9c : - USB_ResetInterface(); -} - -void USB_Disable(void) -{ - USB_INT_DisableAllInterrupts(); - 4d9c: 63 d0 rcall .+198 ; 0x4e64 - USB_INT_ClearAllInterrupts(); - 4d9e: 69 d0 rcall .+210 ; 0x4e72 - * 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; - 4da0: e0 ec ldi r30, 0xC0 ; 192 - 4da2: f4 e0 ldi r31, 0x04 ; 4 - 4da4: 81 81 ldd r24, Z+1 ; 0x01 - 4da6: 8e 7f andi r24, 0xFE ; 254 - 4da8: 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; - 4daa: 80 81 ld r24, Z - 4dac: 8f 77 andi r24, 0x7F ; 127 - 4dae: 80 83 st Z, r24 - - USB_Detach(); - USB_Controller_Disable(); - - USB_IsInitialized = false; - 4db0: 10 92 5d 23 sts 0x235D, r1 ; 0x80235d - 4db4: 08 95 ret - -00004db6 : -} - -void USB_ResetInterface(void) -{ - 4db6: cf 93 push r28 - 4db8: 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); - 4dba: e0 e4 ldi r30, 0x40 ; 64 - 4dbc: f0 e0 ldi r31, 0x00 ; 0 - 4dbe: 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); - 4dc0: 84 81 ldd r24, Z+4 ; 0x04 - 4dc2: 81 60 ori r24, 0x01 ; 1 - 4dc4: 84 83 std Z+4, r24 ; 0x04 - else - CLK.USBCTRL |= (CLK_USBSRC_RC32M_gc | CLK_USBSEN_bm); - - USB_Device_SetDeviceAddress(0); - - USB_INT_DisableAllInterrupts(); - 4dc6: 4e d0 rcall .+156 ; 0x4e64 - USB_INT_ClearAllInterrupts(); - 4dc8: 54 d0 rcall .+168 ; 0x4e72 - } - - static inline void USB_Controller_Reset(void) ATTR_ALWAYS_INLINE; - static inline void USB_Controller_Reset(void) - { - USB.CTRLA &= ~USB_ENABLE_bm; - 4dca: c0 ec ldi r28, 0xC0 ; 192 - 4dcc: d4 e0 ldi r29, 0x04 ; 4 - 4dce: 88 81 ld r24, Y - 4dd0: 8f 77 andi r24, 0x7F ; 127 - 4dd2: 88 83 st Y, r24 - USB.CTRLA |= USB_ENABLE_bm; - 4dd4: 88 81 ld r24, Y - 4dd6: 80 68 ori r24, 0x80 ; 128 - 4dd8: 88 83 st Y, r24 -} - -#if defined(USB_CAN_BE_DEVICE) -static void USB_Init_Device(void) -{ - USB_DeviceState = DEVICE_STATE_Unattached; - 4dda: 10 92 5e 23 sts 0x235E, r1 ; 0x80235e - USB_Device_ConfigurationNumber = 0; - 4dde: 10 92 5a 23 sts 0x235A, r1 ; 0x80235a - - #if !defined(NO_DEVICE_REMOTE_WAKEUP) - USB_Device_RemoteWakeupEnabled = false; - 4de2: 10 92 5c 23 sts 0x235C, r1 ; 0x80235c - #endif - - #if !defined(NO_DEVICE_SELF_POWER) - USB_Device_CurrentlySelfPowered = false; - 4de6: 10 92 5b 23 sts 0x235B, r1 ; 0x80235b - } - - static inline void USB_Device_SetFullSpeed(void) ATTR_ALWAYS_INLINE; - static inline void USB_Device_SetFullSpeed(void) - { - USB.CTRLA |= USB_SPEED_bm; - 4dea: 88 81 ld r24, Y - 4dec: 80 64 ori r24, 0x40 ; 64 - 4dee: 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); - 4df0: 48 e0 ldi r20, 0x08 ; 8 - 4df2: 68 e4 ldi r22, 0x48 ; 72 - 4df4: 80 e8 ldi r24, 0x80 ; 128 - 4df6: bf de rcall .-642 ; 0x4b76 - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 4df8: 48 e0 ldi r20, 0x08 ; 8 - 4dfa: 68 e4 ldi r22, 0x48 ; 72 - 4dfc: 80 e0 ldi r24, 0x00 ; 0 - 4dfe: bb de rcall .-650 ; 0x4b76 - static inline void USB_INT_Enable(const uint8_t Interrupt) - { - switch (Interrupt) - { - case USB_INT_BUSEVENTI: - USB.INTCTRLA |= USB_BUSEVIE_bm; - 4e00: 88 85 ldd r24, Y+8 ; 0x08 - 4e02: 80 64 ori r24, 0x40 ; 64 - 4e04: 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; - 4e06: 89 81 ldd r24, Y+1 ; 0x01 - 4e08: 81 60 ori r24, 0x01 ; 1 - 4e0a: 89 83 std Y+1, r24 ; 0x01 - USB_INT_DisableAllInterrupts(); - USB_INT_ClearAllInterrupts(); - - USB_Controller_Reset(); - USB_Init_Device(); -} - 4e0c: df 91 pop r29 - 4e0e: cf 91 pop r28 - 4e10: 08 95 ret - -00004e12 : - - #if !defined(USE_STATIC_OPTIONS) - const uint8_t Options - #endif - ) -{ - 4e12: cf 93 push r28 - 4e14: 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; - 4e16: 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(); - 4e18: f8 94 cli - #endif - - uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); - GlobalInterruptDisable(); - - NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 4e1a: c0 ec ldi r28, 0xC0 ; 192 - 4e1c: d1 e0 ldi r29, 0x01 ; 1 - 4e1e: 22 e0 ldi r18, 0x02 ; 2 - 4e20: 2a 87 std Y+10, r18 ; 0x0a - USB.CAL0 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL0)); - 4e22: ea e1 ldi r30, 0x1A ; 26 - 4e24: f0 e0 ldi r31, 0x00 ; 0 - 4e26: e4 91 lpm r30, Z - 4e28: a0 ec ldi r26, 0xC0 ; 192 - 4e2a: b4 e0 ldi r27, 0x04 ; 4 - 4e2c: da 96 adiw r26, 0x3a ; 58 - 4e2e: ec 93 st X, r30 - 4e30: da 97 sbiw r26, 0x3a ; 58 - USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1)); - 4e32: eb e1 ldi r30, 0x1B ; 27 - 4e34: f0 e0 ldi r31, 0x00 ; 0 - 4e36: e4 91 lpm r30, Z - 4e38: db 96 adiw r26, 0x3b ; 59 - 4e3a: ec 93 st X, r30 - 4e3c: db 97 sbiw r26, 0x3b ; 59 - NVM.CMD = NVM_CMD_NO_OPERATION_gc; - 4e3e: 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)); - 4e40: 85 e8 ldi r24, 0x85 ; 133 - 4e42: 96 e2 ldi r25, 0x26 ; 38 - 4e44: 8e 7f andi r24, 0xFE ; 254 - 4e46: 16 96 adiw r26, 0x06 ; 6 - 4e48: 8d 93 st X+, r24 - 4e4a: 9c 93 st X, r25 - 4e4c: 17 97 sbiw r26, 0x07 ; 7 - USB.CTRLA = (USB_STFRNUM_bm | ((ENDPOINT_TOTAL_ENDPOINTS - 1) << USB_MAXEP_gp)); - 4e4e: 85 e1 ldi r24, 0x15 ; 21 - 4e50: 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); - 4e52: 18 96 adiw r26, 0x08 ; 8 - 4e54: 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; - 4e56: 3f bf out 0x3f, r19 ; 63 - - #if defined(USB_CAN_BE_BOTH) - USB_CurrentMode = Mode; - #endif - - USB_IsInitialized = true; - 4e58: 81 e0 ldi r24, 0x01 ; 1 - 4e5a: 80 93 5d 23 sts 0x235D, r24 ; 0x80235d - - USB_ResetInterface(); -} - 4e5e: df 91 pop r29 - 4e60: cf 91 pop r28 - USB_CurrentMode = Mode; - #endif - - USB_IsInitialized = true; - - USB_ResetInterface(); - 4e62: a9 cf rjmp .-174 ; 0x4db6 - -00004e64 : -#define __INCLUDE_FROM_USB_DRIVER -#include "../USBInterrupt.h" - -void USB_INT_DisableAllInterrupts(void) -{ - USB.INTCTRLA &= USB_INTLVL_gm; - 4e64: e0 ec ldi r30, 0xC0 ; 192 - 4e66: f4 e0 ldi r31, 0x04 ; 4 - 4e68: 80 85 ldd r24, Z+8 ; 0x08 - 4e6a: 83 70 andi r24, 0x03 ; 3 - 4e6c: 80 87 std Z+8, r24 ; 0x08 - USB.INTCTRLB = 0; - 4e6e: 11 86 std Z+9, r1 ; 0x09 - 4e70: 08 95 ret - -00004e72 : -} - -void USB_INT_ClearAllInterrupts(void) -{ - USB.INTFLAGSACLR = 0xFF; - 4e72: e0 ec ldi r30, 0xC0 ; 192 - 4e74: f4 e0 ldi r31, 0x04 ; 4 - 4e76: 8f ef ldi r24, 0xFF ; 255 - 4e78: 82 87 std Z+10, r24 ; 0x0a - USB.INTFLAGSBCLR = 0xFF; - 4e7a: 84 87 std Z+12, r24 ; 0x0c - 4e7c: 08 95 ret - -00004e7e <__vector_125>: -} - -ISR(USB_BUSEVENT_vect) -{ - 4e7e: 1f 92 push r1 - 4e80: 0f 92 push r0 - 4e82: 0f b6 in r0, 0x3f ; 63 - 4e84: 0f 92 push r0 - 4e86: 11 24 eor r1, r1 - 4e88: 2f 93 push r18 - 4e8a: 3f 93 push r19 - 4e8c: 4f 93 push r20 - 4e8e: 5f 93 push r21 - 4e90: 6f 93 push r22 - 4e92: 7f 93 push r23 - 4e94: 8f 93 push r24 - 4e96: 9f 93 push r25 - 4e98: af 93 push r26 - 4e9a: bf 93 push r27 - 4e9c: ef 93 push r30 - 4e9e: 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); - 4ea0: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - #if !defined(NO_SOF_EVENTS) - if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) - 4ea4: 87 ff sbrs r24, 7 - 4ea6: 08 c0 rjmp .+16 ; 0x4eb8 <__vector_125+0x3a> - 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); - 4ea8: 80 91 c8 04 lds r24, 0x04C8 ; 0x8004c8 <__TEXT_REGION_LENGTH__+0x7004c8> - 4eac: 87 ff sbrs r24, 7 - 4eae: 04 c0 rjmp .+8 ; 0x4eb8 <__vector_125+0x3a> - break; - case USB_INT_BUSEVENTI_Reset: - USB.INTFLAGSACLR = USB_RSTIF_bm; - break; - case USB_INT_SOFI: - USB.INTFLAGSACLR = USB_SOFIF_bm; - 4eb0: 80 e8 ldi r24, 0x80 ; 128 - 4eb2: 80 93 ca 04 sts 0x04CA, r24 ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - { - USB_INT_Clear(USB_INT_SOFI); - - EVENT_USB_Device_StartOfFrame(); - 4eb6: 08 dc rcall .-2032 ; 0x46c8 - 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); - 4eb8: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - } - #endif - - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) - 4ebc: 86 ff sbrs r24, 6 - 4ebe: 07 c0 rjmp .+14 ; 0x4ece <__vector_125+0x50> - static inline void USB_INT_Clear(const uint8_t Interrupt) - { - switch (Interrupt) - { - case USB_INT_BUSEVENTI_Suspend: - USB.INTFLAGSACLR = USB_SUSPENDIF_bm; - 4ec0: 80 e4 ldi r24, 0x40 ; 64 - 4ec2: 80 93 ca 04 sts 0x04CA, r24 ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - { - USB_INT_Clear(USB_INT_BUSEVENTI_Suspend); - - #if !defined(NO_LIMITED_CONTROLLER_CONNECT) - USB_DeviceState = DEVICE_STATE_Unattached; - 4ec6: 10 92 5e 23 sts 0x235E, r1 ; 0x80235e - EVENT_USB_Device_Disconnect(); - 4eca: 0e 94 98 0d call 0x1b30 ; 0x1b30 - switch (Interrupt) - { - 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); - 4ece: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - USB_DeviceState = DEVICE_STATE_Suspended; - EVENT_USB_Device_Suspend(); - #endif - } - - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Resume)) - 4ed2: 85 ff sbrs r24, 5 - 4ed4: 14 c0 rjmp .+40 ; 0x4efe <__vector_125+0x80> - { - case USB_INT_BUSEVENTI_Suspend: - USB.INTFLAGSACLR = USB_SUSPENDIF_bm; - break; - case USB_INT_BUSEVENTI_Resume: - USB.INTFLAGSACLR = USB_RESUMEIF_bm; - 4ed6: 80 e2 ldi r24, 0x20 ; 32 - 4ed8: 80 93 ca 04 sts 0x04CA, r24 ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - { - USB_INT_Clear(USB_INT_BUSEVENTI_Resume); - - if (USB_Device_ConfigurationNumber) - 4edc: 80 91 5a 23 lds r24, 0x235A ; 0x80235a - 4ee0: 88 23 and r24, r24 - 4ee2: 11 f0 breq .+4 ; 0x4ee8 <__vector_125+0x6a> - USB_DeviceState = DEVICE_STATE_Configured; - 4ee4: 84 e0 ldi r24, 0x04 ; 4 - 4ee6: 07 c0 rjmp .+14 ; 0x4ef6 <__vector_125+0x78> - } - - 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); - 4ee8: 80 91 c3 04 lds r24, 0x04C3 ; 0x8004c3 <__TEXT_REGION_LENGTH__+0x7004c3> - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; - 4eec: 81 11 cpse r24, r1 - 4eee: 02 c0 rjmp .+4 ; 0x4ef4 <__vector_125+0x76> - 4ef0: 81 e0 ldi r24, 0x01 ; 1 - 4ef2: 01 c0 rjmp .+2 ; 0x4ef6 <__vector_125+0x78> - 4ef4: 83 e0 ldi r24, 0x03 ; 3 - 4ef6: 80 93 5e 23 sts 0x235E, r24 ; 0x80235e - - #if !defined(NO_LIMITED_CONTROLLER_CONNECT) - EVENT_USB_Device_Connect(); - 4efa: 0e 94 97 0d call 0x1b2e ; 0x1b2e - 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); - 4efe: 80 91 ca 04 lds r24, 0x04CA ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - #else - EVENT_USB_Device_WakeUp(); - #endif - } - - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Reset)) - 4f02: 84 ff sbrs r24, 4 - 4f04: 14 c0 rjmp .+40 ; 0x4f2e <__vector_125+0xb0> - break; - case USB_INT_BUSEVENTI_Resume: - USB.INTFLAGSACLR = USB_RESUMEIF_bm; - break; - case USB_INT_BUSEVENTI_Reset: - USB.INTFLAGSACLR = USB_RSTIF_bm; - 4f06: 80 e1 ldi r24, 0x10 ; 16 - 4f08: 80 93 ca 04 sts 0x04CA, r24 ; 0x8004ca <__TEXT_REGION_LENGTH__+0x7004ca> - { - USB_INT_Clear(USB_INT_BUSEVENTI_Reset); - - USB_DeviceState = DEVICE_STATE_Default; - 4f0c: 82 e0 ldi r24, 0x02 ; 2 - 4f0e: 80 93 5e 23 sts 0x235E, r24 ; 0x80235e - USB_Device_ConfigurationNumber = 0; - 4f12: 10 92 5a 23 sts 0x235A, r1 ; 0x80235a - } - - 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; - 4f16: 10 92 c3 04 sts 0x04C3, r1 ; 0x8004c3 <__TEXT_REGION_LENGTH__+0x7004c3> - - USB_Device_EnableDeviceAddress(0); - - Endpoint_ClearEndpoints(); - 4f1a: cc de rcall .-616 ; 0x4cb4 - EPConfigMask |= USB_EP_TYPE_BULK_gc; - break; - } - - if (Type == EP_TYPE_CONTROL) - Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 4f1c: 48 e0 ldi r20, 0x08 ; 8 - 4f1e: 68 e4 ldi r22, 0x48 ; 72 - 4f20: 80 e8 ldi r24, 0x80 ; 128 - 4f22: 29 de rcall .-942 ; 0x4b76 - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 4f24: 48 e0 ldi r20, 0x08 ; 8 - 4f26: 68 e4 ldi r22, 0x48 ; 72 - 4f28: 80 e0 ldi r24, 0x00 ; 0 - 4f2a: 25 de rcall .-950 ; 0x4b76 - Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL, - USB_Device_ControlEndpointSize, 1); - - EVENT_USB_Device_Reset(); - 4f2c: cd db rcall .-2150 ; 0x46c8 - } -} - 4f2e: ff 91 pop r31 - 4f30: ef 91 pop r30 - 4f32: bf 91 pop r27 - 4f34: af 91 pop r26 - 4f36: 9f 91 pop r25 - 4f38: 8f 91 pop r24 - 4f3a: 7f 91 pop r23 - 4f3c: 6f 91 pop r22 - 4f3e: 5f 91 pop r21 - 4f40: 4f 91 pop r20 - 4f42: 3f 91 pop r19 - 4f44: 2f 91 pop r18 - 4f46: 0f 90 pop r0 - 4f48: 0f be out 0x3f, r0 ; 63 - 4f4a: 0f 90 pop r0 - 4f4c: 1f 90 pop r1 - 4f4e: 18 95 reti - -00004f50 : - -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); - 4f50: cf 93 push r28 - 4f52: df 93 push r29 - 4f54: ec 01 movw r28, r24 - 4f56: fc 01 movw r30, r24 - 4f58: 70 96 adiw r30, 0x10 ; 16 - 4f5a: 8b e0 ldi r24, 0x0B ; 11 - 4f5c: df 01 movw r26, r30 - 4f5e: 1d 92 st X+, r1 - 4f60: 8a 95 dec r24 - 4f62: e9 f7 brne .-6 ; 0x4f5e - 4f64: 82 e0 ldi r24, 0x02 ; 2 - 4f66: 8c 83 std Y+4, r24 ; 0x04 - 4f68: 89 87 std Y+9, r24 ; 0x09 - 4f6a: 83 e0 ldi r24, 0x03 ; 3 - 4f6c: 8e 87 std Y+14, r24 ; 0x0e - 4f6e: 61 e0 ldi r22, 0x01 ; 1 - 4f70: ce 01 movw r24, r28 - 4f72: 01 96 adiw r24, 0x01 ; 1 - 4f74: 3c de rcall .-904 ; 0x4bee - 4f76: 88 23 and r24, r24 - 4f78: 61 f0 breq .+24 ; 0x4f92 - 4f7a: 61 e0 ldi r22, 0x01 ; 1 - 4f7c: ce 01 movw r24, r28 - 4f7e: 06 96 adiw r24, 0x06 ; 6 - 4f80: 36 de rcall .-916 ; 0x4bee - 4f82: 88 23 and r24, r24 - 4f84: 31 f0 breq .+12 ; 0x4f92 - 4f86: 61 e0 ldi r22, 0x01 ; 1 - 4f88: ce 01 movw r24, r28 - 4f8a: 0b 96 adiw r24, 0x0b ; 11 - 4f8c: df 91 pop r29 - 4f8e: cf 91 pop r28 - 4f90: 2e ce rjmp .-932 ; 0x4bee - 4f92: 80 e0 ldi r24, 0x00 ; 0 - 4f94: df 91 pop r29 - 4f96: cf 91 pop r28 - 4f98: 08 95 ret - -00004f9a : - 4f9a: 0f 93 push r16 - 4f9c: 1f 93 push r17 - 4f9e: cf 93 push r28 - 4fa0: df 93 push r29 - 4fa2: 20 91 5e 23 lds r18, 0x235E ; 0x80235e - 4fa6: 24 30 cpi r18, 0x04 ; 4 - 4fa8: e1 f4 brne .+56 ; 0x4fe2 - 4faa: fc 01 movw r30, r24 - 4fac: 04 89 ldd r16, Z+20 ; 0x14 - 4fae: 15 89 ldd r17, Z+21 ; 0x15 - 4fb0: 26 89 ldd r18, Z+22 ; 0x16 - 4fb2: 37 89 ldd r19, Z+23 ; 0x17 - 4fb4: 01 2b or r16, r17 - 4fb6: 02 2b or r16, r18 - 4fb8: 03 2b or r16, r19 - 4fba: 99 f0 breq .+38 ; 0x4fe2 - 4fbc: eb 01 movw r28, r22 - 4fbe: 81 81 ldd r24, Z+1 ; 0x01 - 4fc0: 1e dd rcall .-1476 ; 0x49fe - 4fc2: fe 01 movw r30, r28 - 4fc4: 01 90 ld r0, Z+ - 4fc6: 00 20 and r0, r0 - 4fc8: e9 f7 brne .-6 ; 0x4fc4 - 4fca: 31 97 sbiw r30, 0x01 ; 1 - 4fcc: bf 01 movw r22, r30 - 4fce: 6c 1b sub r22, r28 - 4fd0: 7d 0b sbc r23, r29 - 4fd2: 40 e0 ldi r20, 0x00 ; 0 - 4fd4: 50 e0 ldi r21, 0x00 ; 0 - 4fd6: ce 01 movw r24, r28 - 4fd8: df 91 pop r29 - 4fda: cf 91 pop r28 - 4fdc: 1f 91 pop r17 - 4fde: 0f 91 pop r16 - 4fe0: 85 cb rjmp .-2294 ; 0x46ec - 4fe2: 82 e0 ldi r24, 0x02 ; 2 - 4fe4: df 91 pop r29 - 4fe6: cf 91 pop r28 - 4fe8: 1f 91 pop r17 - 4fea: 0f 91 pop r16 - 4fec: 08 95 ret - -00004fee : - 4fee: 0f 93 push r16 - 4ff0: 1f 93 push r17 - 4ff2: cf 93 push r28 - 4ff4: df 93 push r29 - 4ff6: fc 01 movw r30, r24 - 4ff8: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 4ffc: 84 30 cpi r24, 0x04 ; 4 - 4ffe: a9 f4 brne .+42 ; 0x502a - 5000: 84 89 ldd r24, Z+20 ; 0x14 - 5002: 95 89 ldd r25, Z+21 ; 0x15 - 5004: a6 89 ldd r26, Z+22 ; 0x16 - 5006: b7 89 ldd r27, Z+23 ; 0x17 - 5008: 89 2b or r24, r25 - 500a: 8a 2b or r24, r26 - 500c: 8b 2b or r24, r27 - 500e: 69 f0 breq .+26 ; 0x502a - 5010: 8a 01 movw r16, r20 - 5012: eb 01 movw r28, r22 - 5014: 81 81 ldd r24, Z+1 ; 0x01 - 5016: f3 dc rcall .-1562 ; 0x49fe - 5018: 40 e0 ldi r20, 0x00 ; 0 - 501a: 50 e0 ldi r21, 0x00 ; 0 - 501c: b8 01 movw r22, r16 - 501e: ce 01 movw r24, r28 - 5020: df 91 pop r29 - 5022: cf 91 pop r28 - 5024: 1f 91 pop r17 - 5026: 0f 91 pop r16 - 5028: 61 cb rjmp .-2366 ; 0x46ec - 502a: 82 e0 ldi r24, 0x02 ; 2 - 502c: df 91 pop r29 - 502e: cf 91 pop r28 - 5030: 1f 91 pop r17 - 5032: 0f 91 pop r16 - 5034: 08 95 ret - -00005036 : - 5036: cf 93 push r28 - 5038: fc 01 movw r30, r24 - 503a: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 503e: 84 30 cpi r24, 0x04 ; 4 - 5040: 01 f5 brne .+64 ; 0x5082 - 5042: 84 89 ldd r24, Z+20 ; 0x14 - 5044: 95 89 ldd r25, Z+21 ; 0x15 - 5046: a6 89 ldd r26, Z+22 ; 0x16 - 5048: b7 89 ldd r27, Z+23 ; 0x17 - 504a: 89 2b or r24, r25 - 504c: 8a 2b or r24, r26 - 504e: 8b 2b or r24, r27 - 5050: c1 f0 breq .+48 ; 0x5082 - 5052: c6 2f mov r28, r22 - 5054: 81 81 ldd r24, Z+1 ; 0x01 - 5056: d3 dc rcall .-1626 ; 0x49fe - 5058: 20 91 67 23 lds r18, 0x2367 ; 0x802367 - 505c: 30 91 68 23 lds r19, 0x2368 ; 0x802368 - 5060: f9 01 movw r30, r18 - 5062: ef 5b subi r30, 0xBF ; 191 - 5064: ff 4f sbci r31, 0xFF ; 255 - 5066: 90 81 ld r25, Z - 5068: 31 97 sbiw r30, 0x01 ; 1 - 506a: 80 81 ld r24, Z - 506c: 98 17 cp r25, r24 - 506e: 20 f4 brcc .+8 ; 0x5078 - 5070: 8c 2f mov r24, r28 - 5072: b5 dc rcall .-1686 ; 0x49de - 5074: 80 e0 ldi r24, 0x00 ; 0 - 5076: 06 c0 rjmp .+12 ; 0x5084 - 5078: 7a dc rcall .-1804 ; 0x496e - 507a: 4e de rcall .-868 ; 0x4d18 - 507c: 88 23 and r24, r24 - 507e: c1 f3 breq .-16 ; 0x5070 - 5080: 01 c0 rjmp .+2 ; 0x5084 - 5082: 82 e0 ldi r24, 0x02 ; 2 - 5084: cf 91 pop r28 - 5086: 08 95 ret - -00005088 : - 5088: cf 93 push r28 - 508a: df 93 push r29 - 508c: 20 91 5e 23 lds r18, 0x235E ; 0x80235e - 5090: 24 30 cpi r18, 0x04 ; 4 - 5092: 91 f5 brne .+100 ; 0x50f8 - 5094: fc 01 movw r30, r24 - 5096: 44 89 ldd r20, Z+20 ; 0x14 - 5098: 55 89 ldd r21, Z+21 ; 0x15 - 509a: 66 89 ldd r22, Z+22 ; 0x16 - 509c: 77 89 ldd r23, Z+23 ; 0x17 - 509e: 45 2b or r20, r21 - 50a0: 46 2b or r20, r22 - 50a2: 47 2b or r20, r23 - 50a4: 49 f1 breq .+82 ; 0x50f8 - 50a6: 81 81 ldd r24, Z+1 ; 0x01 - 50a8: aa dc rcall .-1708 ; 0x49fe - 50aa: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 50ae: 20 91 67 23 lds r18, 0x2367 ; 0x802367 - 50b2: 30 91 68 23 lds r19, 0x2368 ; 0x802368 - 50b6: f9 01 movw r30, r18 - 50b8: 87 ff sbrs r24, 7 - 50ba: 05 c0 rjmp .+10 ; 0x50c6 - 50bc: ef 5b subi r30, 0xBF ; 191 - 50be: ff 4f sbci r31, 0xFF ; 255 - 50c0: 80 81 ld r24, Z - 50c2: 90 e0 ldi r25, 0x00 ; 0 - 50c4: 08 c0 rjmp .+16 ; 0x50d6 - 50c6: e0 5c subi r30, 0xC0 ; 192 - 50c8: ff 4f sbci r31, 0xFF ; 255 - 50ca: 80 81 ld r24, Z - 50cc: 31 96 adiw r30, 0x01 ; 1 - 50ce: 40 81 ld r20, Z - 50d0: 90 e0 ldi r25, 0x00 ; 0 - 50d2: 84 1b sub r24, r20 - 50d4: 91 09 sbc r25, r1 - 50d6: 89 2b or r24, r25 - 50d8: 69 f0 breq .+26 ; 0x50f4 - 50da: f9 01 movw r30, r18 - 50dc: ef 5b subi r30, 0xBF ; 191 - 50de: ff 4f sbci r31, 0xFF ; 255 - 50e0: d0 81 ld r29, Z - 50e2: 31 97 sbiw r30, 0x01 ; 1 - 50e4: c0 81 ld r28, Z - 50e6: 43 dc rcall .-1914 ; 0x496e - 50e8: dc 17 cp r29, r28 - 50ea: 20 f0 brcs .+8 ; 0x50f4 - 50ec: 15 de rcall .-982 ; 0x4d18 - 50ee: 81 11 cpse r24, r1 - 50f0: 04 c0 rjmp .+8 ; 0x50fa - 50f2: 3d dc rcall .-1926 ; 0x496e - 50f4: 80 e0 ldi r24, 0x00 ; 0 - 50f6: 01 c0 rjmp .+2 ; 0x50fa - 50f8: 82 e0 ldi r24, 0x02 ; 2 - 50fa: df 91 pop r29 - 50fc: cf 91 pop r28 - 50fe: 08 95 ret - -00005100 : - 5100: cf 93 push r28 - 5102: df 93 push r29 - 5104: 20 91 5e 23 lds r18, 0x235E ; 0x80235e - 5108: 24 30 cpi r18, 0x04 ; 4 - 510a: 99 f4 brne .+38 ; 0x5132 - 510c: fc 01 movw r30, r24 - 510e: 44 89 ldd r20, Z+20 ; 0x14 - 5110: 55 89 ldd r21, Z+21 ; 0x15 - 5112: 66 89 ldd r22, Z+22 ; 0x16 - 5114: 77 89 ldd r23, Z+23 ; 0x17 - 5116: 45 2b or r20, r21 - 5118: 46 2b or r20, r22 - 511a: 47 2b or r20, r23 - 511c: 51 f0 breq .+20 ; 0x5132 - 511e: ec 01 movw r28, r24 - 5120: 81 81 ldd r24, Z+1 ; 0x01 - 5122: 6d dc rcall .-1830 ; 0x49fe - 5124: a1 dc rcall .-1726 ; 0x4a68 - 5126: 88 23 and r24, r24 - 5128: 21 f0 breq .+8 ; 0x5132 - 512a: ce 01 movw r24, r28 - 512c: df 91 pop r29 - 512e: cf 91 pop r28 - 5130: ab cf rjmp .-170 ; 0x5088 - 5132: df 91 pop r29 - 5134: cf 91 pop r28 - 5136: 08 95 ret - -00005138 : - 5138: cf 93 push r28 - 513a: df 93 push r29 - 513c: 20 91 5e 23 lds r18, 0x235E ; 0x80235e - 5140: 24 30 cpi r18, 0x04 ; 4 - 5142: 19 f0 breq .+6 ; 0x514a - 5144: 8f ef ldi r24, 0xFF ; 255 - 5146: 9f ef ldi r25, 0xFF ; 255 - 5148: 46 c0 rjmp .+140 ; 0x51d6 - 514a: fc 01 movw r30, r24 - 514c: 44 89 ldd r20, Z+20 ; 0x14 - 514e: 55 89 ldd r21, Z+21 ; 0x15 - 5150: 66 89 ldd r22, Z+22 ; 0x16 - 5152: 77 89 ldd r23, Z+23 ; 0x17 - 5154: 45 2b or r20, r21 - 5156: 46 2b or r20, r22 - 5158: 47 2b or r20, r23 - 515a: a1 f3 breq .-24 ; 0x5144 - 515c: 86 81 ldd r24, Z+6 ; 0x06 - 515e: 4f dc rcall .-1890 ; 0x49fe - 5160: 8f dc rcall .-1762 ; 0x4a80 - 5162: 88 23 and r24, r24 - 5164: 79 f3 breq .-34 ; 0x5144 - 5166: 80 91 6b 23 lds r24, 0x236B ; 0x80236b - 516a: 20 91 67 23 lds r18, 0x2367 ; 0x802367 - 516e: 30 91 68 23 lds r19, 0x2368 ; 0x802368 - 5172: f9 01 movw r30, r18 - 5174: 87 ff sbrs r24, 7 - 5176: 05 c0 rjmp .+10 ; 0x5182 - 5178: ef 5b subi r30, 0xBF ; 191 - 517a: ff 4f sbci r31, 0xFF ; 255 - 517c: 80 81 ld r24, Z - 517e: 90 e0 ldi r25, 0x00 ; 0 - 5180: 08 c0 rjmp .+16 ; 0x5192 - 5182: e0 5c subi r30, 0xC0 ; 192 - 5184: ff 4f sbci r31, 0xFF ; 255 - 5186: 80 81 ld r24, Z - 5188: 31 96 adiw r30, 0x01 ; 1 - 518a: 20 81 ld r18, Z - 518c: 90 e0 ldi r25, 0x00 ; 0 - 518e: 82 1b sub r24, r18 - 5190: 91 09 sbc r25, r1 - 5192: 89 2b or r24, r25 - 5194: 21 f0 breq .+8 ; 0x519e - 5196: 13 dc rcall .-2010 ; 0x49be - 5198: c8 2f mov r28, r24 - 519a: d0 e0 ldi r29, 0x00 ; 0 - 519c: 02 c0 rjmp .+4 ; 0x51a2 - 519e: cf ef ldi r28, 0xFF ; 255 - 51a0: df ef ldi r29, 0xFF ; 255 - 51a2: 20 91 6b 23 lds r18, 0x236B ; 0x80236b - 51a6: 80 91 67 23 lds r24, 0x2367 ; 0x802367 - 51aa: 90 91 68 23 lds r25, 0x2368 ; 0x802368 - 51ae: fc 01 movw r30, r24 - 51b0: 27 ff sbrs r18, 7 - 51b2: 05 c0 rjmp .+10 ; 0x51be - 51b4: ef 5b subi r30, 0xBF ; 191 - 51b6: ff 4f sbci r31, 0xFF ; 255 - 51b8: 20 81 ld r18, Z - 51ba: 30 e0 ldi r19, 0x00 ; 0 - 51bc: 08 c0 rjmp .+16 ; 0x51ce - 51be: e0 5c subi r30, 0xC0 ; 192 - 51c0: ff 4f sbci r31, 0xFF ; 255 - 51c2: 20 81 ld r18, Z - 51c4: 31 96 adiw r30, 0x01 ; 1 - 51c6: 80 81 ld r24, Z - 51c8: 30 e0 ldi r19, 0x00 ; 0 - 51ca: 28 1b sub r18, r24 - 51cc: 31 09 sbc r19, r1 - 51ce: 23 2b or r18, r19 - 51d0: 09 f4 brne .+2 ; 0x51d4 - 51d2: e6 db rcall .-2100 ; 0x49a0 - 51d4: ce 01 movw r24, r28 - 51d6: df 91 pop r29 - 51d8: cf 91 pop r28 - 51da: 08 95 ret - -000051dc : - return ReceivedByte; -} -#endif - -void CDC_Device_Event_Stub(void) -{ - 51dc: 08 95 ret - -000051de : -#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) -{ - 51de: ff 92 push r15 - 51e0: 0f 93 push r16 - 51e2: 1f 93 push r17 - 51e4: cf 93 push r28 - 51e6: df 93 push r29 - 51e8: ec 01 movw r28, r24 - if (!(Endpoint_IsSETUPReceived())) - 51ea: 64 dc rcall .-1848 ; 0x4ab4 - 51ec: 88 23 and r24, r24 - 51ee: 09 f4 brne .+2 ; 0x51f2 - 51f0: 8e c0 rjmp .+284 ; 0x530e - return; - - if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) - 51f2: 88 81 ld r24, Y - 51f4: 90 e0 ldi r25, 0x00 ; 0 - 51f6: 20 91 63 23 lds r18, 0x2363 ; 0x802363 - 51fa: 30 91 64 23 lds r19, 0x2364 ; 0x802364 - 51fe: 28 17 cp r18, r24 - 5200: 39 07 cpc r19, r25 - 5202: 09 f0 breq .+2 ; 0x5206 - 5204: 84 c0 rjmp .+264 ; 0x530e - return; - - switch (USB_ControlRequest.bRequest) - 5206: 80 91 60 23 lds r24, 0x2360 ; 0x802360 - 520a: 81 32 cpi r24, 0x21 ; 33 - 520c: 59 f0 breq .+22 ; 0x5224 - 520e: 18 f4 brcc .+6 ; 0x5216 - 5210: 80 32 cpi r24, 0x20 ; 32 - 5212: 49 f1 breq .+82 ; 0x5266 - 5214: 7c c0 rjmp .+248 ; 0x530e - 5216: 82 32 cpi r24, 0x22 ; 34 - 5218: 09 f4 brne .+2 ; 0x521c - 521a: 57 c0 rjmp .+174 ; 0x52ca - 521c: 83 32 cpi r24, 0x23 ; 35 - 521e: 09 f4 brne .+2 ; 0x5222 - 5220: 67 c0 rjmp .+206 ; 0x52f0 - 5222: 75 c0 rjmp .+234 ; 0x530e - { - case CDC_REQ_GetLineEncoding: - if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) - 5224: 80 91 5f 23 lds r24, 0x235F ; 0x80235f - 5228: 81 3a cpi r24, 0xA1 ; 161 - 522a: 09 f0 breq .+2 ; 0x522e - 522c: 70 c0 rjmp .+224 ; 0x530e - { - Endpoint_ClearSETUP(); - 522e: 5c dc rcall .-1864 ; 0x4ae8 - - while (!(Endpoint_IsINReady())); - 5230: 1b dc rcall .-1994 ; 0x4a68 - 5232: 88 23 and r24, r24 - 5234: e9 f3 breq .-6 ; 0x5230 - - Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS); - 5236: 8c 89 ldd r24, Y+20 ; 0x14 - 5238: fd 88 ldd r15, Y+21 ; 0x15 - 523a: 0e 89 ldd r16, Y+22 ; 0x16 - 523c: 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); - 523e: cf db rcall .-2146 ; 0x49de - Endpoint_Write_8(Data >> 8); - 5240: 8f 2d mov r24, r15 - 5242: cd db rcall .-2150 ; 0x49de - Endpoint_Write_8(Data >> 16); - 5244: 80 2f mov r24, r16 - 5246: cb db rcall .-2154 ; 0x49de - Endpoint_Write_8(Data >> 24); - 5248: 81 2f mov r24, r17 - 524a: c9 db rcall .-2158 ; 0x49de - Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat); - 524c: 88 8d ldd r24, Y+24 ; 0x18 - 524e: c7 db rcall .-2162 ; 0x49de - Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType); - 5250: 89 8d ldd r24, Y+25 ; 0x19 - 5252: c5 db rcall .-2166 ; 0x49de - Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits); - 5254: 8a 8d ldd r24, Y+26 ; 0x1a - 5256: c3 db rcall .-2170 ; 0x49de - - Endpoint_ClearIN(); - 5258: 8a db rcall .-2284 ; 0x496e - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 525a: df 91 pop r29 - 525c: cf 91 pop r28 - 525e: 1f 91 pop r17 - 5260: 0f 91 pop r16 - 5262: 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(); - 5264: 43 cd rjmp .-1402 ; 0x4cec - } - - break; - case CDC_REQ_SetLineEncoding: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 5266: 80 91 5f 23 lds r24, 0x235F ; 0x80235f - 526a: 81 32 cpi r24, 0x21 ; 33 - 526c: 09 f0 breq .+2 ; 0x5270 - 526e: 4f c0 rjmp .+158 ; 0x530e - { - Endpoint_ClearSETUP(); - 5270: 3b dc rcall .-1930 ; 0x4ae8 - - while (!(Endpoint_IsOUTReceived())) - 5272: 06 dc rcall .-2036 ; 0x4a80 - 5274: 81 11 cpse r24, r1 - 5276: 05 c0 rjmp .+10 ; 0x5282 - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - 5278: 80 91 5e 23 lds r24, 0x235E ; 0x80235e - 527c: 81 11 cpse r24, r1 - 527e: f9 cf rjmp .-14 ; 0x5272 - 5280: 46 c0 rjmp .+140 ; 0x530e - * \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(); - 5282: 9d db rcall .-2246 ; 0x49be - 5284: 08 2f mov r16, r24 - uint32_t Byte1 = Endpoint_Read_8(); - 5286: 9b db rcall .-2250 ; 0x49be - 5288: 18 2f mov r17, r24 - uint32_t Byte2 = Endpoint_Read_8(); - 528a: 99 db rcall .-2254 ; 0x49be - 528c: f8 2e mov r15, r24 - uint32_t Byte3 = Endpoint_Read_8(); - 528e: 97 db rcall .-2258 ; 0x49be - 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(); - 5290: 4f 2d mov r20, r15 - 5292: 50 e0 ldi r21, 0x00 ; 0 - 5294: 60 e0 ldi r22, 0x00 ; 0 - 5296: 70 e0 ldi r23, 0x00 ; 0 - uint32_t Byte3 = Endpoint_Read_8(); - - return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0); - 5298: ba 01 movw r22, r20 - 529a: 55 27 eor r21, r21 - 529c: 44 27 eor r20, r20 - 529e: 78 2b or r23, r24 - 52a0: 40 2b or r20, r16 - 52a2: 51 2b or r21, r17 - return; - } - - CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE(); - 52a4: 4c 8b std Y+20, r20 ; 0x14 - 52a6: 5d 8b std Y+21, r21 ; 0x15 - 52a8: 6e 8b std Y+22, r22 ; 0x16 - 52aa: 7f 8b std Y+23, r23 ; 0x17 - CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8(); - 52ac: 88 db rcall .-2288 ; 0x49be - 52ae: 88 8f std Y+24, r24 ; 0x18 - CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8(); - 52b0: 86 db rcall .-2292 ; 0x49be - 52b2: 89 8f std Y+25, r24 ; 0x19 - CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); - 52b4: 84 db rcall .-2296 ; 0x49be - 52b6: 8a 8f std Y+26, r24 ; 0x1a - - Endpoint_ClearOUT(); - 52b8: 73 db rcall .-2330 ; 0x49a0 - Endpoint_ClearStatusStage(); - 52ba: 18 dd rcall .-1488 ; 0x4cec - - EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - 52bc: ce 01 movw r24, r28 - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 52be: df 91 pop r29 - 52c0: cf 91 pop r28 - 52c2: 1f 91 pop r17 - 52c4: 0f 91 pop r16 - 52c6: ff 90 pop r15 - CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); - - Endpoint_ClearOUT(); - Endpoint_ClearStatusStage(); - - EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - 52c8: 89 cf rjmp .-238 ; 0x51dc - } - - break; - case CDC_REQ_SetControlLineState: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 52ca: 80 91 5f 23 lds r24, 0x235F ; 0x80235f - 52ce: 81 32 cpi r24, 0x21 ; 33 - 52d0: f1 f4 brne .+60 ; 0x530e - { - Endpoint_ClearSETUP(); - 52d2: 0a dc rcall .-2028 ; 0x4ae8 - Endpoint_ClearStatusStage(); - 52d4: 0b dd rcall .-1514 ; 0x4cec - - CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; - 52d6: 80 91 61 23 lds r24, 0x2361 ; 0x802361 - 52da: 90 91 62 23 lds r25, 0x2362 ; 0x802362 - 52de: 88 8b std Y+16, r24 ; 0x10 - 52e0: 99 8b std Y+17, r25 ; 0x11 - - EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - 52e2: ce 01 movw r24, r28 - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 52e4: df 91 pop r29 - 52e6: cf 91 pop r28 - 52e8: 1f 91 pop r17 - 52ea: 0f 91 pop r16 - 52ec: ff 90 pop r15 - Endpoint_ClearSETUP(); - Endpoint_ClearStatusStage(); - - CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; - - EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - 52ee: 76 cf rjmp .-276 ; 0x51dc - } - - break; - case CDC_REQ_SendBreak: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 52f0: 80 91 5f 23 lds r24, 0x235F ; 0x80235f - 52f4: 81 32 cpi r24, 0x21 ; 33 - 52f6: 59 f4 brne .+22 ; 0x530e - { - Endpoint_ClearSETUP(); - 52f8: f7 db rcall .-2066 ; 0x4ae8 - Endpoint_ClearStatusStage(); - 52fa: f8 dc rcall .-1552 ; 0x4cec - - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - 52fc: 60 91 61 23 lds r22, 0x2361 ; 0x802361 - 5300: ce 01 movw r24, r28 - } - - break; - } -} - 5302: df 91 pop r29 - 5304: cf 91 pop r28 - 5306: 1f 91 pop r17 - 5308: 0f 91 pop r16 - 530a: 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); - 530c: 67 cf rjmp .-306 ; 0x51dc - } - - break; - } -} - 530e: df 91 pop r29 - 5310: cf 91 pop r28 - 5312: 1f 91 pop r17 - 5314: 0f 91 pop r16 - 5316: ff 90 pop r15 - 5318: 08 95 ret - -0000531a <__udivmodqi4>: - 531a: 99 1b sub r25, r25 - 531c: 79 e0 ldi r23, 0x09 ; 9 - 531e: 04 c0 rjmp .+8 ; 0x5328 <__udivmodqi4_ep> - -00005320 <__udivmodqi4_loop>: - 5320: 99 1f adc r25, r25 - 5322: 96 17 cp r25, r22 - 5324: 08 f0 brcs .+2 ; 0x5328 <__udivmodqi4_ep> - 5326: 96 1b sub r25, r22 - -00005328 <__udivmodqi4_ep>: - 5328: 88 1f adc r24, r24 - 532a: 7a 95 dec r23 - 532c: c9 f7 brne .-14 ; 0x5320 <__udivmodqi4_loop> - 532e: 80 95 com r24 - 5330: 08 95 ret - -00005332 <__udivmodhi4>: - 5332: aa 1b sub r26, r26 - 5334: bb 1b sub r27, r27 - 5336: 51 e1 ldi r21, 0x11 ; 17 - 5338: 07 c0 rjmp .+14 ; 0x5348 <__udivmodhi4_ep> - -0000533a <__udivmodhi4_loop>: - 533a: aa 1f adc r26, r26 - 533c: bb 1f adc r27, r27 - 533e: a6 17 cp r26, r22 - 5340: b7 07 cpc r27, r23 - 5342: 10 f0 brcs .+4 ; 0x5348 <__udivmodhi4_ep> - 5344: a6 1b sub r26, r22 - 5346: b7 0b sbc r27, r23 - -00005348 <__udivmodhi4_ep>: - 5348: 88 1f adc r24, r24 - 534a: 99 1f adc r25, r25 - 534c: 5a 95 dec r21 - 534e: a9 f7 brne .-22 ; 0x533a <__udivmodhi4_loop> - 5350: 80 95 com r24 - 5352: 90 95 com r25 - 5354: bc 01 movw r22, r24 - 5356: cd 01 movw r24, r26 - 5358: 08 95 ret - -0000535a <__divmodhi4>: - 535a: 97 fb bst r25, 7 - 535c: 07 2e mov r0, r23 - 535e: 16 f4 brtc .+4 ; 0x5364 <__divmodhi4+0xa> - 5360: 00 94 com r0 - 5362: 06 d0 rcall .+12 ; 0x5370 <__divmodhi4_neg1> - 5364: 77 fd sbrc r23, 7 - 5366: 08 d0 rcall .+16 ; 0x5378 <__divmodhi4_neg2> - 5368: e4 df rcall .-56 ; 0x5332 <__udivmodhi4> - 536a: 07 fc sbrc r0, 7 - 536c: 05 d0 rcall .+10 ; 0x5378 <__divmodhi4_neg2> - 536e: 3e f4 brtc .+14 ; 0x537e <__divmodhi4_exit> - -00005370 <__divmodhi4_neg1>: - 5370: 90 95 com r25 - 5372: 81 95 neg r24 - 5374: 9f 4f sbci r25, 0xFF ; 255 - 5376: 08 95 ret - -00005378 <__divmodhi4_neg2>: - 5378: 70 95 com r23 - 537a: 61 95 neg r22 - 537c: 7f 4f sbci r23, 0xFF ; 255 - -0000537e <__divmodhi4_exit>: - 537e: 08 95 ret - -00005380 <__udivmodsi4>: - 5380: a1 e2 ldi r26, 0x21 ; 33 - 5382: 1a 2e mov r1, r26 - 5384: aa 1b sub r26, r26 - 5386: bb 1b sub r27, r27 - 5388: fd 01 movw r30, r26 - 538a: 0d c0 rjmp .+26 ; 0x53a6 <__udivmodsi4_ep> - -0000538c <__udivmodsi4_loop>: - 538c: aa 1f adc r26, r26 - 538e: bb 1f adc r27, r27 - 5390: ee 1f adc r30, r30 - 5392: ff 1f adc r31, r31 - 5394: a2 17 cp r26, r18 - 5396: b3 07 cpc r27, r19 - 5398: e4 07 cpc r30, r20 - 539a: f5 07 cpc r31, r21 - 539c: 20 f0 brcs .+8 ; 0x53a6 <__udivmodsi4_ep> - 539e: a2 1b sub r26, r18 - 53a0: b3 0b sbc r27, r19 - 53a2: e4 0b sbc r30, r20 - 53a4: f5 0b sbc r31, r21 - -000053a6 <__udivmodsi4_ep>: - 53a6: 66 1f adc r22, r22 - 53a8: 77 1f adc r23, r23 - 53aa: 88 1f adc r24, r24 - 53ac: 99 1f adc r25, r25 - 53ae: 1a 94 dec r1 - 53b0: 69 f7 brne .-38 ; 0x538c <__udivmodsi4_loop> - 53b2: 60 95 com r22 - 53b4: 70 95 com r23 - 53b6: 80 95 com r24 - 53b8: 90 95 com r25 - 53ba: 9b 01 movw r18, r22 - 53bc: ac 01 movw r20, r24 - 53be: bd 01 movw r22, r26 - 53c0: cf 01 movw r24, r30 - 53c2: 08 95 ret - -000053c4 <__muluhisi3>: - 53c4: 0f d0 rcall .+30 ; 0x53e4 <__umulhisi3> - 53c6: a5 9f mul r26, r21 - 53c8: 90 0d add r25, r0 - 53ca: b4 9f mul r27, r20 - 53cc: 90 0d add r25, r0 - 53ce: a4 9f mul r26, r20 - 53d0: 80 0d add r24, r0 - 53d2: 91 1d adc r25, r1 - 53d4: 11 24 eor r1, r1 - 53d6: 08 95 ret - -000053d8 <__mulshisi3>: - 53d8: b7 ff sbrs r27, 7 - 53da: f4 cf rjmp .-24 ; 0x53c4 <__muluhisi3> - -000053dc <__mulohisi3>: - 53dc: f3 df rcall .-26 ; 0x53c4 <__muluhisi3> - 53de: 82 1b sub r24, r18 - 53e0: 93 0b sbc r25, r19 - 53e2: 08 95 ret - -000053e4 <__umulhisi3>: - 53e4: a2 9f mul r26, r18 - 53e6: b0 01 movw r22, r0 - 53e8: b3 9f mul r27, r19 - 53ea: c0 01 movw r24, r0 - 53ec: a3 9f mul r26, r19 - 53ee: 70 0d add r23, r0 - 53f0: 81 1d adc r24, r1 - 53f2: 11 24 eor r1, r1 - 53f4: 91 1d adc r25, r1 - 53f6: b2 9f mul r27, r18 - 53f8: 70 0d add r23, r0 - 53fa: 81 1d adc r24, r1 - 53fc: 11 24 eor r1, r1 - 53fe: 91 1d adc r25, r1 - 5400: 08 95 ret - -00005402 : - 5402: 8f 92 push r8 - 5404: 9f 92 push r9 - 5406: af 92 push r10 - 5408: bf 92 push r11 - 540a: cf 92 push r12 - 540c: df 92 push r13 - 540e: ef 92 push r14 - 5410: ff 92 push r15 - 5412: cf 93 push r28 - 5414: df 93 push r29 - 5416: ec 01 movw r28, r24 - 5418: 68 81 ld r22, Y - 541a: 79 81 ldd r23, Y+1 ; 0x01 - 541c: 8a 81 ldd r24, Y+2 ; 0x02 - 541e: 9b 81 ldd r25, Y+3 ; 0x03 - 5420: 61 15 cp r22, r1 - 5422: 71 05 cpc r23, r1 - 5424: 81 05 cpc r24, r1 - 5426: 91 05 cpc r25, r1 - 5428: 21 f4 brne .+8 ; 0x5432 - 542a: 64 e2 ldi r22, 0x24 ; 36 - 542c: 79 ed ldi r23, 0xD9 ; 217 - 542e: 8b e5 ldi r24, 0x5B ; 91 - 5430: 97 e0 ldi r25, 0x07 ; 7 - 5432: 2d e1 ldi r18, 0x1D ; 29 - 5434: 33 ef ldi r19, 0xF3 ; 243 - 5436: 41 e0 ldi r20, 0x01 ; 1 - 5438: 50 e0 ldi r21, 0x00 ; 0 - 543a: 49 d3 rcall .+1682 ; 0x5ace <__divmodsi4> - 543c: 49 01 movw r8, r18 - 543e: 5a 01 movw r10, r20 - 5440: 9b 01 movw r18, r22 - 5442: ac 01 movw r20, r24 - 5444: a7 ea ldi r26, 0xA7 ; 167 - 5446: b1 e4 ldi r27, 0x41 ; 65 - 5448: bd df rcall .-134 ; 0x53c4 <__muluhisi3> - 544a: 6b 01 movw r12, r22 - 544c: 7c 01 movw r14, r24 - 544e: ac ee ldi r26, 0xEC ; 236 - 5450: b4 ef ldi r27, 0xF4 ; 244 - 5452: a5 01 movw r20, r10 - 5454: 94 01 movw r18, r8 - 5456: c2 df rcall .-124 ; 0x53dc <__mulohisi3> - 5458: dc 01 movw r26, r24 - 545a: cb 01 movw r24, r22 - 545c: 8c 0d add r24, r12 - 545e: 9d 1d adc r25, r13 - 5460: ae 1d adc r26, r14 - 5462: bf 1d adc r27, r15 - 5464: b7 ff sbrs r27, 7 - 5466: 03 c0 rjmp .+6 ; 0x546e - 5468: 01 97 sbiw r24, 0x01 ; 1 - 546a: a1 09 sbc r26, r1 - 546c: b0 48 sbci r27, 0x80 ; 128 - 546e: 88 83 st Y, r24 - 5470: 99 83 std Y+1, r25 ; 0x01 - 5472: aa 83 std Y+2, r26 ; 0x02 - 5474: bb 83 std Y+3, r27 ; 0x03 - 5476: 9f 77 andi r25, 0x7F ; 127 - 5478: df 91 pop r29 - 547a: cf 91 pop r28 - 547c: ff 90 pop r15 - 547e: ef 90 pop r14 - 5480: df 90 pop r13 - 5482: cf 90 pop r12 - 5484: bf 90 pop r11 - 5486: af 90 pop r10 - 5488: 9f 90 pop r9 - 548a: 8f 90 pop r8 - 548c: 08 95 ret - -0000548e : - 548e: b9 cf rjmp .-142 ; 0x5402 - -00005490 : - 5490: 87 e4 ldi r24, 0x47 ; 71 - 5492: 90 e2 ldi r25, 0x20 ; 32 - 5494: b6 cf rjmp .-148 ; 0x5402 - -00005496 : - 5496: a0 e0 ldi r26, 0x00 ; 0 - 5498: b0 e0 ldi r27, 0x00 ; 0 - 549a: 80 93 47 20 sts 0x2047, r24 ; 0x802047 - 549e: 90 93 48 20 sts 0x2048, r25 ; 0x802048 - 54a2: a0 93 49 20 sts 0x2049, r26 ; 0x802049 - 54a6: b0 93 4a 20 sts 0x204A, r27 ; 0x80204a - 54aa: 08 95 ret - -000054ac : - 54ac: fb 01 movw r30, r22 - 54ae: dc 01 movw r26, r24 - 54b0: 02 c0 rjmp .+4 ; 0x54b6 - 54b2: 05 90 lpm r0, Z+ - 54b4: 0d 92 st X+, r0 - 54b6: 41 50 subi r20, 0x01 ; 1 - 54b8: 50 40 sbci r21, 0x00 ; 0 - 54ba: d8 f7 brcc .-10 ; 0x54b2 - 54bc: 08 95 ret - -000054be : - 54be: fb 01 movw r30, r22 - 54c0: dc 01 movw r26, r24 - 54c2: 8d 91 ld r24, X+ - 54c4: 05 90 lpm r0, Z+ - 54c6: 80 19 sub r24, r0 - 54c8: 01 10 cpse r0, r1 - 54ca: d9 f3 breq .-10 ; 0x54c2 - 54cc: 99 0b sbc r25, r25 - 54ce: 08 95 ret - -000054d0 : - 54d0: fb 01 movw r30, r22 - 54d2: dc 01 movw r26, r24 - 54d4: 41 50 subi r20, 0x01 ; 1 - 54d6: 50 40 sbci r21, 0x00 ; 0 - 54d8: 48 f0 brcs .+18 ; 0x54ec - 54da: 05 90 lpm r0, Z+ - 54dc: 0d 92 st X+, r0 - 54de: 00 20 and r0, r0 - 54e0: c9 f7 brne .-14 ; 0x54d4 - 54e2: 01 c0 rjmp .+2 ; 0x54e6 - 54e4: 1d 92 st X+, r1 - 54e6: 41 50 subi r20, 0x01 ; 1 - 54e8: 50 40 sbci r21, 0x00 ; 0 - 54ea: e0 f7 brcc .-8 ; 0x54e4 - 54ec: 08 95 ret - -000054ee : - 54ee: fb 01 movw r30, r22 - 54f0: dc 01 movw r26, r24 - 54f2: 04 c0 rjmp .+8 ; 0x54fc - 54f4: 8d 91 ld r24, X+ - 54f6: 01 90 ld r0, Z+ - 54f8: 80 19 sub r24, r0 - 54fa: 21 f4 brne .+8 ; 0x5504 - 54fc: 41 50 subi r20, 0x01 ; 1 - 54fe: 50 40 sbci r21, 0x00 ; 0 - 5500: c8 f7 brcc .-14 ; 0x54f4 - 5502: 88 1b sub r24, r24 - 5504: 99 0b sbc r25, r25 - 5506: 08 95 ret - -00005508 : - 5508: fb 01 movw r30, r22 - 550a: dc 01 movw r26, r24 - 550c: 02 c0 rjmp .+4 ; 0x5512 - 550e: 01 90 ld r0, Z+ - 5510: 0d 92 st X+, r0 - 5512: 41 50 subi r20, 0x01 ; 1 - 5514: 50 40 sbci r21, 0x00 ; 0 - 5516: d8 f7 brcc .-10 ; 0x550e - 5518: 08 95 ret - -0000551a : - 551a: dc 01 movw r26, r24 - 551c: 01 c0 rjmp .+2 ; 0x5520 - 551e: 6d 93 st X+, r22 - 5520: 41 50 subi r20, 0x01 ; 1 - 5522: 50 40 sbci r21, 0x00 ; 0 - 5524: e0 f7 brcc .-8 ; 0x551e - 5526: 08 95 ret - -00005528 : - 5528: ae e0 ldi r26, 0x0E ; 14 - 552a: b0 e0 ldi r27, 0x00 ; 0 - 552c: e9 e9 ldi r30, 0x99 ; 153 - 552e: fa e2 ldi r31, 0x2A ; 42 - 5530: f8 c2 rjmp .+1520 ; 0x5b22 <__prologue_saves__+0x1c> - 5532: 0d 89 ldd r16, Y+21 ; 0x15 - 5534: 1e 89 ldd r17, Y+22 ; 0x16 - 5536: 8f 89 ldd r24, Y+23 ; 0x17 - 5538: 98 8d ldd r25, Y+24 ; 0x18 - 553a: 2e e0 ldi r18, 0x0E ; 14 - 553c: 2c 83 std Y+4, r18 ; 0x04 - 553e: 09 83 std Y+1, r16 ; 0x01 - 5540: 1a 83 std Y+2, r17 ; 0x02 - 5542: 97 ff sbrs r25, 7 - 5544: 02 c0 rjmp .+4 ; 0x554a - 5546: 80 e0 ldi r24, 0x00 ; 0 - 5548: 90 e8 ldi r25, 0x80 ; 128 - 554a: 01 97 sbiw r24, 0x01 ; 1 - 554c: 8d 83 std Y+5, r24 ; 0x05 - 554e: 9e 83 std Y+6, r25 ; 0x06 - 5550: ae 01 movw r20, r28 - 5552: 45 5e subi r20, 0xE5 ; 229 - 5554: 5f 4f sbci r21, 0xFF ; 255 - 5556: 69 8d ldd r22, Y+25 ; 0x19 - 5558: 7a 8d ldd r23, Y+26 ; 0x1a - 555a: ce 01 movw r24, r28 - 555c: 01 96 adiw r24, 0x01 ; 1 - 555e: 11 d0 rcall .+34 ; 0x5582 - 5560: 4d 81 ldd r20, Y+5 ; 0x05 - 5562: 5e 81 ldd r21, Y+6 ; 0x06 - 5564: 57 fd sbrc r21, 7 - 5566: 0a c0 rjmp .+20 ; 0x557c - 5568: 2f 81 ldd r18, Y+7 ; 0x07 - 556a: 38 85 ldd r19, Y+8 ; 0x08 - 556c: 42 17 cp r20, r18 - 556e: 53 07 cpc r21, r19 - 5570: 0c f4 brge .+2 ; 0x5574 - 5572: 9a 01 movw r18, r20 - 5574: f8 01 movw r30, r16 - 5576: e2 0f add r30, r18 - 5578: f3 1f adc r31, r19 - 557a: 10 82 st Z, r1 - 557c: 2e 96 adiw r28, 0x0e ; 14 - 557e: e4 e0 ldi r30, 0x04 ; 4 - 5580: e9 c2 rjmp .+1490 ; 0x5b54 <__epilogue_restores__+0x1c> - -00005582 : - 5582: ac e0 ldi r26, 0x0C ; 12 - 5584: b0 e0 ldi r27, 0x00 ; 0 - 5586: e6 ec ldi r30, 0xC6 ; 198 - 5588: fa e2 ldi r31, 0x2A ; 42 - 558a: bd c2 rjmp .+1402 ; 0x5b06 <__prologue_saves__> - 558c: 7c 01 movw r14, r24 - 558e: 6b 01 movw r12, r22 - 5590: 8a 01 movw r16, r20 - 5592: fc 01 movw r30, r24 - 5594: 16 82 std Z+6, r1 ; 0x06 - 5596: 17 82 std Z+7, r1 ; 0x07 - 5598: 83 81 ldd r24, Z+3 ; 0x03 - 559a: 81 ff sbrs r24, 1 - 559c: b0 c1 rjmp .+864 ; 0x58fe - 559e: ce 01 movw r24, r28 - 55a0: 01 96 adiw r24, 0x01 ; 1 - 55a2: 4c 01 movw r8, r24 - 55a4: f7 01 movw r30, r14 - 55a6: 93 81 ldd r25, Z+3 ; 0x03 - 55a8: f6 01 movw r30, r12 - 55aa: 93 fd sbrc r25, 3 - 55ac: 85 91 lpm r24, Z+ - 55ae: 93 ff sbrs r25, 3 - 55b0: 81 91 ld r24, Z+ - 55b2: 6f 01 movw r12, r30 - 55b4: 88 23 and r24, r24 - 55b6: 09 f4 brne .+2 ; 0x55ba - 55b8: 9e c1 rjmp .+828 ; 0x58f6 - 55ba: 85 32 cpi r24, 0x25 ; 37 - 55bc: 39 f4 brne .+14 ; 0x55cc - 55be: 93 fd sbrc r25, 3 - 55c0: 85 91 lpm r24, Z+ - 55c2: 93 ff sbrs r25, 3 - 55c4: 81 91 ld r24, Z+ - 55c6: 6f 01 movw r12, r30 - 55c8: 85 32 cpi r24, 0x25 ; 37 - 55ca: 21 f4 brne .+8 ; 0x55d4 - 55cc: b7 01 movw r22, r14 - 55ce: 90 e0 ldi r25, 0x00 ; 0 - 55d0: b1 d1 rcall .+866 ; 0x5934 - 55d2: e8 cf rjmp .-48 ; 0x55a4 - 55d4: 51 2c mov r5, r1 - 55d6: 31 2c mov r3, r1 - 55d8: 20 e0 ldi r18, 0x00 ; 0 - 55da: 20 32 cpi r18, 0x20 ; 32 - 55dc: a0 f4 brcc .+40 ; 0x5606 - 55de: 8b 32 cpi r24, 0x2B ; 43 - 55e0: 69 f0 breq .+26 ; 0x55fc - 55e2: 30 f4 brcc .+12 ; 0x55f0 - 55e4: 80 32 cpi r24, 0x20 ; 32 - 55e6: 59 f0 breq .+22 ; 0x55fe - 55e8: 83 32 cpi r24, 0x23 ; 35 - 55ea: 69 f4 brne .+26 ; 0x5606 - 55ec: 20 61 ori r18, 0x10 ; 16 - 55ee: 2c c0 rjmp .+88 ; 0x5648 - 55f0: 8d 32 cpi r24, 0x2D ; 45 - 55f2: 39 f0 breq .+14 ; 0x5602 - 55f4: 80 33 cpi r24, 0x30 ; 48 - 55f6: 39 f4 brne .+14 ; 0x5606 - 55f8: 21 60 ori r18, 0x01 ; 1 - 55fa: 26 c0 rjmp .+76 ; 0x5648 - 55fc: 22 60 ori r18, 0x02 ; 2 - 55fe: 24 60 ori r18, 0x04 ; 4 - 5600: 23 c0 rjmp .+70 ; 0x5648 - 5602: 28 60 ori r18, 0x08 ; 8 - 5604: 21 c0 rjmp .+66 ; 0x5648 - 5606: 27 fd sbrc r18, 7 - 5608: 27 c0 rjmp .+78 ; 0x5658 - 560a: 30 ed ldi r19, 0xD0 ; 208 - 560c: 38 0f add r19, r24 - 560e: 3a 30 cpi r19, 0x0A ; 10 - 5610: 78 f4 brcc .+30 ; 0x5630 - 5612: 26 ff sbrs r18, 6 - 5614: 06 c0 rjmp .+12 ; 0x5622 - 5616: fa e0 ldi r31, 0x0A ; 10 - 5618: 5f 9e mul r5, r31 - 561a: 30 0d add r19, r0 - 561c: 11 24 eor r1, r1 - 561e: 53 2e mov r5, r19 - 5620: 13 c0 rjmp .+38 ; 0x5648 - 5622: 8a e0 ldi r24, 0x0A ; 10 - 5624: 38 9e mul r3, r24 - 5626: 30 0d add r19, r0 - 5628: 11 24 eor r1, r1 - 562a: 33 2e mov r3, r19 - 562c: 20 62 ori r18, 0x20 ; 32 - 562e: 0c c0 rjmp .+24 ; 0x5648 - 5630: 8e 32 cpi r24, 0x2E ; 46 - 5632: 21 f4 brne .+8 ; 0x563c - 5634: 26 fd sbrc r18, 6 - 5636: 5f c1 rjmp .+702 ; 0x58f6 - 5638: 20 64 ori r18, 0x40 ; 64 - 563a: 06 c0 rjmp .+12 ; 0x5648 - 563c: 8c 36 cpi r24, 0x6C ; 108 - 563e: 11 f4 brne .+4 ; 0x5644 - 5640: 20 68 ori r18, 0x80 ; 128 - 5642: 02 c0 rjmp .+4 ; 0x5648 - 5644: 88 36 cpi r24, 0x68 ; 104 - 5646: 41 f4 brne .+16 ; 0x5658 - 5648: f6 01 movw r30, r12 - 564a: 93 fd sbrc r25, 3 - 564c: 85 91 lpm r24, Z+ - 564e: 93 ff sbrs r25, 3 - 5650: 81 91 ld r24, Z+ - 5652: 6f 01 movw r12, r30 - 5654: 81 11 cpse r24, r1 - 5656: c1 cf rjmp .-126 ; 0x55da - 5658: 98 2f mov r25, r24 - 565a: 9f 7d andi r25, 0xDF ; 223 - 565c: 95 54 subi r25, 0x45 ; 69 - 565e: 93 30 cpi r25, 0x03 ; 3 - 5660: 28 f4 brcc .+10 ; 0x566c - 5662: 0c 5f subi r16, 0xFC ; 252 - 5664: 1f 4f sbci r17, 0xFF ; 255 - 5666: ff e3 ldi r31, 0x3F ; 63 - 5668: f9 83 std Y+1, r31 ; 0x01 - 566a: 0d c0 rjmp .+26 ; 0x5686 - 566c: 83 36 cpi r24, 0x63 ; 99 - 566e: 31 f0 breq .+12 ; 0x567c - 5670: 83 37 cpi r24, 0x73 ; 115 - 5672: 71 f0 breq .+28 ; 0x5690 - 5674: 83 35 cpi r24, 0x53 ; 83 - 5676: 09 f0 breq .+2 ; 0x567a - 5678: 57 c0 rjmp .+174 ; 0x5728 - 567a: 21 c0 rjmp .+66 ; 0x56be - 567c: f8 01 movw r30, r16 - 567e: 80 81 ld r24, Z - 5680: 89 83 std Y+1, r24 ; 0x01 - 5682: 0e 5f subi r16, 0xFE ; 254 - 5684: 1f 4f sbci r17, 0xFF ; 255 - 5686: 44 24 eor r4, r4 - 5688: 43 94 inc r4 - 568a: 51 2c mov r5, r1 - 568c: 54 01 movw r10, r8 - 568e: 14 c0 rjmp .+40 ; 0x56b8 - 5690: 38 01 movw r6, r16 - 5692: f2 e0 ldi r31, 0x02 ; 2 - 5694: 6f 0e add r6, r31 - 5696: 71 1c adc r7, r1 - 5698: f8 01 movw r30, r16 - 569a: a0 80 ld r10, Z - 569c: b1 80 ldd r11, Z+1 ; 0x01 - 569e: 26 ff sbrs r18, 6 - 56a0: 03 c0 rjmp .+6 ; 0x56a8 - 56a2: 65 2d mov r22, r5 - 56a4: 70 e0 ldi r23, 0x00 ; 0 - 56a6: 02 c0 rjmp .+4 ; 0x56ac - 56a8: 6f ef ldi r22, 0xFF ; 255 - 56aa: 7f ef ldi r23, 0xFF ; 255 - 56ac: c5 01 movw r24, r10 - 56ae: 2c 87 std Y+12, r18 ; 0x0c - 56b0: 36 d1 rcall .+620 ; 0x591e - 56b2: 2c 01 movw r4, r24 - 56b4: 83 01 movw r16, r6 - 56b6: 2c 85 ldd r18, Y+12 ; 0x0c - 56b8: 2f 77 andi r18, 0x7F ; 127 - 56ba: 22 2e mov r2, r18 - 56bc: 16 c0 rjmp .+44 ; 0x56ea - 56be: 38 01 movw r6, r16 - 56c0: f2 e0 ldi r31, 0x02 ; 2 - 56c2: 6f 0e add r6, r31 - 56c4: 71 1c adc r7, r1 - 56c6: f8 01 movw r30, r16 - 56c8: a0 80 ld r10, Z - 56ca: b1 80 ldd r11, Z+1 ; 0x01 - 56cc: 26 ff sbrs r18, 6 - 56ce: 03 c0 rjmp .+6 ; 0x56d6 - 56d0: 65 2d mov r22, r5 - 56d2: 70 e0 ldi r23, 0x00 ; 0 - 56d4: 02 c0 rjmp .+4 ; 0x56da - 56d6: 6f ef ldi r22, 0xFF ; 255 - 56d8: 7f ef ldi r23, 0xFF ; 255 - 56da: c5 01 movw r24, r10 - 56dc: 2c 87 std Y+12, r18 ; 0x0c - 56de: 14 d1 rcall .+552 ; 0x5908 - 56e0: 2c 01 movw r4, r24 - 56e2: 2c 85 ldd r18, Y+12 ; 0x0c - 56e4: 20 68 ori r18, 0x80 ; 128 - 56e6: 22 2e mov r2, r18 - 56e8: 83 01 movw r16, r6 - 56ea: 23 fc sbrc r2, 3 - 56ec: 19 c0 rjmp .+50 ; 0x5720 - 56ee: 83 2d mov r24, r3 - 56f0: 90 e0 ldi r25, 0x00 ; 0 - 56f2: 48 16 cp r4, r24 - 56f4: 59 06 cpc r5, r25 - 56f6: a0 f4 brcc .+40 ; 0x5720 - 56f8: b7 01 movw r22, r14 - 56fa: 80 e2 ldi r24, 0x20 ; 32 - 56fc: 90 e0 ldi r25, 0x00 ; 0 - 56fe: 1a d1 rcall .+564 ; 0x5934 - 5700: 3a 94 dec r3 - 5702: f5 cf rjmp .-22 ; 0x56ee - 5704: f5 01 movw r30, r10 - 5706: 27 fc sbrc r2, 7 - 5708: 85 91 lpm r24, Z+ - 570a: 27 fe sbrs r2, 7 - 570c: 81 91 ld r24, Z+ - 570e: 5f 01 movw r10, r30 - 5710: b7 01 movw r22, r14 - 5712: 90 e0 ldi r25, 0x00 ; 0 - 5714: 0f d1 rcall .+542 ; 0x5934 - 5716: 31 10 cpse r3, r1 - 5718: 3a 94 dec r3 - 571a: f1 e0 ldi r31, 0x01 ; 1 - 571c: 4f 1a sub r4, r31 - 571e: 51 08 sbc r5, r1 - 5720: 41 14 cp r4, r1 - 5722: 51 04 cpc r5, r1 - 5724: 79 f7 brne .-34 ; 0x5704 - 5726: de c0 rjmp .+444 ; 0x58e4 - 5728: 84 36 cpi r24, 0x64 ; 100 - 572a: 11 f0 breq .+4 ; 0x5730 - 572c: 89 36 cpi r24, 0x69 ; 105 - 572e: 31 f5 brne .+76 ; 0x577c - 5730: f8 01 movw r30, r16 - 5732: 27 ff sbrs r18, 7 - 5734: 07 c0 rjmp .+14 ; 0x5744 - 5736: 60 81 ld r22, Z - 5738: 71 81 ldd r23, Z+1 ; 0x01 - 573a: 82 81 ldd r24, Z+2 ; 0x02 - 573c: 93 81 ldd r25, Z+3 ; 0x03 - 573e: 0c 5f subi r16, 0xFC ; 252 - 5740: 1f 4f sbci r17, 0xFF ; 255 - 5742: 08 c0 rjmp .+16 ; 0x5754 - 5744: 60 81 ld r22, Z - 5746: 71 81 ldd r23, Z+1 ; 0x01 - 5748: 07 2e mov r0, r23 - 574a: 00 0c add r0, r0 - 574c: 88 0b sbc r24, r24 - 574e: 99 0b sbc r25, r25 - 5750: 0e 5f subi r16, 0xFE ; 254 - 5752: 1f 4f sbci r17, 0xFF ; 255 - 5754: 2f 76 andi r18, 0x6F ; 111 - 5756: 72 2e mov r7, r18 - 5758: 97 ff sbrs r25, 7 - 575a: 09 c0 rjmp .+18 ; 0x576e - 575c: 90 95 com r25 - 575e: 80 95 com r24 - 5760: 70 95 com r23 - 5762: 61 95 neg r22 - 5764: 7f 4f sbci r23, 0xFF ; 255 - 5766: 8f 4f sbci r24, 0xFF ; 255 - 5768: 9f 4f sbci r25, 0xFF ; 255 - 576a: 20 68 ori r18, 0x80 ; 128 - 576c: 72 2e mov r7, r18 - 576e: 2a e0 ldi r18, 0x0A ; 10 - 5770: 30 e0 ldi r19, 0x00 ; 0 - 5772: a4 01 movw r20, r8 - 5774: 17 d1 rcall .+558 ; 0x59a4 <__ultoa_invert> - 5776: a8 2e mov r10, r24 - 5778: a8 18 sub r10, r8 - 577a: 43 c0 rjmp .+134 ; 0x5802 - 577c: 85 37 cpi r24, 0x75 ; 117 - 577e: 29 f4 brne .+10 ; 0x578a - 5780: 2f 7e andi r18, 0xEF ; 239 - 5782: b2 2e mov r11, r18 - 5784: 2a e0 ldi r18, 0x0A ; 10 - 5786: 30 e0 ldi r19, 0x00 ; 0 - 5788: 25 c0 rjmp .+74 ; 0x57d4 - 578a: f2 2f mov r31, r18 - 578c: f9 7f andi r31, 0xF9 ; 249 - 578e: bf 2e mov r11, r31 - 5790: 8f 36 cpi r24, 0x6F ; 111 - 5792: c1 f0 breq .+48 ; 0x57c4 - 5794: 18 f4 brcc .+6 ; 0x579c - 5796: 88 35 cpi r24, 0x58 ; 88 - 5798: 79 f0 breq .+30 ; 0x57b8 - 579a: ad c0 rjmp .+346 ; 0x58f6 - 579c: 80 37 cpi r24, 0x70 ; 112 - 579e: 19 f0 breq .+6 ; 0x57a6 - 57a0: 88 37 cpi r24, 0x78 ; 120 - 57a2: 21 f0 breq .+8 ; 0x57ac - 57a4: a8 c0 rjmp .+336 ; 0x58f6 - 57a6: 2f 2f mov r18, r31 - 57a8: 20 61 ori r18, 0x10 ; 16 - 57aa: b2 2e mov r11, r18 - 57ac: b4 fe sbrs r11, 4 - 57ae: 0d c0 rjmp .+26 ; 0x57ca - 57b0: 8b 2d mov r24, r11 - 57b2: 84 60 ori r24, 0x04 ; 4 - 57b4: b8 2e mov r11, r24 - 57b6: 09 c0 rjmp .+18 ; 0x57ca - 57b8: 24 ff sbrs r18, 4 - 57ba: 0a c0 rjmp .+20 ; 0x57d0 - 57bc: 9f 2f mov r25, r31 - 57be: 96 60 ori r25, 0x06 ; 6 - 57c0: b9 2e mov r11, r25 - 57c2: 06 c0 rjmp .+12 ; 0x57d0 - 57c4: 28 e0 ldi r18, 0x08 ; 8 - 57c6: 30 e0 ldi r19, 0x00 ; 0 - 57c8: 05 c0 rjmp .+10 ; 0x57d4 - 57ca: 20 e1 ldi r18, 0x10 ; 16 - 57cc: 30 e0 ldi r19, 0x00 ; 0 - 57ce: 02 c0 rjmp .+4 ; 0x57d4 - 57d0: 20 e1 ldi r18, 0x10 ; 16 - 57d2: 32 e0 ldi r19, 0x02 ; 2 - 57d4: f8 01 movw r30, r16 - 57d6: b7 fe sbrs r11, 7 - 57d8: 07 c0 rjmp .+14 ; 0x57e8 - 57da: 60 81 ld r22, Z - 57dc: 71 81 ldd r23, Z+1 ; 0x01 - 57de: 82 81 ldd r24, Z+2 ; 0x02 - 57e0: 93 81 ldd r25, Z+3 ; 0x03 - 57e2: 0c 5f subi r16, 0xFC ; 252 - 57e4: 1f 4f sbci r17, 0xFF ; 255 - 57e6: 06 c0 rjmp .+12 ; 0x57f4 - 57e8: 60 81 ld r22, Z - 57ea: 71 81 ldd r23, Z+1 ; 0x01 - 57ec: 80 e0 ldi r24, 0x00 ; 0 - 57ee: 90 e0 ldi r25, 0x00 ; 0 - 57f0: 0e 5f subi r16, 0xFE ; 254 - 57f2: 1f 4f sbci r17, 0xFF ; 255 - 57f4: a4 01 movw r20, r8 - 57f6: d6 d0 rcall .+428 ; 0x59a4 <__ultoa_invert> - 57f8: a8 2e mov r10, r24 - 57fa: a8 18 sub r10, r8 - 57fc: fb 2d mov r31, r11 - 57fe: ff 77 andi r31, 0x7F ; 127 - 5800: 7f 2e mov r7, r31 - 5802: 76 fe sbrs r7, 6 - 5804: 0b c0 rjmp .+22 ; 0x581c - 5806: 37 2d mov r19, r7 - 5808: 3e 7f andi r19, 0xFE ; 254 - 580a: a5 14 cp r10, r5 - 580c: 50 f4 brcc .+20 ; 0x5822 - 580e: 74 fe sbrs r7, 4 - 5810: 0a c0 rjmp .+20 ; 0x5826 - 5812: 72 fc sbrc r7, 2 - 5814: 08 c0 rjmp .+16 ; 0x5826 - 5816: 37 2d mov r19, r7 - 5818: 3e 7e andi r19, 0xEE ; 238 - 581a: 05 c0 rjmp .+10 ; 0x5826 - 581c: ba 2c mov r11, r10 - 581e: 37 2d mov r19, r7 - 5820: 03 c0 rjmp .+6 ; 0x5828 - 5822: ba 2c mov r11, r10 - 5824: 01 c0 rjmp .+2 ; 0x5828 - 5826: b5 2c mov r11, r5 - 5828: 34 ff sbrs r19, 4 - 582a: 0d c0 rjmp .+26 ; 0x5846 - 582c: fe 01 movw r30, r28 - 582e: ea 0d add r30, r10 - 5830: f1 1d adc r31, r1 - 5832: 80 81 ld r24, Z - 5834: 80 33 cpi r24, 0x30 ; 48 - 5836: 11 f4 brne .+4 ; 0x583c - 5838: 39 7e andi r19, 0xE9 ; 233 - 583a: 09 c0 rjmp .+18 ; 0x584e - 583c: 32 ff sbrs r19, 2 - 583e: 06 c0 rjmp .+12 ; 0x584c - 5840: b3 94 inc r11 - 5842: b3 94 inc r11 - 5844: 04 c0 rjmp .+8 ; 0x584e - 5846: 83 2f mov r24, r19 - 5848: 86 78 andi r24, 0x86 ; 134 - 584a: 09 f0 breq .+2 ; 0x584e - 584c: b3 94 inc r11 - 584e: 33 fd sbrc r19, 3 - 5850: 12 c0 rjmp .+36 ; 0x5876 - 5852: 30 ff sbrs r19, 0 - 5854: 06 c0 rjmp .+12 ; 0x5862 - 5856: 5a 2c mov r5, r10 - 5858: b3 14 cp r11, r3 - 585a: 18 f4 brcc .+6 ; 0x5862 - 585c: 53 0c add r5, r3 - 585e: 5b 18 sub r5, r11 - 5860: b3 2c mov r11, r3 - 5862: b3 14 cp r11, r3 - 5864: 60 f4 brcc .+24 ; 0x587e - 5866: b7 01 movw r22, r14 - 5868: 80 e2 ldi r24, 0x20 ; 32 - 586a: 90 e0 ldi r25, 0x00 ; 0 - 586c: 3c 87 std Y+12, r19 ; 0x0c - 586e: 62 d0 rcall .+196 ; 0x5934 - 5870: b3 94 inc r11 - 5872: 3c 85 ldd r19, Y+12 ; 0x0c - 5874: f6 cf rjmp .-20 ; 0x5862 - 5876: b3 14 cp r11, r3 - 5878: 10 f4 brcc .+4 ; 0x587e - 587a: 3b 18 sub r3, r11 - 587c: 01 c0 rjmp .+2 ; 0x5880 - 587e: 31 2c mov r3, r1 - 5880: 34 ff sbrs r19, 4 - 5882: 11 c0 rjmp .+34 ; 0x58a6 - 5884: b7 01 movw r22, r14 - 5886: 80 e3 ldi r24, 0x30 ; 48 - 5888: 90 e0 ldi r25, 0x00 ; 0 - 588a: 3c 87 std Y+12, r19 ; 0x0c - 588c: 53 d0 rcall .+166 ; 0x5934 - 588e: 3c 85 ldd r19, Y+12 ; 0x0c - 5890: 32 ff sbrs r19, 2 - 5892: 16 c0 rjmp .+44 ; 0x58c0 - 5894: 31 fd sbrc r19, 1 - 5896: 03 c0 rjmp .+6 ; 0x589e - 5898: 88 e7 ldi r24, 0x78 ; 120 - 589a: 90 e0 ldi r25, 0x00 ; 0 - 589c: 02 c0 rjmp .+4 ; 0x58a2 - 589e: 88 e5 ldi r24, 0x58 ; 88 - 58a0: 90 e0 ldi r25, 0x00 ; 0 - 58a2: b7 01 movw r22, r14 - 58a4: 0c c0 rjmp .+24 ; 0x58be - 58a6: 83 2f mov r24, r19 - 58a8: 86 78 andi r24, 0x86 ; 134 - 58aa: 51 f0 breq .+20 ; 0x58c0 - 58ac: 31 ff sbrs r19, 1 - 58ae: 02 c0 rjmp .+4 ; 0x58b4 - 58b0: 8b e2 ldi r24, 0x2B ; 43 - 58b2: 01 c0 rjmp .+2 ; 0x58b6 - 58b4: 80 e2 ldi r24, 0x20 ; 32 - 58b6: 37 fd sbrc r19, 7 - 58b8: 8d e2 ldi r24, 0x2D ; 45 - 58ba: b7 01 movw r22, r14 - 58bc: 90 e0 ldi r25, 0x00 ; 0 - 58be: 3a d0 rcall .+116 ; 0x5934 - 58c0: a5 14 cp r10, r5 - 58c2: 30 f4 brcc .+12 ; 0x58d0 - 58c4: b7 01 movw r22, r14 - 58c6: 80 e3 ldi r24, 0x30 ; 48 - 58c8: 90 e0 ldi r25, 0x00 ; 0 - 58ca: 34 d0 rcall .+104 ; 0x5934 - 58cc: 5a 94 dec r5 - 58ce: f8 cf rjmp .-16 ; 0x58c0 - 58d0: aa 94 dec r10 - 58d2: f4 01 movw r30, r8 - 58d4: ea 0d add r30, r10 - 58d6: f1 1d adc r31, r1 - 58d8: 80 81 ld r24, Z - 58da: b7 01 movw r22, r14 - 58dc: 90 e0 ldi r25, 0x00 ; 0 - 58de: 2a d0 rcall .+84 ; 0x5934 - 58e0: a1 10 cpse r10, r1 - 58e2: f6 cf rjmp .-20 ; 0x58d0 - 58e4: 33 20 and r3, r3 - 58e6: 09 f4 brne .+2 ; 0x58ea - 58e8: 5d ce rjmp .-838 ; 0x55a4 - 58ea: b7 01 movw r22, r14 - 58ec: 80 e2 ldi r24, 0x20 ; 32 - 58ee: 90 e0 ldi r25, 0x00 ; 0 - 58f0: 21 d0 rcall .+66 ; 0x5934 - 58f2: 3a 94 dec r3 - 58f4: f7 cf rjmp .-18 ; 0x58e4 - 58f6: f7 01 movw r30, r14 - 58f8: 86 81 ldd r24, Z+6 ; 0x06 - 58fa: 97 81 ldd r25, Z+7 ; 0x07 - 58fc: 02 c0 rjmp .+4 ; 0x5902 - 58fe: 8f ef ldi r24, 0xFF ; 255 - 5900: 9f ef ldi r25, 0xFF ; 255 - 5902: 2c 96 adiw r28, 0x0c ; 12 - 5904: e2 e1 ldi r30, 0x12 ; 18 - 5906: 18 c1 rjmp .+560 ; 0x5b38 <__epilogue_restores__> - -00005908 : - 5908: fc 01 movw r30, r24 - 590a: 05 90 lpm r0, Z+ - 590c: 61 50 subi r22, 0x01 ; 1 - 590e: 70 40 sbci r23, 0x00 ; 0 - 5910: 01 10 cpse r0, r1 - 5912: d8 f7 brcc .-10 ; 0x590a - 5914: 80 95 com r24 - 5916: 90 95 com r25 - 5918: 8e 0f add r24, r30 - 591a: 9f 1f adc r25, r31 - 591c: 08 95 ret - -0000591e : - 591e: fc 01 movw r30, r24 - 5920: 61 50 subi r22, 0x01 ; 1 - 5922: 70 40 sbci r23, 0x00 ; 0 - 5924: 01 90 ld r0, Z+ - 5926: 01 10 cpse r0, r1 - 5928: d8 f7 brcc .-10 ; 0x5920 - 592a: 80 95 com r24 - 592c: 90 95 com r25 - 592e: 8e 0f add r24, r30 - 5930: 9f 1f adc r25, r31 - 5932: 08 95 ret - -00005934 : - 5934: 0f 93 push r16 - 5936: 1f 93 push r17 - 5938: cf 93 push r28 - 593a: df 93 push r29 - 593c: fb 01 movw r30, r22 - 593e: 23 81 ldd r18, Z+3 ; 0x03 - 5940: 21 fd sbrc r18, 1 - 5942: 03 c0 rjmp .+6 ; 0x594a - 5944: 8f ef ldi r24, 0xFF ; 255 - 5946: 9f ef ldi r25, 0xFF ; 255 - 5948: 28 c0 rjmp .+80 ; 0x599a - 594a: 22 ff sbrs r18, 2 - 594c: 16 c0 rjmp .+44 ; 0x597a - 594e: 46 81 ldd r20, Z+6 ; 0x06 - 5950: 57 81 ldd r21, Z+7 ; 0x07 - 5952: 24 81 ldd r18, Z+4 ; 0x04 - 5954: 35 81 ldd r19, Z+5 ; 0x05 - 5956: 42 17 cp r20, r18 - 5958: 53 07 cpc r21, r19 - 595a: 44 f4 brge .+16 ; 0x596c - 595c: a0 81 ld r26, Z - 595e: b1 81 ldd r27, Z+1 ; 0x01 - 5960: 9d 01 movw r18, r26 - 5962: 2f 5f subi r18, 0xFF ; 255 - 5964: 3f 4f sbci r19, 0xFF ; 255 - 5966: 20 83 st Z, r18 - 5968: 31 83 std Z+1, r19 ; 0x01 - 596a: 8c 93 st X, r24 - 596c: 26 81 ldd r18, Z+6 ; 0x06 - 596e: 37 81 ldd r19, Z+7 ; 0x07 - 5970: 2f 5f subi r18, 0xFF ; 255 - 5972: 3f 4f sbci r19, 0xFF ; 255 - 5974: 26 83 std Z+6, r18 ; 0x06 - 5976: 37 83 std Z+7, r19 ; 0x07 - 5978: 10 c0 rjmp .+32 ; 0x599a - 597a: eb 01 movw r28, r22 - 597c: 09 2f mov r16, r25 - 597e: 18 2f mov r17, r24 - 5980: 00 84 ldd r0, Z+8 ; 0x08 - 5982: f1 85 ldd r31, Z+9 ; 0x09 - 5984: e0 2d mov r30, r0 - 5986: 09 95 icall - 5988: 89 2b or r24, r25 - 598a: e1 f6 brne .-72 ; 0x5944 - 598c: 8e 81 ldd r24, Y+6 ; 0x06 - 598e: 9f 81 ldd r25, Y+7 ; 0x07 - 5990: 01 96 adiw r24, 0x01 ; 1 - 5992: 8e 83 std Y+6, r24 ; 0x06 - 5994: 9f 83 std Y+7, r25 ; 0x07 - 5996: 81 2f mov r24, r17 - 5998: 90 2f mov r25, r16 - 599a: df 91 pop r29 - 599c: cf 91 pop r28 - 599e: 1f 91 pop r17 - 59a0: 0f 91 pop r16 - 59a2: 08 95 ret - -000059a4 <__ultoa_invert>: - 59a4: fa 01 movw r30, r20 - 59a6: aa 27 eor r26, r26 - 59a8: 28 30 cpi r18, 0x08 ; 8 - 59aa: 51 f1 breq .+84 ; 0x5a00 <__ultoa_invert+0x5c> - 59ac: 20 31 cpi r18, 0x10 ; 16 - 59ae: 81 f1 breq .+96 ; 0x5a10 <__ultoa_invert+0x6c> - 59b0: e8 94 clt - 59b2: 6f 93 push r22 - 59b4: 6e 7f andi r22, 0xFE ; 254 - 59b6: 6e 5f subi r22, 0xFE ; 254 - 59b8: 7f 4f sbci r23, 0xFF ; 255 - 59ba: 8f 4f sbci r24, 0xFF ; 255 - 59bc: 9f 4f sbci r25, 0xFF ; 255 - 59be: af 4f sbci r26, 0xFF ; 255 - 59c0: b1 e0 ldi r27, 0x01 ; 1 - 59c2: 3e d0 rcall .+124 ; 0x5a40 <__ultoa_invert+0x9c> - 59c4: b4 e0 ldi r27, 0x04 ; 4 - 59c6: 3c d0 rcall .+120 ; 0x5a40 <__ultoa_invert+0x9c> - 59c8: 67 0f add r22, r23 - 59ca: 78 1f adc r23, r24 - 59cc: 89 1f adc r24, r25 - 59ce: 9a 1f adc r25, r26 - 59d0: a1 1d adc r26, r1 - 59d2: 68 0f add r22, r24 - 59d4: 79 1f adc r23, r25 - 59d6: 8a 1f adc r24, r26 - 59d8: 91 1d adc r25, r1 - 59da: a1 1d adc r26, r1 - 59dc: 6a 0f add r22, r26 - 59de: 71 1d adc r23, r1 - 59e0: 81 1d adc r24, r1 - 59e2: 91 1d adc r25, r1 - 59e4: a1 1d adc r26, r1 - 59e6: 20 d0 rcall .+64 ; 0x5a28 <__ultoa_invert+0x84> - 59e8: 09 f4 brne .+2 ; 0x59ec <__ultoa_invert+0x48> - 59ea: 68 94 set - 59ec: 3f 91 pop r19 - 59ee: 2a e0 ldi r18, 0x0A ; 10 - 59f0: 26 9f mul r18, r22 - 59f2: 11 24 eor r1, r1 - 59f4: 30 19 sub r19, r0 - 59f6: 30 5d subi r19, 0xD0 ; 208 - 59f8: 31 93 st Z+, r19 - 59fa: de f6 brtc .-74 ; 0x59b2 <__ultoa_invert+0xe> - 59fc: cf 01 movw r24, r30 - 59fe: 08 95 ret - 5a00: 46 2f mov r20, r22 - 5a02: 47 70 andi r20, 0x07 ; 7 - 5a04: 40 5d subi r20, 0xD0 ; 208 - 5a06: 41 93 st Z+, r20 - 5a08: b3 e0 ldi r27, 0x03 ; 3 - 5a0a: 0f d0 rcall .+30 ; 0x5a2a <__ultoa_invert+0x86> - 5a0c: c9 f7 brne .-14 ; 0x5a00 <__ultoa_invert+0x5c> - 5a0e: f6 cf rjmp .-20 ; 0x59fc <__ultoa_invert+0x58> - 5a10: 46 2f mov r20, r22 - 5a12: 4f 70 andi r20, 0x0F ; 15 - 5a14: 40 5d subi r20, 0xD0 ; 208 - 5a16: 4a 33 cpi r20, 0x3A ; 58 - 5a18: 18 f0 brcs .+6 ; 0x5a20 <__ultoa_invert+0x7c> - 5a1a: 49 5d subi r20, 0xD9 ; 217 - 5a1c: 31 fd sbrc r19, 1 - 5a1e: 40 52 subi r20, 0x20 ; 32 - 5a20: 41 93 st Z+, r20 - 5a22: 02 d0 rcall .+4 ; 0x5a28 <__ultoa_invert+0x84> - 5a24: a9 f7 brne .-22 ; 0x5a10 <__ultoa_invert+0x6c> - 5a26: ea cf rjmp .-44 ; 0x59fc <__ultoa_invert+0x58> - 5a28: b4 e0 ldi r27, 0x04 ; 4 - 5a2a: a6 95 lsr r26 - 5a2c: 97 95 ror r25 - 5a2e: 87 95 ror r24 - 5a30: 77 95 ror r23 - 5a32: 67 95 ror r22 - 5a34: ba 95 dec r27 - 5a36: c9 f7 brne .-14 ; 0x5a2a <__ultoa_invert+0x86> - 5a38: 00 97 sbiw r24, 0x00 ; 0 - 5a3a: 61 05 cpc r22, r1 - 5a3c: 71 05 cpc r23, r1 - 5a3e: 08 95 ret - 5a40: 9b 01 movw r18, r22 - 5a42: ac 01 movw r20, r24 - 5a44: 0a 2e mov r0, r26 - 5a46: 06 94 lsr r0 - 5a48: 57 95 ror r21 - 5a4a: 47 95 ror r20 - 5a4c: 37 95 ror r19 - 5a4e: 27 95 ror r18 - 5a50: ba 95 dec r27 - 5a52: c9 f7 brne .-14 ; 0x5a46 <__ultoa_invert+0xa2> - 5a54: 62 0f add r22, r18 - 5a56: 73 1f adc r23, r19 - 5a58: 84 1f adc r24, r20 - 5a5a: 95 1f adc r25, r21 - 5a5c: a0 1d adc r26, r0 - 5a5e: 08 95 ret - -00005a60 : - 5a60: e0 ec ldi r30, 0xC0 ; 192 - 5a62: f1 e0 ldi r31, 0x01 ; 1 - 5a64: a7 85 ldd r26, Z+15 ; 0x0f - 5a66: a7 fd sbrc r26, 7 - 5a68: fd cf rjmp .-6 ; 0x5a64 - 5a6a: a4 85 ldd r26, Z+12 ; 0x0c - 5a6c: a8 60 ori r26, 0x08 ; 8 - 5a6e: a4 87 std Z+12, r26 ; 0x0c - 5a70: 60 50 subi r22, 0x00 ; 0 - 5a72: 70 4f sbci r23, 0xF0 ; 240 - 5a74: 49 cd rjmp .-1390 ; 0x5508 - -00005a76 : - 5a76: dc 01 movw r26, r24 - 5a78: cb 01 movw r24, r22 - 5a7a: 02 c0 rjmp .+4 ; 0x5a80 - 5a7c: 2d 91 ld r18, X+ - 5a7e: 05 d0 rcall .+10 ; 0x5a8a - 5a80: 41 50 subi r20, 0x01 ; 1 - 5a82: 50 40 sbci r21, 0x00 ; 0 - 5a84: d8 f7 brcc .-10 ; 0x5a7c - 5a86: 08 95 ret - -00005a88 : - 5a88: 26 2f mov r18, r22 - -00005a8a : - 5a8a: e0 ec ldi r30, 0xC0 ; 192 - 5a8c: f1 e0 ldi r31, 0x01 ; 1 - 5a8e: 37 85 ldd r19, Z+15 ; 0x0f - 5a90: 37 fd sbrc r19, 7 - 5a92: fd cf rjmp .-6 ; 0x5a8e - 5a94: 34 85 ldd r19, Z+12 ; 0x0c - 5a96: 37 7f andi r19, 0xF7 ; 247 - 5a98: 34 87 std Z+12, r19 ; 0x0c - 5a9a: 37 85 ldd r19, Z+15 ; 0x0f - 5a9c: 31 ff sbrs r19, 1 - 5a9e: 09 c0 rjmp .+18 ; 0x5ab2 - 5aa0: 36 e3 ldi r19, 0x36 ; 54 - 5aa2: 32 87 std Z+10, r19 ; 0x0a - 5aa4: 38 ed ldi r19, 0xD8 ; 216 - 5aa6: 34 bf out 0x34, r19 ; 52 - 5aa8: 31 e0 ldi r19, 0x01 ; 1 - 5aaa: 33 87 std Z+11, r19 ; 0x0b - 5aac: 37 85 ldd r19, Z+15 ; 0x0f - 5aae: 37 fd sbrc r19, 7 - 5ab0: fd cf rjmp .-6 ; 0x5aac - 5ab2: 33 e3 ldi r19, 0x33 ; 51 - 5ab4: 32 87 std Z+10, r19 ; 0x0a - 5ab6: 80 83 st Z, r24 - 5ab8: 91 83 std Z+1, r25 ; 0x01 - 5aba: 12 82 std Z+2, r1 ; 0x02 - 5abc: 24 83 std Z+4, r18 ; 0x04 - 5abe: 25 e3 ldi r18, 0x35 ; 53 - 5ac0: 22 87 std Z+10, r18 ; 0x0a - 5ac2: 28 ed ldi r18, 0xD8 ; 216 - 5ac4: 31 e0 ldi r19, 0x01 ; 1 - 5ac6: 24 bf out 0x34, r18 ; 52 - 5ac8: 33 87 std Z+11, r19 ; 0x0b - 5aca: 01 96 adiw r24, 0x01 ; 1 - 5acc: 08 95 ret - -00005ace <__divmodsi4>: - 5ace: 05 2e mov r0, r21 - 5ad0: 97 fb bst r25, 7 - 5ad2: 16 f4 brtc .+4 ; 0x5ad8 <__divmodsi4+0xa> - 5ad4: 00 94 com r0 - 5ad6: 0f d0 rcall .+30 ; 0x5af6 <__negsi2> - 5ad8: 57 fd sbrc r21, 7 - 5ada: 05 d0 rcall .+10 ; 0x5ae6 <__divmodsi4_neg2> - 5adc: 51 dc rcall .-1886 ; 0x5380 <__udivmodsi4> - 5ade: 07 fc sbrc r0, 7 - 5ae0: 02 d0 rcall .+4 ; 0x5ae6 <__divmodsi4_neg2> - 5ae2: 46 f4 brtc .+16 ; 0x5af4 <__divmodsi4_exit> - 5ae4: 08 c0 rjmp .+16 ; 0x5af6 <__negsi2> - -00005ae6 <__divmodsi4_neg2>: - 5ae6: 50 95 com r21 - 5ae8: 40 95 com r20 - 5aea: 30 95 com r19 - 5aec: 21 95 neg r18 - 5aee: 3f 4f sbci r19, 0xFF ; 255 - 5af0: 4f 4f sbci r20, 0xFF ; 255 - 5af2: 5f 4f sbci r21, 0xFF ; 255 - -00005af4 <__divmodsi4_exit>: - 5af4: 08 95 ret - -00005af6 <__negsi2>: - 5af6: 90 95 com r25 - 5af8: 80 95 com r24 - 5afa: 70 95 com r23 - 5afc: 61 95 neg r22 - 5afe: 7f 4f sbci r23, 0xFF ; 255 - 5b00: 8f 4f sbci r24, 0xFF ; 255 - 5b02: 9f 4f sbci r25, 0xFF ; 255 - 5b04: 08 95 ret - -00005b06 <__prologue_saves__>: - 5b06: 2f 92 push r2 - 5b08: 3f 92 push r3 - 5b0a: 4f 92 push r4 - 5b0c: 5f 92 push r5 - 5b0e: 6f 92 push r6 - 5b10: 7f 92 push r7 - 5b12: 8f 92 push r8 - 5b14: 9f 92 push r9 - 5b16: af 92 push r10 - 5b18: bf 92 push r11 - 5b1a: cf 92 push r12 - 5b1c: df 92 push r13 - 5b1e: ef 92 push r14 - 5b20: ff 92 push r15 - 5b22: 0f 93 push r16 - 5b24: 1f 93 push r17 - 5b26: cf 93 push r28 - 5b28: df 93 push r29 - 5b2a: cd b7 in r28, 0x3d ; 61 - 5b2c: de b7 in r29, 0x3e ; 62 - 5b2e: ca 1b sub r28, r26 - 5b30: db 0b sbc r29, r27 - 5b32: cd bf out 0x3d, r28 ; 61 - 5b34: de bf out 0x3e, r29 ; 62 - 5b36: 09 94 ijmp - -00005b38 <__epilogue_restores__>: - 5b38: 2a 88 ldd r2, Y+18 ; 0x12 - 5b3a: 39 88 ldd r3, Y+17 ; 0x11 - 5b3c: 48 88 ldd r4, Y+16 ; 0x10 - 5b3e: 5f 84 ldd r5, Y+15 ; 0x0f - 5b40: 6e 84 ldd r6, Y+14 ; 0x0e - 5b42: 7d 84 ldd r7, Y+13 ; 0x0d - 5b44: 8c 84 ldd r8, Y+12 ; 0x0c - 5b46: 9b 84 ldd r9, Y+11 ; 0x0b - 5b48: aa 84 ldd r10, Y+10 ; 0x0a - 5b4a: b9 84 ldd r11, Y+9 ; 0x09 - 5b4c: c8 84 ldd r12, Y+8 ; 0x08 - 5b4e: df 80 ldd r13, Y+7 ; 0x07 - 5b50: ee 80 ldd r14, Y+6 ; 0x06 - 5b52: fd 80 ldd r15, Y+5 ; 0x05 - 5b54: 0c 81 ldd r16, Y+4 ; 0x04 - 5b56: 1b 81 ldd r17, Y+3 ; 0x03 - 5b58: aa 81 ldd r26, Y+2 ; 0x02 - 5b5a: b9 81 ldd r27, Y+1 ; 0x01 - 5b5c: ce 0f add r28, r30 - 5b5e: d1 1d adc r29, r1 - 5b60: cd bf out 0x3d, r28 ; 61 - 5b62: de bf out 0x3e, r29 ; 62 - 5b64: ed 01 movw r28, r26 - 5b66: 08 95 ret - -00005b68 <_exit>: - 5b68: f8 94 cli - -00005b6a <__stop_program>: - 5b6a: ff cf rjmp .-2 ; 0x5b6a <__stop_program> diff --git a/Firmware/Chameleon-Mini/Chameleon-Mini.sym b/Firmware/Chameleon-Mini/Chameleon-Mini.sym deleted file mode 100644 index c038da8..0000000 --- a/Firmware/Chameleon-Mini/Chameleon-Mini.sym +++ /dev/null @@ -1,703 +0,0 @@ - U CALLBACK_Audio_Device_GetSetEndpointProperty - U CALLBACK_Audio_Device_GetSetInterfaceProperty - U CALLBACK_HID_Device_CreateHIDReport - U CALLBACK_HID_Device_ProcessHIDReport - U CALLBACK_HIDParser_FilterHIDReportItem - U CALLBACK_MS_Device_SCSICommandReceived -00000000 W __heap_end -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 a __tmp_reg__ -00000000 T __vectors -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000001 a __zero_reg__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -00000034 a __CCP__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003d a __SP_L__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003e a __SP_H__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -0000003f a __SREG__ -000001fc T ProductString -000001fc T __trampolines_end -000001fc T __trampolines_start -0000021a T ManufacturerString -00000234 T LanguageString -00000238 T ConfigurationDescriptor -00000276 T DeviceDescriptor -00000288 t ConfigurationTable -00000330 t ConfigurationMap -00000400 A __FUSE_REGION_LENGTH__ -00000400 A __LOCK_REGION_LENGTH__ -00000400 A __SIGNATURE_REGION_LENGTH__ -00000400 A __USER_SIGNATURE_REGION_LENGTH__ -00000417 T OddParityByteTable -00000517 T BitReverseByteTable -00000617 t ButtonActionTable -000006f7 t __c.6795 -00000708 t __c.6789 -0000070f t __c.6738 -00000712 t __c.6733 -00000715 t __c.6705 -0000071e t __c.6682 -00000730 t __c.6671 -00000733 t __c.6659 -00000736 t __c.6657 -00000739 t __c.6645 -0000073c t __c.6634 -0000073f t __c.6632 -00000742 t StatusTable -00000808 T CommandTable -000009d0 T TableB -000009f0 T TableA -00000a10 T __ctors_end -00000a10 T __ctors_start -00000a10 T __dtors_end -00000a10 T __dtors_start -00000a10 W __init -00000a1c T __do_copy_data -00000a32 T __do_clear_bss -00000a3a t .do_clear_bss_loop -00000a3c t .do_clear_bss_start -00000a48 T __bad_interrupt -00000a48 W __vector_1 -00000a48 W __vector_10 -00000a48 W __vector_100 -00000a48 W __vector_101 -00000a48 W __vector_102 -00000a48 W __vector_103 -00000a48 W __vector_104 -00000a48 W __vector_105 -00000a48 W __vector_106 -00000a48 W __vector_107 -00000a48 W __vector_108 -00000a48 W __vector_109 -00000a48 W __vector_11 -00000a48 W __vector_110 -00000a48 W __vector_111 -00000a48 W __vector_112 -00000a48 W __vector_113 -00000a48 W __vector_114 -00000a48 W __vector_115 -00000a48 W __vector_116 -00000a48 W __vector_117 -00000a48 W __vector_118 -00000a48 W __vector_119 -00000a48 W __vector_12 -00000a48 W __vector_120 -00000a48 W __vector_121 -00000a48 W __vector_122 -00000a48 W __vector_123 -00000a48 W __vector_124 -00000a48 W __vector_126 -00000a48 W __vector_13 -00000a48 W __vector_14 -00000a48 W __vector_15 -00000a48 W __vector_16 -00000a48 W __vector_17 -00000a48 W __vector_18 -00000a48 W __vector_19 -00000a48 W __vector_2 -00000a48 W __vector_20 -00000a48 W __vector_21 -00000a48 W __vector_23 -00000a48 W __vector_24 -00000a48 W __vector_25 -00000a48 W __vector_26 -00000a48 W __vector_27 -00000a48 W __vector_28 -00000a48 W __vector_29 -00000a48 W __vector_3 -00000a48 W __vector_30 -00000a48 W __vector_31 -00000a48 W __vector_32 -00000a48 W __vector_33 -00000a48 W __vector_35 -00000a48 W __vector_36 -00000a48 W __vector_37 -00000a48 W __vector_38 -00000a48 W __vector_39 -00000a48 W __vector_4 -00000a48 W __vector_40 -00000a48 W __vector_41 -00000a48 W __vector_42 -00000a48 W __vector_43 -00000a48 W __vector_44 -00000a48 W __vector_45 -00000a48 W __vector_46 -00000a48 W __vector_47 -00000a48 W __vector_48 -00000a48 W __vector_49 -00000a48 W __vector_5 -00000a48 W __vector_50 -00000a48 W __vector_51 -00000a48 W __vector_52 -00000a48 W __vector_53 -00000a48 W __vector_54 -00000a48 W __vector_55 -00000a48 W __vector_56 -00000a48 W __vector_57 -00000a48 W __vector_59 -00000a48 W __vector_6 -00000a48 W __vector_60 -00000a48 W __vector_61 -00000a48 W __vector_62 -00000a48 W __vector_63 -00000a48 W __vector_64 -00000a48 W __vector_65 -00000a48 W __vector_66 -00000a48 W __vector_67 -00000a48 W __vector_68 -00000a48 W __vector_69 -00000a48 W __vector_7 -00000a48 W __vector_70 -00000a48 W __vector_71 -00000a48 W __vector_72 -00000a48 W __vector_73 -00000a48 W __vector_74 -00000a48 W __vector_75 -00000a48 W __vector_76 -00000a48 W __vector_77 -00000a48 W __vector_78 -00000a48 W __vector_79 -00000a48 W __vector_8 -00000a48 W __vector_80 -00000a48 W __vector_81 -00000a48 W __vector_82 -00000a48 W __vector_84 -00000a48 W __vector_85 -00000a48 W __vector_86 -00000a48 W __vector_87 -00000a48 W __vector_88 -00000a48 W __vector_89 -00000a48 W __vector_9 -00000a48 W __vector_90 -00000a48 W __vector_91 -00000a48 W __vector_92 -00000a48 W __vector_93 -00000a48 W __vector_94 -00000a48 W __vector_95 -00000a48 W __vector_96 -00000a48 W __vector_97 -00000a48 W __vector_98 -00000a48 W __vector_99 -00000a4a T Crypto1FilterOutput -00000a88 t Crypto1FilterOutputEndShiftSixteenBit -00000a98 t Crypto1FilterOutputEndShiftEightBit -00000aaa t Crypto1FilterOutputEndShiftFourBit -00000abc t Crypto1FilterOutputEndShiftTwoBit -00000acc t Crypto1FilterOutputEndShiftOneBit -00000ad8 T Crypto1Proceed -00000aec t Crypto1ProceedSixteenBitShiftCheck -00000af6 t Crypto1ProceedSixteenBitShiftDone -00000afa T Crypto1Bit -00000bae T led_mode -00000c2a T main -00000cb6 T CALLBACK_USB_GetDescriptor -00000d1a T __vector_default -00000d26 T SystemInit -00000d94 T SystemReset -00000da0 T SystemEnterBootloader -00000dac T SystemStartUSBClock -00000dde T SystemStopUSBClock -00000dfa T SystemInterruptInit -00000e04 t CodecInitDummy -00000e06 t CodecTaskDummy -00000e08 t ApplicationInitDummy -00000e0a t ApplicationResetDummy -00000e0c t ApplicationTaskDummy -00000e0e t ApplicationTickDummy -00000e10 t ApplicationProcessDummy -00000e16 t ApplicationGetUidDummy -00000e18 t ApplicationSetUidDummy -00000e1a T ConfigurationSetById -00000e54 T ConfigurationInit -00000e60 T ConfigurationGetByName -00000e80 T ConfigurationSetByName -00000ec2 T ConfigurationGetList -00000ece T RandomInit -00000ed0 T RandomGetByte -00000ed6 T RandomGetBuffer -00000ef8 T RandomTick -00000f08 T BufferToHexString -00000f7c T HexStringToBuffer -00000ffa T MemoryInit -000010f8 T MemoryReadBlock -0000120e T MemoryWriteBlock -00001468 T MemoryClear -0000152e T MemoryUploadBlock -00001566 T MemoryDownloadBlock -000015a2 t ExecuteButtonAction -0000171a T ButtonInit -00001728 T ButtonTick -0000176c T ButtonGetActionList -000017b8 T ButtonSetActionById -000017d8 T ButtonGetActionByName -0000181a T ButtonSetActionByName -00001860 T SettingsLoad -00001870 T SettingsSave -00001880 T SettingsSetActiveById -000018a6 T SettingsCycle -000018e0 T SettingsGetActiveByName -000018fa T SettingsSetActiveByName -00001912 T MapIdToText -00001942 T MapTextToId -00001990 T MapToString -000019d8 T fifo_buffer_input -00001a02 T __vector_58 -00001a4c T TerminalSendString -00001a56 T TerminalSendStringP -00001a78 T TerminalSendBlock -00001a84 T TerminalInit -00001a8c T TerminalTask -00001abe T TerminalTick -00001b2e T EVENT_USB_Device_Connect -00001b30 T EVENT_USB_Device_Disconnect -00001b32 T EVENT_USB_Device_ConfigurationChanged -00001b3a T EVENT_USB_Device_ControlRequest -00001b42 T CommandGetVersion -00001b68 T CommandGetConfig -00001b72 T CommandSetConfig -00001b84 T CommandExecConfig -00001b8e T CommandGetUid -00001be0 T CommandSetUid -00001c6a T CommandGetReadOnly -00001c82 T CommandSetReadOnly -00001ca8 T CommandExecUpload -00001cb2 T CommandExecDownload -00001cbc T CommandExecReset -00001cd0 T CommandExecUpgrade -00001ce4 T CommandGetMemSize -00001d14 T CommandGetUidSize -00001d40 T CommandExecButton -00001d4a T CommandGetButton -00001d58 T CommandSetButton -00001d6a T CommandExecButtonLong -00001d74 T CommandGetButtonLong -00001d82 T CommandSetButtonLong -00001d94 T CommandGetSetting -00001d9e T CommandSetSetting -00001db0 T CommandExecClear -00001db6 T CommandExecHelp -00001e26 T CommandGetRssi -00001e8c T CommandGetUltralightPassword -00001ef2 T ComPass -00001f94 T CommandGetDetection -00002000 T CommandSetDetection -0000203e T XModemReceive -00002074 T XModemSend -000020a0 T XModemProcessByte -00002324 T XModemTick -0000239a t GetStatusMessageP -000023cc T CommandLineProcessByte -000025c6 T CommandLineTick -00002632 t StartDemod -0000266e T __vector_34 -000026f4 T __vector_22 -0000282c T __vector_83 -000029f4 T ISO14443ACodecInit -00002a62 T ISO14443ACodecTask -00002b40 t VerifyAuthentication -00002b64 t AppInitEV1Common -00002bd6 T MifareUltralightAppInit -00002bfe T MifareUltralightEV11AppInit -00002c06 T MifareUltralightEV12AppInit -00002c0e T MifareUltralightAppReset -00002c16 T MifareUltralightAppTask -00002c18 T MifareUltralightAppProcess -00002fff W __stack -00003264 T MifareUltralightGetUid -0000328a T MifareUltralightSetUid -00003308 T MifareClassicAppInit1K -00003326 T MifareClassicAppInit4K -00003344 T MifareClassicAppReset -0000334c T MifareClassicAppTask -0000334e T MifareClassicAppProcess -00003e20 T MifareClassicGetUid -00003e58 T MifareClassicSetUid -00003eac T ISO14443AAppendCRCA -00003f02 T ISO14443ACheckCRCA -00003f64 t Crypto1ByteAuth -00003f96 T Crypto1Setup -000040c4 T Crypto1Auth -000040ea T Crypto1Byte -0000410c T Crypto1Nibble -0000412e T Crypto1PRNG -00004182 T MifareDetectionAppProcess -0000446c T MifareDetectionInit -00004486 T MifareDetectionReset -00004488 T USB_Device_ProcessControlRequest -000046c8 W EVENT_USB_Device_Reset -000046c8 W EVENT_USB_Device_StartOfFrame -000046c8 W EVENT_USB_Device_Suspend -000046c8 W EVENT_USB_Device_WakeUp -000046c8 T USB_Event_Stub -000046ca T USB_USBTask -000046ec T Endpoint_Write_Stream_LE -00004786 T Endpoint_Write_Control_Stream_LE -00004878 T Endpoint_Write_Control_PStream_LE -0000496e T Endpoint_ClearIN -000049a0 T Endpoint_ClearOUT -000049be T Endpoint_Read_8 -000049de T Endpoint_Write_8 -000049fe T Endpoint_SelectEndpoint -00004a68 T Endpoint_IsINReady -00004a80 T Endpoint_IsOUTReceived -00004ab4 T Endpoint_IsSETUPReceived -00004ae8 T Endpoint_ClearSETUP -00004b40 T Endpoint_StallTransaction -00004b76 T Endpoint_ConfigureEndpoint_PRV -00004bee T Endpoint_ConfigureEndpointTable -00004cb4 T Endpoint_ClearEndpoints -00004cec T Endpoint_ClearStatusStage -00004d18 T Endpoint_WaitUntilReady -00004d9c T USB_Disable -00004db6 T USB_ResetInterface -00004e12 T USB_Init -00004e64 T USB_INT_DisableAllInterrupts -00004e72 T USB_INT_ClearAllInterrupts -00004e7e T __vector_125 -00004f50 T CDC_Device_ConfigureEndpoints -00004f9a T CDC_Device_SendString -00004fee T CDC_Device_SendData -00005036 T CDC_Device_SendByte -00005088 T CDC_Device_Flush -00005100 T CDC_Device_USBTask -00005138 T CDC_Device_ReceiveByte -000051dc T CDC_Device_Event_Stub -000051dc W EVENT_CDC_Device_BreakSent -000051dc W EVENT_CDC_Device_ControLineStateChanged -000051dc W EVENT_CDC_Device_LineEncodingChanged -000051de T CDC_Device_ProcessControlRequest -0000531a T __udivmodqi4 -00005320 t __udivmodqi4_loop -00005328 t __udivmodqi4_ep -00005332 T __udivmodhi4 -0000533a t __udivmodhi4_loop -00005348 t __udivmodhi4_ep -0000535a T _div -0000535a T __divmodhi4 -00005370 t __divmodhi4_neg1 -00005378 t __divmodhi4_neg2 -0000537e t __divmodhi4_exit -00005380 T __udivmodsi4 -0000538c t __udivmodsi4_loop -000053a6 t __udivmodsi4_ep -000053c4 T __muluhisi3 -000053d8 T __mulshisi3 -000053dc T __mulohisi3 -000053e4 T __umulhisi3 -00005402 t do_rand -0000548e T rand_r -00005490 T rand -00005496 T srand -000054ac T memcpy_P -000054be T strcmp_P -000054d0 T strncpy_P -000054ee T memcmp -00005508 T memcpy -0000551a T memset -00005528 T snprintf_P -00005582 T vfprintf -00005908 T strnlen_P -0000591e T strnlen -00005934 T fputc -000059a4 T __ultoa_invert -00005a60 T eeprom_read_block -00005a76 T eeprom_write_block -00005a88 T eeprom_write_byte -00005a8a T eeprom_write_r18 -00005ace T __divmodsi4 -00005ae6 t __divmodsi4_neg2 -00005af4 t __divmodsi4_exit -00005af6 T __negsi2 -00005b06 T __prologue_saves__ -00005b38 T __epilogue_restores__ -00005b68 W exit -00005b68 T _exit -00005b6a t __stop_program -00005b6c A __data_load_start -00005b6c T _etext -00005bb8 A __data_load_end -0000ffa0 A __DATA_REGION_LENGTH__ -00010000 A __EEPROM_REGION_LENGTH__ -00100000 A __TEXT_REGION_LENGTH__ -00802000 D __data_start -00802000 D GlobalSettings -0080202b d TerminalInitDelay -0080202c D TerminalHandle -00802047 d next -0080204c B __bss_start -0080204c D __data_end -0080204c D _edata -0080204c b PressTickCounter.6590 -0080204d B LEDHighPulseMask -0080204e B LEDLowPulseMask -0080204f B fifo_buf -008020d5 B TerminalState -008020d6 b CallbackFunc -008020d8 b BlockAddress -008020dc b BufferIdx -008020de b RetryTimeout -008020e0 b RetryCount -008020e1 b Checksum -008020e2 b ReceivedFrameNumber -008020e3 b CurrentFrameNumber -008020e4 b State -008020e5 B CommandLinePendingTaskTimeout -008020e7 b TaskPendingSince -008020e9 b TaskPending -008020ea b BufferIdx -008020ec b SamplePosition -008020ed b LoadModState -008020ee b LastBit -008020ef b IsParityBit -008020f0 b SampleRegister -008020f1 b DataRegister -008020f2 b BitSent -008020f4 b BitCount -008020f6 b ParityBufferPtr -008020f8 b CodecBufferPtr -008020fa b Flags -008020fc b ReadAccessProtected -008020fd b FirstAuthenticatedPage -008020fe b Authenticated -008020ff b CompatWritePageAddress -00802100 b ArmedForCompatWrite -00802101 b PageCount -00802102 b FromHalt -00802103 b State -00802104 b Flavor -00802105 b _7BUID -00802106 b CardSAKValue -00802107 b CardATQAValue -00802109 b BlockBuffer -00802119 b CurrentAddress -0080211a b ReaderResponse -0080211e b CardResponse -00802122 b State -00802123 B data_svae -00802133 b keyb_falg -00802134 b turn_falgb -00802135 b turn_falga -00802136 b CardSAKValue -00802137 b CardATQAValue -00802139 b State -0080213a B ActiveConfiguration -00802152 B TerminalBuffer -00802252 B CodecBuffer -00802352 B StateEven -00802356 B StateOdd -0080235a B USB_Device_ConfigurationNumber -0080235b B USB_Device_CurrentlySelfPowered -0080235c B USB_Device_RemoteWakeupEnabled -0080235d B USB_IsInitialized -0080235e B USB_DeviceState -0080235f B USB_ControlRequest -00802367 B USB_Endpoint_SelectedFIFO -00802369 B USB_Endpoint_SelectedHandle -0080236b B USB_Endpoint_SelectedEndpoint -0080236c B USB_Endpoint_FIFOs -00802684 B USB_EndpointTable -008026e7 B __bss_end -008026e7 B _end -00810000 D StoredSettings -0081002b D __eeprom_end diff --git a/Firmware/Chameleon-Mini/LED.h b/Firmware/Chameleon-Mini/LED.h index 1b12889..c495506 100644 --- a/Firmware/Chameleon-Mini/LED.h +++ b/Firmware/Chameleon-Mini/LED.h @@ -26,6 +26,7 @@ #define LED_EIGHT PIN0_bm #define LED_LOW_MASK (LED_FIVE | LED_SIX | LED_SEVEN| LED_EIGHT) +void LEDMode(void); void LEDInit(void); void LEDTick(void); void CARDInit(void); diff --git a/Firmware/Chameleon-Mini/LUFADescriptors.c b/Firmware/Chameleon-Mini/LUFADescriptors.c index 404d959..6e3f6a4 100644 --- a/Firmware/Chameleon-Mini/LUFADescriptors.c +++ b/Firmware/Chameleon-Mini/LUFADescriptors.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2012. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -18,7 +18,7 @@ advertising or publicity pertaining to distribution of the software without specific, written prior permission. - The author disclaim all warranties with regard to this + The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages @@ -37,7 +37,6 @@ #include "LUFADescriptors.h" - /** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall * device characteristics, including the supported USB version, control endpoint size and the * number of device configurations. The descriptor is read out by the USB host when the enumeration @@ -45,24 +44,24 @@ */ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { - .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, + .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, - .USBSpecification = VERSION_BCD(01.10), - .Class = CDC_CSCP_CDCClass, - .SubClass = CDC_CSCP_NoSpecificSubclass, - .Protocol = CDC_CSCP_NoSpecificProtocol, + .USBSpecification = VERSION_BCD(1,1,0), + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_NoSpecificSubclass, + .Protocol = CDC_CSCP_NoSpecificProtocol, - .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, + .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, - .VendorID = 0x03EB, - .ProductID = 0x2044, - .ReleaseNumber = VERSION_BCD(00.01), + .VendorID = 0x03EB, + .ProductID = 0x2044, + .ReleaseNumber = VERSION_BCD(0,0,1), - .ManufacturerStrIndex = 0x01, - .ProductStrIndex = 0x02, - .SerialNumStrIndex = USE_INTERNAL_SERIAL, + .ManufacturerStrIndex = STRING_ID_Manufacturer, + .ProductStrIndex = STRING_ID_Product, + .SerialNumStrIndex = USE_INTERNAL_SERIAL, - .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS + .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS }; /** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage @@ -72,189 +71,173 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = */ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { - .Config = - { - .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, + .Config = + { + .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration}, - .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), - .TotalInterfaces = 2, + .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t), + .TotalInterfaces = 2, - .ConfigurationNumber = 1, - .ConfigurationStrIndex = NO_DESCRIPTOR, + .ConfigurationNumber = 1, + .ConfigurationStrIndex = NO_DESCRIPTOR, - .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED), + .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_SELFPOWERED), - .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) - }, + .MaxPowerConsumption = USB_CONFIG_POWER_MA(100) + }, - .CDC_CCI_Interface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + .CDC_CCI_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 0, - .AlternateSetting = 0, + .InterfaceNumber = INTERFACE_ID_CDC_CCI, + .AlternateSetting = 0, - .TotalEndpoints = 1, + .TotalEndpoints = 1, - .Class = CDC_CSCP_CDCClass, - .SubClass = CDC_CSCP_ACMSubclass, - .Protocol = CDC_CSCP_ATCommandProtocol, + .Class = CDC_CSCP_CDCClass, + .SubClass = CDC_CSCP_ACMSubclass, + .Protocol = CDC_CSCP_ATCommandProtocol, - .InterfaceStrIndex = NO_DESCRIPTOR - }, + .InterfaceStrIndex = NO_DESCRIPTOR + }, - .CDC_Functional_Header = - { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, - .Subtype = CDC_DSUBTYPE_CSInterface_Header, + .CDC_Functional_Header = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Header, - .CDCSpecification = VERSION_BCD(01.10), - }, + .CDCSpecification = VERSION_BCD(1,1,0), + }, - .CDC_Functional_ACM = - { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, - .Subtype = CDC_DSUBTYPE_CSInterface_ACM, + .CDC_Functional_ACM = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_ACM, - .Capabilities = 0x06, - }, + .Capabilities = 0x06, + }, - .CDC_Functional_Union = - { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, - .Subtype = CDC_DSUBTYPE_CSInterface_Union, + .CDC_Functional_Union = + { + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Subtype = CDC_DSUBTYPE_CSInterface_Union, - .MasterInterfaceNumber = 0, - .SlaveInterfaceNumber = 1, - }, + .MasterInterfaceNumber = INTERFACE_ID_CDC_CCI, + .SlaveInterfaceNumber = INTERFACE_ID_CDC_DCI, + }, - .CDC_NotificationEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + .CDC_NotificationEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = CDC_NOTIFICATION_EPADDR, - .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CDC_NOTIFICATION_EPSIZE, - .PollingIntervalMS = 0xFF - }, + .EndpointAddress = CDC_NOTIFICATION_EPADDR, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_NOTIFICATION_EPSIZE, + .PollingIntervalMS = 0xFF + }, - .CDC_DCI_Interface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, + .CDC_DCI_Interface = + { + .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = 1, - .AlternateSetting = 0, + .InterfaceNumber = INTERFACE_ID_CDC_DCI, + .AlternateSetting = 0, - .TotalEndpoints = 2, + .TotalEndpoints = 2, - .Class = CDC_CSCP_CDCDataClass, - .SubClass = CDC_CSCP_NoDataSubclass, - .Protocol = CDC_CSCP_NoDataProtocol, + .Class = CDC_CSCP_CDCDataClass, + .SubClass = CDC_CSCP_NoDataSubclass, + .Protocol = CDC_CSCP_NoDataProtocol, - .InterfaceStrIndex = NO_DESCRIPTOR - }, + .InterfaceStrIndex = NO_DESCRIPTOR + }, - .CDC_DataOutEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + .CDC_DataOutEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = CDC_RX_EPADDR, - .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x05 - }, + .EndpointAddress = CDC_RX_EPADDR, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_TXRX_EPSIZE, + .PollingIntervalMS = 0x05 + }, - .CDC_DataInEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, + .CDC_DataInEndpoint = + { + .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = CDC_TX_EPADDR, - .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x05 - } + .EndpointAddress = CDC_TX_EPADDR, + .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), + .EndpointSize = CDC_TXRX_EPSIZE, + .PollingIntervalMS = 0x05 + } }; /** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests * the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate * via the language ID table available at USB.org what languages the device supports for its string descriptors. */ -const USB_Descriptor_String_t PROGMEM LanguageString = -{ - .Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String}, - - .UnicodeString = {LANGUAGE_ID_ENG} -}; +const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG); /** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device * Descriptor. */ -const USB_Descriptor_String_t PROGMEM ManufacturerString = -{ - .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String}, - - .UnicodeString = L"Dean Camera" -}; +const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"Chameleon Mini"); /** Product descriptor string. This is a Unicode string containing the product's details in human readable form, * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device * Descriptor. */ -const USB_Descriptor_String_t PROGMEM ProductString = -{ - .Header = {.Size = USB_STRING_LEN(13), .Type = DTYPE_String}, +const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"RevE Rebooted (iceman1001)"); - .UnicodeString = L"LUFA CDC Demo" -}; - -/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" +/** This function is called by the library when in device mode, and must be overridden (see LUFA library "USB Descriptors" * documentation) by the application code so that the address and size of a requested descriptor can be given * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the * USB host. */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, + const uint16_t wIndex, const void** const DescriptorAddress) { - const uint8_t DescriptorType = (wValue >> 8); - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - { - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - Size = sizeof(USB_Descriptor_Configuration_t); - break; - case DTYPE_String: - switch (DescriptorNumber) - { - case 0x00: - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - break; - case 0x01: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - break; - case 0x02: - Address = &ProductString; - Size = pgm_read_byte(&ProductString.Header.Size); - break; - } - - break; - } - - *DescriptorAddress = Address; - return Size; + const uint8_t DescriptorType = (wValue >> 8); + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; + + switch (DescriptorType) + { + case DTYPE_Device: + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + break; + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + Size = sizeof(USB_Descriptor_Configuration_t); + break; + case DTYPE_String: + if (DescriptorNumber == STRING_ID_Language) + { + Address = &LanguageString; + Size = LanguageString.Header.Size; + } + else if (DescriptorNumber == STRING_ID_Manufacturer) + { + Address = &ManufacturerString; + Size = ManufacturerString.Header.Size; + } + else if (DescriptorNumber == STRING_ID_Product) + { + Address = &ProductString; + Size = ProductString.Header.Size; + } + + break; + } + + *DescriptorAddress = Address; + return Size; } - diff --git a/Firmware/Chameleon-Mini/LUFADescriptors.h b/Firmware/Chameleon-Mini/LUFADescriptors.h index 500649f..03a5ce9 100644 --- a/Firmware/Chameleon-Mini/LUFADescriptors.h +++ b/Firmware/Chameleon-Mini/LUFADescriptors.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2012. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -18,7 +18,7 @@ advertising or publicity pertaining to distribution of the software without specific, written prior permission. - The author disclaim all warranties with regard to this + The author disclaims all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages @@ -36,54 +36,75 @@ #ifndef _DESCRIPTORS_H_ #define _DESCRIPTORS_H_ - /* Includes: */ - #include - - #include - - /* Macros: */ - /** Endpoint address of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - - /** Endpoint address of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - - /** Endpoint address of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) - - /** Size in bytes of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPSIZE 8 - - /** Size in bytes of the CDC data IN and OUT endpoints. */ - #define CDC_TXRX_EPSIZE 16 - - /* Type Defines: */ - /** Type define for the device configuration descriptor structure. This must be defined in the - * application code, as the configuration descriptor contains several sub-descriptors which - * vary between devices, and which describe the device's usage to the host. - */ - typedef struct - { - USB_Descriptor_Configuration_Header_t Config; - - // CDC Control Interface - USB_Descriptor_Interface_t CDC_CCI_Interface; - USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; - USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; - USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; - USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; - - // CDC Data Interface - USB_Descriptor_Interface_t CDC_DCI_Interface; - USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; - USB_Descriptor_Endpoint_t CDC_DataInEndpoint; - } USB_Descriptor_Configuration_t; - - /* Function Prototypes: */ - uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress) - ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + /* Includes: */ + #include + #include + + //#include "Config/AppConfig.h" + + /* Macros: */ + /** Endpoint address for the CDC control interface event notification endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) + + /** Endpoint address for the CDC data interface TX (data IN) endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) + + /** Endpoint address for the CDC data interface RX (data OUT) endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) + + /** Size of the CDC data interface TX and RX data endpoint banks, in bytes. */ + #define CDC_TXRX_EPSIZE 16 + + /** Size of the CDC control interface notification endpoint bank, in bytes. */ + #define CDC_NOTIFICATION_EPSIZE 8 + + /* Type Defines: */ + /** Type define for the device configuration descriptor structure. This must be defined in the + * application code, as the configuration descriptor contains several sub-descriptors which + * vary between devices, and which describe the device's usage to the host. + */ + typedef struct + { + USB_Descriptor_Configuration_Header_t Config; + + // CDC Control Interface + USB_Descriptor_Interface_t CDC_CCI_Interface; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; + USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; + + // CDC Data Interface + USB_Descriptor_Interface_t CDC_DCI_Interface; + USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; + USB_Descriptor_Endpoint_t CDC_DataInEndpoint; + } USB_Descriptor_Configuration_t; + + /** Enum for the device interface descriptor IDs within the device. Each interface descriptor + * should have a unique ID index associated with it, which can be used to refer to the + * interface from other descriptors. + */ + enum InterfaceDescriptors_t + { + INTERFACE_ID_CDC_CCI = 0, /**< CDC CCI interface descriptor ID */ + INTERFACE_ID_CDC_DCI = 1, /**< CDC DCI interface descriptor ID */ + }; + + /** Enum for the device string descriptor IDs within the device. Each string descriptor should + * have a unique ID index associated with it, which can be used to refer to the string from + * other descriptors. + */ + enum StringDescriptors_t + { + STRING_ID_Language = 0, /**< Supported Languages string descriptor ID (must be zero) */ + STRING_ID_Manufacturer = 1, /**< Manufacturer string ID */ + STRING_ID_Product = 2, /**< Product string ID */ + }; + + /* Function Prototypes: */ + uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint16_t wIndex, + const void** const DescriptorAddress) + ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif - diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/.gitignore b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/.gitignore old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/HID_EEPROM_Loader.c old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/HID_EEPROM_Loader/makefile old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/License.txt b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/License.txt old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/ModulesOverview.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/ModulesOverview.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md old mode 100644 new mode 100755 index 16df7a5..3ecbb33 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/WritingYourOwnModules.md @@ -63,7 +63,6 @@ user: $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) As well as complaining if they are set, but currently empty: - $(call ERROR_IF_EMPTY, SOME_MANDATORY_VARIABLE) $(call ERROR_IF_EMPTY, SOME_OPTIONAL_BUT_NON_EMPTY_VARIABLE) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/atprogram.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/atprogram.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/atprogram.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/atprogram.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/avrdude.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/avrdude.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/avrdude.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/avrdude.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.md old mode 100644 new mode 100755 index 406abfe..c7c9767 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.md +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.md @@ -95,7 +95,7 @@ syntax) if desired, as they are provided by this module. DMBS_VERSION - Current version of this DMBS release, as a ISO 8601 integer (such as `20160403` for `2016-04-03`). + Current version of this DMBS release, as a ISO 8601 integer (such as `160403` for `2016-04-03`). diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.mk old mode 100644 new mode 100755 index 1edbd17..1c55569 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.mk +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/core.mk @@ -16,7 +16,7 @@ DMBS_BUILD_PROVIDED_MACROS += DMBS_CHECK_VERSION ERROR_IF_UNSET ERROR_IF_EMPTY E SHELL = /bin/sh # Current DMBS release version -DMBS_VERSION := 20170426 +DMBS_VERSION := 20160717 # Macro to check the DMBS version, aborts if the given DMBS version is below the current version DMBS_CHECK_VERSION ?= $(if $(filter-out 0, $(shell test $(DMBS_VERSION) -lt $(1); echo $$?)), , $(error DMBS version $(1) or newer required, current version is $(DMBS_VERSION))) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/cppcheck.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/cppcheck.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/cppcheck.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/cppcheck.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/dfu.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/dfu.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/dfu.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/dfu.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/doxygen.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/doxygen.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/doxygen.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/doxygen.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.md old mode 100644 new mode 100755 index d28fd9a..f516da5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.md +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.md @@ -83,7 +83,7 @@ variable per line) in the user makefile to be able to use this module: TARGET Name of the application output file prefix (e.g. `TestApplication`). - + ARCH Target device architecture (e.g. `AVR8`). @@ -103,10 +103,6 @@ be assumed. - - - - @@ -147,10 +143,6 @@ be assumed. - - - - @@ -167,6 +159,10 @@ be assumed. + + + +
COMPILER_PATHPath to the compiler to use, in case a specific compiler should be substituted for the one in the system's `PATH` variable. Default is blank (use `PATH` provided compiler).
OPTIMIZATION Optimization level to use when compiling C and C++ source files. Default is `s` (optimize for smallest size).LINKER_RELAXATIONS Boolean, if `Y` linker relaxations will be enabled to slightly reduce the resulting binary's size. Default is `Y`.
JUMP_TABLESBoolean, if `Y` jump tables will be enabled to slightly reduce the resulting binary's size - note that this can cause incorrect jumps if the binary is relocated after compilation, such as for a bootloader. Default is `N`.
OBJDIR Directory to store the intermediate object files, as they are generated from the source files. Default is `obj`.DEBUG_LEVEL Level of the debugging information to generate in the compiled object files. Debug is 2 (medium level debugging information).
COMPILER_PATHPath to the compiler to use, in case a specific compiler should be substituted for the one in the system's `PATH` variable. Default is blank (use `PATH` provided compiler).
@@ -204,8 +200,5 @@ this module. The changes to this module since its initial release are listed below, as of the DMBS version where the change was made. -### 20170426 -Added `JUMP_TABLES` optional variable. - ### 20160403 Initial release. diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.mk old mode 100644 new mode 100755 index 6126cf9..3affa63 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.mk +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/gcc.mk @@ -9,7 +9,7 @@ DMBS_BUILD_MODULES += GCC DMBS_BUILD_TARGETS += size symbol-sizes all lib elf bin hex lss clean mostlyclean DMBS_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC -DMBS_BUILD_OPTIONAL_VARS += COMPILER_PATH OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS OBJDIR OBJECT_FILES DEBUG_TYPE DEBUG_LEVEL LINKER_RELAXATIONS JUMP_TABLES +DMBS_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS OBJDIR OBJECT_FILES DEBUG_TYPE DEBUG_LEVEL LINKER_RELAXATIONS COMPILER_PATH DMBS_BUILD_PROVIDED_VARS += DMBS_BUILD_PROVIDED_MACROS += @@ -34,7 +34,6 @@ OBJECT_FILES ?= DEBUG_FORMAT ?= dwarf-2 DEBUG_LEVEL ?= 2 LINKER_RELAXATIONS ?= Y -JUMP_TABLES ?= N # Sanity check user supplied values $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) @@ -48,7 +47,6 @@ $(call ERROR_IF_EMPTY, OBJDIR) $(call ERROR_IF_EMPTY, DEBUG_FORMAT) $(call ERROR_IF_EMPTY, DEBUG_LEVEL) $(call ERROR_IF_NONBOOL, LINKER_RELAXATIONS) -$(call ERROR_IF_NONBOOL, JUMP_TABLES) # Determine the utility prefix to use for the selected architecture ifeq ($(ARCH), AVR8) @@ -119,14 +117,7 @@ ifneq ($(F_CPU),) BASE_CC_FLAGS += -DF_CPU=$(F_CPU)UL endif ifeq ($(LINKER_RELAXATIONS), Y) - BASE_CC_FLAGS += -mrelax -endif -ifeq ($(JUMP_TABLES), N) - # This flag is required for bootloaders as GCC will emit invalid jump table - # assembly code for devices with large amounts of flash; the jump table target - # is extracted from FLASH without using the correct ELPM instruction, resulting - # in a pseudo-random jump target. - BASE_CC_FLAGS += -fno-jump-tables +BASE_CC_FLAGS += -mrelax endif # Additional language specific compiler flags @@ -134,6 +125,12 @@ BASE_C_FLAGS := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes BASE_CPP_FLAGS := -x c++ -O$(OPTIMIZATION) -std=$(CPP_STANDARD) BASE_ASM_FLAGS := -x assembler-with-cpp +# This flag is required for bootloaders as GCC will emit invalid jump table +# assembly code for devices with large amounts of flash; the jump table target +# is extracted from FLASH without using the correct ELPM instruction, resulting +# in a pseudo-random jump target. +BASE_CC_FLAGS += -fno-jump-tables + # Create a list of flags to pass to the linker BASE_LD_FLAGS := -lm -Wl,-Map=$(TARGET).map,--cref -Wl,--gc-sections ifeq ($(LINKER_RELAXATIONS), Y) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/hid.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/hid.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/hid.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/DMBS/hid.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/Readme.md b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/Readme.md old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/Template/Template.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/Template/Template.c old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/Template/makefile b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/DMBS/Template/makefile old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/LUFA/lufa-gcc.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/LUFA/lufa-gcc.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/LUFA/lufa-sources.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/LUFA/lufa-sources.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_atprogram.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_atprogram.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_avrdude.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_avrdude.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_build.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_build.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_core.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_core.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_cppcheck.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_cppcheck.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_dfu.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_dfu.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_doxygen.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_doxygen.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_hid.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_hid.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_sources.mk b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Build/lufa_sources.mk old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/ArchitectureSpecific.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/ArchitectureSpecific.h old mode 100644 new mode 100755 index b262ceb..28f2900 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/ArchitectureSpecific.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/ArchitectureSpecific.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -70,18 +70,18 @@ * * \note This macro is not available for all architectures. */ - #define JTAG_ENABLE() MACROS{ \ - __asm__ __volatile__ ( \ - "in __tmp_reg__,__SREG__" "\n\t" \ - "cli" "\n\t" \ - "out %1, %0" "\n\t" \ - "out __SREG__, __tmp_reg__" "\n\t" \ - "out %1, %0" "\n\t" \ - : \ - : "r" (MCUCR & ~(1 << JTD)), \ - "M" (_SFR_IO_ADDR(MCUCR)) \ - : "r0"); \ - }MACROE + #define JTAG_ENABLE() do { \ + __asm__ __volatile__ ( \ + "in __tmp_reg__,__SREG__" "\n\t" \ + "cli" "\n\t" \ + "out %1, %0" "\n\t" \ + "out __SREG__, __tmp_reg__" "\n\t" \ + "out %1, %0" "\n\t" \ + : \ + : "r" (MCUCR & ~(1 << JTD)), \ + "M" (_SFR_IO_ADDR(MCUCR)) \ + : "r0"); \ + } while (0) /** Disables the AVR's JTAG bus in software, until a system reset. This will override the current JTAG * status as set by the JTAGEN fuse, disabling JTAG debugging and reverting the JTAG pins back to GPIO @@ -89,18 +89,18 @@ * * \note This macro is not available for all architectures. */ - #define JTAG_DISABLE() MACROS{ \ - __asm__ __volatile__ ( \ - "in __tmp_reg__,__SREG__" "\n\t" \ - "cli" "\n\t" \ - "out %1, %0" "\n\t" \ - "out __SREG__, __tmp_reg__" "\n\t" \ - "out %1, %0" "\n\t" \ - : \ - : "r" (MCUCR | (1 << JTD)), \ - "M" (_SFR_IO_ADDR(MCUCR)) \ - : "r0"); \ - }MACROE + #define JTAG_DISABLE() do { \ + __asm__ __volatile__ ( \ + "in __tmp_reg__,__SREG__" "\n\t" \ + "cli" "\n\t" \ + "out %1, %0" "\n\t" \ + "out __SREG__, __tmp_reg__" "\n\t" \ + "out %1, %0" "\n\t" \ + : \ + : "r" (MCUCR | (1 << JTD)), \ + "M" (_SFR_IO_ADDR(MCUCR)) \ + : "r0"); \ + } while (0) #endif /** Defines a volatile \c NOP statement which cannot be optimized out by the compiler, and thus can always @@ -124,7 +124,10 @@ * * \param[in] Condition Condition that will be evaluated. */ - #define JTAG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE + #define JTAG_ASSERT(Condition) do { \ + if (!(Condition)) \ + JTAG_DEBUG_BREAK(); \ + } while (0) /** Macro for testing condition \c "x" and writing debug data to the stdout stream if \c false. The stdout stream * must be pre-initialized before this macro is run and linked to an output device, such as the microcontroller's @@ -136,17 +139,17 @@ * * \param[in] Condition Condition that will be evaluated, */ - #define STDOUT_ASSERT(Condition) MACROS{ if (!(Condition)) { \ - printf_P(PSTR("%s: Function \"%s\", Line %d: " \ - "Assertion \"%s\" failed.\r\n"), \ - __FILE__, __func__, __LINE__, #Condition); } }MACROE + #define STDOUT_ASSERT(Condition) do { \ + if (!(Condition)) \ + printf_P(PSTR("%s: Function \"%s\", Line %d: " \ + "Assertion \"%s\" failed.\r\n"), \ + __FILE__, __func__, __LINE__, #Condition); \ + } while (0) #if !defined(pgm_read_ptr) || defined(__DOXYGEN__) - /** Reads a pointer out of PROGMEM space on the AVR8 architecture. This is currently a wrapper for the - * avr-libc \c pgm_read_word() macro with a \c void* cast, so that its value can be assigned directly - * to a pointer variable or used in pointer arithmetic without further casting in C. In a future - * avr-libc distribution this will be part of the standard API and will be implemented in a more formal - * manner. + /** Reads a pointer out of PROGMEM space on the AVR8 architecture. This is a wrapper for the avr-libc + * \c pgm_read_word() macro with a \c void* cast, so that its value can be assigned directly to a + * pointer variable or used in pointer arithmetic without further casting in C. * * \note This macro is not available for all architectures. * @@ -154,16 +157,21 @@ * * \return Pointer retrieved from PROGMEM space. */ - #define pgm_read_ptr(Address) (void*)pgm_read_word(Address) + #define pgm_read_ptr(Address) (void*)pgm_read_word(Address) #endif #elif (ARCH == ARCH_UC3) #define JTAG_DEBUG_POINT() __asm__ __volatile__ ("nop" ::) #define JTAG_DEBUG_BREAK() __asm__ __volatile__ ("breakpoint" ::) - #define JTAG_ASSERT(Condition) MACROS{ if (!(Condition)) { JTAG_DEBUG_BREAK(); } }MACROE - #define STDOUT_ASSERT(Condition) MACROS{ if (!(Condition)) { \ - printf("%s: Function \"%s\", Line %d: " \ - "Assertion \"%s\" failed.\r\n"), \ - __FILE__, __func__, __LINE__, #Condition); } }MACROE + #define JTAG_ASSERT(Condition) do { \ + if (!(Condition)) \ + JTAG_DEBUG_BREAK(); \ + } while (0) + #define STDOUT_ASSERT(Condition) do { \ + if (!(Condition)) \ + printf("%s: Function \"%s\", Line %d: " \ + "Assertion \"%s\" failed.\r\n", \ + __FILE__, __func__, __LINE__, #Condition); \ + } while (0) #endif /* Disable C linkage for C++ Compilers: */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Architectures.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Architectures.h old mode 100644 new mode 100755 index 69c09bb..5873674 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Architectures.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Architectures.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Attributes.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Attributes.h old mode 100644 new mode 100755 index 201d6b9..c8e4104 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Attributes.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Attributes.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -90,11 +90,6 @@ */ #define ATTR_NO_INLINE __attribute__ ((noinline)) - /** Forces the compiler to never inline the specified function. When applied, the given function will be - * always be called explicitly under all circumstances. - */ - #define ATTR_NEVER_INLINE __attribute__ ((noinline)) - /** Forces the compiler to inline the specified function. When applied, the given function will be * in-lined under all circumstances. */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/BoardTypes.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/BoardTypes.h old mode 100644 new mode 100755 index 9fe6b47..a8bb191 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/BoardTypes.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/BoardTypes.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -234,6 +234,18 @@ /** Selects the U2S specific board drivers, including the Button and LEDs drivers. */ #define BOARD_U2S 56 + /** Selects the Arduino YUN specific board drivers, including the driver for the board LEDs. */ + #define BOARD_YUN 57 + + /** Selects the Arduino Micro specific board drivers, including the driver for the board LEDs. */ + #define BOARD_MICRO 58 + + /** Selects the Pololu A-Star Micro specific board drivers, including the driver for the board LEDs. */ + #define BOARD_POLOLUMICRO 59 + + /** Selects the Atmel Xplained-MINI specific board drivers, including the driver for the board LEDs. */ + #define BOARD_XPLAINED_MINI 60 + #if !defined(__DOXYGEN__) #define BOARD_ BOARD_NONE diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Common.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Common.h old mode 100644 new mode 100755 index c0a7112..6864eb6 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Common.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Common.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -145,19 +145,11 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ - /** Macro for encasing other multi-statement macros. This should be used along with an opening brace - * before the start of any multi-statement macro, so that the macros contents as a whole are treated - * as a discrete block and not as a list of separate statements which may cause problems when used as - * a block (such as inline \c if statements). - */ - #define MACROS do - - /** Macro for encasing other multi-statement macros. This should be used along with a preceding closing - * brace at the end of any multi-statement macro, so that the macros contents as a whole are treated - * as a discrete block and not as a list of separate statements which may cause problems when used as - * a block (such as inline \c if statements). - */ - #define MACROE while (0) + #if !defined(__DOXYGEN__) + // Obsolete, retained for compatibility with user code + #define MACROS do + #define MACROE while (0) + #endif /** Convenience macro to determine the larger of two values. * diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/CompilerSpecific.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/CompilerSpecific.h old mode 100644 new mode 100755 index b2818fa..41e5305 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/CompilerSpecific.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/CompilerSpecific.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Endianness.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Endianness.h old mode 100644 new mode 100755 index 41f1795..8be9e0d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Endianness.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Common/Endianness.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -397,7 +397,7 @@ * * \return Input data with the individual bytes reversed. */ - static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST; + static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint16_t SwapEndian_16(const uint16_t Word) { if (GCC_IS_COMPILE_CONST(Word)) @@ -428,7 +428,7 @@ * * \return Input data with the individual bytes reversed. */ - static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST; + static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE; static inline uint32_t SwapEndian_32(const uint32_t DWord) { if (GCC_IS_COMPILE_CONST(DWord)) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h old mode 100644 new mode 100755 index 9d50b6f..a640ddc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h old mode 100644 new mode 100755 index 2339ad2..be7180c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ADAFRUITU4/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h old mode 100644 new mode 100755 index 57bdb2b..11e6e0e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h old mode 100644 new mode 100755 index 8656050..7d5a48b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h old mode 100644 new mode 100755 index ae4dee2..cd7bff7 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/ATAVRUSBRF01/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Board.h old mode 100644 new mode 100755 index f6ea72d..9f5b291 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h old mode 100644 new mode 100755 index 35faa38..5e9128e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h old mode 100644 new mode 100755 index 940307f..f968d7c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BENITO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h old mode 100644 new mode 100755 index 604147b..02ebe09 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h old mode 100644 new mode 100755 index 190cdbd..93048f5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BIGMULTIO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -98,7 +98,7 @@ { DDRF |= LEDS_PORTF_LEDS; DDRE |= LEDS_PORTE_LEDS; - + PORTF &= ~LEDS_PORTF_LEDS; PORTE &= ~LEDS_PORTE_LEDS; } @@ -107,7 +107,7 @@ { DDRF &= ~LEDS_PORTF_LEDS; DDRE &= ~LEDS_PORTE_LEDS; - + PORTF &= ~LEDS_PORTF_LEDS; PORTE &= ~LEDS_PORTE_LEDS; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h old mode 100644 new mode 100755 index 11ed6ea..a9aef6e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h old mode 100644 new mode 100755 index 9b3d7a7..5a7c4f2 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BLACKCAT/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/Board.h old mode 100644 new mode 100755 index 23d0249..87102b6 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/LEDs.h old mode 100644 new mode 100755 index b5a2e29..d982bcd --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUI/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h old mode 100644 new mode 100755 index 744e4f6..5af60ab --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h old mode 100644 new mode 100755 index 1cd77da..812cf79 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h old mode 100644 new mode 100755 index 5f05a66..259c674 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h old mode 100644 new mode 100755 index 305174a..bb070db --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/BUMBLEB/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Board.h old mode 100644 new mode 100755 index 4350e08..88679d1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h old mode 100644 new mode 100755 index 16c81df..21b6e1c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h old mode 100644 new mode 100755 index df674dd..da3ebf8 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/CULV3/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/Board.h old mode 100644 new mode 100755 index 23180e1..8521ec9 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h old mode 100644 new mode 100755 index 18da3a3..ad866b9 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/DUCE/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Board.h old mode 100644 new mode 100755 index 60fc67c..01b6b93 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h old mode 100644 new mode 100755 index 85fd866..3094fbe --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h old mode 100644 new mode 100755 index a58a06c..2ec973e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h old mode 100644 new mode 100755 index 29af1f5..909fa02 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h old mode 100644 new mode 100755 index 345ea9d..a10b822 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/EVK527/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h old mode 100644 new mode 100755 index 69149e4..0e46a57 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h old mode 100644 new mode 100755 index 66508e5..8da45e4 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h old mode 100644 new mode 100755 index abd72fd..bd2c191 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/JMDBU2/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h old mode 100644 new mode 100755 index e9ead86..400bb11 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h old mode 100644 new mode 100755 index abb3408..6f26cc1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/LEONARDO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -46,7 +46,7 @@ * NameColorInfoActive LevelPort Pin * LEDS_LED1YellowRXLowPORTB.0 * LEDS_LED2YellowTXLowPORTD.5 - * LEDS_LED1YellowGeneral IndicatorHighPORTC.7 + * LEDS_LED3YellowGeneral IndicatorHighPORTC.7 * * * @{ @@ -154,7 +154,7 @@ static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) { - return ((PORTB & LEDS_PORTB_LEDS) | (PORTD & LEDS_PORTD_LEDS) | (~PORTC & LEDS_PORTC_LEDS)); + return ((~PORTB & LEDS_PORTB_LEDS) | (~PORTD & LEDS_PORTD_LEDS) | (PORTC & LEDS_PORTC_LEDS)); } #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h old mode 100644 new mode 100755 index 73d2a8c..7de7501 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h old mode 100644 new mode 100755 index 4a32a4f..aba85ab --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MAXIMUS/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICRO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICRO/Board.h new file mode 100755 index 0000000..279dc3a --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICRO/Board.h @@ -0,0 +1,78 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific information header for the Arduino Micro board. + * \copydetails Group_BoardInfo_MICRO + * + * \note This file should not be included directly. It is automatically included as needed by the Board driver + * dispatch header located in LUFA/Drivers/Board/Board.h. + */ + +/** \ingroup Group_BoardInfo + * \defgroup Group_BoardInfo_MICRO MICRO + * \brief Board specific information header for the Arduino Micro board. + * + * Board specific information header for the Arduino Micro board (http://arduino.cc/en/Main/arduinoBoardMicro). + * + * @{ + */ + +#ifndef __BOARD_MICRO_H__ +#define __BOARD_MICRO_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + #include "../../LEDs.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BOARD_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Indicates the board has hardware LEDs mounted. */ + #define BOARD_HAS_LEDS + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h new file mode 100755 index 0000000..445e1a3 --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICRO/LEDs.h @@ -0,0 +1,169 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Arduino Micro board. + * \copydetails Group_LEDs_MICRO + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_MICRO MICRO + * \brief Board specific LED driver header for the Arduino Micro board. + * + * Board specific LED driver header for the Arduino Micro board (http://arduino.cc/en/Main/arduinoBoardMicro). + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowRXHighPORTB.0
LEDS_LED2YellowTXHighPORTD.5
LEDS_LED3GreenGeneral IndicatorHighPORTC.7
+ * + * @{ + */ + +#ifndef __LEDS_MICRO_H__ +#define __LEDS_MICRO_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORTB_LEDS (LEDS_LED1) + #define LEDS_PORTD_LEDS (LEDS_LED2) + #define LEDS_PORTC_LEDS (LEDS_LED3) + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 0) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 5) + + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 7) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRB |= LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD |= LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC |= LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD &= ~LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC &= ~LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTB |= (LEDMask & LEDS_PORTB_LEDS); + PORTD |= (LEDMask & LEDS_PORTD_LEDS); + PORTC |= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTB &= ~(LEDMask & LEDS_PORTB_LEDS); + PORTD &= ~(LEDMask & LEDS_PORTD_LEDS); + PORTC &= ~(LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTB = ((PORTB & ~LEDS_PORTB_LEDS) | (LEDMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~LEDS_PORTC_LEDS) | (LEDMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTB = ((PORTB & ~(LEDMask & LEDS_PORTB_LEDS)) | (ActiveMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD & ~(LEDMask & LEDS_PORTD_LEDS)) | (ActiveMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~(LEDMask & LEDS_PORTC_LEDS)) | (ActiveMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTB ^= (LEDMask & LEDS_PORTB_LEDS); + PORTD ^= (LEDMask & LEDS_PORTD_LEDS); + PORTC ^= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return ((PORTB & LEDS_PORTB_LEDS) | (PORTD & LEDS_PORTD_LEDS) | (PORTC & LEDS_PORTC_LEDS)); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h old mode 100644 new mode 100755 index 55b6b0a..1ae3d6f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h old mode 100644 new mode 100755 index 602c16f..c40ac1f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h old mode 100644 new mode 100755 index 53311bd..2ab89eb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROPENDOUS/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h old mode 100644 new mode 100755 index ad06231..1e503c3 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h old mode 100644 new mode 100755 index 191b0fe..1c90fab --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h old mode 100644 new mode 100755 index 47720ff..690ce7d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MICROSIN162/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h old mode 100644 new mode 100755 index 6b0cd6a..53bc2da --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h old mode 100644 new mode 100755 index 643cd70..f83924c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h old mode 100644 new mode 100755 index ef5ba2a..5569323 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MINIMUS/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/Board.h old mode 100644 new mode 100755 index 87589a6..d701dc3 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h old mode 100644 new mode 100755 index 1d370d9..9d3bf6a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/MULTIO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -98,7 +98,7 @@ { DDRD |= LEDS_PORTD_LEDS; DDRC |= LEDS_PORTC_LEDS; - + PORTD &= ~LEDS_PORTD_LEDS; PORTC &= ~LEDS_PORTC_LEDS; } @@ -107,7 +107,7 @@ { DDRD &= ~LEDS_PORTD_LEDS; DDRC &= ~LEDS_PORTC_LEDS; - + PORTD &= ~LEDS_PORTD_LEDS; PORTC &= ~LEDS_PORTC_LEDS; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h old mode 100644 new mode 100755 index b718ae0..64c6577 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h old mode 100644 new mode 100755 index 7302a3e..f8ed871 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h old mode 100644 new mode 100755 index 8b46b94..52d82ef --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX162/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h old mode 100644 new mode 100755 index d899118..f063b9f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h old mode 100644 new mode 100755 index 71b4219..fecc637 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h old mode 100644 new mode 100755 index c6f2442..51eeace --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEX32U4/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h old mode 100644 new mode 100755 index cf52354..52129fb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h old mode 100644 new mode 100755 index fb21277..3240dda --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h old mode 100644 new mode 100755 index a8db537..6bf924d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXISPMK2/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -67,7 +67,7 @@ #if !defined(__INCLUDE_FROM_LEDS_H) #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #endif - + /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ @@ -78,7 +78,7 @@ /** LED mask for the third LED on the board. */ #define LEDS_LED3 (1 << 7) - + /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h old mode 100644 new mode 100755 index a4befd4..9b0b28c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h old mode 100644 new mode 100755 index 3d80f47..5db1c59 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h old mode 100644 new mode 100755 index 165c29c..96cf3ed --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/OLIMEXT32U4/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -75,7 +75,7 @@ #define LEDS_PORTD_LEDS (LEDS_LED2) #define LEDS_PORTE_LEDS (LEDS_LED3) #endif - + /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ @@ -86,7 +86,7 @@ /** LED mask for the third LED on the board. */ #define LEDS_LED3 (1 << 6) - + /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h new file mode 100755 index 0000000..bf68e39 --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/POLOLUMICRO/Board.h @@ -0,0 +1,79 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific information header for the "Pololu A-Star Micro" board. + * \copydetails Group_BoardInfo_POLOLUMICRO + * + * \note This file should not be included directly. It is automatically included as needed by the Board driver + * dispatch header located in LUFA/Drivers/Board/Board.h. + */ + +/** \ingroup Group_BoardInfo + * \defgroup Group_BoardInfo_POLOLUMICRO POLOLUMICRO + * \brief Board specific information header for the "Pololu A-Star Micro" board. + * + * Board specific information header: + * https://www.pololu.com/docs/0J61 -> https://www.pololu.com/docs/0J61/3.1 + * + * @{ + */ + +#ifndef __BOARD_POLOLUMICRO_H__ +#define __BOARD_POLOLUMICRO_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + #include "../../LEDs.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BOARD_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Indicates the board has hardware LEDs mounted. */ + #define BOARD_HAS_LEDS + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/POLOLUMICRO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/POLOLUMICRO/LEDs.h new file mode 100755 index 0000000..454a9e2 --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/POLOLUMICRO/LEDs.h @@ -0,0 +1,154 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Pololu A-Star Micro board. + * \copydetails Group_LEDs_MICRO + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_MICRO MICRO + * \brief Board specific LED driver header for the Pololu A-Star Micro board. + * + * Board specific LED driver header for the Pololu A-Star Micro board https://www.pololu.com/docs/0J61/3.1 + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowGeneral IndicatorHighPORTC.7
LEDS_LED2GreenBootloader, USB-activityLowPORTD.5
+ * + * @{ + */ + +#ifndef __LEDS_MICRO_H__ +#define __LEDS_MICRO_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORTC_LEDS (LEDS_LED1) + #define LEDS_PORTD_LEDS (LEDS_LED2) + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 7) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 5) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRD |= LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC |= LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRD &= ~LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC &= ~LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTD |= (LEDMask & LEDS_PORTD_LEDS); + PORTC |= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTD &= ~(LEDMask & LEDS_PORTD_LEDS); + PORTC &= ~(LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTD = ((PORTD & ~LEDS_PORTD_LEDS) | (LEDMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~LEDS_PORTC_LEDS) | (LEDMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTD = ((PORTD & ~(LEDMask & LEDS_PORTD_LEDS)) | (ActiveMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~(LEDMask & LEDS_PORTC_LEDS)) | (ActiveMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PORTD ^= (LEDMask & LEDS_PORTD_LEDS); + PORTC ^= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return ((PORTD & LEDS_PORTD_LEDS) | (PORTC & LEDS_PORTC_LEDS)); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h old mode 100644 new mode 100755 index ad69532..83219b9 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h old mode 100644 new mode 100755 index 6343c6c..25bdae1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/RZUSBSTICK/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h old mode 100644 new mode 100755 index a64988a..7803ecd --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h old mode 100644 new mode 100755 index ea92263..70ca608 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/SPARKFUN8U2/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h old mode 100644 new mode 100755 index 73211b7..45472f1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h old mode 100644 new mode 100755 index 1aaa649..2607622 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2012. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h old mode 100644 new mode 100755 index 13032d1..97a7e37 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STANGE_ISP/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2012. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Board.h old mode 100644 new mode 100755 index 47d809d..a6831a7 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Buttons.h old mode 100644 new mode 100755 index 082e8fd..5770d07 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h old mode 100644 new mode 100755 index b34907b..b0b2855 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Joystick.h old mode 100644 new mode 100755 index aad233b..0224a72 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/LEDs.h old mode 100644 new mode 100755 index b8d59f1..e413816 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK525/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Board.h old mode 100644 new mode 100755 index 86f080d..1c4ee85 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Buttons.h old mode 100644 new mode 100755 index eac9486..168adaa --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h old mode 100644 new mode 100755 index 511479f..82b311b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Joystick.h old mode 100644 new mode 100755 index d626716..c7d816c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/LEDs.h old mode 100644 new mode 100755 index b6bab74..fc561e7 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/STK526/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/Board.h old mode 100644 new mode 100755 index 10c4ba1..15237b6 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h old mode 100644 new mode 100755 index bdc6cff..ed7fbf0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TEENSY/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Board.h old mode 100644 new mode 100755 index 903be56..066e6c3 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Buttons.h old mode 100644 new mode 100755 index 672f38c..af6b2ae --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/LEDs.h old mode 100644 new mode 100755 index e3daa8e..9417b67 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/TUL/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Board.h old mode 100644 new mode 100755 index ca5dcd4..6ea2380 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Buttons.h old mode 100644 new mode 100755 index b414bc9..ea5c1af --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -29,7 +29,7 @@ */ /** \file - * \brief Board specific Buttons driver header for the Mattairtech JM-DB-U2. + * \brief Board specific Buttons driver header for the U2S. * \copydetails Group_Buttons_U2S * * \note This file should not be included directly. It is automatically included as needed by the Buttons driver diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/LEDs.h old mode 100644 new mode 100755 index 2cc36ed..942fdc0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/U2S/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -29,7 +29,7 @@ */ /** \file - * \brief Board specific LED driver header for the Tempusdictum Benito. + * \brief Board specific LED driver header for the U2S. * \copydetails Group_LEDs_U2S * * \note This file should not be included directly. It is automatically included as needed by the LEDs driver diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Board.h old mode 100644 new mode 100755 index 695f8d0..c8b6e77 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h old mode 100644 new mode 100755 index 4263dd5..f579b29 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h old mode 100644 new mode 100755 index a56af73..1bf8398 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UDIP/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/Board.h old mode 100644 new mode 100755 index ecfc37b..9277a38 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -67,6 +67,12 @@ /** Indicates the board has hardware LEDs mounted. */ #define BOARD_HAS_LEDS + /** Pin that can reset the main MCU. */ + #define AVR_RESET_LINE_PORT PORTD + #define AVR_RESET_LINE_DDR DDRD + #define AVR_RESET_LINE_PIN PIND + #define AVR_RESET_LINE_MASK (1 << PD7) + /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/LEDs.h old mode 100644 new mode 100755 index f96501d..17526f3 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/UNO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -44,8 +44,8 @@ * * * - * - * + * + * *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowRXLowPORTD.4
LEDS_LED2YellowTXLowPORTD.5
LEDS_LED1YellowRXLowPORTD.5
LEDS_LED2YellowTXLowPORTD.4
* * @{ @@ -70,10 +70,10 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ - #define LEDS_LED1 (1 << 4) + #define LEDS_LED1 (1 << 5) /** LED mask for the second LED on the board. */ - #define LEDS_LED2 (1 << 5) + #define LEDS_LED2 (1 << 4) /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) @@ -81,6 +81,12 @@ /** LED mask for none of the board LEDs. */ #define LEDS_NO_LEDS 0 + /** LED mask for the library LED driver, to indicate TX activity. */ + #define LEDMASK_TX LEDS_LED1 + + /** LED mask for the library LED driver, to indicate RX activity. */ + #define LEDMASK_RX LEDS_LED2 + /* Inline Functions: */ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) @@ -92,7 +98,7 @@ static inline void LEDs_Disable(void) { DDRD &= ~LEDS_ALL_LEDS; - PORTD &= ~LEDS_ALL_LEDS; + PORTD |= LEDS_ALL_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Board.h old mode 100644 new mode 100755 index 7e7e20d..c6fcd43 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h old mode 100644 new mode 100755 index bc47674..df6ef64 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -42,7 +42,7 @@ * * See \ref Group_Buttons_USB2AX for more details. */ - + /** \ingroup Group_Buttons * \defgroup Group_Buttons_USB2AX_V3 USB2AX_V3 * \brief Board specific Button driver header for the Xevelabs USB2AX revision 3. @@ -54,7 +54,7 @@ * \defgroup Group_Buttons_USB2AX USB2AX * \brief Board specific Buttons driver header for the Xevelabs USB2AX revisions 1 and 2. * - * \note For version 3 USB2AX boards, compile with BOARD = USB2AX_V3 and for version 3.1, with BOARD = USB2AX_V31. + * \note For version 3 USB2AX boards, compile with BOARD = USB2AX_V3 and for version 3.1, with BOARD = USB2AX_V31. * * Board specific Buttons driver header for the Paranoid Studio USB2AX (http://paranoidstudio.assembla.com/wiki/show/paranoidstudio/USB2AX). * diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h old mode 100644 new mode 100755 index c310f7c..b4ed1ca --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USB2AX/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -35,7 +35,7 @@ * \note This file should not be included directly. It is automatically included as needed by the LEDs driver * dispatch header located in LUFA/Drivers/Board/LEDs.h. */ - + /** \ingroup Group_LEDs * \defgroup Group_LEDs_USB2AX_V31 USB2AX_V31 * \brief Board specific LED driver header for the Xevelabs USB2AX revision 3.1. @@ -54,8 +54,8 @@ * \defgroup Group_LEDs_USB2AX USB2AX * \brief Board specific LED driver header for the Xevelabs USB2AX revisions 1 and 2. * - * \note For version 3 USB2AX boards, compile with BOARD = USB2AX_V3 and for version 3.1, with BOARD = USB2AX_V31. - * + * \note For version 3 USB2AX boards, compile with BOARD = USB2AX_V3 and for version 3.1, with BOARD = USB2AX_V31. + * * Board specific LED driver header for the Xevelabs USB2AX (http://paranoidstudio.assembla.com/wiki/show/paranoidstudio/USB2AX). * * USB2AX: diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Board.h old mode 100644 new mode 100755 index 57e36a8..fa01b5b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h old mode 100644 new mode 100755 index 0e98072..9c2476c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h old mode 100644 new mode 100755 index a0bb6b5..9c5b8bc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBFOO/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Board.h old mode 100644 new mode 100755 index 953d421..920681d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h old mode 100644 new mode 100755 index 38e01cf..068fd0b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h old mode 100644 new mode 100755 index 648beb5..77be220 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h old mode 100644 new mode 100755 index 3614723..7410364 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h old mode 100644 new mode 100755 index 360a408..18ff756 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBKEY/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h old mode 100644 new mode 100755 index 36368d2..5501bf6 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h old mode 100644 new mode 100755 index 45fedfb..e87f611 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h old mode 100644 new mode 100755 index 923c88c..288f550 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/USBTINYMKII/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h old mode 100644 new mode 100755 index 7a23752..713e065 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h old mode 100644 new mode 100755 index d8bb12b..ed6a48c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h old mode 100644 new mode 100755 index 80cf181..9da3fad --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAIN/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h new file mode 100755 index 0000000..2253e33 --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/Board.h @@ -0,0 +1,78 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific information header for the Atmel Xplained-MINI series kits. + * \copydetails Group_BoardInfo_XPLAINED_MINI + * + * \note This file should not be included directly. It is automatically included as needed by the Board driver + * dispatch header located in LUFA/Drivers/Board/Board.h. + */ + +/** \ingroup Group_BoardInfo + * \defgroup Group_BoardInfo_XPLAINED_MINI XPLAINED_MINI + * \brief Board specific information header for the Atmel Xplained-MINI series kits. + * + * Board specific information header for the Atmel Xplained-MINI series kits. + * + * @{ + */ + +#ifndef __BOARD_XPLAINED_MINI_H__ +#define __BOARD_XPLAINED_MINI_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + #include "../../LEDs.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BOARD_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Indicates the board has hardware LEDs mounted. */ + #define BOARD_HAS_LEDS + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/LEDs.h new file mode 100755 index 0000000..5c8f196 --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/XPLAINED_MINI/LEDs.h @@ -0,0 +1,135 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Atmel Xplained-MINI series kits.. + * \copydetails Group_LEDs_XPLAINED_MINI + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_XPLAINED_MINI XPLAINED_MINI + * \brief Board specific LED driver header for the Atmel Xplained-MINI series kits. + * + * Board specific LED driver header for the Atmel Xplained-MINI series kits. + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1GreenGeneral IndicatorLowPORTC.6
+ * + * @{ + */ + +#ifndef __LEDS_XPLAINED_MINI_H__ +#define __LEDS_XPLAINED_MINI_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 6) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS LEDS_LED1 + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRC |= LEDS_ALL_LEDS; + PORTC |= LEDS_ALL_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRC &= ~LEDS_ALL_LEDS; + PORTC &= ~LEDS_ALL_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTC &= ~LEDMask; + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTC |= LEDMask; + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTC = ((PORTC | LEDS_ALL_LEDS) & ~LEDMask); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTC = ((PORTC | LEDMask) & ~ActiveMask); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PINC = LEDMask; + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return (~PORTC & LEDS_ALL_LEDS); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/YUN/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/YUN/Board.h new file mode 100755 index 0000000..035f66a --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/YUN/Board.h @@ -0,0 +1,78 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific information header for the Arduino Yun board. + * \copydetails Group_BoardInfo_YUN + * + * \note This file should not be included directly. It is automatically included as needed by the Board driver + * dispatch header located in LUFA/Drivers/Board/Board.h. + */ + +/** \ingroup Group_BoardInfo + * \defgroup Group_BoardInfo_YUN YUN + * \brief Board specific information header for the Arduino Yun board. + * + * Board specific information header for the Arduino Yun board (http://arduino.cc/en/Main/arduinoBoardYun). + * + * @{ + */ + +#ifndef __BOARD_YUN_H__ +#define __BOARD_YUN_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + #include "../../LEDs.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_BOARD_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/Board.h instead. + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** Indicates the board has hardware LEDs mounted. */ + #define BOARD_HAS_LEDS + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/YUN/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/YUN/LEDs.h new file mode 100755 index 0000000..d06acd7 --- /dev/null +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/AVR8/YUN/LEDs.h @@ -0,0 +1,169 @@ +/* + LUFA Library + Copyright (C) Dean Camera, 2017. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaims all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief Board specific LED driver header for the Arduino Yun board. + * \copydetails Group_LEDs_YUN + * + * \note This file should not be included directly. It is automatically included as needed by the LEDs driver + * dispatch header located in LUFA/Drivers/Board/LEDs.h. + */ + +/** \ingroup Group_LEDs + * \defgroup Group_LEDs_YUN YUN + * \brief Board specific LED driver header for the Arduino Yun board. + * + * Board specific LED driver header for the Arduino Yun board (http://arduino.cc/en/Main/arduinoBoardYun). + * + * + * + * + * + * + *
NameColorInfoActive LevelPort Pin
LEDS_LED1YellowRXLowPORTB.0
LEDS_LED2YellowTXLowPORTD.5
LEDS_LED3RedGeneral IndicatorHighPORTC.7
+ * + * @{ + */ + +#ifndef __LEDS_YUN_H__ +#define __LEDS_YUN_H__ + + /* Includes: */ + #include "../../../../Common/Common.h" + + /* Enable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + extern "C" { + #endif + + /* Preprocessor Checks: */ + #if !defined(__INCLUDE_FROM_LEDS_H) + #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. + #endif + + /* Private Interface - For use in library only: */ + #if !defined(__DOXYGEN__) + /* Macros: */ + #define LEDS_PORTB_LEDS (LEDS_LED1) + #define LEDS_PORTD_LEDS (LEDS_LED2) + #define LEDS_PORTC_LEDS (LEDS_LED3) + #endif + + /* Public Interface - May be used in end-application: */ + /* Macros: */ + /** LED mask for the first LED on the board. */ + #define LEDS_LED1 (1 << 0) + + /** LED mask for the second LED on the board. */ + #define LEDS_LED2 (1 << 5) + + /** LED mask for the third LED on the board. */ + #define LEDS_LED3 (1 << 7) + + /** LED mask for all the LEDs on the board. */ + #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2 | LEDS_LED3) + + /** LED mask for none of the board LEDs. */ + #define LEDS_NO_LEDS 0 + + /* Inline Functions: */ + #if !defined(__DOXYGEN__) + static inline void LEDs_Init(void) + { + DDRB |= LEDS_PORTB_LEDS; + PORTB |= LEDS_PORTB_LEDS; + DDRD |= LEDS_PORTD_LEDS; + PORTD |= LEDS_PORTD_LEDS; + DDRC |= LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_Disable(void) + { + DDRB &= ~LEDS_PORTB_LEDS; + PORTB &= ~LEDS_PORTB_LEDS; + DDRD &= ~LEDS_PORTD_LEDS; + PORTD &= ~LEDS_PORTD_LEDS; + DDRC &= ~LEDS_PORTC_LEDS; + PORTC &= ~LEDS_PORTC_LEDS; + } + + static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) + { + PORTB &= ~(LEDMask & LEDS_PORTB_LEDS); + PORTD &= ~(LEDMask & LEDS_PORTD_LEDS); + PORTC |= (LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) + { + PORTB |= (LEDMask & LEDS_PORTB_LEDS); + PORTD |= (LEDMask & LEDS_PORTD_LEDS); + PORTC &= ~(LEDMask & LEDS_PORTC_LEDS); + } + + static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) + { + PORTB = ((PORTB | LEDS_PORTB_LEDS) & ~(LEDMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD | LEDS_PORTD_LEDS) & ~(LEDMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~LEDS_PORTC_LEDS) | (LEDMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) + { + PORTB = ((PORTB | (LEDMask & LEDS_PORTB_LEDS)) & ~(ActiveMask & LEDS_PORTB_LEDS)); + PORTD = ((PORTD | (LEDMask & LEDS_PORTD_LEDS)) & ~(ActiveMask & LEDS_PORTD_LEDS)); + PORTC = ((PORTC & ~(LEDMask & LEDS_PORTC_LEDS)) | (ActiveMask & LEDS_PORTC_LEDS)); + } + + static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) + { + PINB = (LEDMask & LEDS_PORTB_LEDS); + PIND = (LEDMask & LEDS_PORTD_LEDS); + PINC = (LEDMask & LEDS_PORTC_LEDS); + } + + static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; + static inline uint8_t LEDs_GetLEDs(void) + { + return ((~PORTB & LEDS_PORTB_LEDS) | (~PORTD & LEDS_PORTD_LEDS) | (PORTC & LEDS_PORTC_LEDS)); + } + #endif + + /* Disable C linkage for C++ Compilers: */ + #if defined(__cplusplus) + } + #endif + +#endif + +/** @} */ + diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Board.h old mode 100644 new mode 100755 index e84d9e0..55ed29a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -153,6 +153,14 @@ #include "XMEGA/C3_XPLAINED/Board.h" #elif (BOARD == BOARD_U2S) #include "AVR8/U2S/Board.h" + #elif (BOARD == BOARD_YUN) + #include "AVR8/YUN/Board.h" + #elif (BOARD == BOARD_MICRO) + #include "AVR8/MICRO/Board.h" + #elif (BOARD == BOARD_POLOLUMICRO) + #include "AVR8/POLOLUMICRO/Board.h" + #elif (BOARD == BOARD_XPLAINED_MINI) + #include "AVR8/XPLAINED_MINI/Board.h" #else #include "Board/Board.h" #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Buttons.h old mode 100644 new mode 100755 index a74cbd4..00ebe8c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -93,8 +93,9 @@ #if (BOARD == BOARD_NONE) #define BUTTONS_BUTTON1 0 - static inline void Buttons_Init(void) {}; - static inline uint_reg_t Buttons_GetStatus(void) { return 0; }; + static inline void Buttons_Init(void) {} + static inline void Buttons_Disable(void) {} + static inline uint_reg_t Buttons_GetStatus(void) { return 0; } #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/Buttons.h" #elif (BOARD == BOARD_STK525) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Dataflash.h old mode 100644 new mode 100755 index 91b667b..b634dcc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -66,9 +66,7 @@ * application. * * \code - * // Initialize the SPI and board Dataflash drivers before first use - * SPI_Init(SPI_SPEED_FCPU_DIV_2 | SPI_ORDER_MSB_FIRST | SPI_SCK_LEAD_FALLING | - * SPI_SAMPLE_TRAILING | SPI_MODE_MASTER); + * // Initialize the board Dataflash driver before first use * Dataflash_Init(); * * uint8_t WriteBuffer[DATAFLASH_PAGE_SIZE]; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Joystick.h old mode 100644 new mode 100755 index 5ffabfa..0d0fe89 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -105,8 +105,9 @@ #define JOY_LEFT 0 #define JOY_RIGHT 0 #define JOY_PRESS 0 - static inline void Joystick_Init(void) {}; - static inline uint_reg_t Joystick_GetStatus(void) { return 0; }; + static inline void Joystick_Init(void) {} + static inline void Joystick_Disable(void) {} + static inline uint_reg_t Joystick_GetStatus(void) { return 0; } #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/Joystick.h" #elif (BOARD == BOARD_STK525) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/LEDs.h old mode 100644 new mode 100755 index e0267f6..ba0b1bb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -108,13 +108,13 @@ #include "../../Common/Common.h" #if (BOARD == BOARD_NONE) - static inline void LEDs_Init(void) {}; - static inline void LEDs_Disable(void) {}; - static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {}; - static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {}; - static inline void LEDs_SetAllLEDs(const uint_reg_t LEDMask) {}; - static inline void LEDs_ChangeLEDs(const uint_reg_t LEDMask, const uint_reg_t ActiveMask) {}; - static inline void LEDs_ToggleLEDs(const uint_reg_t LEDMask) {}; + static inline void LEDs_Init(void) {} + static inline void LEDs_Disable(void) {} + static inline void LEDs_TurnOnLEDs(const uint_reg_t LEDMask) {} + static inline void LEDs_TurnOffLEDs(const uint_reg_t LEDMask) {} + static inline void LEDs_SetAllLEDs(const uint_reg_t LEDMask) {} + static inline void LEDs_ChangeLEDs(const uint_reg_t LEDMask, const uint_reg_t ActiveMask) {} + static inline void LEDs_ToggleLEDs(const uint_reg_t LEDMask) {} static inline uint_reg_t LEDs_GetLEDs(void) { return 0; } #elif (BOARD == BOARD_USBKEY) #include "AVR8/USBKEY/LEDs.h" @@ -203,6 +203,14 @@ #include "XMEGA/C3_XPLAINED/LEDs.h" #elif (BOARD == BOARD_U2S) #include "AVR8/U2S/LEDs.h" + #elif (BOARD == BOARD_YUN) + #include "AVR8/YUN/LEDs.h" + #elif (BOARD == BOARD_MICRO) + #include "AVR8/MICRO/LEDs.h" + #elif (BOARD == BOARD_POLOLUMICRO) + #include "AVR8/POLOLUMICRO/LEDs.h" + #elif (BOARD == BOARD_XPLAINED_MINI) + #include "AVR8/XPLAINED_MINI/LEDs.h" #else #include "Board/LEDs.h" #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.c old mode 100644 new mode 100755 index e2e5744..2fb1976 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.h old mode 100644 new mode 100755 index 229dfae..f381cc9 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/Temperature.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Board.h old mode 100644 new mode 100755 index ad826c1..bd68cf5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h old mode 100644 new mode 100755 index c5a460e..a2bd15d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h old mode 100644 new mode 100755 index bfe96bd..7117bc5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h old mode 100644 new mode 100755 index b98a575..ca6a37f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1100/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Board.h old mode 100644 new mode 100755 index 98eef90..46d79f0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h old mode 100644 new mode 100755 index fd3df31..41bf42c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h old mode 100644 new mode 100755 index 66a0298..1351213 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/Joystick.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h old mode 100644 new mode 100755 index f9350ed..71d45d2 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1101/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Board.h old mode 100644 new mode 100755 index d4b696d..0c8b762 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h old mode 100644 new mode 100755 index 5fff79a..d12fda5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h old mode 100644 new mode 100755 index 5ccbc4c..793ea86 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/EVK1104/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h old mode 100644 new mode 100755 index 1104019..94abc3e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h old mode 100644 new mode 100755 index bd7da38..879373e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h old mode 100644 new mode 100755 index 1ab81b7..cbd2bde --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/UC3/UC3A3_XPLAINED/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h old mode 100644 new mode 100755 index 03603c8..2bc2377 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h old mode 100644 new mode 100755 index ebc6d34..901869d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -95,7 +95,7 @@ { PORTE.OUTCLR = BUTTONS_BUTTON1; PORTE.PIN5CTRL = 0; - + PORTF.OUTCLR = (BUTTONS_BUTTON2 | BUTTONS_BUTTON3); PORTF.PIN1CTRL = 0; PORTF.PIN2CTRL = 0; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h old mode 100644 new mode 100755 index 7ba478c..b484738 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h old mode 100644 new mode 100755 index 925bd26..a0c5b3a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/A3BU_XPLAINED/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h old mode 100644 new mode 100755 index cb529ff..b133b9a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h old mode 100644 new mode 100755 index c11bfdc..01c7c08 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h old mode 100644 new mode 100755 index 3430e0c..7140266 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/Dataflash.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h old mode 100644 new mode 100755 index 50ef7d8..078532a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/B1_XPLAINED/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h old mode 100644 new mode 100755 index be11c59..e48bd58 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Board.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h old mode 100644 new mode 100755 index 11c7956..1a8c1fc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/Buttons.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h old mode 100644 new mode 100755 index 348eedf..f701c88 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Board/XMEGA/C3_XPLAINED/LEDs.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB321C.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB321C.h old mode 100644 new mode 100755 index 0d1bb8b..e354ca4 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB321C.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB321C.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB642D.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB642D.h old mode 100644 new mode 100755 index 08f8abd..76a7a5c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB642D.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/AT45DB642D.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/RingBuffer.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/RingBuffer.h old mode 100644 new mode 100755 index bc6cfe8..0e76a07 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/RingBuffer.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/RingBuffer.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -70,11 +70,11 @@ * RingBuffer_InitBuffer(&Buffer, BufferData, sizeof(BufferData)); * * // Insert some data into the buffer - * RingBuffer_Insert(Buffer, 'H'); - * RingBuffer_Insert(Buffer, 'E'); - * RingBuffer_Insert(Buffer, 'L'); - * RingBuffer_Insert(Buffer, 'L'); - * RingBuffer_Insert(Buffer, 'O'); + * RingBuffer_Insert(&Buffer, 'H'); + * RingBuffer_Insert(&Buffer, 'E'); + * RingBuffer_Insert(&Buffer, 'L'); + * RingBuffer_Insert(&Buffer, 'L'); + * RingBuffer_Insert(&Buffer, 'O'); * * // Cache the number of stored bytes in the buffer * uint16_t BufferCount = RingBuffer_GetCount(&Buffer); @@ -235,8 +235,10 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into. * \param[in] Data Data element to insert into the buffer. */ - static inline void RingBuffer_Insert(RingBuffer_t* Buffer, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1); - static inline void RingBuffer_Insert(RingBuffer_t* Buffer, const uint8_t Data) + static inline void RingBuffer_Insert(RingBuffer_t* Buffer, + const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1); + static inline void RingBuffer_Insert(RingBuffer_t* Buffer, + const uint8_t Data) { GCC_FORCE_POINTER_ACCESS(Buffer); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/TerminalCodes.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/TerminalCodes.h old mode 100644 new mode 100755 index 55cd5e0..b12a247 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/TerminalCodes.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Misc/TerminalCodes.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/ADC.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/ADC.h old mode 100644 new mode 100755 index 4e40c08..a0182b3 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/ADC.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/ADC.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h old mode 100644 new mode 100755 index d4526e2..a2b7ede --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/ADC_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h old mode 100644 new mode 100755 index b87b1c7..7244f4a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SPI_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h old mode 100644 new mode 100755 index e449a8f..052780e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/SerialSPI_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -52,7 +52,7 @@ * * \code * // Initialize the Master SPI mode USART driver before first use, with 1Mbit baud - * SerialSPI_Init((USART_SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING | SPI_ORDER_MSB_FIRST), 1000000); + * SerialSPI_Init((USART_SPI_SCK_LEAD_RISING | USART_SPI_SAMPLE_LEADING | USART_SPI_ORDER_MSB_FIRST), 1000000); * * // Send several bytes, ignoring the returned data * SerialSPI_SendByte(0x01); @@ -90,37 +90,45 @@ #endif /* Private Interface - For use in library only: */ - #if !defined(__DOXYGEN__) - #define SERIAL_SPI_UBBRVAL(Baud) ((Baud < (F_CPU / 2)) ? ((F_CPU / (2 * Baud)) - 1) : 0) - #endif + #if !defined(__DOXYGEN__) + #define SERIAL_SPI_UBBRVAL(Baud) ((Baud < (F_CPU / 2)) ? ((F_CPU / (2 * Baud)) - 1) : 0) + + /* Master USART SPI mode flag definitions missing in the AVR8 toolchain */ + #if !defined(UCPHA1) + #define UCPHA1 1 + #endif + #if !defined(UDORD1) + #define UDORD1 2 + #endif + #endif /* Public Interface - May be used in end-application: */ /* Macros: */ /** \name SPI SCK Polarity Configuration Masks */ //@{ /** SPI clock polarity mask for \ref SPI_Init(). Indicates that the SCK should lead on the rising edge. */ - #define USART_SPI_SCK_LEAD_RISING (0 << UCPOL) + #define USART_SPI_SCK_LEAD_RISING (0 << UCPOL1) /** SPI clock polarity mask for \ref SPI_Init(). Indicates that the SCK should lead on the falling edge. */ - #define USART_SPI_SCK_LEAD_FALLING (1 << UCPOL) + #define USART_SPI_SCK_LEAD_FALLING (1 << UCPOL1) //@} /** \name SPI Sample Edge Configuration Masks */ //@{ /** SPI data sample mode mask for \ref SerialSPI_Init(). Indicates that the data should sampled on the leading edge. */ - #define USART_SPI_SAMPLE_LEADING (0 << UPCHA) + #define USART_SPI_SAMPLE_LEADING (0 << UCPHA1) /** SPI data sample mode mask for \ref SerialSPI_Init(). Indicates that the data should be sampled on the trailing edge. */ - #define USART_SPI_SAMPLE_TRAILING (1 << UPCHA) + #define USART_SPI_SAMPLE_TRAILING (1 << UCPHA1) //@} /** \name SPI Data Ordering Configuration Masks */ //@{ /** SPI data order mask for \ref SerialSPI_Init(). Indicates that data should be shifted out MSB first. */ - #define USART_SPI_ORDER_MSB_FIRST (0 << UDORD) + #define USART_SPI_ORDER_MSB_FIRST (0 << UDORD1) /** SPI data order mask for \ref SerialSPI_Init(). Indicates that data should be shifted out LSB first. */ - #define USART_SPI_ORDER_LSB_FIRST (1 << UDORD) + #define USART_SPI_ORDER_LSB_FIRST (1 << UDORD1) //@} /* Inline Functions: */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c old mode 100644 new mode 100755 index e77eb90..779a80c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -88,8 +88,10 @@ void Serial_SendString(const char* StringPtr) void Serial_SendData(const void* Buffer, uint16_t Length) { + uint8_t* CurrByte = (uint8_t*)Buffer; + while (Length--) - Serial_SendByte(*((uint8_t*)Buffer++)); + Serial_SendByte(*(CurrByte++)); } void Serial_CreateStream(FILE* Stream) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h old mode 100644 new mode 100755 index 724c19c..b3e7ee3 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -168,7 +168,8 @@ /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to * standard 8-bit, no parity, 1 stop bit settings suitable for most applications. * - * \param[in] BaudRate Serial baud rate, in bits per second. + * \param[in] BaudRate Serial baud rate, in bits per second. This should be the target baud rate regardless of the + * \c DoubleSpeed parameter's value. * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. */ static inline void Serial_Init(const uint32_t BaudRate, @@ -210,14 +211,39 @@ return ((UCSR1A & (1 << RXC1)) ? true : false); } + /** Indicates whether there is hardware buffer space for a new transmit on the USART. This + * function can be used to determine if a call to \ref Serial_SendByte() will block in advance. + * + * \return Boolean \c true if a character can be queued for transmission immediately, \c false otherwise. + */ + static inline bool Serial_IsSendReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline bool Serial_IsSendReady(void) + { + return ((UCSR1A & (1 << UDRE1)) ? true : false); + } + + /** Indicates whether the hardware USART transmit buffer is completely empty, indicating all + * pending transmissions have completed. + * + * \return Boolean \c true if no characters are buffered for transmission, \c false otherwise. + */ + static inline bool Serial_IsSendComplete(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline bool Serial_IsSendComplete(void) + { + return ((UCSR1A & (1 << TXC1)) ? true : false); + } + /** Transmits a given byte through the USART. + * + * \note If no buffer space is available in the hardware USART, this function will block. To check if + * space is available before calling this function, see \ref Serial_IsSendReady(). * * \param[in] DataByte Byte to transmit through the USART. */ static inline void Serial_SendByte(const char DataByte) ATTR_ALWAYS_INLINE; static inline void Serial_SendByte(const char DataByte) { - while (!(UCSR1A & (1 << UDRE1))); + while (!(Serial_IsSendReady())); UDR1 = DataByte; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c old mode 100644 new mode 100755 index e7629d5..eb08687 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -135,7 +135,7 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress, const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; @@ -175,7 +175,7 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress, const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h old mode 100644 new mode 100755 index 498138f..a8b845a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -273,7 +273,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(3); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(3); /** High level function to perform a complete packet transfer over the TWI bus from the specified * device. @@ -292,7 +292,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(3); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(3); /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SPI.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SPI.h old mode 100644 new mode 100755 index 16f91d9..f0cd177 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SPI.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SPI.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/Serial.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/Serial.h old mode 100644 new mode 100755 index 4dad0dc..0c537bc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/Serial.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/Serial.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SerialSPI.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SerialSPI.h old mode 100644 new mode 100755 index 4efa5bd..dbab9db --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SerialSPI.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/SerialSPI.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/TWI.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/TWI.h old mode 100644 new mode 100755 index b17ace9..24483d8 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/TWI.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/TWI.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h old mode 100644 new mode 100755 index 07f6d48..7797df1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SPI_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h old mode 100644 new mode 100755 index caae55a..ca32350 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/SerialSPI_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c old mode 100644 new mode 100755 index c7dcd61..9ecda47 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -91,23 +91,26 @@ void Serial_SendData(USART_t* const USART, const void* Buffer, uint16_t Length) { + uint8_t* CurrByte = (uint8_t*)Buffer; + while (Length--) - Serial_SendByte(USART, *((uint8_t*)Buffer++)); + Serial_SendByte(USART, *(CurrByte++)); } -void Serial_CreateStream(FILE* Stream) +void Serial_CreateStream(USART_t* USART, FILE* Stream) { if (!(Stream)) { Stream = &USARTSerialStream; stdin = Stream; stdout = Stream; - } + } - *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); + *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW); + fdev_set_udata(Stream, USART); } -void Serial_CreateBlockingStream(FILE* Stream) +void Serial_CreateBlockingStream(USART_t* USART, FILE* Stream) { if (!(Stream)) { @@ -116,7 +119,8 @@ void Serial_CreateBlockingStream(FILE* Stream) stdout = Stream; } - *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); + *Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW); + fdev_set_udata(Stream, USART); } #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h old mode 100644 new mode 100755 index e337b31..36f507d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -151,29 +151,32 @@ * be used when the read data is processed byte-per-bye (via \c getc()) or when the user application will implement its own * line buffering. * + * \param[in,out] USART Pointer to the base of the USART peripheral within the device. * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL, \c stdout * and \c stdin will be configured to use the USART. * * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. */ - void Serial_CreateStream(FILE* Stream); + void Serial_CreateStream(USART_t* USART, FILE* Stream); - /** Identical to \ref Serial_CreateStream(), except that reads are blocking until the calling stream function terminates + /** Identical to \ref Serial_CreateStream(), except that reads are blocking until the calling stream function terminates * the transfer. * + * \param[in,out] USART Pointer to the base of the USART peripheral within the device. * \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed, if \c NULL, \c stdout * and \c stdin will be configured to use the USART. * * \pre The USART must first be configured via a call to \ref Serial_Init() before the stream is used. */ - void Serial_CreateBlockingStream(FILE* Stream); + void Serial_CreateBlockingStream(USART_t* USART, FILE* Stream); /* Inline Functions: */ /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to * standard 8-bit, no parity, 1 stop bit settings suitable for most applications. * * \param[in,out] USART Pointer to the base of the USART peripheral within the device. - * \param[in] BaudRate Serial baud rate, in bits per second. + * \param[in] BaudRate Serial baud rate, in bits per second. This should be the target baud rate regardless of + * the \c DoubleSpeed parameter's value. * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. */ static inline void Serial_Init(USART_t* const USART, @@ -216,7 +219,36 @@ return ((USART->STATUS & USART_RXCIF_bm) ? true : false); } + /** Indicates whether there is hardware buffer space for a new transmit on the USART. This + * function can be used to determine if a call to \ref Serial_SendByte() will block in advance. + * + * \param[in,out] USART Pointer to the base of the USART peripheral within the device. + * + * \return Boolean \c true if a character can be queued for transmission immediately, \c false otherwise. + */ + static inline bool Serial_IsSendReady(USART_t* const USART) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1); + static inline bool Serial_IsSendReady(USART_t* const USART) + { + return (USART->STATUS & USART_DREIF_bm) ? true : false; + } + + /** Indicates whether the hardware USART transmit buffer is completely empty, indicating all + * pending transmissions have completed. + * + * \param[in,out] USART Pointer to the base of the USART peripheral within the device. + * + * \return Boolean \c true if no characters are buffered for transmission, \c false otherwise. + */ + static inline bool Serial_IsSendComplete(USART_t* const USART) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1); + static inline bool Serial_IsSendComplete(USART_t* const USART) + { + return (USART->STATUS & USART_TXCIF_bm) ? true : false; + } + /** Transmits a given byte through the USART. + * + * \note If no buffer space is available in the hardware USART, this function will block. To check if + * space is available before calling this function, see \ref Serial_IsSendReady(). * * \param[in,out] USART Pointer to the base of the USART peripheral within the device. * \param[in] DataByte Byte to transmit through the USART. @@ -226,7 +258,7 @@ static inline void Serial_SendByte(USART_t* const USART, const char DataByte) { - while (!(USART->STATUS & USART_DREIF_bm)); + while (!(Serial_IsSendReady(USART))); USART->DATA = DataByte; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c old mode 100644 new mode 100755 index e5a5529..92cc643 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -53,7 +53,7 @@ uint8_t TWI_StartTransmission(TWI_t* const TWI, } else if ((status & (TWI_MASTER_WIF_bm | TWI_MASTER_RXACK_bm)) == (TWI_MASTER_WIF_bm | TWI_MASTER_RXACK_bm)) { - TWI_StopTransmission(twi); + TWI_StopTransmission(TWI); return TWI_ERROR_SlaveResponseTimeout; } else if (status & (TWI_MASTER_WIF_bm | TWI_MASTER_RIF_bm)) @@ -67,7 +67,7 @@ uint8_t TWI_StartTransmission(TWI_t* const TWI, if (!(TimeoutRemaining)) { if (TWI->MASTER.STATUS & TWI_MASTER_CLKHOLD_bm) { - TWI_StopTransmission(twi); + TWI_StopTransmission(TWI); } } @@ -110,28 +110,28 @@ uint8_t TWI_ReadPacket(TWI_t* const TWI, const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; - if ((ErrorCode = TWI_StartTransmission(twi, (SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_WRITE, + if ((ErrorCode = TWI_StartTransmission(TWI, (SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_WRITE, TimeoutMS)) == TWI_ERROR_NoError) { while (InternalAddressLen--) { - if (!(TWI_SendByte(twi, *(InternalAddress++)))) + if (!(TWI_SendByte(TWI, *(InternalAddress++)))) { ErrorCode = TWI_ERROR_SlaveNAK; break; } } - if ((ErrorCode = TWI_StartTransmission(twi, (SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_READ, + if ((ErrorCode = TWI_StartTransmission(TWI, (SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_READ, TimeoutMS)) == TWI_ERROR_NoError) { while (Length--) { - if (!(TWI_ReceiveByte(twi, Buffer++, (Length == 0)))) + if (!(TWI_ReceiveByte(TWI, Buffer++, (Length == 0)))) { ErrorCode = TWI_ERROR_SlaveNAK; break; @@ -139,28 +139,28 @@ uint8_t TWI_ReadPacket(TWI_t* const TWI, } } - TWI_StopTransmission(twi); + TWI_StopTransmission(TWI); } return ErrorCode; } -uint8_t TWI_WritePacket(TWI_t* const twi, +uint8_t TWI_WritePacket(TWI_t* const TWI, const uint8_t SlaveAddress, const uint8_t TimeoutMS, const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) + uint16_t Length) { uint8_t ErrorCode; - if ((ErrorCode = TWI_StartTransmission(twi, (SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_WRITE, + if ((ErrorCode = TWI_StartTransmission(TWI, (SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_WRITE, TimeoutMS)) == TWI_ERROR_NoError) { while (InternalAddressLen--) { - if (!(TWI_SendByte(twi, *(InternalAddress++)))) + if (!(TWI_SendByte(TWI, *(InternalAddress++)))) { ErrorCode = TWI_ERROR_SlaveNAK; break; @@ -169,14 +169,14 @@ uint8_t TWI_WritePacket(TWI_t* const twi, while (Length--) { - if (!(TWI_SendByte(twi, *(Buffer++)))) + if (!(TWI_SendByte(TWI, *(Buffer++)))) { ErrorCode = TWI_ERROR_SlaveNAK; break; } } - TWI_StopTransmission(twi); + TWI_StopTransmission(TWI); } return ErrorCode; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h old mode 100644 new mode 100755 index 8ea19e5..94ada73 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/Peripheral/XMEGA/TWI_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -268,7 +268,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); /** High level function to perform a complete packet transfer over the TWI bus from the specified * device. @@ -289,7 +289,7 @@ const uint8_t* InternalAddress, uint8_t InternalAddressLen, const uint8_t* Buffer, - uint8_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); + uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(4); /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h old mode 100644 new mode 100755 index 19dff7a..f1c0109 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AudioClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AudioClass.h old mode 100644 new mode 100755 index 32d7247..d6ced05 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AudioClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/AudioClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/CDCClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/CDCClass.h old mode 100644 new mode 100755 index d6336be..30b3ee2 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/CDCClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/CDCClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h old mode 100644 new mode 100755 index a7b2083..fdf8671 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h old mode 100644 new mode 100755 index 6e40873..46ecd08 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -618,7 +618,7 @@ /** \brief 24-Bit Audio Frequency Structure. * - * Type define for a 24bit audio sample frequency structure. As GCC does not contain a built in 24-bit datatype, + * Type define for a 24-bit audio sample frequency structure. As GCC does not contain a built in 24-bit datatype, * this this structure is used to build up the value instead. Fill this structure with the \ref AUDIO_SAMPLE_FREQ() macro. * * \note Regardless of CPU architecture, these values should be stored as little endian. diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h old mode 100644 new mode 100755 index 5f451b0..1ad49ec --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -289,7 +289,7 @@ * must be \ref CDC_DSUBTYPE_CSInterface_ACM. */ uint8_t Capabilities; /**< Capabilities of the ACM interface, given as a bit mask. For most devices, - * this should be set to a fixed value of 0x06 - for other capabilities, refer + * this should be set to a fixed value of \c 0x06 - for other capabilities, refer * to the CDC ACM specification. */ } ATTR_PACKED USB_CDC_Descriptor_FunctionalACM_t; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h old mode 100644 new mode 100755 index 534dec7..6e700a9 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -147,7 +147,7 @@ #define HID_KEYBOARD_SC_4_AND_DOLLAR 0x21 #define HID_KEYBOARD_SC_5_AND_PERCENTAGE 0x22 #define HID_KEYBOARD_SC_6_AND_CARET 0x23 - #define HID_KEYBOARD_SC_7_AND_AND_AMPERSAND 0x24 + #define HID_KEYBOARD_SC_7_AND_AMPERSAND 0x24 #define HID_KEYBOARD_SC_8_AND_ASTERISK 0x25 #define HID_KEYBOARD_SC_9_AND_OPENING_PARENTHESIS 0x26 #define HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS 0x27 @@ -229,7 +229,7 @@ #define HID_KEYBOARD_SC_F24 0x73 #define HID_KEYBOARD_SC_EXECUTE 0x74 #define HID_KEYBOARD_SC_HELP 0x75 - #define HID_KEYBOARD_SC_MANU 0x76 + #define HID_KEYBOARD_SC_MENU 0x76 #define HID_KEYBOARD_SC_SELECT 0x77 #define HID_KEYBOARD_SC_STOP 0x78 #define HID_KEYBOARD_SC_AGAIN 0x79 @@ -265,7 +265,7 @@ #define HID_KEYBOARD_SC_LANG8 0x97 #define HID_KEYBOARD_SC_LANG9 0x98 #define HID_KEYBOARD_SC_ALTERNATE_ERASE 0x99 - #define HID_KEYBOARD_SC_SISREQ 0x9A + #define HID_KEYBOARD_SC_SYSREQ 0x9A #define HID_KEYBOARD_SC_CANCEL 0x9B #define HID_KEYBOARD_SC_CLEAR 0x9C #define HID_KEYBOARD_SC_PRIOR 0x9D @@ -274,7 +274,7 @@ #define HID_KEYBOARD_SC_OUT 0xA0 #define HID_KEYBOARD_SC_OPER 0xA1 #define HID_KEYBOARD_SC_CLEAR_AND_AGAIN 0xA2 - #define HID_KEYBOARD_SC_CRSEL_ANDPROPS 0xA3 + #define HID_KEYBOARD_SC_CRSEL_AND_PROPS 0xA3 #define HID_KEYBOARD_SC_EXSEL 0xA4 #define HID_KEYBOARD_SC_KEYPAD_00 0xB0 #define HID_KEYBOARD_SC_KEYPAD_000 0xB1 @@ -330,6 +330,23 @@ #define HID_KEYBOARD_SC_RIGHT_SHIFT 0xE5 #define HID_KEYBOARD_SC_RIGHT_ALT 0xE6 #define HID_KEYBOARD_SC_RIGHT_GUI 0xE7 + #define HID_KEYBOARD_SC_MEDIA_PLAY 0xE8 + #define HID_KEYBOARD_SC_MEDIA_STOP 0xE9 + #define HID_KEYBOARD_SC_MEDIA_PREVIOUS_TRACK 0xEA + #define HID_KEYBOARD_SC_MEDIA_NEXT_TRACK 0xEB + #define HID_KEYBOARD_SC_MEDIA_EJECT 0xEC + #define HID_KEYBOARD_SC_MEDIA_VOLUME_UP 0xED + #define HID_KEYBOARD_SC_MEDIA_VOLUME_DOWN 0xEE + #define HID_KEYBOARD_SC_MEDIA_MUTE 0xEF + #define HID_KEYBOARD_SC_MEDIA_WWW 0xF0 + #define HID_KEYBOARD_SC_MEDIA_BACKWARD 0xF1 + #define HID_KEYBOARD_SC_MEDIA_FORWARD 0xF2 + #define HID_KEYBOARD_SC_MEDIA_CANCEL 0xF3 + #define HID_KEYBOARD_SC_MEDIA_SEARCH 0xF4 + #define HID_KEYBOARD_SC_MEDIA_SLEEP 0xF8 + #define HID_KEYBOARD_SC_MEDIA_LOCK 0xF9 + #define HID_KEYBOARD_SC_MEDIA_RELOAD 0xFA + #define HID_KEYBOARD_SC_MEDIA_CALCULATOR 0xFB //@} /** \name Common HID Device Report Descriptors */ @@ -428,7 +445,7 @@ HID_RI_REPORT_SIZE(8, 0x03), \ HID_RI_OUTPUT(8, HID_IOF_CONSTANT), \ HID_RI_LOGICAL_MINIMUM(8, 0x00), \ - HID_RI_LOGICAL_MAXIMUM(8, 0xFF), \ + HID_RI_LOGICAL_MAXIMUM(16, 0xFF), \ HID_RI_USAGE_PAGE(8, 0x07), \ HID_RI_USAGE_MINIMUM(8, 0x00), \ HID_RI_USAGE_MAXIMUM(8, 0xFF), \ @@ -662,4 +679,3 @@ #endif /** @} */ - diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.c old mode 100644 new mode 100755 index 92a4bed..9250cad --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -90,7 +90,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH - 1]) return HID_PARSE_HIDStackOverflow; - memcpy((CurrStateTable + 1), + memmove(CurrStateTable + 1, CurrStateTable, sizeof(HID_ReportItem_t)); @@ -364,8 +364,8 @@ void USB_SetHIDReportItemInfo(uint8_t* ReportData, while (DataBitsRem--) { - if (ReportItem->Value & (1 << (CurrentBit % 8))) - ReportData[CurrentBit / 8] |= BitMask; + if (ReportItem->Value & BitMask) + ReportData[CurrentBit / 8] |= (1 << (CurrentBit % 8)); CurrentBit++; BitMask <<= 1; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.h old mode 100644 new mode 100755 index f5454c3..023316d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDParser.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDReportData.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDReportData.h old mode 100644 new mode 100755 index b5825a9..fe1c4df --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDReportData.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/HIDReportData.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h old mode 100644 new mode 100755 index fbd633a..b6414bc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MIDIClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -135,7 +135,7 @@ * * \return Constructed MIDI event ID. */ - #define MIDI_EVENT(virtualcable, command) ((virtualcable << 4) | (command >> 4)) + #define MIDI_EVENT(virtualcable, command) (((virtualcable) << 4) | ((command) >> 4)) /* Enums: */ /** Enum for the possible MIDI jack types in a MIDI device jack descriptor. */ @@ -345,7 +345,7 @@ */ typedef struct { - uint8_t Event; /**< MIDI event type, constructed with the \ref MIDI_EVENT() macro. */ + uint8_t Event; /**< MIDI event type, constructed with the \ref MIDI_EVENT() macro. */ uint8_t Data1; /**< First byte of data in the MIDI event. */ uint8_t Data2; /**< Second byte of data in the MIDI event. */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h old mode 100644 new mode 100755 index 097db50..d2ea37a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h old mode 100644 new mode 100755 index 12c04c8..2db830e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h old mode 100644 new mode 100755 index 7b27dd0..ade1af0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -172,9 +172,6 @@ #define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103UL //@} - /** Maximum size in bytes of a RNDIS control message which can be sent or received. */ - #define RNDIS_MESSAGE_BUFFER_SIZE 128 - /** Maximum size in bytes of an Ethernet frame according to the Ethernet standard. */ #define ETHERNET_FRAME_SIZE_MAX 1500 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h old mode 100644 new mode 100755 index fd7b035..7608b18 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Common/StillImageClassCommon.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c old mode 100644 new mode 100755 index 49a71b0..eb3aa57 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -45,7 +45,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_INTERFACE) { uint8_t InterfaceIndex = (USB_ControlRequest.wIndex & 0xFF); - + if ((InterfaceIndex != AudioInterfaceInfo->Config.ControlInterfaceNumber) && (InterfaceIndex != AudioInterfaceInfo->Config.StreamingInterfaceNumber)) { @@ -55,7 +55,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT) { uint8_t EndpointAddress = (USB_ControlRequest.wIndex & 0xFF); - + if ((EndpointAddress != AudioInterfaceInfo->Config.DataINEndpoint.Address) && (EndpointAddress != AudioInterfaceInfo->Config.DataOUTEndpoint.Address)) { @@ -175,7 +175,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) { memset(&AudioInterfaceInfo->State, 0x00, sizeof(AudioInterfaceInfo->State)); - + AudioInterfaceInfo->Config.DataINEndpoint.Type = EP_TYPE_ISOCHRONOUS; AudioInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_ISOCHRONOUS; @@ -188,7 +188,7 @@ bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioIn return true; } -void Audio_Device_Event_Stub(void) +void Audio_Device_Event_Stub(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) { } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h old mode 100644 new mode 100755 index 8c26ca2..91938af --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -377,7 +377,7 @@ #if !defined(__DOXYGEN__) /* Function Prototypes: */ #if defined(__INCLUDE_FROM_AUDIO_DEVICE_C) - void Audio_Device_Event_Stub(void) ATTR_CONST; + void Audio_Device_Event_Stub(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo); void EVENT_Audio_Device_StreamStartStop(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(Audio_Device_Event_Stub); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c old mode 100644 new mode 100755 index baa0e52..93930bc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -155,6 +155,16 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo return Endpoint_Write_Stream_LE(String, strlen(String), NULL); } +uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const String) +{ + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); + return Endpoint_Write_PStream_LE(String, strlen_P(String), NULL); +} + uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const void* const Buffer, const uint16_t Length) @@ -166,6 +176,17 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, return Endpoint_Write_Stream_LE(Buffer, Length, NULL); } +uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) +{ + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address); + return Endpoint_Write_PStream_LE(Buffer, Length, NULL); +} + uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Data) { @@ -332,10 +353,15 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) } #endif -void CDC_Device_Event_Stub(void) +void CDC_Device_Event_Stub(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) { } +void CDC_Device_Event_Stub_2(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t _1) +{ + CDC_Device_Event_Stub(CDCInterfaceInfo); +} + #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h old mode 100644 new mode 100755 index 2c66289..55dbbc7 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -200,6 +200,24 @@ const void* const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given data buffer from PROGMEM space to the attached USB host, if connected. If a host is not connected when the + * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the endpoint + * bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows + * for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + * + * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. + * + * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given null terminated string to the attached USB host, if connected. If a host is not connected when * the function is called, the string is discarded. Bytes will be queued for transmission to the host until either * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to @@ -216,6 +234,22 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given null terminated string from PROGMEM space to the attached USB host, if connected. If a host is not connected + * when the function is called, the string is discarded. Bytes will be queued for transmission to the host until either + * the endpoint bank becomes full, or the \ref CDC_Device_Flush() function is called to flush the pending data to + * the host. This allows for multiple bytes to be packed into a single endpoint packet, increasing data throughput. + * + * \pre This function must only be called when the Device state machine is in the \ref DEVICE_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state. + * \param[in] String Pointer to the null terminated string to send to the host. + * + * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given byte to the attached USB host, if connected. If a host is not connected when the function is called, the * byte is discarded. Bytes will be queued for transmission to the host until either the endpoint bank becomes full, or the * \ref CDC_Device_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be @@ -328,7 +362,8 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Device_Event_Stub(void) ATTR_CONST; + void CDC_Device_Event_Stub(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo); + void CDC_Device_Event_Stub_2(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t _1); void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); @@ -336,7 +371,7 @@ ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) - ATTR_ALIAS(CDC_Device_Event_Stub); + ATTR_ALIAS(CDC_Device_Event_Stub_2); #endif #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c old mode 100644 new mode 100755 index 6ca4c1f..a8a6e8b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -68,6 +68,10 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); Endpoint_ClearSETUP(); + + if (ReportID) + Endpoint_Write_8(ReportID); + Endpoint_Write_Control_Stream_LE(ReportData, ReportSize); Endpoint_ClearOUT(); } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h old mode 100644 new mode 100755 index 2915c91..ae628c8 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/HIDClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -91,13 +91,13 @@ * stored by the driver, for comparison purposes to detect report changes that * must be sent immediately to the host. This should point to a buffer big enough * to hold the largest HID input report sent from the HID interface. If this is set - * to \c NULL, it is up to the user to force transfers when needed in the - * \ref CALLBACK_HID_Device_CreateHIDReport() callback function. - * - * \note Due to the single buffer, the internal driver can only correctly compare - * subsequent reports with identical report IDs. In multiple report devices, - * this buffer should be set to \c NULL and the decision to send reports made - * by the user application instead. + * to \c NULL, it is up to the user to force transfers when needed in the + * \ref CALLBACK_HID_Device_CreateHIDReport() callback function. + * + * \note Due to the single buffer, the internal driver can only correctly compare + * subsequent reports with identical report IDs. In multiple report devices, + * this buffer should be set to \c NULL and the decision to send reports made + * by the user application instead. */ uint8_t PrevReportINBufferSize; /**< Size in bytes of the given input report buffer. This is used to create a * second buffer of the same size within the driver so that subsequent reports diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c old mode 100644 new mode 100755 index c782119..a35c408 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -60,7 +60,7 @@ void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) #if !defined(NO_CLASS_DRIVER_AUTOFLUSH) Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataINEndpoint.Address); - + if (Endpoint_IsINReady()) MIDI_Device_Flush(MIDIInterfaceInfo); #endif @@ -113,6 +113,9 @@ bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInter Endpoint_SelectEndpoint(MIDIInterfaceInfo->Config.DataOUTEndpoint.Address); + if (!(Endpoint_IsOUTReceived())) + return false; + if (!(Endpoint_IsReadWriteAllowed())) return false; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h old mode 100644 new mode 100755 index 4b8be3e..ee2efd7 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c old mode 100644 new mode 100755 index feb2951..1ea30f7 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -136,7 +136,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte uint16_t BytesProcessed; Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpoint.Address); - + BytesProcessed = 0; while (Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock, (sizeof(MS_CommandBlockWrapper_t) - 16), &BytesProcessed) == @@ -151,7 +151,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte (MSInterfaceInfo->State.CommandBlock.Flags & 0x1F) || (MSInterfaceInfo->State.CommandBlock.SCSICommandLength == 0) || (MSInterfaceInfo->State.CommandBlock.SCSICommandLength > 16)) - { + { Endpoint_StallTransaction(); Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpoint.Address); Endpoint_StallTransaction(); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h old mode 100644 new mode 100755 index 3c3076c..12b54f8 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c old mode 100644 new mode 100755 index 3d34047..668b138 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -305,7 +305,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) } #endif -void PRNT_Device_Event_Stub(void) +void PRNT_Device_Event_Stub(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) { } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h old mode 100644 new mode 100755 index 6cdc0da..d850842 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -273,7 +273,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void PRNT_Device_Event_Stub(void) ATTR_CONST; + void PRNT_Device_Event_Stub(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo); void EVENT_PRNT_Device_SoftReset(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(PRNT_Device_Event_Stub); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c old mode 100644 new mode 100755 index bf5dfb6..45293b1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -82,7 +82,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); - Endpoint_Read_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, USB_ControlRequest.wLength); + Endpoint_Read_Control_Stream_LE(RNDISInterfaceInfo->Config.MessageBuffer, USB_ControlRequest.wLength); Endpoint_ClearIN(); RNDIS_Device_ProcessRNDISControlMessage(RNDISInterfaceInfo); @@ -92,16 +92,16 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI case RNDIS_REQ_GetEncapsulatedResponse: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { - RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)RNDISInterfaceInfo->Config.MessageBuffer; if (!(MessageHeader->MessageLength)) { - RNDISInterfaceInfo->State.RNDISMessageBuffer[0] = 0; - MessageHeader->MessageLength = CPU_TO_LE32(1); + RNDISInterfaceInfo->Config.MessageBuffer[0] = 0; + MessageHeader->MessageLength = CPU_TO_LE32(1); } Endpoint_ClearSETUP(); - Endpoint_Write_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, le32_to_cpu(MessageHeader->MessageLength)); + Endpoint_Write_Control_Stream_LE(RNDISInterfaceInfo->Config.MessageBuffer, le32_to_cpu(MessageHeader->MessageLength)); Endpoint_ClearOUT(); MessageHeader->MessageLength = CPU_TO_LE32(0); @@ -119,6 +119,12 @@ bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_Device_t* const RNDISIn RNDISInterfaceInfo->Config.DataOUTEndpoint.Type = EP_TYPE_BULK; RNDISInterfaceInfo->Config.NotificationEndpoint.Type = EP_TYPE_INTERRUPT; + if (RNDISInterfaceInfo->Config.MessageBuffer == NULL) + return false; + + if (RNDISInterfaceInfo->Config.MessageBufferLength < RNDIS_DEVICE_MIN_MESSAGE_BUFFER_LENGTH) + return false; + if (!(Endpoint_ConfigureEndpointTable(&RNDISInterfaceInfo->Config.DataINEndpoint, 1))) return false; @@ -162,7 +168,7 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const /* Note: Only a single buffer is used for both the received message and its response to save SRAM. Because of this, response bytes should be filled in order so that they do not clobber unread data in the buffer. */ - RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)RNDISInterfaceInfo->Config.MessageBuffer; switch (le32_to_cpu(MessageHeader->MessageType)) { @@ -170,9 +176,9 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo->State.ResponseReady = true; RNDIS_Initialize_Message_t* INITIALIZE_Message = - (RNDIS_Initialize_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + (RNDIS_Initialize_Message_t*)RNDISInterfaceInfo->Config.MessageBuffer; RNDIS_Initialize_Complete_t* INITIALIZE_Response = - (RNDIS_Initialize_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + (RNDIS_Initialize_Complete_t*)RNDISInterfaceInfo->Config.MessageBuffer; INITIALIZE_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_INITIALIZE_CMPLT); INITIALIZE_Response->MessageLength = CPU_TO_LE32(sizeof(RNDIS_Initialize_Complete_t)); @@ -201,13 +207,13 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const case REMOTE_NDIS_QUERY_MSG: RNDISInterfaceInfo->State.ResponseReady = true; - RNDIS_Query_Message_t* QUERY_Message = (RNDIS_Query_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; - RNDIS_Query_Complete_t* QUERY_Response = (RNDIS_Query_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + RNDIS_Query_Message_t* QUERY_Message = (RNDIS_Query_Message_t*)RNDISInterfaceInfo->Config.MessageBuffer; + RNDIS_Query_Complete_t* QUERY_Response = (RNDIS_Query_Complete_t*)RNDISInterfaceInfo->Config.MessageBuffer; uint32_t Query_Oid = CPU_TO_LE32(QUERY_Message->Oid); - void* QueryData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) + - le32_to_cpu(QUERY_Message->InformationBufferOffset)]; - void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)]; + void* QueryData = &RNDISInterfaceInfo->Config.MessageBuffer[sizeof(RNDIS_Message_Header_t) + + le32_to_cpu(QUERY_Message->InformationBufferOffset)]; + void* ResponseData = &RNDISInterfaceInfo->Config.MessageBuffer[sizeof(RNDIS_Query_Complete_t)]; uint16_t ResponseSize; QUERY_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_QUERY_CMPLT); @@ -234,15 +240,15 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const case REMOTE_NDIS_SET_MSG: RNDISInterfaceInfo->State.ResponseReady = true; - RNDIS_Set_Message_t* SET_Message = (RNDIS_Set_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; - RNDIS_Set_Complete_t* SET_Response = (RNDIS_Set_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + RNDIS_Set_Message_t* SET_Message = (RNDIS_Set_Message_t*)RNDISInterfaceInfo->Config.MessageBuffer; + RNDIS_Set_Complete_t* SET_Response = (RNDIS_Set_Complete_t*)RNDISInterfaceInfo->Config.MessageBuffer; uint32_t SET_Oid = le32_to_cpu(SET_Message->Oid); SET_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_SET_CMPLT); SET_Response->MessageLength = CPU_TO_LE32(sizeof(RNDIS_Set_Complete_t)); SET_Response->RequestId = SET_Message->RequestId; - void* SetData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) + + void* SetData = &RNDISInterfaceInfo->Config.MessageBuffer[sizeof(RNDIS_Message_Header_t) + le32_to_cpu(SET_Message->InformationBufferOffset)]; SET_Response->Status = RNDIS_Device_ProcessNDISSet(RNDISInterfaceInfo, SET_Oid, SetData, @@ -252,7 +258,7 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const case REMOTE_NDIS_RESET_MSG: RNDISInterfaceInfo->State.ResponseReady = true; - RNDIS_Reset_Complete_t* RESET_Response = (RNDIS_Reset_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + RNDIS_Reset_Complete_t* RESET_Response = (RNDIS_Reset_Complete_t*)RNDISInterfaceInfo->Config.MessageBuffer; RESET_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_RESET_CMPLT); RESET_Response->MessageLength = CPU_TO_LE32(sizeof(RNDIS_Reset_Complete_t)); @@ -264,9 +270,9 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo->State.ResponseReady = true; RNDIS_KeepAlive_Message_t* KEEPALIVE_Message = - (RNDIS_KeepAlive_Message_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + (RNDIS_KeepAlive_Message_t*)RNDISInterfaceInfo->Config.MessageBuffer; RNDIS_KeepAlive_Complete_t* KEEPALIVE_Response = - (RNDIS_KeepAlive_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer; + (RNDIS_KeepAlive_Complete_t*)RNDISInterfaceInfo->Config.MessageBuffer; KEEPALIVE_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_KEEPALIVE_CMPLT); KEEPALIVE_Response->MessageLength = CPU_TO_LE32(sizeof(RNDIS_KeepAlive_Complete_t)); @@ -387,7 +393,7 @@ static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RN *ResponseSize = sizeof(uint32_t); /* Indicate maximum overall buffer (Ethernet frame and RNDIS header) the adapter can handle */ - *((uint32_t*)ResponseData) = CPU_TO_LE32(RNDIS_MESSAGE_BUFFER_SIZE + ETHERNET_FRAME_SIZE_MAX); + *((uint32_t*)ResponseData) = CPU_TO_LE32(RNDISInterfaceInfo->Config.MessageBufferLength + ETHERNET_FRAME_SIZE_MAX); return true; default: diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h old mode 100644 new mode 100755 index 3fc0e66..761bc27 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -87,14 +87,15 @@ char* AdapterVendorDescription; /**< String description of the adapter vendor. */ MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter. */ + + uint8_t* MessageBuffer; /**< Buffer where RNDIS messages can be stored by the internal driver. This + * should be at least 132 bytes in length for minimal functionality. */ + uint16_t MessageBufferLength; /**< Length in bytes of the \ref MessageBuffer RNDIS buffer. */ } Config; /**< Config data for the USB class interface within the device. All elements in this section * must be set or the interface will fail to enumerate and operate correctly. */ struct { - uint8_t RNDISMessageBuffer[RNDIS_MESSAGE_BUFFER_SIZE]; /**< Buffer to hold RNDIS messages to and from the host, - * managed by the class driver. - */ bool ResponseReady; /**< Internal flag indicating if a RNDIS message is waiting to be returned to the host. */ uint8_t CurrRNDISState; /**< Current RNDIS state of the adapter, a value from the \ref RNDIS_States_t enum. */ uint32_t CurrPacketFilter; /**< Current packet filter mode, used internally by the class driver. */ @@ -172,6 +173,9 @@ /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) + /* Macros: */ + #define RNDIS_DEVICE_MIN_MESSAGE_BUFFER_LENGTH sizeof(AdapterSupportedOIDList) + sizeof(RNDIS_Query_Complete_t) + /* Function Prototypes: */ #if defined(__INCLUDE_FROM_RNDIS_DEVICE_C) static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/HIDClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/HIDClass.h old mode 100644 new mode 100755 index 48427e5..158eb25 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/HIDClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/HIDClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c old mode 100644 new mode 100755 index 1871df1..ea89033 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -98,10 +98,10 @@ uint8_t AOA_Host_ConfigurePipes(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo AOAInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK; if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataINPipe, 1))) - return false; + return AOA_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return AOA_ENUMERROR_PipeConfigurationFailed; AOAInterfaceInfo->State.IsActive = true; AOAInterfaceInfo->State.InterfaceNumber = AOAInterface->InterfaceNumber; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h old mode 100644 new mode 100755 index a8d3e90..f4f04e4 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.c old mode 100644 new mode 100755 index 2cd061b..9f1a6dc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -97,17 +97,17 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa AudioInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress; AudioInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_ISOCHRONOUS; AudioInterfaceInfo->Config.DataINPipe.Banks = 2; - + AudioInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize); AudioInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress; AudioInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_ISOCHRONOUS; AudioInterfaceInfo->Config.DataOUTPipe.Banks = 2; - + if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataINPipe, 1))) - return false; - + return AUDIO_ENUMERROR_PipeConfigurationFailed; + if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return AUDIO_ENUMERROR_PipeConfigurationFailed; AudioInterfaceInfo->State.ControlInterfaceNumber = AudioControlInterface->InterfaceNumber; AudioInterfaceInfo->State.StreamingInterfaceNumber = AudioStreamingInterface->InterfaceNumber; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.h old mode 100644 new mode 100755 index 02a79aa..f1f4207 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/AudioClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.c old mode 100644 new mode 100755 index 146d501..cc93f96 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -112,13 +112,13 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo CDCInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT; if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataINPipe, 1))) - return false; + return CDC_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return CDC_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.NotificationPipe, 1))) - return false; + return CDC_ENUMERROR_PipeConfigurationFailed; CDCInterfaceInfo->State.ControlInterfaceNumber = CDCControlInterface->InterfaceNumber; CDCInterfaceInfo->State.ControlLineStates.HostToDevice = (CDC_CONTROL_LINE_OUT_RTS | CDC_CONTROL_LINE_OUT_DTR); @@ -294,6 +294,24 @@ uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, return ErrorCode; } +uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) +{ + if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) + return PIPE_READYWAIT_DeviceDisconnected; + + uint8_t ErrorCode; + + Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); + + Pipe_Unfreeze(); + ErrorCode = Pipe_Write_PStream_LE(Buffer, Length, NULL); + Pipe_Freeze(); + + return ErrorCode; +} + uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const char* const String) { @@ -311,6 +329,23 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, return ErrorCode; } +uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) +{ + if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) + return PIPE_READYWAIT_DeviceDisconnected; + + uint8_t ErrorCode; + + Pipe_SelectPipe(CDCInterfaceInfo->Config.DataOUTPipe.Address); + + Pipe_Unfreeze(); + ErrorCode = Pipe_Write_PStream_LE(String, strlen_P(String), NULL); + Pipe_Freeze(); + + return ErrorCode; +} + uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data) { @@ -468,7 +503,7 @@ static int CDC_Host_getchar_Blocking(FILE* Stream) } #endif -void CDC_Host_Event_Stub(void) +void CDC_Host_Event_Stub(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) { } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.h old mode 100644 new mode 100755 index 2d8d700..8d0d89a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/CDCClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -201,6 +201,24 @@ const void* const Buffer, const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + /** Sends a given data buffer from PROGMEM space to the attached USB device, if connected. If a device is not connected when the + * function is called, the string is discarded. Bytes will be queued for transmission to the host until either the pipe + * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows + * for multiple bytes to be packed into a single pipe packet, increasing data throughput. + * + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. + * \param[in] Buffer Pointer to a buffer containing the data to send to the device. + * \param[in] Length Length of the data to send to the host. + * + * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Host_SendData_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const void* const Buffer, + const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); + /** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the * function is called, the string is discarded. Bytes will be queued for transmission to the device until either the pipe * bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to the device. This allows @@ -217,6 +235,22 @@ uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given null terminated string from PROGMEM space to the attached USB device, if connected. If a device is not connected + * when the function is called, the string is discarded. Bytes will be queued for transmission to the device until either + * the pipe bank becomes full, or the \ref CDC_Host_Flush() function is called to flush the pending data to + * the device. This allows for multiple bytes to be packed into a single pipe packet, increasing data throughput. + * + * \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or + * the call will fail. + * + * \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state. + * \param[in] String Pointer to the null terminated string to send to the host. + * + * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. + */ + uint8_t CDC_Host_SendString_P(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, + const char* const String) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); + /** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the * byte is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the * \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be @@ -326,7 +360,7 @@ static int CDC_Host_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Host_Event_Stub(void) ATTR_CONST; + void CDC_Host_Event_Stub(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo); void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.c old mode 100644 new mode 100755 index 837c841..32591ff --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -99,7 +99,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo HIDInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_INTERRUPT; if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1))) - return false; + return HID_ENUMERROR_PipeConfigurationFailed; if (DataOUTEndpoint) { @@ -108,7 +108,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT; if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return HID_ENUMERROR_PipeConfigurationFailed; } HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber; @@ -238,7 +238,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo { #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.IsActive)) - return false; + return PIPE_RWSTREAM_NoError; if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == HID_REPORT_ITEM_Out)) { diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.h old mode 100644 new mode 100755 index 965ac36..73b5abb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/HIDClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -93,7 +93,7 @@ #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol * is not used. - * + * * \note When the \c HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, * this field is unavailable. */ @@ -120,9 +120,9 @@ uint8_t LargestReportSize; /**< Largest report the device will send, in bytes. */ } State; /**< State data for the USB class interface within the device. All elements in this section - * may be set to initial values, but may also be ignored to default to sane values when - * the interface is enumerated. - */ + * may be set to initial values, but may also be ignored to default to sane values when + * the interface is enumerated. + */ } USB_ClassInfo_HID_Host_t; /* Enums: */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c old mode 100644 new mode 100755 index c845760..635148f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -81,16 +81,16 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI MIDIInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize); MIDIInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress; MIDIInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK; - + MIDIInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize); MIDIInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress; MIDIInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK; - + if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataINPipe, 1))) - return false; - + return MIDI_ENUMERROR_PipeConfigurationFailed; + if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return MIDI_ENUMERROR_PipeConfigurationFailed; MIDIInterfaceInfo->State.InterfaceNumber = MIDIInterface->InterfaceNumber; MIDIInterfaceInfo->State.IsActive = true; @@ -157,7 +157,7 @@ uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipe.Address); Pipe_Unfreeze(); - + if (Pipe_BytesInPipe()) { Pipe_ClearOUT(); @@ -184,7 +184,7 @@ uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataOUTPipe.Address); Pipe_Unfreeze(); - + if ((ErrorCode = Pipe_Write_Stream_LE(Event, sizeof(MIDI_EventPacket_t), NULL)) != PIPE_RWSTREAM_NoError) { Pipe_Freeze(); @@ -204,7 +204,7 @@ bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface { if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive)) return HOST_SENDCONTROL_DeviceDisconnected; - + bool DataReady = false; Pipe_SelectPipe(MIDIInterfaceInfo->Config.DataINPipe.Address); @@ -221,9 +221,9 @@ bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterface if (!(Pipe_BytesInPipe())) Pipe_ClearIN(); } - + Pipe_Freeze(); - + return DataReady; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h old mode 100644 new mode 100755 index 50832b8..9cae21a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MIDIClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c old mode 100644 new mode 100755 index c4cb21a..f7c5a6a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -81,16 +81,16 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MSInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize); MSInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress; MSInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK; - + MSInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize); MSInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress; MSInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK; - + if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataINPipe, 1))) - return false; - + return MS_ENUMERROR_PipeConfigurationFailed; + if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return MS_ENUMERROR_PipeConfigurationFailed; MSInterfaceInfo->State.InterfaceNumber = MassStorageInterface->InterfaceNumber; MSInterfaceInfo->State.IsActive = true; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h old mode 100644 new mode 100755 index 37cfd0f..348050f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c old mode 100644 new mode 100755 index e04a9b5..8a04d0a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -87,10 +87,10 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI PRNTInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK; if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataINPipe, 1))) - return false; + return PRNT_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return PRNT_ENUMERROR_PipeConfigurationFailed; PRNTInterfaceInfo->State.InterfaceNumber = PrinterInterface->InterfaceNumber; PRNTInterfaceInfo->State.AlternateSetting = PrinterInterface->AlternateSetting; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h old mode 100644 new mode 100755 index 1952b9c..511dab4 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/PrinterClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c old mode 100644 new mode 100755 index 2fadfd9..6fb09fd --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -104,23 +104,23 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa RNDISInterfaceInfo->Config.DataINPipe.Size = le16_to_cpu(DataINEndpoint->EndpointSize); RNDISInterfaceInfo->Config.DataINPipe.EndpointAddress = DataINEndpoint->EndpointAddress; RNDISInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_BULK; - + RNDISInterfaceInfo->Config.DataOUTPipe.Size = le16_to_cpu(DataOUTEndpoint->EndpointSize); RNDISInterfaceInfo->Config.DataOUTPipe.EndpointAddress = DataOUTEndpoint->EndpointAddress; RNDISInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK; - + RNDISInterfaceInfo->Config.NotificationPipe.Size = le16_to_cpu(NotificationEndpoint->EndpointSize); RNDISInterfaceInfo->Config.NotificationPipe.EndpointAddress = NotificationEndpoint->EndpointAddress; RNDISInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT; if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataINPipe, 1))) - return false; - + return RNDIS_ENUMERROR_PipeConfigurationFailed; + if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return RNDIS_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.NotificationPipe, 1))) - return false; + return RNDIS_ENUMERROR_PipeConfigurationFailed; RNDISInterfaceInfo->State.ControlInterfaceNumber = RNDISControlInterface->InterfaceNumber; RNDISInterfaceInfo->State.IsActive = true; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h old mode 100644 new mode 100755 index 497469e..bddbc24 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/RNDISClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c old mode 100644 new mode 100755 index 5b317f9..ef33d9b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -100,13 +100,13 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, SIInterfaceInfo->Config.EventsPipe.Type = EP_TYPE_INTERRUPT; if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataINPipe, 1))) - return false; + return SI_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataOUTPipe, 1))) - return false; + return SI_ENUMERROR_PipeConfigurationFailed; if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.EventsPipe, 1))) - return false; + return SI_ENUMERROR_PipeConfigurationFailed; SIInterfaceInfo->State.InterfaceNumber = StillImageInterface->InterfaceNumber; SIInterfaceInfo->State.IsActive = true; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h old mode 100644 new mode 100755 index daf25e8..ababdb0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/Host/StillImageClassHost.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MIDIClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MIDIClass.h old mode 100644 new mode 100755 index 9583085..a35ae13 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MIDIClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MIDIClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MassStorageClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MassStorageClass.h old mode 100644 new mode 100755 index c9285b6..fa41fbf --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MassStorageClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/MassStorageClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/PrinterClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/PrinterClass.h old mode 100644 new mode 100755 index 0f38ad2..78ad520 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/PrinterClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/PrinterClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/RNDISClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/RNDISClass.h old mode 100644 new mode 100755 index 926472b..07b4f56 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/RNDISClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/RNDISClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/StillImageClass.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/StillImageClass.h old mode 100644 new mode 100755 index 7fd8eeb..7cb8b4f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/StillImageClass.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Class/StillImageClass.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c old mode 100644 new mode 100755 index edfdde5..f972b0b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h old mode 100644 new mode 100755 index a0dba7b..69f9be5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -217,7 +217,7 @@ static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) { (void)Address; - + UDADDR |= (1 << ADDEN); } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c old mode 100644 new mode 100755 index ce54174..8ffae15 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -44,10 +44,10 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + if ((ErrorCode = Endpoint_WaitUntilReady())) return ErrorCode; - + if (BytesProcessed != NULL) Length -= *BytesProcessed; @@ -74,7 +74,7 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length, BytesInTransfer++; } } - + return ENDPOINT_RWSTREAM_NoError; } @@ -83,10 +83,10 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + if ((ErrorCode = Endpoint_WaitUntilReady())) return ErrorCode; - + if (BytesProcessed != NULL) Length -= *BytesProcessed; @@ -113,7 +113,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, BytesInTransfer++; } } - + return ENDPOINT_RWSTREAM_NoError; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h old mode 100644 new mode 100755 index 8fac3f3..80e78df --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -44,16 +44,16 @@ * and to endpoints. * * @{ - */ + */ #ifndef __ENDPOINT_STREAM_AVR8_H__ #define __ENDPOINT_STREAM_AVR8_H__ /* Includes: */ #include "../../../../Common/Common.h" - #include "../USBMode.h" + #include "../USBMode.h" #include "../USBTask.h" - + /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -87,7 +87,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Discard_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -98,13 +98,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Discard_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -123,7 +123,7 @@ uint16_t* const BytesProcessed); /** Writes a given number of zeroed bytes to the currently selected endpoint's bank, sending - * full packets to the host as needed. The last packet is not automatically sent once the + * full packets to the host as needed. The last packet is not automatically sent once the * remaining bytes have been written; the user is responsible for manually sending the last * packet to the host via the \ref Endpoint_ClearIN() macro. * @@ -140,7 +140,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Null_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -151,13 +151,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Null_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -179,7 +179,7 @@ /** \name Stream functions for RAM source/destination data */ //@{ - + /** Writes the given number of bytes to the endpoint from the given buffer in little endian, * sending full packets to the host as needed. The last packet filled is not automatically sent; * the user is responsible for manually sending the last written packet to the host via the @@ -199,7 +199,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != ENDPOINT_RWSTREAM_NoError) * { @@ -256,7 +256,7 @@ uint8_t Endpoint_Write_Stream_BE(const void* const Buffer, uint16_t Length, uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); - + /** Reads the given number of bytes from the endpoint from the given buffer in little endian, * discarding fully read packets from the host as needed. The last packet is not automatically * discarded once the remaining bytes has been read; the user is responsible for manually @@ -276,7 +276,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != ENDPOINT_RWSTREAM_NoError) * { @@ -289,14 +289,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -651,7 +651,7 @@ #if defined(__cplusplus) } #endif - + #endif /** @} */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c old mode 100644 new mode 100755 index 63a75d0..92cf836 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -49,11 +49,11 @@ bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, { if (!(Table[i].Address)) continue; - + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) return false; } - + return true; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h old mode 100644 new mode 100755 index 7eaabae..6d83752 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -314,7 +314,7 @@ } /** Retrieves the number of busy banks in the currently selected endpoint, which have been queued for - * transmission via the \ref Endpoint_ClearIN() command, or are awaiting acknowledgement via the + * transmission via the \ref Endpoint_ClearIN() command, or are awaiting acknowledgment via the * \ref Endpoint_ClearOUT() command. * * \ingroup Group_EndpointPacketManagement_AVR8 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c old mode 100644 new mode 100755 index b65f233..cbb7735 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -82,7 +82,7 @@ void USB_Host_ProcessNextHostState(void) USB_OTGPAD_On(); USB_Host_VBUS_Auto_Enable(); USB_Host_VBUS_Auto_On(); - + #if defined(NO_AUTO_VBUS_MANAGEMENT) USB_Host_VBUS_Manual_Enable(); USB_Host_VBUS_Manual_On(); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h old mode 100644 new mode 100755 index 4f7f024..7a48e31 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h old mode 100644 new mode 100755 index 7d2a5b6..74c70cc --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/OTG_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c old mode 100644 new mode 100755 index 341436d..7b17d45 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -43,7 +43,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + Pipe_SetPipeToken(PIPE_TOKEN_IN); if ((ErrorCode = Pipe_WaitUntilReady())) @@ -57,7 +57,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length, if (!(Pipe_IsReadWriteAllowed())) { Pipe_ClearIN(); - + if (BytesProcessed != NULL) { *BytesProcessed += BytesInTransfer; @@ -70,7 +70,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length, else { Pipe_Discard_8(); - + Length--; BytesInTransfer++; } @@ -84,7 +84,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + Pipe_SetPipeToken(PIPE_TOKEN_OUT); if ((ErrorCode = Pipe_WaitUntilReady())) @@ -98,13 +98,13 @@ uint8_t Pipe_Null_Stream(uint16_t Length, if (!(Pipe_IsReadWriteAllowed())) { Pipe_ClearOUT(); - + if (BytesProcessed != NULL) { *BytesProcessed += BytesInTransfer; return PIPE_RWSTREAM_IncompleteTransfer; } - + USB_USBTask(); if ((ErrorCode = Pipe_WaitUntilReady())) @@ -113,7 +113,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length, else { Pipe_Write_8(0); - + Length--; BytesInTransfer++; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h old mode 100644 new mode 100755 index 7295f2a..ca63bdf --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -27,7 +27,7 @@ arising out of or in connection with the use or performance of this software. */ - + /** \file * \brief Pipe data stream transmission and reception management for the AVR8 microcontrollers * \copydetails Group_PipeStreamRW_AVR8 @@ -51,9 +51,9 @@ /* Includes: */ #include "../../../../Common/Common.h" - #include "../USBMode.h" + #include "../USBMode.h" #include "../USBTask.h" - + /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -63,7 +63,7 @@ #if !defined(__INCLUDE_FROM_USB_DRIVER) #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. #endif - + /* Public Interface - May be used in end-application: */ /* Function Prototypes: */ /** \name Stream functions for null data */ @@ -85,7 +85,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Discard_Stream(512, NULL)) != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -96,13 +96,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Discard_Stream(512, &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -137,7 +137,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Null_Stream(512, NULL)) != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -148,13 +148,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Null_Stream(512, &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -177,7 +177,7 @@ /** \name Stream functions for RAM source/destination data */ //@{ - + /** Writes the given number of bytes to the pipe from the given buffer in little endian, * sending full packets to the device as needed. The last packet filled is not automatically sent; * the user is responsible for manually sending the last written packet to the host via the @@ -198,7 +198,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Write_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != PIPE_RWSTREAM_NoError) * { @@ -211,14 +211,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Write_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -279,7 +279,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Read_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != PIPE_RWSTREAM_NoError) * { @@ -292,14 +292,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Read_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -343,7 +343,7 @@ /** \name Stream functions for EEPROM source/destination data */ //@{ - + /** EEPROM buffer source version of \ref Pipe_Write_Stream_LE(). * * \param[in] Buffer Pointer to the source data buffer to read from. @@ -356,7 +356,7 @@ uint8_t Pipe_Write_EStream_LE(const void* const Buffer, uint16_t Length, uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); - + /** EEPROM buffer source version of \ref Pipe_Write_Stream_BE(). * * \param[in] Buffer Pointer to the source data buffer to read from. @@ -382,7 +382,7 @@ uint8_t Pipe_Read_EStream_LE(void* const Buffer, uint16_t Length, uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); - + /** EEPROM buffer source version of \ref Pipe_Read_Stream_BE(). * * \param[out] Buffer Pointer to the source data buffer to write to. @@ -399,7 +399,7 @@ /** \name Stream functions for PROGMEM source/destination data */ //@{ - + /** FLASH buffer source version of \ref Pipe_Write_Stream_LE(). * * \pre The FLASH data must be located in the first 64KB of FLASH for this function to work correctly. @@ -414,7 +414,7 @@ uint8_t Pipe_Write_PStream_LE(const void* const Buffer, uint16_t Length, uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); - + /** FLASH buffer source version of \ref Pipe_Write_Stream_BE(). * * \pre The FLASH data must be located in the first 64KB of FLASH for this function to work correctly. @@ -435,7 +435,7 @@ #if defined(__cplusplus) } #endif - + #endif /** @} */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c old mode 100644 new mode 100755 index bd285db..20239d0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h old mode 100644 new mode 100755 index b396263..3521efb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c old mode 100644 new mode 100755 index ac8517f..f6c4beb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_R.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c old mode 100644 new mode 100755 index 453847a..922b58e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_Control_W.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -79,6 +79,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; + else if (Endpoint_IsSETUPReceived()) + return ENDPOINT_RWCSTREAM_HostAborted; } return ENDPOINT_RWCSTREAM_NoError; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c old mode 100644 new mode 100755 index 92b1a44..e55e592 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c old mode 100644 new mode 100755 index 4ecf6a7..bb2a57f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Template/Template_Pipe_RW.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c old mode 100644 new mode 100755 index 8faec1d..92532ab --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -112,7 +112,8 @@ void USB_Disable(void) if (!(USB_Options & USB_OPT_MANUAL_PLL)) USB_PLL_Off(); - USB_REG_Off(); + if (!(USB_Options & USB_OPT_REG_KEEP_ENABLED)) + USB_REG_Off(); #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) USB_OTGPAD_Off(); diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h old mode 100644 new mode 100755 index 1b72bf1..1b6e2ef --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -133,6 +133,14 @@ */ #define USB_OPT_REG_ENABLED (0 << 1) + /** Option mask for \ref USB_Init() to keep regulator enabled at all times. Indicates that \ref USB_Disable() + * should not disable the regulator as it would otherwise. Has no effect if regulator is disabled using + * \ref USB_OPT_REG_DISABLED. + * + * \note See USB AVR data sheet for more information on the internal pad regulator. + */ + #define USB_OPT_REG_KEEP_ENABLED (1 << 3) + /** Manual PLL control option mask for \ref USB_Init(). This indicates to the library that the user application * will take full responsibility for controlling the AVR's PLL (used to generate the high frequency clock * that the USB controller requires) and ensuring that it is locked at the correct frequency for USB operations. diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c old mode 100644 new mode 100755 index dcf4569..fac4fb4 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h old mode 100644 new mode 100755 index efc12f3..1eeb019 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.c old mode 100644 new mode 100755 index d23c3c8..d540bcf --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.h old mode 100644 new mode 100755 index ad3c987..5355ecf --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Device.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Device.h old mode 100644 new mode 100755 index 6162547..81b0e17 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Device.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Device.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -131,7 +131,7 @@ * \return Size in bytes of the descriptor if it exists, zero or \ref NO_DESCRIPTOR otherwise. */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, + const uint16_t wIndex, const void** const DescriptorAddress #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) || defined(__DOXYGEN__)) && \ !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS)) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.c old mode 100644 new mode 100755 index 3176e15..feb092d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -152,8 +152,8 @@ static void USB_Device_SetConfiguration(void) #define MemoryAddressSpace MEMSPACE_FLASH #elif defined(USE_EEPROM_DESCRIPTORS) #define MemoryAddressSpace MEMSPACE_EEPROM - #elif defined(USE_SRAM_DESCRIPTORS) - #define MemoryAddressSpace MEMSPACE_SRAM + #elif defined(USE_RAM_DESCRIPTORS) + #define MemoryAddressSpace MEMSPACE_RAM #else uint8_t MemoryAddressSpace; #endif @@ -292,6 +292,7 @@ static void USB_Device_GetStatus(void) switch (USB_ControlRequest.bmRequestType) { case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE): + { #if !defined(NO_DEVICE_SELF_POWER) if (USB_Device_CurrentlySelfPowered) CurrentStatus |= FEATURE_SELFPOWERED_ENABLED; @@ -302,9 +303,16 @@ static void USB_Device_GetStatus(void) 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); + uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); + + if (EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS) + return; + + Endpoint_SelectEndpoint(EndpointIndex); CurrentStatus = Endpoint_IsStalled(); @@ -312,6 +320,7 @@ static void USB_Device_GetStatus(void) #endif break; + } default: return; } @@ -330,20 +339,23 @@ static void USB_Device_ClearSetFeature(void) { #if !defined(NO_DEVICE_REMOTE_WAKEUP) case REQREC_DEVICE: + { if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup) USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature); else return; break; + } #endif #if !defined(CONTROL_ONLY_DEVICE) case REQREC_ENDPOINT: + { if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt) { uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); - if (EndpointIndex == ENDPOINT_CONTROLEP) + if (EndpointIndex == ENDPOINT_CONTROLEP || EndpointIndex >= ENDPOINT_TOTAL_ENDPOINTS) return; Endpoint_SelectEndpoint(EndpointIndex); @@ -364,6 +376,7 @@ static void USB_Device_ClearSetFeature(void) } break; + } #endif default: return; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.h old mode 100644 new mode 100755 index 21194b8..14badcd --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/DeviceStandardReq.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Endpoint.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Endpoint.h old mode 100644 new mode 100755 index 6a67e55..b577f63 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Endpoint.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Endpoint.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -98,7 +98,7 @@ uint8_t Type; /**< Type of the endpoint, a \c EP_TYPE_* mask. */ uint8_t Banks; /**< Number of hardware banks to use for the endpoint. */ } USB_Endpoint_Table_t; - + /* Macros: */ /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's * numerical address in the device. diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/EndpointStream.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/EndpointStream.h old mode 100644 new mode 100755 index 1c135b6..156d155 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/EndpointStream.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/EndpointStream.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.c old mode 100644 new mode 100755 index 535233a..e05fd74 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -37,3 +37,12 @@ void USB_Event_Stub(void) } +void USB_Event_Stub_2(const uint8_t _1) +{ + USB_Event_Stub(); +} + +void USB_Event_Stub_3(const uint8_t _1, const uint8_t _2) +{ + USB_Event_Stub(); +} diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.h old mode 100644 new mode 100755 index 77c01f0..d37bb30 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Events.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -331,20 +331,22 @@ #if !defined(__DOXYGEN__) /* Function Prototypes: */ #if defined(__INCLUDE_FROM_EVENTS_C) - void USB_Event_Stub(void) ATTR_CONST; + void USB_Event_Stub(void); + void USB_Event_Stub_2(const uint8_t _1); + void USB_Event_Stub_3(const uint8_t _1, const uint8_t _2); #if defined(USB_CAN_BE_BOTH) void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); #endif #if defined(USB_CAN_BE_HOST) - void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); + void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub_2); void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) - ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); + ATTR_WEAK ATTR_ALIAS(USB_Event_Stub_3); void EVENT_USB_Host_StartOfFrame(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); #endif diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Host.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Host.h old mode 100644 new mode 100755 index 7105788..50410b2 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Host.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Host.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.c old mode 100644 new mode 100755 index 2f8f86c..42a934d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -150,7 +150,7 @@ static uint8_t USB_Host_SendControlRequest_PRV(void* const BufferPtr) Pipe_ClearIN(); } - + return ReturnStatus; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.h old mode 100644 new mode 100755 index da6693e..6654269 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/OTG.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/OTG.h old mode 100644 new mode 100755 index cbdb001..6293e4c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/OTG.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/OTG.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Pipe.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Pipe.h old mode 100644 new mode 100755 index 1635739..0697078 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Pipe.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/Pipe.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/PipeStream.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/PipeStream.h old mode 100644 new mode 100755 index 0842eec..8785302 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/PipeStream.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/PipeStream.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdDescriptors.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdDescriptors.h old mode 100644 new mode 100755 index d7f0ca3..381c02c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdDescriptors.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdDescriptors.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -85,17 +85,34 @@ */ #define USB_STRING_LEN(UnicodeChars) (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1)) - /** Macro to encode a given four digit floating point version number (e.g. 01.23) into Binary Coded - * Decimal format for descriptor fields requiring BCD encoding, such as the USB version number in the - * standard device descriptor. + /** Convenience macro to easily create \ref USB_Descriptor_String_t instances from a wide character string. + * + * \note This macro is for little-endian systems only. + * + * \param[in] String String to initialize a USB String Descriptor structure with. + */ + #define USB_STRING_DESCRIPTOR(String) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String } + + /** Convenience macro to easily create \ref USB_Descriptor_String_t instances from an array of characters. + * + * \param[in] ... Characters to initialize a USB String Descriptor structure with. + */ + #define USB_STRING_DESCRIPTOR_ARRAY(...) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} } + + /** Macro to encode a given major/minor/revision version number into Binary Coded Decimal format for descriptor + * fields requiring BCD encoding, such as the USB version number in the standard device descriptor. * * \note This value is automatically converted into Little Endian, suitable for direct use inside device * descriptors on all architectures without endianness conversion macros. * - * \param[in] x Version number to encode as a 16-bit little-endian number, as a floating point number. + * \param[in] Major Major version number to encode. + * \param[in] Minor Minor version number to encode. + * \param[in] Revision Revision version number to encode. */ - #define VERSION_BCD(x) CPU_TO_LE16((VERSION_TENS(x) << 12) | (VERSION_ONES(x) << 8) | \ - (VERSION_TENTHS(x) << 4) | (VERSION_HUNDREDTHS(x) << 0) ) + #define VERSION_BCD(Major, Minor, Revision) \ + CPU_TO_LE16( ((Major & 0xFF) << 8) | \ + ((Minor & 0x0F) << 4) | \ + (Revision & 0x0F) ) /** String language ID for the English language. Should be used in \ref USB_Descriptor_String_t descriptors * to indicate that the English language is supported by the device in its string descriptors. @@ -736,14 +753,6 @@ */ } ATTR_PACKED USB_StdDescriptor_String_t; - /* Private Interface - For use in library only: */ - #if !defined(__DOXYGEN__) - /* Macros: */ - #define VERSION_TENS(x) (int)((int)(x) / 10) - #define VERSION_ONES(x) (int)((int)(x) % 10) - #define VERSION_TENTHS(x) (int)((x - (int)x) * 10) - #define VERSION_HUNDREDTHS(x) (int)((x * 100) - ((int)(x * 10) * 10)) - #endif /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdRequestType.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdRequestType.h old mode 100644 new mode 100755 index faecdec..7297806 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdRequestType.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/StdRequestType.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.c old mode 100644 new mode 100755 index 0e09791..3aa1433 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.h old mode 100644 new mode 100755 index 854e321..fd6dbde --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Device_UC3.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c old mode 100644 new mode 100755 index 082e929..04f6e97 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -44,10 +44,10 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + if ((ErrorCode = Endpoint_WaitUntilReady())) return ErrorCode; - + if (BytesProcessed != NULL) Length -= *BytesProcessed; @@ -74,7 +74,7 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length, BytesInTransfer++; } } - + return ENDPOINT_RWSTREAM_NoError; } @@ -83,10 +83,10 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + if ((ErrorCode = Endpoint_WaitUntilReady())) return ErrorCode; - + if (BytesProcessed != NULL) Length -= *BytesProcessed; @@ -113,7 +113,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, BytesInTransfer++; } } - + return ENDPOINT_RWSTREAM_NoError; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h old mode 100644 new mode 100755 index c946b72..8b1c10e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/EndpointStream_UC3.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -44,7 +44,7 @@ * and to endpoints. * * @{ - */ + */ #ifndef __ENDPOINT_STREAM_UC3_H__ #define __ENDPOINT_STREAM_UC3_H__ @@ -53,7 +53,7 @@ #include "../../../../Common/Common.h" #include "../USBMode.h" #include "../USBTask.h" - + /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -87,7 +87,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Discard_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -98,13 +98,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Discard_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -123,7 +123,7 @@ uint16_t* const BytesProcessed); /** Writes a given number of zeroed bytes to the currently selected endpoint's bank, sending - * full packets to the host as needed. The last packet is not automatically sent once the + * full packets to the host as needed. The last packet is not automatically sent once the * remaining bytes have been written; the user is responsible for manually sending the last * packet to the host via the \ref Endpoint_ClearIN() macro. * @@ -140,7 +140,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Null_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -151,13 +151,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Null_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -179,7 +179,7 @@ /** \name Stream functions for RAM source/destination data */ //@{ - + /** Writes the given number of bytes to the endpoint from the given buffer in little endian, * sending full packets to the host as needed. The last packet filled is not automatically sent; * the user is responsible for manually sending the last written packet to the host via the @@ -199,7 +199,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != ENDPOINT_RWSTREAM_NoError) * { @@ -212,14 +212,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -256,7 +256,7 @@ uint8_t Endpoint_Write_Stream_BE(const void* const Buffer, uint16_t Length, uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); - + /** Reads the given number of bytes from the endpoint from the given buffer in little endian, * discarding fully read packets from the host as needed. The last packet is not automatically * discarded once the remaining bytes has been read; the user is responsible for manually @@ -276,7 +276,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != ENDPOINT_RWSTREAM_NoError) * { @@ -289,14 +289,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -431,7 +431,7 @@ #if defined(__cplusplus) } #endif - + #endif /** @} */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c old mode 100644 new mode 100755 index 3c4b5a0..7e24672 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -52,13 +52,13 @@ bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, { if (!(Table[i].Address)) continue; - + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) { return false; } } - + return true; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h old mode 100644 new mode 100755 index 7e582ad..32d6a9b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.c old mode 100644 new mode 100755 index f71dc51..2c182ab --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -180,7 +180,7 @@ void USB_Host_ProcessNextHostState(void) EVENT_USB_Host_DeviceEnumerationComplete(); break; - + default: break; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.h old mode 100644 new mode 100755 index 19169ce..5338f72 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Host_UC3.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c old mode 100644 new mode 100755 index 89f0581..27426ad --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -43,7 +43,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + Pipe_SetPipeToken(PIPE_TOKEN_IN); if ((ErrorCode = Pipe_WaitUntilReady())) @@ -57,7 +57,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length, if (!(Pipe_IsReadWriteAllowed())) { Pipe_ClearIN(); - + if (BytesProcessed != NULL) { *BytesProcessed += BytesInTransfer; @@ -70,7 +70,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length, else { Pipe_Discard_8(); - + Length--; BytesInTransfer++; } @@ -84,7 +84,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + Pipe_SetPipeToken(PIPE_TOKEN_OUT); if ((ErrorCode = Pipe_WaitUntilReady())) @@ -98,13 +98,13 @@ uint8_t Pipe_Null_Stream(uint16_t Length, if (!(Pipe_IsReadWriteAllowed())) { Pipe_ClearOUT(); - + if (BytesProcessed != NULL) { *BytesProcessed += BytesInTransfer; return PIPE_RWSTREAM_IncompleteTransfer; } - + USB_USBTask(); if ((ErrorCode = Pipe_WaitUntilReady())) @@ -113,7 +113,7 @@ uint8_t Pipe_Null_Stream(uint16_t Length, else { Pipe_Write_8(0); - + Length--; BytesInTransfer++; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h old mode 100644 new mode 100755 index cd12b75..cc34442 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/PipeStream_UC3.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -27,7 +27,7 @@ arising out of or in connection with the use or performance of this software. */ - + /** \file * \brief Pipe data stream transmission and reception management for the AVR32 UC3 microcontrollers. * \copydetails Group_PipeStreamRW_UC3 @@ -53,7 +53,7 @@ #include "../../../../Common/Common.h" #include "../USBMode.h" #include "../USBTask.h" - + /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -63,7 +63,7 @@ #if !defined(__INCLUDE_FROM_USB_DRIVER) #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. #endif - + /* Public Interface - May be used in end-application: */ /* Function Prototypes: */ /** \name Stream functions for null data */ @@ -85,24 +85,24 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Discard_Stream(512, NULL)) != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here * } * \endcode - * + * * Partial Stream Transfers Example: * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Discard_Stream(512, &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -137,7 +137,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Null_Stream(512, NULL)) != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -148,13 +148,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Null_Stream(512, &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -177,7 +177,7 @@ /** \name Stream functions for RAM source/destination data */ //@{ - + /** Writes the given number of bytes to the pipe from the given buffer in little endian, * sending full packets to the device as needed. The last packet filled is not automatically sent; * the user is responsible for manually sending the last written packet to the host via the @@ -198,7 +198,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Write_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != PIPE_RWSTREAM_NoError) * { @@ -211,14 +211,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Write_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -279,7 +279,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Pipe_Read_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != PIPE_RWSTREAM_NoError) * { @@ -292,14 +292,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Pipe_Read_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == PIPE_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != PIPE_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -345,7 +345,7 @@ #if defined(__cplusplus) } #endif - + #endif /** @} */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c old mode 100644 new mode 100755 index c6e6f86..73cf360 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -50,13 +50,13 @@ bool Pipe_ConfigurePipeTable(const USB_Pipe_Table_t* const Table, { if (!(Table[i].Address)) continue; - + if (!(Pipe_ConfigurePipe(Table[i].Address, Table[i].Type, Table[i].EndpointAddress, Table[i].Size, Table[i].Banks))) { return false; } } - + return true; } @@ -68,7 +68,7 @@ bool Pipe_ConfigurePipe(const uint8_t Address, { uint8_t Number = (Address & PIPE_EPNUM_MASK); uint8_t Token = (Address & PIPE_DIR_IN) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT; - + if (Number >= PIPE_TOTAL_PIPES) return false; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h old mode 100644 new mode 100755 index a8cb29e..12e0dcd --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c old mode 100644 new mode 100755 index ac8517f..f6c4beb --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_R.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c old mode 100644 new mode 100755 index 453847a..922b58e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_Control_W.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -79,6 +79,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; + else if (Endpoint_IsSETUPReceived()) + return ENDPOINT_RWCSTREAM_HostAborted; } return ENDPOINT_RWCSTREAM_NoError; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c old mode 100644 new mode 100755 index 92b1a44..e55e592 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c old mode 100644 new mode 100755 index 4ecf6a7..bb2a57f --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/Template/Template_Pipe_RW.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c old mode 100644 new mode 100755 index a65dfc5..2b1e9ac --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -140,7 +140,7 @@ void USB_ResetInterface(void) #if defined(INVERTED_VBUS_ENABLE_LINE) AVR32_USBB.USBCON.vbuspo = true; #endif - + #if defined(USB_CAN_BE_HOST) AVR32_USBB.USBCON.uimod = false; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h old mode 100644 new mode 100755 index b76605a..32c2f6e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c old mode 100644 new mode 100755 index 6690e82..3b3958a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h old mode 100644 new mode 100755 index 75cb4dd..e2f67bf --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBController.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBController.h old mode 100644 new mode 100755 index 7702b74..5980a37 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBController.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBController.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBInterrupt.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBInterrupt.h old mode 100644 new mode 100755 index 61bcac5..b00ef7b --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBInterrupt.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBInterrupt.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBMode.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBMode.h old mode 100644 new mode 100755 index eadf641..2044f89 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBMode.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBMode.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -64,7 +64,7 @@ #if !defined(__INCLUDE_FROM_USB_DRIVER) #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. #endif - + /* Includes: */ #include "../../../Common/Common.h" diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.c old mode 100644 new mode 100755 index e68d3d0..329ff4a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.h old mode 100644 new mode 100755 index 9d7b7e5..77cee65 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/USBTask.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -186,9 +186,9 @@ #endif /* Macros: */ - #define HOST_TASK_NONBLOCK_WAIT(Duration, NextState) MACROS{ USB_HostState = HOST_STATE_WaitForDevice; \ - WaitMSRemaining = (Duration); \ - PostWaitState = (NextState); }MACROE + #define HOST_TASK_NONBLOCK_WAIT(Duration, NextState) do { USB_HostState = HOST_STATE_WaitForDevice; \ + WaitMSRemaining = (Duration); \ + PostWaitState = (NextState); } while (0) #endif /* Disable C linkage for C++ Compilers: */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c old mode 100644 new mode 100755 index 771a4fd..470e128 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h old mode 100644 new mode 100755 index 7b82c7c..759ff35 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Device_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c old mode 100644 new mode 100755 index 5683a36..6413281 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.c @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -44,10 +44,10 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + if ((ErrorCode = Endpoint_WaitUntilReady())) return ErrorCode; - + if (BytesProcessed != NULL) Length -= *BytesProcessed; @@ -74,7 +74,7 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length, BytesInTransfer++; } } - + return ENDPOINT_RWSTREAM_NoError; } @@ -83,10 +83,10 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, { uint8_t ErrorCode; uint16_t BytesInTransfer = 0; - + if ((ErrorCode = Endpoint_WaitUntilReady())) return ErrorCode; - + if (BytesProcessed != NULL) Length -= *BytesProcessed; @@ -113,7 +113,7 @@ uint8_t Endpoint_Null_Stream(uint16_t Length, BytesInTransfer++; } } - + return ENDPOINT_RWSTREAM_NoError; } diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h old mode 100644 new mode 100755 index 013d25a..3c094da --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/EndpointStream_XMEGA.h @@ -1,21 +1,21 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. - + Copyright (C) Dean Camera, 2017. + dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) - Permission to use, copy, modify, distribute, and sell this + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in + without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaims all warranties with regard to this @@ -44,16 +44,16 @@ * and to endpoints. * * @{ - */ + */ #ifndef __ENDPOINT_STREAM_XMEGA_H__ #define __ENDPOINT_STREAM_XMEGA_H__ /* Includes: */ #include "../../../../Common/Common.h" - #include "../USBMode.h" + #include "../USBMode.h" #include "../USBTask.h" - + /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { @@ -87,7 +87,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Discard_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -98,13 +98,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Discard_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -123,7 +123,7 @@ uint16_t* const BytesProcessed); /** Writes a given number of zeroed bytes to the currently selected endpoint's bank, sending - * full packets to the host as needed. The last packet is not automatically sent once the + * full packets to the host as needed. The last packet is not automatically sent once the * remaining bytes have been written; the user is responsible for manually sending the last * packet to the host via the \ref Endpoint_ClearIN() macro. * @@ -140,7 +140,7 @@ * Single Stream Transfer Example: * \code * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Null_Stream(512, NULL)) != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -151,13 +151,13 @@ * \code * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Null_Stream(512, &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -179,7 +179,7 @@ /** \name Stream functions for RAM source/destination data */ //@{ - + /** Writes the given number of bytes to the endpoint from the given buffer in little endian, * sending full packets to the host as needed. The last packet filled is not automatically sent; * the user is responsible for manually sending the last written packet to the host via the @@ -199,7 +199,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != ENDPOINT_RWSTREAM_NoError) * { @@ -212,14 +212,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Write_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -256,7 +256,7 @@ uint8_t Endpoint_Write_Stream_BE(const void* const Buffer, uint16_t Length, uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1); - + /** Reads the given number of bytes from the endpoint from the given buffer in little endian, * discarding fully read packets from the host as needed. The last packet is not automatically * discarded once the remaining bytes has been read; the user is responsible for manually @@ -276,7 +276,7 @@ * \code * uint8_t DataStream[512]; * uint8_t ErrorCode; - * + * * if ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream), * NULL)) != ENDPOINT_RWSTREAM_NoError) * { @@ -289,14 +289,14 @@ * uint8_t DataStream[512]; * uint8_t ErrorCode; * uint16_t BytesProcessed; - * + * * BytesProcessed = 0; * while ((ErrorCode = Endpoint_Read_Stream_LE(DataStream, sizeof(DataStream), * &BytesProcessed)) == ENDPOINT_RWSTREAM_IncompleteTransfer) * { * // Stream not yet complete - do other actions here, abort if required * } - * + * * if (ErrorCode != ENDPOINT_RWSTREAM_NoError) * { * // Stream failed to complete - check ErrorCode here @@ -651,7 +651,7 @@ #if defined(__cplusplus) } #endif - + #endif /** @} */ diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c old mode 100644 new mode 100755 index b8a80a4..470f57e --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h old mode 100644 new mode 100755 index 4ebe0ce..db7d840 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c old mode 100644 new mode 100755 index 39e7497..b8b8c46 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Host_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c old mode 100644 new mode 100755 index 39e7497..b8b8c46 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/PipeStream_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c old mode 100644 new mode 100755 index 5993bd9..bb92b1d --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Pipe_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c old mode 100644 new mode 100755 index ebc8c1c..c923f31 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_R.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c old mode 100644 new mode 100755 index ee99de7..b32de81 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_Control_W.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -81,6 +81,8 @@ uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, return ENDPOINT_RWCSTREAM_DeviceDisconnected; else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) return ENDPOINT_RWCSTREAM_BusSuspended; + else if (Endpoint_IsSETUPReceived()) + return ENDPOINT_RWCSTREAM_HostAborted; } return ENDPOINT_RWCSTREAM_NoError; diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c old mode 100644 new mode 100755 index 92b1a44..e55e592 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c old mode 100644 new mode 100755 index 979f095..4eea57a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -109,15 +109,26 @@ void USB_Disable(void) void USB_ResetInterface(void) { + uint8_t PrescalerNeeded; + #if defined(USB_DEVICE_OPT_FULLSPEED) if (USB_Options & USB_DEVICE_OPT_LOWSPEED) - CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp); + PrescalerNeeded = F_USB / 6000000; else - CLK.USBCTRL = (((F_USB / 48000000) - 1) << CLK_USBPSDIV_gp); + PrescalerNeeded = F_USB / 48000000; #else - CLK.USBCTRL = (((F_USB / 6000000) - 1) << CLK_USBPSDIV_gp); + PrescalerNeeded = F_USB / 6000000; #endif + uint8_t DividerIndex = 0; + while (PrescalerNeeded > 0) + { + DividerIndex++; + PrescalerNeeded >>= 1; + } + + CLK.USBCTRL = (DividerIndex - 1) << CLK_USBPSDIV_gp; + if (USB_Options & USB_OPT_PLLCLKSRC) CLK.USBCTRL |= (CLK_USBSRC_PLL_gc | CLK_USBSEN_bm); else diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h old mode 100644 new mode 100755 index 5128820..6bab03a --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBController_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c old mode 100644 new mode 100755 index 9651193..a82dde0 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h old mode 100644 new mode 100755 index e0337ab..54ee7f1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/USB.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/USB.h old mode 100644 new mode 100755 index 6899591..87c098c --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/USB.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Drivers/USB/USB.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/License.txt b/Firmware/Chameleon-Mini/src/LUFA/LUFA/License.txt old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/Platform.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/Platform.h old mode 100644 new mode 100755 index 0eb83cb..9997d79 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/Platform.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/Platform.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/ClockManagement.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/ClockManagement.h old mode 100644 new mode 100755 index 2b1ed56..5f286d5 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/ClockManagement.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/ClockManagement.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/Exception.S b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/Exception.S old mode 100644 new mode 100755 index ffcf0cc..59f16f1 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/Exception.S +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/Exception.S @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.c b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.c old mode 100644 new mode 100755 index bd3d1c9..b99be24 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.c +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.h old mode 100644 new mode 100755 index e1f64fc..b051930 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/InterruptManagement.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/UC3ExperimentalInfo.txt b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/UC3/UC3ExperimentalInfo.txt old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/XMEGA/ClockManagement.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/XMEGA/ClockManagement.h old mode 100644 new mode 100755 index fdcc52e..eb941d9 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/XMEGA/ClockManagement.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/XMEGA/ClockManagement.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -171,8 +171,8 @@ * * \return Boolean \c true if the internal oscillator was successfully started, \c false if invalid parameters specified. */ - static inline uint8_t XMEGACLK_StartInternalOscillator(const uint8_t Source) ATTR_ALWAYS_INLINE; - static inline uint8_t XMEGACLK_StartInternalOscillator(const uint8_t Source) + static inline bool XMEGACLK_StartInternalOscillator(const uint8_t Source) ATTR_ALWAYS_INLINE; + static inline bool XMEGACLK_StartInternalOscillator(const uint8_t Source) { switch (Source) { @@ -286,7 +286,7 @@ const uint8_t Reference, const uint32_t Frequency) { - uint16_t DFLLCompare = (Frequency / 1000); + uint16_t DFLLCompare = (Frequency / 1024); switch (Source) { diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/XMEGA/XMEGAExperimentalInfo.txt b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Platform/XMEGA/XMEGAExperimentalInfo.txt old mode 100644 new mode 100755 diff --git a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Version.h b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Version.h old mode 100644 new mode 100755 index 24869fb..03cb084 --- a/Firmware/Chameleon-Mini/src/LUFA/LUFA/Version.h +++ b/Firmware/Chameleon-Mini/src/LUFA/LUFA/Version.h @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2013. + Copyright (C) Dean Camera, 2017. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -42,11 +42,26 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ - /** Indicates the version number of the library, as an integer. */ - #define LUFA_VERSION_INTEGER 0x130901 + /** \name LUFA Release Type Constants */ + //@{ + /** Constant for \ref LUFA_VERSION_RELEASE_TYPE indicating a development release. */ + #define LUFA_VERSION_RELEASE_TYPE_DEVELOPMENT 0 - /** Indicates the version number of the library, as a string. */ - #define LUFA_VERSION_STRING "130901" + /** Constant for \ref LUFA_VERSION_RELEASE_TYPE indicating a beta release. */ + #define LUFA_VERSION_RELEASE_TYPE_BETA 1 + + /** Constant for \ref LUFA_VERSION_RELEASE_TYPE indicating a full official release. */ + #define LUFA_VERSION_RELEASE_TYPE_FULL 2 + //@} + + /** Indicates the version number of the library, as an integer. \note This value is only updates in non-development releases. */ + #define LUFA_VERSION_INTEGER 0x170418 + + /** Indicates the version number of the library, as a string. \note This value is only updates in non-development releases. */ + #define LUFA_VERSION_STRING "170418" + + /** Indicates the release type of the library. */ + #define LUFA_VERSION_RELEASE_TYPE LUFA_VERSION_RELEASE_TYPE_FULL #endif