diff --git a/Firmware/Chameleon-Mini/.cproject b/Firmware/Chameleon-Mini/.cproject index ecd4de3..b4bc4a5 100644 --- a/Firmware/Chameleon-Mini/.cproject +++ b/Firmware/Chameleon-Mini/.cproject @@ -1,73 +1,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - program - true - true - true - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firmware/Chameleon-Mini/.project b/Firmware/Chameleon-Mini/.project index 7b77bcf..884aab5 100644 --- a/Firmware/Chameleon-Mini/.project +++ b/Firmware/Chameleon-Mini/.project @@ -9,6 +9,58 @@ org.eclipse.cdt.managedbuilder.core.genmakebuilder clean,full,incremental, + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + @@ -20,15 +72,8 @@ org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + de.innot.avreclipse.core.avrnature - - - Doxyfile - 1 - PARENT-2-PROJECT_LOC/Doc/Doxyfile - - diff --git a/Firmware/Chameleon-Mini/AntennaLevel.h b/Firmware/Chameleon-Mini/AntennaLevel.h index 1b390f0..4053e03 100644 --- a/Firmware/Chameleon-Mini/AntennaLevel.h +++ b/Firmware/Chameleon-Mini/AntennaLevel.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * AntennaLevel.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 24.11.2013 + * Author: skuser */ #ifndef ANTENNALEVEL_H_ diff --git a/Firmware/Chameleon-Mini/Application/Application.h b/Firmware/Chameleon-Mini/Application/Application.h index 7b7df2f..fd72214 100644 --- a/Firmware/Chameleon-Mini/Application/Application.h +++ b/Firmware/Chameleon-Mini/Application/Application.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Application.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 18.02.2013 + * Author: skuser */ #ifndef APPLICATION_H_ @@ -58,10 +10,13 @@ #include "../Common.h" #include "../Configuration.h" +#include "../Log.h" /* Applications */ +#include "MifareUltralight.h" #include "MifareClassic.h" + /* Function wrappers */ INLINE void ApplicationInit(void) { ActiveConfiguration.ApplicationInitFunc(); @@ -77,6 +32,7 @@ INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { INLINE void ApplicationReset(void) { ActiveConfiguration.ApplicationResetFunc(); + //LogEntry(LOG_INFO_APP_RESET, NULL, 0); } INLINE void ApplicationGetUid(ConfigurationUidType Uid) { diff --git a/Firmware/Chameleon-Mini/Application/Crypto1.c b/Firmware/Chameleon-Mini/Application/Crypto1.c index cd41a1e..20b5b67 100644 --- a/Firmware/Chameleon-Mini/Application/Crypto1.c +++ b/Firmware/Chameleon-Mini/Application/Crypto1.c @@ -1,58 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "Crypto1.h" #define PRNG_MASK 0x002D0000UL diff --git a/Firmware/Chameleon-Mini/Application/Crypto1.h b/Firmware/Chameleon-Mini/Application/Crypto1.h index 5d8d964..4c882b1 100644 --- a/Firmware/Chameleon-Mini/Application/Crypto1.h +++ b/Firmware/Chameleon-Mini/Application/Crypto1.h @@ -1,58 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #ifndef CRYPTO1_H #define CRYPTO1_H diff --git a/Firmware/Chameleon-Mini/Application/ISO14443-3A.c b/Firmware/Chameleon-Mini/Application/ISO14443-3A.c index 090a0bd..25a226b 100644 --- a/Firmware/Chameleon-Mini/Application/ISO14443-3A.c +++ b/Firmware/Chameleon-Mini/Application/ISO14443-3A.c @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * ISO14443A.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 19.03.2013 + * Author: skuser */ #include "ISO14443-3A.h" diff --git a/Firmware/Chameleon-Mini/Application/ISO14443-3A.h b/Firmware/Chameleon-Mini/Application/ISO14443-3A.h index e38860c..939901a 100644 --- a/Firmware/Chameleon-Mini/Application/ISO14443-3A.h +++ b/Firmware/Chameleon-Mini/Application/ISO14443-3A.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * ISO14443-2A.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 19.03.2013 + * Author: skuser */ #ifndef ISO14443_3A_H_ diff --git a/Firmware/Chameleon-Mini/Application/MifareClassic.c b/Firmware/Chameleon-Mini/Application/MifareClassic.c index 1d532cb..1486be3 100644 --- a/Firmware/Chameleon-Mini/Application/MifareClassic.c +++ b/Firmware/Chameleon-Mini/Application/MifareClassic.c @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * MifareClassic.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 13.05.2013 + * Author: skuser */ #include "MifareClassic.h" @@ -62,13 +14,18 @@ #include "../Random.h" #define MFCLASSIC_1K_ATQA_VALUE 0x0004 +#define MFPlus_ATQA_VALUE 0x0044 #define MFCLASSIC_4K_ATQA_VALUE 0x0002 #define MFCLASSIC_1K_SAK_CL1_VALUE 0x08 #define MFCLASSIC_4K_SAK_CL1_VALUE 0x18 +#define SAK_CL1_VALUE ISO14443A_SAK_INCOMPLETE +#define SAK_CL2_VALUE ISO14443A_SAK_COMPLETE_NOT_COMPLIANT #define MEM_UID_CL1_ADDRESS 0x00 #define MEM_UID_CL1_SIZE 4 #define MEM_UID_BCC1_ADDRESS 0x04 +#define MEM_UID_CL2_ADDRESS 0x03 +#define MEM_UID_CL2_SIZE 4 #define MEM_KEY_A_OFFSET 48 /* Bytes */ #define MEM_KEY_B_OFFSET 58 /* Bytes */ #define MEM_KEY_SIZE 6 /* Bytes */ @@ -105,11 +62,17 @@ #define CMD_RESTORE_FRAME_SIZE 2 /* Bytes without CRCA */ #define CMD_TRANSFER 0xB0 #define CMD_TRANSFER_FRAME_SIZE 2 /* Bytes without CRCA */ +#define CMD_CHINESE_UNLOCK 0x40 +#define CMD_CHINESE_WIPE 0x41 +#define CMD_CHINESE_UNLOCK_RW 0x43 static enum { STATE_HALT, STATE_IDLE, - STATE_READY, + STATE_CHINESE_IDLE, + STATE_CHINESE_WRITE, + STATE_READY1, + STATE_READY2, STATE_ACTIVE, STATE_AUTHING, STATE_AUTHED_IDLE, @@ -126,6 +89,8 @@ static uint8_t BlockBuffer[MEM_BYTES_PER_BLOCK]; static uint16_t CardATQAValue; static uint8_t CardSAKValue; +static uint8_t _7BUID = 0x00; + INLINE bool CheckValueIntegrity(uint8_t* Block) { /* Value Blocks contain a value stored three times, with @@ -173,6 +138,16 @@ void MifareClassicAppInit1K(void) State = STATE_IDLE; CardATQAValue = MFCLASSIC_1K_ATQA_VALUE; CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; + _7BUID = 0x00; +} + +void MifarePlus1kAppInit_7B(void) +{ + State = STATE_IDLE; + CardATQAValue = MFPlus_ATQA_VALUE; + CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; + uint8_t UidSize = ActiveConfiguration.UidSize; + _7BUID = (UidSize == 7); } void MifareClassicAppInit4K(void) @@ -180,6 +155,7 @@ void MifareClassicAppInit4K(void) State = STATE_IDLE; CardATQAValue = MFCLASSIC_4K_ATQA_VALUE; CardSAKValue = MFCLASSIC_4K_SAK_CL1_VALUE; + _7BUID = 0x00; } void MifareClassicAppReset(void) @@ -198,22 +174,109 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) case STATE_IDLE: case STATE_HALT: if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - State = STATE_READY; + State = STATE_READY1; return BitCount; } +#ifdef SUPPORT_MF_CLASSIC_MAGIC_MODE + else if (Buffer[0] == CMD_CHINESE_UNLOCK) { + State = STATE_CHINESE_IDLE; + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } +#endif + break; + +#ifdef SUPPORT_MF_CLASSIC_MAGIC_MODE + case STATE_CHINESE_IDLE: + /* Support special china commands that dont require authentication. */ + if (Buffer[0] == CMD_CHINESE_UNLOCK_RW) { + /* Unlock read and write commands */ + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_CHINESE_WIPE) { + /* Wipe memory */ + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_READ) { + if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { + /* 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); + + return (CMD_READ_RESPONSE_FRAME_SIZE + ISO14443A_CRCA_SIZE ) + * BITS_PER_BYTE; + } else { + Buffer[0] = NAK_CRC_ERROR; + return ACK_NAK_FRAME_SIZE; + } + } else if (Buffer[0] == CMD_WRITE) { + if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { + /* Write command. Store the address and prepare for the upcoming data. + * Respond with ACK. */ + CurrentAddress = Buffer[1]; + State = STATE_CHINESE_WRITE; + + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else { + Buffer[0] = NAK_CRC_ERROR; + return ACK_NAK_FRAME_SIZE; + } + } else if (Buffer[0] == CMD_HALT) { + /* Halts the tag. According to the ISO14443, the second + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { + /* 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; + return ACK_NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_INVALID_ARG; + return ACK_NAK_FRAME_SIZE; + } + } break; - case STATE_READY: + case STATE_CHINESE_WRITE: + if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { + /* CRC check passed. Write data into memory and send ACK. */ + if (!ActiveConfiguration.ReadOnly) { + MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + } + + Buffer[0] = ACK_VALUE; + } else { + /* CRC Error. */ + Buffer[0] = NAK_CRC_ERROR; + } + + State = STATE_CHINESE_IDLE; + + return ACK_NAK_FRAME_SIZE; +#endif + + case STATE_READY1: if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - State = STATE_READY; + State = STATE_READY1; return BitCount; } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { /* Load UID CL1 and perform anticollision */ - uint8_t UidCL1[4]; - MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - - if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) { - State = STATE_ACTIVE; + 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; + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) + State = STATE_READY2; + } else { + MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) + State = STATE_ACTIVE; } return BitCount; @@ -223,9 +286,29 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) } break; + case STATE_READY2: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + State = STATE_READY1; + return BitCount; + } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL2) { + /* Load UID CL2 and perform anticollision */ + uint8_t UidCL2[ISO14443A_CL_UID_SIZE]; + MemoryReadBlock(UidCL2, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + + if (ISO14443ASelect(Buffer, &BitCount, UidCL2, CardSAKValue)) { + State = STATE_ACTIVE; + } + + return BitCount; + } else { + /* Unknown command. Enter HALT state. */ + State = STATE_HALT; + } + break; + case STATE_ACTIVE: - if (ISO14443AWakeUp(Buffer, &BitCount, MFCLASSIC_1K_ATQA_VALUE)) { - State = STATE_READY; + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + State = STATE_READY1; return BitCount; } else if (Buffer[0] == CMD_HALT) { /* Halts the tag. According to the ISO14443, the second @@ -255,7 +338,10 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) /* Generate a random nonce and read UID and key from memory */ RandomGetBuffer(CardNonce, sizeof(CardNonce)); - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + if (_7BUID) + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); /* Precalculate the reader response from card-nonce */ @@ -416,7 +502,10 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) /* Generate a random nonce and read UID and key from memory */ RandomGetBuffer(CardNonce, sizeof(CardNonce)); - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + if (_7BUID) + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); /* Precalculate the reader response from card-nonce */ @@ -538,15 +627,27 @@ uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) void MifareClassicGetUid(ConfigurationUidType Uid) { - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + if (_7BUID) { + //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); } void MifareClassicSetUid(ConfigurationUidType Uid) { - uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; + if (_7BUID) { + //Uid[0]=0x88; + MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, ActiveConfiguration.UidSize); + } + else { + uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; - MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); + MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); + } } diff --git a/Firmware/Chameleon-Mini/Application/MifareClassic.h b/Firmware/Chameleon-Mini/Application/MifareClassic.h index 756ccaa..fcfe1e1 100644 --- a/Firmware/Chameleon-Mini/Application/MifareClassic.h +++ b/Firmware/Chameleon-Mini/Application/MifareClassic.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * MifareClassic.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 13.05.2013 + * Author: skuser */ #ifndef MIFARECLASSIC_H_ @@ -64,6 +16,7 @@ #define MIFARE_CLASSIC_4K_MEM_SIZE 4096 void MifareClassicAppInit1K(void); +void MifarePlus1kAppInit_7B(void); void MifareClassicAppInit4K(void); void MifareClassicAppReset(void); void MifareClassicAppTask(void); diff --git a/Firmware/Chameleon-Mini/Application/MifareUltralight.c b/Firmware/Chameleon-Mini/Application/MifareUltralight.c new file mode 100644 index 0000000..a31a13b --- /dev/null +++ b/Firmware/Chameleon-Mini/Application/MifareUltralight.c @@ -0,0 +1,288 @@ +/* + * MifareUltralight.c + * + * Created on: 20.03.2013 + * Author: skuser + */ + +#include "MifareUltralight.h" +#include "ISO14443-3A.h" +#include "../Codec/ISO14443-2A.h" +#include "../Memory.h" + + +#define ATQA_VALUE 0x0044 +#define SAK_CL1_VALUE ISO14443A_SAK_INCOMPLETE +#define SAK_CL2_VALUE ISO14443A_SAK_COMPLETE_NOT_COMPLIANT + +#define ACK_VALUE 0x0A +#define ACK_FRAME_SIZE 4 /* Bits */ +#define NAK_INVALID_ARG 0x00 +#define NAK_CRC_ERROR 0x01 +#define NAK_EEPROM_ERROR 0x05 +#define NAK_OTHER_ERROR 0x06 +#define NAK_FRAME_SIZE 4 + +#define CMD_READ 0x30 +#define CMD_READ_FRAME_SIZE 2 /* without CRC bytes */ +#define CMD_WRITE 0xA2 +#define CMD_WRITE_FRAME_SIZE 6 /* without CRC bytes */ +#define CMD_COMPAT_WRITE 0xA0 +#define CMD_COMPAT_WRITE_FRAME_SIZE 2 +#define CMD_HALT 0x50 + +#define UID_CL1_ADDRESS 0x00 /* In Card Memory */ +#define UID_CL1_SIZE 3 /* In Bytes */ +#define UID_BCC1_ADDRESS 0x03 +#define UID_CL2_ADDRESS 0x04 +#define UID_CL2_SIZE 4 +#define UID_BCC2_ADDRESS 0x08 + +#define BYTES_PER_PAGE 4 +#define PAGE_ADDRESS_MASK 0x0F + +#define BYTES_PER_READ 16 +#define PAGE_READ_MIN 0x00 +#define PAGE_READ_MAX 0x0F + +#define BYTES_PER_WRITE 4 +#define PAGE_WRITE_MIN 0x02 +#define PAGE_WRITE_MAX 0x0F + +#define BYTES_PER_COMPAT_WRITE 16 + +static enum { + STATE_HALT, + STATE_IDLE, + STATE_READY1, + STATE_READY2, + STATE_ACTIVE, + STATE_COMPAT_WRITE +} State; + +static uint8_t CompatWritePageAddress; + +void MifareUltralightAppInit(void) +{ + State = STATE_IDLE; +} + +void MifareUltralightAppReset(void) +{ + State = STATE_IDLE; +} + +void MifareUltralightAppTask(void) +{ + +} + + +uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + uint8_t Cmd = Buffer[0]; + + switch(State) { + case STATE_IDLE: + case STATE_HALT: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + /* We received a REQA or WUPA command, so wake up. */ + State = STATE_READY1; + return BitCount; + } + break; + + case STATE_READY1: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + return BitCount; + } else if (Cmd == ISO14443A_CMD_SELECT_CL1) { + /* 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 }; + + MemoryReadBlock(&UidCL1[1], UID_CL1_ADDRESS, UID_CL1_SIZE); + + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) { + /* CL1 stage has ended successfully */ + State = STATE_READY2; + } + + return BitCount; + } else { + /* Unknown command. Enter halt state */ + State = STATE_IDLE; + } + break; + + case STATE_READY2: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + return BitCount; + } else if (Cmd == ISO14443A_CMD_SELECT_CL2) { + /* Load UID CL2 and perform anticollision */ + uint8_t UidCL2[ISO14443A_CL_UID_SIZE]; + + MemoryReadBlock(UidCL2, UID_CL2_ADDRESS, UID_CL2_SIZE); + + 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; + } + + return BitCount; + } else { + /* Unknown command. Enter halt state */ + State = STATE_IDLE; + } + break; + + case STATE_ACTIVE: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + return BitCount; + } else if (Cmd == CMD_READ) { + uint8_t PageAddress = Buffer[1]; + + if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { + if ( (PageAddress >= PAGE_READ_MIN) + && (PageAddress <= PAGE_READ_MAX) ) { + /* TODO: Missing address wrap around behaviour. + * Implement using a for-loop copying 4 bytes each iteration + * and mask pageaddress */ + MemoryReadBlock(Buffer, PageAddress * BYTES_PER_PAGE, BYTES_PER_READ); + ISO14443AAppendCRCA(Buffer, BYTES_PER_READ); + return (BYTES_PER_READ + ISO14443A_CRCA_SIZE) * 8; + } else { + Buffer[0] = NAK_INVALID_ARG; + return NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else if (Cmd == 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]; + if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { + /* CRC check passed */ + if ( (PageAddress >= PAGE_WRITE_MIN) + && (PageAddress <= PAGE_WRITE_MAX) ) { + /* PageAddress is within bounds. */ + + if (!ActiveConfiguration.ReadOnly) { + MemoryWriteBlock(&Buffer[2], PageAddress * BYTES_PER_PAGE, BYTES_PER_WRITE); + } else { + /* If the chameleon is in read only mode, it silently + * ignores any attempt to write data. */ + } + + Buffer[0] = ACK_VALUE; + return ACK_FRAME_SIZE; + + } else { + Buffer[0] = NAK_INVALID_ARG; + return NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else if (Cmd == CMD_COMPAT_WRITE) { + /* The Mifare compatbility write command is a 2-frame command. + * The first frame contains the page-address and the second frame + * holds the data. */ + uint8_t PageAddress = Buffer[1]; + + if (ISO14443ACheckCRCA(Buffer, CMD_COMPAT_WRITE_FRAME_SIZE)) { + if ( (PageAddress >= PAGE_WRITE_MIN) + && (PageAddress <= PAGE_WRITE_MAX) ) { + /* CRC check passed and page-address is within bounds. + * Store address and proceed to receiving the data. */ + CompatWritePageAddress = PageAddress; + State = STATE_COMPAT_WRITE; + + Buffer[0] = ACK_VALUE; + return ACK_FRAME_SIZE; + } else { + Buffer[0] = NAK_INVALID_ARG; + return NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else if (Cmd == CMD_HALT) { + /* Halts the tag. According to the ISO14443, the second + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + if (ISO14443ACheckCRCA(Buffer, 2)) { + /* 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; + return NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_INVALID_ARG; + return NAK_FRAME_SIZE; + } + } else { + /* Unknown command. Enter halt state */ + State = STATE_IDLE; + } + break; + + case STATE_COMPAT_WRITE: + /* Compatibility write. Receiving 16 bytes of data of which 4 bytes are valid. */ + if (ISO14443ACheckCRCA(Buffer, BYTES_PER_COMPAT_WRITE)) { + /* We don't perform any checks here. You will be able to program the + * whole memory. Also there is no OTP behaviour. */ + if (!ActiveConfiguration.ReadOnly) { + MemoryWriteBlock(Buffer, CompatWritePageAddress * BYTES_PER_PAGE, BYTES_PER_WRITE); + } else { + /* If we are told to be read only, we silently ignore the write command + * and pretend to have written data. */ + } + + State = STATE_ACTIVE; + Buffer[0] = ACK_VALUE; + return ACK_FRAME_SIZE; + } else { + State = STATE_ACTIVE; + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + + default: + /* Unknown state? Should never happen. */ + break; + } + + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; +} + +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); +} + +void MifareUltralightSetUid(ConfigurationUidType Uid) +{ + /* Calculate check bytes and write everything into memory */ + uint8_t BCC1 = ISO14443A_UID0_CT ^ Uid[0] ^ Uid[1] ^ Uid[2]; + uint8_t BCC2 = Uid[3] ^ Uid[4] ^ Uid[5] ^ Uid[6]; + + MemoryWriteBlock(&Uid[0], UID_CL1_ADDRESS, UID_CL1_SIZE); + MemoryWriteBlock(&BCC1, UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); + MemoryWriteBlock(&Uid[UID_CL1_SIZE], UID_CL2_ADDRESS, UID_CL2_SIZE); + MemoryWriteBlock(&BCC2, UID_BCC2_ADDRESS, ISO14443A_CL_BCC_SIZE); +} diff --git a/Firmware/Chameleon-Mini/Application/MifareUltralight.h b/Firmware/Chameleon-Mini/Application/MifareUltralight.h new file mode 100644 index 0000000..a1a5b85 --- /dev/null +++ b/Firmware/Chameleon-Mini/Application/MifareUltralight.h @@ -0,0 +1,28 @@ +/* + * MifareUltralight.h + * + * Created on: 20.03.2013 + * Author: skuser + */ + +#ifndef MIFAREULTRALIGHT_H_ +#define MIFAREULTRALIGHT_H_ + +#include "Application.h" +#include "ISO14443-3A.h" + +#define MIFARE_ULTRALIGHT_UID_SIZE ISO14443A_UID_SIZE_DOUBLE +#define MIFARE_ULTRALIGHT_MEM_SIZE 64 + +void MifareUltralightAppInit(void); +void MifareUltralightAppReset(void); +void MifareUltralightAppTask(void); + +uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount); + +void MifareUltralightGetUid(ConfigurationUidType Uid); +void MifareUltralightSetUid(ConfigurationUidType Uid); + + + +#endif /* MIFAREULTRALIGHT_H_ */ diff --git a/Firmware/Chameleon-Mini/Button.c b/Firmware/Chameleon-Mini/Button.c index 8daafd0..da57861 100644 --- a/Firmware/Chameleon-Mini/Button.c +++ b/Firmware/Chameleon-Mini/Button.c @@ -1,64 +1,11 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "Button.h" #include "Random.h" #include "Common.h" #include "Settings.h" #include "Memory.h" +#define LONG_PRESS_TICK_COUNT 10 + static const char PROGMEM ButtonActionTable[][32] = { [BUTTON_ACTION_NONE] = "NONE", @@ -72,6 +19,97 @@ static const char PROGMEM ButtonActionTable[][32] = [BUTTON_ACTION_RECALL_MEM] = "RECALL_MEM", }; +static void ExecuteButtonAction(ButtonActionEnum ButtonAction) +{ + uint8_t UidBuffer[32]; + + if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { + for (uint8_t i=0; i 0) { + if (Carry) { + if (UidBuffer[i] == 0xFF) { + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i 0) { + if (Carry) { + if (UidBuffer[i] == 0x00) { + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { + SettingsCycle(); + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + MemoryStore(); + } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { + MemoryRecall(); + } +} + void ButtonInit(void) { BUTTON_PORT.DIRCLR = BUTTON_MASK; @@ -80,101 +118,31 @@ void ButtonInit(void) void ButtonTick(void) { - static uint8_t LastButtonState = 0; + static uint8_t PressTickCounter = 0; uint8_t ThisButtonState = ~BUTTON_PORT.IN; - uint8_t ThisButtonChange = ThisButtonState ^ LastButtonState; - uint8_t ThisButtonPress = ThisButtonChange & ThisButtonState; - LastButtonState = ThisButtonState; - if ( ThisButtonPress & BUTTON_MASK ) { - uint8_t UidBuffer[32]; - ButtonActionEnum ButtonAction = GlobalSettings.ActiveSettingPtr->ButtonAction; + if (ThisButtonState & BUTTON_MASK) { + /* Button is currently pressed */ + if (PressTickCounter < LONG_PRESS_TICK_COUNT) { + /* Count ticks while button is being pressed */ + PressTickCounter++; + } else if (PressTickCounter == LONG_PRESS_TICK_COUNT) { + /* Long button press detected execute button action and advance PressTickCounter + * to an invalid state. */ + ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonLongAction); + PressTickCounter++; + } else { + /* 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) ) { + /* We have a short button press */ + ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonAction); + } - if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { - for (uint8_t i=0; i 0) { - if (Carry) { - if (UidBuffer[i] == 0xFF) { - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; - } - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { - ApplicationGetUid(UidBuffer); - bool Carry = 1; - uint8_t i; - - for (i=0; i 0) { - if (Carry) { - if (UidBuffer[i] == 0x00) { - Carry = 1; - } else { - Carry = 0; - } - - UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; - } - } - - ApplicationSetUid(UidBuffer); - } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { - SettingsCycle(); - } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { - MemoryStore(); - } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { - MemoryRecall(); - } + PressTickCounter = 0; } } @@ -207,30 +175,45 @@ void ButtonGetActionList(char* ListOut, uint16_t BufferSize) *ListOut = '\0'; } -void ButtonSetActionById(ButtonActionEnum Action) +void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action) { #ifndef BUTTON_SETTING_GLOBAL - GlobalSettings.ActiveSettingPtr->ButtonAction = Action; + if (Type == BUTTON_PRESS_SHORT) { + GlobalSettings.ActiveSettingPtr->ButtonAction = Action; + } else if (Type == BUTTON_PRESS_LONG) { + GlobalSettings.ActiveSettingPtr->ButtonLongAction = Action; + } #else /* Write button action to all settings when using global settings */ for (uint8_t i=0; iButtonAction], BufferSize); + if (Type == BUTTON_PRESS_SHORT) { + strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonAction], BufferSize); + } else if (Type == BUTTON_PRESS_LONG) { + strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonLongAction], BufferSize); + } else { + /* Should not happen (TM) */ + *ActionOut = '\0'; + } } -bool ButtonSetActionByName(const char* Action) +bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action) { uint8_t i; for (i=0; i: - 0: 7b c3 rjmp .+1782 ; 0x6f8 <__ctors_end> - 2: 00 00 nop - 4: 95 c3 rjmp .+1834 ; 0x730 <__bad_interrupt> - 6: 00 00 nop - 8: 93 c3 rjmp .+1830 ; 0x730 <__bad_interrupt> - a: 00 00 nop - c: 91 c3 rjmp .+1826 ; 0x730 <__bad_interrupt> - e: 00 00 nop - 10: 8f c3 rjmp .+1822 ; 0x730 <__bad_interrupt> - 12: 00 00 nop - 14: 8d c3 rjmp .+1818 ; 0x730 <__bad_interrupt> - 16: 00 00 nop - 18: 8b c3 rjmp .+1814 ; 0x730 <__bad_interrupt> - 1a: 00 00 nop - 1c: 89 c3 rjmp .+1810 ; 0x730 <__bad_interrupt> - 1e: 00 00 nop - 20: 87 c3 rjmp .+1806 ; 0x730 <__bad_interrupt> - 22: 00 00 nop - 24: 85 c3 rjmp .+1802 ; 0x730 <__bad_interrupt> - 26: 00 00 nop - 28: 83 c3 rjmp .+1798 ; 0x730 <__bad_interrupt> - 2a: 00 00 nop - 2c: 81 c3 rjmp .+1794 ; 0x730 <__bad_interrupt> - 2e: 00 00 nop - 30: 7f c3 rjmp .+1790 ; 0x730 <__bad_interrupt> - 32: 00 00 nop - 34: 7d c3 rjmp .+1786 ; 0x730 <__bad_interrupt> - 36: 00 00 nop - 38: 7b c3 rjmp .+1782 ; 0x730 <__bad_interrupt> - 3a: 00 00 nop - 3c: 79 c3 rjmp .+1778 ; 0x730 <__bad_interrupt> - 3e: 00 00 nop - 40: 77 c3 rjmp .+1774 ; 0x730 <__bad_interrupt> - 42: 00 00 nop - 44: 75 c3 rjmp .+1770 ; 0x730 <__bad_interrupt> - 46: 00 00 nop - 48: 73 c3 rjmp .+1766 ; 0x730 <__bad_interrupt> - 4a: 00 00 nop - 4c: 71 c3 rjmp .+1762 ; 0x730 <__bad_interrupt> - 4e: 00 00 nop - 50: 6f c3 rjmp .+1758 ; 0x730 <__bad_interrupt> - 52: 00 00 nop - 54: 6d c3 rjmp .+1754 ; 0x730 <__bad_interrupt> - 56: 00 00 nop - 58: 0c 94 ab 12 jmp 0x2556 ; 0x2556 <__vector_22> - 5c: 69 c3 rjmp .+1746 ; 0x730 <__bad_interrupt> - 5e: 00 00 nop - 60: 67 c3 rjmp .+1742 ; 0x730 <__bad_interrupt> - 62: 00 00 nop - 64: 65 c3 rjmp .+1738 ; 0x730 <__bad_interrupt> - 66: 00 00 nop - 68: 63 c3 rjmp .+1734 ; 0x730 <__bad_interrupt> - 6a: 00 00 nop - 6c: 61 c3 rjmp .+1730 ; 0x730 <__bad_interrupt> - 6e: 00 00 nop - 70: 5f c3 rjmp .+1726 ; 0x730 <__bad_interrupt> - 72: 00 00 nop - 74: 5d c3 rjmp .+1722 ; 0x730 <__bad_interrupt> - 76: 00 00 nop - 78: 5b c3 rjmp .+1718 ; 0x730 <__bad_interrupt> - 7a: 00 00 nop - 7c: 59 c3 rjmp .+1714 ; 0x730 <__bad_interrupt> - 7e: 00 00 nop - 80: 57 c3 rjmp .+1710 ; 0x730 <__bad_interrupt> - 82: 00 00 nop - 84: 55 c3 rjmp .+1706 ; 0x730 <__bad_interrupt> - 86: 00 00 nop - 88: 0c 94 67 12 jmp 0x24ce ; 0x24ce <__vector_34> - 8c: 51 c3 rjmp .+1698 ; 0x730 <__bad_interrupt> - 8e: 00 00 nop - 90: 4f c3 rjmp .+1694 ; 0x730 <__bad_interrupt> - 92: 00 00 nop - 94: 4d c3 rjmp .+1690 ; 0x730 <__bad_interrupt> - 96: 00 00 nop - 98: 4b c3 rjmp .+1686 ; 0x730 <__bad_interrupt> - 9a: 00 00 nop - 9c: 49 c3 rjmp .+1682 ; 0x730 <__bad_interrupt> - 9e: 00 00 nop - a0: 47 c3 rjmp .+1678 ; 0x730 <__bad_interrupt> - a2: 00 00 nop - a4: 45 c3 rjmp .+1674 ; 0x730 <__bad_interrupt> - a6: 00 00 nop - a8: 43 c3 rjmp .+1670 ; 0x730 <__bad_interrupt> - aa: 00 00 nop - ac: 41 c3 rjmp .+1666 ; 0x730 <__bad_interrupt> - ae: 00 00 nop - b0: 3f c3 rjmp .+1662 ; 0x730 <__bad_interrupt> - b2: 00 00 nop - b4: 3d c3 rjmp .+1658 ; 0x730 <__bad_interrupt> - b6: 00 00 nop - b8: 3b c3 rjmp .+1654 ; 0x730 <__bad_interrupt> - ba: 00 00 nop - bc: 39 c3 rjmp .+1650 ; 0x730 <__bad_interrupt> - be: 00 00 nop - c0: 37 c3 rjmp .+1646 ; 0x730 <__bad_interrupt> - c2: 00 00 nop - c4: 35 c3 rjmp .+1642 ; 0x730 <__bad_interrupt> - c6: 00 00 nop - c8: 33 c3 rjmp .+1638 ; 0x730 <__bad_interrupt> - ca: 00 00 nop - cc: 31 c3 rjmp .+1634 ; 0x730 <__bad_interrupt> - ce: 00 00 nop - d0: 2f c3 rjmp .+1630 ; 0x730 <__bad_interrupt> - d2: 00 00 nop - d4: 2d c3 rjmp .+1626 ; 0x730 <__bad_interrupt> - d6: 00 00 nop - d8: 2b c3 rjmp .+1622 ; 0x730 <__bad_interrupt> - da: 00 00 nop - dc: 29 c3 rjmp .+1618 ; 0x730 <__bad_interrupt> - de: 00 00 nop - e0: 27 c3 rjmp .+1614 ; 0x730 <__bad_interrupt> - e2: 00 00 nop - e4: 25 c3 rjmp .+1610 ; 0x730 <__bad_interrupt> - e6: 00 00 nop - e8: 23 c3 rjmp .+1606 ; 0x730 <__bad_interrupt> - ea: 00 00 nop - ec: 21 c3 rjmp .+1602 ; 0x730 <__bad_interrupt> - ee: 00 00 nop - f0: 1f c3 rjmp .+1598 ; 0x730 <__bad_interrupt> - f2: 00 00 nop - f4: 1d c3 rjmp .+1594 ; 0x730 <__bad_interrupt> - f6: 00 00 nop - f8: 1b c3 rjmp .+1590 ; 0x730 <__bad_interrupt> - fa: 00 00 nop - fc: 19 c3 rjmp .+1586 ; 0x730 <__bad_interrupt> - fe: 00 00 nop - 100: 17 c3 rjmp .+1582 ; 0x730 <__bad_interrupt> - 102: 00 00 nop - 104: 15 c3 rjmp .+1578 ; 0x730 <__bad_interrupt> - 106: 00 00 nop - 108: 13 c3 rjmp .+1574 ; 0x730 <__bad_interrupt> - 10a: 00 00 nop - 10c: 11 c3 rjmp .+1570 ; 0x730 <__bad_interrupt> - 10e: 00 00 nop - 110: 0f c3 rjmp .+1566 ; 0x730 <__bad_interrupt> - 112: 00 00 nop - 114: 0d c3 rjmp .+1562 ; 0x730 <__bad_interrupt> - 116: 00 00 nop - 118: 0b c3 rjmp .+1558 ; 0x730 <__bad_interrupt> - 11a: 00 00 nop - 11c: 09 c3 rjmp .+1554 ; 0x730 <__bad_interrupt> - 11e: 00 00 nop - 120: 07 c3 rjmp .+1550 ; 0x730 <__bad_interrupt> - 122: 00 00 nop - 124: 05 c3 rjmp .+1546 ; 0x730 <__bad_interrupt> - 126: 00 00 nop - 128: 03 c3 rjmp .+1542 ; 0x730 <__bad_interrupt> - 12a: 00 00 nop - 12c: 01 c3 rjmp .+1538 ; 0x730 <__bad_interrupt> - 12e: 00 00 nop - 130: ff c2 rjmp .+1534 ; 0x730 <__bad_interrupt> - 132: 00 00 nop - 134: fd c2 rjmp .+1530 ; 0x730 <__bad_interrupt> - 136: 00 00 nop - 138: fb c2 rjmp .+1526 ; 0x730 <__bad_interrupt> - 13a: 00 00 nop - 13c: f9 c2 rjmp .+1522 ; 0x730 <__bad_interrupt> - 13e: 00 00 nop - 140: f7 c2 rjmp .+1518 ; 0x730 <__bad_interrupt> - 142: 00 00 nop - 144: f5 c2 rjmp .+1514 ; 0x730 <__bad_interrupt> - 146: 00 00 nop - 148: f3 c2 rjmp .+1510 ; 0x730 <__bad_interrupt> - 14a: 00 00 nop - 14c: 0c 94 65 13 jmp 0x26ca ; 0x26ca <__vector_83> - 150: ef c2 rjmp .+1502 ; 0x730 <__bad_interrupt> - 152: 00 00 nop - 154: ed c2 rjmp .+1498 ; 0x730 <__bad_interrupt> - 156: 00 00 nop - 158: eb c2 rjmp .+1494 ; 0x730 <__bad_interrupt> - 15a: 00 00 nop - 15c: e9 c2 rjmp .+1490 ; 0x730 <__bad_interrupt> - 15e: 00 00 nop - 160: e7 c2 rjmp .+1486 ; 0x730 <__bad_interrupt> - 162: 00 00 nop - 164: e5 c2 rjmp .+1482 ; 0x730 <__bad_interrupt> - 166: 00 00 nop - 168: e3 c2 rjmp .+1478 ; 0x730 <__bad_interrupt> - 16a: 00 00 nop - 16c: e1 c2 rjmp .+1474 ; 0x730 <__bad_interrupt> - 16e: 00 00 nop - 170: df c2 rjmp .+1470 ; 0x730 <__bad_interrupt> - 172: 00 00 nop - 174: dd c2 rjmp .+1466 ; 0x730 <__bad_interrupt> - 176: 00 00 nop - 178: db c2 rjmp .+1462 ; 0x730 <__bad_interrupt> - 17a: 00 00 nop - 17c: d9 c2 rjmp .+1458 ; 0x730 <__bad_interrupt> - 17e: 00 00 nop - 180: d7 c2 rjmp .+1454 ; 0x730 <__bad_interrupt> - 182: 00 00 nop - 184: d5 c2 rjmp .+1450 ; 0x730 <__bad_interrupt> - 186: 00 00 nop - 188: d3 c2 rjmp .+1446 ; 0x730 <__bad_interrupt> - 18a: 00 00 nop - 18c: d1 c2 rjmp .+1442 ; 0x730 <__bad_interrupt> - 18e: 00 00 nop - 190: cf c2 rjmp .+1438 ; 0x730 <__bad_interrupt> - 192: 00 00 nop - 194: cd c2 rjmp .+1434 ; 0x730 <__bad_interrupt> - 196: 00 00 nop - 198: cb c2 rjmp .+1430 ; 0x730 <__bad_interrupt> - 19a: 00 00 nop - 19c: c9 c2 rjmp .+1426 ; 0x730 <__bad_interrupt> - 19e: 00 00 nop - 1a0: c7 c2 rjmp .+1422 ; 0x730 <__bad_interrupt> - 1a2: 00 00 nop - 1a4: c5 c2 rjmp .+1418 ; 0x730 <__bad_interrupt> - 1a6: 00 00 nop - 1a8: c3 c2 rjmp .+1414 ; 0x730 <__bad_interrupt> - 1aa: 00 00 nop - 1ac: c1 c2 rjmp .+1410 ; 0x730 <__bad_interrupt> - 1ae: 00 00 nop - 1b0: bf c2 rjmp .+1406 ; 0x730 <__bad_interrupt> - 1b2: 00 00 nop - 1b4: bd c2 rjmp .+1402 ; 0x730 <__bad_interrupt> - 1b6: 00 00 nop - 1b8: bb c2 rjmp .+1398 ; 0x730 <__bad_interrupt> - 1ba: 00 00 nop - 1bc: b9 c2 rjmp .+1394 ; 0x730 <__bad_interrupt> - 1be: 00 00 nop - 1c0: b7 c2 rjmp .+1390 ; 0x730 <__bad_interrupt> - 1c2: 00 00 nop - 1c4: b5 c2 rjmp .+1386 ; 0x730 <__bad_interrupt> - 1c6: 00 00 nop - 1c8: b3 c2 rjmp .+1382 ; 0x730 <__bad_interrupt> - 1ca: 00 00 nop - 1cc: b1 c2 rjmp .+1378 ; 0x730 <__bad_interrupt> - 1ce: 00 00 nop - 1d0: af c2 rjmp .+1374 ; 0x730 <__bad_interrupt> - 1d2: 00 00 nop - 1d4: ad c2 rjmp .+1370 ; 0x730 <__bad_interrupt> - 1d6: 00 00 nop - 1d8: ab c2 rjmp .+1366 ; 0x730 <__bad_interrupt> - 1da: 00 00 nop - 1dc: a9 c2 rjmp .+1362 ; 0x730 <__bad_interrupt> - 1de: 00 00 nop - 1e0: a7 c2 rjmp .+1358 ; 0x730 <__bad_interrupt> - 1e2: 00 00 nop - 1e4: a5 c2 rjmp .+1354 ; 0x730 <__bad_interrupt> - 1e6: 00 00 nop - 1e8: a3 c2 rjmp .+1350 ; 0x730 <__bad_interrupt> - 1ea: 00 00 nop - 1ec: a1 c2 rjmp .+1346 ; 0x730 <__bad_interrupt> - 1ee: 00 00 nop - 1f0: 9f c2 rjmp .+1342 ; 0x730 <__bad_interrupt> - 1f2: 00 00 nop - 1f4: 0c 94 03 21 jmp 0x4206 ; 0x4206 <__vector_125> - 1f8: 9b c2 rjmp .+1334 ; 0x730 <__bad_interrupt> - 1fa: 00 00 nop - 1fc: 66 0f add r22, r22 - 1fe: 66 0f add r22, r22 - 200: 4e 0f add r20, r30 - 202: 57 0f add r21, r23 - 204: 70 0f add r23, r16 - 206: 24 0f add r18, r20 - 208: 3e 0f add r19, r30 - 20a: 41 0f add r20, r17 - 20c: 38 0f add r19, r24 - 20e: 29 14 cp r2, r9 - 210: b5 13 cpse r27, r21 - 212: be 13 cpse r27, r30 - 214: c5 13 cpse r28, r21 - 216: d3 13 cpse r29, r19 - 218: de 13 cpse r29, r30 - 21a: 03 14 cp r0, r3 - 21c: 7d 13 cpse r23, r29 - 21e: 11 14 cp r1, r1 - 220: 18 14 cp r1, r8 - 222: 1f 14 cp r1, r15 - 224: 81 15 cp r24, r1 - 226: 81 15 cp r24, r1 - 228: 95 15 cp r25, r5 - 22a: 50 16 cp r5, r16 - 22c: a7 15 cp r26, r7 - 22e: c5 15 cp r28, r5 - 230: 45 15 cp r20, r5 - 232: 69 15 cp r22, r9 - 234: 69 15 cp r22, r9 - 236: 69 15 cp r22, r9 - 238: 0e 1c adc r0, r14 - 23a: db 1b sub r29, r27 - 23c: 7a 1b sub r23, r26 - 23e: db 1b sub r29, r27 - 240: 7a 1b sub r23, r26 - 242: c9 1b sub r28, r25 - 244: ab 1b sub r26, r27 - 246: 7a 1b sub r23, r26 - 248: a2 1b sub r26, r18 - 24a: 8b 1b sub r24, r27 - -0000024c : - 24c: 1c 03 4c 00 55 00 46 00 41 00 20 00 43 00 44 00 ..L.U.F.A. .C.D. - 25c: 43 00 20 00 44 00 65 00 6d 00 6f 00 00 00 C. .D.e.m.o... - -0000026a : - 26a: 18 03 44 00 65 00 61 00 6e 00 20 00 43 00 61 00 ..D.e.a.n. .C.a. - 27a: 6d 00 65 00 72 00 61 00 00 00 m.e.r.a... - -00000284 : - 284: 04 03 09 04 .... - -00000288 : - 288: 09 02 3e 00 02 01 00 c0 32 09 04 00 00 01 02 02 ..>.....2....... - 298: 01 00 05 24 00 10 01 04 24 02 06 05 24 06 00 01 ...$....$...$... - 2a8: 07 05 82 03 08 00 ff 09 04 01 00 02 0a 00 00 00 ................ - 2b8: 07 05 04 02 10 00 05 07 05 83 02 10 00 05 .............. - -000002c6 : - 2c6: 12 01 10 01 02 00 00 08 eb 03 44 20 01 00 01 02 ..........D .... - 2d6: dc 01 .. - -000002d8 : - 2d8: 00 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 .NONE........... - 2e8: 00 89 04 8a 04 8b 04 8c 04 8d 04 8e 04 91 04 92 ................ - 2f8: 04 00 00 00 01 01 4d 46 5f 43 4c 41 53 53 49 43 ......MF_CLASSIC - 308: 5f 31 4b 00 00 00 43 14 7a 14 f5 14 0f 15 13 15 _1K...C.z....... - 318: 14 15 e7 18 ed 18 00 04 04 00 02 4d 46 5f 43 4c ...........MF_CL - 328: 41 53 53 49 43 5f 34 4b 00 00 00 43 14 7a 14 02 ASSIC_4K...C.z.. - 338: 15 0f 15 13 15 14 15 e7 18 ed 18 00 10 04 00 ............... - -00000347 : - 347: 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 00 NONE............ - 357: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 367: 55 49 44 5f 52 41 4e 44 4f 4d 00 00 00 00 00 00 UID_RANDOM...... - 377: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 387: 55 49 44 5f 4c 45 46 54 5f 49 4e 43 52 45 4d 45 UID_LEFT_INCREME - 397: 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 NT.............. - 3a7: 55 49 44 5f 52 49 47 48 54 5f 49 4e 43 52 45 4d UID_RIGHT_INCREM - 3b7: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. - 3c7: 55 49 44 5f 4c 45 46 54 5f 44 45 43 52 45 4d 45 UID_LEFT_DECREME - 3d7: 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 NT.............. - 3e7: 55 49 44 5f 52 49 47 48 54 5f 44 45 43 52 45 4d UID_RIGHT_DECREM - 3f7: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. - 407: 43 59 43 4c 45 5f 53 45 54 54 49 4e 47 53 00 00 CYCLE_SETTINGS.. - 417: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 427: 53 54 4f 52 45 5f 4d 45 4d 00 00 00 00 00 00 00 STORE_MEM....... - 437: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 447: 52 45 43 41 4c 4c 5f 4d 45 4d 00 00 00 00 00 00 RECALL_MEM...... - 457: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - -00000467 <__c.6505>: - 467: 25 35 75 20 6d 56 00 %5u mV. - -0000046e <__c.6466>: - 46e: 25 75 00 %u. - -00000471 <__c.6461>: - 471: 25 75 00 %u. - -00000474 <__c.6434>: - 474: 52 41 4e 44 4f 4d 00 RANDOM. - -0000047b <__c.6416>: - 47b: 25 73 00 %s. - -0000047e <__c.6405>: - 47e: 43 68 61 6d 65 6c 65 6f 6e 2d 4d 69 6e 69 20 25 Chameleon-Mini % - 48e: 53 20 75 73 69 6e 67 20 4c 55 46 41 20 25 53 20 S using LUFA %S - 49e: 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 41 56 compiled with AV - 4ae: 52 2d 47 43 43 20 25 53 00 R-GCC %S. - -000004b7 <__c.6407>: - 4b7: 31 34 30 39 32 34 00 140924. - -000004be <__c.6409>: - 4be: 31 33 30 39 30 31 00 130901. - -000004c5 <__c.6411>: - 4c5: 34 2e 38 2e 31 00 4.8.1. - -000004cb <__c.6197>: - 4cb: 0d 0a 00 ... - -000004ce <__c.6195>: - 4ce: 0d 0a 00 ... - -000004d1 : - 4d1: 64 31 30 30 3a 4f 4b 00 00 00 00 00 00 00 00 00 d100:OK......... - 4e1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 4f1: 00 65 31 30 31 3a 4f 4b 20 57 49 54 48 20 54 45 .e101:OK WITH TE - 501: 58 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XT.............. - 511: 00 00 6e 31 31 30 3a 57 41 49 54 49 4e 47 20 46 ..n110:WAITING F - 521: 4f 52 20 58 4d 4f 44 45 4d 00 00 00 00 00 00 00 OR XMODEM....... - 531: 00 00 00 c8 32 30 30 3a 55 4e 4b 4e 4f 57 4e 20 ....200:UNKNOWN - 541: 43 4f 4d 4d 41 4e 44 00 00 00 00 00 00 00 00 00 COMMAND......... - 551: 00 00 00 00 c9 32 30 31 3a 49 4e 56 41 4c 49 44 .....201:INVALID - 561: 20 43 4f 4d 4d 41 4e 44 20 55 53 41 47 45 00 00 COMMAND USAGE.. - 571: 00 00 00 00 00 ca 32 30 32 3a 49 4e 56 41 4c 49 ......202:INVALI - 581: 44 20 50 41 52 41 4d 45 54 45 52 00 00 00 00 00 D PARAMETER..... - 591: 00 00 00 00 00 00 ...... - -00000597 : - 597: 56 45 52 53 49 4f 4e 00 00 00 00 00 00 00 00 00 VERSION......... - 5a7: 00 00 00 00 14 0d 43 4f 4e 46 49 47 00 00 00 00 ......CONFIG.... - 5b7: 00 00 00 00 00 00 51 0d 48 0d 32 0d 55 49 44 00 ......Q.H.2.UID. - 5c7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 81 0d ................ - 5d7: 57 0d 52 45 41 44 4f 4e 4c 59 00 00 00 00 00 00 W.READONLY...... - 5e7: 00 00 00 00 e5 0d d3 0d 55 50 4c 4f 41 44 00 00 ........UPLOAD.. - 5f7: 00 00 00 00 00 00 00 00 f9 0d 00 00 00 00 44 4f ..............DO - 607: 57 4e 4c 4f 41 44 00 00 00 00 00 00 00 00 fe 0d WNLOAD.......... - 617: 00 00 00 00 52 45 53 45 54 00 00 00 00 00 00 00 ....RESET....... - 627: 00 00 00 00 03 0e 00 00 00 00 55 50 47 52 41 44 ..........UPGRAD - 637: 45 00 00 00 00 00 00 00 00 00 0e 0e 00 00 00 00 E............... - 647: 4d 45 4d 53 49 5a 45 00 00 00 00 00 00 00 00 00 MEMSIZE......... - 657: 00 00 00 00 19 0e 55 49 44 53 49 5a 45 00 00 00 ......UIDSIZE... - 667: 00 00 00 00 00 00 00 00 00 00 31 0e 42 55 54 54 ..........1.BUTT - 677: 4f 4e 00 00 00 00 00 00 00 00 00 00 47 0e 51 0e ON..........G.Q. - 687: 4c 0e 53 45 54 54 49 4e 47 00 00 00 00 00 00 00 L.SETTING....... - 697: 00 00 00 00 5e 0e 59 0e 43 4c 45 41 52 00 00 00 ....^.Y.CLEAR... - 6a7: 00 00 00 00 00 00 00 00 66 0e 00 00 00 00 48 45 ........f.....HE - 6b7: 4c 50 00 00 00 00 00 00 00 00 00 00 00 00 6a 0e LP............j. - 6c7: 00 00 00 00 52 53 53 49 00 00 00 00 00 00 00 00 ....RSSI........ - 6d7: 00 00 00 00 00 00 00 00 b4 0e 00 00 00 00 00 00 ................ - 6e7: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ - 6f7: 00 . - -000006f8 <__ctors_end>: - 6f8: 11 24 eor r1, r1 - 6fa: 1f be out 0x3f, r1 ; 63 - 6fc: cf ef ldi r28, 0xFF ; 255 - 6fe: cd bf out 0x3d, r28 ; 61 - 700: df e2 ldi r29, 0x2F ; 47 - 702: de bf out 0x3e, r29 ; 62 - -00000704 <__do_copy_data>: - 704: 10 e2 ldi r17, 0x20 ; 32 - 706: a0 e0 ldi r26, 0x00 ; 0 - 708: b0 e2 ldi r27, 0x20 ; 32 - 70a: ea e9 ldi r30, 0x9A ; 154 - 70c: fe e4 ldi r31, 0x4E ; 78 - 70e: 02 c0 rjmp .+4 ; 0x714 <__do_copy_data+0x10> - 710: 05 90 lpm r0, Z+ - 712: 0d 92 st X+, r0 - 714: a2 39 cpi r26, 0x92 ; 146 - 716: b1 07 cpc r27, r17 - 718: d9 f7 brne .-10 ; 0x710 <__do_copy_data+0xc> - -0000071a <__do_clear_bss>: - 71a: 2a e2 ldi r18, 0x2A ; 42 - 71c: a2 e9 ldi r26, 0x92 ; 146 - 71e: b0 e2 ldi r27, 0x20 ; 32 - 720: 01 c0 rjmp .+2 ; 0x724 <.do_clear_bss_start> - -00000722 <.do_clear_bss_loop>: - 722: 1d 92 st X+, r1 - -00000724 <.do_clear_bss_start>: - 724: ad 39 cpi r26, 0x9D ; 157 - 726: b2 07 cpc r27, r18 - 728: e1 f7 brne .-8 ; 0x722 <.do_clear_bss_loop> - 72a: 03 d0 rcall .+6 ; 0x732
- 72c: 0c 94 4b 27 jmp 0x4e96 ; 0x4e96 <_exit> - -00000730 <__bad_interrupt>: - 730: 79 c0 rjmp .+242 ; 0x824 <__vector_default> - -00000732
: - -#include "Chameleon-Mini.h" - -int main(void) -{ - SystemInit(); - 732: 7e d0 rcall .+252 ; 0x830 - SettingsLoad(); - 734: 0e 94 d0 0b call 0x17a0 ; 0x17a0 - -extern uint8_t LEDPulseMask; - -static inline -void LEDInit(void) { - LED_PORT.DIRSET = LED_MASK; - 738: 80 e3 ldi r24, 0x30 ; 48 - 73a: 80 93 01 06 sts 0x0601, r24 - LEDInit(); - MemoryInit(); - 73e: e4 d2 rcall .+1480 ; 0xd08 - ConfigurationInit(); - 740: 0d d1 rcall .+538 ; 0x95c - TerminalInit(); - 742: 0e 94 9e 0c call 0x193c ; 0x193c - RandomInit(); - 746: 87 d1 rcall .+782 ; 0xa56 - ButtonInit(); - 748: a0 d6 rcall .+3392 ; 0x148a -#define ANTENNA_LEVEL_DENOMINATOR (ANTENNA_LEVEL_SCALE) - -static inline -void AntennaLevelInit(void) -{ - ADCA.CTRLA = ADC_ENABLE_bm; - 74a: 81 e0 ldi r24, 0x01 ; 1 - 74c: 80 93 00 02 sts 0x0200, r24 - ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc; - 750: 10 92 01 02 sts 0x0201, r1 - ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm; - 754: 92 e0 ldi r25, 0x02 ; 2 - 756: 90 93 02 02 sts 0x0202, r25 - ADCA.PRESCALER = ADC_PRESCALER_DIV32_gc; - 75a: 93 e0 ldi r25, 0x03 ; 3 - 75c: 90 93 04 02 sts 0x0204, r25 - ADCA.CH0.CTRL = ADC_CH_INPUTMODE_SINGLEENDED_gc; - 760: 80 93 20 02 sts 0x0220, r24 - ADCA.CH0.MUXCTRL = ADC_CH_MUXPOS_PIN7_gc; - 764: 88 e3 ldi r24, 0x38 ; 56 - 766: 80 93 21 02 sts 0x0221, r24 - AntennaLevelInit(); - - SystemInterruptInit(); - 76a: cd d0 rcall .+410 ; 0x906 -} - -INLINE bool SystemTick100ms(void) -{ - if (TCE0.INTFLAGS & TC0_OVFIF_bm) { - TCE0.INTFLAGS = TC0_OVFIF_bm; - 76c: c1 e0 ldi r28, 0x01 ; 1 - - while(1) { - TerminalTask(); - 76e: 0e 94 a3 0c call 0x1946 ; 0x1946 -INLINE void CodecInit(void) { - ActiveConfiguration.CodecInitFunc(); -} - -INLINE void CodecTask(void) { - ActiveConfiguration.CodecTaskFunc(); - 772: e0 91 eb 24 lds r30, 0x24EB - 776: f0 91 ec 24 lds r31, 0x24EC - 77a: 09 95 icall -INLINE void ApplicationInit(void) { - ActiveConfiguration.ApplicationInitFunc(); -} - -INLINE void ApplicationTask(void) { - ActiveConfiguration.ApplicationTaskFunc(); - 77c: e0 91 f1 24 lds r30, 0x24F1 - 780: f0 91 f2 24 lds r31, 0x24F2 - 784: 09 95 icall - return RTC.CNT; -} - -INLINE bool SystemTick100ms(void) -{ - if (TCE0.INTFLAGS & TC0_OVFIF_bm) { - 786: 80 91 0c 0a lds r24, 0x0A0C - 78a: 80 ff sbrs r24, 0 - 78c: f0 cf rjmp .-32 ; 0x76e - TCE0.INTFLAGS = TC0_OVFIF_bm; - 78e: c0 93 0c 0a sts 0x0A0C, r28 - CodecTask(); - ApplicationTask(); - - if (SystemTick100ms()) { - RandomTick(); - 792: 75 d1 rcall .+746 ; 0xa7e - TerminalTick(); - 794: 0e 94 c2 0c call 0x1984 ; 0x1984 - ButtonTick(); - 798: 7f d6 rcall .+3326 ; 0x1498 - LED_PORT.OUTSET = Mask; -} - -static inline -void LEDTick(void) { - LED_PORT.OUTCLR = LEDPulseMask; - 79a: 80 91 93 24 lds r24, 0x2493 - 79e: 80 93 06 06 sts 0x0606, r24 - LEDPulseMask = 0; - 7a2: 10 92 93 24 sts 0x2493, r1 - 7a6: e3 cf rjmp .-58 ; 0x76e - -000007a8 : - */ -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, - const uint8_t wIndex, - const void** const DescriptorAddress) -{ - const uint8_t DescriptorType = (wValue >> 8); - 7a8: 29 2f mov r18, r25 - 7aa: 33 27 eor r19, r19 - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - 7ac: 22 30 cpi r18, 0x02 ; 2 - 7ae: 31 05 cpc r19, r1 - 7b0: 29 f1 breq .+74 ; 0x7fc - 7b2: 23 30 cpi r18, 0x03 ; 3 - 7b4: 31 05 cpc r19, r1 - 7b6: 99 f0 breq .+38 ; 0x7de - 7b8: 21 30 cpi r18, 0x01 ; 1 - 7ba: 31 05 cpc r19, r1 - 7bc: 41 f0 breq .+16 ; 0x7ce -{ - const uint8_t DescriptorType = (wValue >> 8); - const uint8_t DescriptorNumber = (wValue & 0xFF); - - const void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; - 7be: 80 e0 ldi r24, 0x00 ; 0 - 7c0: 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; - 7c2: 20 e0 ldi r18, 0x00 ; 0 - 7c4: 30 e0 ldi r19, 0x00 ; 0 - } - - break; - } - - *DescriptorAddress = Address; - 7c6: fa 01 movw r30, r20 - 7c8: 20 83 st Z, r18 - 7ca: 31 83 std Z+1, r19 ; 0x01 - return Size; -} - 7cc: 08 95 ret - - switch (DescriptorType) - { - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - 7ce: 82 e1 ldi r24, 0x12 ; 18 - 7d0: 90 e0 ldi r25, 0x00 ; 0 - uint16_t Size = NO_DESCRIPTOR; - - switch (DescriptorType) - { - case DTYPE_Device: - Address = &DeviceDescriptor; - 7d2: 26 ec ldi r18, 0xC6 ; 198 - 7d4: 32 e0 ldi r19, 0x02 ; 2 - } - - break; - } - - *DescriptorAddress = Address; - 7d6: fa 01 movw r30, r20 - 7d8: 20 83 st Z, r18 - 7da: 31 83 std Z+1, r19 ; 0x01 - return Size; -} - 7dc: 08 95 ret - 7de: 99 27 eor r25, r25 - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - Size = sizeof(USB_Descriptor_Configuration_t); - break; - case DTYPE_String: - switch (DescriptorNumber) - 7e0: 81 30 cpi r24, 0x01 ; 1 - 7e2: 91 05 cpc r25, r1 - 7e4: 99 f0 breq .+38 ; 0x80c - 7e6: 82 30 cpi r24, 0x02 ; 2 - 7e8: 91 05 cpc r25, r1 - 7ea: b1 f0 breq .+44 ; 0x818 - 7ec: 89 2b or r24, r25 - 7ee: 39 f7 brne .-50 ; 0x7be - { - case 0x00: - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - 7f0: e4 e8 ldi r30, 0x84 ; 132 - 7f2: f2 e0 ldi r31, 0x02 ; 2 - 7f4: 84 91 lpm r24, Z - 7f6: 90 e0 ldi r25, 0x00 ; 0 - break; - case DTYPE_String: - switch (DescriptorNumber) - { - case 0x00: - Address = &LanguageString; - 7f8: 9f 01 movw r18, r30 - Size = pgm_read_byte(&LanguageString.Header.Size); - break; - 7fa: e5 cf rjmp .-54 ; 0x7c6 - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - Size = sizeof(USB_Descriptor_Configuration_t); - 7fc: 8e e3 ldi r24, 0x3E ; 62 - 7fe: 90 e0 ldi r25, 0x00 ; 0 - case DTYPE_Device: - Address = &DeviceDescriptor; - Size = sizeof(USB_Descriptor_Device_t); - break; - case DTYPE_Configuration: - Address = &ConfigurationDescriptor; - 800: 28 e8 ldi r18, 0x88 ; 136 - 802: 32 e0 ldi r19, 0x02 ; 2 - } - - break; - } - - *DescriptorAddress = Address; - 804: fa 01 movw r30, r20 - 806: 20 83 st Z, r18 - 808: 31 83 std Z+1, r19 ; 0x01 - return Size; -} - 80a: 08 95 ret - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - break; - case 0x01: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - 80c: ea e6 ldi r30, 0x6A ; 106 - 80e: f2 e0 ldi r31, 0x02 ; 2 - 810: 84 91 lpm r24, Z - 812: 90 e0 ldi r25, 0x00 ; 0 - case 0x00: - Address = &LanguageString; - Size = pgm_read_byte(&LanguageString.Header.Size); - break; - case 0x01: - Address = &ManufacturerString; - 814: 9f 01 movw r18, r30 - Size = pgm_read_byte(&ManufacturerString.Header.Size); - break; - 816: d7 cf rjmp .-82 ; 0x7c6 - case 0x02: - Address = &ProductString; - Size = pgm_read_byte(&ProductString.Header.Size); - 818: ec e4 ldi r30, 0x4C ; 76 - 81a: f2 e0 ldi r31, 0x02 ; 2 - 81c: 84 91 lpm r24, Z - 81e: 90 e0 ldi r25, 0x00 ; 0 - case 0x01: - Address = &ManufacturerString; - Size = pgm_read_byte(&ManufacturerString.Header.Size); - break; - case 0x02: - Address = &ProductString; - 820: 9f 01 movw r18, r30 - Size = pgm_read_byte(&ProductString.Header.Size); - break; - 822: d1 cf rjmp .-94 ; 0x7c6 - -00000824 <__vector_default>: - -#include "System.h" -#include "LED.h" - -ISR(BADISR_vect) -{ - 824: 1f 92 push r1 - 826: 0f 92 push r0 - 828: 0f b6 in r0, 0x3f ; 63 - 82a: 0f 92 push r0 - 82c: 11 24 eor r1, r1 - 82e: ff cf rjmp .-2 ; 0x82e <__vector_default+0xa> - -00000830 : - while(1); -} - -void SystemInit(void) -{ - if (RST.STATUS & RST_WDRF_bm) { - 830: 80 91 78 00 lds r24, 0x0078 - 834: 83 ff sbrs r24, 3 - 836: 0a c0 rjmp .+20 ; 0x84c - /* On Watchdog reset clear WDRF bit, disable watchdog - * and jump into bootloader */ - RST.STATUS = RST_WDRF_bm; - 838: 88 e0 ldi r24, 0x08 ; 8 - 83a: 80 93 78 00 sts 0x0078, r24 - - CCP = CCP_IOREG_gc; - 83e: 88 ed ldi r24, 0xD8 ; 216 - 840: 84 bf out 0x34, r24 ; 52 - WDT.CTRL = WDT_CEN_bm; - 842: 81 e0 ldi r24, 0x01 ; 1 - 844: 80 93 80 00 sts 0x0080, r24 - - asm volatile ("jmp %0"::"i" (BOOT_SECTION_START + 0x1FC)); - 848: fd 95 fe c0 jmp 0x7f81fc ; 0x7f81fc <__data_load_end+0x7f32d0> - } - - /* 32MHz system clock using internal RC and 32K DFLL*/ - OSC.CTRL |= OSC_RC32MEN_bm | OSC_RC32KEN_bm; - 84c: 80 91 50 00 lds r24, 0x0050 - 850: 86 60 ori r24, 0x06 ; 6 - 852: 80 93 50 00 sts 0x0050, r24 - while(!(OSC.STATUS & OSC_RC32MRDY_bm)) - 856: 80 91 51 00 lds r24, 0x0051 - 85a: 81 ff sbrs r24, 1 - 85c: fc cf rjmp .-8 ; 0x856 - ; - while(!(OSC.STATUS & OSC_RC32KRDY_bm)) - 85e: 80 91 51 00 lds r24, 0x0051 - 862: 82 ff sbrs r24, 2 - 864: fc cf rjmp .-8 ; 0x85e - ; - - OSC.DFLLCTRL = OSC_RC32MCREF_RC32K_gc; - 866: 10 92 56 00 sts 0x0056, r1 - DFLLRC32M.CTRL = DFLL_ENABLE_bm; - 86a: 21 e0 ldi r18, 0x01 ; 1 - 86c: 20 93 60 00 sts 0x0060, r18 - - CCP = CCP_IOREG_gc; - 870: 88 ed ldi r24, 0xD8 ; 216 - 872: 84 bf out 0x34, r24 ; 52 - CLK.CTRL = CLK_SCLKSEL_RC32M_gc; - 874: 20 93 40 00 sts 0x0040, r18 - - /* Use TCE0 as system tick */ - TCE0.PER = F_CPU / 256 / SYSTEM_TICK_FREQ - 1; - 878: 83 ed ldi r24, 0xD3 ; 211 - 87a: 90 e3 ldi r25, 0x30 ; 48 - 87c: 80 93 26 0a sts 0x0A26, r24 - 880: 90 93 27 0a sts 0x0A27, r25 - TCE0.CTRLA = TC_CLKSEL_DIV256_gc; - 884: 86 e0 ldi r24, 0x06 ; 6 - 886: 80 93 00 0a sts 0x0A00, r24 - - /* Enable RTC with roughly 1kHz clock */ - CLK.RTCCTRL = CLK_RTCSRC_ULP_gc | CLK_RTCEN_bm; - 88a: 20 93 43 00 sts 0x0043, r18 - RTC.CTRL = RTC_PRESCALER_DIV1_gc; - 88e: 20 93 00 04 sts 0x0400, r18 - - /* Enable EEPROM data memory mapping */ - NVM.CTRLB |= NVM_EEMAPEN_bm; - 892: 80 91 cc 01 lds r24, 0x01CC - 896: 88 60 ori r24, 0x08 ; 8 - 898: 80 93 cc 01 sts 0x01CC, r24 - 89c: 08 95 ret - -0000089e : -} - -void SystemReset(void) -{ - CCP = CCP_IOREG_gc; - 89e: 88 ed ldi r24, 0xD8 ; 216 - 8a0: 84 bf out 0x34, r24 ; 52 - RST.CTRL = RST_SWRST_bm; - 8a2: 81 e0 ldi r24, 0x01 ; 1 - 8a4: e8 e7 ldi r30, 0x78 ; 120 - 8a6: f0 e0 ldi r31, 0x00 ; 0 - 8a8: 81 83 std Z+1, r24 ; 0x01 - 8aa: 08 95 ret - -000008ac : -} - -void SystemEnterBootloader(void) -{ - /* Use Watchdog timer to reset into bootloader. */ - CCP = CCP_IOREG_gc; - 8ac: 88 ed ldi r24, 0xD8 ; 216 - 8ae: 84 bf out 0x34, r24 ; 52 - WDT.CTRL = WDT_PER_512CLK_gc | WDT_ENABLE_bm | WDT_CEN_bm; - 8b0: 8b e1 ldi r24, 0x1B ; 27 - 8b2: 80 93 80 00 sts 0x0080, r24 - 8b6: 08 95 ret - -000008b8 : - - -void SystemStartUSBClock(void) -{ - /* 48MHz USB Clock using 12MHz XTAL */ - OSC.XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; - 8b8: 8b ec ldi r24, 0xCB ; 203 - 8ba: 80 93 52 00 sts 0x0052, r24 - OSC.CTRL |= OSC_XOSCEN_bm; - 8be: 80 91 50 00 lds r24, 0x0050 - 8c2: 88 60 ori r24, 0x08 ; 8 - 8c4: 80 93 50 00 sts 0x0050, r24 - while(!(OSC.STATUS & OSC_XOSCRDY_bm)) - 8c8: 80 91 51 00 lds r24, 0x0051 - 8cc: 83 ff sbrs r24, 3 - 8ce: fc cf rjmp .-8 ; 0x8c8 - ; - - OSC.PLLCTRL = OSC_PLLSRC_XOSC_gc | (4 << OSC_PLLFAC_gp); - 8d0: 84 ec ldi r24, 0xC4 ; 196 - 8d2: 80 93 55 00 sts 0x0055, r24 - - OSC.CTRL |= OSC_PLLEN_bm; - 8d6: 80 91 50 00 lds r24, 0x0050 - 8da: 80 61 ori r24, 0x10 ; 16 - 8dc: 80 93 50 00 sts 0x0050, r24 - while(!(OSC.STATUS & OSC_PLLRDY_bm)) - 8e0: 80 91 51 00 lds r24, 0x0051 - 8e4: 84 ff sbrs r24, 4 - 8e6: fc cf rjmp .-8 ; 0x8e0 - ; -} - 8e8: 08 95 ret - -000008ea : - -void SystemStopUSBClock(void) -{ - /* Disable USB Clock to minimize power consumption */ - CLK.USBCTRL &= ~CLK_USBSEN_bm; - 8ea: e0 e4 ldi r30, 0x40 ; 64 - 8ec: f0 e0 ldi r31, 0x00 ; 0 - 8ee: 84 81 ldd r24, Z+4 ; 0x04 - 8f0: 8e 7f andi r24, 0xFE ; 254 - 8f2: 84 83 std Z+4, r24 ; 0x04 - OSC.CTRL &= ~OSC_PLLEN_bm; - 8f4: e0 e5 ldi r30, 0x50 ; 80 - 8f6: f0 e0 ldi r31, 0x00 ; 0 - 8f8: 80 81 ld r24, Z - 8fa: 8f 7e andi r24, 0xEF ; 239 - 8fc: 80 83 st Z, r24 - OSC.CTRL &= ~OSC_XOSCEN_bm; - 8fe: 80 81 ld r24, Z - 900: 87 7f andi r24, 0xF7 ; 247 - 902: 80 83 st Z, r24 - 904: 08 95 ret - -00000906 : -} - -void SystemInterruptInit(void) -{ - /* Enable all interrupt levels */ - PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; - 906: 87 e0 ldi r24, 0x07 ; 7 - 908: e0 ea ldi r30, 0xA0 ; 160 - 90a: f0 e0 ldi r31, 0x00 ; 0 - 90c: 82 83 std Z+2, r24 ; 0x02 - sei(); - 90e: 78 94 sei - 910: 08 95 ret - -00000912 : - -/* Include all Codecs and Applications */ -#include "Codec/Codec.h" -#include "Application/Application.h" - -static void CodecInitDummy(void) { } - 912: 08 95 ret - -00000914 : -static void CodecTaskDummy(void) { } - 914: 08 95 ret - -00000916 : -static void ApplicationInitDummy(void) {} - 916: 08 95 ret - -00000918 : -static void ApplicationResetDummy(void) {} - 918: 08 95 ret - -0000091a : -static void ApplicationTaskDummy(void) {} - 91a: 08 95 ret - -0000091c : -static uint16_t ApplicationProcessDummy(uint8_t* ByteBuffer, uint16_t ByteCount) { return 0; } - 91c: 80 e0 ldi r24, 0x00 ; 0 - 91e: 90 e0 ldi r25, 0x00 ; 0 - 920: 08 95 ret - -00000922 : -static void ApplicationGetUidDummy(ConfigurationUidType Uid) { } - 922: 08 95 ret - -00000924 : -static void ApplicationSetUidDummy(ConfigurationUidType Uid) { } - 924: 08 95 ret - -00000926 : - ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); -} - -void ConfigurationSetById( ConfigurationEnum Configuration ) -{ - GlobalSettings.ActiveSettingPtr->Configuration = Configuration; - 926: e0 91 fe 24 lds r30, 0x24FE - 92a: f0 91 ff 24 lds r31, 0x24FF - 92e: 81 83 std Z+1, r24 ; 0x01 - - /* Copy struct from PROGMEM to RAM */ - memcpy_P(&ActiveConfiguration, - &ConfigurationTable[Configuration], sizeof(ConfigurationType)); - 930: 95 e2 ldi r25, 0x25 ; 37 - 932: 89 9f mul r24, r25 - 934: b0 01 movw r22, r0 - 936: 11 24 eor r1, r1 - 938: 68 52 subi r22, 0x28 ; 40 - 93a: 7d 4f sbci r23, 0xFD ; 253 -void ConfigurationSetById( ConfigurationEnum Configuration ) -{ - GlobalSettings.ActiveSettingPtr->Configuration = Configuration; - - /* Copy struct from PROGMEM to RAM */ - memcpy_P(&ActiveConfiguration, - 93c: 45 e2 ldi r20, 0x25 ; 37 - 93e: 50 e0 ldi r21, 0x00 ; 0 - 940: 88 ed ldi r24, 0xD8 ; 216 - 942: 94 e2 ldi r25, 0x24 ; 36 - 944: 0e 94 e5 23 call 0x47ca ; 0x47ca -/* Applications */ -#include "MifareClassic.h" - -/* Function wrappers */ -INLINE void ApplicationInit(void) { - ActiveConfiguration.ApplicationInitFunc(); - 948: e0 91 ed 24 lds r30, 0x24ED - 94c: f0 91 ee 24 lds r31, 0x24EE - 950: 09 95 icall -#define CODEC_CARRIER_FREQ 13560000 - -extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE]; - -INLINE void CodecInit(void) { - ActiveConfiguration.CodecInitFunc(); - 952: e0 91 e9 24 lds r30, 0x24E9 - 956: f0 91 ea 24 lds r31, 0x24EA - 95a: 09 94 ijmp - -0000095c : - -ConfigurationType ActiveConfiguration; - -void ConfigurationInit(void) -{ - ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); - 95c: e0 91 fe 24 lds r30, 0x24FE - 960: f0 91 ff 24 lds r31, 0x24FF - 964: 81 81 ldd r24, Z+1 ; 0x01 - 966: df cf rjmp .-66 ; 0x926 - -00000968 : - ApplicationInit(); - CodecInit(); -} - -bool ConfigurationSetByName(const char* ConfigurationName) -{ - 968: 0f 93 push r16 - 96a: 1f 93 push r17 - 96c: cf 93 push r28 - 96e: df 93 push r29 - 970: 49 ed ldi r20, 0xD9 ; 217 - 972: 52 e0 ldi r21, 0x02 ; 2 - uint8_t i; - - /* Loop through table trying to find the configuration */ - for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { - 974: 10 e0 ldi r17, 0x00 ; 0 - 976: bc 01 movw r22, r24 - 978: 6f 5f subi r22, 0xFF ; 255 - 97a: 7f 4f sbci r23, 0xFF ; 255 - const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; - 97c: 9a 01 movw r18, r20 - const char* pRequestedConfigName = ConfigurationName; - bool StringMismatch = false; - char c = pgm_read_byte(pTableConfigName); - 97e: fa 01 movw r30, r20 - 980: c4 91 lpm r28, Z - - /* Try to keep running until both strings end at the same point */ - while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - 982: c1 11 cpse r28, r1 - 984: 0f c0 rjmp .+30 ; 0x9a4 - uint8_t i; - - /* Loop through table trying to find the configuration */ - for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { - const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; - const char* pRequestedConfigName = ConfigurationName; - 986: ec 01 movw r28, r24 - bool StringMismatch = false; - char c = pgm_read_byte(pTableConfigName); - - /* Try to keep running until both strings end at the same point */ - while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - 988: 28 81 ld r18, Y - 98a: 22 23 and r18, r18 - 98c: 11 f1 breq .+68 ; 0x9d2 -bool ConfigurationSetByName(const char* ConfigurationName) -{ - uint8_t i; - - /* Loop through table trying to find the configuration */ - for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { - 98e: 1f 5f subi r17, 0xFF ; 255 - 990: 4b 5d subi r20, 0xDB ; 219 - 992: 5f 4f sbci r21, 0xFF ; 255 - 994: 13 30 cpi r17, 0x03 ; 3 - 996: 91 f7 brne .-28 ; 0x97c - ConfigurationSetById(i); - return true; - } - } - - return false; - 998: 80 e0 ldi r24, 0x00 ; 0 -} - 99a: df 91 pop r29 - 99c: cf 91 pop r28 - 99e: 1f 91 pop r17 - 9a0: 0f 91 pop r16 - 9a2: 08 95 ret - bool StringMismatch = false; - char c = pgm_read_byte(pTableConfigName); - - /* Try to keep running until both strings end at the same point */ - while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - if ( (c == '\0') || (*pRequestedConfigName == '\0') ) { - 9a4: dc 01 movw r26, r24 - 9a6: fc 91 ld r31, X - 9a8: ff 23 and r31, r31 - 9aa: 89 f3 breq .-30 ; 0x98e - /* One String ended before the other did -> unequal length */ - StringMismatch = true; - break; - } - - if (c != *pRequestedConfigName) { - 9ac: cf 13 cpse r28, r31 - 9ae: ef cf rjmp .-34 ; 0x98e - 9b0: db 01 movw r26, r22 - 9b2: 05 c0 rjmp .+10 ; 0x9be - bool StringMismatch = false; - char c = pgm_read_byte(pTableConfigName); - - /* Try to keep running until both strings end at the same point */ - while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - if ( (c == '\0') || (*pRequestedConfigName == '\0') ) { - 9b4: fd 91 ld r31, X+ - 9b6: ff 23 and r31, r31 - 9b8: 51 f3 breq .-44 ; 0x98e - /* One String ended before the other did -> unequal length */ - StringMismatch = true; - break; - } - - if (c != *pRequestedConfigName) { - 9ba: f0 13 cpse r31, r16 - 9bc: e8 cf rjmp .-48 ; 0x98e - StringMismatch = true; - break; - } - - /* Proceed to next character */ - pTableConfigName++; - 9be: 2f 5f subi r18, 0xFF ; 255 - 9c0: 3f 4f sbci r19, 0xFF ; 255 - pRequestedConfigName++; - 9c2: ed 01 movw r28, r26 - - c = pgm_read_byte(pTableConfigName); - 9c4: f9 01 movw r30, r18 - 9c6: 04 91 lpm r16, Z - const char* pRequestedConfigName = ConfigurationName; - bool StringMismatch = false; - char c = pgm_read_byte(pTableConfigName); - - /* Try to keep running until both strings end at the same point */ - while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { - 9c8: 01 11 cpse r16, r1 - 9ca: f4 cf rjmp .-24 ; 0x9b4 - 9cc: 28 81 ld r18, Y - 9ce: 21 11 cpse r18, r1 - 9d0: de cf rjmp .-68 ; 0x98e - c = pgm_read_byte(pTableConfigName); - } - - if (!StringMismatch) { - /* Configuration found */ - ConfigurationSetById(i); - 9d2: 81 2f mov r24, r17 - 9d4: a8 df rcall .-176 ; 0x926 - return true; - 9d6: 81 e0 ldi r24, 0x01 ; 1 - } - } - - return false; -} - 9d8: df 91 pop r29 - 9da: cf 91 pop r28 - 9dc: 1f 91 pop r17 - 9de: 0f 91 pop r16 - 9e0: 08 95 ret - -000009e2 : - -void ConfigurationGetList(char* ConfigListOut, uint16_t ByteCount) -{ - 9e2: 0f 93 push r16 - 9e4: 1f 93 push r17 - 9e6: cf 93 push r28 - 9e8: df 93 push r29 - uint8_t i; - - /* Account for '\0' */ - ByteCount--; - 9ea: 61 50 subi r22, 0x01 ; 1 - 9ec: 71 09 sbc r23, r1 - 9ee: 49 ed ldi r20, 0xD9 ; 217 - 9f0: 52 e0 ldi r21, 0x02 ; 2 - ByteCount--; - } - - if ( i < (CONFIG_COUNT - 1) ) { - /* No comma on last configuration */ - *ConfigListOut++ = ','; - 9f2: 1c e2 ldi r17, 0x2C ; 44 - - /* Account for '\0' */ - ByteCount--; - - for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { - 9f6: fa 01 movw r30, r20 - 9f8: 04 91 lpm r16, Z - 9fa: 00 23 and r16, r16 - 9fc: 51 f1 breq .+84 ; 0xa52 - 9fe: 61 31 cpi r22, 0x11 ; 17 - a00: 71 05 cpc r23, r1 - a02: 20 f4 brcc .+8 ; 0xa0c - a04: 26 c0 rjmp .+76 ; 0xa52 - a06: 60 31 cpi r22, 0x10 ; 16 - a08: 71 05 cpc r23, r1 - a0a: 61 f0 breq .+24 ; 0xa24 - a0c: dc 01 movw r26, r24 - a0e: 01 96 adiw r24, 0x01 ; 1 - a10: ec 01 movw r28, r24 - /* While not end-of-string and enough buffer to - * put a complete configuration name */ - *ConfigListOut++ = c; - a12: 0c 93 st X, r16 - ConfigName++; - a14: 2f 5f subi r18, 0xFF ; 255 - a16: 3f 4f sbci r19, 0xFF ; 255 - ByteCount--; - a18: 61 50 subi r22, 0x01 ; 1 - a1a: 71 09 sbc r23, r1 - - for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { - a1c: f9 01 movw r30, r18 - a1e: 04 91 lpm r16, Z - a20: 01 11 cpse r16, r1 - a22: f1 cf rjmp .-30 ; 0xa06 - *ConfigListOut++ = c; - ConfigName++; - ByteCount--; - } - - if ( i < (CONFIG_COUNT - 1) ) { - a24: f3 e0 ldi r31, 0x03 ; 3 - a26: 43 32 cpi r20, 0x23 ; 35 - a28: 5f 07 cpc r21, r31 - a2a: 31 f4 brne .+12 ; 0xa38 - *ConfigListOut++ = ','; - ByteCount--; - } - } - - *ConfigListOut = '\0'; - a2c: 18 82 st Y, r1 -} - a2e: df 91 pop r29 - a30: cf 91 pop r28 - a32: 1f 91 pop r17 - a34: 0f 91 pop r16 - a36: 08 95 ret - ByteCount--; - } - - if ( i < (CONFIG_COUNT - 1) ) { - /* No comma on last configuration */ - *ConfigListOut++ = ','; - a38: ce 01 movw r24, r28 - a3a: 01 96 adiw r24, 0x01 ; 1 - a3c: 18 83 st Y, r17 - ByteCount--; - a3e: 61 50 subi r22, 0x01 ; 1 - a40: 71 09 sbc r23, r1 - a42: 4b 5d subi r20, 0xDB ; 219 - a44: 5f 4f sbci r21, 0xFF ; 255 - uint8_t i; - - /* Account for '\0' */ - ByteCount--; - - for (i=0; i - ByteCount--; - } - - if ( i < (CONFIG_COUNT - 1) ) { - /* No comma on last configuration */ - *ConfigListOut++ = ','; - a4e: ec 01 movw r28, r24 - a50: ed cf rjmp .-38 ; 0xa2c - - for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { - a52: ec 01 movw r28, r24 - a54: e7 cf rjmp .-50 ; 0xa24 - -00000a56 : -#include "Random.h" - -#include - -void RandomInit(void) -{ - a56: 08 95 ret - -00000a58 : - -} - -uint8_t RandomGetByte(void) -{ - return rand() & 0xFF; - a58: 0c 94 d7 23 jmp 0x47ae ; 0x47ae -} - a5c: 08 95 ret - -00000a5e : - -void RandomGetBuffer(void* Buffer, uint8_t ByteCount) -{ - a5e: 1f 93 push r17 - a60: cf 93 push r28 - a62: df 93 push r29 - uint8_t* BufferPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - a64: 66 23 and r22, r22 - a66: 39 f0 breq .+14 ; 0xa76 - a68: ec 01 movw r28, r24 - a6a: 16 2f mov r17, r22 - -} - -uint8_t RandomGetByte(void) -{ - return rand() & 0xFF; - a6c: 0e 94 d7 23 call 0x47ae ; 0x47ae - a70: 89 93 st Y+, r24 - a72: 11 50 subi r17, 0x01 ; 1 - -void RandomGetBuffer(void* Buffer, uint8_t ByteCount) -{ - uint8_t* BufferPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - a74: d9 f7 brne .-10 ; 0xa6c - *BufferPtr++ = RandomGetByte(); - } -} - a76: df 91 pop r29 - a78: cf 91 pop r28 - a7a: 1f 91 pop r17 - a7c: 08 95 ret - -00000a7e : - -void RandomTick(void) -{ - rand(); - a7e: 0e 94 d7 23 call 0x47ae ; 0x47ae - rand(); - a82: 0e 94 d7 23 call 0x47ae ; 0x47ae - rand(); - a86: 0e 94 d7 23 call 0x47ae ; 0x47ae - rand(); - a8a: 0c 94 d7 23 jmp 0x47ae ; 0x47ae - -00000a8e : - */ - -#include "Common.h" - -uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) -{ - a8e: cf 93 push r28 - a90: df 93 push r29 - a92: dc 01 movw r26, r24 - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t CharCount = 0; - - /* Account for '\0' at the end */ - MaxChars--; - a94: 61 50 subi r22, 0x01 ; 1 - a96: 71 09 sbc r23, r1 - - while( (ByteCount > 0) && (MaxChars >= 2) ) { - a98: 21 15 cp r18, r1 - a9a: 31 05 cpc r19, r1 - a9c: a9 f1 breq .+106 ; 0xb08 - a9e: 62 30 cpi r22, 0x02 ; 2 - aa0: 71 05 cpc r23, r1 - aa2: 90 f1 brcs .+100 ; 0xb08 - aa4: fa 01 movw r30, r20 - aa6: 21 50 subi r18, 0x01 ; 1 - aa8: 31 09 sbc r19, r1 - aaa: 24 0f add r18, r20 - aac: 35 1f adc r19, r21 -#include "Common.h" - -uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t CharCount = 0; - aae: 80 e0 ldi r24, 0x00 ; 0 - ab0: 90 e0 ldi r25, 0x00 ; 0 - ab2: 17 c0 rjmp .+46 ; 0xae2 - MaxChars--; - - while( (ByteCount > 0) && (MaxChars >= 2) ) { - uint8_t Byte = *ByteBuffer; - - HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); - ab4: d0 5d subi r29, 0xD0 ; 208 - ab6: dc 93 st X, r29 - HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); - ab8: cf 70 andi r28, 0x0F ; 15 - aba: 4c 2f mov r20, r28 - abc: 50 e0 ldi r21, 0x00 ; 0 - abe: 4a 30 cpi r20, 0x0A ; 10 - ac0: 51 05 cpc r21, r1 - ac2: 04 f5 brge .+64 ; 0xb04 - ac4: c0 5d subi r28, 0xD0 ; 208 - ac6: 11 96 adiw r26, 0x01 ; 1 - ac8: cc 93 st X, r28 - aca: 11 97 sbiw r26, 0x01 ; 1 - - HexOut += 2; - acc: 12 96 adiw r26, 0x02 ; 2 - MaxChars -= 2; - ace: 62 50 subi r22, 0x02 ; 2 - ad0: 71 09 sbc r23, r1 - CharCount += 2; - ad2: 02 96 adiw r24, 0x02 ; 2 - uint16_t CharCount = 0; - - /* Account for '\0' at the end */ - MaxChars--; - - while( (ByteCount > 0) && (MaxChars >= 2) ) { - ad4: e2 17 cp r30, r18 - ad6: f3 07 cpc r31, r19 - ad8: c9 f0 breq .+50 ; 0xb0c - ada: 31 96 adiw r30, 0x01 ; 1 - adc: 62 30 cpi r22, 0x02 ; 2 - ade: 71 05 cpc r23, r1 - ae0: a8 f0 brcs .+42 ; 0xb0c - uint8_t Byte = *ByteBuffer; - ae2: c0 81 ld r28, Z - - HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); - ae4: dc 2f mov r29, r28 - ae6: d2 95 swap r29 - ae8: df 70 andi r29, 0x0F ; 15 - aea: 4d 2f mov r20, r29 - aec: 50 e0 ldi r21, 0x00 ; 0 - aee: 4a 30 cpi r20, 0x0A ; 10 - af0: 51 05 cpc r21, r1 - af2: 04 f3 brlt .-64 ; 0xab4 - af4: d9 5c subi r29, 0xC9 ; 201 - af6: dc 93 st X, r29 - HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); - af8: cf 70 andi r28, 0x0F ; 15 - afa: 4c 2f mov r20, r28 - afc: 50 e0 ldi r21, 0x00 ; 0 - afe: 4a 30 cpi r20, 0x0A ; 10 - b00: 51 05 cpc r21, r1 - b02: 04 f3 brlt .-64 ; 0xac4 - b04: c9 5c subi r28, 0xC9 ; 201 - b06: df cf rjmp .-66 ; 0xac6 -#include "Common.h" - -uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t CharCount = 0; - b08: 80 e0 ldi r24, 0x00 ; 0 - b0a: 90 e0 ldi r25, 0x00 ; 0 - CharCount += 2; - ByteBuffer++; - ByteCount -= 1; - } - - *HexOut = '\0'; - b0c: 1c 92 st X, r1 - - return CharCount; -} - b0e: df 91 pop r29 - b10: cf 91 pop r28 - b12: 08 95 ret - -00000b14 : - -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - b14: dc 01 movw r26, r24 - b16: fa 01 movw r30, r20 - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - b18: 80 81 ld r24, Z - b1a: 88 23 and r24, r24 - b1c: 09 f4 brne .+2 ; 0xb20 - b1e: 41 c0 rjmp .+130 ; 0xba2 - b20: 91 81 ldd r25, Z+1 ; 0x01 - b22: 99 23 and r25, r25 - b24: d9 f1 breq .+118 ; 0xb9c -} - -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - b26: 20 e0 ldi r18, 0x00 ; 0 - b28: 30 e0 ldi r19, 0x00 ; 0 - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - b2a: 61 15 cp r22, r1 - b2c: 71 05 cpc r23, r1 - b2e: a1 f4 brne .+40 ; 0xb58 - b30: 33 c0 rjmp .+102 ; 0xb98 - if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { - uint8_t Byte = 0; - - Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; - b32: 82 95 swap r24 - b34: 80 7f andi r24, 0xF0 ; 240 - Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; - b36: 91 34 cpi r25, 0x41 ; 65 - b38: 30 f5 brcc .+76 ; 0xb86 - b3a: 94 2f mov r25, r20 - b3c: 89 2b or r24, r25 - - *ByteBuffer = Byte; - b3e: 8d 93 st X+, r24 - - ByteBuffer++; - MaxBytes--; - ByteCount++; - b40: 2f 5f subi r18, 0xFF ; 255 - b42: 3f 4f sbci r19, 0xFF ; 255 - HexIn += 2; - b44: 32 96 adiw r30, 0x02 ; 2 -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - b46: 80 81 ld r24, Z - b48: 88 23 and r24, r24 - b4a: 31 f1 breq .+76 ; 0xb98 - b4c: 91 81 ldd r25, Z+1 ; 0x01 - b4e: 99 23 and r25, r25 - b50: 29 f1 breq .+74 ; 0xb9c - b52: 62 17 cp r22, r18 - b54: 73 07 cpc r23, r19 - b56: 01 f1 breq .+64 ; 0xb98 - if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { - b58: 40 ed ldi r20, 0xD0 ; 208 - b5a: 48 0f add r20, r24 - b5c: 4a 30 cpi r20, 0x0A ; 10 - b5e: 20 f0 brcs .+8 ; 0xb68 - b60: 4f eb ldi r20, 0xBF ; 191 - b62: 48 0f add r20, r24 - b64: 46 30 cpi r20, 0x06 ; 6 - b66: d0 f4 brcc .+52 ; 0xb9c - b68: 40 ed ldi r20, 0xD0 ; 208 - b6a: 49 0f add r20, r25 - b6c: 4a 30 cpi r20, 0x0A ; 10 - b6e: 20 f0 brcs .+8 ; 0xb78 - b70: 5f eb ldi r21, 0xBF ; 191 - b72: 59 0f add r21, r25 - b74: 56 30 cpi r21, 0x06 ; 6 - b76: 90 f4 brcc .+36 ; 0xb9c - uint8_t Byte = 0; - - Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; - b78: 81 34 cpi r24, 0x41 ; 65 - b7a: d8 f2 brcs .-74 ; 0xb32 - b7c: 82 95 swap r24 - b7e: 80 7f andi r24, 0xF0 ; 240 - b80: 80 57 subi r24, 0x70 ; 112 - Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; - b82: 91 34 cpi r25, 0x41 ; 65 - b84: d0 f2 brcs .-76 ; 0xb3a - b86: 97 53 subi r25, 0x37 ; 55 - b88: 89 2b or r24, r25 - - *ByteBuffer = Byte; - b8a: 8d 93 st X+, r24 - - ByteBuffer++; - MaxBytes--; - ByteCount++; - b8c: 2f 5f subi r18, 0xFF ; 255 - b8e: 3f 4f sbci r19, 0xFF ; 255 - HexIn += 2; - b90: 32 96 adiw r30, 0x02 ; 2 -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - - while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { - b92: 80 81 ld r24, Z - b94: 81 11 cpse r24, r1 - b96: da cf rjmp .-76 ; 0xb4c - if ( (HexIn[0] != '\0') && (HexIn[1] == '\0') ) { - /* Odd number of characters */ - return 0; - } - - return ByteCount; - b98: c9 01 movw r24, r18 - b9a: 08 95 ret - } - } - - if ( (HexIn[0] != '\0') && (HexIn[1] == '\0') ) { - /* Odd number of characters */ - return 0; - b9c: 80 e0 ldi r24, 0x00 ; 0 - b9e: 90 e0 ldi r25, 0x00 ; 0 - } - - return ByteCount; -} - ba0: 08 95 ret -} - -uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - uint16_t ByteCount = 0; - ba2: 20 e0 ldi r18, 0x00 ; 0 - ba4: 30 e0 ldi r19, 0x00 ; 0 - ba6: f8 cf rjmp .-16 ; 0xb98 - -00000ba8 : - MemoryRecall(); -} - -void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) -{ - uint8_t* SrcPtr = &Memory[Address]; - ba8: fb 01 movw r30, r22 - baa: ee 56 subi r30, 0x6E ; 110 - bac: ff 4d sbci r31, 0xDF ; 223 - uint8_t* DstPtr = (uint8_t*) Buffer; - - /* Prevent Buf Ovfs */ - ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); - bae: 20 e0 ldi r18, 0x00 ; 0 - bb0: 34 e0 ldi r19, 0x04 ; 4 - bb2: 26 1b sub r18, r22 - bb4: 37 0b sbc r19, r23 - bb6: 42 17 cp r20, r18 - bb8: 53 07 cpc r21, r19 - bba: 08 f4 brcc .+2 ; 0xbbe - bbc: 9a 01 movw r18, r20 - - while(ByteCount--) { - bbe: 21 15 cp r18, r1 - bc0: 31 05 cpc r19, r1 - bc2: 49 f0 breq .+18 ; 0xbd6 - bc4: dc 01 movw r26, r24 - bc6: cf 01 movw r24, r30 - bc8: 82 0f add r24, r18 - bca: 93 1f adc r25, r19 - *DstPtr++ = *SrcPtr++; - bcc: 21 91 ld r18, Z+ - bce: 2d 93 st X+, r18 - uint8_t* DstPtr = (uint8_t*) Buffer; - - /* Prevent Buf Ovfs */ - ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); - - while(ByteCount--) { - bd0: e8 17 cp r30, r24 - bd2: f9 07 cpc r31, r25 - bd4: d9 f7 brne .-10 ; 0xbcc - bd6: 08 95 ret - -00000bd8 : -} - -void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) -{ - uint8_t* SrcPtr = (uint8_t*) Buffer; - uint8_t* DstPtr = &Memory[Address]; - bd8: db 01 movw r26, r22 - bda: ae 56 subi r26, 0x6E ; 110 - bdc: bf 4d sbci r27, 0xDF ; 223 - - /* Prevent Buf Ovfs */ - ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); - bde: 20 e0 ldi r18, 0x00 ; 0 - be0: 34 e0 ldi r19, 0x04 ; 4 - be2: 26 1b sub r18, r22 - be4: 37 0b sbc r19, r23 - be6: 42 17 cp r20, r18 - be8: 53 07 cpc r21, r19 - bea: 08 f4 brcc .+2 ; 0xbee - bec: 9a 01 movw r18, r20 - - while(ByteCount--) { - bee: 21 15 cp r18, r1 - bf0: 31 05 cpc r19, r1 - bf2: 41 f0 breq .+16 ; 0xc04 - bf4: fc 01 movw r30, r24 - bf6: 82 0f add r24, r18 - bf8: 93 1f adc r25, r19 - *DstPtr++ = *SrcPtr++; - bfa: 21 91 ld r18, Z+ - bfc: 2d 93 st X+, r18 - uint8_t* DstPtr = &Memory[Address]; - - /* Prevent Buf Ovfs */ - ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); - - while(ByteCount--) { - bfe: e8 17 cp r30, r24 - c00: f9 07 cpc r31, r25 - c02: d9 f7 brne .-10 ; 0xbfa - c04: 08 95 ret - -00000c06 : - *DstPtr++ = *SrcPtr++; - } -} - -void MemoryClear(void) -{ - c06: 80 e0 ldi r24, 0x00 ; 0 - c08: 94 e0 ldi r25, 0x04 ; 4 - c0a: e2 e9 ldi r30, 0x92 ; 146 - c0c: f0 e2 ldi r31, 0x20 ; 32 - c0e: df 01 movw r26, r30 - c10: 9c 01 movw r18, r24 - c12: 1d 92 st X+, r1 - c14: 21 50 subi r18, 0x01 ; 1 - c16: 30 40 sbci r19, 0x00 ; 0 - c18: e1 f7 brne .-8 ; 0xc12 - c1a: 08 95 ret - -00000c1c : -} - -void MemoryRecall(void) -{ - /* Recall memory from permanent flash */ - FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); - c1c: 80 91 fd 24 lds r24, 0x24FD - c20: 90 e0 ldi r25, 0x00 ; 0 - c22: a0 e0 ldi r26, 0x00 ; 0 - c24: b0 e0 ldi r27, 0x00 ; 0 - c26: 4a e0 ldi r20, 0x0A ; 10 - c28: 88 0f add r24, r24 - c2a: 99 1f adc r25, r25 - c2c: aa 1f adc r26, r26 - c2e: bb 1f adc r27, r27 - c30: 4a 95 dec r20 - c32: d1 f7 brne .-12 ; 0xc28 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - c34: 40 e1 ldi r20, 0x10 ; 16 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c36: 57 ed ldi r21, 0xD7 ; 215 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c38: 30 e4 ldi r19, 0x40 ; 64 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - c3a: 40 93 66 06 sts 0x0666, r20 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c3e: 50 93 a0 09 sts 0x09A0, r21 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c42: 20 91 a1 09 lds r18, 0x09A1 - c46: 26 ff sbrs r18, 6 - c48: fc cf rjmp .-8 ; 0xc42 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c4a: 30 93 a1 09 sts 0x09A1, r19 - - return MEMORY_FLASH_USART.DATA; - c4e: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c52: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c56: 20 91 a1 09 lds r18, 0x09A1 - c5a: 26 ff sbrs r18, 6 - c5c: fc cf rjmp .-8 ; 0xc56 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c5e: 30 93 a1 09 sts 0x09A1, r19 - - return MEMORY_FLASH_USART.DATA; - c62: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - c66: 40 93 65 06 sts 0x0665, r20 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashRead(void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(FlashIsBusy()); - c6a: 27 ff sbrs r18, 7 - c6c: e6 cf rjmp .-52 ; 0xc3a - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - c6e: 20 e1 ldi r18, 0x10 ; 16 - c70: 20 93 66 06 sts 0x0666, r18 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c74: 23 e0 ldi r18, 0x03 ; 3 - c76: 20 93 a0 09 sts 0x09A0, r18 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c7a: 20 91 a1 09 lds r18, 0x09A1 - c7e: 26 ff sbrs r18, 6 - c80: fc cf rjmp .-8 ; 0xc7a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c82: 20 e4 ldi r18, 0x40 ; 64 - c84: 20 93 a1 09 sts 0x09A1, r18 - - return MEMORY_FLASH_USART.DATA; - c88: 20 91 a0 09 lds r18, 0x09A0 -{ - while(FlashIsBusy()); - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(0x03); - SPITransferByte( (Address >> 16) & 0xFF ); - c8c: ad 01 movw r20, r26 - c8e: 66 27 eor r22, r22 - c90: 77 27 eor r23, r23 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - c92: 40 93 a0 09 sts 0x09A0, r20 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - c96: 20 91 a1 09 lds r18, 0x09A1 - c9a: 26 ff sbrs r18, 6 - c9c: fc cf rjmp .-8 ; 0xc96 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - c9e: 20 e4 ldi r18, 0x40 ; 64 - ca0: 20 93 a1 09 sts 0x09A1, r18 - - return MEMORY_FLASH_USART.DATA; - ca4: 20 91 a0 09 lds r18, 0x09A0 - while(FlashIsBusy()); - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(0x03); - SPITransferByte( (Address >> 16) & 0xFF ); - SPITransferByte( (Address >> 8) & 0xFF ); - ca8: 89 2f mov r24, r25 - caa: 9a 2f mov r25, r26 - cac: ab 2f mov r26, r27 - cae: bb 27 eor r27, r27 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - cb0: 80 93 a0 09 sts 0x09A0, r24 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - cb4: 80 91 a1 09 lds r24, 0x09A1 - cb8: 86 ff sbrs r24, 6 - cba: fc cf rjmp .-8 ; 0xcb4 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - cbc: 80 e4 ldi r24, 0x40 ; 64 - cbe: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - cc2: 80 91 a0 09 lds r24, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - cc6: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - cca: 80 91 a1 09 lds r24, 0x09A1 - cce: 86 ff sbrs r24, 6 - cd0: fc cf rjmp .-8 ; 0xcca - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - cd2: 80 e4 ldi r24, 0x40 ; 64 - cd4: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - cd8: 80 91 a0 09 lds r24, 0x09A0 - cdc: e2 e9 ldi r30, 0x92 ; 146 - cde: f0 e2 ldi r31, 0x20 ; 32 - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - MEMORY_FLASH_USART.DATA = 0; - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ce0: 90 e4 ldi r25, 0x40 ; 64 -INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - MEMORY_FLASH_USART.DATA = 0; - ce2: 10 92 a0 09 sts 0x09A0, r1 - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ce6: 80 91 a1 09 lds r24, 0x09A1 - cea: 86 ff sbrs r24, 6 - cec: fc cf rjmp .-8 ; 0xce6 - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - cee: 90 93 a1 09 sts 0x09A1, r25 - *ByteBuffer++ = MEMORY_FLASH_USART.DATA; - cf2: 80 91 a0 09 lds r24, 0x09A0 - cf6: 81 93 st Z+, r24 - -INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - cf8: 84 e2 ldi r24, 0x24 ; 36 - cfa: e2 39 cpi r30, 0x92 ; 146 - cfc: f8 07 cpc r31, r24 - cfe: 89 f7 brne .-30 ; 0xce2 - SPITransferByte(0x03); - SPITransferByte( (Address >> 16) & 0xFF ); - SPITransferByte( (Address >> 8) & 0xFF ); - SPITransferByte( (Address >> 0) & 0xFF ); - SPIReadBlock(Buffer, ByteCount); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - d00: 80 e1 ldi r24, 0x10 ; 16 - d02: 80 93 65 06 sts 0x0665, r24 - d06: 08 95 ret - -00000d08 : - SPITransferByte( 0 ); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -void MemoryInit(void) -{ - d08: cf 93 push r28 - d0a: df 93 push r29 - d0c: 00 d0 rcall .+0 ; 0xd0e - d0e: 00 d0 rcall .+0 ; 0xd10 - d10: cd b7 in r28, 0x3d ; 61 - d12: de b7 in r29, 0x3e ; 62 - /* Configure MEMORY_FLASH_USART for SPI master mode 0 with maximum clock frequency */ - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - d14: 80 e1 ldi r24, 0x10 ; 16 - d16: 80 93 65 06 sts 0x0665, r24 - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_SCK; - d1a: 92 e0 ldi r25, 0x02 ; 2 - d1c: 90 93 66 06 sts 0x0666, r25 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_MOSI; - d20: 98 e0 ldi r25, 0x08 ; 8 - d22: 90 93 65 06 sts 0x0665, r25 - - MEMORY_FLASH_PORT.DIRSET = MEMORY_FLASH_SCK | MEMORY_FLASH_MOSI | MEMORY_FLASH_CS; - d26: 9a e1 ldi r25, 0x1A ; 26 - d28: 90 93 61 06 sts 0x0661, r25 - - MEMORY_FLASH_USART.BAUDCTRLA = 0; - d2c: 10 92 a6 09 sts 0x09A6, r1 - MEMORY_FLASH_USART.BAUDCTRLB = 0; - d30: 10 92 a7 09 sts 0x09A7, r1 - MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; - d34: 90 ec ldi r25, 0xC0 ; 192 - d36: 90 93 a5 09 sts 0x09A5, r25 - MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; - d3a: 98 e1 ldi r25, 0x18 ; 24 - d3c: 90 93 a4 09 sts 0x09A4, r25 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - d40: 80 93 66 06 sts 0x0666, r24 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - d44: 87 ed ldi r24, 0xD7 ; 215 - d46: 80 93 a0 09 sts 0x09A0, r24 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - d4a: 80 91 a1 09 lds r24, 0x09A1 - d4e: 86 ff sbrs r24, 6 - d50: fc cf rjmp .-8 ; 0xd4a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - d52: 80 e4 ldi r24, 0x40 ; 64 - d54: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - d58: 80 91 a0 09 lds r24, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - d5c: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - d60: 80 91 a1 09 lds r24, 0x09A1 - d64: 86 ff sbrs r24, 6 - d66: fc cf rjmp .-8 ; 0xd60 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - d68: 80 e4 ldi r24, 0x40 ; 64 - d6a: 80 93 a1 09 sts 0x09A1, r24 - - return MEMORY_FLASH_USART.DATA; - d6e: 80 91 a0 09 lds r24, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - d72: 90 e1 ldi r25, 0x10 ; 16 - d74: 90 93 65 06 sts 0x0665, r25 - MEMORY_FLASH_USART.BAUDCTRLB = 0; - MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; - MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; - - - if ( !(FlashReadStatusRegister() & FLASH_STATUS_REG_PAGESIZE_BIT) ) { - d78: 80 fd sbrc r24, 0 - d7a: 3e c0 rjmp .+124 ; 0xdf8 - return !(FlashReadStatusRegister() & FLASH_STATUS_REG_READY_BIT); -} - -INLINE void FlashConfigurePageSize(void) -{ - uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; - d7c: 8d e3 ldi r24, 0x3D ; 61 - d7e: 89 83 std Y+1, r24 ; 0x01 - d80: 8a e2 ldi r24, 0x2A ; 42 - d82: 8a 83 std Y+2, r24 ; 0x02 - d84: 80 e8 ldi r24, 0x80 ; 128 - d86: 8b 83 std Y+3, r24 ; 0x03 - d88: 86 ea ldi r24, 0xA6 ; 166 - d8a: 8c 83 std Y+4, r24 ; 0x04 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - d8c: 20 e1 ldi r18, 0x10 ; 16 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - d8e: 37 ed ldi r19, 0xD7 ; 215 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - d90: 90 e4 ldi r25, 0x40 ; 64 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - d92: 20 93 66 06 sts 0x0666, r18 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - d96: 30 93 a0 09 sts 0x09A0, r19 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - d9a: 80 91 a1 09 lds r24, 0x09A1 - d9e: 86 ff sbrs r24, 6 - da0: fc cf rjmp .-8 ; 0xd9a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - da2: 90 93 a1 09 sts 0x09A1, r25 - - return MEMORY_FLASH_USART.DATA; - da6: 80 91 a0 09 lds r24, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - daa: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - dae: 80 91 a1 09 lds r24, 0x09A1 - db2: 86 ff sbrs r24, 6 - db4: fc cf rjmp .-8 ; 0xdae - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - db6: 90 93 a1 09 sts 0x09A1, r25 - - return MEMORY_FLASH_USART.DATA; - dba: 80 91 a0 09 lds r24, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - dbe: 20 93 65 06 sts 0x0665, r18 - -INLINE void FlashConfigurePageSize(void) -{ - uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; - - while(FlashIsBusy()); - dc2: 87 ff sbrs r24, 7 - dc4: e6 cf rjmp .-52 ; 0xd92 - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - dc6: 80 e1 ldi r24, 0x10 ; 16 - dc8: 80 93 66 06 sts 0x0666, r24 - dcc: fe 01 movw r30, r28 - dce: 31 96 adiw r30, 0x01 ; 1 - dd0: ce 01 movw r24, r28 - dd2: 05 96 adiw r24, 0x05 ; 5 - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - MEMORY_FLASH_USART.DATA = *ByteBuffer++; - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - dd4: 30 e4 ldi r19, 0x40 ; 64 -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - MEMORY_FLASH_USART.DATA = *ByteBuffer++; - dd6: 21 91 ld r18, Z+ - dd8: 20 93 a0 09 sts 0x09A0, r18 - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ddc: 20 91 a1 09 lds r18, 0x09A1 - de0: 26 ff sbrs r18, 6 - de2: fc cf rjmp .-8 ; 0xddc - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - de4: 30 93 a1 09 sts 0x09A1, r19 - MEMORY_FLASH_USART.DATA; /* Flush Buffer */ - de8: 20 91 a0 09 lds r18, 0x09A0 - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - dec: e8 17 cp r30, r24 - dee: f9 07 cpc r31, r25 - df0: 91 f7 brne .-28 ; 0xdd6 - - while(FlashIsBusy()); - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPIWriteBlock(Sequence, sizeof(Sequence)); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - df2: 80 e1 ldi r24, 0x10 ; 16 - df4: 80 93 65 06 sts 0x0665, r24 - FlashConfigurePageSize(); - } - - /* Load permanent flash contents to memory at startup */ - MemoryRecall(); -} - df8: 24 96 adiw r28, 0x04 ; 4 - dfa: cd bf out 0x3d, r28 ; 61 - dfc: de bf out 0x3e, r29 ; 62 - dfe: df 91 pop r29 - e00: cf 91 pop r28 - /* Configure for 256 byte Dataflash if not already done. */ - FlashConfigurePageSize(); - } - - /* Load permanent flash contents to memory at startup */ - MemoryRecall(); - e02: 0c cf rjmp .-488 ; 0xc1c - -00000e04 : - /* Recall memory from permanent flash */ - FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); -} - -void MemoryStore(void) -{ - e04: 5f 92 push r5 - e06: 6f 92 push r6 - e08: 7f 92 push r7 - e0a: 8f 92 push r8 - e0c: 9f 92 push r9 - e0e: af 92 push r10 - e10: bf 92 push r11 - e12: cf 92 push r12 - e14: df 92 push r13 - e16: ef 92 push r14 - e18: ff 92 push r15 - e1a: 0f 93 push r16 - e1c: 1f 93 push r17 - e1e: cf 93 push r28 - e20: df 93 push r29 - /* Store current memory into permanent flash */ - FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); - e22: 80 91 fd 24 lds r24, 0x24FD - e26: 90 e0 ldi r25, 0x00 ; 0 - e28: a0 e0 ldi r26, 0x00 ; 0 - e2a: b0 e0 ldi r27, 0x00 ; 0 - e2c: 6a e0 ldi r22, 0x0A ; 10 - e2e: 88 0f add r24, r24 - e30: 99 1f adc r25, r25 - e32: aa 1f adc r26, r26 - e34: bb 1f adc r27, r27 - e36: 6a 95 dec r22 - e38: d1 f7 brne .-12 ; 0xe2e - e3a: 00 e0 ldi r16, 0x00 ; 0 - e3c: 14 e0 ldi r17, 0x04 ; 4 -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - uint16_t PageAddress = Address / FLASH_PAGE_SIZE; - uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; - uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); - e3e: e1 2c mov r14, r1 - e40: ff 24 eor r15, r15 - e42: f3 94 inc r15 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - e44: e0 e1 ldi r30, 0x10 ; 16 - e46: ce 2e mov r12, r30 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - e48: f7 ed ldi r31, 0xD7 ; 215 - e4a: bf 2e mov r11, r31 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e4c: c0 e4 ldi r28, 0x40 ; 64 - e4e: dc 2e mov r13, r28 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - e50: d0 e1 ldi r29, 0x10 ; 16 - e52: ad 2e mov r10, r29 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - e54: 27 ed ldi r18, 0xD7 ; 215 - e56: 92 2e mov r9, r18 - e58: 33 e5 ldi r19, 0x53 ; 83 - e5a: 63 2e mov r6, r19 - e5c: 44 e8 ldi r20, 0x84 ; 132 - e5e: 74 2e mov r7, r20 - e60: 53 e8 ldi r21, 0x83 ; 131 - e62: 85 2e mov r8, r21 -} - -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - uint16_t PageAddress = Address / FLASH_PAGE_SIZE; - e64: 49 2f mov r20, r25 - e66: 5a 2f mov r21, r26 - e68: 6b 2f mov r22, r27 - e6a: 77 27 eor r23, r23 - uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; - e6c: 38 2f mov r19, r24 - uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); - e6e: e7 01 movw r28, r14 - e70: c8 1b sub r28, r24 - e72: d1 09 sbc r29, r1 - e74: 0c 17 cp r16, r28 - e76: 1d 07 cpc r17, r29 - e78: 08 f4 brcc .+2 ; 0xe7c - e7a: e8 01 movw r28, r16 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - e7c: a0 92 66 06 sts 0x0666, r10 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - e80: 90 92 a0 09 sts 0x09A0, r9 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e84: 20 91 a1 09 lds r18, 0x09A1 - e88: 26 ff sbrs r18, 6 - e8a: fc cf rjmp .-8 ; 0xe84 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - e8c: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - e90: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - e94: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - e98: 20 91 a1 09 lds r18, 0x09A1 - e9c: 26 ff sbrs r18, 6 - e9e: fc cf rjmp .-8 ; 0xe98 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ea0: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - ea4: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - ea8: c0 92 65 06 sts 0x0665, r12 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashMemoryToBuffer(uint16_t PageAddress) -{ - while(FlashIsBusy()); - eac: 27 ff sbrs r18, 7 - eae: e6 cf rjmp .-52 ; 0xe7c - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - eb0: a0 92 66 06 sts 0x0666, r10 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - eb4: 60 92 a0 09 sts 0x09A0, r6 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - eb8: 20 91 a1 09 lds r18, 0x09A1 - ebc: 26 ff sbrs r18, 6 - ebe: fc cf rjmp .-8 ; 0xeb8 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ec0: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - ec4: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - ec8: 50 93 a0 09 sts 0x09A0, r21 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ecc: 20 91 a1 09 lds r18, 0x09A1 - ed0: 26 ff sbrs r18, 6 - ed2: fc cf rjmp .-8 ; 0xecc - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ed4: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - ed8: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - edc: 40 93 a0 09 sts 0x09A0, r20 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ee0: 20 91 a1 09 lds r18, 0x09A1 - ee4: 26 ff sbrs r18, 6 - ee6: fc cf rjmp .-8 ; 0xee0 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - ee8: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - eec: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - ef0: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ef4: 20 91 a1 09 lds r18, 0x09A1 - ef8: 26 ff sbrs r18, 6 - efa: fc cf rjmp .-8 ; 0xef4 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - efc: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f00: 20 91 a0 09 lds r18, 0x09A0 - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_MEM_TO_BUF1); - SPITransferByte( (PageAddress >> 8) & 0xFF ); - SPITransferByte( (PageAddress >> 0) & 0xFF ); - SPITransferByte( 0 ); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - f04: c0 92 65 06 sts 0x0665, r12 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - f08: c0 92 66 06 sts 0x0666, r12 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - f0c: b0 92 a0 09 sts 0x09A0, r11 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f10: 20 91 a1 09 lds r18, 0x09A1 - f14: 26 ff sbrs r18, 6 - f16: fc cf rjmp .-8 ; 0xf10 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f18: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f1c: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - f20: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f24: 20 91 a1 09 lds r18, 0x09A1 - f28: 26 ff sbrs r18, 6 - f2a: fc cf rjmp .-8 ; 0xf24 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f2c: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f30: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - f34: c0 92 65 06 sts 0x0665, r12 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashWriteBuffer(const void* Buffer, uint8_t Address, uint16_t ByteCount) -{ - while(FlashIsBusy()); - f38: 27 ff sbrs r18, 7 - f3a: e6 cf rjmp .-52 ; 0xf08 - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - f3c: a0 92 66 06 sts 0x0666, r10 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - f40: 70 92 a0 09 sts 0x09A0, r7 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f44: 20 91 a1 09 lds r18, 0x09A1 - f48: 26 ff sbrs r18, 6 - f4a: fc cf rjmp .-8 ; 0xf44 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f4c: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f50: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - f54: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f58: 20 91 a1 09 lds r18, 0x09A1 - f5c: 26 ff sbrs r18, 6 - f5e: fc cf rjmp .-8 ; 0xf58 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f60: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f64: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - f68: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f6c: 20 91 a1 09 lds r18, 0x09A1 - f70: 26 ff sbrs r18, 6 - f72: fc cf rjmp .-8 ; 0xf6c - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f74: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f78: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - f7c: 30 93 a0 09 sts 0x09A0, r19 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - f80: 20 91 a1 09 lds r18, 0x09A1 - f84: 26 ff sbrs r18, 6 - f86: fc cf rjmp .-8 ; 0xf80 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - f88: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - f8c: 20 91 a0 09 lds r18, 0x09A0 - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - f90: 20 97 sbiw r28, 0x00 ; 0 - f92: 99 f0 breq .+38 ; 0xfba - f94: e2 e9 ldi r30, 0x92 ; 146 - f96: f0 e2 ldi r31, 0x20 ; 32 - f98: 9e 01 movw r18, r28 - f9a: 2e 56 subi r18, 0x6E ; 110 - f9c: 3f 4d sbci r19, 0xDF ; 223 - MEMORY_FLASH_USART.DATA = *ByteBuffer++; - f9e: 51 90 ld r5, Z+ - fa0: 50 92 a0 09 sts 0x09A0, r5 - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - fa4: 50 90 a1 09 lds r5, 0x09A1 - fa8: 56 fe sbrs r5, 6 - faa: fc cf rjmp .-8 ; 0xfa4 - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fac: d0 92 a1 09 sts 0x09A1, r13 - MEMORY_FLASH_USART.DATA; /* Flush Buffer */ - fb0: 50 90 a0 09 lds r5, 0x09A0 - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - fb4: e2 17 cp r30, r18 - fb6: f3 07 cpc r31, r19 - fb8: 91 f7 brne .-28 ; 0xf9e - SPITransferByte(FLASH_CMD_BUF1_WRITE); - SPITransferByte( 0 ); - SPITransferByte( 0 ); - SPITransferByte( Address ); - SPIWriteBlock(Buffer, ByteCount); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - fba: c0 92 65 06 sts 0x0665, r12 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - fbe: c0 92 66 06 sts 0x0666, r12 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - fc2: b0 92 a0 09 sts 0x09A0, r11 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - fc6: 20 91 a1 09 lds r18, 0x09A1 - fca: 26 ff sbrs r18, 6 - fcc: fc cf rjmp .-8 ; 0xfc6 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fce: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - fd2: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - fd6: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - fda: 20 91 a1 09 lds r18, 0x09A1 - fde: 26 ff sbrs r18, 6 - fe0: fc cf rjmp .-8 ; 0xfda - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - fe2: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - fe6: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - fea: c0 92 65 06 sts 0x0665, r12 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashBufferToMemory(uint16_t PageAddress) -{ - while(FlashIsBusy()); - fee: 27 ff sbrs r18, 7 - ff0: e6 cf rjmp .-52 ; 0xfbe - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - ff2: a0 92 66 06 sts 0x0666, r10 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - ff6: 80 92 a0 09 sts 0x09A0, r8 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - ffa: 20 91 a1 09 lds r18, 0x09A1 - ffe: 26 ff sbrs r18, 6 - 1000: fc cf rjmp .-8 ; 0xffa - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1002: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - 1006: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 100a: 50 93 a0 09 sts 0x09A0, r21 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 100e: 20 91 a1 09 lds r18, 0x09A1 - 1012: 26 ff sbrs r18, 6 - 1014: fc cf rjmp .-8 ; 0x100e - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1016: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - 101a: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 101e: 40 93 a0 09 sts 0x09A0, r20 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1022: 20 91 a1 09 lds r18, 0x09A1 - 1026: 26 ff sbrs r18, 6 - 1028: fc cf rjmp .-8 ; 0x1022 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 102a: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - 102e: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1032: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1036: 20 91 a1 09 lds r18, 0x09A1 - 103a: 26 ff sbrs r18, 6 - 103c: fc cf rjmp .-8 ; 0x1036 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 103e: d0 92 a1 09 sts 0x09A1, r13 - - return MEMORY_FLASH_USART.DATA; - 1042: 20 91 a0 09 lds r18, 0x09A0 - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_BUF1_TO_MEM_ERASE); - SPITransferByte( (PageAddress >> 8) & 0xFF ); - SPITransferByte( (PageAddress >> 0) & 0xFF ); - SPITransferByte( 0 ); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 1046: c0 92 65 06 sts 0x0665, r12 - - FlashMemoryToBuffer(PageAddress); - FlashWriteBuffer(Buffer, ByteAddress, PageBytes); - FlashBufferToMemory(PageAddress); - - ByteCount -= PageBytes; - 104a: 0c 1b sub r16, r28 - 104c: 1d 0b sbc r17, r29 - Address += PageBytes; - 104e: 8c 0f add r24, r28 - 1050: 9d 1f adc r25, r29 - 1052: a1 1d adc r26, r1 - 1054: b1 1d adc r27, r1 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - 1056: 01 15 cp r16, r1 - 1058: 11 05 cpc r17, r1 - 105a: 09 f0 breq .+2 ; 0x105e - 105c: 03 cf rjmp .-506 ; 0xe64 - -void MemoryStore(void) -{ - /* Store current memory into permanent flash */ - FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); -} - 105e: df 91 pop r29 - 1060: cf 91 pop r28 - 1062: 1f 91 pop r17 - 1064: 0f 91 pop r16 - 1066: ff 90 pop r15 - 1068: ef 90 pop r14 - 106a: df 90 pop r13 - 106c: cf 90 pop r12 - 106e: bf 90 pop r11 - 1070: af 90 pop r10 - 1072: 9f 90 pop r9 - 1074: 8f 90 pop r8 - 1076: 7f 90 pop r7 - 1078: 6f 90 pop r6 - 107a: 5f 90 pop r5 - 107c: 08 95 ret - -0000107e : - -bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) -{ - 107e: 2f 92 push r2 - 1080: 3f 92 push r3 - 1082: 4f 92 push r4 - 1084: 5f 92 push r5 - 1086: 6f 92 push r6 - 1088: 7f 92 push r7 - 108a: 8f 92 push r8 - 108c: 9f 92 push r9 - 108e: af 92 push r10 - 1090: bf 92 push r11 - 1092: cf 92 push r12 - 1094: df 92 push r13 - 1096: ef 92 push r14 - 1098: ff 92 push r15 - 109a: 0f 93 push r16 - 109c: 1f 93 push r17 - 109e: cf 93 push r28 - 10a0: df 93 push r29 - 10a2: cd b7 in r28, 0x3d ; 61 - 10a4: de b7 in r29, 0x3e ; 62 - 10a6: 2a 97 sbiw r28, 0x0a ; 10 - 10a8: cd bf out 0x3d, r28 ; 61 - 10aa: de bf out 0x3e, r29 ; 62 - 10ac: 8c 01 movw r16, r24 - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - 10ae: 41 15 cp r20, r1 - 10b0: 84 e0 ldi r24, 0x04 ; 4 - 10b2: 58 07 cpc r21, r24 - 10b4: 61 05 cpc r22, r1 - 10b6: 71 05 cpc r23, r1 - 10b8: 08 f0 brcs .+2 ; 0x10bc - 10ba: 8e c1 rjmp .+796 ; 0x13d8 - /* Prevent writing out of bounds by silently ignoring it */ - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - 10bc: 80 91 fd 24 lds r24, 0x24FD - 10c0: 90 e0 ldi r25, 0x00 ; 0 - 10c2: a0 e0 ldi r26, 0x00 ; 0 - 10c4: b0 e0 ldi r27, 0x00 ; 0 - 10c6: ea e0 ldi r30, 0x0A ; 10 - 10c8: 88 0f add r24, r24 - 10ca: 99 1f adc r25, r25 - 10cc: aa 1f adc r26, r26 - 10ce: bb 1f adc r27, r27 - 10d0: ea 95 dec r30 - 10d2: d1 f7 brne .-12 ; 0x10c8 - 10d4: 84 0f add r24, r20 - 10d6: 95 1f adc r25, r21 - 10d8: a6 1f adc r26, r22 - 10da: b7 1f adc r27, r23 - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - /* Prevent writing out of bounds by silently ignoring it */ - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - 10dc: 81 2c mov r8, r1 - 10de: f4 e0 ldi r31, 0x04 ; 4 - 10e0: 9f 2e mov r9, r31 - 10e2: a1 2c mov r10, r1 - 10e4: b1 2c mov r11, r1 - uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - ByteCount = MIN(ByteCount, BytesLeft); - 10e6: 69 01 movw r12, r18 - 10e8: e1 2c mov r14, r1 - 10ea: f1 2c mov r15, r1 - 10ec: 84 1a sub r8, r20 - 10ee: 95 0a sbc r9, r21 - 10f0: a6 0a sbc r10, r22 - 10f2: b7 0a sbc r11, r23 - 10f4: 89 82 std Y+1, r8 ; 0x01 - 10f6: 9a 82 std Y+2, r9 ; 0x02 - 10f8: ab 82 std Y+3, r10 ; 0x03 - 10fa: bc 82 std Y+4, r11 ; 0x04 - 10fc: c8 14 cp r12, r8 - 10fe: d9 04 cpc r13, r9 - 1100: ea 04 cpc r14, r10 - 1102: fb 04 cpc r15, r11 - 1104: 08 f4 brcc .+2 ; 0x1108 - 1106: 7f c1 rjmp .+766 ; 0x1406 - 1108: 29 81 ldd r18, Y+1 ; 0x01 - 110a: 3a 81 ldd r19, Y+2 ; 0x02 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - 110c: 21 15 cp r18, r1 - 110e: 31 05 cpc r19, r1 - 1110: 09 f4 brne .+2 ; 0x1114 - 1112: 62 c1 rjmp .+708 ; 0x13d8 - uint16_t PageAddress = Address / FLASH_PAGE_SIZE; - uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; - uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); - 1114: e1 2c mov r14, r1 - 1116: ff 24 eor r15, r15 - 1118: f3 94 inc r15 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 111a: e0 e1 ldi r30, 0x10 ; 16 - 111c: 7e 2e mov r7, r30 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 111e: f7 ed ldi r31, 0xD7 ; 215 - 1120: df 2e mov r13, r31 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1122: e0 e4 ldi r30, 0x40 ; 64 - 1124: 4e 2e mov r4, r30 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 1126: f0 e1 ldi r31, 0x10 ; 16 - 1128: cf 2e mov r12, r31 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 112a: e7 ed ldi r30, 0xD7 ; 215 - 112c: 3e 2e mov r3, r30 - 112e: f3 e5 ldi r31, 0x53 ; 83 - 1130: 5f 2e mov r5, r31 - 1132: e4 e8 ldi r30, 0x84 ; 132 - 1134: 6e 2e mov r6, r30 - 1136: f3 e8 ldi r31, 0x83 ; 131 - 1138: 2f 2e mov r2, r31 - 113a: 29 87 std Y+9, r18 ; 0x09 - 113c: 3a 87 std Y+10, r19 ; 0x0a - 113e: 4d 83 std Y+5, r20 ; 0x05 - 1140: 5e 83 std Y+6, r21 ; 0x06 - 1142: 6f 83 std Y+7, r22 ; 0x07 - 1144: 78 87 std Y+8, r23 ; 0x08 - 1146: b9 01 movw r22, r18 -} - -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - uint16_t PageAddress = Address / FLASH_PAGE_SIZE; - 1148: 89 2e mov r8, r25 - 114a: 9a 2e mov r9, r26 - 114c: ab 2e mov r10, r27 - 114e: bb 24 eor r11, r11 - uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; - 1150: 38 2f mov r19, r24 - uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); - 1152: a7 01 movw r20, r14 - 1154: 48 1b sub r20, r24 - 1156: 51 09 sbc r21, r1 - 1158: 64 17 cp r22, r20 - 115a: 75 07 cpc r23, r21 - 115c: 08 f4 brcc .+2 ; 0x1160 - 115e: ab 01 movw r20, r22 - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 1160: c0 92 66 06 sts 0x0666, r12 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1164: 30 92 a0 09 sts 0x09A0, r3 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1168: 20 91 a1 09 lds r18, 0x09A1 - 116c: 26 ff sbrs r18, 6 - 116e: fc cf rjmp .-8 ; 0x1168 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1170: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1174: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1178: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 117c: 20 91 a1 09 lds r18, 0x09A1 - 1180: 26 ff sbrs r18, 6 - 1182: fc cf rjmp .-8 ; 0x117c - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1184: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1188: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 118c: 70 92 65 06 sts 0x0665, r7 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashMemoryToBuffer(uint16_t PageAddress) -{ - while(FlashIsBusy()); - 1190: 27 ff sbrs r18, 7 - 1192: e6 cf rjmp .-52 ; 0x1160 - 1194: 69 87 std Y+9, r22 ; 0x09 - 1196: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 1198: c0 92 66 06 sts 0x0666, r12 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 119c: 50 92 a0 09 sts 0x09A0, r5 - 11a0: 69 85 ldd r22, Y+9 ; 0x09 - 11a2: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 11a4: 20 91 a1 09 lds r18, 0x09A1 - 11a8: 26 ff sbrs r18, 6 - 11aa: fc cf rjmp .-8 ; 0x11a4 - 11ac: 69 87 std Y+9, r22 ; 0x09 - 11ae: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 11b0: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 11b4: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 11b8: 90 92 a0 09 sts 0x09A0, r9 - 11bc: 69 85 ldd r22, Y+9 ; 0x09 - 11be: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 11c0: 20 91 a1 09 lds r18, 0x09A1 - 11c4: 26 ff sbrs r18, 6 - 11c6: fc cf rjmp .-8 ; 0x11c0 - 11c8: 69 87 std Y+9, r22 ; 0x09 - 11ca: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 11cc: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 11d0: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 11d4: 80 92 a0 09 sts 0x09A0, r8 - 11d8: 69 85 ldd r22, Y+9 ; 0x09 - 11da: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 11dc: 20 91 a1 09 lds r18, 0x09A1 - 11e0: 26 ff sbrs r18, 6 - 11e2: fc cf rjmp .-8 ; 0x11dc - 11e4: 69 87 std Y+9, r22 ; 0x09 - 11e6: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 11e8: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 11ec: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 11f0: 10 92 a0 09 sts 0x09A0, r1 - 11f4: 69 85 ldd r22, Y+9 ; 0x09 - 11f6: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 11f8: 20 91 a1 09 lds r18, 0x09A1 - 11fc: 26 ff sbrs r18, 6 - 11fe: fc cf rjmp .-8 ; 0x11f8 - 1200: 69 87 std Y+9, r22 ; 0x09 - 1202: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1204: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1208: 20 91 a0 09 lds r18, 0x09A0 - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_MEM_TO_BUF1); - SPITransferByte( (PageAddress >> 8) & 0xFF ); - SPITransferByte( (PageAddress >> 0) & 0xFF ); - SPITransferByte( 0 ); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 120c: 70 92 65 06 sts 0x0665, r7 - 1210: 69 85 ldd r22, Y+9 ; 0x09 - 1212: 7a 85 ldd r23, Y+10 ; 0x0a - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 1214: 70 92 66 06 sts 0x0666, r7 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1218: d0 92 a0 09 sts 0x09A0, r13 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 121c: 20 91 a1 09 lds r18, 0x09A1 - 1220: 26 ff sbrs r18, 6 - 1222: fc cf rjmp .-8 ; 0x121c - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1224: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1228: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 122c: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1230: 20 91 a1 09 lds r18, 0x09A1 - 1234: 26 ff sbrs r18, 6 - 1236: fc cf rjmp .-8 ; 0x1230 - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1238: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 123c: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 1240: 70 92 65 06 sts 0x0665, r7 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashWriteBuffer(const void* Buffer, uint8_t Address, uint16_t ByteCount) -{ - while(FlashIsBusy()); - 1244: 27 ff sbrs r18, 7 - 1246: e6 cf rjmp .-52 ; 0x1214 - 1248: 69 87 std Y+9, r22 ; 0x09 - 124a: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 124c: c0 92 66 06 sts 0x0666, r12 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1250: 60 92 a0 09 sts 0x09A0, r6 - 1254: 69 85 ldd r22, Y+9 ; 0x09 - 1256: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1258: 20 91 a1 09 lds r18, 0x09A1 - 125c: 26 ff sbrs r18, 6 - 125e: fc cf rjmp .-8 ; 0x1258 - 1260: 69 87 std Y+9, r22 ; 0x09 - 1262: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1264: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1268: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 126c: 10 92 a0 09 sts 0x09A0, r1 - 1270: 69 85 ldd r22, Y+9 ; 0x09 - 1272: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1274: 20 91 a1 09 lds r18, 0x09A1 - 1278: 26 ff sbrs r18, 6 - 127a: fc cf rjmp .-8 ; 0x1274 - 127c: 69 87 std Y+9, r22 ; 0x09 - 127e: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1280: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1284: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1288: 10 92 a0 09 sts 0x09A0, r1 - 128c: 69 85 ldd r22, Y+9 ; 0x09 - 128e: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1290: 20 91 a1 09 lds r18, 0x09A1 - 1294: 26 ff sbrs r18, 6 - 1296: fc cf rjmp .-8 ; 0x1290 - 1298: 69 87 std Y+9, r22 ; 0x09 - 129a: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 129c: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 12a0: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 12a4: 30 93 a0 09 sts 0x09A0, r19 - 12a8: 69 85 ldd r22, Y+9 ; 0x09 - 12aa: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 12ac: 20 91 a1 09 lds r18, 0x09A1 - 12b0: 26 ff sbrs r18, 6 - 12b2: fc cf rjmp .-8 ; 0x12ac - 12b4: 69 87 std Y+9, r22 ; 0x09 - 12b6: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 12b8: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 12bc: 20 91 a0 09 lds r18, 0x09A0 - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - 12c0: 41 15 cp r20, r1 - 12c2: 51 05 cpc r21, r1 - 12c4: 91 f0 breq .+36 ; 0x12ea - 12c6: f8 01 movw r30, r16 - 12c8: 9a 01 movw r18, r20 - 12ca: 20 0f add r18, r16 - 12cc: 31 1f adc r19, r17 - MEMORY_FLASH_USART.DATA = *ByteBuffer++; - 12ce: 61 91 ld r22, Z+ - 12d0: 60 93 a0 09 sts 0x09A0, r22 - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 12d4: 60 91 a1 09 lds r22, 0x09A1 - 12d8: 66 ff sbrs r22, 6 - 12da: fc cf rjmp .-8 ; 0x12d4 - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 12dc: 40 92 a1 09 sts 0x09A1, r4 - MEMORY_FLASH_USART.DATA; /* Flush Buffer */ - 12e0: 60 91 a0 09 lds r22, 0x09A0 - -INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) -{ - uint8_t* ByteBuffer = (uint8_t*) Buffer; - - while(ByteCount-- > 0) { - 12e4: e2 17 cp r30, r18 - 12e6: f3 07 cpc r31, r19 - 12e8: 91 f7 brne .-28 ; 0x12ce - SPITransferByte(FLASH_CMD_BUF1_WRITE); - SPITransferByte( 0 ); - SPITransferByte( 0 ); - SPITransferByte( Address ); - SPIWriteBlock(Buffer, ByteCount); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 12ea: 70 92 65 06 sts 0x0665, r7 - 12ee: 69 85 ldd r22, Y+9 ; 0x09 - 12f0: 7a 85 ldd r23, Y+10 ; 0x0a - -INLINE uint8_t FlashReadStatusRegister(void) -{ - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 12f2: 70 92 66 06 sts 0x0666, r7 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 12f6: d0 92 a0 09 sts 0x09A0, r13 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 12fa: 20 91 a1 09 lds r18, 0x09A1 - 12fe: 26 ff sbrs r18, 6 - 1300: fc cf rjmp .-8 ; 0x12fa - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1302: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1306: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 130a: 10 92 a0 09 sts 0x09A0, r1 - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 130e: 20 91 a1 09 lds r18, 0x09A1 - 1312: 26 ff sbrs r18, 6 - 1314: fc cf rjmp .-8 ; 0x130e - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1316: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 131a: 20 91 a0 09 lds r18, 0x09A0 - uint8_t Register; - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_STATUS_REG_READ); - Register = SPITransferByte(0); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 131e: 70 92 65 06 sts 0x0665, r7 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashBufferToMemory(uint16_t PageAddress) -{ - while(FlashIsBusy()); - 1322: 27 ff sbrs r18, 7 - 1324: e6 cf rjmp .-52 ; 0x12f2 - 1326: 69 87 std Y+9, r22 ; 0x09 - 1328: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - 132a: c0 92 66 06 sts 0x0666, r12 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 132e: 20 92 a0 09 sts 0x09A0, r2 - 1332: 69 85 ldd r22, Y+9 ; 0x09 - 1334: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1336: 20 91 a1 09 lds r18, 0x09A1 - 133a: 26 ff sbrs r18, 6 - 133c: fc cf rjmp .-8 ; 0x1336 - 133e: 69 87 std Y+9, r22 ; 0x09 - 1340: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1342: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1346: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 134a: 90 92 a0 09 sts 0x09A0, r9 - 134e: 69 85 ldd r22, Y+9 ; 0x09 - 1350: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 1352: 20 91 a1 09 lds r18, 0x09A1 - 1356: 26 ff sbrs r18, 6 - 1358: fc cf rjmp .-8 ; 0x1352 - 135a: 69 87 std Y+9, r22 ; 0x09 - 135c: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 135e: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1362: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1366: 80 92 a0 09 sts 0x09A0, r8 - 136a: 69 85 ldd r22, Y+9 ; 0x09 - 136c: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 136e: 20 91 a1 09 lds r18, 0x09A1 - 1372: 26 ff sbrs r18, 6 - 1374: fc cf rjmp .-8 ; 0x136e - 1376: 69 87 std Y+9, r22 ; 0x09 - 1378: 7a 87 std Y+10, r23 ; 0x0a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 137a: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 137e: 20 91 a0 09 lds r18, 0x09A0 - -static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; - -INLINE uint8_t SPITransferByte(uint8_t Data) -{ - MEMORY_FLASH_USART.DATA = Data; - 1382: 10 92 a0 09 sts 0x09A0, r1 - 1386: 69 85 ldd r22, Y+9 ; 0x09 - 1388: 7a 85 ldd r23, Y+10 ; 0x0a - - while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); - 138a: 20 91 a1 09 lds r18, 0x09A1 - 138e: 26 ff sbrs r18, 6 - 1390: fc cf rjmp .-8 ; 0x138a - - MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; - 1392: 40 92 a1 09 sts 0x09A1, r4 - - return MEMORY_FLASH_USART.DATA; - 1396: 20 91 a0 09 lds r18, 0x09A0 - MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; - SPITransferByte(FLASH_CMD_BUF1_TO_MEM_ERASE); - SPITransferByte( (PageAddress >> 8) & 0xFF ); - SPITransferByte( (PageAddress >> 0) & 0xFF ); - SPITransferByte( 0 ); - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; - 139a: 70 92 65 06 sts 0x0665, r7 - - FlashMemoryToBuffer(PageAddress); - FlashWriteBuffer(Buffer, ByteAddress, PageBytes); - FlashBufferToMemory(PageAddress); - - ByteCount -= PageBytes; - 139e: 64 1b sub r22, r20 - 13a0: 75 0b sbc r23, r21 - 13a2: 69 87 std Y+9, r22 ; 0x09 - 13a4: 7a 87 std Y+10, r23 ; 0x0a - Address += PageBytes; - 13a6: 84 0f add r24, r20 - 13a8: 95 1f adc r25, r21 - 13aa: a1 1d adc r26, r1 - 13ac: b1 1d adc r27, r1 - MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; -} - -INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) -{ - while(ByteCount > 0) { - 13ae: 61 15 cp r22, r1 - 13b0: 71 05 cpc r23, r1 - 13b2: 09 f0 breq .+2 ; 0x13b6 - 13b4: c9 ce rjmp .-622 ; 0x1148 - 13b6: 4d 81 ldd r20, Y+5 ; 0x05 - 13b8: 5e 81 ldd r21, Y+6 ; 0x06 - 13ba: 6f 81 ldd r22, Y+7 ; 0x07 - 13bc: 78 85 ldd r23, Y+8 ; 0x08 - - /* Store into flash */ - FlashWrite(Buffer, FlashAddress, ByteCount); - - /* Store to local memory */ - uint8_t* DstPtr = &Memory[BlockAddress]; - 13be: da 01 movw r26, r20 - 13c0: ae 56 subi r26, 0x6E ; 110 - 13c2: bf 4d sbci r27, 0xDF ; 223 - 13c4: 89 81 ldd r24, Y+1 ; 0x01 - 13c6: 9a 81 ldd r25, Y+2 ; 0x02 - 13c8: 8a 0f add r24, r26 - 13ca: 9b 1f adc r25, r27 - 13cc: f8 01 movw r30, r16 - uint8_t* SrcPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - *DstPtr++ = *SrcPtr++; - 13ce: 21 91 ld r18, Z+ - 13d0: 2d 93 st X+, r18 - - /* Store to local memory */ - uint8_t* DstPtr = &Memory[BlockAddress]; - uint8_t* SrcPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 13d2: a8 17 cp r26, r24 - 13d4: b9 07 cpc r27, r25 - 13d6: d9 f7 brne .-10 ; 0x13ce - } - - return true; - } - -} - 13d8: 81 e0 ldi r24, 0x01 ; 1 - 13da: 2a 96 adiw r28, 0x0a ; 10 - 13dc: cd bf out 0x3d, r28 ; 61 - 13de: de bf out 0x3e, r29 ; 62 - 13e0: df 91 pop r29 - 13e2: cf 91 pop r28 - 13e4: 1f 91 pop r17 - 13e6: 0f 91 pop r16 - 13e8: ff 90 pop r15 - 13ea: ef 90 pop r14 - 13ec: df 90 pop r13 - 13ee: cf 90 pop r12 - 13f0: bf 90 pop r11 - 13f2: af 90 pop r10 - 13f4: 9f 90 pop r9 - 13f6: 8f 90 pop r8 - 13f8: 7f 90 pop r7 - 13fa: 6f 90 pop r6 - 13fc: 5f 90 pop r5 - 13fe: 4f 90 pop r4 - 1400: 3f 90 pop r3 - 1402: 2f 90 pop r2 - 1404: 08 95 ret - return true; - } else { - /* Calculate bytes left in memory and start writing */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - ByteCount = MIN(ByteCount, BytesLeft); - 1406: c9 82 std Y+1, r12 ; 0x01 - 1408: da 82 std Y+2, r13 ; 0x02 - 140a: eb 82 std Y+3, r14 ; 0x03 - 140c: fc 82 std Y+4, r15 ; 0x04 - 140e: 7c ce rjmp .-776 ; 0x1108 - -00001410 : - } - -} - -bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) -{ - 1410: cf 92 push r12 - 1412: df 92 push r13 - 1414: ef 92 push r14 - 1416: ff 92 push r15 - 1418: 0f 93 push r16 - 141a: 1f 93 push r17 - 141c: 69 01 movw r12, r18 - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - 141e: 41 15 cp r20, r1 - 1420: 24 e0 ldi r18, 0x04 ; 4 - 1422: 52 07 cpc r21, r18 - 1424: 61 05 cpc r22, r1 - 1426: 71 05 cpc r23, r1 - 1428: 40 f5 brcc .+80 ; 0x147a - /* There are bytes out of bounds to be read. Notify that we are done. */ - return false; - } else { - /* Calculate bytes left in memory and issue reading */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - 142a: 00 e0 ldi r16, 0x00 ; 0 - 142c: 14 e0 ldi r17, 0x04 ; 4 - 142e: 20 e0 ldi r18, 0x00 ; 0 - 1430: 30 e0 ldi r19, 0x00 ; 0 - //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - ByteCount = MIN(ByteCount, BytesLeft); - 1432: e1 2c mov r14, r1 - 1434: f1 2c mov r15, r1 - 1436: 04 1b sub r16, r20 - 1438: 15 0b sbc r17, r21 - 143a: 26 0b sbc r18, r22 - 143c: 37 0b sbc r19, r23 - 143e: c0 16 cp r12, r16 - 1440: d1 06 cpc r13, r17 - 1442: e2 06 cpc r14, r18 - 1444: f3 06 cpc r15, r19 - 1446: b0 f0 brcs .+44 ; 0x1474 - - /* Output local memory contents */ - uint8_t* DstPtr = (uint8_t*) Buffer; - uint8_t* SrcPtr = &Memory[BlockAddress]; - 1448: 4e 56 subi r20, 0x6E ; 110 - 144a: 5f 4d sbci r21, 0xDF ; 223 - - while(ByteCount--) { - 144c: 01 15 cp r16, r1 - 144e: 11 05 cpc r17, r1 - 1450: 49 f0 breq .+18 ; 0x1464 - 1452: da 01 movw r26, r20 - 1454: fc 01 movw r30, r24 - 1456: 08 0f add r16, r24 - 1458: 19 1f adc r17, r25 - *DstPtr++ = *SrcPtr++; - 145a: 8d 91 ld r24, X+ - 145c: 81 93 st Z+, r24 - - /* Output local memory contents */ - uint8_t* DstPtr = (uint8_t*) Buffer; - uint8_t* SrcPtr = &Memory[BlockAddress]; - - while(ByteCount--) { - 145e: e0 17 cp r30, r16 - 1460: f1 07 cpc r31, r17 - 1462: d9 f7 brne .-10 ; 0x145a - *DstPtr++ = *SrcPtr++; - } - - return true; - 1464: 81 e0 ldi r24, 0x01 ; 1 - } - 1466: 1f 91 pop r17 - 1468: 0f 91 pop r16 - 146a: ff 90 pop r15 - 146c: ef 90 pop r14 - 146e: df 90 pop r13 - 1470: cf 90 pop r12 - 1472: 08 95 ret - return false; - } else { - /* Calculate bytes left in memory and issue reading */ - uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; - ByteCount = MIN(ByteCount, BytesLeft); - 1474: 97 01 movw r18, r14 - 1476: 86 01 movw r16, r12 - 1478: e7 cf rjmp .-50 ; 0x1448 - -bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) -{ - if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { - /* There are bytes out of bounds to be read. Notify that we are done. */ - return false; - 147a: 80 e0 ldi r24, 0x00 ; 0 - *DstPtr++ = *SrcPtr++; - } - - return true; - } - 147c: 1f 91 pop r17 - 147e: 0f 91 pop r16 - 1480: ff 90 pop r15 - 1482: ef 90 pop r14 - 1484: df 90 pop r13 - 1486: cf 90 pop r12 - 1488: 08 95 ret - -0000148a : -} - -void ButtonSetActionById(ButtonActionEnum Action) -{ -#ifndef BUTTON_SETTING_GLOBAL - GlobalSettings.ActiveSettingPtr->ButtonAction = Action; - 148a: e0 e0 ldi r30, 0x00 ; 0 - 148c: f6 e0 ldi r31, 0x06 ; 6 - 148e: 80 e4 ldi r24, 0x40 ; 64 - 1490: 82 83 std Z+2, r24 ; 0x02 - 1492: 88 e1 ldi r24, 0x18 ; 24 - 1494: 86 8b std Z+22, r24 ; 0x16 - 1496: 08 95 ret - -00001498 : - 1498: ff 92 push r15 - 149a: 0f 93 push r16 - 149c: 1f 93 push r17 - 149e: cf 93 push r28 - 14a0: df 93 push r29 - 14a2: cd b7 in r28, 0x3d ; 61 - 14a4: de b7 in r29, 0x3e ; 62 - 14a6: a0 97 sbiw r28, 0x20 ; 32 - 14a8: cd bf out 0x3d, r28 ; 61 - 14aa: de bf out 0x3e, r29 ; 62 - 14ac: 80 91 08 06 lds r24, 0x0608 - 14b0: 80 95 com r24 - 14b2: 90 91 92 24 lds r25, 0x2492 - 14b6: 98 27 eor r25, r24 - 14b8: 80 93 92 24 sts 0x2492, r24 - 14bc: 80 74 andi r24, 0x40 ; 64 - 14be: 89 23 and r24, r25 - 14c0: d9 f0 breq .+54 ; 0x14f8 - 14c2: e0 91 fe 24 lds r30, 0x24FE - 14c6: f0 91 ff 24 lds r31, 0x24FF - 14ca: 80 81 ld r24, Z - 14cc: 81 30 cpi r24, 0x01 ; 1 - 14ce: e9 f0 breq .+58 ; 0x150a - 14d0: 82 30 cpi r24, 0x02 ; 2 - 14d2: a9 f1 breq .+106 ; 0x153e - 14d4: 83 30 cpi r24, 0x03 ; 3 - 14d6: 09 f4 brne .+2 ; 0x14da - 14d8: 50 c0 rjmp .+160 ; 0x157a - 14da: 84 30 cpi r24, 0x04 ; 4 - 14dc: 09 f4 brne .+2 ; 0x14e0 - 14de: 73 c0 rjmp .+230 ; 0x15c6 - 14e0: 85 30 cpi r24, 0x05 ; 5 - 14e2: 09 f4 brne .+2 ; 0x14e6 - 14e4: 8e c0 rjmp .+284 ; 0x1602 - 14e6: 86 30 cpi r24, 0x06 ; 6 - 14e8: 09 f4 brne .+2 ; 0x14ec - 14ea: ad c0 rjmp .+346 ; 0x1646 - 14ec: 87 30 cpi r24, 0x07 ; 7 - 14ee: 09 f4 brne .+2 ; 0x14f2 - 14f0: 66 c0 rjmp .+204 ; 0x15be - 14f2: 88 30 cpi r24, 0x08 ; 8 - 14f4: 09 f4 brne .+2 ; 0x14f8 - 14f6: 65 c0 rjmp .+202 ; 0x15c2 - 14f8: a0 96 adiw r28, 0x20 ; 32 - 14fa: cd bf out 0x3d, r28 ; 61 - 14fc: de bf out 0x3e, r29 ; 62 - 14fe: df 91 pop r29 - 1500: cf 91 pop r28 - 1502: 1f 91 pop r17 - 1504: 0f 91 pop r16 - 1506: ff 90 pop r15 - 1508: 08 95 ret - 150a: 80 91 fb 24 lds r24, 0x24FB - 150e: 88 23 and r24, r24 - 1510: 09 f4 brne .+2 ; 0x1514 - 1512: 9b c0 rjmp .+310 ; 0x164a - 1514: f1 2c mov r15, r1 - 1516: 8e 01 movw r16, r28 - 1518: 0f 5f subi r16, 0xFF ; 255 - 151a: 1f 4f sbci r17, 0xFF ; 255 - 151c: 9d da rcall .-2758 ; 0xa58 - 151e: f8 01 movw r30, r16 - 1520: ef 0d add r30, r15 - 1522: f1 1d adc r31, r1 - 1524: 80 83 st Z, r24 - 1526: f3 94 inc r15 - 1528: 80 91 fb 24 lds r24, 0x24FB - 152c: f8 16 cp r15, r24 - 152e: b0 f3 brcs .-20 ; 0x151c - 1530: e0 91 f7 24 lds r30, 0x24F7 - 1534: f0 91 f8 24 lds r31, 0x24F8 - 1538: c8 01 movw r24, r16 - 153a: 09 95 icall - 153c: dd cf rjmp .-70 ; 0x14f8 - 153e: e0 91 f5 24 lds r30, 0x24F5 - 1542: f0 91 f6 24 lds r31, 0x24F6 - 1546: 8e 01 movw r16, r28 - 1548: 0f 5f subi r16, 0xFF ; 255 - 154a: 1f 4f sbci r17, 0xFF ; 255 - 154c: c8 01 movw r24, r16 - 154e: 09 95 icall - 1550: 20 91 fb 24 lds r18, 0x24FB - 1554: 22 23 and r18, r18 - 1556: 61 f3 breq .-40 ; 0x1530 - 1558: f8 01 movw r30, r16 - 155a: 91 e0 ldi r25, 0x01 ; 1 - 155c: 99 23 and r25, r25 - 155e: 39 f0 breq .+14 ; 0x156e - 1560: 80 81 ld r24, Z - 1562: 91 e0 ldi r25, 0x01 ; 1 - 1564: 8f 3f cpi r24, 0xFF ; 255 - 1566: 09 f0 breq .+2 ; 0x156a - 1568: 90 e0 ldi r25, 0x00 ; 0 - 156a: 8f 5f subi r24, 0xFF ; 255 - 156c: 80 83 st Z, r24 - 156e: 31 96 adiw r30, 0x01 ; 1 - 1570: 8e 2f mov r24, r30 - 1572: 80 1b sub r24, r16 - 1574: 82 17 cp r24, r18 - 1576: 90 f3 brcs .-28 ; 0x155c - 1578: db cf rjmp .-74 ; 0x1530 - 157a: e0 91 f5 24 lds r30, 0x24F5 - 157e: f0 91 f6 24 lds r31, 0x24F6 - 1582: 8e 01 movw r16, r28 - 1584: 0f 5f subi r16, 0xFF ; 255 - 1586: 1f 4f sbci r17, 0xFF ; 255 - 1588: c8 01 movw r24, r16 - 158a: 09 95 icall - 158c: 20 91 fb 24 lds r18, 0x24FB - 1590: 31 e0 ldi r19, 0x01 ; 1 - 1592: 21 50 subi r18, 0x01 ; 1 - 1594: 68 f2 brcs .-102 ; 0x1530 - 1596: 33 23 and r19, r19 - 1598: e1 f3 breq .-8 ; 0x1592 - 159a: 82 2f mov r24, r18 - 159c: 90 e0 ldi r25, 0x00 ; 0 - 159e: f8 01 movw r30, r16 - 15a0: e8 0f add r30, r24 - 15a2: f9 1f adc r31, r25 - 15a4: 40 81 ld r20, Z - 15a6: 31 e0 ldi r19, 0x01 ; 1 - 15a8: 4f 3f cpi r20, 0xFF ; 255 - 15aa: 09 f0 breq .+2 ; 0x15ae - 15ac: 30 e0 ldi r19, 0x00 ; 0 - 15ae: f8 01 movw r30, r16 - 15b0: e8 0f add r30, r24 - 15b2: f9 1f adc r31, r25 - 15b4: 4f 5f subi r20, 0xFF ; 255 - 15b6: 40 83 st Z, r20 - 15b8: 21 50 subi r18, 0x01 ; 1 - 15ba: 68 f7 brcc .-38 ; 0x1596 - 15bc: b9 cf rjmp .-142 ; 0x1530 - 15be: 22 dc rcall .-1980 ; 0xe04 - 15c0: 9b cf rjmp .-202 ; 0x14f8 - 15c2: 2c db rcall .-2472 ; 0xc1c - 15c4: 99 cf rjmp .-206 ; 0x14f8 - 15c6: e0 91 f5 24 lds r30, 0x24F5 - 15ca: f0 91 f6 24 lds r31, 0x24F6 - 15ce: 8e 01 movw r16, r28 - 15d0: 0f 5f subi r16, 0xFF ; 255 - 15d2: 1f 4f sbci r17, 0xFF ; 255 - 15d4: c8 01 movw r24, r16 - 15d6: 09 95 icall - 15d8: 20 91 fb 24 lds r18, 0x24FB - 15dc: 22 23 and r18, r18 - 15de: 09 f4 brne .+2 ; 0x15e2 - 15e0: a7 cf rjmp .-178 ; 0x1530 - 15e2: f8 01 movw r30, r16 - 15e4: 91 e0 ldi r25, 0x01 ; 1 - 15e6: 99 23 and r25, r25 - 15e8: 31 f0 breq .+12 ; 0x15f6 - 15ea: 80 81 ld r24, Z - 15ec: 91 e0 ldi r25, 0x01 ; 1 - 15ee: 81 11 cpse r24, r1 - 15f0: 90 e0 ldi r25, 0x00 ; 0 - 15f2: 81 50 subi r24, 0x01 ; 1 - 15f4: 80 83 st Z, r24 - 15f6: 31 96 adiw r30, 0x01 ; 1 - 15f8: 8e 2f mov r24, r30 - 15fa: 80 1b sub r24, r16 - 15fc: 82 17 cp r24, r18 - 15fe: 98 f3 brcs .-26 ; 0x15e6 - 1600: 97 cf rjmp .-210 ; 0x1530 - 1602: e0 91 f5 24 lds r30, 0x24F5 - 1606: f0 91 f6 24 lds r31, 0x24F6 - 160a: 8e 01 movw r16, r28 - 160c: 0f 5f subi r16, 0xFF ; 255 - 160e: 1f 4f sbci r17, 0xFF ; 255 - 1610: c8 01 movw r24, r16 - 1612: 09 95 icall - 1614: 20 91 fb 24 lds r18, 0x24FB - 1618: 31 e0 ldi r19, 0x01 ; 1 - 161a: 21 50 subi r18, 0x01 ; 1 - 161c: 08 f4 brcc .+2 ; 0x1620 - 161e: 88 cf rjmp .-240 ; 0x1530 - 1620: 33 23 and r19, r19 - 1622: d9 f3 breq .-10 ; 0x161a - 1624: 82 2f mov r24, r18 - 1626: 90 e0 ldi r25, 0x00 ; 0 - 1628: f8 01 movw r30, r16 - 162a: e8 0f add r30, r24 - 162c: f9 1f adc r31, r25 - 162e: 40 81 ld r20, Z - 1630: 31 e0 ldi r19, 0x01 ; 1 - 1632: 41 11 cpse r20, r1 - 1634: 30 e0 ldi r19, 0x00 ; 0 - 1636: f8 01 movw r30, r16 - 1638: e8 0f add r30, r24 - 163a: f9 1f adc r31, r25 - 163c: 41 50 subi r20, 0x01 ; 1 - 163e: 40 83 st Z, r20 - 1640: 21 50 subi r18, 0x01 ; 1 - 1642: 70 f7 brcc .-36 ; 0x1620 - 1644: 75 cf rjmp .-278 ; 0x1530 - 1646: da d0 rcall .+436 ; 0x17fc - 1648: 57 cf rjmp .-338 ; 0x14f8 - 164a: 8e 01 movw r16, r28 - 164c: 0f 5f subi r16, 0xFF ; 255 - 164e: 1f 4f sbci r17, 0xFF ; 255 - 1650: 6f cf rjmp .-290 ; 0x1530 - -00001652 : - 1652: 0f 93 push r16 - 1654: 1f 93 push r17 - 1656: cf 93 push r28 - 1658: df 93 push r29 - 165a: 61 50 subi r22, 0x01 ; 1 - 165c: 71 09 sbc r23, r1 - 165e: 47 e4 ldi r20, 0x47 ; 71 - 1660: 53 e0 ldi r21, 0x03 ; 3 - 1662: 1c e2 ldi r17, 0x2C ; 44 - 1664: 9a 01 movw r18, r20 - 1666: fa 01 movw r30, r20 - 1668: 04 91 lpm r16, Z - 166a: 00 23 and r16, r16 - 166c: 49 f1 breq .+82 ; 0x16c0 - 166e: 61 32 cpi r22, 0x21 ; 33 - 1670: 71 05 cpc r23, r1 - 1672: 20 f4 brcc .+8 ; 0x167c - 1674: 25 c0 rjmp .+74 ; 0x16c0 - 1676: 60 32 cpi r22, 0x20 ; 32 - 1678: 71 05 cpc r23, r1 - 167a: 61 f0 breq .+24 ; 0x1694 - 167c: dc 01 movw r26, r24 - 167e: 01 96 adiw r24, 0x01 ; 1 - 1680: ec 01 movw r28, r24 - 1682: 0c 93 st X, r16 - 1684: 2f 5f subi r18, 0xFF ; 255 - 1686: 3f 4f sbci r19, 0xFF ; 255 - 1688: 61 50 subi r22, 0x01 ; 1 - 168a: 71 09 sbc r23, r1 - 168c: f9 01 movw r30, r18 - 168e: 04 91 lpm r16, Z - 1690: 01 11 cpse r16, r1 - 1692: f1 cf rjmp .-30 ; 0x1676 - 1694: f4 e0 ldi r31, 0x04 ; 4 - 1696: 47 34 cpi r20, 0x47 ; 71 - 1698: 5f 07 cpc r21, r31 - 169a: 61 f0 breq .+24 ; 0x16b4 - 169c: ce 01 movw r24, r28 - 169e: 01 96 adiw r24, 0x01 ; 1 - 16a0: 18 83 st Y, r17 - 16a2: 61 50 subi r22, 0x01 ; 1 - 16a4: 71 09 sbc r23, r1 - 16a6: 40 5e subi r20, 0xE0 ; 224 - 16a8: 5f 4f sbci r21, 0xFF ; 255 - 16aa: 24 e0 ldi r18, 0x04 ; 4 - 16ac: 47 36 cpi r20, 0x67 ; 103 - 16ae: 52 07 cpc r21, r18 - 16b0: c9 f6 brne .-78 ; 0x1664 - 16b2: ec 01 movw r28, r24 - 16b4: 18 82 st Y, r1 - 16b6: df 91 pop r29 - 16b8: cf 91 pop r28 - 16ba: 1f 91 pop r17 - 16bc: 0f 91 pop r16 - 16be: 08 95 ret - 16c0: ec 01 movw r28, r24 - 16c2: e8 cf rjmp .-48 ; 0x1694 - -000016c4 : - } -#endif -} - -void ButtonGetActionByName(char* ActionOut, uint16_t BufferSize) -{ - 16c4: ab 01 movw r20, r22 - strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonAction], BufferSize); - 16c6: e0 91 fe 24 lds r30, 0x24FE - 16ca: f0 91 ff 24 lds r31, 0x24FF - 16ce: 60 81 ld r22, Z - 16d0: 20 e2 ldi r18, 0x20 ; 32 - 16d2: 62 9f mul r22, r18 - 16d4: b0 01 movw r22, r0 - 16d6: 11 24 eor r1, r1 - 16d8: 69 5b subi r22, 0xB9 ; 185 - 16da: 7c 4f sbci r23, 0xFC ; 252 - 16dc: 0c 94 f7 23 jmp 0x47ee ; 0x47ee - -000016e0 : -} - -bool ButtonSetActionByName(const char* Action) -{ - 16e0: cf 93 push r28 - 16e2: df 93 push r29 - 16e4: ec 01 movw r28, r24 - uint8_t i; - - for (i=0; i - 16ee: 89 2b or r24, r25 - 16f0: e9 f1 breq .+122 ; 0x176c - 16f2: 67 e6 ldi r22, 0x67 ; 103 - 16f4: 73 e0 ldi r23, 0x03 ; 3 - 16f6: ce 01 movw r24, r28 - 16f8: 0e 94 ee 23 call 0x47dc ; 0x47dc - 16fc: 89 2b or r24, r25 - 16fe: 09 f4 brne .+2 ; 0x1702 - 1700: 3f c0 rjmp .+126 ; 0x1780 - 1702: 67 e8 ldi r22, 0x87 ; 135 - 1704: 73 e0 ldi r23, 0x03 ; 3 - 1706: ce 01 movw r24, r28 - 1708: 0e 94 ee 23 call 0x47dc ; 0x47dc - 170c: 89 2b or r24, r25 - 170e: d1 f1 breq .+116 ; 0x1784 - 1710: 67 ea ldi r22, 0xA7 ; 167 - 1712: 73 e0 ldi r23, 0x03 ; 3 - 1714: ce 01 movw r24, r28 - 1716: 0e 94 ee 23 call 0x47dc ; 0x47dc - 171a: 89 2b or r24, r25 - 171c: a9 f1 breq .+106 ; 0x1788 - 171e: 67 ec ldi r22, 0xC7 ; 199 - 1720: 73 e0 ldi r23, 0x03 ; 3 - 1722: ce 01 movw r24, r28 - 1724: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1728: 89 2b or r24, r25 - 172a: 81 f1 breq .+96 ; 0x178c - 172c: 67 ee ldi r22, 0xE7 ; 231 - 172e: 73 e0 ldi r23, 0x03 ; 3 - 1730: ce 01 movw r24, r28 - 1732: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1736: 89 2b or r24, r25 - 1738: 59 f1 breq .+86 ; 0x1790 - 173a: 67 e0 ldi r22, 0x07 ; 7 - 173c: 74 e0 ldi r23, 0x04 ; 4 - 173e: ce 01 movw r24, r28 - 1740: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1744: 89 2b or r24, r25 - 1746: 31 f1 breq .+76 ; 0x1794 - 1748: 67 e2 ldi r22, 0x27 ; 39 - 174a: 74 e0 ldi r23, 0x04 ; 4 - 174c: ce 01 movw r24, r28 - 174e: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1752: 89 2b or r24, r25 - 1754: 09 f1 breq .+66 ; 0x1798 - 1756: 67 e4 ldi r22, 0x47 ; 71 - 1758: 74 e0 ldi r23, 0x04 ; 4 - 175a: ce 01 movw r24, r28 - 175c: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1760: 89 2b or r24, r25 - 1762: e1 f0 breq .+56 ; 0x179c - return true; - } - } - - /* Button action not found */ - return false; - 1764: 80 e0 ldi r24, 0x00 ; 0 -} - 1766: df 91 pop r29 - 1768: cf 91 pop r28 - 176a: 08 95 ret - -bool ButtonSetActionByName(const char* Action) -{ - uint8_t i; - - for (i=0; iButtonAction = Action; - 176e: e0 91 fe 24 lds r30, 0x24FE - 1772: f0 91 ff 24 lds r31, 0x24FF - 1776: 80 83 st Z, r24 - uint8_t i; - - for (i=0; i - 1784: 82 e0 ldi r24, 0x02 ; 2 - 1786: f3 cf rjmp .-26 ; 0x176e - 1788: 83 e0 ldi r24, 0x03 ; 3 - 178a: f1 cf rjmp .-30 ; 0x176e - 178c: 84 e0 ldi r24, 0x04 ; 4 - 178e: ef cf rjmp .-34 ; 0x176e - 1790: 85 e0 ldi r24, 0x05 ; 5 - 1792: ed cf rjmp .-38 ; 0x176e - 1794: 86 e0 ldi r24, 0x06 ; 6 - 1796: eb cf rjmp .-42 ; 0x176e - 1798: 87 e0 ldi r24, 0x07 ; 7 - 179a: e9 cf rjmp .-46 ; 0x176e - 179c: 88 e0 ldi r24, 0x08 ; 8 - 179e: e7 cf rjmp .-50 ; 0x176e - -000017a0 : - } -} - -uint8_t SettingsGetActiveById(void) { - return GlobalSettings.ActiveSetting; -} - 17a0: 43 e1 ldi r20, 0x13 ; 19 - 17a2: 50 e0 ldi r21, 0x00 ; 0 - 17a4: 60 e0 ldi r22, 0x00 ; 0 - 17a6: 70 e0 ldi r23, 0x00 ; 0 - 17a8: 8d ef ldi r24, 0xFD ; 253 - 17aa: 94 e2 ldi r25, 0x24 ; 36 - 17ac: 0c 94 ff 25 jmp 0x4bfe ; 0x4bfe <__eerd_block_x32a4u> - -000017b0 : - 17b0: 43 e1 ldi r20, 0x13 ; 19 - 17b2: 50 e0 ldi r21, 0x00 ; 0 - 17b4: 60 e0 ldi r22, 0x00 ; 0 - 17b6: 70 e0 ldi r23, 0x00 ; 0 - 17b8: 8d ef ldi r24, 0xFD ; 253 - 17ba: 94 e2 ldi r25, 0x24 ; 36 - 17bc: 0c 94 0a 26 jmp 0x4c14 ; 0x4c14 <__eewr_block_x32a4u> - -000017c0 : - 17c0: cf 93 push r28 - 17c2: df 93 push r29 - 17c4: 1f 92 push r1 - 17c6: cd b7 in r28, 0x3d ; 61 - 17c8: de b7 in r29, 0x3e ; 62 - 17ca: 88 30 cpi r24, 0x08 ; 8 - 17cc: 20 f0 brcs .+8 ; 0x17d6 - 17ce: 0f 90 pop r0 - 17d0: df 91 pop r29 - 17d2: cf 91 pop r28 - 17d4: 08 95 ret - 17d6: 89 83 std Y+1, r24 ; 0x01 - 17d8: 15 db rcall .-2518 ; 0xe04 - 17da: 89 81 ldd r24, Y+1 ; 0x01 - 17dc: 80 93 fd 24 sts 0x24FD, r24 - 17e0: 90 e0 ldi r25, 0x00 ; 0 - 17e2: 88 0f add r24, r24 - 17e4: 99 1f adc r25, r25 - 17e6: 80 50 subi r24, 0x00 ; 0 - 17e8: 9b 4d sbci r25, 0xDB ; 219 - 17ea: 80 93 fe 24 sts 0x24FE, r24 - 17ee: 90 93 ff 24 sts 0x24FF, r25 - 17f2: b4 d8 rcall .-3736 ; 0x95c - 17f4: 0f 90 pop r0 - 17f6: df 91 pop r29 - 17f8: cf 91 pop r28 - 17fa: 10 ca rjmp .-3040 ; 0xc1c - -000017fc : - 17fc: 20 91 fd 24 lds r18, 0x24FD - 1800: 30 e0 ldi r19, 0x00 ; 0 - 1802: 2f 5f subi r18, 0xFF ; 255 - 1804: 3f 4f sbci r19, 0xFF ; 255 - 1806: 27 70 andi r18, 0x07 ; 7 - 1808: 33 27 eor r19, r19 - 180a: 82 2f mov r24, r18 - 180c: f9 01 movw r30, r18 - 180e: ee 0f add r30, r30 - 1810: ff 1f adc r31, r31 - 1812: ef 5f subi r30, 0xFF ; 255 - 1814: fa 4d sbci r31, 0xDA ; 218 - 1816: 90 81 ld r25, Z - 1818: 91 11 cpse r25, r1 - 181a: 5c c0 rjmp .+184 ; 0x18d4 - 181c: 2f 5f subi r18, 0xFF ; 255 - 181e: 3f 4f sbci r19, 0xFF ; 255 - 1820: 27 70 andi r18, 0x07 ; 7 - 1822: 33 27 eor r19, r19 - 1824: 82 2f mov r24, r18 - 1826: f9 01 movw r30, r18 - 1828: ee 0f add r30, r30 - 182a: ff 1f adc r31, r31 - 182c: ef 5f subi r30, 0xFF ; 255 - 182e: fa 4d sbci r31, 0xDA ; 218 - 1830: 90 81 ld r25, Z - 1832: 91 11 cpse r25, r1 - 1834: 4f c0 rjmp .+158 ; 0x18d4 - 1836: 2f 5f subi r18, 0xFF ; 255 - 1838: 3f 4f sbci r19, 0xFF ; 255 - 183a: 27 70 andi r18, 0x07 ; 7 - 183c: 33 27 eor r19, r19 - 183e: 82 2f mov r24, r18 - 1840: f9 01 movw r30, r18 - 1842: ee 0f add r30, r30 - 1844: ff 1f adc r31, r31 - 1846: ef 5f subi r30, 0xFF ; 255 - 1848: fa 4d sbci r31, 0xDA ; 218 - 184a: 90 81 ld r25, Z - 184c: 91 11 cpse r25, r1 - 184e: 42 c0 rjmp .+132 ; 0x18d4 - 1850: 2f 5f subi r18, 0xFF ; 255 - 1852: 3f 4f sbci r19, 0xFF ; 255 - 1854: 27 70 andi r18, 0x07 ; 7 - 1856: 33 27 eor r19, r19 - 1858: 82 2f mov r24, r18 - 185a: f9 01 movw r30, r18 - 185c: ee 0f add r30, r30 - 185e: ff 1f adc r31, r31 - 1860: ef 5f subi r30, 0xFF ; 255 - 1862: fa 4d sbci r31, 0xDA ; 218 - 1864: 90 81 ld r25, Z - 1866: 91 11 cpse r25, r1 - 1868: 35 c0 rjmp .+106 ; 0x18d4 - 186a: 2f 5f subi r18, 0xFF ; 255 - 186c: 3f 4f sbci r19, 0xFF ; 255 - 186e: 27 70 andi r18, 0x07 ; 7 - 1870: 33 27 eor r19, r19 - 1872: 82 2f mov r24, r18 - 1874: f9 01 movw r30, r18 - 1876: ee 0f add r30, r30 - 1878: ff 1f adc r31, r31 - 187a: ef 5f subi r30, 0xFF ; 255 - 187c: fa 4d sbci r31, 0xDA ; 218 - 187e: 90 81 ld r25, Z - 1880: 91 11 cpse r25, r1 - 1882: 28 c0 rjmp .+80 ; 0x18d4 - 1884: 2f 5f subi r18, 0xFF ; 255 - 1886: 3f 4f sbci r19, 0xFF ; 255 - 1888: 27 70 andi r18, 0x07 ; 7 - 188a: 33 27 eor r19, r19 - 188c: 82 2f mov r24, r18 - 188e: f9 01 movw r30, r18 - 1890: ee 0f add r30, r30 - 1892: ff 1f adc r31, r31 - 1894: ef 5f subi r30, 0xFF ; 255 - 1896: fa 4d sbci r31, 0xDA ; 218 - 1898: 90 81 ld r25, Z - 189a: 91 11 cpse r25, r1 - 189c: 1b c0 rjmp .+54 ; 0x18d4 - 189e: 2f 5f subi r18, 0xFF ; 255 - 18a0: 3f 4f sbci r19, 0xFF ; 255 - 18a2: 27 70 andi r18, 0x07 ; 7 - 18a4: 33 27 eor r19, r19 - 18a6: 82 2f mov r24, r18 - 18a8: f9 01 movw r30, r18 - 18aa: ee 0f add r30, r30 - 18ac: ff 1f adc r31, r31 - 18ae: ef 5f subi r30, 0xFF ; 255 - 18b0: fa 4d sbci r31, 0xDA ; 218 - 18b2: 90 81 ld r25, Z - 18b4: 91 11 cpse r25, r1 - 18b6: 0e c0 rjmp .+28 ; 0x18d4 - 18b8: 2f 5f subi r18, 0xFF ; 255 - 18ba: 3f 4f sbci r19, 0xFF ; 255 - 18bc: 27 70 andi r18, 0x07 ; 7 - 18be: 33 27 eor r19, r19 - 18c0: 82 2f mov r24, r18 - 18c2: f9 01 movw r30, r18 - 18c4: ee 0f add r30, r30 - 18c6: ff 1f adc r31, r31 - 18c8: ef 5f subi r30, 0xFF ; 255 - 18ca: fa 4d sbci r31, 0xDA ; 218 - 18cc: 90 81 ld r25, Z - 18ce: 91 11 cpse r25, r1 - 18d0: 01 c0 rjmp .+2 ; 0x18d4 - 18d2: 08 95 ret - 18d4: 75 cf rjmp .-278 ; 0x17c0 - -000018d6 : - -void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize) { - SettingOut[0] = SettingsGetActiveById() + '0'; - 18d6: 20 91 fd 24 lds r18, 0x24FD - 18da: 20 5d subi r18, 0xD0 ; 208 - 18dc: fc 01 movw r30, r24 - 18de: 20 83 st Z, r18 - SettingOut[1] = '\0'; - 18e0: 11 82 std Z+1, r1 ; 0x01 - 18e2: 08 95 ret - -000018e4 : -} - -bool SettingsSetActiveByName(const char* Setting) { - 18e4: fc 01 movw r30, r24 - uint8_t SettingNr = Setting[0] - '0'; - 18e6: 80 81 ld r24, Z - - if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - 18e8: 91 81 ldd r25, Z+1 ; 0x01 - 18ea: 91 11 cpse r25, r1 - 18ec: 03 c0 rjmp .+6 ; 0x18f4 - SettingOut[0] = SettingsGetActiveById() + '0'; - SettingOut[1] = '\0'; -} - -bool SettingsSetActiveByName(const char* Setting) { - uint8_t SettingNr = Setting[0] - '0'; - 18ee: 80 53 subi r24, 0x30 ; 48 - - if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - 18f0: 88 30 cpi r24, 0x08 ; 8 - 18f2: 10 f0 brcs .+4 ; 0x18f8 - SettingsSetActiveById(SettingNr); - return true; - } else { - return false; - 18f4: 80 e0 ldi r24, 0x00 ; 0 - } -} - 18f6: 08 95 ret - -bool SettingsSetActiveByName(const char* Setting) { - uint8_t SettingNr = Setting[0] - '0'; - - if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - SettingsSetActiveById(SettingNr); - 18f8: 63 df rcall .-314 ; 0x17c0 - return true; - 18fa: 81 e0 ldi r24, 0x01 ; 1 - 18fc: 08 95 ret - -000018fe : -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); - 18fe: bc 01 movw r22, r24 - 1900: 81 e0 ldi r24, 0x01 ; 1 - 1902: 90 e2 ldi r25, 0x20 ; 32 - 1904: 0c 94 95 21 jmp 0x432a ; 0x432a - -00001908 : -} - -void TerminalSendStringP(const char* s) { - 1908: cf 93 push r28 - 190a: df 93 push r29 - char c; - - while( (c = pgm_read_byte(s++)) != '\0' ) { - 190c: ec 01 movw r28, r24 - 190e: 21 96 adiw r28, 0x01 ; 1 - 1910: fc 01 movw r30, r24 - 1912: 64 91 lpm r22, Z - 1914: 66 23 and r22, r22 - 1916: 49 f0 breq .+18 ; 0x192a -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); } - 1918: 81 e0 ldi r24, 0x01 ; 1 - 191a: 90 e2 ldi r25, 0x20 ; 32 - 191c: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - 1920: fe 01 movw r30, r28 - 1922: 64 91 lpm r22, Z - 1924: 21 96 adiw r28, 0x01 ; 1 - 1926: 61 11 cpse r22, r1 - 1928: f7 cf rjmp .-18 ; 0x1918 - TerminalSendChar(c); - } -} - 192a: df 91 pop r29 - 192c: cf 91 pop r28 - 192e: 08 95 ret - -00001930 : -#endif - - - -void TerminalSendBlock(void* Buffer, uint16_t ByteCount) -{ - 1930: ab 01 movw r20, r22 - CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); - 1932: bc 01 movw r22, r24 - 1934: 81 e0 ldi r24, 0x01 ; 1 - 1936: 90 e2 ldi r25, 0x20 ; 32 - 1938: 0c 94 ba 21 jmp 0x4374 ; 0x4374 - -0000193c : - } -} - -void TerminalInit(void) -{ - TERMINAL_VBUS_PORT.DIRCLR = TERMINAL_VBUS_MASK; - 193c: 80 e2 ldi r24, 0x20 ; 32 - 193e: e0 e6 ldi r30, 0x60 ; 96 - 1940: f6 e0 ldi r31, 0x06 ; 6 - 1942: 82 83 std Z+2, r24 ; 0x02 - 1944: 08 95 ret - -00001946 : -} - -void TerminalTask(void) -{ - 1946: cf 93 push r28 - 1948: df 93 push r29 - CDC_Device_USBTask(&TerminalHandle); - 194a: 81 e0 ldi r24, 0x01 ; 1 - 194c: 90 e2 ldi r25, 0x20 ; 32 - 194e: 0e 94 57 22 call 0x44ae ; 0x44ae - USB_USBTask(); - 1952: 0e 94 7a 1c call 0x38f4 ; 0x38f4 - CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); -} - - -static void ProcessByte(void) { - int16_t Byte = CDC_Device_ReceiveByte(&TerminalHandle); - 1956: 81 e0 ldi r24, 0x01 ; 1 - 1958: 90 e2 ldi r25, 0x20 ; 32 - 195a: 0e 94 72 22 call 0x44e4 ; 0x44e4 - 195e: ec 01 movw r28, r24 - - if (Byte >= 0) { - 1960: 97 fd sbrc r25, 7 - 1962: 09 c0 rjmp .+18 ; 0x1976 - LED_PORT.OUTTGL = Mask; -} - -static inline -void LEDPulse(uint8_t Mask) { - LEDPulseMask = Mask; - 1964: 80 e1 ldi r24, 0x10 ; 16 - 1966: 80 93 93 24 sts 0x2493, r24 - LED_PORT.OUTSET = Mask; - 196a: 80 93 05 06 sts 0x0605, r24 - /* Byte received */ - LEDPulse(LED_RED); - - if (XModemProcessByte(Byte)) { - 196e: 8c 2f mov r24, r28 - 1970: 5a d2 rcall .+1204 ; 0x1e26 - 1972: 88 23 and r24, r24 - 1974: 19 f0 breq .+6 ; 0x197c -{ - CDC_Device_USBTask(&TerminalHandle); - USB_USBTask(); - - ProcessByte(); -} - 1976: df 91 pop r29 - 1978: cf 91 pop r28 - 197a: 08 95 ret - /* Byte received */ - LEDPulse(LED_RED); - - if (XModemProcessByte(Byte)) { - /* XModem handled the byte */ - } else if (CommandLineProcessByte(Byte)) { - 197c: 8c 2f mov r24, r28 -{ - CDC_Device_USBTask(&TerminalHandle); - USB_USBTask(); - - ProcessByte(); -} - 197e: df 91 pop r29 - 1980: cf 91 pop r28 - /* Byte received */ - LEDPulse(LED_RED); - - if (XModemProcessByte(Byte)) { - /* XModem handled the byte */ - } else if (CommandLineProcessByte(Byte)) { - 1982: e0 c3 rjmp .+1984 ; 0x2144 - -00001984 : - } -} - -static void SenseVBus(void) -{ - switch(TerminalState) { - 1984: 80 91 94 24 lds r24, 0x2494 - 1988: 81 30 cpi r24, 0x01 ; 1 - 198a: 31 f1 breq .+76 ; 0x19d8 - 198c: c8 f0 brcs .+50 ; 0x19c0 - 198e: 82 30 cpi r24, 0x02 ; 2 - 1990: 59 f0 breq .+22 ; 0x19a8 - 1992: 83 30 cpi r24, 0x03 ; 3 - 1994: 39 f4 brne .+14 ; 0x19a4 - TerminalState = TERMINAL_UNITIALIZING; - } - break; - - case TERMINAL_UNITIALIZING: - if (--TerminalInitDelay == 0) { - 1996: 80 91 00 20 lds r24, 0x2000 - 199a: 81 50 subi r24, 0x01 ; 1 - 199c: 80 93 00 20 sts 0x2000, r24 - 19a0: 88 23 and r24, r24 - 19a2: 49 f1 breq .+82 ; 0x19f6 - -void TerminalTick(void) -{ - SenseVBus(); - - XModemTick(); - 19a4: a1 d3 rcall .+1858 ; 0x20e8 - CommandLineTick(); - 19a6: 74 c5 rjmp .+2792 ; 0x2490 - TerminalState = TERMINAL_INITIALIZED; - } - break; - - case TERMINAL_INITIALIZED: - if (!(TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK)) { - 19a8: 80 91 68 06 lds r24, 0x0668 - 19ac: 85 fd sbrc r24, 5 - 19ae: fa cf rjmp .-12 ; 0x19a4 - /* Initialized and VBUS sense low */ - TerminalInitDelay = INIT_DELAY; - 19b0: 84 e1 ldi r24, 0x14 ; 20 - 19b2: 80 93 00 20 sts 0x2000, r24 - TerminalState = TERMINAL_UNITIALIZING; - 19b6: 83 e0 ldi r24, 0x03 ; 3 - 19b8: 80 93 94 24 sts 0x2494, r24 - -void TerminalTick(void) -{ - SenseVBus(); - - XModemTick(); - 19bc: 95 d3 rcall .+1834 ; 0x20e8 - CommandLineTick(); - 19be: 68 c5 rjmp .+2768 ; 0x2490 - -static void SenseVBus(void) -{ - switch(TerminalState) { - case TERMINAL_UNINITIALIZED: - if (TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK) { - 19c0: 80 91 68 06 lds r24, 0x0668 - 19c4: 85 ff sbrs r24, 5 - 19c6: ee cf rjmp .-36 ; 0x19a4 - /* Not initialized and VBUS sense high */ - TerminalInitDelay = INIT_DELAY; - 19c8: 84 e1 ldi r24, 0x14 ; 20 - 19ca: 80 93 00 20 sts 0x2000, r24 - TerminalState = TERMINAL_INITIALIZING; - 19ce: 81 e0 ldi r24, 0x01 ; 1 - 19d0: 80 93 94 24 sts 0x2494, r24 - -void TerminalTick(void) -{ - SenseVBus(); - - XModemTick(); - 19d4: 89 d3 rcall .+1810 ; 0x20e8 - CommandLineTick(); - 19d6: 5c c5 rjmp .+2744 ; 0x2490 - TerminalState = TERMINAL_INITIALIZING; - } - break; - - case TERMINAL_INITIALIZING: - if (--TerminalInitDelay == 0) { - 19d8: 80 91 00 20 lds r24, 0x2000 - 19dc: 81 50 subi r24, 0x01 ; 1 - 19de: 80 93 00 20 sts 0x2000, r24 - 19e2: 81 11 cpse r24, r1 - 19e4: df cf rjmp .-66 ; 0x19a4 - SystemStartUSBClock(); - 19e6: 0e 94 5c 04 call 0x8b8 ; 0x8b8 - USB_Init(); - 19ea: 0e 94 ce 20 call 0x419c ; 0x419c - TerminalState = TERMINAL_INITIALIZED; - 19ee: 82 e0 ldi r24, 0x02 ; 2 - 19f0: 80 93 94 24 sts 0x2494, r24 - 19f4: d7 cf rjmp .-82 ; 0x19a4 - } - break; - - case TERMINAL_UNITIALIZING: - if (--TerminalInitDelay == 0) { - USB_Disable(); - 19f6: 0e 94 93 20 call 0x4126 ; 0x4126 - SystemStopUSBClock(); - 19fa: 0e 94 75 04 call 0x8ea ; 0x8ea - TerminalState = TERMINAL_UNINITIALIZED; - 19fe: 10 92 94 24 sts 0x2494, r1 - 1a02: d0 cf rjmp .-96 ; 0x19a4 - -00001a04 : - LED_PORT.DIRSET = LED_MASK; -} - -static inline -void LEDSetOn(uint8_t Mask) { - LED_PORT.OUTSET = Mask; - 1a04: 80 e2 ldi r24, 0x20 ; 32 - 1a06: e0 e0 ldi r30, 0x00 ; 0 - 1a08: f6 e0 ldi r31, 0x06 ; 6 - 1a0a: 85 83 std Z+5, r24 ; 0x05 - 1a0c: 08 95 ret - -00001a0e : -} - -static inline -void LEDSetOff(uint8_t Mask) { - LED_PORT.OUTCLR = Mask; - 1a0e: 80 e2 ldi r24, 0x20 ; 32 - 1a10: e0 e0 ldi r30, 0x00 ; 0 - 1a12: f6 e0 ldi r31, 0x06 ; 6 - 1a14: 86 83 std Z+6, r24 ; 0x06 - 1a16: 08 95 ret - -00001a18 : - - -/** Event handler for the library USB Configuration Changed event. */ -void EVENT_USB_Device_ConfigurationChanged(void) -{ - CDC_Device_ConfigureEndpoints(&TerminalHandle); - 1a18: 81 e0 ldi r24, 0x01 ; 1 - 1a1a: 90 e2 ldi r25, 0x20 ; 32 - 1a1c: 0c 94 70 21 jmp 0x42e0 ; 0x42e0 - -00001a20 : -} - -/** Event handler for the library USB Control Request reception event. */ -void EVENT_USB_Device_ControlRequest(void) -{ - CDC_Device_ProcessControlRequest(&TerminalHandle); - 1a20: 81 e0 ldi r24, 0x01 ; 1 - 1a22: 90 e2 ldi r25, 0x20 ; 32 - 1a24: 0c 94 cf 22 jmp 0x459e ; 0x459e - -00001a28 : - -extern const PROGMEM CommandEntryType CommandTable[]; - -CommandStatusIdType CommandGetVersion(char* OutParam) -{ - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR( - 1a28: 25 ec ldi r18, 0xC5 ; 197 - 1a2a: 34 e0 ldi r19, 0x04 ; 4 - 1a2c: 3f 93 push r19 - 1a2e: 2f 93 push r18 - 1a30: 2e eb ldi r18, 0xBE ; 190 - 1a32: 34 e0 ldi r19, 0x04 ; 4 - 1a34: 3f 93 push r19 - 1a36: 2f 93 push r18 - 1a38: 27 eb ldi r18, 0xB7 ; 183 - 1a3a: 34 e0 ldi r19, 0x04 ; 4 - 1a3c: 3f 93 push r19 - 1a3e: 2f 93 push r18 - 1a40: 2e e7 ldi r18, 0x7E ; 126 - 1a42: 34 e0 ldi r19, 0x04 ; 4 - 1a44: 3f 93 push r19 - 1a46: 2f 93 push r18 - 1a48: 21 e0 ldi r18, 0x01 ; 1 - 1a4a: 2f 93 push r18 - 1a4c: 1f 92 push r1 - 1a4e: 9f 93 push r25 - 1a50: 8f 93 push r24 - 1a52: 0e 94 0f 24 call 0x481e ; 0x481e - "Chameleon-Mini %S using LUFA %S compiled with AVR-GCC %S" - ), PSTR(CHAMELEON_MINI_VERSION_STRING), PSTR(LUFA_VERSION_STRING), PSTR(__VERSION__) - ); - - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1a56: 8d b7 in r24, 0x3d ; 61 - 1a58: 9e b7 in r25, 0x3e ; 62 - 1a5a: 0c 96 adiw r24, 0x0c ; 12 - 1a5c: 8d bf out 0x3d, r24 ; 61 - 1a5e: 9e bf out 0x3e, r25 ; 62 -} - 1a60: 85 e6 ldi r24, 0x65 ; 101 - 1a62: 08 95 ret - -00001a64 : - -CommandStatusIdType CommandGetConfig(char* OutParam) -{ - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, - 1a64: 29 ed ldi r18, 0xD9 ; 217 - 1a66: 34 e2 ldi r19, 0x24 ; 36 - 1a68: 3f 93 push r19 - 1a6a: 2f 93 push r18 - 1a6c: 2b e7 ldi r18, 0x7B ; 123 - 1a6e: 34 e0 ldi r19, 0x04 ; 4 - 1a70: 3f 93 push r19 - 1a72: 2f 93 push r18 - 1a74: 21 e0 ldi r18, 0x01 ; 1 - 1a76: 2f 93 push r18 - 1a78: 1f 92 push r1 - 1a7a: 9f 93 push r25 - 1a7c: 8f 93 push r24 - 1a7e: 0e 94 0f 24 call 0x481e ; 0x481e - PSTR("%s"), ActiveConfiguration.ConfigurationName); - - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1a82: 8d b7 in r24, 0x3d ; 61 - 1a84: 9e b7 in r25, 0x3e ; 62 - 1a86: 08 96 adiw r24, 0x08 ; 8 - 1a88: 8d bf out 0x3d, r24 ; 61 - 1a8a: 9e bf out 0x3e, r25 ; 62 - -} - 1a8c: 85 e6 ldi r24, 0x65 ; 101 - 1a8e: 08 95 ret - -00001a90 : - -CommandStatusIdType CommandSetConfig(const char* InParam) -{ - if (ConfigurationSetByName(InParam)) { - 1a90: 0e 94 b4 04 call 0x968 ; 0x968 - 1a94: 81 11 cpse r24, r1 - 1a96: 02 c0 rjmp .+4 ; 0x1a9c - SettingsSave(); - return COMMAND_INFO_OK_ID; - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1a98: 8a ec ldi r24, 0xCA ; 202 - } -} - 1a9a: 08 95 ret -} - -CommandStatusIdType CommandSetConfig(const char* InParam) -{ - if (ConfigurationSetByName(InParam)) { - SettingsSave(); - 1a9c: 89 de rcall .-750 ; 0x17b0 - return COMMAND_INFO_OK_ID; - 1a9e: 84 e6 ldi r24, 0x64 ; 100 - 1aa0: 08 95 ret - -00001aa2 : - } -} - -CommandStatusIdType CommandExecConfig(char* OutMessage) -{ - ConfigurationGetList(OutMessage, TERMINAL_BUFFER_SIZE); - 1aa2: 60 e0 ldi r22, 0x00 ; 0 - 1aa4: 71 e0 ldi r23, 0x01 ; 1 - 1aa6: 0e 94 f1 04 call 0x9e2 ; 0x9e2 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1aaa: 85 e6 ldi r24, 0x65 ; 101 - 1aac: 08 95 ret - -00001aae : - -CommandStatusIdType CommandGetUid(char* OutParam) -{ - 1aae: ef 92 push r14 - 1ab0: ff 92 push r15 - 1ab2: 0f 93 push r16 - 1ab4: 1f 93 push r17 - 1ab6: cf 93 push r28 - 1ab8: df 93 push r29 - 1aba: cd b7 in r28, 0x3d ; 61 - 1abc: de b7 in r29, 0x3e ; 62 - 1abe: a0 97 sbiw r28, 0x20 ; 32 - 1ac0: cd bf out 0x3d, r28 ; 61 - 1ac2: de bf out 0x3e, r29 ; 62 - 1ac4: 8c 01 movw r16, r24 - uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; - uint16_t UidSize = ActiveConfiguration.UidSize; - 1ac6: e0 90 fb 24 lds r14, 0x24FB - 1aca: f1 2c mov r15, r1 -INLINE void ApplicationReset(void) { - ActiveConfiguration.ApplicationResetFunc(); -} - -INLINE void ApplicationGetUid(ConfigurationUidType Uid) { - ActiveConfiguration.ApplicationGetUidFunc(Uid); - 1acc: e0 91 f5 24 lds r30, 0x24F5 - 1ad0: f0 91 f6 24 lds r31, 0x24F6 - 1ad4: ce 01 movw r24, r28 - 1ad6: 01 96 adiw r24, 0x01 ; 1 - 1ad8: 09 95 icall - - ApplicationGetUid(UidBuffer); - - BufferToHexString(OutParam, TERMINAL_BUFFER_SIZE, - 1ada: 97 01 movw r18, r14 - 1adc: ae 01 movw r20, r28 - 1ade: 4f 5f subi r20, 0xFF ; 255 - 1ae0: 5f 4f sbci r21, 0xFF ; 255 - 1ae2: 60 e0 ldi r22, 0x00 ; 0 - 1ae4: 71 e0 ldi r23, 0x01 ; 1 - 1ae6: c8 01 movw r24, r16 - 1ae8: 0e 94 47 05 call 0xa8e ; 0xa8e - UidBuffer, UidSize); - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1aec: 85 e6 ldi r24, 0x65 ; 101 - 1aee: a0 96 adiw r28, 0x20 ; 32 - 1af0: cd bf out 0x3d, r28 ; 61 - 1af2: de bf out 0x3e, r29 ; 62 - 1af4: df 91 pop r29 - 1af6: cf 91 pop r28 - 1af8: 1f 91 pop r17 - 1afa: 0f 91 pop r16 - 1afc: ff 90 pop r15 - 1afe: ef 90 pop r14 - 1b00: 08 95 ret - -00001b02 : - -CommandStatusIdType CommandSetUid(const char* InParam) -{ - 1b02: bf 92 push r11 - 1b04: cf 92 push r12 - 1b06: df 92 push r13 - 1b08: ef 92 push r14 - 1b0a: ff 92 push r15 - 1b0c: 0f 93 push r16 - 1b0e: 1f 93 push r17 - 1b10: cf 93 push r28 - 1b12: df 93 push r29 - 1b14: cd b7 in r28, 0x3d ; 61 - 1b16: de b7 in r29, 0x3e ; 62 - 1b18: a0 97 sbiw r28, 0x20 ; 32 - 1b1a: cd bf out 0x3d, r28 ; 61 - 1b1c: de bf out 0x3e, r29 ; 62 - 1b1e: 8c 01 movw r16, r24 - uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; - uint16_t UidSize = ActiveConfiguration.UidSize; - 1b20: c0 90 fb 24 lds r12, 0x24FB - 1b24: d1 2c mov r13, r1 - - if (strcmp_P(InParam, PSTR(COMMAND_UID_RANDOM)) == 0) { - 1b26: 64 e7 ldi r22, 0x74 ; 116 - 1b28: 74 e0 ldi r23, 0x04 ; 4 - 1b2a: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1b2e: 89 2b or r24, r25 - 1b30: 49 f5 brne .+82 ; 0x1b84 - /* Load with random bytes */ - for (uint8_t i=0; i - 1b38: b1 2c mov r11, r1 - 1b3a: ce 01 movw r24, r28 - 1b3c: 01 96 adiw r24, 0x01 ; 1 - 1b3e: 7c 01 movw r14, r24 - 1b40: 00 e0 ldi r16, 0x00 ; 0 - 1b42: 10 e0 ldi r17, 0x00 ; 0 - UidBuffer[i] = RandomGetByte(); - 1b44: 0e 94 2c 05 call 0xa58 ; 0xa58 - 1b48: f7 01 movw r30, r14 - 1b4a: e0 0f add r30, r16 - 1b4c: f1 1f adc r31, r17 - 1b4e: 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); - 1b5c: e0 91 f7 24 lds r30, 0x24F7 - 1b60: f0 91 f8 24 lds r31, 0x24F8 - 1b64: c7 01 movw r24, r14 - 1b66: 09 95 icall - } - } - - ApplicationSetUid(UidBuffer); - - return COMMAND_INFO_OK_ID; - 1b68: 84 e6 ldi r24, 0x64 ; 100 -} - 1b6a: a0 96 adiw r28, 0x20 ; 32 - 1b6c: cd bf out 0x3d, r28 ; 61 - 1b6e: de bf out 0x3e, r29 ; 62 - 1b70: df 91 pop r29 - 1b72: cf 91 pop r28 - 1b74: 1f 91 pop r17 - 1b76: 0f 91 pop r16 - 1b78: ff 90 pop r15 - 1b7a: ef 90 pop r14 - 1b7c: df 90 pop r13 - 1b7e: cf 90 pop r12 - 1b80: bf 90 pop r11 - 1b82: 08 95 ret - for (uint8_t i=0; i - 1b94: 8c 15 cp r24, r12 - 1b96: 9d 05 cpc r25, r13 - 1b98: 09 f3 breq .-62 ; 0x1b5c - /* Malformed input. Abort */ - return COMMAND_ERR_INVALID_PARAM_ID; - 1b9a: 8a ec ldi r24, 0xCA ; 202 - 1b9c: e6 cf rjmp .-52 ; 0x1b6a - 1b9e: ce 01 movw r24, r28 - 1ba0: 01 96 adiw r24, 0x01 ; 1 - 1ba2: 7c 01 movw r14, r24 - 1ba4: db cf rjmp .-74 ; 0x1b5c - -00001ba6 : - return COMMAND_INFO_OK_ID; -} - -CommandStatusIdType CommandGetReadOnly(char* OutParam) -{ - if (ActiveConfiguration.ReadOnly) { - 1ba6: 20 91 fc 24 lds r18, 0x24FC - 1baa: 21 11 cpse r18, r1 - 1bac: 07 c0 rjmp .+14 ; 0x1bbc - OutParam[0] = COMMAND_CHAR_TRUE; - } else { - OutParam[0] = COMMAND_CHAR_FALSE; - 1bae: 20 e3 ldi r18, 0x30 ; 48 - 1bb0: fc 01 movw r30, r24 - 1bb2: 20 83 st Z, r18 - } - - OutParam[1] = '\0'; - 1bb4: fc 01 movw r30, r24 - 1bb6: 11 82 std Z+1, r1 ; 0x01 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1bb8: 85 e6 ldi r24, 0x65 ; 101 - 1bba: 08 95 ret -} - -CommandStatusIdType CommandGetReadOnly(char* OutParam) -{ - if (ActiveConfiguration.ReadOnly) { - OutParam[0] = COMMAND_CHAR_TRUE; - 1bbc: 21 e3 ldi r18, 0x31 ; 49 - 1bbe: fc 01 movw r30, r24 - 1bc0: 20 83 st Z, r18 - } else { - OutParam[0] = COMMAND_CHAR_FALSE; - } - - OutParam[1] = '\0'; - 1bc2: fc 01 movw r30, r24 - 1bc4: 11 82 std Z+1, r1 ; 0x01 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1bc6: 85 e6 ldi r24, 0x65 ; 101 - 1bc8: 08 95 ret - -00001bca : - -CommandStatusIdType CommandSetReadOnly(const char* InParam) -{ - if (InParam[1] == '\0') { - 1bca: fc 01 movw r30, r24 - 1bcc: 21 81 ldd r18, Z+1 ; 0x01 - 1bce: 21 11 cpse r18, r1 - 1bd0: 05 c0 rjmp .+10 ; 0x1bdc - if (InParam[0] == COMMAND_CHAR_TRUE) { - 1bd2: 80 81 ld r24, Z - 1bd4: 81 33 cpi r24, 0x31 ; 49 - 1bd6: 41 f0 breq .+16 ; 0x1be8 - ActiveConfiguration.ReadOnly = true; - return COMMAND_INFO_OK_ID; - } else if (InParam[0] == COMMAND_CHAR_FALSE) { - 1bd8: 80 33 cpi r24, 0x30 ; 48 - 1bda: 11 f0 breq .+4 ; 0x1be0 - ActiveConfiguration.ReadOnly = false; - return COMMAND_INFO_OK_ID; - } - } - - return COMMAND_ERR_INVALID_PARAM_ID; - 1bdc: 8a ec ldi r24, 0xCA ; 202 -} - 1bde: 08 95 ret - if (InParam[1] == '\0') { - if (InParam[0] == COMMAND_CHAR_TRUE) { - ActiveConfiguration.ReadOnly = true; - return COMMAND_INFO_OK_ID; - } else if (InParam[0] == COMMAND_CHAR_FALSE) { - ActiveConfiguration.ReadOnly = false; - 1be0: 10 92 fc 24 sts 0x24FC, r1 - return COMMAND_INFO_OK_ID; - 1be4: 84 e6 ldi r24, 0x64 ; 100 - 1be6: 08 95 ret - -CommandStatusIdType CommandSetReadOnly(const char* InParam) -{ - if (InParam[1] == '\0') { - if (InParam[0] == COMMAND_CHAR_TRUE) { - ActiveConfiguration.ReadOnly = true; - 1be8: 81 e0 ldi r24, 0x01 ; 1 - 1bea: 80 93 fc 24 sts 0x24FC, r24 - return COMMAND_INFO_OK_ID; - 1bee: 84 e6 ldi r24, 0x64 ; 100 - 1bf0: 08 95 ret - -00001bf2 : - return COMMAND_ERR_INVALID_PARAM_ID; -} - -CommandStatusIdType CommandExecUpload(char* OutMessage) -{ - XModemReceive(MemoryUploadBlock); - 1bf2: 8f e3 ldi r24, 0x3F ; 63 - 1bf4: 98 e0 ldi r25, 0x08 ; 8 - 1bf6: ec d0 rcall .+472 ; 0x1dd0 - return COMMAND_INFO_XMODEM_WAIT_ID; -} - 1bf8: 8e e6 ldi r24, 0x6E ; 110 - 1bfa: 08 95 ret - -00001bfc : - -CommandStatusIdType CommandExecDownload(char* OutMessage) -{ - XModemSend(MemoryDownloadBlock); - 1bfc: 88 e0 ldi r24, 0x08 ; 8 - 1bfe: 9a e0 ldi r25, 0x0A ; 10 - 1c00: ff d0 rcall .+510 ; 0x1e00 - return COMMAND_INFO_XMODEM_WAIT_ID; -} - 1c02: 8e e6 ldi r24, 0x6E ; 110 - 1c04: 08 95 ret - -00001c06 : - * 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; - 1c06: e0 ec ldi r30, 0xC0 ; 192 - 1c08: f4 e0 ldi r31, 0x04 ; 4 - 1c0a: 81 81 ldd r24, Z+1 ; 0x01 - 1c0c: 8e 7f andi r24, 0xFE ; 254 - 1c0e: 81 83 std Z+1, r24 ; 0x01 - -CommandStatusIdType CommandExecReset(char* OutMessage) -{ - USB_Detach(); - USB_Disable(); - 1c10: 0e 94 93 20 call 0x4126 ; 0x4126 - - SystemReset(); - 1c14: 0e 94 4f 04 call 0x89e ; 0x89e - - return COMMAND_INFO_OK_ID; -} - 1c18: 84 e6 ldi r24, 0x64 ; 100 - 1c1a: 08 95 ret - -00001c1c : - 1c1c: e0 ec ldi r30, 0xC0 ; 192 - 1c1e: f4 e0 ldi r31, 0x04 ; 4 - 1c20: 81 81 ldd r24, Z+1 ; 0x01 - 1c22: 8e 7f andi r24, 0xFE ; 254 - 1c24: 81 83 std Z+1, r24 ; 0x01 - -#ifdef SUPPORT_FIRMWARE_UPGRADE -CommandStatusIdType CommandExecUpgrade(char* OutMessage) -{ - USB_Detach(); - USB_Disable(); - 1c26: 0e 94 93 20 call 0x4126 ; 0x4126 - - SystemEnterBootloader(); - 1c2a: 0e 94 56 04 call 0x8ac ; 0x8ac - - return COMMAND_INFO_OK_ID; -} - 1c2e: 84 e6 ldi r24, 0x64 ; 100 - 1c30: 08 95 ret - -00001c32 : -#endif - -CommandStatusIdType CommandGetMemSize(char* OutParam) -{ - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.MemorySize); - 1c32: e9 ef ldi r30, 0xF9 ; 249 - 1c34: f4 e2 ldi r31, 0x24 ; 36 - 1c36: 21 81 ldd r18, Z+1 ; 0x01 - 1c38: 2f 93 push r18 - 1c3a: 20 81 ld r18, Z - 1c3c: 2f 93 push r18 - 1c3e: 21 e7 ldi r18, 0x71 ; 113 - 1c40: 34 e0 ldi r19, 0x04 ; 4 - 1c42: 3f 93 push r19 - 1c44: 2f 93 push r18 - 1c46: 21 e0 ldi r18, 0x01 ; 1 - 1c48: 2f 93 push r18 - 1c4a: 1f 92 push r1 - 1c4c: 9f 93 push r25 - 1c4e: 8f 93 push r24 - 1c50: 0e 94 0f 24 call 0x481e ; 0x481e - - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1c54: 8d b7 in r24, 0x3d ; 61 - 1c56: 9e b7 in r25, 0x3e ; 62 - 1c58: 08 96 adiw r24, 0x08 ; 8 - 1c5a: 8d bf out 0x3d, r24 ; 61 - 1c5c: 9e bf out 0x3e, r25 ; 62 -} - 1c5e: 85 e6 ldi r24, 0x65 ; 101 - 1c60: 08 95 ret - -00001c62 : - -CommandStatusIdType CommandGetUidSize(char* OutParam) -{ - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.UidSize); - 1c62: 20 91 fb 24 lds r18, 0x24FB - 1c66: 1f 92 push r1 - 1c68: 2f 93 push r18 - 1c6a: 2e e6 ldi r18, 0x6E ; 110 - 1c6c: 34 e0 ldi r19, 0x04 ; 4 - 1c6e: 3f 93 push r19 - 1c70: 2f 93 push r18 - 1c72: 21 e0 ldi r18, 0x01 ; 1 - 1c74: 2f 93 push r18 - 1c76: 1f 92 push r1 - 1c78: 9f 93 push r25 - 1c7a: 8f 93 push r24 - 1c7c: 0e 94 0f 24 call 0x481e ; 0x481e - - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1c80: 8d b7 in r24, 0x3d ; 61 - 1c82: 9e b7 in r25, 0x3e ; 62 - 1c84: 08 96 adiw r24, 0x08 ; 8 - 1c86: 8d bf out 0x3d, r24 ; 61 - 1c88: 9e bf out 0x3e, r25 ; 62 -} - 1c8a: 85 e6 ldi r24, 0x65 ; 101 - 1c8c: 08 95 ret - -00001c8e : - -CommandStatusIdType CommandExecButton(char* OutMessage) -{ - ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); - 1c8e: 60 e0 ldi r22, 0x00 ; 0 - 1c90: 71 e0 ldi r23, 0x01 ; 1 - 1c92: df dc rcall .-1602 ; 0x1652 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1c94: 85 e6 ldi r24, 0x65 ; 101 - 1c96: 08 95 ret - -00001c98 : - -CommandStatusIdType CommandGetButton(char* OutParam) -{ - ButtonGetActionByName(OutParam, TERMINAL_BUFFER_SIZE); - 1c98: 60 e0 ldi r22, 0x00 ; 0 - 1c9a: 71 e0 ldi r23, 0x01 ; 1 - 1c9c: 13 dd rcall .-1498 ; 0x16c4 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1c9e: 85 e6 ldi r24, 0x65 ; 101 - 1ca0: 08 95 ret - -00001ca2 : - -CommandStatusIdType CommandSetButton(const char* InParam) -{ - if (ButtonSetActionByName(InParam)) { - 1ca2: 1e dd rcall .-1476 ; 0x16e0 - 1ca4: 81 11 cpse r24, r1 - 1ca6: 02 c0 rjmp .+4 ; 0x1cac - SettingsSave(); - return COMMAND_INFO_OK_ID; - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1ca8: 8a ec ldi r24, 0xCA ; 202 - } -} - 1caa: 08 95 ret -} - -CommandStatusIdType CommandSetButton(const char* InParam) -{ - if (ButtonSetActionByName(InParam)) { - SettingsSave(); - 1cac: 81 dd rcall .-1278 ; 0x17b0 - return COMMAND_INFO_OK_ID; - 1cae: 84 e6 ldi r24, 0x64 ; 100 - 1cb0: 08 95 ret - -00001cb2 : - } -} - -CommandStatusIdType CommandGetSetting(char* OutParam) -{ - SettingsGetActiveByName(OutParam, TERMINAL_BUFFER_SIZE); - 1cb2: 60 e0 ldi r22, 0x00 ; 0 - 1cb4: 71 e0 ldi r23, 0x01 ; 1 - 1cb6: 0f de rcall .-994 ; 0x18d6 - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1cb8: 85 e6 ldi r24, 0x65 ; 101 - 1cba: 08 95 ret - -00001cbc : - -CommandStatusIdType CommandSetSetting(const char* InParam) -{ - if (SettingsSetActiveByName(InParam)) { - 1cbc: 13 de rcall .-986 ; 0x18e4 - 1cbe: 81 11 cpse r24, r1 - 1cc0: 02 c0 rjmp .+4 ; 0x1cc6 - SettingsSave(); - return COMMAND_INFO_OK_ID; - } else { - return COMMAND_ERR_INVALID_PARAM_ID; - 1cc2: 8a ec ldi r24, 0xCA ; 202 - } -} - 1cc4: 08 95 ret -} - -CommandStatusIdType CommandSetSetting(const char* InParam) -{ - if (SettingsSetActiveByName(InParam)) { - SettingsSave(); - 1cc6: 74 dd rcall .-1304 ; 0x17b0 - return COMMAND_INFO_OK_ID; - 1cc8: 84 e6 ldi r24, 0x64 ; 100 - 1cca: 08 95 ret - -00001ccc : - } -} - -CommandStatusIdType CommandExecClear(char* OutParam) -{ - MemoryClear(); - 1ccc: 0e 94 03 06 call 0xc06 ; 0xc06 - return COMMAND_INFO_OK_ID; -} - 1cd0: 84 e6 ldi r24, 0x64 ; 100 - 1cd2: 08 95 ret - -00001cd4 : - -CommandStatusIdType CommandExecHelp(char* OutMessage) -{ - 1cd4: df 92 push r13 - 1cd6: ef 92 push r14 - 1cd8: ff 92 push r15 - 1cda: 0f 93 push r16 - 1cdc: 1f 93 push r17 - 1cde: cf 93 push r28 - 1ce0: df 93 push r29 - 1ce2: 7c 01 movw r14, r24 - const CommandEntryType* EntryPtr = CommandTable; - uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ - 1ce4: cf ef ldi r28, 0xFF ; 255 - 1ce6: d0 e0 ldi r29, 0x00 ; 0 - return COMMAND_INFO_OK_ID; -} - -CommandStatusIdType CommandExecHelp(char* OutMessage) -{ - const CommandEntryType* EntryPtr = CommandTable; - 1ce8: 07 e9 ldi r16, 0x97 ; 151 - 1cea: 15 e0 ldi r17, 0x05 ; 5 - *OutMessage++ = c; - CommandName++; - ByteCount--; - } - - *OutMessage++ = ','; - 1cec: 8c e2 ldi r24, 0x2C ; 44 - 1cee: d8 2e mov r13, r24 -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) { - 1cf0: b8 01 movw r22, r16 - 1cf2: 80 e9 ldi r24, 0x90 ; 144 - 1cf4: 90 e2 ldi r25, 0x20 ; 32 - 1cf6: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1cfa: 89 2b or r24, r25 - 1cfc: 39 f1 breq .+78 ; 0x1d4c - const char* CommandName = EntryPtr->Command; - char c; - - while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { - 1cfe: f8 01 movw r30, r16 - 1d00: 44 91 lpm r20, Z - 1d02: 44 23 and r20, r20 - 1d04: 79 f1 breq .+94 ; 0x1d64 - 1d06: c1 32 cpi r28, 0x21 ; 33 - 1d08: d1 05 cpc r29, r1 - 1d0a: 60 f1 brcs .+88 ; 0x1d64 - 1d0c: d7 01 movw r26, r14 - 1d0e: f8 01 movw r30, r16 - 1d10: 04 c0 rjmp .+8 ; 0x1d1a - 1d12: c0 32 cpi r28, 0x20 ; 32 - 1d14: d1 05 cpc r29, r1 - 1d16: 51 f0 breq .+20 ; 0x1d2c - 1d18: dc 01 movw r26, r24 - 1d1a: cd 01 movw r24, r26 - 1d1c: 01 96 adiw r24, 0x01 ; 1 - 1d1e: 9c 01 movw r18, r24 - *OutMessage++ = c; - 1d20: 4c 93 st X, r20 - CommandName++; - 1d22: 31 96 adiw r30, 0x01 ; 1 - ByteCount--; - 1d24: 21 97 sbiw r28, 0x01 ; 1 - - while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { - const char* CommandName = EntryPtr->Command; - char c; - - while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { - 1d26: 44 91 lpm r20, Z - 1d28: 41 11 cpse r20, r1 - 1d2a: f3 cf rjmp .-26 ; 0x1d12 - *OutMessage++ = c; - CommandName++; - ByteCount--; - } - - *OutMessage++ = ','; - 1d2c: 79 01 movw r14, r18 - 1d2e: 8f ef ldi r24, 0xFF ; 255 - 1d30: e8 1a sub r14, r24 - 1d32: f8 0a sbc r15, r24 - 1d34: f9 01 movw r30, r18 - 1d36: d0 82 st Z, r13 - ByteCount--; - 1d38: 21 97 sbiw r28, 0x01 ; 1 - - EntryPtr++; - 1d3a: 0a 5e subi r16, 0xEA ; 234 - 1d3c: 1f 4f sbci r17, 0xFF ; 255 -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) { - 1d3e: b8 01 movw r22, r16 - 1d40: 80 e9 ldi r24, 0x90 ; 144 - 1d42: 90 e2 ldi r25, 0x20 ; 32 - 1d44: 0e 94 ee 23 call 0x47dc ; 0x47dc - 1d48: 89 2b or r24, r25 - 1d4a: c9 f6 brne .-78 ; 0x1cfe - ByteCount--; - - EntryPtr++; - } - - *--OutMessage = '\0'; - 1d4c: d7 01 movw r26, r14 - 1d4e: 11 97 sbiw r26, 0x01 ; 1 - 1d50: 1c 92 st X, r1 - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - 1d52: 85 e6 ldi r24, 0x65 ; 101 - 1d54: df 91 pop r29 - 1d56: cf 91 pop r28 - 1d58: 1f 91 pop r17 - 1d5a: 0f 91 pop r16 - 1d5c: ff 90 pop r15 - 1d5e: ef 90 pop r14 - 1d60: df 90 pop r13 - 1d62: 08 95 ret - - while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { - const char* CommandName = EntryPtr->Command; - char c; - - while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { - 1d64: 97 01 movw r18, r14 - 1d66: e2 cf rjmp .-60 ; 0x1d2c - -00001d68 : - - return COMMAND_INFO_OK_WITH_TEXT_ID; -} - -CommandStatusIdType CommandGetRssi(char* OutParam) -{ - 1d68: fc 01 movw r30, r24 -} - -static inline -uint16_t AntennaLevelGet(void) -{ - ADCA.CH0.CTRL |= ADC_CH_START_bm; - 1d6a: 20 91 20 02 lds r18, 0x0220 - 1d6e: 20 68 ori r18, 0x80 ; 128 - 1d70: 20 93 20 02 sts 0x0220, r18 - while( !(ADCA.CH0.INTFLAGS & ADC_CH_CHIF_bm) ); - 1d74: 20 91 23 02 lds r18, 0x0223 - 1d78: 20 ff sbrs r18, 0 - 1d7a: fc cf rjmp .-8 ; 0x1d74 - - ADCA.CH0.INTFLAGS = ADC_CH_CHIF_bm; - 1d7c: 81 e0 ldi r24, 0x01 ; 1 - 1d7e: 80 93 23 02 sts 0x0223, r24 - - int16_t Result = ADCA.CH0RES - ANTENNA_LEVEL_OFFSET; - 1d82: a0 91 10 02 lds r26, 0x0210 - 1d86: b0 91 11 02 lds r27, 0x0211 - 1d8a: ae 5b subi r26, 0xBE ; 190 - 1d8c: b1 09 sbc r27, r1 - 1d8e: b7 fd sbrc r27, 7 - 1d90: 1c c0 rjmp .+56 ; 0x1dca - if (Result < 0) Result = 0; - - return (uint16_t) (((uint32_t) Result * ANTENNA_LEVEL_NUMERATOR) / ANTENNA_LEVEL_DENOMINATOR); - 1d92: 29 e6 ldi r18, 0x69 ; 105 - 1d94: 37 e5 ldi r19, 0x57 ; 87 - 1d96: 4b e0 ldi r20, 0x0B ; 11 - 1d98: 50 e0 ldi r21, 0x00 ; 0 - 1d9a: 0e 94 6f 23 call 0x46de ; 0x46de <__mulshisi3> - 1d9e: aa 27 eor r26, r26 - 1da0: bb 27 eor r27, r27 - snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, - 1da2: 9f 93 push r25 - 1da4: 8f 93 push r24 - 1da6: 27 e6 ldi r18, 0x67 ; 103 - 1da8: 34 e0 ldi r19, 0x04 ; 4 - 1daa: 3f 93 push r19 - 1dac: 2f 93 push r18 - 1dae: 81 e0 ldi r24, 0x01 ; 1 - 1db0: 8f 93 push r24 - 1db2: 1f 92 push r1 - 1db4: ff 93 push r31 - 1db6: ef 93 push r30 - 1db8: 0e 94 0f 24 call 0x481e ; 0x481e - PSTR("%5u mV"), AntennaLevelGet()); - - - return COMMAND_INFO_OK_WITH_TEXT_ID; - 1dbc: 8d b7 in r24, 0x3d ; 61 - 1dbe: 9e b7 in r25, 0x3e ; 62 - 1dc0: 08 96 adiw r24, 0x08 ; 8 - 1dc2: 8d bf out 0x3d, r24 ; 61 - 1dc4: 9e bf out 0x3e, r25 ; 62 -} - 1dc6: 85 e6 ldi r24, 0x65 ; 101 - 1dc8: 08 95 ret - 1dca: a0 e0 ldi r26, 0x00 ; 0 - 1dcc: b0 e0 ldi r27, 0x00 ; 0 - 1dce: e1 cf rjmp .-62 ; 0x1d92 - -00001dd0 : - return Checksum; -} - -void XModemReceive(XModemCallbackType TheCallbackFunc) -{ - State = STATE_RECEIVE_INIT; - 1dd0: 21 e0 ldi r18, 0x01 ; 1 - 1dd2: 20 93 a2 24 sts 0x24A2, r18 - CurrentFrameNumber = FIRST_FRAME_NUMBER; - 1dd6: 20 93 a1 24 sts 0x24A1, r18 - RetryCount = RECV_INIT_COUNT; - 1dda: 24 e1 ldi r18, 0x14 ; 20 - 1ddc: 20 93 9e 24 sts 0x249E, r18 - RetryTimeout = RECV_INIT_TIMEOUT; - 1de0: 25 e0 ldi r18, 0x05 ; 5 - 1de2: 20 93 9d 24 sts 0x249D, r18 - BlockAddress = 0; - 1de6: 10 92 97 24 sts 0x2497, r1 - 1dea: 10 92 98 24 sts 0x2498, r1 - 1dee: 10 92 99 24 sts 0x2499, r1 - 1df2: 10 92 9a 24 sts 0x249A, r1 - - CallbackFunc = TheCallbackFunc; - 1df6: 80 93 95 24 sts 0x2495, r24 - 1dfa: 90 93 96 24 sts 0x2496, r25 - 1dfe: 08 95 ret - -00001e00 : -} - -void XModemSend(XModemCallbackType TheCallbackFunc) -{ - State = STATE_SEND_INIT; - 1e00: 27 e0 ldi r18, 0x07 ; 7 - 1e02: 20 93 a2 24 sts 0x24A2, r18 - RetryTimeout = SEND_INIT_TIMEOUT; - 1e06: 24 e6 ldi r18, 0x64 ; 100 - 1e08: 20 93 9d 24 sts 0x249D, r18 - BlockAddress = 0; - 1e0c: 10 92 97 24 sts 0x2497, r1 - 1e10: 10 92 98 24 sts 0x2498, r1 - 1e14: 10 92 99 24 sts 0x2499, r1 - 1e18: 10 92 9a 24 sts 0x249A, r1 - - CallbackFunc = TheCallbackFunc; - 1e1c: 80 93 95 24 sts 0x2495, r24 - 1e20: 90 93 96 24 sts 0x2496, r25 - 1e24: 08 95 ret - -00001e26 : -} - -bool XModemProcessByte(uint8_t Byte) -{ - 1e26: cf 93 push r28 - switch(State) { - 1e28: 40 91 a2 24 lds r20, 0x24A2 - 1e2c: 50 e0 ldi r21, 0x00 ; 0 - 1e2e: fa 01 movw r30, r20 - 1e30: 31 97 sbiw r30, 0x01 ; 1 - 1e32: e9 30 cpi r30, 0x09 ; 9 - 1e34: f1 05 cpc r31, r1 - 1e36: 20 f0 brcs .+8 ; 0x1e40 - /* Receive Ack */ - State = STATE_OFF; - break; - - default: - return false; - 1e38: c0 e0 ldi r28, 0x00 ; 0 - break; - } - - return true; -} - 1e3a: 8c 2f mov r24, r28 - 1e3c: cf 91 pop r28 - 1e3e: 08 95 ret - CallbackFunc = TheCallbackFunc; -} - -bool XModemProcessByte(uint8_t Byte) -{ - switch(State) { - 1e40: e2 50 subi r30, 0x02 ; 2 - 1e42: ff 4f sbci r31, 0xFF ; 255 - 1e44: 0c 94 69 23 jmp 0x46d2 ; 0x46d2 <__tablejump2__> - } - - break; - - case STATE_RECEIVE_PROCESS: - if (ReceivedFrameNumber == CurrentFrameNumber) { - 1e48: 20 91 a0 24 lds r18, 0x24A0 - 1e4c: 90 91 a1 24 lds r25, 0x24A1 - 1e50: 29 17 cp r18, r25 - 1e52: 09 f4 brne .+2 ; 0x1e56 - 1e54: dd c0 rjmp .+442 ; 0x2010 - } else { - /* Data seems to be damaged */ - TerminalSendByte(BYTE_NAK); - State = STATE_RECEIVE_WAIT; - } - } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { - 1e56: 30 e0 ldi r19, 0x00 ; 0 - 1e58: 89 2f mov r24, r25 - 1e5a: 90 e0 ldi r25, 0x00 ; 0 - 1e5c: 01 97 sbiw r24, 0x01 ; 1 - 1e5e: 28 17 cp r18, r24 - 1e60: 39 07 cpc r19, r25 - 1e62: 09 f4 brne .+2 ; 0x1e66 - 1e64: 20 c1 rjmp .+576 ; 0x20a6 -INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } - 1e66: 68 e1 ldi r22, 0x18 ; 24 - 1e68: 81 e0 ldi r24, 0x01 ; 1 - 1e6a: 90 e2 ldi r25, 0x20 ; 32 - 1e6c: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendByte(BYTE_ACK); - State = STATE_RECEIVE_WAIT; - } else { - /* This frame is completely out of order. Just cancel */ - TerminalSendByte(BYTE_CAN); - State = STATE_OFF; - 1e70: 10 92 a2 24 sts 0x24A2, r1 - default: - return false; - break; - } - - return true; - 1e74: c1 e0 ldi r28, 0x01 ; 1 -} - 1e76: 8c 2f mov r24, r28 - 1e78: cf 91 pop r28 - 1e7a: 08 95 ret - - break; - - case STATE_SEND_INIT: - /* Start sending on NAK */ - if (Byte == BYTE_NAK) { - 1e7c: 85 31 cpi r24, 0x15 ; 21 - 1e7e: 09 f4 brne .+2 ; 0x1e82 - 1e80: 50 c0 rjmp .+160 ; 0x1f22 - } - - /* Fallthrough */ - - case STATE_SEND_WAIT: - if (Byte == BYTE_CAN) { - 1e82: 88 31 cpi r24, 0x18 ; 24 - 1e84: 09 f4 brne .+2 ; 0x1e88 - 1e86: 06 c1 rjmp .+524 ; 0x2094 - /* Cancel */ - TerminalSendByte(BYTE_ACK); - State = STATE_OFF; - } else if (Byte == BYTE_ACK) { - 1e88: 86 30 cpi r24, 0x06 ; 6 - 1e8a: 09 f4 brne .+2 ; 0x1e8e - 1e8c: 29 c1 rjmp .+594 ; 0x20e0 - BlockAddress += XMODEM_BLOCK_SIZE; - } else { - TerminalSendByte(BYTE_EOT); - State = STATE_SEND_EOT; - } - } else if (Byte == BYTE_NAK){ - 1e8e: 85 31 cpi r24, 0x15 ; 21 - 1e90: 09 f4 brne .+2 ; 0x1e94 - 1e92: 98 c0 rjmp .+304 ; 0x1fc4 - default: - return false; - break; - } - - return true; - 1e94: c1 e0 ldi r28, 0x01 ; 1 -} - 1e96: 8c 2f mov r24, r28 - 1e98: cf 91 pop r28 - 1e9a: 08 95 ret - - break; - - case STATE_RECEIVE_FRAMENUM1: - /* Store frame number */ - ReceivedFrameNumber = Byte; - 1e9c: 80 93 a0 24 sts 0x24A0, r24 - State = STATE_RECEIVE_FRAMENUM2; - 1ea0: 84 e0 ldi r24, 0x04 ; 4 - 1ea2: 80 93 a2 24 sts 0x24A2, r24 - default: - return false; - break; - } - - return true; - 1ea6: c1 e0 ldi r28, 0x01 ; 1 -} - 1ea8: 8c 2f mov r24, r28 - 1eaa: cf 91 pop r28 - 1eac: 08 95 ret - ReceivedFrameNumber = Byte; - State = STATE_RECEIVE_FRAMENUM2; - break; - - case STATE_RECEIVE_FRAMENUM2: - if (Byte == (255 - ReceivedFrameNumber)) { - 1eae: 90 e0 ldi r25, 0x00 ; 0 - 1eb0: 40 91 a0 24 lds r20, 0x24A0 - 1eb4: 2f ef ldi r18, 0xFF ; 255 - 1eb6: 30 e0 ldi r19, 0x00 ; 0 - 1eb8: 24 1b sub r18, r20 - 1eba: 31 09 sbc r19, r1 - 1ebc: 82 17 cp r24, r18 - 1ebe: 93 07 cpc r25, r19 - 1ec0: 31 f5 brne .+76 ; 0x1f0e - /* frame-number check passed. */ - State = STATE_RECEIVE_DATA; - 1ec2: 85 e0 ldi r24, 0x05 ; 5 - 1ec4: 80 93 a2 24 sts 0x24A2, r24 - default: - return false; - break; - } - - return true; - 1ec8: c1 e0 ldi r28, 0x01 ; 1 - 1eca: b7 cf rjmp .-146 ; 0x1e3a -bool XModemProcessByte(uint8_t Byte) -{ - switch(State) { - case STATE_RECEIVE_INIT: - case STATE_RECEIVE_WAIT: - if (Byte == BYTE_SOH) { - 1ecc: 81 30 cpi r24, 0x01 ; 1 - 1ece: 09 f4 brne .+2 ; 0x1ed2 - 1ed0: ec c0 rjmp .+472 ; 0x20aa - /* Next frame incoming */ - BufferIdx = 0; - Checksum = CHECKSUM_INIT_VALUE; - State = STATE_RECEIVE_FRAMENUM1; - } else if (Byte == BYTE_EOT) { - 1ed2: 84 30 cpi r24, 0x04 ; 4 - 1ed4: 09 f4 brne .+2 ; 0x1ed8 - 1ed6: de c0 rjmp .+444 ; 0x2094 - /* Transmission finished */ - TerminalSendByte(BYTE_ACK); - State = STATE_OFF; - } else if (Byte == BYTE_CAN) { - 1ed8: 88 31 cpi r24, 0x18 ; 24 - 1eda: 51 f2 breq .-108 ; 0x1e70 - default: - return false; - break; - } - - return true; - 1edc: c1 e0 ldi r28, 0x01 ; 1 - 1ede: db cf rjmp .-74 ; 0x1e96 - - break; - - case STATE_RECEIVE_DATA: - /* Process byte and update checksum */ - TerminalBuffer[BufferIdx++] = Byte; - 1ee0: 40 91 9b 24 lds r20, 0x249B - 1ee4: 50 91 9c 24 lds r21, 0x249C - 1ee8: 9a 01 movw r18, r20 - 1eea: 2f 5f subi r18, 0xFF ; 255 - 1eec: 3f 4f sbci r19, 0xFF ; 255 - 1eee: 20 93 9b 24 sts 0x249B, r18 - 1ef2: 30 93 9c 24 sts 0x249C, r19 - 1ef6: fa 01 movw r30, r20 - 1ef8: e0 5f subi r30, 0xF0 ; 240 - 1efa: fa 4d sbci r31, 0xDA ; 218 - 1efc: 80 83 st Z, r24 - - if (BufferIdx == XMODEM_BLOCK_SIZE) { - 1efe: 20 38 cpi r18, 0x80 ; 128 - 1f00: 31 05 cpc r19, r1 - 1f02: 41 f6 brne .-112 ; 0x1e94 - /* Block full */ - State = STATE_RECEIVE_PROCESS; - 1f04: 86 e0 ldi r24, 0x06 ; 6 - 1f06: 80 93 a2 24 sts 0x24A2, r24 - default: - return false; - break; - } - - return true; - 1f0a: c1 e0 ldi r28, 0x01 ; 1 - 1f0c: 96 cf rjmp .-212 ; 0x1e3a - 1f0e: 65 e1 ldi r22, 0x15 ; 21 - 1f10: 81 e0 ldi r24, 0x01 ; 1 - 1f12: 90 e2 ldi r25, 0x20 ; 32 - 1f14: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - State = STATE_RECEIVE_WAIT; - } - } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { - /* This is a retransmission */ - TerminalSendByte(BYTE_ACK); - State = STATE_RECEIVE_WAIT; - 1f18: 82 e0 ldi r24, 0x02 ; 2 - 1f1a: 80 93 a2 24 sts 0x24A2, r24 - default: - return false; - break; - } - - return true; - 1f1e: c1 e0 ldi r28, 0x01 ; 1 - 1f20: 8c cf rjmp .-232 ; 0x1e3a - 1f22: 81 e0 ldi r24, 0x01 ; 1 - /* Cancel */ - TerminalSendByte(BYTE_ACK); - State = STATE_OFF; - } else if (Byte == BYTE_ACK) { - /* Acknowledge. Proceed to next frame, get data and calc checksum */ - CurrentFrameNumber++; - 1f24: 80 93 a1 24 sts 0x24A1, r24 - - if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { - 1f28: 40 91 97 24 lds r20, 0x2497 - 1f2c: 50 91 98 24 lds r21, 0x2498 - 1f30: 60 91 99 24 lds r22, 0x2499 - 1f34: 70 91 9a 24 lds r23, 0x249A - 1f38: e0 91 95 24 lds r30, 0x2495 - 1f3c: f0 91 96 24 lds r31, 0x2496 - 1f40: 20 e8 ldi r18, 0x80 ; 128 - 1f42: 30 e0 ldi r19, 0x00 ; 0 - 1f44: 80 e1 ldi r24, 0x10 ; 16 - 1f46: 95 e2 ldi r25, 0x25 ; 37 - 1f48: 09 95 icall - 1f4a: c8 2f mov r28, r24 - 1f4c: 88 23 and r24, r24 - 1f4e: 09 f4 brne .+2 ; 0x1f52 - 1f50: b7 c0 rjmp .+366 ; 0x20c0 - 1f52: 61 e0 ldi r22, 0x01 ; 1 - 1f54: 81 e0 ldi r24, 0x01 ; 1 - 1f56: 90 e2 ldi r25, 0x20 ; 32 - 1f58: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - 1f5c: 60 91 a1 24 lds r22, 0x24A1 - 1f60: 81 e0 ldi r24, 0x01 ; 1 - 1f62: 90 e2 ldi r25, 0x20 ; 32 - 1f64: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendByte(BYTE_SOH); - TerminalSendByte(CurrentFrameNumber); - TerminalSendByte(255 - CurrentFrameNumber); - 1f68: 60 91 a1 24 lds r22, 0x24A1 - 1f6c: 60 95 com r22 - 1f6e: 81 e0 ldi r24, 0x01 ; 1 - 1f70: 90 e2 ldi r25, 0x20 ; 32 - 1f72: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - 1f76: 60 e8 ldi r22, 0x80 ; 128 - 1f78: 70 e0 ldi r23, 0x00 ; 0 - 1f7a: 80 e1 ldi r24, 0x10 ; 16 - 1f7c: 95 e2 ldi r25, 0x25 ; 37 - 1f7e: d8 dc rcall .-1616 ; 0x1930 - 1f80: e0 e1 ldi r30, 0x10 ; 16 - 1f82: f5 e2 ldi r31, 0x25 ; 37 -static uint32_t BlockAddress; - -static XModemCallbackType CallbackFunc; - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - 1f84: 60 e0 ldi r22, 0x00 ; 0 - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - Checksum += *DataPtr++; - 1f86: 81 91 ld r24, Z+ - 1f88: 68 0f add r22, r24 - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 1f8a: 85 e2 ldi r24, 0x25 ; 37 - 1f8c: e0 39 cpi r30, 0x90 ; 144 - 1f8e: f8 07 cpc r31, r24 - 1f90: d1 f7 brne .-12 ; 0x1f86 - 1f92: 81 e0 ldi r24, 0x01 ; 1 - 1f94: 90 e2 ldi r25, 0x20 ; 32 - 1f96: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendByte(CurrentFrameNumber); - TerminalSendByte(255 - CurrentFrameNumber); - TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); - - BlockAddress += XMODEM_BLOCK_SIZE; - 1f9a: 40 91 97 24 lds r20, 0x2497 - 1f9e: 50 91 98 24 lds r21, 0x2498 - 1fa2: 60 91 99 24 lds r22, 0x2499 - 1fa6: 70 91 9a 24 lds r23, 0x249A - 1faa: 40 58 subi r20, 0x80 ; 128 - 1fac: 5f 4f sbci r21, 0xFF ; 255 - 1fae: 6f 4f sbci r22, 0xFF ; 255 - 1fb0: 7f 4f sbci r23, 0xFF ; 255 - 1fb2: 40 93 97 24 sts 0x2497, r20 - 1fb6: 50 93 98 24 sts 0x2498, r21 - 1fba: 60 93 99 24 sts 0x2499, r22 - 1fbe: 70 93 9a 24 sts 0x249A, r23 - 1fc2: 3b cf rjmp .-394 ; 0x1e3a - 1fc4: 61 e0 ldi r22, 0x01 ; 1 - 1fc6: 81 e0 ldi r24, 0x01 ; 1 - 1fc8: 90 e2 ldi r25, 0x20 ; 32 - 1fca: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - 1fce: 60 91 a1 24 lds r22, 0x24A1 - 1fd2: 81 e0 ldi r24, 0x01 ; 1 - 1fd4: 90 e2 ldi r25, 0x20 ; 32 - 1fd6: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - } - } else if (Byte == BYTE_NAK){ - /* Resend frame */ - TerminalSendByte(BYTE_SOH); - TerminalSendByte(CurrentFrameNumber); - TerminalSendByte(255 - CurrentFrameNumber); - 1fda: 60 91 a1 24 lds r22, 0x24A1 - 1fde: 60 95 com r22 - 1fe0: 81 e0 ldi r24, 0x01 ; 1 - 1fe2: 90 e2 ldi r25, 0x20 ; 32 - 1fe4: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); - 1fe8: 60 e8 ldi r22, 0x80 ; 128 - 1fea: 70 e0 ldi r23, 0x00 ; 0 - 1fec: 80 e1 ldi r24, 0x10 ; 16 - 1fee: 95 e2 ldi r25, 0x25 ; 37 - 1ff0: 9f dc rcall .-1730 ; 0x1930 - 1ff2: e0 e1 ldi r30, 0x10 ; 16 - 1ff4: f5 e2 ldi r31, 0x25 ; 37 -static uint32_t BlockAddress; - -static XModemCallbackType CallbackFunc; - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - 1ff6: 60 e0 ldi r22, 0x00 ; 0 - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - Checksum += *DataPtr++; - 1ff8: 81 91 ld r24, Z+ - 1ffa: 68 0f add r22, r24 - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 1ffc: 25 e2 ldi r18, 0x25 ; 37 - 1ffe: e0 39 cpi r30, 0x90 ; 144 - 2000: f2 07 cpc r31, r18 - 2002: d1 f7 brne .-12 ; 0x1ff8 - 2004: 81 e0 ldi r24, 0x01 ; 1 - 2006: 90 e2 ldi r25, 0x20 ; 32 - 2008: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - default: - return false; - break; - } - - return true; - 200c: c1 e0 ldi r28, 0x01 ; 1 - 200e: 43 cf rjmp .-378 ; 0x1e96 - 2010: e0 e1 ldi r30, 0x10 ; 16 - 2012: f5 e2 ldi r31, 0x25 ; 37 - } - - break; - - case STATE_RECEIVE_PROCESS: - if (ReceivedFrameNumber == CurrentFrameNumber) { - 2014: 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--) { - Checksum += *DataPtr++; - 2016: 21 91 ld r18, Z+ - 2018: 92 0f add r25, r18 - -static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { - uint8_t Checksum = CHECKSUM_INIT_VALUE; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 201a: 25 e2 ldi r18, 0x25 ; 37 - 201c: e0 39 cpi r30, 0x90 ; 144 - 201e: f2 07 cpc r31, r18 - 2020: d1 f7 brne .-12 ; 0x2016 - - case STATE_RECEIVE_PROCESS: - if (ReceivedFrameNumber == CurrentFrameNumber) { - /* This is the expected frame. Calculate and verify checksum */ - - if (CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE) == Byte) { - 2022: 89 13 cpse r24, r25 - 2024: 74 cf rjmp .-280 ; 0x1f0e - /* Checksum is valid. Pass received data to callback function */ - if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { - 2026: 40 91 97 24 lds r20, 0x2497 - 202a: 50 91 98 24 lds r21, 0x2498 - 202e: 60 91 99 24 lds r22, 0x2499 - 2032: 70 91 9a 24 lds r23, 0x249A - 2036: e0 91 95 24 lds r30, 0x2495 - 203a: f0 91 96 24 lds r31, 0x2496 - 203e: 20 e8 ldi r18, 0x80 ; 128 - 2040: 30 e0 ldi r19, 0x00 ; 0 - 2042: 80 e1 ldi r24, 0x10 ; 16 - 2044: 95 e2 ldi r25, 0x25 ; 37 - 2046: 09 95 icall - 2048: c8 2f mov r28, r24 - 204a: 88 23 and r24, r24 - 204c: 09 f4 brne .+2 ; 0x2050 - 204e: 42 c0 rjmp .+132 ; 0x20d4 - /* Proceed to next frame and send ACK */ - CurrentFrameNumber++; - 2050: 80 91 a1 24 lds r24, 0x24A1 - 2054: 8f 5f subi r24, 0xFF ; 255 - 2056: 80 93 a1 24 sts 0x24A1, r24 - BlockAddress += XMODEM_BLOCK_SIZE; - 205a: 40 91 97 24 lds r20, 0x2497 - 205e: 50 91 98 24 lds r21, 0x2498 - 2062: 60 91 99 24 lds r22, 0x2499 - 2066: 70 91 9a 24 lds r23, 0x249A - 206a: 40 58 subi r20, 0x80 ; 128 - 206c: 5f 4f sbci r21, 0xFF ; 255 - 206e: 6f 4f sbci r22, 0xFF ; 255 - 2070: 7f 4f sbci r23, 0xFF ; 255 - 2072: 40 93 97 24 sts 0x2497, r20 - 2076: 50 93 98 24 sts 0x2498, r21 - 207a: 60 93 99 24 sts 0x2499, r22 - 207e: 70 93 9a 24 sts 0x249A, r23 -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); } - 2082: 66 e0 ldi r22, 0x06 ; 6 - 2084: 81 e0 ldi r24, 0x01 ; 1 - 2086: 90 e2 ldi r25, 0x20 ; 32 - 2088: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendChar(BYTE_ACK); - State = STATE_RECEIVE_WAIT; - 208c: 82 e0 ldi r24, 0x02 ; 2 - 208e: 80 93 a2 24 sts 0x24A2, r24 - 2092: d3 ce rjmp .-602 ; 0x1e3a -INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } - 2094: 66 e0 ldi r22, 0x06 ; 6 - 2096: 81 e0 ldi r24, 0x01 ; 1 - 2098: 90 e2 ldi r25, 0x20 ; 32 - 209a: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - Checksum = CHECKSUM_INIT_VALUE; - State = STATE_RECEIVE_FRAMENUM1; - } else if (Byte == BYTE_EOT) { - /* Transmission finished */ - TerminalSendByte(BYTE_ACK); - State = STATE_OFF; - 209e: 10 92 a2 24 sts 0x24A2, r1 - default: - return false; - break; - } - - return true; - 20a2: c1 e0 ldi r28, 0x01 ; 1 - 20a4: ca ce rjmp .-620 ; 0x1e3a - 20a6: 66 e0 ldi r22, 0x06 ; 6 - 20a8: 33 cf rjmp .-410 ; 0x1f10 - switch(State) { - case STATE_RECEIVE_INIT: - case STATE_RECEIVE_WAIT: - if (Byte == BYTE_SOH) { - /* Next frame incoming */ - BufferIdx = 0; - 20aa: 10 92 9b 24 sts 0x249B, r1 - 20ae: 10 92 9c 24 sts 0x249C, r1 - Checksum = CHECKSUM_INIT_VALUE; - 20b2: 10 92 9f 24 sts 0x249F, r1 - State = STATE_RECEIVE_FRAMENUM1; - 20b6: 83 e0 ldi r24, 0x03 ; 3 - 20b8: 80 93 a2 24 sts 0x24A2, r24 - default: - return false; - break; - } - - return true; - 20bc: c1 e0 ldi r28, 0x01 ; 1 - 20be: bd ce rjmp .-646 ; 0x1e3a - 20c0: 64 e0 ldi r22, 0x04 ; 4 - 20c2: 81 e0 ldi r24, 0x01 ; 1 - 20c4: 90 e2 ldi r25, 0x20 ; 32 - 20c6: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); - - BlockAddress += XMODEM_BLOCK_SIZE; - } else { - TerminalSendByte(BYTE_EOT); - State = STATE_SEND_EOT; - 20ca: 89 e0 ldi r24, 0x09 ; 9 - 20cc: 80 93 a2 24 sts 0x24A2, r24 - default: - return false; - break; - } - - return true; - 20d0: c1 e0 ldi r28, 0x01 ; 1 - 20d2: b3 ce rjmp .-666 ; 0x1e3a - 20d4: 68 e1 ldi r22, 0x18 ; 24 - 20d6: 81 e0 ldi r24, 0x01 ; 1 - 20d8: 90 e2 ldi r25, 0x20 ; 32 - 20da: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - 20de: c3 ce rjmp .-634 ; 0x1e66 - 20e0: 80 91 a1 24 lds r24, 0x24A1 - 20e4: 8f 5f subi r24, 0xFF ; 255 - 20e6: 1e cf rjmp .-452 ; 0x1f24 - -000020e8 : -} - -void XModemTick(void) -{ - /* Timeouts go here */ - switch(State) { - 20e8: 80 91 a2 24 lds r24, 0x24A2 - 20ec: 81 30 cpi r24, 0x01 ; 1 - 20ee: 71 f0 breq .+28 ; 0x210c - 20f0: 87 30 cpi r24, 0x07 ; 7 - 20f2: 59 f4 brne .+22 ; 0x210a - RetryTimeout = RECV_INIT_TIMEOUT; - } - break; - - case STATE_SEND_INIT: - if (RetryTimeout-- == 0) { - 20f4: 80 91 9d 24 lds r24, 0x249D - 20f8: 9f ef ldi r25, 0xFF ; 255 - 20fa: 98 0f add r25, r24 - 20fc: 90 93 9d 24 sts 0x249D, r25 - 2100: 81 11 cpse r24, r1 - 2102: 02 c0 rjmp .+4 ; 0x2108 - /* Abort */ - State = STATE_OFF; - 2104: 10 92 a2 24 sts 0x24A2, r1 - 2108: 08 95 ret - 210a: 08 95 ret -void XModemTick(void) -{ - /* Timeouts go here */ - switch(State) { - case STATE_RECEIVE_INIT: - if (RetryTimeout-- == 0) { - 210c: 80 91 9d 24 lds r24, 0x249D - 2110: 9f ef ldi r25, 0xFF ; 255 - 2112: 98 0f add r25, r24 - 2114: 90 93 9d 24 sts 0x249D, r25 - 2118: 81 11 cpse r24, r1 - 211a: f6 cf rjmp .-20 ; 0x2108 - if (RetryCount-- > 0) { - 211c: 80 91 9e 24 lds r24, 0x249E - 2120: 9f ef ldi r25, 0xFF ; 255 - 2122: 98 0f add r25, r24 - 2124: 90 93 9e 24 sts 0x249E, r25 - 2128: 81 11 cpse r24, r1 - 212a: 06 c0 rjmp .+12 ; 0x2138 - /* Put out communication request */ - TerminalSendChar(BYTE_NAK); - } else { - /* Just shut off after some time. */ - State = STATE_OFF; - 212c: 10 92 a2 24 sts 0x24A2, r1 - } - - RetryTimeout = RECV_INIT_TIMEOUT; - 2130: 85 e0 ldi r24, 0x05 ; 5 - 2132: 80 93 9d 24 sts 0x249D, r24 - 2136: 08 95 ret -void EVENT_USB_Device_Connect(void); -void EVENT_USB_Device_Disconnect(void); -void EVENT_USB_Device_ConfigurationChanged(void); -void EVENT_USB_Device_ControlRequest(void); - -INLINE void TerminalSendChar(char c) { CDC_Device_SendByte(&TerminalHandle, c); } - 2138: 65 e1 ldi r22, 0x15 ; 21 - 213a: 81 e0 ldi r24, 0x01 ; 1 - 213c: 90 e2 ldi r25, 0x20 ; 32 - 213e: 0e 94 e4 21 call 0x43c8 ; 0x43c8 - 2142: f6 cf rjmp .-20 ; 0x2130 - -00002144 : -void CommandLineInit(void) -{ - BufferIdx = 0; -} - -bool CommandLineProcessByte(uint8_t Byte) { - 2144: 1f 93 push r17 - 2146: cf 93 push r28 - 2148: df 93 push r29 - if (IS_CHARACTER(Byte)){ - 214a: 9f eb ldi r25, 0xBF ; 191 - 214c: 98 0f add r25, r24 - 214e: 9a 31 cpi r25, 0x1A ; 26 - 2150: 28 f0 brcs .+10 ; 0x215c - 2152: 9f e9 ldi r25, 0x9F ; 159 - 2154: 98 0f add r25, r24 - 2156: 9a 31 cpi r25, 0x1A ; 26 - 2158: c0 f4 brcc .+48 ; 0x218a - /* Store uppercase character */ - if (IS_LOWERCASE(Byte)) { - Byte = TO_UPPERCASE(Byte); - 215a: 80 52 subi r24, 0x20 ; 32 - } - - /* Prevent buffer overflow and account for '\0' */ - if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { - 215c: 20 91 a3 24 lds r18, 0x24A3 - 2160: 30 91 a4 24 lds r19, 0x24A4 - 2164: 2f 3f cpi r18, 0xFF ; 255 - 2166: 31 05 cpc r19, r1 - 2168: 58 f4 brcc .+22 ; 0x2180 - TerminalBuffer[BufferIdx++] = Byte; - 216a: a9 01 movw r20, r18 - 216c: 4f 5f subi r20, 0xFF ; 255 - 216e: 5f 4f sbci r21, 0xFF ; 255 - 2170: 40 93 a3 24 sts 0x24A3, r20 - 2174: 50 93 a4 24 sts 0x24A4, r21 - 2178: f9 01 movw r30, r18 - 217a: e0 5f subi r30, 0xF0 ; 240 - 217c: fa 4d sbci r31, 0xDA ; 218 - 217e: 80 83 st Z, r24 - } else { - /* Ignore other chars */ - } - - return true; -} - 2180: 81 e0 ldi r24, 0x01 ; 1 - 2182: df 91 pop r29 - 2184: cf 91 pop r28 - 2186: 1f 91 pop r17 - 2188: 08 95 ret -{ - BufferIdx = 0; -} - -bool CommandLineProcessByte(uint8_t Byte) { - if (IS_CHARACTER(Byte)){ - 218a: 90 ed ldi r25, 0xD0 ; 208 - 218c: 98 0f add r25, r24 - 218e: 9a 30 cpi r25, 0x0A ; 10 - 2190: 28 f3 brcs .-54 ; 0x215c - 2192: 8f 35 cpi r24, 0x5F ; 95 - 2194: 19 f3 breq .-58 ; 0x215c - 2196: 98 2f mov r25, r24 - 2198: 9d 7f andi r25, 0xFD ; 253 - 219a: 9d 33 cpi r25, 0x3D ; 61 - 219c: f9 f2 breq .-66 ; 0x215c - - /* Prevent buffer overflow and account for '\0' */ - if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { - TerminalBuffer[BufferIdx++] = Byte; - } - }else if (Byte == '\r') { - 219e: 8d 30 cpi r24, 0x0D ; 13 - 21a0: a9 f0 breq .+42 ; 0x21cc - /* Process on \r. Terminate string and decode. */ - TerminalBuffer[BufferIdx] = '\0'; - BufferIdx = 0; - - DecodeCommand(); - }else if (Byte == '\b') { - 21a2: 88 30 cpi r24, 0x08 ; 8 - 21a4: 39 f0 breq .+14 ; 0x21b4 - /* Backspace. Delete last character in buffer. */ - if (BufferIdx > 0) { - BufferIdx--; - } - } else if (Byte == 0x1B){ - 21a6: 8b 31 cpi r24, 0x1B ; 27 - 21a8: 59 f7 brne .-42 ; 0x2180 - /* Drop buffer on escape */ - BufferIdx = 0; - 21aa: 10 92 a3 24 sts 0x24A3, r1 - 21ae: 10 92 a4 24 sts 0x24A4, r1 - 21b2: e6 cf rjmp .-52 ; 0x2180 - BufferIdx = 0; - - DecodeCommand(); - }else if (Byte == '\b') { - /* Backspace. Delete last character in buffer. */ - if (BufferIdx > 0) { - 21b4: 80 91 a3 24 lds r24, 0x24A3 - 21b8: 90 91 a4 24 lds r25, 0x24A4 - 21bc: 00 97 sbiw r24, 0x00 ; 0 - 21be: 01 f3 breq .-64 ; 0x2180 - BufferIdx--; - 21c0: 01 97 sbiw r24, 0x01 ; 1 - 21c2: 80 93 a3 24 sts 0x24A3, r24 - 21c6: 90 93 a4 24 sts 0x24A4, r25 - 21ca: da cf rjmp .-76 ; 0x2180 - if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { - TerminalBuffer[BufferIdx++] = Byte; - } - }else if (Byte == '\r') { - /* Process on \r. Terminate string and decode. */ - TerminalBuffer[BufferIdx] = '\0'; - 21cc: e0 91 a3 24 lds r30, 0x24A3 - 21d0: f0 91 a4 24 lds r31, 0x24A4 - 21d4: e0 5f subi r30, 0xF0 ; 240 - 21d6: fa 4d sbci r31, 0xDA ; 218 - 21d8: 10 82 st Z, r1 - BufferIdx = 0; - 21da: 10 92 a3 24 sts 0x24A3, r1 - 21de: 10 92 a4 24 sts 0x24A4, r1 - bool CommandFound = false; - CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; - char* pTerminalBuffer = (char*) TerminalBuffer; - - /* Do some sanity check first */ - if (!IS_COMMAND_DELIMITER(pTerminalBuffer[0])) { - 21e2: 80 91 10 25 lds r24, 0x2510 - 21e6: 88 23 and r24, r24 - 21e8: 09 f4 brne .+2 ; 0x21ec - 21ea: a0 c0 rjmp .+320 ; 0x232c - 21ec: 8d 7f andi r24, 0xFD ; 253 - 21ee: 8d 33 cpi r24, 0x3D ; 61 - 21f0: 09 f4 brne .+2 ; 0x21f4 - 21f2: 9c c0 rjmp .+312 ; 0x232c - 21f4: e1 e1 ldi r30, 0x11 ; 17 - 21f6: f5 e2 ldi r31, 0x25 ; 37 - 21f8: 04 c0 rjmp .+8 ; 0x2202 - char* pCommandDelimiter = pTerminalBuffer; - char CommandDelimiter = '\0'; - - /* Search for command delimiter, store it and replace with '\0' */ - while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) - 21fa: 1f 33 cpi r17, 0x3F ; 63 - 21fc: 31 f0 breq .+12 ; 0x220a - 21fe: 1d 33 cpi r17, 0x3D ; 61 - 2200: 21 f0 breq .+8 ; 0x220a - pCommandDelimiter++; - 2202: ef 01 movw r28, r30 - if (!IS_COMMAND_DELIMITER(pTerminalBuffer[0])) { - char* pCommandDelimiter = pTerminalBuffer; - char CommandDelimiter = '\0'; - - /* Search for command delimiter, store it and replace with '\0' */ - while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) - 2204: 11 91 ld r17, Z+ - 2206: 11 11 cpse r17, r1 - 2208: f8 cf rjmp .-16 ; 0x21fa - pCommandDelimiter++; - - CommandDelimiter = *pCommandDelimiter; - *pCommandDelimiter = '\0'; - 220a: 18 82 st Y, r1 - - /* Search in command table */ - for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { - if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 220c: 67 e9 ldi r22, 0x97 ; 151 - 220e: 75 e0 ldi r23, 0x05 ; 5 - 2210: 80 e1 ldi r24, 0x10 ; 16 - 2212: 95 e2 ldi r25, 0x25 ; 37 - 2214: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2218: 89 2b or r24, r25 - 221a: 09 f4 brne .+2 ; 0x221e - 221c: 36 c1 rjmp .+620 ; 0x248a - 221e: 6d ea ldi r22, 0xAD ; 173 - 2220: 75 e0 ldi r23, 0x05 ; 5 - 2222: 80 e1 ldi r24, 0x10 ; 16 - 2224: 95 e2 ldi r25, 0x25 ; 37 - 2226: 0e 94 ee 23 call 0x47dc ; 0x47dc - 222a: 89 2b or r24, r25 - 222c: 09 f4 brne .+2 ; 0x2230 - 222e: 2a c1 rjmp .+596 ; 0x2484 - 2230: 63 ec ldi r22, 0xC3 ; 195 - 2232: 75 e0 ldi r23, 0x05 ; 5 - 2234: 80 e1 ldi r24, 0x10 ; 16 - 2236: 95 e2 ldi r25, 0x25 ; 37 - 2238: 0e 94 ee 23 call 0x47dc ; 0x47dc - 223c: 89 2b or r24, r25 - 223e: 09 f4 brne .+2 ; 0x2242 - 2240: 1e c1 rjmp .+572 ; 0x247e - 2242: 69 ed ldi r22, 0xD9 ; 217 - 2244: 75 e0 ldi r23, 0x05 ; 5 - 2246: 80 e1 ldi r24, 0x10 ; 16 - 2248: 95 e2 ldi r25, 0x25 ; 37 - 224a: 0e 94 ee 23 call 0x47dc ; 0x47dc - 224e: 89 2b or r24, r25 - 2250: 09 f4 brne .+2 ; 0x2254 - 2252: 12 c1 rjmp .+548 ; 0x2478 - 2254: 6f ee ldi r22, 0xEF ; 239 - 2256: 75 e0 ldi r23, 0x05 ; 5 - 2258: 80 e1 ldi r24, 0x10 ; 16 - 225a: 95 e2 ldi r25, 0x25 ; 37 - 225c: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2260: 89 2b or r24, r25 - 2262: 09 f4 brne .+2 ; 0x2266 - 2264: 06 c1 rjmp .+524 ; 0x2472 - 2266: 65 e0 ldi r22, 0x05 ; 5 - 2268: 76 e0 ldi r23, 0x06 ; 6 - 226a: 80 e1 ldi r24, 0x10 ; 16 - 226c: 95 e2 ldi r25, 0x25 ; 37 - 226e: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2272: 89 2b or r24, r25 - 2274: 09 f4 brne .+2 ; 0x2278 - 2276: fa c0 rjmp .+500 ; 0x246c - 2278: 6b e1 ldi r22, 0x1B ; 27 - 227a: 76 e0 ldi r23, 0x06 ; 6 - 227c: 80 e1 ldi r24, 0x10 ; 16 - 227e: 95 e2 ldi r25, 0x25 ; 37 - 2280: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2284: 89 2b or r24, r25 - 2286: 09 f4 brne .+2 ; 0x228a - 2288: ee c0 rjmp .+476 ; 0x2466 - 228a: 61 e3 ldi r22, 0x31 ; 49 - 228c: 76 e0 ldi r23, 0x06 ; 6 - 228e: 80 e1 ldi r24, 0x10 ; 16 - 2290: 95 e2 ldi r25, 0x25 ; 37 - 2292: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2296: 89 2b or r24, r25 - 2298: 09 f4 brne .+2 ; 0x229c - 229a: e2 c0 rjmp .+452 ; 0x2460 - 229c: 67 e4 ldi r22, 0x47 ; 71 - 229e: 76 e0 ldi r23, 0x06 ; 6 - 22a0: 80 e1 ldi r24, 0x10 ; 16 - 22a2: 95 e2 ldi r25, 0x25 ; 37 - 22a4: 0e 94 ee 23 call 0x47dc ; 0x47dc - 22a8: 89 2b or r24, r25 - 22aa: 09 f4 brne .+2 ; 0x22ae - 22ac: d6 c0 rjmp .+428 ; 0x245a - 22ae: 6d e5 ldi r22, 0x5D ; 93 - 22b0: 76 e0 ldi r23, 0x06 ; 6 - 22b2: 80 e1 ldi r24, 0x10 ; 16 - 22b4: 95 e2 ldi r25, 0x25 ; 37 - 22b6: 0e 94 ee 23 call 0x47dc ; 0x47dc - 22ba: 89 2b or r24, r25 - 22bc: 09 f4 brne .+2 ; 0x22c0 - 22be: ca c0 rjmp .+404 ; 0x2454 - 22c0: 63 e7 ldi r22, 0x73 ; 115 - 22c2: 76 e0 ldi r23, 0x06 ; 6 - 22c4: 80 e1 ldi r24, 0x10 ; 16 - 22c6: 95 e2 ldi r25, 0x25 ; 37 - 22c8: 0e 94 ee 23 call 0x47dc ; 0x47dc - 22cc: 89 2b or r24, r25 - 22ce: 09 f4 brne .+2 ; 0x22d2 - 22d0: be c0 rjmp .+380 ; 0x244e - 22d2: 69 e8 ldi r22, 0x89 ; 137 - 22d4: 76 e0 ldi r23, 0x06 ; 6 - 22d6: 80 e1 ldi r24, 0x10 ; 16 - 22d8: 95 e2 ldi r25, 0x25 ; 37 - 22da: 0e 94 ee 23 call 0x47dc ; 0x47dc - 22de: 89 2b or r24, r25 - 22e0: 09 f4 brne .+2 ; 0x22e4 - 22e2: b2 c0 rjmp .+356 ; 0x2448 - 22e4: 6f e9 ldi r22, 0x9F ; 159 - 22e6: 76 e0 ldi r23, 0x06 ; 6 - 22e8: 80 e1 ldi r24, 0x10 ; 16 - 22ea: 95 e2 ldi r25, 0x25 ; 37 - 22ec: 0e 94 ee 23 call 0x47dc ; 0x47dc - 22f0: 89 2b or r24, r25 - 22f2: 09 f4 brne .+2 ; 0x22f6 - 22f4: a6 c0 rjmp .+332 ; 0x2442 - 22f6: 65 eb ldi r22, 0xB5 ; 181 - 22f8: 76 e0 ldi r23, 0x06 ; 6 - 22fa: 80 e1 ldi r24, 0x10 ; 16 - 22fc: 95 e2 ldi r25, 0x25 ; 37 - 22fe: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2302: 89 2b or r24, r25 - 2304: 09 f4 brne .+2 ; 0x2308 - 2306: 9a c0 rjmp .+308 ; 0x243c - 2308: 6b ec ldi r22, 0xCB ; 203 - 230a: 76 e0 ldi r23, 0x06 ; 6 - 230c: 80 e1 ldi r24, 0x10 ; 16 - 230e: 95 e2 ldi r25, 0x25 ; 37 - 2310: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2314: 89 2b or r24, r25 - 2316: 09 f4 brne .+2 ; 0x231a - 2318: 8e c0 rjmp .+284 ; 0x2436 - 231a: 61 ee ldi r22, 0xE1 ; 225 - 231c: 76 e0 ldi r23, 0x06 ; 6 - 231e: 80 e1 ldi r24, 0x10 ; 16 - 2320: 95 e2 ldi r25, 0x25 ; 37 - 2322: 0e 94 ee 23 call 0x47dc ; 0x47dc - 2326: 89 2b or r24, r25 - 2328: 09 f4 brne .+2 ; 0x232c - 232a: 52 c0 rjmp .+164 ; 0x23d0 - -static void DecodeCommand(void) -{ - uint8_t i; - bool CommandFound = false; - CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; - 232c: 88 ec ldi r24, 0xC8 ; 200 -} - -static void DecodeCommand(void) -{ - uint8_t i; - bool CommandFound = false; - 232e: c0 e0 ldi r28, 0x00 ; 0 -static const char* GetStatusMessageP(CommandStatusIdType StatusId) -{ - uint8_t i; - - for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { - if (pgm_read_byte(&StatusTable[i].Id) == StatusId) - 2330: e1 ed ldi r30, 0xD1 ; 209 - 2332: f4 e0 ldi r31, 0x04 ; 4 - 2334: e4 91 lpm r30, Z - 2336: 8e 17 cp r24, r30 - 2338: 09 f4 brne .+2 ; 0x233c - 233a: 30 c0 rjmp .+96 ; 0x239c - 233c: e2 ef ldi r30, 0xF2 ; 242 - 233e: f4 e0 ldi r31, 0x04 ; 4 - 2340: e4 91 lpm r30, Z - 2342: 8e 17 cp r24, r30 - 2344: 09 f4 brne .+2 ; 0x2348 - 2346: 41 c0 rjmp .+130 ; 0x23ca - 2348: e3 e1 ldi r30, 0x13 ; 19 - 234a: f5 e0 ldi r31, 0x05 ; 5 - 234c: e4 91 lpm r30, Z - 234e: 8e 17 cp r24, r30 - 2350: 09 f4 brne .+2 ; 0x2354 - 2352: 38 c0 rjmp .+112 ; 0x23c4 - 2354: e4 e3 ldi r30, 0x34 ; 52 - 2356: f5 e0 ldi r31, 0x05 ; 5 - 2358: e4 91 lpm r30, Z - 235a: 8e 17 cp r24, r30 - 235c: 81 f1 breq .+96 ; 0x23be - 235e: e5 e5 ldi r30, 0x55 ; 85 - 2360: f5 e0 ldi r31, 0x05 ; 5 - 2362: e4 91 lpm r30, Z - 2364: 8e 17 cp r24, r30 - 2366: 41 f1 breq .+80 ; 0x23b8 - 2368: e6 e7 ldi r30, 0x76 ; 118 - 236a: f5 e0 ldi r31, 0x05 ; 5 - 236c: e4 91 lpm r30, Z - 236e: 8e 17 cp r24, r30 - 2370: 01 f1 breq .+64 ; 0x23b2 - return StatusTable[i].Message; - } - - return (void*) 0; - 2372: 80 e0 ldi r24, 0x00 ; 0 - 2374: 90 e0 ldi r25, 0x00 ; 0 - } - } - } - - /* Send command status message */ - TerminalSendStringP(GetStatusMessageP(StatusId)); - 2376: c8 da rcall .-2672 ; 0x1908 - TerminalSendStringP(PSTR(STATUS_MESSAGE_TRAILER)); - 2378: 8e ec ldi r24, 0xCE ; 206 - 237a: 94 e0 ldi r25, 0x04 ; 4 - 237c: c5 da rcall .-2678 ; 0x1908 - - if (CommandFound && (pTerminalBuffer[0] != '\0') ) { - 237e: cc 23 and r28, r28 - 2380: 09 f4 brne .+2 ; 0x2384 - 2382: fe ce rjmp .-516 ; 0x2180 - 2384: 80 91 10 25 lds r24, 0x2510 - 2388: 88 23 and r24, r24 - 238a: 09 f4 brne .+2 ; 0x238e - 238c: f9 ce rjmp .-526 ; 0x2180 - /* Send optional answer */ - TerminalSendString(pTerminalBuffer); - 238e: 80 e1 ldi r24, 0x10 ; 16 - 2390: 95 e2 ldi r25, 0x25 ; 37 - 2392: b5 da rcall .-2710 ; 0x18fe - TerminalSendStringP(PSTR(OPTIONAL_ANSWER_TRAILER)); - 2394: 8b ec ldi r24, 0xCB ; 203 - 2396: 94 e0 ldi r25, 0x04 ; 4 - 2398: b7 da rcall .-2706 ; 0x1908 - 239a: f2 ce rjmp .-540 ; 0x2180 -static const char* GetStatusMessageP(CommandStatusIdType StatusId) -{ - uint8_t i; - - for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { - if (pgm_read_byte(&StatusTable[i].Id) == StatusId) - 239c: 20 e0 ldi r18, 0x00 ; 0 - 239e: 30 e0 ldi r19, 0x00 ; 0 - return StatusTable[i].Message; - 23a0: 41 e2 ldi r20, 0x21 ; 33 - 23a2: 42 9f mul r20, r18 - 23a4: c0 01 movw r24, r0 - 23a6: 43 9f mul r20, r19 - 23a8: 90 0d add r25, r0 - 23aa: 11 24 eor r1, r1 - 23ac: 8e 52 subi r24, 0x2E ; 46 - 23ae: 9b 4f sbci r25, 0xFB ; 251 - 23b0: e2 cf rjmp .-60 ; 0x2376 -static const char* GetStatusMessageP(CommandStatusIdType StatusId) -{ - uint8_t i; - - for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { - if (pgm_read_byte(&StatusTable[i].Id) == StatusId) - 23b2: 25 e0 ldi r18, 0x05 ; 5 - 23b4: 30 e0 ldi r19, 0x00 ; 0 - 23b6: f4 cf rjmp .-24 ; 0x23a0 - 23b8: 24 e0 ldi r18, 0x04 ; 4 - 23ba: 30 e0 ldi r19, 0x00 ; 0 - 23bc: f1 cf rjmp .-30 ; 0x23a0 - 23be: 23 e0 ldi r18, 0x03 ; 3 - 23c0: 30 e0 ldi r19, 0x00 ; 0 - 23c2: ee cf rjmp .-36 ; 0x23a0 - 23c4: 22 e0 ldi r18, 0x02 ; 2 - 23c6: 30 e0 ldi r19, 0x00 ; 0 - 23c8: eb cf rjmp .-42 ; 0x23a0 - 23ca: 21 e0 ldi r18, 0x01 ; 1 - 23cc: 30 e0 ldi r19, 0x00 ; 0 - 23ce: e8 cf rjmp .-48 ; 0x23a0 - CommandDelimiter = *pCommandDelimiter; - *pCommandDelimiter = '\0'; - - /* Search in command table */ - for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { - if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 23d0: 21 ee ldi r18, 0xE1 ; 225 - 23d2: 36 e0 ldi r19, 0x06 ; 6 - /* Command found. Clear buffer, and call appropriate function */ - char* pParam = ++pCommandDelimiter; - - pTerminalBuffer[0] = '\0'; - 23d4: 10 92 10 25 sts 0x2510, r1 -static CommandStatusIdType CallCommandFunc( - const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { - char* pTerminalBuffer = (char*) TerminalBuffer; - - /* Call appropriate function depending on CommandDelimiter */ - if (CommandDelimiter == CHAR_GET_MODE) { - 23d8: 1f 33 cpi r17, 0x3F ; 63 - 23da: 19 f1 breq .+70 ; 0x2422 - CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); - if (GetFunc != NO_FUNCTION) { - return GetFunc(pTerminalBuffer); - } - } else if (CommandDelimiter == CHAR_SET_MODE) { - 23dc: 1d 33 cpi r17, 0x3D ; 61 - 23de: 99 f0 breq .+38 ; 0x2406 - CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); - if (SetFunc != NO_FUNCTION) { - return SetFunc(pParam); - } - } else if (CommandDelimiter == CHAR_EXEC_MODE){ - 23e0: 11 23 and r17, r17 - 23e2: 19 f0 breq .+6 ; 0x23ea - } else { - /* This should not happen (TM) */ - } - - /* This delimiter has not been registered with this command */ - return COMMAND_ERR_INVALID_USAGE_ID; - 23e4: 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; - 23e6: c1 e0 ldi r28, 0x01 ; 1 - 23e8: a3 cf rjmp .-186 ; 0x2330 - CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); - if (SetFunc != NO_FUNCTION) { - return SetFunc(pParam); - } - } else if (CommandDelimiter == CHAR_EXEC_MODE){ - CommandExecFuncType ExecFunc = pgm_read_ptr(&CommandEntry->ExecFunc); - 23ea: 20 5f subi r18, 0xF0 ; 240 - 23ec: 3f 4f sbci r19, 0xFF ; 255 - 23ee: f9 01 movw r30, r18 - 23f0: 45 91 lpm r20, Z+ - 23f2: 54 91 lpm r21, Z - if (ExecFunc != NO_FUNCTION) { - 23f4: 41 15 cp r20, r1 - 23f6: 51 05 cpc r21, r1 - 23f8: a9 f3 breq .-22 ; 0x23e4 - return ExecFunc(pTerminalBuffer); - 23fa: 80 e1 ldi r24, 0x10 ; 16 - 23fc: 95 e2 ldi r25, 0x25 ; 37 - 23fe: fa 01 movw r30, r20 - 2400: 09 95 icall - if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - /* Command found. Clear buffer, and call appropriate function */ - char* pParam = ++pCommandDelimiter; - - pTerminalBuffer[0] = '\0'; - CommandFound = true; - 2402: c1 e0 ldi r28, 0x01 ; 1 - 2404: 95 cf rjmp .-214 ; 0x2330 - CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); - if (GetFunc != NO_FUNCTION) { - return GetFunc(pTerminalBuffer); - } - } else if (CommandDelimiter == CHAR_SET_MODE) { - CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); - 2406: 2e 5e subi r18, 0xEE ; 238 - 2408: 3f 4f sbci r19, 0xFF ; 255 - 240a: f9 01 movw r30, r18 - 240c: 45 91 lpm r20, Z+ - 240e: 54 91 lpm r21, Z - if (SetFunc != NO_FUNCTION) { - 2410: 41 15 cp r20, r1 - 2412: 51 05 cpc r21, r1 - 2414: 39 f3 breq .-50 ; 0x23e4 - return SetFunc(pParam); - 2416: ce 01 movw r24, r28 - 2418: 01 96 adiw r24, 0x01 ; 1 - 241a: fa 01 movw r30, r20 - 241c: 09 95 icall - if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - /* Command found. Clear buffer, and call appropriate function */ - char* pParam = ++pCommandDelimiter; - - pTerminalBuffer[0] = '\0'; - CommandFound = true; - 241e: c1 e0 ldi r28, 0x01 ; 1 - 2420: 87 cf rjmp .-242 ; 0x2330 - const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { - char* pTerminalBuffer = (char*) TerminalBuffer; - - /* Call appropriate function depending on CommandDelimiter */ - if (CommandDelimiter == CHAR_GET_MODE) { - CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); - 2422: 2c 5e subi r18, 0xEC ; 236 - 2424: 3f 4f sbci r19, 0xFF ; 255 - 2426: f9 01 movw r30, r18 - 2428: 45 91 lpm r20, Z+ - 242a: 54 91 lpm r21, Z - if (GetFunc != NO_FUNCTION) { - 242c: 41 15 cp r20, r1 - 242e: 51 05 cpc r21, r1 - 2430: 21 f7 brne .-56 ; 0x23fa - } else { - /* This should not happen (TM) */ - } - - /* This delimiter has not been registered with this command */ - return COMMAND_ERR_INVALID_USAGE_ID; - 2432: 89 ec ldi r24, 0xC9 ; 201 - 2434: d8 cf rjmp .-80 ; 0x23e6 - CommandDelimiter = *pCommandDelimiter; - *pCommandDelimiter = '\0'; - - /* Search in command table */ - for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { - if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { - 2436: 2b ec ldi r18, 0xCB ; 203 - 2438: 36 e0 ldi r19, 0x06 ; 6 - 243a: cc cf rjmp .-104 ; 0x23d4 - 243c: 25 eb ldi r18, 0xB5 ; 181 - 243e: 36 e0 ldi r19, 0x06 ; 6 - 2440: c9 cf rjmp .-110 ; 0x23d4 - 2442: 2f e9 ldi r18, 0x9F ; 159 - 2444: 36 e0 ldi r19, 0x06 ; 6 - 2446: c6 cf rjmp .-116 ; 0x23d4 - 2448: 29 e8 ldi r18, 0x89 ; 137 - 244a: 36 e0 ldi r19, 0x06 ; 6 - 244c: c3 cf rjmp .-122 ; 0x23d4 - 244e: 23 e7 ldi r18, 0x73 ; 115 - 2450: 36 e0 ldi r19, 0x06 ; 6 - 2452: c0 cf rjmp .-128 ; 0x23d4 - 2454: 2d e5 ldi r18, 0x5D ; 93 - 2456: 36 e0 ldi r19, 0x06 ; 6 - 2458: bd cf rjmp .-134 ; 0x23d4 - 245a: 27 e4 ldi r18, 0x47 ; 71 - 245c: 36 e0 ldi r19, 0x06 ; 6 - 245e: ba cf rjmp .-140 ; 0x23d4 - 2460: 21 e3 ldi r18, 0x31 ; 49 - 2462: 36 e0 ldi r19, 0x06 ; 6 - 2464: b7 cf rjmp .-146 ; 0x23d4 - 2466: 2b e1 ldi r18, 0x1B ; 27 - 2468: 36 e0 ldi r19, 0x06 ; 6 - 246a: b4 cf rjmp .-152 ; 0x23d4 - 246c: 25 e0 ldi r18, 0x05 ; 5 - 246e: 36 e0 ldi r19, 0x06 ; 6 - 2470: b1 cf rjmp .-158 ; 0x23d4 - 2472: 2f ee ldi r18, 0xEF ; 239 - 2474: 35 e0 ldi r19, 0x05 ; 5 - 2476: ae cf rjmp .-164 ; 0x23d4 - 2478: 29 ed ldi r18, 0xD9 ; 217 - 247a: 35 e0 ldi r19, 0x05 ; 5 - 247c: ab cf rjmp .-170 ; 0x23d4 - 247e: 23 ec ldi r18, 0xC3 ; 195 - 2480: 35 e0 ldi r19, 0x05 ; 5 - 2482: a8 cf rjmp .-176 ; 0x23d4 - 2484: 2d ea ldi r18, 0xAD ; 173 - 2486: 35 e0 ldi r19, 0x05 ; 5 - 2488: a5 cf rjmp .-182 ; 0x23d4 - 248a: 27 e9 ldi r18, 0x97 ; 151 - 248c: 35 e0 ldi r19, 0x05 ; 5 - 248e: a2 cf rjmp .-188 ; 0x23d4 - -00002490 : - - return true; -} - -void CommandLineTick(void) -{ - 2490: 08 95 ret - -00002492 : -INLINE void CodecTask(void) { - ActiveConfiguration.CodecTaskFunc(); -} - -INLINE void CodecSetDemodPower(bool bOnOff) { - CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; - 2492: a0 e2 ldi r26, 0x20 ; 32 - 2494: b6 e0 ldi r27, 0x06 ; 6 - 2496: 82 e0 ldi r24, 0x02 ; 2 - 2498: 11 96 adiw r26, 0x01 ; 1 - 249a: 8c 93 st X, r24 - 249c: 11 97 sbiw r26, 0x01 ; 1 - - if (bOnOff) { - CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; - 249e: 15 96 adiw r26, 0x05 ; 5 - 24a0: 8c 93 st X, r24 - 24a2: 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; - 24a4: e0 e4 ldi r30, 0x40 ; 64 - 24a6: f8 e0 ldi r31, 0x08 ; 8 - 24a8: 10 a2 std Z+32, r1 ; 0x20 - 24aa: 11 a2 std Z+33, r1 ; 0x21 - CODEC_TIMER_SAMPLING.PER = SAMPLE_RATE_SYSTEM_CYCLES - 1; - 24ac: 8d e2 ldi r24, 0x2D ; 45 - 24ae: 91 e0 ldi r25, 0x01 ; 1 - 24b0: 86 a3 std Z+38, r24 ; 0x26 - 24b2: 97 a3 std Z+39, r25 ; 0x27 - CODEC_TIMER_SAMPLING.CCA = 0xFFFF; /* CCA Interrupt is not active! */ - 24b4: 8f ef ldi r24, 0xFF ; 255 - 24b6: 9f ef ldi r25, 0xFF ; 255 - 24b8: 80 a7 std Z+40, r24 ; 0x28 - 24ba: 91 a7 std Z+41, r25 ; 0x29 - CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_DIV1_gc; - 24bc: 81 e0 ldi r24, 0x01 ; 1 - 24be: 80 83 st Z, r24 - CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; - 24c0: 98 e8 ldi r25, 0x88 ; 136 - 24c2: 93 83 std Z+3, r25 ; 0x03 - CODEC_TIMER_SAMPLING.INTCTRLB = TC_CCAINTLVL_HI_gc; - 24c4: 93 e0 ldi r25, 0x03 ; 3 - 24c6: 97 83 std Z+7, r25 ; 0x07 - - /* Start looking out for modulation pause via interrupt. */ - CODEC_DEMOD_IN_PORT.INT0MASK = CODEC_DEMOD_IN_MASK0; - 24c8: 1a 96 adiw r26, 0x0a ; 10 - 24ca: 8c 93 st X, r24 - 24cc: 08 95 ret - -000024ce <__vector_34>: -} - -ISR(CODEC_DEMOD_IN_INT0_VECT) { - 24ce: 1f 92 push r1 - 24d0: 0f 92 push r0 - 24d2: 0f b6 in r0, 0x3f ; 63 - 24d4: 0f 92 push r0 - 24d6: 11 24 eor r1, r1 - 24d8: 8f 93 push r24 - 24da: 9f 93 push r25 - 24dc: ef 93 push r30 - 24de: 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; - 24e0: 80 e1 ldi r24, 0x10 ; 16 - 24e2: 96 e2 ldi r25, 0x26 ; 38 - 24e4: 80 93 b1 24 sts 0x24B1, r24 - 24e8: 90 93 b2 24 sts 0x24B2, r25 - ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - 24ec: 80 e9 ldi r24, 0x90 ; 144 - 24ee: 96 e2 ldi r25, 0x26 ; 38 - 24f0: 80 93 af 24 sts 0x24AF, r24 - 24f4: 90 93 b0 24 sts 0x24B0, r25 - DataRegister = 0; - 24f8: 10 92 aa 24 sts 0x24AA, r1 - SampleRegister = 0; - 24fc: 10 92 a9 24 sts 0x24A9, r1 - SamplePosition = 0; - 2500: 10 92 a5 24 sts 0x24A5, r1 - BitCount = 0; - 2504: 10 92 ad 24 sts 0x24AD, r1 - 2508: 10 92 ae 24 sts 0x24AE, r1 - IsParityBit = false; - 250c: 10 92 a8 24 sts 0x24A8, r1 - * XYZBUF mechanism of the xmega to automatically double the sampling rate on the - * next overflow. For this we have to temporarily deactivate the automatical alignment - * in order to catch next overflow event for updating the BUF registers. - * We want to sample the demodulated data stream in the first quarter of the half-bit - * where the pulsed miller encoded is located. */ - CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_OFF_gc; - 2510: e0 e4 ldi r30, 0x40 ; 64 - 2512: f8 e0 ldi r31, 0x08 ; 8 - 2514: 13 82 std Z+3, r1 ; 0x03 - CODEC_TIMER_SAMPLING.PERBUF = SAMPLE_RATE_SYSTEM_CYCLES/2 - 1; /* Half bit width */ - 2516: 86 e9 ldi r24, 0x96 ; 150 - 2518: 90 e0 ldi r25, 0x00 ; 0 - 251a: 86 ab std Z+54, r24 ; 0x36 - 251c: 97 ab std Z+55, r25 ; 0x37 - CODEC_TIMER_SAMPLING.CCABUF = SAMPLE_RATE_SYSTEM_CYCLES/8 - 10 - 1; /* Compensate for DIGFILT and ISR prolog */ - 251e: 8a e1 ldi r24, 0x1A ; 26 - 2520: 90 e0 ldi r25, 0x00 ; 0 - 2522: 80 af std Z+56, r24 ; 0x38 - 2524: 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; - 2526: e0 e4 ldi r30, 0x40 ; 64 - 2528: f9 e0 ldi r31, 0x09 ; 9 - 252a: 10 a2 std Z+32, r1 ; 0x20 - 252c: 11 a2 std Z+33, r1 ; 0x21 - CODEC_TIMER_LOADMOD.PER = 0xFFFF; - 252e: 8f ef ldi r24, 0xFF ; 255 - 2530: 9f ef ldi r25, 0xFF ; 255 - 2532: 86 a3 std Z+38, r24 ; 0x26 - 2534: 97 a3 std Z+39, r25 ; 0x27 - CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH1_gc; - 2536: 89 e8 ldi r24, 0x89 ; 137 - 2538: 83 83 std Z+3, r24 ; 0x03 - CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_EVCH6_gc; - 253a: 8e e0 ldi r24, 0x0E ; 14 - 253c: 80 83 st Z, r24 - - /* Disable this interrupt */ - CODEC_DEMOD_IN_PORT.INT0MASK = 0; - 253e: e0 e2 ldi r30, 0x20 ; 32 - 2540: f6 e0 ldi r31, 0x06 ; 6 - 2542: 12 86 std Z+10, r1 ; 0x0a -} - 2544: ff 91 pop r31 - 2546: ef 91 pop r30 - 2548: 9f 91 pop r25 - 254a: 8f 91 pop r24 - 254c: 0f 90 pop r0 - 254e: 0f be out 0x3f, r0 ; 63 - 2550: 0f 90 pop r0 - 2552: 1f 90 pop r1 - 2554: 18 95 reti - -00002556 <__vector_22>: - -ISR(CODEC_TIMER_SAMPLING_CCA_VECT) { - 2556: 1f 92 push r1 - 2558: 0f 92 push r0 - 255a: 0f b6 in r0, 0x3f ; 63 - 255c: 0f 92 push r0 - 255e: 11 24 eor r1, r1 - 2560: 2f 93 push r18 - 2562: 3f 93 push r19 - 2564: 4f 93 push r20 - 2566: 8f 93 push r24 - 2568: 9f 93 push r25 - 256a: ef 93 push r30 - 256c: 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; - 256e: 90 91 28 06 lds r25, 0x0628 - uint8_t NewSampleRegister; - - /* Shift sampled bit into sampling register and hold a local copy for fast access. */ - NewSampleRegister = SampleRegister << 1; - 2572: 80 91 a9 24 lds r24, 0x24A9 - CODEC_DEMOD_IN_PORT.INT0MASK = 0; -} - -ISR(CODEC_TIMER_SAMPLING_CCA_VECT) { - /* This interrupt gets called twice for every bit to sample it. */ - uint8_t SamplePin = CODEC_DEMOD_IN_PORT.IN & CODEC_DEMOD_IN_MASK; - 2576: 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); - 2578: 21 e0 ldi r18, 0x01 ; 1 - 257a: 09 f0 breq .+2 ; 0x257e <__vector_22+0x28> - 257c: 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; - 257e: 88 0f add r24, r24 - NewSampleRegister |= (!SamplePin ? 0x01 : 0x00); - 2580: 82 2b or r24, r18 - SampleRegister = NewSampleRegister; - 2582: 80 93 a9 24 sts 0x24A9, r24 - - if (SamplePosition) { - 2586: 90 91 a5 24 lds r25, 0x24A5 - 258a: 99 23 and r25, r25 - 258c: c1 f1 breq .+112 ; 0x25fe <__vector_22+0xa8> - /* Analyze the sampling register after 2 samples. */ - if ((NewSampleRegister & 0x07) == 0x07) { - 258e: 98 2f mov r25, r24 - 2590: 97 70 andi r25, 0x07 ; 7 - 2592: 97 30 cpi r25, 0x07 ; 7 - 2594: 09 f4 brne .+2 ; 0x2598 <__vector_22+0x42> - 2596: 48 c0 rjmp .+144 ; 0x2628 <__vector_22+0xd2> - - /* Signal, that we have finished sampling */ - Flags.DemodFinished = 1; - } else { - /* Otherwise, we check the two sample bits from the bit before. */ - uint8_t BitSample = NewSampleRegister & 0xC; - 2598: 98 2f mov r25, r24 - 259a: 9c 70 andi r25, 0x0C ; 12 - uint8_t Bit = 0; - - if (BitSample != (0x0 << 2)) { - 259c: 81 f1 breq .+96 ; 0x25fe <__vector_22+0xa8> - /* We have a valid bit. decode and process it. */ - if (BitSample & (0x1 << 2)) { - 259e: 82 fb bst r24, 2 - 25a0: 88 27 eor r24, r24 - 25a2: 80 f9 bld r24, 0 - 25a4: 91 e0 ldi r25, 0x01 ; 1 - 25a6: 89 27 eor r24, r25 - } else { - /* 10 sequence -> This is a one bit */ - Bit = 1; - } - - LastBit = Bit; - 25a8: 80 93 a7 24 sts 0x24A7, r24 - - if (!IsParityBit) { - 25ac: 90 91 a8 24 lds r25, 0x24A8 - 25b0: 91 11 cpse r25, r1 - 25b2: 7f c0 rjmp .+254 ; 0x26b2 <__vector_22+0x15c> - /* This is a data bit, so shift it into the data register and - * hold a local copy of it. */ - uint8_t NewDataRegister = DataRegister >> 1; - 25b4: 90 91 aa 24 lds r25, 0x24AA - 25b8: 96 95 lsr r25 - NewDataRegister |= (Bit ? 0x80 : 0x00); - 25ba: 88 23 and r24, r24 - 25bc: 09 f4 brne .+2 ; 0x25c0 <__vector_22+0x6a> - 25be: 83 c0 rjmp .+262 ; 0x26c6 <__vector_22+0x170> - 25c0: 20 e8 ldi r18, 0x80 ; 128 - 25c2: 29 2b or r18, r25 - DataRegister = NewDataRegister; - 25c4: 20 93 aa 24 sts 0x24AA, r18 - - /* Update bitcount */ - uint16_t NewBitCount = ++BitCount; - 25c8: 80 91 ad 24 lds r24, 0x24AD - 25cc: 90 91 ae 24 lds r25, 0x24AE - 25d0: 01 96 adiw r24, 0x01 ; 1 - 25d2: 80 93 ad 24 sts 0x24AD, r24 - 25d6: 90 93 ae 24 sts 0x24AE, r25 - if ((NewBitCount & 0x07) == 0) { - 25da: 87 70 andi r24, 0x07 ; 7 - 25dc: 99 27 eor r25, r25 - 25de: 89 2b or r24, r25 - 25e0: 71 f4 brne .+28 ; 0x25fe <__vector_22+0xa8> - /* We have reached a byte boundary! Store the data register. */ - /* TODO: Prevent buffer overflow */ - *CodecBufferPtr++ = NewDataRegister; - 25e2: e0 91 b1 24 lds r30, 0x24B1 - 25e6: f0 91 b2 24 lds r31, 0x24B2 - 25ea: cf 01 movw r24, r30 - 25ec: 01 96 adiw r24, 0x01 ; 1 - 25ee: 80 93 b1 24 sts 0x24B1, r24 - 25f2: 90 93 b2 24 sts 0x24B2, r25 - 25f6: 20 83 st Z, r18 - - /* Store bit for determining FDT at EOC and enable parity - * handling on next bit. */ - IsParityBit = true; - 25f8: 81 e0 ldi r24, 0x01 ; 1 - 25fa: 80 93 a8 24 sts 0x24A8, r24 - } - } else { - /* On odd sample position just sample. */ - } - - SamplePosition = !SamplePosition; - 25fe: 80 91 a5 24 lds r24, 0x24A5 - 2602: 91 e0 ldi r25, 0x01 ; 1 - 2604: 89 27 eor r24, r25 - 2606: 80 93 a5 24 sts 0x24A5, r24 - - /* Make sure the sampling timer gets automatically aligned to the - * modulation pauses by using the RESTART event. - * This can be understood as a "poor mans PLL" and makes sure that we are - * never too far out the bit-grid while sampling. */ - CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; - 260a: 88 e8 ldi r24, 0x88 ; 136 - 260c: 80 93 43 08 sts 0x0843, r24 -} - 2610: ff 91 pop r31 - 2612: ef 91 pop r30 - 2614: 9f 91 pop r25 - 2616: 8f 91 pop r24 - 2618: 4f 91 pop r20 - 261a: 3f 91 pop r19 - 261c: 2f 91 pop r18 - 261e: 0f 90 pop r0 - 2620: 0f be out 0x3f, r0 ; 63 - 2622: 0f 90 pop r0 - 2624: 1f 90 pop r1 - 2626: 18 95 reti - - if (SamplePosition) { - /* Analyze the sampling register after 2 samples. */ - if ((NewSampleRegister & 0x07) == 0x07) { - /* No carrier modulation for 3 sample points. EOC! */ - CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_OFF_gc; - 2628: 10 92 40 08 sts 0x0840, r1 - CODEC_TIMER_SAMPLING.INTFLAGS = TC0_CCAIF_bm; - 262c: 80 e1 ldi r24, 0x10 ; 16 - 262e: 80 93 4c 08 sts 0x084C, r24 - - /* By this time, the FDT timer is aligned to the last modulation - * edge of the reader. So we disable the auto-synchronization and - * let it count the frame delay time in the background, and generate - * an interrupt once it has reached the FDT. */ - CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_OFF_gc; - 2632: 10 92 43 09 sts 0x0943, r1 - - if (LastBit) { - 2636: 80 91 a7 24 lds r24, 0x24A7 - 263a: 88 23 and r24, r24 - 263c: e9 f1 breq .+122 ; 0x26b8 <__vector_22+0x162> - CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; - 263e: 8c eb ldi r24, 0xBC ; 188 - 2640: 94 e0 ldi r25, 0x04 ; 4 - 2642: 80 93 66 09 sts 0x0966, r24 - 2646: 90 93 67 09 sts 0x0967, r25 - } else { - CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; - } - - LoadModState = LOADMOD_FDT; - 264a: 10 92 a6 24 sts 0x24A6, r1 - - CODEC_TIMER_LOADMOD.INTFLAGS = TC1_OVFIF_bm; - 264e: 81 e0 ldi r24, 0x01 ; 1 - 2650: 80 93 4c 09 sts 0x094C, r24 - CODEC_TIMER_LOADMOD.INTCTRLA = TC_OVFINTLVL_HI_gc; - 2654: 83 e0 ldi r24, 0x03 ; 3 - 2656: 80 93 46 09 sts 0x0946, r24 - - /* Determine if we did not receive a multiple of 8 bits. - * If this is the case, right-align the remaining data and - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - 265a: 80 91 ad 24 lds r24, 0x24AD - 265e: 90 91 ae 24 lds r25, 0x24AE - 2662: 87 70 andi r24, 0x07 ; 7 - if (RemainingBits != 0) { - 2664: 11 f1 breq .+68 ; 0x26aa <__vector_22+0x154> - uint8_t NewDataRegister = DataRegister; - 2666: 90 91 aa 24 lds r25, 0x24AA - - while (RemainingBits++ < 8) { - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 266a: 96 95 lsr r25 - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - if (RemainingBits != 0) { - uint8_t NewDataRegister = DataRegister; - - while (RemainingBits++ < 8) { - 266c: 22 e0 ldi r18, 0x02 ; 2 - 266e: 28 0f add r18, r24 - 2670: 87 30 cpi r24, 0x07 ; 7 - 2672: b1 f0 breq .+44 ; 0x26a0 <__vector_22+0x14a> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 2674: 96 95 lsr r25 - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - if (RemainingBits != 0) { - uint8_t NewDataRegister = DataRegister; - - while (RemainingBits++ < 8) { - 2676: 43 e0 ldi r20, 0x03 ; 3 - 2678: 48 0f add r20, r24 - 267a: 28 30 cpi r18, 0x08 ; 8 - 267c: 88 f4 brcc .+34 ; 0x26a0 <__vector_22+0x14a> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 267e: 96 95 lsr r25 - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - if (RemainingBits != 0) { - uint8_t NewDataRegister = DataRegister; - - while (RemainingBits++ < 8) { - 2680: 34 e0 ldi r19, 0x04 ; 4 - 2682: 38 0f add r19, r24 - 2684: 48 30 cpi r20, 0x08 ; 8 - 2686: 60 f4 brcc .+24 ; 0x26a0 <__vector_22+0x14a> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 2688: 96 95 lsr r25 - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - if (RemainingBits != 0) { - uint8_t NewDataRegister = DataRegister; - - while (RemainingBits++ < 8) { - 268a: 25 e0 ldi r18, 0x05 ; 5 - 268c: 28 0f add r18, r24 - 268e: 38 30 cpi r19, 0x08 ; 8 - 2690: 38 f4 brcc .+14 ; 0x26a0 <__vector_22+0x14a> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 2692: 96 95 lsr r25 - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - if (RemainingBits != 0) { - uint8_t NewDataRegister = DataRegister; - - while (RemainingBits++ < 8) { - 2694: 28 30 cpi r18, 0x08 ; 8 - 2696: 20 f4 brcc .+8 ; 0x26a0 <__vector_22+0x14a> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 2698: 96 95 lsr r25 - * store it into the buffer. */ - uint8_t RemainingBits = BitCount % 8; - if (RemainingBits != 0) { - uint8_t NewDataRegister = DataRegister; - - while (RemainingBits++ < 8) { - 269a: 81 30 cpi r24, 0x01 ; 1 - 269c: 09 f4 brne .+2 ; 0x26a0 <__vector_22+0x14a> - /* Pad with zeroes to right-align. */ - NewDataRegister >>= 1; - 269e: 96 95 lsr r25 - } - - /* TODO: Prevent buffer overflow */ - *CodecBufferPtr = NewDataRegister; - 26a0: e0 91 b1 24 lds r30, 0x24B1 - 26a4: f0 91 b2 24 lds r31, 0x24B2 - 26a8: 90 83 st Z, r25 - } - - /* Signal, that we have finished sampling */ - Flags.DemodFinished = 1; - 26aa: 81 e0 ldi r24, 0x01 ; 1 - 26ac: 80 93 b3 24 sts 0x24B3, r24 - 26b0: a6 cf rjmp .-180 ; 0x25fe <__vector_22+0xa8> - - } else { - /* This is a parity bit. Store it */ - /* TODO: Store parity and prevent overflow */ - //*ParityBufferPtr++ = Bit; - IsParityBit = false; - 26b2: 10 92 a8 24 sts 0x24A8, r1 - 26b6: a3 cf rjmp .-186 ; 0x25fe <__vector_22+0xa8> - CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_OFF_gc; - - if (LastBit) { - CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; - } else { - CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; - 26b8: 8c e7 ldi r24, 0x7C ; 124 - 26ba: 94 e0 ldi r25, 0x04 ; 4 - 26bc: 80 93 66 09 sts 0x0966, r24 - 26c0: 90 93 67 09 sts 0x0967, r25 - 26c4: c2 cf rjmp .-124 ; 0x264a <__vector_22+0xf4> - - if (!IsParityBit) { - /* This is a data bit, so shift it into the data register and - * hold a local copy of it. */ - uint8_t NewDataRegister = DataRegister >> 1; - NewDataRegister |= (Bit ? 0x80 : 0x00); - 26c6: 20 e0 ldi r18, 0x00 ; 0 - 26c8: 7c cf rjmp .-264 ; 0x25c2 <__vector_22+0x6c> - -000026ca <__vector_83>: - * This can be understood as a "poor mans PLL" and makes sure that we are - * never too far out the bit-grid while sampling. */ - CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; -} - -ISR(CODEC_TIMER_OVF_VECT) { - 26ca: 1f 92 push r1 - 26cc: 0f 92 push r0 - 26ce: 0f b6 in r0, 0x3f ; 63 - 26d0: 0f 92 push r0 - 26d2: 11 24 eor r1, r1 - 26d4: 2f 93 push r18 - 26d6: 3f 93 push r19 - 26d8: 8f 93 push r24 - 26da: 9f 93 push r25 - 26dc: af 93 push r26 - 26de: bf 93 push r27 - 26e0: ef 93 push r30 - 26e2: ff 93 push r31 - /* Bit rate timer. Output a half bit on the output. */ - uint8_t Temp8; - uint16_t Temp16; - - switch (LoadModState) { - 26e4: 80 91 a6 24 lds r24, 0x24A6 - 26e8: 90 e0 ldi r25, 0x00 ; 0 - 26ea: 8b 30 cpi r24, 0x0B ; 11 - 26ec: 91 05 cpc r25, r1 - 26ee: 80 f5 brcc .+96 ; 0x2750 <__vector_83+0x86> - 26f0: fc 01 movw r30, r24 - 26f2: e9 5f subi r30, 0xF9 ; 249 - 26f4: fe 4f sbci r31, 0xFE ; 254 - 26f6: 0c 94 69 23 jmp 0x46d2 ; 0x46d2 <__tablejump2__> - - LoadModState = LOADMOD_PARITY1; - break; - - case LOADMOD_PARITY1: - if (*ParityBufferPtr) { - 26fa: e0 91 af 24 lds r30, 0x24AF - 26fe: f0 91 b0 24 lds r31, 0x24B0 - 2702: 80 81 ld r24, Z - 2704: 81 11 cpse r24, r1 - 2706: ac c0 rjmp .+344 ; 0x2860 <__vector_83+0x196> - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - } else { - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2708: 80 e4 ldi r24, 0x40 ; 64 - 270a: 80 93 45 06 sts 0x0645, r24 - } - - if (BitSent == BitCount) { - 270e: 20 91 ab 24 lds r18, 0x24AB - 2712: 30 91 ac 24 lds r19, 0x24AC - 2716: 80 91 ad 24 lds r24, 0x24AD - 271a: 90 91 ae 24 lds r25, 0x24AE - 271e: 28 17 cp r18, r24 - 2720: 39 07 cpc r19, r25 - 2722: 09 f4 brne .+2 ; 0x2726 <__vector_83+0x5c> - 2724: 6c c0 rjmp .+216 ; 0x27fe <__vector_83+0x134> - /* No data left */ - LoadModState = LOADMOD_STOP_BIT0; - } else { - /* Fetch next data and continue sending bits. */ - ParityBufferPtr++; - 2726: 31 96 adiw r30, 0x01 ; 1 - 2728: e0 93 af 24 sts 0x24AF, r30 - 272c: f0 93 b0 24 sts 0x24B0, r31 - DataRegister = *++CodecBufferPtr; - 2730: e0 91 b1 24 lds r30, 0x24B1 - 2734: f0 91 b2 24 lds r31, 0x24B2 - 2738: cf 01 movw r24, r30 - 273a: 01 96 adiw r24, 0x01 ; 1 - 273c: 80 93 b1 24 sts 0x24B1, r24 - 2740: 90 93 b2 24 sts 0x24B2, r25 - 2744: 81 81 ldd r24, Z+1 ; 0x01 - 2746: 80 93 aa 24 sts 0x24AA, r24 - LoadModState = LOADMOD_DATA0; - 274a: 84 e0 ldi r24, 0x04 ; 4 - 274c: 80 93 a6 24 sts 0x24A6, r24 - break; - - default: - break; - } -} - 2750: ff 91 pop r31 - 2752: ef 91 pop r30 - 2754: bf 91 pop r27 - 2756: af 91 pop r26 - 2758: 9f 91 pop r25 - 275a: 8f 91 pop r24 - 275c: 3f 91 pop r19 - 275e: 2f 91 pop r18 - 2760: 0f 90 pop r0 - 2762: 0f be out 0x3f, r0 ; 63 - 2764: 0f 90 pop r0 - 2766: 1f 90 pop r1 - 2768: 18 95 reti - 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; - 276a: 8f e3 ldi r24, 0x3F ; 63 - 276c: 90 e0 ldi r25, 0x00 ; 0 - 276e: 80 93 66 09 sts 0x0966, r24 - 2772: 90 93 67 09 sts 0x0967, r25 - CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_EVCH6_gc; - 2776: 8e e0 ldi r24, 0x0E ; 14 - 2778: 80 93 00 08 sts 0x0800, r24 - - /* Fallthrough to first bit */ - - case LOADMOD_START_BIT0: - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 277c: 80 e4 ldi r24, 0x40 ; 64 - 277e: 80 93 45 06 sts 0x0645, r24 - LoadModState = LOADMOD_START_BIT1; - 2782: 83 e0 ldi r24, 0x03 ; 3 - 2784: 80 93 a6 24 sts 0x24A6, r24 - break; - 2788: e3 cf rjmp .-58 ; 0x2750 <__vector_83+0x86> - - case LOADMOD_START_BIT1: - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 278a: 80 e4 ldi r24, 0x40 ; 64 - 278c: 80 93 46 06 sts 0x0646, r24 - LoadModState = LOADMOD_DATA0; - 2790: 84 e0 ldi r24, 0x04 ; 4 - 2792: 80 93 a6 24 sts 0x24A6, r24 - - /* Fetch first byte */ - DataRegister = *CodecBufferPtr; - 2796: e0 91 b1 24 lds r30, 0x24B1 - 279a: f0 91 b2 24 lds r31, 0x24B2 - 279e: 80 81 ld r24, Z - 27a0: 80 93 aa 24 sts 0x24AA, r24 - break; - 27a4: d5 cf rjmp .-86 ; 0x2750 <__vector_83+0x86> - - case LOADMOD_DATA0: - if (DataRegister & 1) { - 27a6: 80 91 aa 24 lds r24, 0x24AA - 27aa: 80 fd sbrc r24, 0 - 27ac: 64 c0 rjmp .+200 ; 0x2876 <__vector_83+0x1ac> - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - } else { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 27ae: 80 e4 ldi r24, 0x40 ; 64 - 27b0: 80 93 46 06 sts 0x0646, r24 - } - - LoadModState = LOADMOD_DATA1; - 27b4: 85 e0 ldi r24, 0x05 ; 5 - 27b6: 80 93 a6 24 sts 0x24A6, r24 - break; - 27ba: ca cf rjmp .-108 ; 0x2750 <__vector_83+0x86> - - case LOADMOD_DATA1: - Temp8 = DataRegister; - 27bc: 80 91 aa 24 lds r24, 0x24AA - - if (Temp8 & 1) { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 27c0: 90 e4 ldi r25, 0x40 ; 64 - break; - - case LOADMOD_DATA1: - Temp8 = DataRegister; - - if (Temp8 & 1) { - 27c2: 80 fd sbrc r24, 0 - 27c4: 55 c0 rjmp .+170 ; 0x2870 <__vector_83+0x1a6> - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - } else { - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 27c6: 90 93 45 06 sts 0x0645, r25 - } - - DataRegister = Temp8 >> 1; - 27ca: 86 95 lsr r24 - 27cc: 80 93 aa 24 sts 0x24AA, r24 - - Temp16 = BitSent; - 27d0: 80 91 ab 24 lds r24, 0x24AB - 27d4: 90 91 ac 24 lds r25, 0x24AC - BitSent = ++Temp16; - 27d8: 01 96 adiw r24, 0x01 ; 1 - 27da: 80 93 ab 24 sts 0x24AB, r24 - 27de: 90 93 ac 24 sts 0x24AC, r25 - - if ((Temp16 & 0x07) == 0) { - 27e2: 9c 01 movw r18, r24 - 27e4: 27 70 andi r18, 0x07 ; 7 - 27e6: 33 27 eor r19, r19 - 27e8: 23 2b or r18, r19 - 27ea: 09 f4 brne .+2 ; 0x27ee <__vector_83+0x124> - 27ec: 48 c0 rjmp .+144 ; 0x287e <__vector_83+0x1b4> - /* Byte boundary. Load parity bit and output it later. */ - LoadModState = LOADMOD_PARITY0; - break; - } - - if (Temp16 == BitCount) { - 27ee: 20 91 ad 24 lds r18, 0x24AD - 27f2: 30 91 ae 24 lds r19, 0x24AE - 27f6: 82 17 cp r24, r18 - 27f8: 93 07 cpc r25, r19 - 27fa: 09 f0 breq .+2 ; 0x27fe <__vector_83+0x134> - 27fc: a6 cf rjmp .-180 ; 0x274a <__vector_83+0x80> - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - } - - if (BitSent == BitCount) { - /* No data left */ - LoadModState = LOADMOD_STOP_BIT0; - 27fe: 88 e0 ldi r24, 0x08 ; 8 - 2800: 80 93 a6 24 sts 0x24A6, r24 - 2804: a5 cf rjmp .-182 ; 0x2750 <__vector_83+0x86> - LoadModState = LOADMOD_DATA0; - - break; - - case LOADMOD_PARITY0: - if (*ParityBufferPtr) { - 2806: e0 91 af 24 lds r30, 0x24AF - 280a: f0 91 b0 24 lds r31, 0x24B0 - 280e: 80 81 ld r24, Z - 2810: 81 11 cpse r24, r1 - 2812: 2a c0 rjmp .+84 ; 0x2868 <__vector_83+0x19e> - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - } else { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2814: 80 e4 ldi r24, 0x40 ; 64 - 2816: 80 93 46 06 sts 0x0646, r24 - } - - LoadModState = LOADMOD_PARITY1; - 281a: 87 e0 ldi r24, 0x07 ; 7 - 281c: 80 93 a6 24 sts 0x24A6, r24 - break; - 2820: 97 cf rjmp .-210 ; 0x2750 <__vector_83+0x86> - } - - break; - - case LOADMOD_STOP_BIT0: - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2822: 80 e4 ldi r24, 0x40 ; 64 - 2824: 80 93 46 06 sts 0x0646, r24 - LoadModState = LOADMOD_STOP_BIT1; - 2828: 89 e0 ldi r24, 0x09 ; 9 - 282a: 80 93 a6 24 sts 0x24A6, r24 - break; - 282e: 90 cf rjmp .-224 ; 0x2750 <__vector_83+0x86> - - case LOADMOD_STOP_BIT1: - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2830: 80 e4 ldi r24, 0x40 ; 64 - 2832: 80 93 46 06 sts 0x0646, r24 - LoadModState = LOADMOD_FINISHED; - 2836: 8a e0 ldi r24, 0x0A ; 10 - 2838: 80 93 a6 24 sts 0x24A6, r24 - break; - 283c: 89 cf rjmp .-238 ; 0x2750 <__vector_83+0x86> - - 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; - 283e: 10 92 40 09 sts 0x0940, r1 - CODEC_TIMER_LOADMOD.INTCTRLA = 0; - 2842: 10 92 46 09 sts 0x0946, r1 - CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_OFF_gc; - 2846: 10 92 00 08 sts 0x0800, r1 - - /* Signal application that we have finished loadmod */ - Flags.LoadmodFinished = 1; - 284a: 81 e0 ldi r24, 0x01 ; 1 - 284c: 80 93 b4 24 sts 0x24B4, r24 - break; - 2850: 7f cf rjmp .-258 ; 0x2750 <__vector_83+0x86> - 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; - 2852: 8f e7 ldi r24, 0x7F ; 127 - 2854: 90 e0 ldi r25, 0x00 ; 0 - 2856: 80 93 66 09 sts 0x0966, r24 - 285a: 90 93 67 09 sts 0x0967, r25 - break; - 285e: 78 cf rjmp .-272 ; 0x2750 <__vector_83+0x86> - LoadModState = LOADMOD_PARITY1; - break; - - case LOADMOD_PARITY1: - if (*ParityBufferPtr) { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2860: 80 e4 ldi r24, 0x40 ; 64 - 2862: 80 93 46 06 sts 0x0646, r24 - 2866: 53 cf rjmp .-346 ; 0x270e <__vector_83+0x44> - - break; - - case LOADMOD_PARITY0: - if (*ParityBufferPtr) { - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2868: 80 e4 ldi r24, 0x40 ; 64 - 286a: 80 93 45 06 sts 0x0645, r24 - 286e: d5 cf rjmp .-86 ; 0x281a <__vector_83+0x150> - - case LOADMOD_DATA1: - Temp8 = DataRegister; - - if (Temp8 & 1) { - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 2870: 90 93 46 06 sts 0x0646, r25 - 2874: aa cf rjmp .-172 ; 0x27ca <__vector_83+0x100> - DataRegister = *CodecBufferPtr; - break; - - case LOADMOD_DATA0: - if (DataRegister & 1) { - CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; - 2876: 80 e4 ldi r24, 0x40 ; 64 - 2878: 80 93 45 06 sts 0x0645, r24 - 287c: 9b cf rjmp .-202 ; 0x27b4 <__vector_83+0xea> - Temp16 = BitSent; - BitSent = ++Temp16; - - if ((Temp16 & 0x07) == 0) { - /* Byte boundary. Load parity bit and output it later. */ - LoadModState = LOADMOD_PARITY0; - 287e: 86 e0 ldi r24, 0x06 ; 6 - 2880: 80 93 a6 24 sts 0x24A6, r24 - break; - 2884: 65 cf rjmp .-310 ; 0x2750 <__vector_83+0x86> - -00002886 : - default: - break; - } -} - -void ISO14443ACodecInit(void) { - 2886: cf 93 push r28 - 2888: 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; - 288a: e0 e4 ldi r30, 0x40 ; 64 - 288c: f6 e0 ldi r31, 0x06 ; 6 - 288e: 84 e0 ldi r24, 0x04 ; 4 - 2890: 82 83 std Z+2, r24 ; 0x02 - CODEC_CARRIER_IN_PORT.CODEC_CARRIER_IN_PINCTRL = PORT_ISC_BOTHEDGES_gc; - 2892: 12 8a std Z+18, r1 ; 0x12 - EVSYS.CH6MUX = CODEC_CARRIER_IN_EVMUX; - 2894: c0 e8 ldi r28, 0x80 ; 128 - 2896: d1 e0 ldi r29, 0x01 ; 1 - 2898: 82 e6 ldi r24, 0x62 ; 98 - 289a: 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; - 289c: a0 e2 ldi r26, 0x20 ; 32 - 289e: b6 e0 ldi r27, 0x06 ; 6 - 28a0: 85 e0 ldi r24, 0x05 ; 5 - 28a2: 12 96 adiw r26, 0x02 ; 2 - 28a4: 8c 93 st X, r24 - 28a6: 12 97 sbiw r26, 0x02 ; 2 - CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL0 = PORT_ISC_RISING_gc; - 28a8: 81 e0 ldi r24, 0x01 ; 1 - 28aa: 50 96 adiw r26, 0x10 ; 16 - 28ac: 8c 93 st X, r24 - 28ae: 50 97 sbiw r26, 0x10 ; 16 - CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL1 = PORT_ISC_FALLING_gc; - 28b0: 82 e0 ldi r24, 0x02 ; 2 - 28b2: 52 96 adiw r26, 0x12 ; 18 - 28b4: 8c 93 st X, r24 - 28b6: 52 97 sbiw r26, 0x12 ; 18 - CODEC_DEMOD_IN_PORT.INT0MASK = 0; - 28b8: 1a 96 adiw r26, 0x0a ; 10 - 28ba: 1c 92 st X, r1 - 28bc: 1a 97 sbiw r26, 0x0a ; 10 - CODEC_DEMOD_IN_PORT.INTCTRL = PORT_INT0LVL_HI_gc; - 28be: 83 e0 ldi r24, 0x03 ; 3 - 28c0: 19 96 adiw r26, 0x09 ; 9 - 28c2: 8c 93 st X, r24 - EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0; - 28c4: 98 e5 ldi r25, 0x58 ; 88 - 28c6: 98 83 st Y, r25 - EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1; - 28c8: 9a e5 ldi r25, 0x5A ; 90 - 28ca: 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; - 28cc: 90 e4 ldi r25, 0x40 ; 64 - 28ce: 91 83 std Z+1, r25 ; 0x01 - CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; - 28d0: 96 83 std Z+6, r25 ; 0x06 - CODEC_SUBCARRIER_PORT.DIRSET = CODEC_SUBCARRIER_MASK; - 28d2: 81 83 std Z+1, r24 ; 0x01 - CODEC_SUBCARRIER_PORT.OUTCLR = CODEC_SUBCARRIER_MASK; - 28d4: 86 83 std Z+6, r24 ; 0x06 - - /* Configure subcarrier generation with 50% DC output using OOK */ - CODEC_SUBCARRIER_TIMER.PER = ISO14443A_SUBCARRIER_DIVIDER - 1; - 28d6: e0 e0 ldi r30, 0x00 ; 0 - 28d8: f8 e0 ldi r31, 0x08 ; 8 - 28da: 8f e0 ldi r24, 0x0F ; 15 - 28dc: 90 e0 ldi r25, 0x00 ; 0 - 28de: 86 a3 std Z+38, r24 ; 0x26 - 28e0: 97 a3 std Z+39, r25 ; 0x27 - CODEC_SUBCARRIER_TIMER.CODEC_SUBCARRIER_CC_OOK = ISO14443A_SUBCARRIER_DIVIDER/2; - 28e2: 88 e0 ldi r24, 0x08 ; 8 - 28e4: 90 e0 ldi r25, 0x00 ; 0 - 28e6: 82 a7 std Z+42, r24 ; 0x2a - 28e8: 93 a7 std Z+43, r25 ; 0x2b - CODEC_SUBCARRIER_TIMER.CTRLB = CODEC_SUBCARRIER_CCEN_OOK | TC_WGMODE_SINGLESLOPE_gc; - 28ea: 83 e2 ldi r24, 0x23 ; 35 - 28ec: 81 83 std Z+1, r24 ; 0x01 -void ISO14443ACodecInit(void) { - /* Initialize common peripherals and start listening - * for incoming data. */ - Initialize(); - StartDemod(); -} - 28ee: df 91 pop r29 - 28f0: cf 91 pop r28 - -void ISO14443ACodecInit(void) { - /* Initialize common peripherals and start listening - * for incoming data. */ - Initialize(); - StartDemod(); - 28f2: cf cd rjmp .-1122 ; 0x2492 - -000028f4 : -} - -void ISO14443ACodecTask(void) { - 28f4: cf 93 push r28 - 28f6: df 93 push r29 - if (Flags.DemodFinished) { - 28f8: 80 91 b3 24 lds r24, 0x24B3 - 28fc: 88 23 and r24, r24 - 28fe: c1 f0 breq .+48 ; 0x2930 - Flags.DemodFinished = 0; - 2900: 10 92 b3 24 sts 0x24B3, r1 -INLINE void CodecTask(void) { - ActiveConfiguration.CodecTaskFunc(); -} - -INLINE void CodecSetDemodPower(bool bOnOff) { - CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; - 2904: 82 e0 ldi r24, 0x02 ; 2 - 2906: 80 93 21 06 sts 0x0621, r24 - - if (bOnOff) { - CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; - } else { - CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK; - 290a: 80 93 26 06 sts 0x0626, r24 - /* Reception finished. Process the received bytes */ - CodecSetDemodPower(false); - - uint16_t DemodBitCount = BitCount; - 290e: 60 91 ad 24 lds r22, 0x24AD - 2912: 70 91 ae 24 lds r23, 0x24AE - uint16_t AnswerBitCount = ISO14443A_APP_NO_RESPONSE; - - if (DemodBitCount > 0) { - 2916: 61 15 cp r22, r1 - 2918: 71 05 cpc r23, r1 - 291a: 89 f4 brne .+34 ; 0x293e -INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { - return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); -} - -INLINE void ApplicationReset(void) { - ActiveConfiguration.ApplicationResetFunc(); - 291c: e0 91 ef 24 lds r30, 0x24EF - 2920: f0 91 f0 24 lds r31, 0x24F0 - 2924: 09 95 icall - CodecBufferPtr = CodecBuffer; - ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - LoadModState = LOADMOD_START; - } else { - /* No data to be processed. Disable loadmodding and start listening again */ - CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_OFF_gc; - 2926: 10 92 40 09 sts 0x0940, r1 - CODEC_TIMER_LOADMOD.INTCTRLA = 0; - 292a: 10 92 46 09 sts 0x0946, r1 - - StartDemod(); - 292e: b1 dd rcall .-1182 ; 0x2492 - } - } - - if (Flags.LoadmodFinished) { - 2930: 80 91 b4 24 lds r24, 0x24B4 - 2934: 81 11 cpse r24, r1 - 2936: 2a c0 rjmp .+84 ; 0x298c - Flags.LoadmodFinished = 0; - /* Load modulation has been finished. Stop it and start to listen - * for incoming data again. */ - StartDemod(); - } -} - 2938: df 91 pop r29 - 293a: cf 91 pop r28 - 293c: 08 95 ret -INLINE void ApplicationTask(void) { - ActiveConfiguration.ApplicationTaskFunc(); -} - -INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { - return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); - 293e: e0 91 f3 24 lds r30, 0x24F3 - 2942: f0 91 f4 24 lds r31, 0x24F4 - 2946: 80 e1 ldi r24, 0x10 ; 16 - 2948: 96 e2 ldi r25, 0x26 ; 38 - 294a: 09 95 icall - - if (DemodBitCount > 0) { - /* Call application if we received data */ - AnswerBitCount = ApplicationProcess(CodecBuffer, DemodBitCount); - - if (AnswerBitCount & ISO14443A_APP_CUSTOM_PARITY) { - 294c: 94 ff sbrs r25, 4 - 294e: 23 c0 rjmp .+70 ; 0x2996 - /* Application has generated it's own parity bits. - * Clear this option bit. */ - AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; - 2950: 9f 7e andi r25, 0xEF ; 239 - } - } else { - ApplicationReset(); - } - - if (AnswerBitCount != ISO14443A_APP_NO_RESPONSE) { - 2952: 00 97 sbiw r24, 0x00 ; 0 - 2954: 41 f3 breq .-48 ; 0x2926 - BitCount = AnswerBitCount; - 2956: 80 93 ad 24 sts 0x24AD, r24 - 295a: 90 93 ae 24 sts 0x24AE, r25 - BitSent = 0; - 295e: 10 92 ab 24 sts 0x24AB, r1 - 2962: 10 92 ac 24 sts 0x24AC, r1 - CodecBufferPtr = CodecBuffer; - 2966: 80 e1 ldi r24, 0x10 ; 16 - 2968: 96 e2 ldi r25, 0x26 ; 38 - 296a: 80 93 b1 24 sts 0x24B1, r24 - 296e: 90 93 b2 24 sts 0x24B2, r25 - ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - 2972: 80 e9 ldi r24, 0x90 ; 144 - 2974: 96 e2 ldi r25, 0x26 ; 38 - 2976: 80 93 af 24 sts 0x24AF, r24 - 297a: 90 93 b0 24 sts 0x24B0, r25 - LoadModState = LOADMOD_START; - 297e: 81 e0 ldi r24, 0x01 ; 1 - 2980: 80 93 a6 24 sts 0x24A6, r24 - - StartDemod(); - } - } - - if (Flags.LoadmodFinished) { - 2984: 80 91 b4 24 lds r24, 0x24B4 - 2988: 88 23 and r24, r24 - 298a: b1 f2 breq .-84 ; 0x2938 - Flags.LoadmodFinished = 0; - 298c: 10 92 b4 24 sts 0x24B4, r1 - /* Load modulation has been finished. Stop it and start to listen - * for incoming data again. */ - StartDemod(); - } -} - 2990: df 91 pop r29 - 2992: 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(); - 2994: 7e cd rjmp .-1284 ; 0x2492 - /* 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++) { - 2996: ac 01 movw r20, r24 - 2998: 56 95 lsr r21 - 299a: 47 95 ror r20 - 299c: 56 95 lsr r21 - 299e: 47 95 ror r20 - 29a0: 56 95 lsr r21 - 29a2: 47 95 ror r20 - 29a4: 41 15 cp r20, r1 - 29a6: 51 05 cpc r21, r1 - 29a8: a1 f2 breq .-88 ; 0x2952 - 29aa: 70 e0 ldi r23, 0x00 ; 0 - 29ac: 20 e0 ldi r18, 0x00 ; 0 - 29ae: 30 e0 ldi r19, 0x00 ; 0 - /* For each whole byte, generate a parity bit. */ - CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = - ODD_PARITY(CodecBuffer[i]); - 29b0: f9 01 movw r30, r18 - 29b2: e0 5f subi r30, 0xF0 ; 240 - 29b4: f9 4d sbci r31, 0xD9 ; 217 - 29b6: 60 81 ld r22, Z - 29b8: 06 2e mov r0, r22 - 29ba: 62 95 swap r22 - 29bc: 60 25 eor r22, r0 - 29be: 06 2e mov r0, r22 - 29c0: 66 95 lsr r22 - 29c2: 66 95 lsr r22 - 29c4: 60 25 eor r22, r0 - AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; - } else { - /* We have to generate the parity bits ourself */ - for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { - /* For each whole byte, generate a parity bit. */ - CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = - 29c6: e0 58 subi r30, 0x80 ; 128 - 29c8: ff 4f sbci r31, 0xFF ; 255 - ODD_PARITY(CodecBuffer[i]); - 29ca: 6f 5f subi r22, 0xFF ; 255 - 29cc: 66 95 lsr r22 - 29ce: 61 70 andi r22, 0x01 ; 1 - 29d0: c6 2f mov r28, r22 - 29d2: 20 e0 ldi r18, 0x00 ; 0 - 29d4: d2 2f mov r29, r18 - 29d6: 21 e0 ldi r18, 0x01 ; 1 - 29d8: c2 27 eor r28, r18 - 29da: c0 83 st Z, r28 - /* Application has generated it's own parity bits. - * Clear this option bit. */ - AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; - } else { - /* We have to generate the parity bits ourself */ - for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { - 29dc: 7f 5f subi r23, 0xFF ; 255 - 29de: 27 2f mov r18, r23 - 29e0: 30 e0 ldi r19, 0x00 ; 0 - 29e2: 24 17 cp r18, r20 - 29e4: 35 07 cpc r19, r21 - 29e6: 20 f3 brcs .-56 ; 0x29b0 - 29e8: b6 cf rjmp .-148 ; 0x2956 - -000029ea : - Block[11] = Block[3]; -} - -void MifareClassicAppInit1K(void) -{ - State = STATE_IDLE; - 29ea: 81 e0 ldi r24, 0x01 ; 1 - 29ec: 80 93 d1 24 sts 0x24D1, r24 - CardATQAValue = MFCLASSIC_1K_ATQA_VALUE; - 29f0: 84 e0 ldi r24, 0x04 ; 4 - 29f2: 90 e0 ldi r25, 0x00 ; 0 - 29f4: 80 93 b6 24 sts 0x24B6, r24 - 29f8: 90 93 b7 24 sts 0x24B7, r25 - CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; - 29fc: 88 e0 ldi r24, 0x08 ; 8 - 29fe: 80 93 b5 24 sts 0x24B5, r24 - 2a02: 08 95 ret - -00002a04 : -} - -void MifareClassicAppInit4K(void) -{ - State = STATE_IDLE; - 2a04: 81 e0 ldi r24, 0x01 ; 1 - 2a06: 80 93 d1 24 sts 0x24D1, r24 - CardATQAValue = MFCLASSIC_4K_ATQA_VALUE; - 2a0a: 82 e0 ldi r24, 0x02 ; 2 - 2a0c: 90 e0 ldi r25, 0x00 ; 0 - 2a0e: 80 93 b6 24 sts 0x24B6, r24 - 2a12: 90 93 b7 24 sts 0x24B7, r25 - CardSAKValue = MFCLASSIC_4K_SAK_CL1_VALUE; - 2a16: 88 e1 ldi r24, 0x18 ; 24 - 2a18: 80 93 b5 24 sts 0x24B5, r24 - 2a1c: 08 95 ret - -00002a1e : -} - -void MifareClassicAppReset(void) -{ - State = STATE_IDLE; - 2a1e: 81 e0 ldi r24, 0x01 ; 1 - 2a20: 80 93 d1 24 sts 0x24D1, r24 - 2a24: 08 95 ret - -00002a26 : -} - -void MifareClassicAppTask(void) -{ - 2a26: 08 95 ret - -00002a28 : - -} - -uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - 2a28: 7f 92 push r7 - 2a2a: 8f 92 push r8 - 2a2c: 9f 92 push r9 - 2a2e: af 92 push r10 - 2a30: bf 92 push r11 - 2a32: cf 92 push r12 - 2a34: df 92 push r13 - 2a36: ef 92 push r14 - 2a38: ff 92 push r15 - 2a3a: 0f 93 push r16 - 2a3c: 1f 93 push r17 - 2a3e: cf 93 push r28 - 2a40: df 93 push r29 - 2a42: cd b7 in r28, 0x3d ; 61 - 2a44: de b7 in r29, 0x3e ; 62 - 2a46: 2e 97 sbiw r28, 0x0e ; 14 - 2a48: cd bf out 0x3d, r28 ; 61 - 2a4a: de bf out 0x3e, r29 ; 62 - 2a4c: 8c 01 movw r16, r24 - switch(State) { - 2a4e: 40 91 d1 24 lds r20, 0x24D1 - 2a52: 50 e0 ldi r21, 0x00 ; 0 - 2a54: 4a 30 cpi r20, 0x0A ; 10 - 2a56: 51 05 cpc r21, r1 - 2a58: 98 f0 brcs .+38 ; 0x2a80 - - *BitCount = ISO14443A_SAK_FRAME_SIZE; - return true; - } else { - /* We have not been selected. Don't send anything. */ - *BitCount = 0; - 2a5a: 80 e0 ldi r24, 0x00 ; 0 - 2a5c: 90 e0 ldi r25, 0x00 ; 0 - break; - } - - /* No response has been sent, when we reach here */ - return ISO14443A_APP_NO_RESPONSE; -} - 2a5e: 2e 96 adiw r28, 0x0e ; 14 - 2a60: cd bf out 0x3d, r28 ; 61 - 2a62: de bf out 0x3e, r29 ; 62 - 2a64: df 91 pop r29 - 2a66: cf 91 pop r28 - 2a68: 1f 91 pop r17 - 2a6a: 0f 91 pop r16 - 2a6c: ff 90 pop r15 - 2a6e: ef 90 pop r14 - 2a70: df 90 pop r13 - 2a72: cf 90 pop r12 - 2a74: bf 90 pop r11 - 2a76: af 90 pop r10 - 2a78: 9f 90 pop r9 - 2a7a: 8f 90 pop r8 - 2a7c: 7f 90 pop r7 - 2a7e: 08 95 ret - -} - -uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - switch(State) { - 2a80: fa 01 movw r30, r20 - 2a82: ee 5e subi r30, 0xEE ; 238 - 2a84: fe 4f sbci r31, 0xFE ; 254 - 2a86: 0c 94 69 23 jmp 0x46d2 ; 0x46d2 <__tablejump2__> - 2a8a: 7c 01 movw r14, r24 - 2a8c: d1 2c mov 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(); - 2a8e: f7 01 movw r30, r14 - 2a90: c0 80 ld r12, Z - 2a92: 99 d5 rcall .+2866 ; 0x35c6 - 2a94: 8c 25 eor r24, r12 - 2a96: d7 01 movw r26, r14 - 2a98: 8d 93 st X+, r24 - 2a9a: 7d 01 movw r14, r26 - * 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++) - 2a9c: d3 94 inc r13 - 2a9e: b2 e1 ldi r27, 0x12 ; 18 - 2aa0: db 12 cpse r13, r27 - 2aa2: f5 cf rjmp .-22 ; 0x2a8e - Buffer[i] ^= Crypto1Byte(); - - if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { - 2aa4: 60 e1 ldi r22, 0x10 ; 16 - 2aa6: 70 e0 ldi r23, 0x00 ; 0 - 2aa8: c8 01 movw r24, r16 - 2aaa: e5 d3 rcall .+1994 ; 0x3276 - 2aac: 88 23 and r24, r24 - 2aae: 09 f4 brne .+2 ; 0x2ab2 - 2ab0: ec c1 rjmp .+984 ; 0x2e8a - if (!ActiveConfiguration.ReadOnly) { - 2ab2: 80 91 fc 24 lds r24, 0x24FC - 2ab6: 88 23 and r24, r24 - 2ab8: 09 f4 brne .+2 ; 0x2abc - 2aba: ed c1 rjmp .+986 ; 0x2e96 - MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - } else { - /* Silently ignore in ReadOnly mode */ - } - - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2abc: 97 d5 rcall .+2862 ; 0x35ec - 2abe: 9a e0 ldi r25, 0x0A ; 10 - 2ac0: 98 27 eor r25, r24 - 2ac2: d8 01 movw r26, r16 - 2ac4: 9c 93 st X, r25 - } else { - /* CRC Error. */ - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - - State = STATE_AUTHED_IDLE; - 2ac6: 85 e0 ldi r24, 0x05 ; 5 - 2ac8: 80 93 d1 24 sts 0x24D1, r24 - return ACK_NAK_FRAME_SIZE; - 2acc: 84 e0 ldi r24, 0x04 ; 4 - 2ace: 90 e0 ldi r25, 0x00 ; 0 - 2ad0: c6 cf rjmp .-116 ; 0x2a5e - 2ad2: 7c 01 movw r14, r24 - -} - -uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - switch(State) { - 2ad4: 56 e0 ldi r21, 0x06 ; 6 - 2ad6: d5 2e mov r13, r21 - * 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(); - 2ad8: d7 01 movw r26, r14 - 2ada: cc 90 ld r12, X - 2adc: 74 d5 rcall .+2792 ; 0x35c6 - 2ade: 8c 25 eor r24, r12 - 2ae0: f7 01 movw r30, r14 - 2ae2: 81 93 st Z+, r24 - 2ae4: 7f 01 movw r14, r30 - 2ae6: da 94 dec r13 - * 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++) - 2ae8: b9 f7 brne .-18 ; 0x2ad8 - Buffer[i] ^= Crypto1Byte(); - - if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { - 2aea: 64 e0 ldi r22, 0x04 ; 4 - 2aec: 70 e0 ldi r23, 0x00 ; 0 - 2aee: c8 01 movw r24, r16 - 2af0: c2 d3 rcall .+1924 ; 0x3276 - 2af2: 81 11 cpse r24, r1 - 2af4: b0 c1 rjmp .+864 ; 0x2e56 - /* Not sure if this is the correct error code.. */ - Buffer[0] = NAK_OTHER_ERROR ^ Crypto1Nibble(); - } - } else { - /* CRC Error. */ - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 2af6: 7a d5 rcall .+2804 ; 0x35ec - 2af8: 91 e0 ldi r25, 0x01 ; 1 - 2afa: 98 27 eor r25, r24 - 2afc: d8 01 movw r26, r16 - 2afe: 9c 93 st X, r25 - 2b00: e2 cf rjmp .-60 ; 0x2ac6 -uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - switch(State) { - case STATE_IDLE: - case STATE_HALT: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - 2b02: 20 91 b6 24 lds r18, 0x24B6 - 2b06: 90 91 b7 24 lds r25, 0x24B7 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - 2b0a: d8 01 movw r26, r16 - 2b0c: 8c 91 ld r24, X - 2b0e: 86 32 cpi r24, 0x26 ; 38 - 2b10: 19 f0 breq .+6 ; 0x2b18 - 2b12: 82 35 cpi r24, 0x52 ; 82 - 2b14: 09 f0 breq .+2 ; 0x2b18 - 2b16: a1 cf rjmp .-190 ; 0x2a5a - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 2b18: f8 01 movw r30, r16 - 2b1a: 20 83 st Z, r18 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 2b1c: 91 83 std Z+1, r25 ; 0x01 - } - break; - - case STATE_READY: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - State = STATE_READY; - 2b1e: 82 e0 ldi r24, 0x02 ; 2 - 2b20: 80 93 d1 24 sts 0x24D1, r24 - - *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 2b24: 80 e1 ldi r24, 0x10 ; 16 - 2b26: 90 e0 ldi r25, 0x00 ; 0 - return BitCount; - 2b28: 9a cf rjmp .-204 ; 0x2a5e - return BitCount; - } - break; - - case STATE_READY: - if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { - 2b2a: 20 91 b6 24 lds r18, 0x24B6 - 2b2e: 90 91 b7 24 lds r25, 0x24B7 -INLINE -bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) -{ - uint8_t* DataPtr = (uint8_t*) Buffer; - - if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ - 2b32: d8 01 movw r26, r16 - 2b34: 8c 91 ld r24, X - 2b36: 86 32 cpi r24, 0x26 ; 38 - 2b38: 79 f3 breq .-34 ; 0x2b18 - 2b3a: 82 35 cpi r24, 0x52 ; 82 - 2b3c: 69 f3 breq .-38 ; 0x2b18 - State = STATE_READY; - return BitCount; - } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { - 2b3e: 83 39 cpi r24, 0x93 ; 147 - 2b40: 09 f4 brne .+2 ; 0x2b44 - 2b42: cb c1 rjmp .+918 ; 0x2eda - * byte is supposed to be 0. */ - if (Buffer[1] == 0) { - if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { - /* According to ISO14443, we must not send anything - * in order to acknowledge the HALT command. */ - State = STATE_HALT; - 2b44: 10 92 d1 24 sts 0x24D1, r1 - return ISO14443A_APP_NO_RESPONSE; - 2b48: 80 e0 ldi r24, 0x00 ; 0 - 2b4a: 90 e0 ldi r25, 0x00 ; 0 - 2b4c: 88 cf rjmp .-240 ; 0x2a5e - - 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]); - 2b4e: 16 d5 rcall .+2604 ; 0x357c - 2b50: 68 01 movw r12, r16 - 2b52: b4 e0 ldi r27, 0x04 ; 4 - 2b54: cb 0e add r12, r27 - 2b56: d1 1c adc r13, r1 - - for (uint8_t i=0; i<4; i++) - 2b58: b1 2c mov r11, r1 - Buffer[i+4] ^= Crypto1Byte(); - 2b5a: f6 01 movw r30, r12 - 2b5c: a0 80 ld r10, Z - 2b5e: 33 d5 rcall .+2662 ; 0x35c6 - 2b60: 8a 25 eor r24, r10 - 2b62: d6 01 movw r26, r12 - 2b64: 8d 93 st X+, r24 - 2b66: 6d 01 movw r12, r26 - /* 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++) - 2b68: b3 94 inc r11 - 2b6a: b4 e0 ldi r27, 0x04 ; 4 - 2b6c: bb 12 cpse r11, r27 - 2b6e: f5 cf rjmp .-22 ; 0x2b5a - Buffer[i+4] ^= Crypto1Byte(); - - if ((Buffer[4] == ReaderResponse[0]) && - 2b70: f8 01 movw r30, r16 - 2b72: 94 81 ldd r25, Z+4 ; 0x04 - 2b74: 80 91 c9 24 lds r24, 0x24C9 - 2b78: 98 17 cp r25, r24 - 2b7a: 09 f4 brne .+2 ; 0x2b7e - 2b7c: 2e c1 rjmp .+604 ; 0x2dda - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - return ACK_NAK_FRAME_SIZE; - } - } else { - /* Unknown command. Enter HALT state */ - State = STATE_IDLE; - 2b7e: 81 e0 ldi r24, 0x01 ; 1 - 2b80: 80 93 d1 24 sts 0x24D1, r24 - /* Unknown state? Should never happen. */ - break; - } - - /* No response has been sent, when we reach here */ - return ISO14443A_APP_NO_RESPONSE; - 2b84: 80 e0 ldi r24, 0x00 ; 0 - 2b86: 90 e0 ldi r25, 0x00 ; 0 - } else { - /* Unknown command. Enter HALT state */ - State = STATE_IDLE; - } - - break; - 2b88: 6a cf rjmp .-300 ; 0x2a5e - -} - -uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) -{ - switch(State) { - 2b8a: 7c 01 movw r14, r24 - 2b8c: 74 e0 ldi r23, 0x04 ; 4 - 2b8e: b7 2e mov r11, r23 - - 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(); - 2b90: d7 01 movw r26, r14 - 2b92: ac 90 ld r10, X - 2b94: 18 d5 rcall .+2608 ; 0x35c6 - 2b96: 8a 25 eor r24, r10 - 2b98: f7 01 movw r30, r14 - 2b9a: 81 93 st Z+, r24 - 2b9c: 7f 01 movw r14, r30 - 2b9e: ba 94 dec r11 - 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++) - 2ba0: b9 f7 brne .-18 ; 0x2b90 - Buffer[i] ^= Crypto1Byte(); - - if (Buffer[0] == CMD_READ) { - 2ba2: d8 01 movw r26, r16 - 2ba4: 8c 91 ld r24, X - 2ba6: 80 33 cpi r24, 0x30 ; 48 - 2ba8: 09 f4 brne .+2 ; 0x2bac - 2baa: 89 c1 rjmp .+786 ; 0x2ebe - * 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) { - 2bac: 80 3a cpi r24, 0xA0 ; 160 - 2bae: 09 f4 brne .+2 ; 0x2bb2 - 2bb0: cb c1 rjmp .+918 ; 0x2f48 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_DECREMENT) { - 2bb2: 80 3c cpi r24, 0xC0 ; 192 - 2bb4: 09 f4 brne .+2 ; 0x2bb8 - 2bb6: da c1 rjmp .+948 ; 0x2f6c - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_INCREMENT) { - 2bb8: 81 3c cpi r24, 0xC1 ; 193 - 2bba: 09 f4 brne .+2 ; 0x2bbe - 2bbc: 75 c2 rjmp .+1258 ; 0x30a8 <__stack+0xa9> - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_RESTORE) { - 2bbe: 82 3c cpi r24, 0xC2 ; 194 - 2bc0: 09 f4 brne .+2 ; 0x2bc4 - 2bc2: 80 c2 rjmp .+1280 ; 0x30c4 <__stack+0xc5> - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - }else if (Buffer[0] == CMD_TRANSFER) { - 2bc4: 80 3b cpi r24, 0xB0 ; 176 - 2bc6: 09 f4 brne .+2 ; 0x2bca - 2bc8: 8e c2 rjmp .+1308 ; 0x30e6 <__stack+0xe7> - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - - return ACK_NAK_FRAME_SIZE; - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { - 2bca: 80 56 subi r24, 0x60 ; 96 - 2bcc: 82 30 cpi r24, 0x02 ; 2 - 2bce: b8 f6 brcc .-82 ; 0x2b7e - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 2bd0: 62 e0 ldi r22, 0x02 ; 2 - 2bd2: 70 e0 ldi r23, 0x00 ; 0 - 2bd4: c8 01 movw r24, r16 - 2bd6: 4f d3 rcall .+1694 ; 0x3276 - 2bd8: 88 23 and r24, r24 - 2bda: 09 f4 brne .+2 ; 0x2bde - 2bdc: 68 c1 rjmp .+720 ; 0x2eae - /* Nested authentication. */ - uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - 2bde: f8 01 movw r30, r16 - 2be0: 81 81 ldd r24, Z+1 ; 0x01 - 2be2: 8c 73 andi r24, 0x3C ; 60 - uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 2be4: 90 81 ld r25, Z - 2be6: 90 36 cpi r25, 0x60 ; 96 - 2be8: 09 f4 brne .+2 ; 0x2bec - 2bea: eb c2 rjmp .+1494 ; 0x31c2 <__stack+0x1c3> - 2bec: 6a e3 ldi r22, 0x3A ; 58 - 2bee: 70 e0 ldi r23, 0x00 ; 0 - uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; - 2bf0: 7b 01 movw r14, r22 - 2bf2: f0 e1 ldi r31, 0x10 ; 16 - 2bf4: 8f 9f mul r24, r31 - 2bf6: e0 0c add r14, r0 - 2bf8: f1 1c adc r15, r1 - 2bfa: 11 24 eor r1, r1 - uint8_t Key[6]; - uint8_t Uid[4]; - uint8_t CardNonce[4]; - - /* Generate a random nonce and read UID and key from memory */ - RandomGetBuffer(CardNonce, sizeof(CardNonce)); - 2bfc: 64 e0 ldi r22, 0x04 ; 4 - 2bfe: ce 01 movw r24, r28 - 2c00: 07 96 adiw r24, 0x07 ; 7 - 2c02: 0e 94 2f 05 call 0xa5e ; 0xa5e - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2c06: 44 e0 ldi r20, 0x04 ; 4 - 2c08: 50 e0 ldi r21, 0x00 ; 0 - 2c0a: 60 e0 ldi r22, 0x00 ; 0 - 2c0c: 70 e0 ldi r23, 0x00 ; 0 - 2c0e: ce 01 movw r24, r28 - 2c10: 0b 96 adiw r24, 0x0b ; 11 - 2c12: 0e 94 d4 05 call 0xba8 ; 0xba8 - MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); - 2c16: 46 e0 ldi r20, 0x06 ; 6 - 2c18: 50 e0 ldi r21, 0x00 ; 0 - 2c1a: b7 01 movw r22, r14 - 2c1c: ce 01 movw r24, r28 - 2c1e: 01 96 adiw r24, 0x01 ; 1 - 2c20: 0e 94 d4 05 call 0xba8 ; 0xba8 - 2c24: 8f 81 ldd r24, Y+7 ; 0x07 - 2c26: 98 85 ldd r25, Y+8 ; 0x08 - 2c28: a9 85 ldd r26, Y+9 ; 0x09 - 2c2a: ba 85 ldd r27, Y+10 ; 0x0a - 2c2c: 80 93 c9 24 sts 0x24C9, r24 - 2c30: 90 93 ca 24 sts 0x24CA, r25 - 2c34: a0 93 cb 24 sts 0x24CB, r26 - 2c38: b0 93 cc 24 sts 0x24CC, r27 - - /* Precalculate the reader response from card-nonce */ - for (uint8_t i=0; i - 2c46: 80 91 c9 24 lds r24, 0x24C9 - 2c4a: 90 91 ca 24 lds r25, 0x24CA - 2c4e: a0 91 cb 24 lds r26, 0x24CB - 2c52: b0 91 cc 24 lds r27, 0x24CC - 2c56: 80 93 cd 24 sts 0x24CD, r24 - 2c5a: 90 93 ce 24 sts 0x24CE, r25 - 2c5e: a0 93 cf 24 sts 0x24CF, r26 - 2c62: b0 93 d0 24 sts 0x24D0, r27 - - /* Precalculate our response from the reader response */ - for (uint8_t i=0; i - - /* Setup crypto1 cipher. */ - Crypto1Setup(Key, Uid, CardNonce); - 2c70: ae 01 movw r20, r28 - 2c72: 49 5f subi r20, 0xF9 ; 249 - 2c74: 5f 4f sbci r21, 0xFF ; 255 - 2c76: be 01 movw r22, r28 - 2c78: 65 5f subi r22, 0xF5 ; 245 - 2c7a: 7f 4f sbci r23, 0xFF ; 255 - 2c7c: ce 01 movw r24, r28 - 2c7e: 01 96 adiw r24, 0x01 ; 1 - 2c80: b0 d3 rcall .+1888 ; 0x33e2 - 2c82: 8f 81 ldd r24, Y+7 ; 0x07 - 2c84: 98 85 ldd r25, Y+8 ; 0x08 - 2c86: a9 85 ldd r26, Y+9 ; 0x09 - 2c88: ba 85 ldd r27, Y+10 ; 0x0a - 2c8a: f8 01 movw r30, r16 - 2c8c: 80 83 st Z, r24 - 2c8e: 91 83 std Z+1, r25 ; 0x01 - 2c90: a2 83 std Z+2, r26 ; 0x02 - 2c92: b3 83 std Z+3, r27 ; 0x03 - for (uint8_t i=0; i - 2ca0: fc 01 movw r30, r24 - 2ca2: 80 81 ld r24, Z - 2ca4: 86 32 cpi r24, 0x26 ; 38 - 2ca6: d1 f0 breq .+52 ; 0x2cdc - 2ca8: 82 35 cpi r24, 0x52 ; 82 - 2caa: c1 f0 breq .+48 ; 0x2cdc - - case STATE_ACTIVE: - if (ISO14443AWakeUp(Buffer, &BitCount, MFCLASSIC_1K_ATQA_VALUE)) { - State = STATE_READY; - return BitCount; - } else if (Buffer[0] == CMD_HALT) { - 2cac: 80 35 cpi r24, 0x50 ; 80 - 2cae: 09 f1 breq .+66 ; 0x2cf2 - } - } else { - Buffer[0] = NAK_INVALID_ARG; - return ACK_NAK_FRAME_SIZE; - } - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { - 2cb0: 90 ea ldi r25, 0xA0 ; 160 - 2cb2: 98 0f add r25, r24 - 2cb4: 92 30 cpi r25, 0x02 ; 2 - 2cb6: 38 f1 brcs .+78 ; 0x2d06 - 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) - 2cb8: 98 2f mov r25, r24 - 2cba: 9f 77 andi r25, 0x7F ; 127 - 2cbc: 90 33 cpi r25, 0x30 ; 48 - 2cbe: 31 f0 breq .+12 ; 0x2ccc - 2cc0: 80 3a cpi r24, 0xA0 ; 160 - 2cc2: 21 f0 breq .+8 ; 0x2ccc - 2cc4: 80 5c subi r24, 0xC0 ; 192 - 2cc6: 83 30 cpi r24, 0x03 ; 3 - 2cc8: 08 f0 brcs .+2 ; 0x2ccc - 2cca: 59 cf rjmp .-334 ; 0x2b7e - || (Buffer[0] == CMD_INCREMENT) || (Buffer[0] == CMD_RESTORE) || (Buffer[0] == CMD_TRANSFER) ) { - State = STATE_IDLE; - 2ccc: 81 e0 ldi r24, 0x01 ; 1 - 2cce: 80 93 d1 24 sts 0x24D1, r24 - Buffer[0] = NAK_NOT_AUTHED; - 2cd2: 84 e0 ldi r24, 0x04 ; 4 - 2cd4: d8 01 movw r26, r16 - 2cd6: 8c 93 st X, r24 - return ACK_NAK_FRAME_SIZE; - 2cd8: 90 e0 ldi r25, 0x00 ; 0 - 2cda: c1 ce rjmp .-638 ; 0x2a5e - DataPtr[0] = (ATQAValue >> 0) & 0x00FF; - 2cdc: 84 e0 ldi r24, 0x04 ; 4 - 2cde: d8 01 movw r26, r16 - 2ce0: 8c 93 st X, r24 - DataPtr[1] = (ATQAValue >> 8) & 0x00FF; - 2ce2: 11 96 adiw r26, 0x01 ; 1 - 2ce4: 1c 92 st X, r1 - } - break; - - case STATE_ACTIVE: - if (ISO14443AWakeUp(Buffer, &BitCount, MFCLASSIC_1K_ATQA_VALUE)) { - State = STATE_READY; - 2ce6: 82 e0 ldi r24, 0x02 ; 2 - 2ce8: 80 93 d1 24 sts 0x24D1, r24 - - *BitCount = ISO14443A_ATQA_FRAME_SIZE; - 2cec: 80 e1 ldi r24, 0x10 ; 16 - 2cee: 90 e0 ldi r25, 0x00 ; 0 - return BitCount; - 2cf0: b6 ce rjmp .-660 ; 0x2a5e - } else if (Buffer[0] == CMD_HALT) { - /* Halts the tag. According to the ISO14443, the second - * byte is supposed to be 0. */ - if (Buffer[1] == 0) { - 2cf2: f8 01 movw r30, r16 - 2cf4: 81 81 ldd r24, Z+1 ; 0x01 - 2cf6: 88 23 and r24, r24 - 2cf8: 09 f4 brne .+2 ; 0x2cfc - 2cfa: 13 c2 rjmp .+1062 ; 0x3122 <__stack+0x123> - } else { - Buffer[0] = NAK_CRC_ERROR; - return ACK_NAK_FRAME_SIZE; - } - } else { - Buffer[0] = NAK_INVALID_ARG; - 2cfc: f8 01 movw r30, r16 - 2cfe: 10 82 st Z, r1 - return ACK_NAK_FRAME_SIZE; - 2d00: 84 e0 ldi r24, 0x04 ; 4 - 2d02: 90 e0 ldi r25, 0x00 ; 0 - 2d04: ac ce rjmp .-680 ; 0x2a5e - } - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - 2d06: 62 e0 ldi r22, 0x02 ; 2 - 2d08: 70 e0 ldi r23, 0x00 ; 0 - 2d0a: c8 01 movw r24, r16 - 2d0c: b4 d2 rcall .+1384 ; 0x3276 - 2d0e: 88 23 and r24, r24 - 2d10: 09 f4 brne .+2 ; 0x2d14 - 2d12: 0d c2 rjmp .+1050 ; 0x312e <__stack+0x12f> - uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - 2d14: d8 01 movw r26, r16 - 2d16: 11 96 adiw r26, 0x01 ; 1 - 2d18: 2c 91 ld r18, X - 2d1a: 11 97 sbiw r26, 0x01 ; 1 - 2d1c: 2c 73 andi r18, 0x3C ; 60 - uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 2d1e: 8c 91 ld r24, X - 2d20: 80 36 cpi r24, 0x60 ; 96 - 2d22: 09 f4 brne .+2 ; 0x2d26 - 2d24: 51 c2 rjmp .+1186 ; 0x31c8 <__stack+0x1c9> - 2d26: 8a e3 ldi r24, 0x3A ; 58 - 2d28: 90 e0 ldi r25, 0x00 ; 0 - uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; - 2d2a: 7c 01 movw r14, r24 - 2d2c: b0 e1 ldi r27, 0x10 ; 16 - 2d2e: 2b 9f mul r18, r27 - 2d30: e0 0c add r14, r0 - 2d32: f1 1c adc r15, r1 - 2d34: 11 24 eor r1, r1 - uint8_t Key[6]; - uint8_t Uid[4]; - uint8_t CardNonce[4]; - - /* Generate a random nonce and read UID and key from memory */ - RandomGetBuffer(CardNonce, sizeof(CardNonce)); - 2d36: 64 e0 ldi r22, 0x04 ; 4 - 2d38: ce 01 movw r24, r28 - 2d3a: 07 96 adiw r24, 0x07 ; 7 - 2d3c: 0e 94 2f 05 call 0xa5e ; 0xa5e - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2d40: 44 e0 ldi r20, 0x04 ; 4 - 2d42: 50 e0 ldi r21, 0x00 ; 0 - 2d44: 60 e0 ldi r22, 0x00 ; 0 - 2d46: 70 e0 ldi r23, 0x00 ; 0 - 2d48: ce 01 movw r24, r28 - 2d4a: 0b 96 adiw r24, 0x0b ; 11 - 2d4c: 0e 94 d4 05 call 0xba8 ; 0xba8 - MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); - 2d50: 46 e0 ldi r20, 0x06 ; 6 - 2d52: 50 e0 ldi r21, 0x00 ; 0 - 2d54: b7 01 movw r22, r14 - 2d56: ce 01 movw r24, r28 - 2d58: 01 96 adiw r24, 0x01 ; 1 - 2d5a: 0e 94 d4 05 call 0xba8 ; 0xba8 - 2d5e: 8f 81 ldd r24, Y+7 ; 0x07 - 2d60: 98 85 ldd r25, Y+8 ; 0x08 - 2d62: a9 85 ldd r26, Y+9 ; 0x09 - 2d64: ba 85 ldd r27, Y+10 ; 0x0a - 2d66: 80 93 c9 24 sts 0x24C9, r24 - 2d6a: 90 93 ca 24 sts 0x24CA, r25 - 2d6e: a0 93 cb 24 sts 0x24CB, r26 - 2d72: b0 93 cc 24 sts 0x24CC, r27 - - /* Precalculate the reader response from card-nonce */ - for (uint8_t i=0; i - 2d80: 80 91 c9 24 lds r24, 0x24C9 - 2d84: 90 91 ca 24 lds r25, 0x24CA - 2d88: a0 91 cb 24 lds r26, 0x24CB - 2d8c: b0 91 cc 24 lds r27, 0x24CC - 2d90: 80 93 cd 24 sts 0x24CD, r24 - 2d94: 90 93 ce 24 sts 0x24CE, r25 - 2d98: a0 93 cf 24 sts 0x24CF, r26 - 2d9c: b0 93 d0 24 sts 0x24D0, r27 - - /* Precalculate our response from the reader response */ - for (uint8_t i=0; i - - /* Respond with the random card nonce and expect further authentication - * form the reader in the next frame. */ - State = STATE_AUTHING; - 2daa: 84 e0 ldi r24, 0x04 ; 4 - 2dac: 80 93 d1 24 sts 0x24D1, r24 - 2db0: 8f 81 ldd r24, Y+7 ; 0x07 - 2db2: 98 85 ldd r25, Y+8 ; 0x08 - 2db4: a9 85 ldd r26, Y+9 ; 0x09 - 2db6: ba 85 ldd r27, Y+10 ; 0x0a - 2db8: f8 01 movw r30, r16 - 2dba: 80 83 st Z, r24 - 2dbc: 91 83 std Z+1, r25 ; 0x01 - 2dbe: a2 83 std Z+2, r26 ; 0x02 - 2dc0: b3 83 std Z+3, r27 ; 0x03 - - for (uint8_t i=0; i - - return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; - 2dd4: 80 e2 ldi r24, 0x20 ; 32 - 2dd6: 90 e0 ldi r25, 0x00 ; 0 - 2dd8: 42 ce rjmp .-892 ; 0x2a5e - Crypto1Auth(&Buffer[0]); - - for (uint8_t i=0; i<4; i++) - Buffer[i+4] ^= Crypto1Byte(); - - if ((Buffer[4] == ReaderResponse[0]) && - 2dda: 95 81 ldd r25, Z+5 ; 0x05 - 2ddc: 80 91 ca 24 lds r24, 0x24CA - 2de0: 98 13 cpse r25, r24 - 2de2: cd ce rjmp .-614 ; 0x2b7e - (Buffer[5] == ReaderResponse[1]) && - 2de4: 96 81 ldd r25, Z+6 ; 0x06 - 2de6: 80 91 cb 24 lds r24, 0x24CB - 2dea: 98 13 cpse r25, r24 - 2dec: c8 ce rjmp .-624 ; 0x2b7e - (Buffer[6] == ReaderResponse[2]) && - 2dee: 97 81 ldd r25, Z+7 ; 0x07 - 2df0: 80 91 cc 24 lds r24, 0x24CC - 2df4: 98 13 cpse r25, r24 - 2df6: c3 ce rjmp .-634 ; 0x2b7e - 2df8: 68 01 movw r12, r16 - 2dfa: 0d ec ldi r16, 0xCD ; 205 - 2dfc: 14 e2 ldi r17, 0x24 ; 36 - 2dfe: 5f 01 movw r10, r30 - 2e00: f0 e8 ldi r31, 0x80 ; 128 - 2e02: af 0e add r10, r31 - 2e04: b1 1c adc r11, r1 - 2e06: 48 01 movw r8, r16 - (Buffer[7] == ReaderResponse[3])) { - /* Reader is authenticated. Encrypt the precalculated card response - * and generate the parity bits. */ - for (uint8_t i=0; i - 2e10: 87 25 eor r24, r7 - 2e12: f6 01 movw r30, r12 - 2e14: 81 93 st Z+, r24 - 2e16: 6f 01 movw r12, r30 - Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); - 2e18: d4 01 movw r26, r8 - 2e1a: 9c 90 ld r9, X - 2e1c: 09 2c mov r0, r9 - 2e1e: 92 94 swap r9 - 2e20: 90 24 eor r9, r0 - 2e22: 09 2c mov r0, r9 - 2e24: 96 94 lsr r9 - 2e26: 96 94 lsr r9 - 2e28: 90 24 eor r9, r0 - 2e2a: a9 d2 rcall .+1362 ; 0x337e - 2e2c: 93 94 inc r9 - 2e2e: 91 fa bst r9, 1 - 2e30: ee 24 eor r14, r14 - 2e32: e0 f8 bld r14, 0 - 2e34: f1 2c mov r15, r1 - 2e36: b1 e0 ldi r27, 0x01 ; 1 - 2e38: eb 26 eor r14, r27 - 2e3a: 8e 25 eor r24, r14 - 2e3c: f5 01 movw r30, r10 - 2e3e: 81 93 st Z+, r24 - 2e40: 5f 01 movw r10, r30 - (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; - 2e4a: 85 e0 ldi r24, 0x05 ; 5 - 2e4c: 80 93 d1 24 sts 0x24D1, r24 - - return (CMD_AUTH_BA_FRAME_SIZE * BITS_PER_BYTE) | ISO14443A_APP_CUSTOM_PARITY; - 2e50: 80 e2 ldi r24, 0x20 ; 32 - 2e52: 90 e1 ldi r25, 0x10 ; 16 - 2e54: 04 ce rjmp .-1016 ; 0x2a5e - * the block back into the global block buffer. */ - for (uint8_t i=0; i<(MEM_VALUE_SIZE + ISO14443A_CRCA_SIZE); i++) - Buffer[i] ^= Crypto1Byte(); - - if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { - MemoryReadBlock(BlockBuffer, (uint16_t) CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 2e56: 60 91 c8 24 lds r22, 0x24C8 - 2e5a: f0 e1 ldi r31, 0x10 ; 16 - 2e5c: 6f 9f mul r22, r31 - 2e5e: b0 01 movw r22, r0 - 2e60: 11 24 eor r1, r1 - 2e62: 40 e1 ldi r20, 0x10 ; 16 - 2e64: 50 e0 ldi r21, 0x00 ; 0 - 2e66: 88 eb ldi r24, 0xB8 ; 184 - 2e68: 94 e2 ldi r25, 0x24 ; 36 - 2e6a: 0e 94 d4 05 call 0xba8 ; 0xba8 - -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]) - 2e6e: 20 91 b8 24 lds r18, 0x24B8 - 2e72: 80 91 bc 24 lds r24, 0x24BC - 2e76: 80 95 com r24 - 2e78: 28 17 cp r18, r24 - 2e7a: 09 f4 brne .+2 ; 0x2e7e - 2e7c: 88 c0 rjmp .+272 ; 0x2f8e - 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(); - 2e7e: b6 d3 rcall .+1900 ; 0x35ec - 2e80: 96 e0 ldi r25, 0x06 ; 6 - 2e82: 98 27 eor r25, r24 - 2e84: f8 01 movw r30, r16 - 2e86: 90 83 st Z, r25 - 2e88: 1e ce rjmp .-964 ; 0x2ac6 - /* Silently ignore in ReadOnly mode */ - } - - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 2e8a: b0 d3 rcall .+1888 ; 0x35ec - 2e8c: 91 e0 ldi r25, 0x01 ; 1 - 2e8e: 98 27 eor r25, r24 - 2e90: f8 01 movw r30, r16 - 2e92: 90 83 st Z, r25 - 2e94: 18 ce rjmp .-976 ; 0x2ac6 - for (uint8_t i=0; i<(MEM_BYTES_PER_BLOCK + ISO14443A_CRCA_SIZE); i++) - Buffer[i] ^= Crypto1Byte(); - - if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { - if (!ActiveConfiguration.ReadOnly) { - MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 2e96: 60 91 c8 24 lds r22, 0x24C8 - 2e9a: e0 e1 ldi r30, 0x10 ; 16 - 2e9c: 6e 9f mul r22, r30 - 2e9e: b0 01 movw r22, r0 - 2ea0: 11 24 eor r1, r1 - 2ea2: 40 e1 ldi r20, 0x10 ; 16 - 2ea4: 50 e0 ldi r21, 0x00 ; 0 - 2ea6: c8 01 movw r24, r16 - 2ea8: 0e 94 ec 05 call 0xbd8 ; 0xbd8 - 2eac: 07 ce rjmp .-1010 ; 0x2abc - * form the reader in the next frame. */ - State = STATE_AUTHING; - - return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 2eae: 9e d3 rcall .+1852 ; 0x35ec - 2eb0: 91 e0 ldi r25, 0x01 ; 1 - 2eb2: 98 27 eor r25, r24 - 2eb4: d8 01 movw r26, r16 - 2eb6: 9c 93 st X, r25 - return ACK_NAK_FRAME_SIZE; - 2eb8: 84 e0 ldi r24, 0x04 ; 4 - 2eba: 90 e0 ldi r25, 0x00 ; 0 - 2ebc: d0 cd rjmp .-1120 ; 0x2a5e - * the incoming data. */ - for (uint8_t i=0; i<4; i++) - Buffer[i] ^= Crypto1Byte(); - - if (Buffer[0] == CMD_READ) { - if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { - 2ebe: 62 e0 ldi r22, 0x02 ; 2 - 2ec0: 70 e0 ldi r23, 0x00 ; 0 - 2ec2: c8 01 movw r24, r16 - 2ec4: d8 d1 rcall .+944 ; 0x3276 - 2ec6: 81 11 cpse r24, r1 - 2ec8: 38 c1 rjmp .+624 ; 0x313a <__stack+0x13b> - if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { - CurrentAddress = Buffer[1]; - State = STATE_RESTORE; - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - 2eca: 90 d3 rcall .+1824 ; 0x35ec - 2ecc: 91 e0 ldi r25, 0x01 ; 1 - if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { - /* Write command. Store the address and prepare for the upcoming data. - * Respond with ACK. */ - CurrentAddress = Buffer[1]; - State = STATE_WRITE; - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2ece: 98 27 eor r25, r24 - 2ed0: f8 01 movw r30, r16 - 2ed2: 90 83 st Z, r25 - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - 2ed4: 84 e0 ldi r24, 0x04 ; 4 - 2ed6: 90 e0 ldi r25, 0x00 ; 0 - 2ed8: c2 cd rjmp .-1148 ; 0x2a5e - State = STATE_READY; - return BitCount; - } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { - /* Load UID CL1 and perform anticollision */ - uint8_t UidCL1[4]; - MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 2eda: 44 e0 ldi r20, 0x04 ; 4 - 2edc: 50 e0 ldi r21, 0x00 ; 0 - 2ede: 60 e0 ldi r22, 0x00 ; 0 - 2ee0: 70 e0 ldi r23, 0x00 ; 0 - 2ee2: ce 01 movw r24, r28 - 2ee4: 01 96 adiw r24, 0x01 ; 1 - 2ee6: 0e 94 d4 05 call 0xba8 ; 0xba8 - - if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) { - 2eea: 90 91 b5 24 lds r25, 0x24B5 - 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) { - 2eee: d8 01 movw r26, r16 - 2ef0: 11 96 adiw r26, 0x01 ; 1 - 2ef2: 8c 91 ld r24, X - 2ef4: 80 32 cpi r24, 0x20 ; 32 - 2ef6: 09 f4 brne .+2 ; 0x2efa - 2ef8: 54 c1 rjmp .+680 ; 0x31a2 <__stack+0x1a3> - 2efa: 80 37 cpi r24, 0x70 ; 112 - 2efc: 09 f0 breq .+2 ; 0x2f00 - 2efe: ad cd rjmp .-1190 ; 0x2a5a - return false; - - case ISO14443A_NVB_AC_END: - /* End of anticollision procedure. - * Send SAK CLn if we are selected. */ - if ( (DataPtr[2] == UidCL[0]) && - 2f00: d8 01 movw r26, r16 - 2f02: 12 96 adiw r26, 0x02 ; 2 - 2f04: 2c 91 ld r18, X - 2f06: 12 97 sbiw r26, 0x02 ; 2 - 2f08: 89 81 ldd r24, Y+1 ; 0x01 - 2f0a: 28 13 cpse r18, r24 - 2f0c: a6 cd rjmp .-1204 ; 0x2a5a - 2f0e: 13 96 adiw r26, 0x03 ; 3 - 2f10: 2c 91 ld r18, X - 2f12: 13 97 sbiw r26, 0x03 ; 3 - 2f14: 8a 81 ldd r24, Y+2 ; 0x02 - 2f16: 28 13 cpse r18, r24 - 2f18: a0 cd rjmp .-1216 ; 0x2a5a - (DataPtr[3] == UidCL[1]) && - 2f1a: 14 96 adiw r26, 0x04 ; 4 - 2f1c: 2c 91 ld r18, X - 2f1e: 14 97 sbiw r26, 0x04 ; 4 - 2f20: 8b 81 ldd r24, Y+3 ; 0x03 - 2f22: 28 13 cpse r18, r24 - 2f24: 9a cd rjmp .-1228 ; 0x2a5a - (DataPtr[4] == UidCL[2]) && - 2f26: 15 96 adiw r26, 0x05 ; 5 - 2f28: 2c 91 ld r18, X - 2f2a: 15 97 sbiw r26, 0x05 ; 5 - 2f2c: 8c 81 ldd r24, Y+4 ; 0x04 - 2f2e: 28 13 cpse r18, r24 - 2f30: 94 cd rjmp .-1240 ; 0x2a5a - (DataPtr[5] == UidCL[3]) ) { - - DataPtr[0] = SAKValue; - 2f32: 9c 93 st X, r25 - ISO14443AAppendCRCA(Buffer, 1); - 2f34: 61 e0 ldi r22, 0x01 ; 1 - 2f36: 70 e0 ldi r23, 0x00 ; 0 - 2f38: c8 01 movw r24, r16 - 2f3a: 6f d1 rcall .+734 ; 0x321a - State = STATE_ACTIVE; - 2f3c: 83 e0 ldi r24, 0x03 ; 3 - 2f3e: 80 93 d1 24 sts 0x24D1, r24 - - *BitCount = ISO14443A_SAK_FRAME_SIZE; - 2f42: 88 e1 ldi r24, 0x18 ; 24 - 2f44: 90 e0 ldi r25, 0x00 ; 0 - 2f46: 8b cd rjmp .-1258 ; 0x2a5e - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - return ACK_NAK_FRAME_SIZE; - } - } else if (Buffer[0] == CMD_WRITE) { - if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { - 2f48: 62 e0 ldi r22, 0x02 ; 2 - 2f4a: 70 e0 ldi r23, 0x00 ; 0 - 2f4c: c8 01 movw r24, r16 - 2f4e: 93 d1 rcall .+806 ; 0x3276 - 2f50: 88 23 and r24, r24 - 2f52: 09 f4 brne .+2 ; 0x2f56 - 2f54: ac cf rjmp .-168 ; 0x2eae - /* Write command. Store the address and prepare for the upcoming data. - * Respond with ACK. */ - CurrentAddress = Buffer[1]; - 2f56: d8 01 movw r26, r16 - 2f58: 11 96 adiw r26, 0x01 ; 1 - 2f5a: 8c 91 ld r24, X - 2f5c: 80 93 c8 24 sts 0x24C8, r24 - State = STATE_WRITE; - 2f60: 86 e0 ldi r24, 0x06 ; 6 - 2f62: 80 93 d1 24 sts 0x24D1, r24 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2f66: 42 d3 rcall .+1668 ; 0x35ec - 2f68: 9a e0 ldi r25, 0x0A ; 10 - 2f6a: b1 cf rjmp .-158 ; 0x2ece - } else { - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - } else if (Buffer[0] == CMD_DECREMENT) { - if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { - 2f6c: 62 e0 ldi r22, 0x02 ; 2 - 2f6e: 70 e0 ldi r23, 0x00 ; 0 - 2f70: c8 01 movw r24, r16 - 2f72: 81 d1 rcall .+770 ; 0x3276 - 2f74: 88 23 and r24, r24 - 2f76: 09 f4 brne .+2 ; 0x2f7a - 2f78: a8 cf rjmp .-176 ; 0x2eca - CurrentAddress = Buffer[1]; - 2f7a: f8 01 movw r30, r16 - 2f7c: 81 81 ldd r24, Z+1 ; 0x01 - 2f7e: 80 93 c8 24 sts 0x24C8, r24 - State = STATE_DECREMENT; - 2f82: 88 e0 ldi r24, 0x08 ; 8 - 2f84: 80 93 d1 24 sts 0x24D1, r24 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 2f88: 31 d3 rcall .+1634 ; 0x35ec - 2f8a: 9a e0 ldi r25, 0x0A ; 10 - 2f8c: 92 cf rjmp .-220 ; 0x2eb2 - -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]) - 2f8e: 80 91 c0 24 lds r24, 0x24C0 - 2f92: 28 13 cpse r18, r24 - 2f94: 74 cf rjmp .-280 ; 0x2e7e - && (Block[1] == (uint8_t) ~Block[5]) && (Block[1] == Block[9]) - 2f96: e0 91 b9 24 lds r30, 0x24B9 - 2f9a: 80 91 bd 24 lds r24, 0x24BD - 2f9e: 80 95 com r24 - 2fa0: e8 13 cpse r30, r24 - 2fa2: 6d cf rjmp .-294 ; 0x2e7e - 2fa4: 80 91 c1 24 lds r24, 0x24C1 - 2fa8: e8 13 cpse r30, r24 - 2faa: 69 cf rjmp .-302 ; 0x2e7e - && (Block[2] == (uint8_t) ~Block[6]) && (Block[2] == Block[10]) - 2fac: 80 91 ba 24 lds r24, 0x24BA - 2fb0: 90 91 be 24 lds r25, 0x24BE - 2fb4: 90 95 com r25 - 2fb6: 89 13 cpse r24, r25 - 2fb8: 62 cf rjmp .-316 ; 0x2e7e - 2fba: 90 91 c2 24 lds r25, 0x24C2 - 2fbe: 89 13 cpse r24, r25 - 2fc0: 5e cf rjmp .-324 ; 0x2e7e - && (Block[3] == (uint8_t) ~Block[7]) && (Block[3] == Block[11]) - 2fc2: 30 91 bb 24 lds r19, 0x24BB - 2fc6: 90 91 bf 24 lds r25, 0x24BF - 2fca: 90 95 com r25 - 2fcc: 39 13 cpse r19, r25 - 2fce: 57 cf rjmp .-338 ; 0x2e7e - 2fd0: 90 91 c3 24 lds r25, 0x24C3 - 2fd4: 39 13 cpse r19, r25 - 2fd6: 53 cf rjmp .-346 ; 0x2e7e - && (Block[12] == (uint8_t) ~Block[13]) - 2fd8: 40 91 c4 24 lds r20, 0x24C4 - 2fdc: 90 91 c5 24 lds r25, 0x24C5 - 2fe0: 90 95 com r25 - 2fe2: 49 13 cpse r20, r25 - 2fe4: 4c cf rjmp .-360 ; 0x2e7e - && (Block[12] == Block[14]) - 2fe6: 90 91 c6 24 lds r25, 0x24C6 - 2fea: 49 13 cpse r20, r25 - 2fec: 48 cf rjmp .-368 ; 0x2e7e - && (Block[14] == (uint8_t) ~Block[15])) { - 2fee: 90 91 c7 24 lds r25, 0x24C7 - 2ff2: 90 95 com r25 - 2ff4: 49 13 cpse r20, r25 - 2ff6: 43 cf rjmp .-378 ; 0x2e7e -} - -INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) -{ - *Value = 0; - *Value |= ((uint32_t) Block[0] << 0); - 2ff8: d8 01 movw r26, r16 - 2ffa: 9c 91 ld r25, X - *Value |= ((uint32_t) Block[1] << 8); - 2ffc: 11 96 adiw r26, 0x01 ; 1 - 2ffe: fc 91 ld r31, X - 3000: 11 97 sbiw r26, 0x01 ; 1 - *Value |= ((uint32_t) Block[2] << 16); - 3002: 12 96 adiw r26, 0x02 ; 2 - 3004: 4c 91 ld r20, X - 3006: 12 97 sbiw r26, 0x02 ; 2 - 3008: 50 e0 ldi r21, 0x00 ; 0 - 300a: 60 e0 ldi r22, 0x00 ; 0 - 300c: 70 e0 ldi r23, 0x00 ; 0 - 300e: ba 01 movw r22, r20 - 3010: 55 27 eor r21, r21 - 3012: 44 27 eor r20, r20 - -INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) -{ - *Value = 0; - *Value |= ((uint32_t) Block[0] << 0); - *Value |= ((uint32_t) Block[1] << 8); - 3014: 5f 2b or r21, r31 - *Value |= ((uint32_t) Block[2] << 16); - 3016: 49 2b or r20, r25 - *Value |= ((uint32_t) Block[3] << 24); - 3018: 13 96 adiw r26, 0x03 ; 3 - 301a: 9c 91 ld r25, X - 301c: 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); - 301e: 90 e0 ldi r25, 0x00 ; 0 - 3020: a0 e0 ldi r26, 0x00 ; 0 - 3022: b0 e0 ldi r27, 0x00 ; 0 - 3024: dc 01 movw r26, r24 - 3026: 99 27 eor r25, r25 - 3028: 88 27 eor r24, r24 - -INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) -{ - *Value = 0; - *Value |= ((uint32_t) Block[0] << 0); - *Value |= ((uint32_t) Block[1] << 8); - 302a: 9e 2b or r25, r30 - *Value |= ((uint32_t) Block[2] << 16); - 302c: 82 2b or r24, r18 - *Value |= ((uint32_t) Block[3] << 24); - 302e: b3 2b or r27, r19 - uint32_t BlockValue; - - ValueFromBlock(&ParamValue, Buffer); - ValueFromBlock(&BlockValue, BlockBuffer); - - if (State == STATE_DECREMENT) { - 3030: 20 91 d1 24 lds r18, 0x24D1 - 3034: 28 30 cpi r18, 0x08 ; 8 - 3036: 09 f4 brne .+2 ; 0x303a <__stack+0x3b> - 3038: 6f c0 rjmp .+222 ; 0x3118 <__stack+0x119> - BlockValue -= ParamValue; - } else if (State == STATE_INCREMENT) { - 303a: 27 30 cpi r18, 0x07 ; 7 - 303c: 21 f4 brne .+8 ; 0x3046 <__stack+0x47> - BlockValue += ParamValue; - 303e: 84 0f add r24, r20 - 3040: 95 1f adc r25, r21 - 3042: a6 1f adc r26, r22 - 3044: b7 1f adc r27, r23 - *Value |= ((uint32_t) Block[3] << 24); -} - -INLINE void ValueToBlock(uint8_t* Block, uint32_t Value) -{ - Block[0] = (uint8_t) (Value >> 0); - 3046: 80 93 b8 24 sts 0x24B8, r24 - Block[1] = (uint8_t) (Value >> 8); - 304a: c9 2e mov r12, r25 - 304c: da 2e mov r13, r26 - 304e: eb 2e mov r14, r27 - 3050: ff 24 eor r15, r15 - 3052: c0 92 b9 24 sts 0x24B9, r12 - Block[2] = (uint8_t) (Value >> 16); - 3056: 8d 01 movw r16, r26 - 3058: 22 27 eor r18, r18 - 305a: 33 27 eor r19, r19 - 305c: 00 93 ba 24 sts 0x24BA, r16 - Block[3] = (uint8_t) (Value >> 24); - 3060: 4b 2f mov r20, r27 - 3062: 55 27 eor r21, r21 - 3064: 66 27 eor r22, r22 - 3066: 77 27 eor r23, r23 - 3068: 40 93 bb 24 sts 0x24BB, r20 - Block[4] = ~Block[0]; - 306c: e8 2f mov r30, r24 - 306e: e0 95 com r30 - 3070: e0 93 bc 24 sts 0x24BC, r30 - Block[5] = ~Block[1]; - 3074: ec 2d mov r30, r12 - 3076: e0 95 com r30 - 3078: e0 93 bd 24 sts 0x24BD, r30 - Block[6] = ~Block[2]; - 307c: e0 2f mov r30, r16 - 307e: e0 95 com r30 - 3080: e0 93 be 24 sts 0x24BE, r30 - Block[7] = ~Block[3]; - 3084: e4 2f mov r30, r20 - 3086: e0 95 com r30 - 3088: e0 93 bf 24 sts 0x24BF, r30 - Block[8] = Block[0]; - 308c: 80 93 c0 24 sts 0x24C0, r24 - Block[9] = Block[1]; - 3090: c0 92 c1 24 sts 0x24C1, r12 - Block[10] = Block[2]; - 3094: 00 93 c2 24 sts 0x24C2, r16 - Block[11] = Block[3]; - 3098: 40 93 c3 24 sts 0x24C3, r20 - /* Do nothing */ - } - - ValueToBlock(BlockBuffer, BlockValue); - - State = STATE_AUTHED_IDLE; - 309c: 85 e0 ldi r24, 0x05 ; 5 - 309e: 80 93 d1 24 sts 0x24D1, r24 - /* No ACK response on value commands part 2 */ - return ISO14443A_APP_NO_RESPONSE; - 30a2: 80 e0 ldi r24, 0x00 ; 0 - 30a4: 90 e0 ldi r25, 0x00 ; 0 - 30a6: db cc rjmp .-1610 ; 0x2a5e - } 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)) { - 30a8: 62 e0 ldi r22, 0x02 ; 2 - 30aa: 70 e0 ldi r23, 0x00 ; 0 - 30ac: c8 01 movw r24, r16 - 30ae: e3 d0 rcall .+454 ; 0x3276 - 30b0: 88 23 and r24, r24 - 30b2: 09 f4 brne .+2 ; 0x30b6 <__stack+0xb7> - 30b4: fc ce rjmp .-520 ; 0x2eae - CurrentAddress = Buffer[1]; - 30b6: d8 01 movw r26, r16 - 30b8: 11 96 adiw r26, 0x01 ; 1 - 30ba: 8c 91 ld r24, X - 30bc: 80 93 c8 24 sts 0x24C8, r24 - State = STATE_INCREMENT; - 30c0: 87 e0 ldi r24, 0x07 ; 7 - 30c2: 4f cf rjmp .-354 ; 0x2f62 - } 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)) { - 30c4: 62 e0 ldi r22, 0x02 ; 2 - 30c6: 70 e0 ldi r23, 0x00 ; 0 - 30c8: c8 01 movw r24, r16 - 30ca: d5 d0 rcall .+426 ; 0x3276 - 30cc: 88 23 and r24, r24 - 30ce: 09 f4 brne .+2 ; 0x30d2 <__stack+0xd3> - 30d0: fc ce rjmp .-520 ; 0x2eca - CurrentAddress = Buffer[1]; - 30d2: f8 01 movw r30, r16 - 30d4: 81 81 ldd r24, Z+1 ; 0x01 - 30d6: 80 93 c8 24 sts 0x24C8, r24 - State = STATE_RESTORE; - 30da: 89 e0 ldi r24, 0x09 ; 9 - 30dc: 80 93 d1 24 sts 0x24D1, r24 - Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); - 30e0: 85 d2 rcall .+1290 ; 0x35ec - 30e2: 9a e0 ldi r25, 0x0A ; 10 - 30e4: e6 ce rjmp .-564 ; 0x2eb2 - Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); - } - return ACK_NAK_FRAME_SIZE; - }else if (Buffer[0] == CMD_TRANSFER) { - /* Write back the global block buffer to the desired block address */ - if (ISO14443ACheckCRCA(Buffer, CMD_TRANSFER_FRAME_SIZE)) { - 30e6: 62 e0 ldi r22, 0x02 ; 2 - 30e8: 70 e0 ldi r23, 0x00 ; 0 - 30ea: c8 01 movw r24, r16 - 30ec: c4 d0 rcall .+392 ; 0x3276 - 30ee: 88 23 and r24, r24 - 30f0: 09 f4 brne .+2 ; 0x30f4 <__stack+0xf5> - 30f2: dd ce rjmp .-582 ; 0x2eae - if (!ActiveConfiguration.ReadOnly) { - 30f4: 80 91 fc 24 lds r24, 0x24FC - 30f8: 81 11 cpse r24, r1 - 30fa: 35 cf rjmp .-406 ; 0x2f66 - MemoryWriteBlock(BlockBuffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK ); - 30fc: d8 01 movw r26, r16 - 30fe: 11 96 adiw r26, 0x01 ; 1 - 3100: 6c 91 ld r22, X - 3102: b0 e1 ldi r27, 0x10 ; 16 - 3104: 6b 9f mul r22, r27 - 3106: b0 01 movw r22, r0 - 3108: 11 24 eor r1, r1 - 310a: 40 e1 ldi r20, 0x10 ; 16 - 310c: 50 e0 ldi r21, 0x00 ; 0 - 310e: 88 eb ldi r24, 0xB8 ; 184 - 3110: 94 e2 ldi r25, 0x24 ; 36 - 3112: 0e 94 ec 05 call 0xbd8 ; 0xbd8 - 3116: 27 cf rjmp .-434 ; 0x2f66 - - ValueFromBlock(&ParamValue, Buffer); - ValueFromBlock(&BlockValue, BlockBuffer); - - if (State == STATE_DECREMENT) { - BlockValue -= ParamValue; - 3118: 84 1b sub r24, r20 - 311a: 95 0b sbc r25, r21 - 311c: a6 0b sbc r26, r22 - 311e: b7 0b sbc r27, r23 - 3120: 92 cf rjmp .-220 ; 0x3046 <__stack+0x47> - return BitCount; - } else if (Buffer[0] == CMD_HALT) { - /* Halts the tag. According to the ISO14443, the second - * byte is supposed to be 0. */ - if (Buffer[1] == 0) { - if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { - 3122: 62 e0 ldi r22, 0x02 ; 2 - 3124: 70 e0 ldi r23, 0x00 ; 0 - 3126: c8 01 movw r24, r16 - 3128: a6 d0 rcall .+332 ; 0x3276 - 312a: 81 11 cpse r24, r1 - 312c: 0b cd rjmp .-1514 ; 0x2b44 - /* 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; - 312e: 81 e0 ldi r24, 0x01 ; 1 - 3130: d8 01 movw r26, r16 - 3132: 8c 93 st X, r24 - return ACK_NAK_FRAME_SIZE; - 3134: 84 e0 ldi r24, 0x04 ; 4 - 3136: 90 e0 ldi r25, 0x00 ; 0 - 3138: 92 cc rjmp .-1756 ; 0x2a5e - Buffer[i] ^= Crypto1Byte(); - - if (Buffer[0] == CMD_READ) { - if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { - /* Read command. Read data from memory and append CRCA. */ - MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); - 313a: f8 01 movw r30, r16 - 313c: 61 81 ldd r22, Z+1 ; 0x01 - 313e: f0 e1 ldi r31, 0x10 ; 16 - 3140: 6f 9f mul r22, r31 - 3142: b0 01 movw r22, r0 - 3144: 11 24 eor r1, r1 - 3146: 40 e1 ldi r20, 0x10 ; 16 - 3148: 50 e0 ldi r21, 0x00 ; 0 - 314a: c8 01 movw r24, r16 - 314c: 0e 94 d4 05 call 0xba8 ; 0xba8 - ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); - 3150: 60 e1 ldi r22, 0x10 ; 16 - 3152: 70 e0 ldi r23, 0x00 ; 0 - 3154: c8 01 movw r24, r16 - 3156: 61 d0 rcall .+194 ; 0x321a - 3158: 78 01 movw r14, r16 - 315a: 30 e8 ldi r19, 0x80 ; 128 - 315c: e3 0e add r14, r19 - 315e: f1 1c adc r15, r1 - 3160: 62 e1 ldi r22, 0x12 ; 18 - 3162: a6 2e mov r10, r22 - - /* Encrypt and calculate parity bits. */ - for (uint8_t i=0; i<(ISO14443A_CRCA_SIZE + MEM_BYTES_PER_BLOCK); i++) { - uint8_t Plain = Buffer[i]; - 3164: d8 01 movw r26, r16 - 3166: bc 90 ld r11, X - Buffer[i] = Plain ^ Crypto1Byte(); - 3168: 2e d2 rcall .+1116 ; 0x35c6 - 316a: 8b 25 eor r24, r11 - 316c: f8 01 movw r30, r16 - 316e: 81 93 st Z+, r24 - 3170: 8f 01 movw r16, r30 - Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(Plain) ^ Crypto1FilterOutput(); - 3172: 0b 2c mov r0, r11 - 3174: b2 94 swap r11 - 3176: b0 24 eor r11, r0 - 3178: 0b 2c mov r0, r11 - 317a: b6 94 lsr r11 - 317c: b6 94 lsr r11 - 317e: b0 24 eor r11, r0 - 3180: fe d0 rcall .+508 ; 0x337e - 3182: b3 94 inc r11 - 3184: b1 fa bst r11, 1 - 3186: cc 24 eor r12, r12 - 3188: c0 f8 bld r12, 0 - 318a: d1 2c mov r13, r1 - 318c: f1 e0 ldi r31, 0x01 ; 1 - 318e: cf 26 eor r12, r31 - 3190: 8c 25 eor r24, r12 - 3192: d7 01 movw r26, r14 - 3194: 8d 93 st X+, r24 - 3196: 7d 01 movw r14, r26 - 3198: aa 94 dec r10 - /* 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++) { - 319a: 21 f7 brne .-56 ; 0x3164 <__stack+0x165> - 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 ) - 319c: 80 e9 ldi r24, 0x90 ; 144 - 319e: 90 e1 ldi r25, 0x10 ; 16 - 31a0: 5e cc rjmp .-1860 ; 0x2a5e - - switch (NVB) { - case ISO14443A_NVB_AC_START: - /* Start of anticollision procedure. - * Send whole UID CLn + BCC */ - DataPtr[0] = UidCL[0]; - 31a2: 89 81 ldd r24, Y+1 ; 0x01 - 31a4: f8 01 movw r30, r16 - 31a6: 80 83 st Z, r24 - DataPtr[1] = UidCL[1]; - 31a8: 3a 81 ldd r19, Y+2 ; 0x02 - 31aa: 31 83 std Z+1, r19 ; 0x01 - DataPtr[2] = UidCL[2]; - 31ac: 2b 81 ldd r18, Y+3 ; 0x03 - 31ae: 22 83 std Z+2, r18 ; 0x02 - DataPtr[3] = UidCL[3]; - 31b0: 9c 81 ldd r25, Y+4 ; 0x04 - 31b2: 93 83 std Z+3, r25 ; 0x03 - DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); - 31b4: 83 27 eor r24, r19 - 31b6: 82 27 eor r24, r18 - 31b8: 89 27 eor r24, r25 - 31ba: 84 83 std Z+4, r24 ; 0x04 - - *BitCount = ISO14443A_CL_FRAME_SIZE; - 31bc: 88 e2 ldi r24, 0x28 ; 40 - 31be: 90 e0 ldi r25, 0x00 ; 0 - 31c0: 4e cc rjmp .-1892 ; 0x2a5e - return ACK_NAK_FRAME_SIZE; - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - /* Nested authentication. */ - uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 31c2: 60 e3 ldi r22, 0x30 ; 48 - 31c4: 70 e0 ldi r23, 0x00 ; 0 - 31c6: 14 cd rjmp .-1496 ; 0x2bf0 - return ACK_NAK_FRAME_SIZE; - } - } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { - if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { - uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; - uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); - 31c8: 80 e3 ldi r24, 0x30 ; 48 - 31ca: 90 e0 ldi r25, 0x00 ; 0 - 31cc: ae cd rjmp .-1188 ; 0x2d2a - -000031ce : - return ISO14443A_APP_NO_RESPONSE; -} - -void MifareClassicGetUid(ConfigurationUidType Uid) -{ - MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 31ce: 44 e0 ldi r20, 0x04 ; 4 - 31d0: 50 e0 ldi r21, 0x00 ; 0 - 31d2: 60 e0 ldi r22, 0x00 ; 0 - 31d4: 70 e0 ldi r23, 0x00 ; 0 - 31d6: 0c 94 d4 05 jmp 0xba8 ; 0xba8 - -000031da : -} - -void MifareClassicSetUid(ConfigurationUidType Uid) -{ - 31da: cf 93 push r28 - 31dc: df 93 push r29 - 31de: 1f 92 push r1 - 31e0: cd b7 in r28, 0x3d ; 61 - 31e2: de b7 in r29, 0x3e ; 62 - uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; - 31e4: fc 01 movw r30, r24 - 31e6: 21 81 ldd r18, Z+1 ; 0x01 - 31e8: 30 81 ld r19, Z - 31ea: 23 27 eor r18, r19 - 31ec: 32 81 ldd r19, Z+2 ; 0x02 - 31ee: 23 27 eor r18, r19 - 31f0: 33 81 ldd r19, Z+3 ; 0x03 - 31f2: 23 27 eor r18, r19 - 31f4: 29 83 std Y+1, r18 ; 0x01 - - MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); - 31f6: 44 e0 ldi r20, 0x04 ; 4 - 31f8: 50 e0 ldi r21, 0x00 ; 0 - 31fa: 60 e0 ldi r22, 0x00 ; 0 - 31fc: 70 e0 ldi r23, 0x00 ; 0 - 31fe: 0e 94 ec 05 call 0xbd8 ; 0xbd8 - MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); - 3202: 41 e0 ldi r20, 0x01 ; 1 - 3204: 50 e0 ldi r21, 0x00 ; 0 - 3206: 64 e0 ldi r22, 0x04 ; 4 - 3208: 70 e0 ldi r23, 0x00 ; 0 - 320a: ce 01 movw r24, r28 - 320c: 01 96 adiw r24, 0x01 ; 1 - 320e: 0e 94 ec 05 call 0xbd8 ; 0xbd8 -} - 3212: 0f 90 pop r0 - 3214: df 91 pop r29 - 3216: cf 91 pop r28 - 3218: 08 95 ret - -0000321a : - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - -#include "ISO14443-3A.h" - -void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { - 321a: fc 01 movw r30, r24 - uint16_t Checksum = 0x6363; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 321c: 61 15 cp r22, r1 - 321e: 71 05 cpc r23, r1 - 3220: 39 f1 breq .+78 ; 0x3270 - 3222: 68 0f add r22, r24 - 3224: 79 1f adc r23, r25 - */ - -#include "ISO14443-3A.h" - -void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { - uint16_t Checksum = 0x6363; - 3226: 23 e6 ldi r18, 0x63 ; 99 - 3228: 33 e6 ldi r19, 0x63 ; 99 - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - uint8_t Byte = *DataPtr++; - 322a: 41 91 ld r20, Z+ - - Byte ^= (uint8_t) (Checksum & 0x00FF); - 322c: 42 27 eor r20, r18 - Byte ^= Byte << 4; - 322e: 50 e1 ldi r21, 0x10 ; 16 - 3230: 45 9f mul r20, r21 - 3232: c0 01 movw r24, r0 - 3234: 11 24 eor r1, r1 - 3236: a4 2f mov r26, r20 - 3238: a8 27 eor r26, r24 - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 323a: 8a 2f mov r24, r26 - 323c: 90 e0 ldi r25, 0x00 ; 0 - 323e: 58 2f mov r21, r24 - 3240: 44 27 eor r20, r20 - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 3242: 88 0f add r24, r24 - 3244: 99 1f adc r25, r25 - 3246: 88 0f add r24, r24 - 3248: 99 1f adc r25, r25 - 324a: 88 0f add r24, r24 - 324c: 99 1f adc r25, r25 - uint8_t Byte = *DataPtr++; - - Byte ^= (uint8_t) (Checksum & 0x00FF); - Byte ^= Byte << 4; - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 324e: 48 27 eor r20, r24 - 3250: 59 27 eor r21, r25 - 3252: 23 2f mov r18, r19 - 3254: 33 27 eor r19, r19 - 3256: 24 27 eor r18, r20 - 3258: 35 27 eor r19, r21 - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 325a: a2 95 swap r26 - 325c: af 70 andi r26, 0x0F ; 15 - uint8_t Byte = *DataPtr++; - - Byte ^= (uint8_t) (Checksum & 0x00FF); - Byte ^= Byte << 4; - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 325e: 2a 27 eor r18, r26 - -void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { - uint16_t Checksum = 0x6363; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 3260: e6 17 cp r30, r22 - 3262: f7 07 cpc r31, r23 - 3264: 11 f7 brne .-60 ; 0x322a - 3266: 92 2f mov r25, r18 - 3268: 83 2f mov r24, r19 - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - } - - *DataPtr++ = (Checksum >> 0) & 0x00FF; - 326a: 90 83 st Z, r25 - *DataPtr = (Checksum >> 8) & 0x00FF; - 326c: 81 83 std Z+1, r24 ; 0x01 - 326e: 08 95 ret - -void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { - uint16_t Checksum = 0x6363; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 3270: 83 e6 ldi r24, 0x63 ; 99 - 3272: 93 e6 ldi r25, 0x63 ; 99 - 3274: fa cf rjmp .-12 ; 0x326a - -00003276 : - *DataPtr++ = (Checksum >> 0) & 0x00FF; - *DataPtr = (Checksum >> 8) & 0x00FF; -} - -bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) -{ - 3276: fc 01 movw r30, r24 - uint16_t Checksum = 0x6363; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 3278: 61 15 cp r22, r1 - 327a: 71 05 cpc r23, r1 - 327c: a9 f1 breq .+106 ; 0x32e8 - 327e: 68 0f add r22, r24 - 3280: 79 1f adc r23, r25 - *DataPtr = (Checksum >> 8) & 0x00FF; -} - -bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) -{ - uint16_t Checksum = 0x6363; - 3282: 23 e6 ldi r18, 0x63 ; 99 - 3284: 33 e6 ldi r19, 0x63 ; 99 - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - uint8_t Byte = *DataPtr++; - 3286: 41 91 ld r20, Z+ - - Byte ^= (uint8_t) (Checksum & 0x00FF); - 3288: 42 27 eor r20, r18 - Byte ^= Byte << 4; - 328a: 50 e1 ldi r21, 0x10 ; 16 - 328c: 45 9f mul r20, r21 - 328e: c0 01 movw r24, r0 - 3290: 11 24 eor r1, r1 - 3292: a4 2f mov r26, r20 - 3294: a8 27 eor r26, r24 - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 3296: 8a 2f mov r24, r26 - 3298: 90 e0 ldi r25, 0x00 ; 0 - 329a: 58 2f mov r21, r24 - 329c: 44 27 eor r20, r20 - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 329e: 88 0f add r24, r24 - 32a0: 99 1f adc r25, r25 - 32a2: 88 0f add r24, r24 - 32a4: 99 1f adc r25, r25 - 32a6: 88 0f add r24, r24 - 32a8: 99 1f adc r25, r25 - uint8_t Byte = *DataPtr++; - - Byte ^= (uint8_t) (Checksum & 0x00FF); - Byte ^= Byte << 4; - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 32aa: 48 27 eor r20, r24 - 32ac: 59 27 eor r21, r25 - 32ae: 23 2f mov r18, r19 - 32b0: 33 27 eor r19, r19 - 32b2: 24 27 eor r18, r20 - 32b4: 35 27 eor r19, r21 - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - 32b6: a2 95 swap r26 - 32b8: af 70 andi r26, 0x0F ; 15 - uint8_t Byte = *DataPtr++; - - Byte ^= (uint8_t) (Checksum & 0x00FF); - Byte ^= Byte << 4; - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - 32ba: 2a 27 eor r18, r26 -bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) -{ - uint16_t Checksum = 0x6363; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 32bc: e6 17 cp r30, r22 - 32be: f7 07 cpc r31, r23 - 32c0: 11 f7 brne .-60 ; 0x3286 - 32c2: a9 01 movw r20, r18 - 32c4: 55 27 eor r21, r21 - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - } - - return (DataPtr[0] == ((Checksum >> 0) & 0xFF)) && (DataPtr[1] == ((Checksum >> 8) & 0xFF)); - 32c6: 80 81 ld r24, Z - 32c8: 90 e0 ldi r25, 0x00 ; 0 - 32ca: 84 17 cp r24, r20 - 32cc: 95 07 cpc r25, r21 - 32ce: 11 f0 breq .+4 ; 0x32d4 - 32d0: 80 e0 ldi r24, 0x00 ; 0 -} - 32d2: 08 95 ret - - Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ - ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); - } - - return (DataPtr[0] == ((Checksum >> 0) & 0xFF)) && (DataPtr[1] == ((Checksum >> 8) & 0xFF)); - 32d4: 41 81 ldd r20, Z+1 ; 0x01 - 32d6: 50 e0 ldi r21, 0x00 ; 0 - 32d8: 23 2f mov r18, r19 - 32da: 33 27 eor r19, r19 - 32dc: 81 e0 ldi r24, 0x01 ; 1 - 32de: 42 17 cp r20, r18 - 32e0: 53 07 cpc r21, r19 - 32e2: b9 f3 breq .-18 ; 0x32d2 - 32e4: 80 e0 ldi r24, 0x00 ; 0 - 32e6: f5 cf rjmp .-22 ; 0x32d2 -bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) -{ - uint16_t Checksum = 0x6363; - uint8_t* DataPtr = (uint8_t*) Buffer; - - while(ByteCount--) { - 32e8: 43 e6 ldi r20, 0x63 ; 99 - 32ea: 50 e0 ldi r21, 0x00 ; 0 - *DataPtr = (Checksum >> 8) & 0x00FF; -} - -bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) -{ - uint16_t Checksum = 0x6363; - 32ec: 23 e6 ldi r18, 0x63 ; 99 - 32ee: 33 e6 ldi r19, 0x63 ; 99 - 32f0: ea cf rjmp .-44 ; 0x32c6 - -000032f2 : -/* Split Crypto1 state into even and odd bits to speed up the output filter network */ -static uint8_t StateEven[LFSR_SIZE/2] = {0}; -static uint8_t StateOdd[LFSR_SIZE/2] = {0}; - -/* Proceed LFSR by one clock cycle */ -static void Crypto1LFSR(uint8_t In) { - 32f2: cf 93 push r28 - uint8_t Feedback = 0; - - /* Calculate feedback according to LFSR taps. XOR all 6 state bytes - * into a single bit. */ - Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); - 32f4: b0 91 d5 24 lds r27, 0x24D5 - Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); - 32f8: c0 91 d6 24 lds r28, 0x24D6 - Feedback ^= StateEven[2] & (uint8_t) (LFSR_MASK_EVEN >> 16); - 32fc: 40 91 d7 24 lds r20, 0x24D7 - - Feedback ^= StateOdd[0] & (uint8_t) (LFSR_MASK_ODD >> 0); - 3300: a0 91 d2 24 lds r26, 0x24D2 - Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); - 3304: f0 91 d3 24 lds r31, 0x24D3 - Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); - 3308: e0 91 d4 24 lds r30, 0x24D4 - uint8_t Feedback = 0; - - /* Calculate feedback according to LFSR taps. XOR all 6 state bytes - * into a single bit. */ - Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); - Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); - 330c: 9c 2f mov r25, r28 - 330e: 90 71 andi r25, 0x10 ; 16 -static void Crypto1LFSR(uint8_t In) { - uint8_t Feedback = 0; - - /* Calculate feedback according to LFSR taps. XOR all 6 state bytes - * into a single bit. */ - Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); - 3310: 2b 2f mov r18, r27 - 3312: 21 7e andi r18, 0xE1 ; 225 - Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); - 3314: 92 27 eor r25, r18 - Feedback ^= StateEven[2] & (uint8_t) (LFSR_MASK_EVEN >> 16); - 3316: 24 2f mov r18, r20 - 3318: 20 72 andi r18, 0x20 ; 32 - 331a: 92 27 eor r25, r18 - - Feedback ^= StateOdd[0] & (uint8_t) (LFSR_MASK_ODD >> 0); - 331c: 2a 2f mov r18, r26 - 331e: 24 79 andi r18, 0x94 ; 148 - 3320: 92 27 eor r25, r18 - Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); - 3322: 2f 2f mov r18, r31 - 3324: 23 77 andi r18, 0x73 ; 115 - 3326: 92 27 eor r25, r18 - Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); - 3328: 2e 2f mov r18, r30 - 332a: 2a 73 andi r18, 0x3A ; 58 - 332c: 92 27 eor r25, r18 - - Feedback ^= Feedback >> 4; - 332e: 39 2f mov r19, r25 - 3330: 32 95 swap r19 - 3332: 3f 70 andi r19, 0x0F ; 15 - 3334: 39 27 eor r19, r25 - Feedback ^= Feedback >> 2; - 3336: 23 2f mov r18, r19 - 3338: 26 95 lsr r18 - 333a: 26 95 lsr r18 - 333c: 23 27 eor r18, r19 - Feedback ^= Feedback >> 1; - 333e: 92 2f mov r25, r18 - 3340: 96 95 lsr r25 - * - the new odd state becomes the old even state right-shifted by 1. - * For shifting the even state, we convert it into a 32 bit int first */ - uint32_t Temp = 0; - Temp |= ((uint32_t) StateEven[0] << 0); - Temp |= ((uint32_t) StateEven[1] << 8); - Temp |= ((uint32_t) StateEven[2] << 16); - 3342: 50 e0 ldi r21, 0x00 ; 0 - 3344: 60 e0 ldi r22, 0x00 ; 0 - 3346: 70 e0 ldi r23, 0x00 ; 0 - 3348: ba 01 movw r22, r20 - 334a: 55 27 eor r21, r21 - 334c: 44 27 eor r20, r20 - * - the new even state becomes the old odd state - * - the new odd state becomes the old even state right-shifted by 1. - * For shifting the even state, we convert it into a 32 bit int first */ - uint32_t Temp = 0; - Temp |= ((uint32_t) StateEven[0] << 0); - Temp |= ((uint32_t) StateEven[1] << 8); - 334e: 5c 2b or r21, r28 - Temp |= ((uint32_t) StateEven[2] << 16); - 3350: 4b 2b or r20, r27 - - /* Proceed LFSR. Try to force compiler not to shift the unneded upper bits. */ - Temp = (Temp >> 1) & 0x00FFFFFF; - 3352: 76 95 lsr r23 - 3354: 67 95 ror r22 - 3356: 57 95 ror r21 - 3358: 47 95 ror r20 - Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); - Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); - - Feedback ^= Feedback >> 4; - Feedback ^= Feedback >> 2; - Feedback ^= Feedback >> 1; - 335a: 92 27 eor r25, r18 - - /* Proceed LFSR. Try to force compiler not to shift the unneded upper bits. */ - Temp = (Temp >> 1) & 0x00FFFFFF; - - /* Calculate MSBit of even state as input bit to LFSR */ - if ( (Feedback & 0x01) ^ In ) { - 335c: 91 70 andi r25, 0x01 ; 1 - 335e: 98 13 cpse r25, r24 - Temp |= (uint32_t) 1 << (8 * LFSR_SIZE/2 - 1); - 3360: 60 68 ori r22, 0x80 ; 128 - } - - /* Convert even state back into byte array and swap odd/even state - * as explained above. */ - StateEven[0] = StateOdd[0]; - 3362: a0 93 d5 24 sts 0x24D5, r26 - StateEven[1] = StateOdd[1]; - 3366: f0 93 d6 24 sts 0x24D6, r31 - StateEven[2] = StateOdd[2]; - 336a: e0 93 d7 24 sts 0x24D7, r30 - - StateOdd[0] = (uint8_t) (Temp >> 0); - 336e: 40 93 d2 24 sts 0x24D2, r20 - StateOdd[1] = (uint8_t) (Temp >> 8); - 3372: 50 93 d3 24 sts 0x24D3, r21 - StateOdd[2] = (uint8_t) (Temp >> 16); - 3376: 60 93 d4 24 sts 0x24D4, r22 -} - 337a: cf 91 pop r28 - 337c: 08 95 ret - -0000337e : - -uint8_t Crypto1FilterOutput(void) { - 337e: cf 93 push r28 - 3380: df 93 push r29 - * 5 bits that are used to lookup the output bit. - */ - uint8_t Sum = 0; - - Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; - Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; - 3382: a0 91 d3 24 lds r26, 0x24D3 - 3386: ea 2f mov r30, r26 - 3388: ef 70 andi r30, 0x0F ; 15 - 338a: f0 e0 ldi r31, 0x00 ; 0 - 338c: e0 5c subi r30, 0xC0 ; 192 - 338e: ff 4d sbci r31, 0xDF ; 223 - * can simply be ORed together to produce the resulting - * 5 bits that are used to lookup the output bit. - */ - uint8_t Sum = 0; - - Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; - 3390: c0 91 d2 24 lds r28, 0x24D2 - 3394: c2 95 swap r28 - 3396: cf 70 andi r28, 0x0F ; 15 - 3398: d0 e0 ldi r29, 0x00 ; 0 - 339a: c0 5c subi r28, 0xC0 ; 192 - 339c: df 4d sbci r29, 0xDF ; 223 - Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; - 339e: e0 89 ldd r30, Z+16 ; 0x10 - 33a0: 88 81 ld r24, Y - 33a2: e8 2b or r30, r24 - Sum |= TableAB[2][(StateOdd[1] >> 4) & 0x0F]; - 33a4: a2 95 swap r26 - 33a6: af 70 andi r26, 0x0F ; 15 - 33a8: b0 e0 ldi r27, 0x00 ; 0 - 33aa: a0 5c subi r26, 0xC0 ; 192 - 33ac: bf 4d sbci r27, 0xDF ; 223 - 33ae: 90 96 adiw r26, 0x20 ; 32 - 33b0: 8c 91 ld r24, X - 33b2: e8 2b or r30, r24 - Sum |= TableAB[3][(StateOdd[2] >> 0) & 0x0F]; - 33b4: a0 91 d4 24 lds r26, 0x24D4 - 33b8: ca 2f mov r28, r26 - 33ba: cf 70 andi r28, 0x0F ; 15 - 33bc: d0 e0 ldi r29, 0x00 ; 0 - 33be: c0 5c subi r28, 0xC0 ; 192 - 33c0: df 4d sbci r29, 0xDF ; 223 - 33c2: 88 a9 ldd r24, Y+48 ; 0x30 - 33c4: e8 2b or r30, r24 - Sum |= TableAB[4][(StateOdd[2] >> 4) & 0x0F]; - 33c6: a2 95 swap r26 - 33c8: af 70 andi r26, 0x0F ; 15 - 33ca: b0 e0 ldi r27, 0x00 ; 0 - 33cc: a0 58 subi r26, 0x80 ; 128 - 33ce: bf 4d sbci r27, 0xDF ; 223 - 33d0: 8c 91 ld r24, X - 33d2: e8 2b or r30, r24 - - return TableC[Sum]; - 33d4: f0 e0 ldi r31, 0x00 ; 0 - 33d6: e0 5e subi r30, 0xE0 ; 224 - 33d8: ff 4d sbci r31, 0xDF ; 223 -} - 33da: 80 81 ld r24, Z - 33dc: df 91 pop r29 - 33de: cf 91 pop r28 - 33e0: 08 95 ret - -000033e2 : - -void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]) -{ - 33e2: af 92 push r10 - 33e4: bf 92 push r11 - 33e6: cf 92 push r12 - 33e8: df 92 push r13 - 33ea: ef 92 push r14 - 33ec: ff 92 push r15 - 33ee: 0f 93 push r16 - 33f0: 1f 93 push r17 - 33f2: cf 93 push r28 - 33f4: df 93 push r29 - 33f6: 5b 01 movw r10, r22 - 33f8: ea 01 movw r28, r20 - 33fa: dc 01 movw r26, r24 - 33fc: 11 96 adiw r26, 0x01 ; 1 - 33fe: 45 ed ldi r20, 0xD5 ; 213 - 3400: 54 e2 ldi r21, 0x24 ; 36 - 3402: 62 ed ldi r22, 0xD2 ; 210 - 3404: 74 e2 ldi r23, 0x24 ; 36 - 3406: cd 01 movw r24, r26 - 3408: 01 97 sbiw r24, 0x01 ; 1 - * The inner loop generates 8 even and 8 odd bits from 16 key bits and - * the outer loop stores them. */ - for (i=0; i<(LFSR_SIZE/2); i++) { - uint8_t EvenByte = 0; - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - 340a: fc 01 movw r30, r24 - 340c: 20 81 ld r18, Z - 340e: 8c 91 ld r24, X - 3410: 30 e0 ldi r19, 0x00 ; 0 - 3412: 38 2b or r19, r24 - 3414: 20 ff sbrs r18, 0 - 3416: b0 c0 rjmp .+352 ; 0x3578 - 3418: 00 e4 ldi r16, 0x40 ; 64 - 341a: 21 ff sbrs r18, 1 - 341c: ab c0 rjmp .+342 ; 0x3574 - 341e: 10 e4 ldi r17, 0x40 ; 64 - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - } - - KeyWord >>= 2; - 3420: c9 01 movw r24, r18 - 3422: 96 95 lsr r25 - 3424: 87 95 ror r24 - 3426: 96 95 lsr r25 - 3428: 87 95 ror r24 - for (j=0; j<8; j++) { - EvenByte >>= 1; - OddByte >>= 1; - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 342a: 30 2f mov r19, r16 - 342c: 30 68 ori r19, 0x80 ; 128 - 342e: 80 ff sbrs r24, 0 - 3430: 30 2f mov r19, r16 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 3432: 21 2f mov r18, r17 - 3434: 20 68 ori r18, 0x80 ; 128 - 3436: 81 ff sbrs r24, 1 - 3438: 21 2f mov r18, r17 - } - - KeyWord >>= 2; - 343a: 96 95 lsr r25 - 343c: 87 95 ror r24 - 343e: 96 95 lsr r25 - 3440: 87 95 ror r24 - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - uint8_t j; - - for (j=0; j<8; j++) { - EvenByte >>= 1; - 3442: 36 95 lsr r19 - OddByte >>= 1; - 3444: 26 95 lsr r18 - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 3446: 13 2f mov r17, r19 - 3448: 10 68 ori r17, 0x80 ; 128 - 344a: 80 fd sbrc r24, 0 - 344c: 31 2f mov r19, r17 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 344e: 12 2f mov r17, r18 - 3450: 10 68 ori r17, 0x80 ; 128 - 3452: 81 fd sbrc r24, 1 - 3454: 21 2f mov r18, r17 - } - - KeyWord >>= 2; - 3456: 96 95 lsr r25 - 3458: 87 95 ror r24 - 345a: 96 95 lsr r25 - 345c: 87 95 ror r24 - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - uint8_t j; - - for (j=0; j<8; j++) { - EvenByte >>= 1; - 345e: 36 95 lsr r19 - OddByte >>= 1; - 3460: 26 95 lsr r18 - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 3462: 13 2f mov r17, r19 - 3464: 10 68 ori r17, 0x80 ; 128 - 3466: 80 fd sbrc r24, 0 - 3468: 31 2f mov r19, r17 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 346a: 12 2f mov r17, r18 - 346c: 10 68 ori r17, 0x80 ; 128 - 346e: 81 fd sbrc r24, 1 - 3470: 21 2f mov r18, r17 - } - - KeyWord >>= 2; - 3472: 96 95 lsr r25 - 3474: 87 95 ror r24 - 3476: 96 95 lsr r25 - 3478: 87 95 ror r24 - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - uint8_t j; - - for (j=0; j<8; j++) { - EvenByte >>= 1; - 347a: 36 95 lsr r19 - OddByte >>= 1; - 347c: 26 95 lsr r18 - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 347e: 13 2f mov r17, r19 - 3480: 10 68 ori r17, 0x80 ; 128 - 3482: 80 fd sbrc r24, 0 - 3484: 31 2f mov r19, r17 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 3486: 12 2f mov r17, r18 - 3488: 10 68 ori r17, 0x80 ; 128 - 348a: 81 fd sbrc r24, 1 - 348c: 21 2f mov r18, r17 - } - - KeyWord >>= 2; - 348e: 96 95 lsr r25 - 3490: 87 95 ror r24 - 3492: 96 95 lsr r25 - 3494: 87 95 ror r24 - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - uint8_t j; - - for (j=0; j<8; j++) { - EvenByte >>= 1; - 3496: 36 95 lsr r19 - OddByte >>= 1; - 3498: 26 95 lsr r18 - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 349a: 13 2f mov r17, r19 - 349c: 10 68 ori r17, 0x80 ; 128 - 349e: 80 fd sbrc r24, 0 - 34a0: 31 2f mov r19, r17 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 34a2: 12 2f mov r17, r18 - 34a4: 10 68 ori r17, 0x80 ; 128 - 34a6: 81 fd sbrc r24, 1 - 34a8: 21 2f mov r18, r17 - } - - KeyWord >>= 2; - 34aa: 96 95 lsr r25 - 34ac: 87 95 ror r24 - 34ae: 96 95 lsr r25 - 34b0: 87 95 ror r24 - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - uint8_t j; - - for (j=0; j<8; j++) { - EvenByte >>= 1; - 34b2: 36 95 lsr r19 - OddByte >>= 1; - 34b4: 26 95 lsr r18 - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 34b6: 13 2f mov r17, r19 - 34b8: 10 68 ori r17, 0x80 ; 128 - 34ba: 80 fd sbrc r24, 0 - 34bc: 31 2f mov r19, r17 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 34be: 12 2f mov r17, r18 - 34c0: 10 68 ori r17, 0x80 ; 128 - 34c2: 81 fd sbrc r24, 1 - 34c4: 21 2f mov r18, r17 - } - - KeyWord >>= 2; - 34c6: 96 95 lsr r25 - 34c8: 87 95 ror r24 - 34ca: 96 95 lsr r25 - 34cc: 87 95 ror r24 - uint8_t OddByte = 0; - uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; - uint8_t j; - - for (j=0; j<8; j++) { - EvenByte >>= 1; - 34ce: 36 95 lsr r19 - OddByte >>= 1; - 34d0: 26 95 lsr r18 - - if (KeyWord & (1<<0)) { - EvenByte |= 0x80; - 34d2: 03 2f mov r16, r19 - 34d4: 00 68 ori r16, 0x80 ; 128 - } - - if (KeyWord & (1<<1)) { - OddByte |= 0x80; - 34d6: 12 2f mov r17, r18 - 34d8: 10 68 ori r17, 0x80 ; 128 - 34da: 80 fd sbrc r24, 0 - 34dc: 30 2f mov r19, r16 - } - - KeyWord >>= 2; - } - - StateEven[i] = EvenByte; - 34de: fa 01 movw r30, r20 - 34e0: 31 93 st Z+, r19 - 34e2: af 01 movw r20, r30 - 34e4: 81 fd sbrc r24, 1 - 34e6: 21 2f mov r18, r17 - StateOdd[i] = OddByte; - 34e8: fb 01 movw r30, r22 - 34ea: 21 93 st Z+, r18 - 34ec: bf 01 movw r22, r30 - 34ee: 12 96 adiw r26, 0x02 ; 2 - - /* Again, one trade off when splitting up the state into even/odd parts - * is that loading the key into the state becomes a little more difficult. - * The inner loop generates 8 even and 8 odd bits from 16 key bits and - * the outer loop stores them. */ - for (i=0; i<(LFSR_SIZE/2); i++) { - 34f0: f4 e2 ldi r31, 0x24 ; 36 - 34f2: 48 3d cpi r20, 0xD8 ; 216 - 34f4: 5f 07 cpc r21, r31 - 34f6: 09 f0 breq .+2 ; 0x34fa - 34f8: 86 cf rjmp .-244 ; 0x3406 - /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the - * Crypto1 LFSR.*/ - uint32_t Temp = 0; - - Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; - Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; - 34fa: f5 01 movw r30, r10 - 34fc: 81 81 ldd r24, Z+1 ; 0x01 - 34fe: 99 81 ldd r25, Y+1 ; 0x01 - 3500: 89 27 eor r24, r25 - Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; - 3502: c2 80 ldd r12, Z+2 ; 0x02 - 3504: 9a 81 ldd r25, Y+2 ; 0x02 - 3506: c9 26 eor r12, r25 - 3508: d1 2c mov r13, r1 - 350a: e1 2c mov r14, r1 - 350c: f1 2c mov r15, r1 - 350e: 76 01 movw r14, r12 - 3510: dd 24 eor r13, r13 - 3512: cc 24 eor r12, r12 - /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the - * Crypto1 LFSR.*/ - uint32_t Temp = 0; - - Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; - Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; - 3514: d8 2a or r13, r24 - - /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the - * Crypto1 LFSR.*/ - uint32_t Temp = 0; - - Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; - 3516: 80 81 ld r24, Z - 3518: 98 81 ld r25, Y - 351a: 89 27 eor r24, r25 - Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; - Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; - 351c: c8 2a or r12, r24 - Temp |= (uint32_t) (Uid[3] ^ CardNonce[3]) << 24; - 351e: 83 81 ldd r24, Z+3 ; 0x03 - 3520: 9b 81 ldd r25, Y+3 ; 0x03 - 3522: 89 27 eor r24, r25 - 3524: f8 2a or r15, r24 - 3526: 10 e2 ldi r17, 0x20 ; 32 - - for (i=0; i<32; i++) { - uint8_t Out = Crypto1FilterOutput(); - 3528: 2a df rcall .-428 ; 0x337e - 352a: 08 2f mov r16, r24 - - Crypto1LFSR(Temp & 0x01); - 352c: 8c 2d mov r24, r12 - 352e: 81 70 andi r24, 0x01 ; 1 - 3530: e0 de rcall .-576 ; 0x32f2 - Temp >>= 1; - 3532: f6 94 lsr r15 - 3534: e7 94 ror r14 - 3536: d7 94 ror r13 - 3538: c7 94 ror r12 - - /* Store the keystream for later use */ - if (Out) { - 353a: 00 23 and r16, r16 - 353c: 11 f0 breq .+4 ; 0x3542 - Temp |= (uint32_t) 1 << 31; - 353e: 68 94 set - 3540: f7 f8 bld r15, 7 - 3542: 11 50 subi r17, 0x01 ; 1 - Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; - Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; - Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; - Temp |= (uint32_t) (Uid[3] ^ CardNonce[3]) << 24; - - for (i=0; i<32; i++) { - 3544: 89 f7 brne .-30 ; 0x3528 - } - - /* Crypto1 state register is now set up to be used for authentication. - * In case of nested authentication, we need to use the produced keystream - * to encrypt the CardNonce. For this case we do the encryption in-place. */ - CardNonce[0] ^= (uint8_t) (Temp >> 0); - 3546: 88 81 ld r24, Y - 3548: 8c 25 eor r24, r12 - 354a: 88 83 st Y, r24 - CardNonce[1] ^= (uint8_t) (Temp >> 8); - 354c: 89 81 ldd r24, Y+1 ; 0x01 - 354e: 8d 25 eor r24, r13 - 3550: 89 83 std Y+1, r24 ; 0x01 - CardNonce[2] ^= (uint8_t) (Temp >> 16); - 3552: 8a 81 ldd r24, Y+2 ; 0x02 - 3554: 8e 25 eor r24, r14 - 3556: 8a 83 std Y+2, r24 ; 0x02 - CardNonce[3] ^= (uint8_t) (Temp >> 24); - 3558: 8b 81 ldd r24, Y+3 ; 0x03 - 355a: 8f 25 eor r24, r15 - 355c: 8b 83 std Y+3, r24 ; 0x03 -} - 355e: df 91 pop r29 - 3560: cf 91 pop r28 - 3562: 1f 91 pop r17 - 3564: 0f 91 pop r16 - 3566: ff 90 pop r15 - 3568: ef 90 pop r14 - 356a: df 90 pop r13 - 356c: cf 90 pop r12 - 356e: bf 90 pop r11 - 3570: af 90 pop r10 - 3572: 08 95 ret - 3574: 10 e0 ldi r17, 0x00 ; 0 - 3576: 54 cf rjmp .-344 ; 0x3420 - 3578: 00 e0 ldi r16, 0x00 ; 0 - 357a: 4f cf rjmp .-354 ; 0x341a - -0000357c : - -void Crypto1Auth(uint8_t EncryptedReaderNonce[4]) -{ - 357c: cf 92 push r12 - 357e: df 92 push r13 - 3580: ef 92 push r14 - 3582: ff 92 push r15 - 3584: cf 93 push r28 - 3586: fc 01 movw r30, r24 - uint32_t Temp = 0; - - /* For ease of processing, we convert the encrypted reader nonce - * into a 32 bit integer */ - Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; - Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; - 3588: 81 81 ldd r24, Z+1 ; 0x01 - Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; - 358a: c2 80 ldd r12, Z+2 ; 0x02 - 358c: d1 2c mov r13, r1 - 358e: e1 2c mov r14, r1 - 3590: f1 2c mov r15, r1 - 3592: 76 01 movw r14, r12 - 3594: dd 24 eor r13, r13 - 3596: cc 24 eor r12, r12 - uint32_t Temp = 0; - - /* For ease of processing, we convert the encrypted reader nonce - * into a 32 bit integer */ - Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; - Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; - 3598: d8 2a or r13, r24 -{ - uint32_t Temp = 0; - - /* For ease of processing, we convert the encrypted reader nonce - * into a 32 bit integer */ - Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; - 359a: 80 81 ld r24, Z - Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; - Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; - 359c: c8 2a or r12, r24 - Temp |= (uint32_t) EncryptedReaderNonce[3] << 24; - 359e: 83 81 ldd r24, Z+3 ; 0x03 - 35a0: f8 2a or r15, r24 - 35a2: c0 e2 ldi r28, 0x20 ; 32 - uint8_t i; - - for (i=0; i<32; i++) { - /* Decrypt one output bit of the given encrypted nonce using the - * filter output as keystream. */ - uint8_t Out = Crypto1FilterOutput(); - 35a4: ec de rcall .-552 ; 0x337e - uint8_t Bit = Out ^ (Temp & 0x01); - 35a6: 9c 2d mov r25, r12 - 35a8: 91 70 andi r25, 0x01 ; 1 - - /* Feed back the bit to load the LFSR with the (decrypted) nonce */ - Crypto1LFSR(Bit); - 35aa: 89 27 eor r24, r25 - 35ac: a2 de rcall .-700 ; 0x32f2 - Temp >>= 1; - 35ae: f6 94 lsr r15 - 35b0: e7 94 ror r14 - 35b2: d7 94 ror r13 - 35b4: c7 94 ror r12 - 35b6: c1 50 subi r28, 0x01 ; 1 - Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; - Temp |= (uint32_t) EncryptedReaderNonce[3] << 24; - - uint8_t i; - - for (i=0; i<32; i++) { - 35b8: a9 f7 brne .-22 ; 0x35a4 - - /* Feed back the bit to load the LFSR with the (decrypted) nonce */ - Crypto1LFSR(Bit); - Temp >>= 1; - } -} - 35ba: cf 91 pop r28 - 35bc: ff 90 pop r15 - 35be: ef 90 pop r14 - 35c0: df 90 pop r13 - 35c2: cf 90 pop r12 - 35c4: 08 95 ret - -000035c6 : - -uint8_t Crypto1Byte(void) -{ - 35c6: 1f 93 push r17 - 35c8: cf 93 push r28 - 35ca: df 93 push r29 - 35cc: d8 e0 ldi r29, 0x08 ; 8 - uint8_t KeyStream = 0; - 35ce: c0 e0 ldi r28, 0x00 ; 0 - /* Generate 8 keystream-bits */ - for (i=0; i<8; i++) { - - /* Calculate output of function-network and cycle LFSR with no - * additional input, thus linearly! */ - uint8_t Out = Crypto1FilterOutput(); - 35d0: d6 de rcall .-596 ; 0x337e - 35d2: 18 2f mov r17, r24 - Crypto1LFSR(0); - 35d4: 80 e0 ldi r24, 0x00 ; 0 - 35d6: 8d de rcall .-742 ; 0x32f2 - - /* Store keystream bit */ - KeyStream >>= 1; - 35d8: c6 95 lsr r28 - - if (Out) { - 35da: 11 11 cpse r17, r1 - KeyStream |= (1<<7); - 35dc: c0 68 ori r28, 0x80 ; 128 - 35de: d1 50 subi r29, 0x01 ; 1 -{ - uint8_t KeyStream = 0; - uint8_t i; - - /* Generate 8 keystream-bits */ - for (i=0; i<8; i++) { - 35e0: b9 f7 brne .-18 ; 0x35d0 - KeyStream |= (1<<7); - } - } - - return KeyStream; -} - 35e2: 8c 2f mov r24, r28 - 35e4: df 91 pop r29 - 35e6: cf 91 pop r28 - 35e8: 1f 91 pop r17 - 35ea: 08 95 ret - -000035ec : - -uint8_t Crypto1Nibble(void) -{ - 35ec: 1f 93 push r17 - 35ee: cf 93 push r28 - 35f0: df 93 push r29 - 35f2: d4 e0 ldi r29, 0x04 ; 4 - uint8_t KeyStream = 0; - 35f4: c0 e0 ldi r28, 0x00 ; 0 - /* Generate 4 keystream-bits */ - for (i=0; i<4; i++) { - - /* Calculate output of function-network and cycle LFSR with no - * additional input, thus linearly! */ - uint8_t Out = Crypto1FilterOutput(); - 35f6: c3 de rcall .-634 ; 0x337e - 35f8: 18 2f mov r17, r24 - Crypto1LFSR(0); - 35fa: 80 e0 ldi r24, 0x00 ; 0 - 35fc: 7a de rcall .-780 ; 0x32f2 - - /* Store keystream bit */ - KeyStream >>= 1; - 35fe: c6 95 lsr r28 - - if (Out) { - 3600: 11 11 cpse r17, r1 - KeyStream |= (1<<3); - 3602: c8 60 ori r28, 0x08 ; 8 - 3604: d1 50 subi r29, 0x01 ; 1 -{ - uint8_t KeyStream = 0; - uint8_t i; - - /* Generate 4 keystream-bits */ - for (i=0; i<4; i++) { - 3606: b9 f7 brne .-18 ; 0x35f6 - KeyStream |= (1<<3); - } - } - - return KeyStream; -} - 3608: 8c 2f mov r24, r28 - 360a: df 91 pop r29 - 360c: cf 91 pop r28 - 360e: 1f 91 pop r17 - 3610: 08 95 ret - -00003612 : - -void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) -{ - 3612: 8f 92 push r8 - 3614: 9f 92 push r9 - 3616: af 92 push r10 - 3618: bf 92 push r11 - 361a: cf 92 push r12 - 361c: df 92 push r13 - 361e: ef 92 push r14 - 3620: ff 92 push r15 - 3622: 0f 93 push r16 - 3624: 1f 93 push r17 - 3626: fc 01 movw r30, r24 - while(ClockCount--) { - 3628: cb 01 movw r24, r22 - 362a: 01 97 sbiw r24, 0x01 ; 1 - 362c: 67 2b or r22, r23 - 362e: b1 f1 breq .+108 ; 0x369c - 3630: b2 81 ldd r27, Z+2 ; 0x02 - 3632: a0 81 ld r26, Z - 3634: 81 80 ldd r8, Z+1 ; 0x01 - 3636: 03 81 ldd r16, Z+3 ; 0x03 - 3638: 02 c0 rjmp .+4 ; 0x363e - 363a: a4 2f mov r26, r20 - 363c: bc 2d mov r27, r12 - * 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); - 363e: 2b 2f mov r18, r27 - 3640: 2d 72 andi r18, 0x2D ; 45 - Feedback ^= State[3] & (uint8_t) (PRNG_MASK >> 24); - - Feedback ^= Feedback >> 4; - 3642: 32 2f mov r19, r18 - 3644: 32 95 swap r19 - 3646: 3f 70 andi r19, 0x0F ; 15 - 3648: 32 27 eor r19, r18 - Feedback ^= Feedback >> 2; - 364a: 23 2f mov r18, r19 - 364c: 26 95 lsr r18 - 364e: 26 95 lsr r18 - 3650: 23 27 eor r18, r19 - Feedback ^= Feedback >> 1; - 3652: 32 2f mov r19, r18 - 3654: 36 95 lsr r19 - uint32_t Temp = 0; - - Temp |= (uint32_t) State[0] << 0; - Temp |= (uint32_t) State[1] << 8; - Temp |= (uint32_t) State[2] << 16; - Temp |= (uint32_t) State[3] << 24; - 3656: 40 2f mov r20, r16 - 3658: 50 e0 ldi r21, 0x00 ; 0 - 365a: 60 e0 ldi r22, 0x00 ; 0 - 365c: 70 e0 ldi r23, 0x00 ; 0 - 365e: 74 2f mov r23, r20 - 3660: 66 27 eor r22, r22 - 3662: 55 27 eor r21, r21 - 3664: 44 27 eor r20, r20 - - /* For ease of processing convert the state into a 32 bit integer first */ - uint32_t Temp = 0; - - Temp |= (uint32_t) State[0] << 0; - Temp |= (uint32_t) State[1] << 8; - 3666: 58 29 or r21, r8 - Temp |= (uint32_t) State[2] << 16; - 3668: 4a 2b or r20, r26 - Temp |= (uint32_t) State[3] << 24; - 366a: 6b 2b or r22, r27 - - /* Cycle LFSR and feed back. */ - Temp >>= 1; - 366c: 76 95 lsr r23 - 366e: 67 95 ror r22 - 3670: 57 95 ror r21 - 3672: 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; - 3674: 32 27 eor r19, r18 - Temp |= (uint32_t) State[3] << 24; - - /* Cycle LFSR and feed back. */ - Temp >>= 1; - - if (Feedback & 0x01) { - 3676: 30 fd sbrc r19, 0 - Temp |= (uint32_t) 1 << (8 * PRNG_SIZE - 1); - 3678: 70 68 ori r23, 0x80 ; 128 - } - - /* Store back state */ - State[0] = (uint8_t) (Temp >> 0); - State[1] = (uint8_t) (Temp >> 8); - 367a: 85 2e mov r8, r21 - 367c: 96 2e mov r9, r22 - 367e: a7 2e mov r10, r23 - 3680: bb 24 eor r11, r11 - State[2] = (uint8_t) (Temp >> 16); - 3682: 6b 01 movw r12, r22 - 3684: ee 24 eor r14, r14 - 3686: ff 24 eor r15, r15 - State[3] = (uint8_t) (Temp >> 24); - 3688: 07 2f mov r16, r23 - 368a: 11 27 eor r17, r17 - 368c: 22 27 eor r18, r18 - 368e: 33 27 eor r19, r19 - return KeyStream; -} - -void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) -{ - while(ClockCount--) { - 3690: 01 97 sbiw r24, 0x01 ; 1 - 3692: 98 f6 brcc .-90 ; 0x363a - 3694: 40 83 st Z, r20 - 3696: 81 82 std Z+1, r8 ; 0x01 - 3698: c2 82 std Z+2, r12 ; 0x02 - 369a: 03 83 std Z+3, r16 ; 0x03 - State[2] = (uint8_t) (Temp >> 16); - State[3] = (uint8_t) (Temp >> 24); - } - - -} - 369c: 1f 91 pop r17 - 369e: 0f 91 pop r16 - 36a0: ff 90 pop r15 - 36a2: ef 90 pop r14 - 36a4: df 90 pop r13 - 36a6: cf 90 pop r12 - 36a8: bf 90 pop r11 - 36aa: af 90 pop r10 - 36ac: 9f 90 pop r9 - 36ae: 8f 90 pop r8 - 36b0: 08 95 ret - -000036b2 : -#if !defined(NO_DEVICE_REMOTE_WAKEUP) -bool USB_Device_RemoteWakeupEnabled; -#endif - -void USB_Device_ProcessControlRequest(void) -{ - 36b2: 0f 93 push r16 - 36b4: 1f 93 push r17 - 36b6: cf 93 push r28 - 36b8: df 93 push r29 - 36ba: cd b7 in r28, 0x3d ; 61 - 36bc: de b7 in r29, 0x3e ; 62 - 36be: ea 97 sbiw r28, 0x3a ; 58 - 36c0: cd bf out 0x3d, r28 ; 61 - 36c2: de bf out 0x3e, r29 ; 62 - 36c4: 05 e1 ldi r16, 0x15 ; 21 - 36c6: 17 e2 ldi r17, 0x27 ; 39 - 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(); - 36c8: f7 d2 rcall .+1518 ; 0x3cb8 - 36ca: f8 01 movw r30, r16 - 36cc: 81 93 st Z+, r24 - 36ce: 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++) - 36d0: f7 e2 ldi r31, 0x27 ; 39 - 36d2: 0d 31 cpi r16, 0x1D ; 29 - 36d4: 1f 07 cpc r17, r31 - 36d6: c1 f7 brne .-16 ; 0x36c8 - *(RequestHeader++) = Endpoint_Read_8(); - #endif - - EVENT_USB_Device_ControlRequest(); - 36d8: 0e 94 10 0d call 0x1a20 ; 0x1a20 - - if (Endpoint_IsSETUPReceived()) - 36dc: 6b d3 rcall .+1750 ; 0x3db4 - 36de: 88 23 and r24, r24 - 36e0: 49 f0 breq .+18 ; 0x36f4 - { - uint8_t bmRequestType = USB_ControlRequest.bmRequestType; - 36e2: 30 91 15 27 lds r19, 0x2715 - - switch (USB_ControlRequest.bRequest) - 36e6: 20 91 16 27 lds r18, 0x2716 - 36ea: 82 2f mov r24, r18 - 36ec: 90 e0 ldi r25, 0x00 ; 0 - 36ee: 8a 30 cpi r24, 0x0A ; 10 - 36f0: 91 05 cpc r25, r1 - 36f2: 68 f0 brcs .+26 ; 0x370e - default: - break; - } - } - - if (Endpoint_IsSETUPReceived()) - 36f4: 5f d3 rcall .+1726 ; 0x3db4 - 36f6: 88 23 and r24, r24 - 36f8: 11 f0 breq .+4 ; 0x36fe - { - Endpoint_ClearSETUP(); - 36fa: 75 d3 rcall .+1770 ; 0x3de6 - Endpoint_StallTransaction(); - 36fc: a0 d3 rcall .+1856 ; 0x3e3e - } -} - 36fe: ea 96 adiw r28, 0x3a ; 58 - 3700: cd bf out 0x3d, r28 ; 61 - 3702: de bf out 0x3e, r29 ; 62 - 3704: df 91 pop r29 - 3706: cf 91 pop r28 - 3708: 1f 91 pop r17 - 370a: 0f 91 pop r16 - 370c: 08 95 ret - - if (Endpoint_IsSETUPReceived()) - { - uint8_t bmRequestType = USB_ControlRequest.bmRequestType; - - switch (USB_ControlRequest.bRequest) - 370e: fc 01 movw r30, r24 - 3710: e4 5e subi r30, 0xE4 ; 228 - 3712: fe 4f sbci r31, 0xFE ; 254 - 3714: de c7 rjmp .+4028 ; 0x46d2 <__tablejump2__> - if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) - USB_Device_GetConfiguration(); - - break; - case REQ_SetConfiguration: - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - 3716: 31 11 cpse r19, r1 - 3718: ed cf rjmp .-38 ; 0x36f4 -} - -static void USB_Device_SetConfiguration(void) -{ - #if defined(FIXED_NUM_CONFIGURATIONS) - if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS) - 371a: 80 91 17 27 lds r24, 0x2717 - 371e: 82 30 cpi r24, 0x02 ; 2 - 3720: 48 f7 brcc .-46 ; 0x36f4 - if ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations) - return; - #endif - #endif - - Endpoint_ClearSETUP(); - 3722: 61 d3 rcall .+1730 ; 0x3de6 - - USB_Device_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue; - 3724: 80 91 17 27 lds r24, 0x2717 - 3728: 80 93 10 27 sts 0x2710, r24 - - Endpoint_ClearStatusStage(); - 372c: 93 d4 rcall .+2342 ; 0x4054 - - if (USB_Device_ConfigurationNumber) - 372e: 80 91 10 27 lds r24, 0x2710 - 3732: 88 23 and r24, r24 - 3734: 09 f4 brne .+2 ; 0x3738 - 3736: d1 c0 rjmp .+418 ; 0x38da - USB_DeviceState = DEVICE_STATE_Configured; - 3738: 84 e0 ldi r24, 0x04 ; 4 - 373a: 80 93 14 27 sts 0x2714, r24 - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; - - EVENT_USB_Device_ConfigurationChanged(); - 373e: 0e 94 0c 0d call 0x1a18 ; 0x1a18 - 3742: d8 cf rjmp .-80 ; 0x36f4 - USB_Device_GetDescriptor(); - } - - break; - case REQ_GetConfiguration: - if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) - 3744: 30 38 cpi r19, 0x80 ; 128 - 3746: b1 f6 brne .-84 ; 0x36f4 - EVENT_USB_Device_ConfigurationChanged(); -} - -static void USB_Device_GetConfiguration(void) -{ - Endpoint_ClearSETUP(); - 3748: 4e d3 rcall .+1692 ; 0x3de6 - - Endpoint_Write_8(USB_Device_ConfigurationNumber); - 374a: 80 91 10 27 lds r24, 0x2710 - 374e: c4 d2 rcall .+1416 ; 0x3cd8 - Endpoint_ClearIN(); - 3750: 8b d2 rcall .+1302 ; 0x3c68 - - Endpoint_ClearStatusStage(); - 3752: 80 d4 rcall .+2304 ; 0x4054 - 3754: cf cf rjmp .-98 ; 0x36f4 - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - USB_Device_SetAddress(); - - break; - case REQ_GetDescriptor: - if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || - 3756: 30 58 subi r19, 0x80 ; 128 - 3758: 32 30 cpi r19, 0x02 ; 2 - 375a: 60 f6 brcc .-104 ; 0x36f4 - !(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)) - 375c: 80 91 17 27 lds r24, 0x2717 - 3760: 90 91 18 27 lds r25, 0x2718 - 3764: 8c 3d cpi r24, 0xDC ; 220 - 3766: e3 e0 ldi r30, 0x03 ; 3 - 3768: 9e 07 cpc r25, r30 - 376a: 09 f4 brne .+2 ; 0x376e - 376c: 88 c0 rjmp .+272 ; 0x387e - USB_Device_GetInternalSerialDescriptor(); - return; - } - #endif - - if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, - 376e: ae 01 movw r20, r28 - 3770: 4f 5f subi r20, 0xFF ; 255 - 3772: 5f 4f sbci r21, 0xFF ; 255 - 3774: 60 91 19 27 lds r22, 0x2719 - 3778: 0e 94 d4 03 call 0x7a8 ; 0x7a8 - 377c: 8c 01 movw r16, r24 - 377e: 00 97 sbiw r24, 0x00 ; 0 - 3780: 09 f4 brne .+2 ; 0x3784 - 3782: b8 cf rjmp .-144 ; 0x36f4 - )) == NO_DESCRIPTOR) - { - return; - } - - Endpoint_ClearSETUP(); - 3784: 30 d3 rcall .+1632 ; 0x3de6 - #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); - 3786: b8 01 movw r22, r16 - 3788: 89 81 ldd r24, Y+1 ; 0x01 - 378a: 9a 81 ldd r25, Y+2 ; 0x02 - 378c: c1 d1 rcall .+898 ; 0x3b10 - Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize); - else - Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize); - #endif - - Endpoint_ClearOUT(); - 378e: 85 d2 rcall .+1290 ; 0x3c9a - 3790: b1 cf rjmp .-158 ; 0x36f4 - USB_Device_ClearSetFeature(); - } - - break; - case REQ_SetAddress: - if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) - 3792: 31 11 cpse r19, r1 - 3794: af cf rjmp .-162 ; 0x36f4 - } -} - -static void USB_Device_SetAddress(void) -{ - uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F); - 3796: 10 91 17 27 lds r17, 0x2717 - 379a: 1f 77 andi r17, 0x7F ; 127 - - USB_Device_SetDeviceAddress(DeviceAddress); - - Endpoint_ClearSETUP(); - 379c: 24 d3 rcall .+1608 ; 0x3de6 - - Endpoint_ClearStatusStage(); - 379e: 5a d4 rcall .+2228 ; 0x4054 - - while (!(Endpoint_IsINReady())); - 37a0: e4 d2 rcall .+1480 ; 0x3d6a - 37a2: 88 23 and r24, r24 - 37a4: e9 f3 breq .-6 ; 0x37a0 - } - - 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; - 37a6: 10 93 c3 04 sts 0x04C3, r17 - - USB_Device_EnableDeviceAddress(DeviceAddress); - - USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; - 37aa: 11 11 cpse r17, r1 - 37ac: 66 c0 rjmp .+204 ; 0x387a - 37ae: 82 e0 ldi r24, 0x02 ; 2 - 37b0: 80 93 14 27 sts 0x2714, r24 - 37b4: 9f cf rjmp .-194 ; 0x36f4 - } - - break; - case REQ_ClearFeature: - case REQ_SetFeature: - if ((bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) || - 37b6: 33 23 and r19, r19 - 37b8: 09 f4 brne .+2 ; 0x37bc - 37ba: 4b c0 rjmp .+150 ; 0x3852 - 37bc: 32 30 cpi r19, 0x02 ; 2 - 37be: 09 f0 breq .+2 ; 0x37c2 - 37c0: 99 cf rjmp .-206 ; 0x36f4 - - break; - #endif - #if !defined(CONTROL_ONLY_DEVICE) - case REQREC_ENDPOINT: - if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt) - 37c2: 80 91 17 27 lds r24, 0x2717 - 37c6: 81 11 cpse r24, r1 - 37c8: 24 c0 rjmp .+72 ; 0x3812 - { - uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); - 37ca: 10 91 19 27 lds r17, 0x2719 - 37ce: 1f 70 andi r17, 0x0F ; 15 - - if (EndpointIndex == ENDPOINT_CONTROLEP) - 37d0: 09 f4 brne .+2 ; 0x37d4 - 37d2: 90 cf rjmp .-224 ; 0x36f4 - return; - - Endpoint_SelectEndpoint(EndpointIndex); - 37d4: 81 2f mov r24, r17 - 37d6: 90 d2 rcall .+1312 ; 0x3cf8 - - if (Endpoint_IsEnabled()) - { - if (USB_ControlRequest.bRequest == REQ_SetFeature) - 37d8: 80 91 16 27 lds r24, 0x2716 - 37dc: 83 30 cpi r24, 0x03 ; 3 - 37de: 09 f4 brne .+2 ; 0x37e2 - 37e0: 86 c0 rjmp .+268 ; 0x38ee - * \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; - 37e2: a0 91 1f 27 lds r26, 0x271F - 37e6: b0 91 20 27 lds r27, 0x2720 - 37ea: 11 96 adiw r26, 0x01 ; 1 - 37ec: 8c 91 ld r24, X - 37ee: 11 97 sbiw r26, 0x01 ; 1 - 37f0: 8b 7f andi r24, 0xFB ; 251 - 37f2: 11 96 adiw r26, 0x01 ; 1 - 37f4: 8c 93 st X, r24 - 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; - 37f6: 24 e8 ldi r18, 0x84 ; 132 - 37f8: 12 9f mul r17, r18 - 37fa: f0 01 movw r30, r0 - 37fc: 11 24 eor r1, r1 - 37fe: ed 59 subi r30, 0x9D ; 157 - 3800: f8 4d sbci r31, 0xD8 ; 216 - 3802: 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; - 3804: e0 91 1f 27 lds r30, 0x271F - 3808: f0 91 20 27 lds r31, 0x2720 - 380c: 80 81 ld r24, Z - 380e: 8e 7f andi r24, 0xFE ; 254 - 3810: 80 83 st Z, r24 - #endif - default: - return; - } - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 3812: 80 e0 ldi r24, 0x00 ; 0 - 3814: 71 d2 rcall .+1250 ; 0x3cf8 - - Endpoint_ClearSETUP(); - 3816: e7 d2 rcall .+1486 ; 0x3de6 - - Endpoint_ClearStatusStage(); - 3818: 1d d4 rcall .+2106 ; 0x4054 - 381a: 6c cf rjmp .-296 ; 0x36f4 - uint8_t bmRequestType = USB_ControlRequest.bmRequestType; - - switch (USB_ControlRequest.bRequest) - { - case REQ_GetStatus: - if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || - 381c: 30 38 cpi r19, 0x80 ; 128 - 381e: 29 f1 breq .+74 ; 0x386a - 3820: 32 38 cpi r19, 0x82 ; 130 - 3822: 09 f0 breq .+2 ; 0x3826 - 3824: 67 cf rjmp .-306 ; 0x36f4 - 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); - 3826: 80 91 19 27 lds r24, 0x2719 - 382a: 8f 70 andi r24, 0x0F ; 15 - 382c: 65 d2 rcall .+1226 ; 0x3cf8 - * \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); - 382e: e0 91 1f 27 lds r30, 0x271F - 3832: f0 91 20 27 lds r31, 0x2720 - 3836: 11 81 ldd r17, Z+1 ; 0x01 - 3838: 12 fb bst r17, 2 - 383a: 11 27 eor r17, r17 - 383c: 10 f9 bld r17, 0 - - CurrentStatus = Endpoint_IsStalled(); - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 383e: 80 e0 ldi r24, 0x00 ; 0 - 3840: 5b d2 rcall .+1206 ; 0x3cf8 - break; - default: - return; - } - - Endpoint_ClearSETUP(); - 3842: d1 d2 rcall .+1442 ; 0x3de6 - * \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); - 3844: 81 2f mov r24, r17 - 3846: 48 d2 rcall .+1168 ; 0x3cd8 - Endpoint_Write_8(Data >> 8); - 3848: 80 e0 ldi r24, 0x00 ; 0 - 384a: 46 d2 rcall .+1164 ; 0x3cd8 - - Endpoint_Write_16_LE(CurrentStatus); - Endpoint_ClearIN(); - 384c: 0d d2 rcall .+1050 ; 0x3c68 - - Endpoint_ClearStatusStage(); - 384e: 02 d4 rcall .+2052 ; 0x4054 - 3850: 51 cf rjmp .-350 ; 0x36f4 -{ - switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) - { - #if !defined(NO_DEVICE_REMOTE_WAKEUP) - case REQREC_DEVICE: - if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup) - 3852: 80 91 17 27 lds r24, 0x2717 - 3856: 81 30 cpi r24, 0x01 ; 1 - 3858: 09 f0 breq .+2 ; 0x385c - 385a: 4c cf rjmp .-360 ; 0x36f4 - USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature); - 385c: 81 e0 ldi r24, 0x01 ; 1 - 385e: 23 30 cpi r18, 0x03 ; 3 - 3860: 09 f0 breq .+2 ; 0x3864 - 3862: 80 e0 ldi r24, 0x00 ; 0 - 3864: 80 93 12 27 sts 0x2712, r24 - 3868: d4 cf rjmp .-88 ; 0x3812 - Endpoint_ClearOUT(); -} - -static void USB_Device_GetStatus(void) -{ - uint8_t CurrentStatus = 0; - 386a: 10 91 11 27 lds r17, 0x2711 - if (USB_Device_CurrentlySelfPowered) - CurrentStatus |= FEATURE_SELFPOWERED_ENABLED; - #endif - - #if !defined(NO_DEVICE_REMOTE_WAKEUP) - if (USB_Device_RemoteWakeupEnabled) - 386e: 80 91 12 27 lds r24, 0x2712 - 3872: 88 23 and r24, r24 - 3874: 31 f3 breq .-52 ; 0x3842 - CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; - 3876: 12 60 ori r17, 0x02 ; 2 - 3878: e4 cf rjmp .-56 ; 0x3842 - - while (!(Endpoint_IsINReady())); - - USB_Device_EnableDeviceAddress(DeviceAddress); - - USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; - 387a: 83 e0 ldi r24, 0x03 ; 3 - 387c: 99 cf rjmp .-206 ; 0x37b0 - { - USB_Descriptor_Header_t Header; - uint16_t UnicodeString[INTERNAL_SERIAL_LENGTH_BITS / 4]; - } SignatureDescriptor; - - SignatureDescriptor.Header.Type = DTYPE_String; - 387e: 83 e0 ldi r24, 0x03 ; 3 - 3880: 8a 83 std Y+2, r24 ; 0x02 - SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4); - 3882: 8a e3 ldi r24, 0x3A ; 58 - 3884: 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; - 3886: 5f b7 in r21, 0x3f ; 63 - #if (ARCH == ARCH_AVR8) - cli(); - #elif (ARCH == ARCH_UC3) - __builtin_ssrf(AVR32_SR_GM_OFFSET); - #elif (ARCH == ARCH_XMEGA) - cli(); - 3888: f8 94 cli - #endif - - GCC_MEMORY_BARRIER(); - 388a: de 01 movw r26, r28 - 388c: 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++) - 388e: 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; - 3890: 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; - 3892: 42 e0 ldi r20, 0x02 ; 2 - 3894: 07 c0 rjmp .+14 ; 0x38a4 - SigReadAddress++; - } - - SerialByte &= 0x0F; - - UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? - 3896: 90 e0 ldi r25, 0x00 ; 0 - 3898: c7 96 adiw r24, 0x37 ; 55 - 389a: 8d 93 st X+, r24 - 389c: 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++) - 389e: 2f 5f subi r18, 0xFF ; 255 - 38a0: 2c 31 cpi r18, 0x1C ; 28 - 38a2: 91 f0 breq .+36 ; 0x38c8 - { - uint8_t SerialByte; - - NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 38a4: 40 93 ca 01 sts 0x01CA, r20 - SerialByte = pgm_read_byte(SigReadAddress); - 38a8: e3 2f mov r30, r19 - 38aa: f0 e0 ldi r31, 0x00 ; 0 - 38ac: 84 91 lpm r24, Z - NVM.CMD = 0; - 38ae: 10 92 ca 01 sts 0x01CA, r1 - - if (SerialCharNum & 0x01) - 38b2: 20 ff sbrs r18, 0 - 38b4: 03 c0 rjmp .+6 ; 0x38bc - { - SerialByte >>= 4; - 38b6: 82 95 swap r24 - 38b8: 8f 70 andi r24, 0x0F ; 15 - SigReadAddress++; - 38ba: 3f 5f subi r19, 0xFF ; 255 - } - - SerialByte &= 0x0F; - 38bc: 8f 70 andi r24, 0x0F ; 15 - - UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? - 38be: 8a 30 cpi r24, 0x0A ; 10 - 38c0: 50 f7 brcc .-44 ; 0x3896 - 38c2: 90 e0 ldi r25, 0x00 ; 0 - 38c4: c0 96 adiw r24, 0x30 ; 48 - 38c6: e9 cf rjmp .-46 ; 0x389a - if (GlobalIntState & AVR32_SR_GM) - __builtin_ssrf(AVR32_SR_GM_OFFSET); - else - __builtin_csrf(AVR32_SR_GM_OFFSET); - #elif (ARCH == ARCH_XMEGA) - SREG = GlobalIntState; - 38c8: 5f bf out 0x3f, r21 ; 63 - - USB_Device_GetSerialString(SignatureDescriptor.UnicodeString); - - Endpoint_ClearSETUP(); - 38ca: 8d d2 rcall .+1306 ; 0x3de6 - - Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor)); - 38cc: 6a e3 ldi r22, 0x3A ; 58 - 38ce: 70 e0 ldi r23, 0x00 ; 0 - 38d0: ce 01 movw r24, r28 - 38d2: 01 96 adiw r24, 0x01 ; 1 - 38d4: 88 d0 rcall .+272 ; 0x39e6 - Endpoint_ClearOUT(); - 38d6: e1 d1 rcall .+962 ; 0x3c9a - 38d8: 0d cf rjmp .-486 ; 0x36f4 - } - - 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); - 38da: 80 91 c3 04 lds r24, 0x04C3 - Endpoint_ClearStatusStage(); - - if (USB_Device_ConfigurationNumber) - USB_DeviceState = DEVICE_STATE_Configured; - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; - 38de: 88 23 and r24, r24 - 38e0: 21 f0 breq .+8 ; 0x38ea - 38e2: 84 e0 ldi r24, 0x04 ; 4 - 38e4: 80 93 14 27 sts 0x2714, r24 - 38e8: 2a cf rjmp .-428 ; 0x373e - 38ea: 81 e0 ldi r24, 0x01 ; 1 - 38ec: fb cf rjmp .-10 ; 0x38e4 - - if (Endpoint_IsEnabled()) - { - if (USB_ControlRequest.bRequest == REQ_SetFeature) - { - Endpoint_StallTransaction(); - 38ee: a7 d2 rcall .+1358 ; 0x3e3e - 38f0: 90 cf rjmp .-224 ; 0x3812 - -000038f2 : -#define __INCLUDE_FROM_EVENTS_C -#define __INCLUDE_FROM_USB_DRIVER -#include "Events.h" - -void USB_Event_Stub(void) -{ - 38f2: 08 95 ret - -000038f4 : -#if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) -volatile uint8_t USB_DeviceState; -#endif - -void USB_USBTask(void) -{ - 38f4: cf 93 push r28 -} - -#if defined(USB_CAN_BE_DEVICE) -static void USB_DeviceTask(void) -{ - if (USB_DeviceState == DEVICE_STATE_Unattached) - 38f6: 80 91 14 27 lds r24, 0x2714 - 38fa: 81 11 cpse r24, r1 - 38fc: 02 c0 rjmp .+4 ; 0x3902 - #elif defined(USB_CAN_BE_HOST) - USB_HostTask(); - #elif defined(USB_CAN_BE_DEVICE) - USB_DeviceTask(); - #endif -} - 38fe: cf 91 pop r28 - 3900: 08 95 ret - * \return Index of the currently selected endpoint. - */ - static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; - static inline uint8_t Endpoint_GetCurrentEndpoint(void) - { - return USB_Endpoint_SelectedEndpoint; - 3902: c0 91 21 27 lds r28, 0x2721 - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - - uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - 3906: 80 e0 ldi r24, 0x00 ; 0 - 3908: f7 d1 rcall .+1006 ; 0x3cf8 - - if (Endpoint_IsSETUPReceived()) - 390a: 54 d2 rcall .+1192 ; 0x3db4 - 390c: 81 11 cpse r24, r1 - 390e: 03 c0 rjmp .+6 ; 0x3916 - USB_Device_ProcessControlRequest(); - - Endpoint_SelectEndpoint(PrevEndpoint); - 3910: 8c 2f mov r24, r28 - #elif defined(USB_CAN_BE_HOST) - USB_HostTask(); - #elif defined(USB_CAN_BE_DEVICE) - USB_DeviceTask(); - #endif -} - 3912: cf 91 pop r28 - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - - if (Endpoint_IsSETUPReceived()) - USB_Device_ProcessControlRequest(); - - Endpoint_SelectEndpoint(PrevEndpoint); - 3914: f1 c1 rjmp .+994 ; 0x3cf8 - uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); - - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - - if (Endpoint_IsSETUPReceived()) - USB_Device_ProcessControlRequest(); - 3916: cd de rcall .-614 ; 0x36b2 - - Endpoint_SelectEndpoint(PrevEndpoint); - 3918: 8c 2f mov r24, r28 - #elif defined(USB_CAN_BE_HOST) - USB_HostTask(); - #elif defined(USB_CAN_BE_DEVICE) - USB_DeviceTask(); - #endif -} - 391a: cf 91 pop r28 - Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); - - if (Endpoint_IsSETUPReceived()) - USB_Device_ProcessControlRequest(); - - Endpoint_SelectEndpoint(PrevEndpoint); - 391c: ed c1 rjmp .+986 ; 0x3cf8 - -0000391e : - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; -} - 391e: cf 92 push r12 - 3920: df 92 push r13 - 3922: ef 92 push r14 - 3924: ff 92 push r15 - 3926: 0f 93 push r16 - 3928: 1f 93 push r17 - 392a: cf 93 push r28 - 392c: df 93 push r29 - 392e: 8c 01 movw r16, r24 - 3930: eb 01 movw r28, r22 - 3932: 7a 01 movw r14, r20 - 3934: a5 d3 rcall .+1866 ; 0x4080 - 3936: 81 11 cpse r24, r1 - 3938: 25 c0 rjmp .+74 ; 0x3984 - 393a: e1 14 cp r14, r1 - 393c: f1 04 cpc r15, r1 - 393e: 81 f1 breq .+96 ; 0x39a0 - 3940: f7 01 movw r30, r14 - 3942: 80 81 ld r24, Z - 3944: 91 81 ldd r25, Z+1 ; 0x01 - 3946: c8 1b sub r28, r24 - 3948: d9 0b sbc r29, r25 - 394a: 08 0f add r16, r24 - 394c: 19 1f adc r17, r25 - 394e: 20 97 sbiw r28, 0x00 ; 0 - 3950: 09 f4 brne .+2 ; 0x3954 - 3952: 3b c0 rjmp .+118 ; 0x39ca - 3954: c1 2c mov r12, r1 - 3956: d1 2c mov r13, r1 - 3958: 20 91 1d 27 lds r18, 0x271D - 395c: 30 91 1e 27 lds r19, 0x271E - 3960: f9 01 movw r30, r18 - 3962: ef 5b subi r30, 0xBF ; 191 - 3964: ff 4f sbci r31, 0xFF ; 255 - 3966: 90 81 ld r25, Z - 3968: 31 97 sbiw r30, 0x01 ; 1 - 396a: 80 81 ld r24, Z - 396c: 98 17 cp r25, r24 - 396e: 78 f1 brcs .+94 ; 0x39ce - 3970: 7b d1 rcall .+758 ; 0x3c68 - 3972: c0 df rcall .-128 ; 0x38f4 - 3974: f7 01 movw r30, r14 - 3976: 80 81 ld r24, Z - 3978: 91 81 ldd r25, Z+1 ; 0x01 - 397a: 8c 0d add r24, r12 - 397c: 9d 1d adc r25, r13 - 397e: 80 83 st Z, r24 - 3980: 91 83 std Z+1, r25 ; 0x01 - 3982: 85 e0 ldi r24, 0x05 ; 5 - 3984: df 91 pop r29 - 3986: cf 91 pop r28 - 3988: 1f 91 pop r17 - 398a: 0f 91 pop r16 - 398c: ff 90 pop r15 - 398e: ef 90 pop r14 - 3990: df 90 pop r13 - 3992: cf 90 pop r12 - 3994: 08 95 ret - 3996: 68 d1 rcall .+720 ; 0x3c68 - 3998: ad df rcall .-166 ; 0x38f4 - 399a: 72 d3 rcall .+1764 ; 0x4080 - 399c: 81 11 cpse r24, r1 - 399e: f2 cf rjmp .-28 ; 0x3984 - 39a0: 20 97 sbiw r28, 0x00 ; 0 - 39a2: 99 f0 breq .+38 ; 0x39ca - 39a4: 20 91 1d 27 lds r18, 0x271D - 39a8: 30 91 1e 27 lds r19, 0x271E - 39ac: f9 01 movw r30, r18 - 39ae: ef 5b subi r30, 0xBF ; 191 - 39b0: ff 4f sbci r31, 0xFF ; 255 - 39b2: 90 81 ld r25, Z - 39b4: 31 97 sbiw r30, 0x01 ; 1 - 39b6: 80 81 ld r24, Z - 39b8: 98 17 cp r25, r24 - 39ba: 68 f7 brcc .-38 ; 0x3996 - 39bc: f8 01 movw r30, r16 - 39be: 81 91 ld r24, Z+ - 39c0: 8f 01 movw r16, r30 - 39c2: 8a d1 rcall .+788 ; 0x3cd8 - 39c4: 21 97 sbiw r28, 0x01 ; 1 - 39c6: 20 97 sbiw r28, 0x00 ; 0 - 39c8: 69 f7 brne .-38 ; 0x39a4 - 39ca: 80 e0 ldi r24, 0x00 ; 0 - 39cc: db cf rjmp .-74 ; 0x3984 - 39ce: f8 01 movw r30, r16 - 39d0: 81 91 ld r24, Z+ - 39d2: 8f 01 movw r16, r30 - 39d4: 81 d1 rcall .+770 ; 0x3cd8 - 39d6: ff ef ldi r31, 0xFF ; 255 - 39d8: cf 1a sub r12, r31 - 39da: df 0a sbc r13, r31 - 39dc: cc 15 cp r28, r12 - 39de: dd 05 cpc r29, r13 - 39e0: 09 f0 breq .+2 ; 0x39e4 - 39e2: ba cf rjmp .-140 ; 0x3958 - 39e4: f2 cf rjmp .-28 ; 0x39ca - -000039e6 : - 39e6: cf 92 push r12 - 39e8: df 92 push r13 - 39ea: ef 92 push r14 - 39ec: ff 92 push r15 - 39ee: 0f 93 push r16 - 39f0: 1f 93 push r17 - 39f2: cf 93 push r28 - 39f4: df 93 push r29 - 39f6: 6c 01 movw r12, r24 - 39f8: 8b 01 movw r16, r22 - 39fa: 80 91 21 27 lds r24, 0x2721 - 39fe: 80 68 ori r24, 0x80 ; 128 - 3a00: 7b d1 rcall .+758 ; 0x3cf8 - 3a02: c0 91 1b 27 lds r28, 0x271B - 3a06: d0 91 1c 27 lds r29, 0x271C - 3a0a: c0 17 cp r28, r16 - 3a0c: d1 07 cpc r29, r17 - 3a0e: 28 f0 brcs .+10 ; 0x3a1a - 3a10: 01 15 cp r16, r1 - 3a12: 11 05 cpc r17, r1 - 3a14: 09 f4 brne .+2 ; 0x3a18 - 3a16: 6f c0 rjmp .+222 ; 0x3af6 - 3a18: e8 01 movw r28, r16 - 3a1a: 10 e0 ldi r17, 0x00 ; 0 - 3a1c: 20 97 sbiw r28, 0x00 ; 0 - 3a1e: 39 f5 brne .+78 ; 0x3a6e - 3a20: 11 11 cpse r17, r1 - 3a22: 0c c0 rjmp .+24 ; 0x3a3c - 3a24: 2f c0 rjmp .+94 ; 0x3a84 - 3a26: 85 30 cpi r24, 0x05 ; 5 - 3a28: 91 f1 breq .+100 ; 0x3a8e - 3a2a: c4 d1 rcall .+904 ; 0x3db4 - 3a2c: 81 11 cpse r24, r1 - 3a2e: 31 c0 rjmp .+98 ; 0x3a92 - 3a30: a8 d1 rcall .+848 ; 0x3d82 - 3a32: 81 11 cpse r24, r1 - 3a34: 27 c0 rjmp .+78 ; 0x3a84 - 3a36: 99 d1 rcall .+818 ; 0x3d6a - 3a38: 81 11 cpse r24, r1 - 3a3a: 2d c0 rjmp .+90 ; 0x3a96 - 3a3c: 80 91 14 27 lds r24, 0x2714 - 3a40: 81 11 cpse r24, r1 - 3a42: f1 cf rjmp .-30 ; 0x3a26 - 3a44: 82 e0 ldi r24, 0x02 ; 2 - 3a46: df 91 pop r29 - 3a48: cf 91 pop r28 - 3a4a: 1f 91 pop r17 - 3a4c: 0f 91 pop r16 - 3a4e: ff 90 pop r15 - 3a50: ef 90 pop r14 - 3a52: df 90 pop r13 - 3a54: cf 90 pop r12 - 3a56: 08 95 ret - 3a58: 85 30 cpi r24, 0x05 ; 5 - 3a5a: c9 f0 breq .+50 ; 0x3a8e - 3a5c: ab d1 rcall .+854 ; 0x3db4 - 3a5e: 81 11 cpse r24, r1 - 3a60: 18 c0 rjmp .+48 ; 0x3a92 - 3a62: 8f d1 rcall .+798 ; 0x3d82 - 3a64: 81 11 cpse r24, r1 - 3a66: 0e c0 rjmp .+28 ; 0x3a84 - 3a68: 80 d1 rcall .+768 ; 0x3d6a - 3a6a: 81 11 cpse r24, r1 - 3a6c: 14 c0 rjmp .+40 ; 0x3a96 - 3a6e: 80 91 14 27 lds r24, 0x2714 - 3a72: 81 11 cpse r24, r1 - 3a74: f1 cf rjmp .-30 ; 0x3a58 - 3a76: e6 cf rjmp .-52 ; 0x3a44 - 3a78: 80 91 14 27 lds r24, 0x2714 - 3a7c: 88 23 and r24, r24 - 3a7e: 11 f3 breq .-60 ; 0x3a44 - 3a80: 85 30 cpi r24, 0x05 ; 5 - 3a82: 29 f0 breq .+10 ; 0x3a8e - 3a84: 7e d1 rcall .+764 ; 0x3d82 - 3a86: 88 23 and r24, r24 - 3a88: b9 f3 breq .-18 ; 0x3a78 - 3a8a: 80 e0 ldi r24, 0x00 ; 0 - 3a8c: dc cf rjmp .-72 ; 0x3a46 - 3a8e: 83 e0 ldi r24, 0x03 ; 3 - 3a90: da cf rjmp .-76 ; 0x3a46 - 3a92: 81 e0 ldi r24, 0x01 ; 1 - 3a94: d8 cf rjmp .-80 ; 0x3a46 - 3a96: 80 91 21 27 lds r24, 0x2721 - 3a9a: 87 fd sbrc r24, 7 - 3a9c: 30 c0 rjmp .+96 ; 0x3afe - 3a9e: 20 91 1d 27 lds r18, 0x271D - 3aa2: 30 91 1e 27 lds r19, 0x271E - 3aa6: f9 01 movw r30, r18 - 3aa8: e0 5c subi r30, 0xC0 ; 192 - 3aaa: ff 4f sbci r31, 0xFF ; 255 - 3aac: e0 80 ld r14, Z - 3aae: 31 96 adiw r30, 0x01 ; 1 - 3ab0: 80 81 ld r24, Z - 3ab2: f1 2c mov r15, r1 - 3ab4: e8 1a sub r14, r24 - 3ab6: f1 08 sbc r15, r1 - 3ab8: 20 97 sbiw r28, 0x00 ; 0 - 3aba: a9 f0 breq .+42 ; 0x3ae6 - 3abc: 88 e0 ldi r24, 0x08 ; 8 - 3abe: e8 16 cp r14, r24 - 3ac0: f1 04 cpc r15, r1 - 3ac2: 88 f4 brcc .+34 ; 0x3ae6 - 3ac4: 86 01 movw r16, r12 - 3ac6: 04 c0 rjmp .+8 ; 0x3ad0 - 3ac8: 88 e0 ldi r24, 0x08 ; 8 - 3aca: e8 16 cp r14, r24 - 3acc: f1 04 cpc r15, r1 - 3ace: 59 f0 breq .+22 ; 0x3ae6 - 3ad0: f8 01 movw r30, r16 - 3ad2: 81 91 ld r24, Z+ - 3ad4: 8f 01 movw r16, r30 - 3ad6: 00 d1 rcall .+512 ; 0x3cd8 - 3ad8: 68 01 movw r12, r16 - 3ada: 21 97 sbiw r28, 0x01 ; 1 - 3adc: ff ef ldi r31, 0xFF ; 255 - 3ade: ef 1a sub r14, r31 - 3ae0: ff 0a sbc r15, r31 - 3ae2: 20 97 sbiw r28, 0x00 ; 0 - 3ae4: 89 f7 brne .-30 ; 0x3ac8 - 3ae6: 11 e0 ldi r17, 0x01 ; 1 - 3ae8: e8 e0 ldi r30, 0x08 ; 8 - 3aea: ee 16 cp r14, r30 - 3aec: f1 04 cpc r15, r1 - 3aee: 09 f0 breq .+2 ; 0x3af2 - 3af0: 10 e0 ldi r17, 0x00 ; 0 - 3af2: ba d0 rcall .+372 ; 0x3c68 - 3af4: 93 cf rjmp .-218 ; 0x3a1c - 3af6: b8 d0 rcall .+368 ; 0x3c68 - 3af8: c0 e0 ldi r28, 0x00 ; 0 - 3afa: d0 e0 ldi r29, 0x00 ; 0 - 3afc: 8e cf rjmp .-228 ; 0x3a1a - 3afe: e0 91 1d 27 lds r30, 0x271D - 3b02: f0 91 1e 27 lds r31, 0x271E - 3b06: ef 5b subi r30, 0xBF ; 191 - 3b08: ff 4f sbci r31, 0xFF ; 255 - 3b0a: e0 80 ld r14, Z - 3b0c: f1 2c mov r15, r1 - 3b0e: d4 cf rjmp .-88 ; 0x3ab8 - -00003b10 : - -#if defined(TEMPLATE_FUNC_NAME) - -uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, - uint16_t Length) -{ - 3b10: df 92 push r13 - 3b12: ef 92 push r14 - 3b14: ff 92 push r15 - 3b16: 0f 93 push r16 - 3b18: 1f 93 push r17 - 3b1a: cf 93 push r28 - 3b1c: df 93 push r29 - 3b1e: f8 2e mov r15, r24 - 3b20: e9 2e mov r14, r25 - 3b22: 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); - 3b24: 80 91 21 27 lds r24, 0x2721 - 3b28: 80 68 ori r24, 0x80 ; 128 - 3b2a: e6 d0 rcall .+460 ; 0x3cf8 - - if (Length > USB_ControlRequest.wLength) - 3b2c: c0 91 1b 27 lds r28, 0x271B - 3b30: d0 91 1c 27 lds r29, 0x271C - 3b34: c0 17 cp r28, r16 - 3b36: d1 07 cpc r29, r17 - 3b38: 28 f0 brcs .+10 ; 0x3b44 - Length = USB_ControlRequest.wLength; - else if (!(Length)) - 3b3a: 01 15 cp r16, r1 - 3b3c: 11 05 cpc r17, r1 - 3b3e: 09 f4 brne .+2 ; 0x3b42 - 3b40: 86 c0 rjmp .+268 ; 0x3c4e - 3b42: e8 01 movw r28, r16 - 3b44: 0f 2d mov r16, r15 - 3b46: 1e 2d mov r17, r14 - 3b48: d1 2c mov r13, r1 - 3b4a: 20 97 sbiw r28, 0x00 ; 0 - 3b4c: 39 f5 brne .+78 ; 0x3b9c - 3b4e: d1 10 cpse r13, r1 - 3b50: 0d c0 rjmp .+26 ; 0x3b6c - 3b52: 2f c0 rjmp .+94 ; 0x3bb2 - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 3b54: 85 30 cpi r24, 0x05 ; 5 - 3b56: 09 f4 brne .+2 ; 0x3b5a - 3b58: 38 c0 rjmp .+112 ; 0x3bca - return ENDPOINT_RWCSTREAM_BusSuspended; - else if (Endpoint_IsSETUPReceived()) - 3b5a: 2c d1 rcall .+600 ; 0x3db4 - 3b5c: 81 11 cpse r24, r1 - 3b5e: 3e c0 rjmp .+124 ; 0x3bdc - return ENDPOINT_RWCSTREAM_HostAborted; - else if (Endpoint_IsOUTReceived()) - 3b60: 10 d1 rcall .+544 ; 0x3d82 - 3b62: 81 11 cpse r24, r1 - 3b64: 26 c0 rjmp .+76 ; 0x3bb2 - break; - - if (Endpoint_IsINReady()) - 3b66: 01 d1 rcall .+514 ; 0x3d6a - 3b68: 81 11 cpse r24, r1 - 3b6a: 41 c0 rjmp .+130 ; 0x3bee - else if (!(Length)) - Endpoint_ClearIN(); - - while (Length || LastPacketFull) - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3b6c: 80 91 14 27 lds r24, 0x2714 - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3b70: 81 11 cpse r24, r1 - 3b72: f0 cf rjmp .-32 ; 0x3b54 - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - 3b74: 82 e0 ldi r24, 0x02 ; 2 - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; -} - 3b76: df 91 pop r29 - 3b78: cf 91 pop r28 - 3b7a: 1f 91 pop r17 - 3b7c: 0f 91 pop r16 - 3b7e: ff 90 pop r15 - 3b80: ef 90 pop r14 - 3b82: df 90 pop r13 - 3b84: 08 95 ret - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 3b86: 85 30 cpi r24, 0x05 ; 5 - 3b88: 01 f1 breq .+64 ; 0x3bca - return ENDPOINT_RWCSTREAM_BusSuspended; - else if (Endpoint_IsSETUPReceived()) - 3b8a: 14 d1 rcall .+552 ; 0x3db4 - 3b8c: 81 11 cpse r24, r1 - 3b8e: 26 c0 rjmp .+76 ; 0x3bdc - return ENDPOINT_RWCSTREAM_HostAborted; - else if (Endpoint_IsOUTReceived()) - 3b90: f8 d0 rcall .+496 ; 0x3d82 - 3b92: 81 11 cpse r24, r1 - 3b94: 0e c0 rjmp .+28 ; 0x3bb2 - break; - - if (Endpoint_IsINReady()) - 3b96: e9 d0 rcall .+466 ; 0x3d6a - 3b98: 81 11 cpse r24, r1 - 3b9a: 29 c0 rjmp .+82 ; 0x3bee - else if (!(Length)) - Endpoint_ClearIN(); - - while (Length || LastPacketFull) - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3b9c: 80 91 14 27 lds r24, 0x2714 - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3ba0: 81 11 cpse r24, r1 - 3ba2: f1 cf rjmp .-30 ; 0x3b86 - 3ba4: e7 cf rjmp .-50 ; 0x3b74 - } - } - - while (!(Endpoint_IsOUTReceived())) - { - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 3ba6: 80 91 14 27 lds r24, 0x2714 - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 3baa: 88 23 and r24, r24 - 3bac: 19 f3 breq .-58 ; 0x3b74 - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 3bae: 85 30 cpi r24, 0x05 ; 5 - 3bb0: 61 f0 breq .+24 ; 0x3bca - LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); - Endpoint_ClearIN(); - } - } - - while (!(Endpoint_IsOUTReceived())) - 3bb2: e7 d0 rcall .+462 ; 0x3d82 - 3bb4: 88 23 and r24, r24 - 3bb6: b9 f3 breq .-18 ; 0x3ba6 - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; - 3bb8: 80 e0 ldi r24, 0x00 ; 0 -} - 3bba: df 91 pop r29 - 3bbc: cf 91 pop r28 - 3bbe: 1f 91 pop r17 - 3bc0: 0f 91 pop r16 - 3bc2: ff 90 pop r15 - 3bc4: ef 90 pop r14 - 3bc6: df 90 pop r13 - 3bc8: 08 95 ret - uint8_t USB_DeviceState_LCL = USB_DeviceState; - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_RWCSTREAM_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - 3bca: 83 e0 ldi r24, 0x03 ; 3 - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; -} - 3bcc: df 91 pop r29 - 3bce: cf 91 pop r28 - 3bd0: 1f 91 pop r17 - 3bd2: 0f 91 pop r16 - 3bd4: ff 90 pop r15 - 3bd6: ef 90 pop r14 - 3bd8: df 90 pop r13 - 3bda: 08 95 ret - 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; - 3bdc: 81 e0 ldi r24, 0x01 ; 1 - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_RWCSTREAM_BusSuspended; - } - - return ENDPOINT_RWCSTREAM_NoError; -} - 3bde: df 91 pop r29 - 3be0: cf 91 pop r28 - 3be2: 1f 91 pop r17 - 3be4: 0f 91 pop r16 - 3be6: ff 90 pop r15 - 3be8: ef 90 pop r14 - 3bea: df 90 pop r13 - 3bec: 08 95 ret - * \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) - 3bee: 80 91 21 27 lds r24, 0x2721 - 3bf2: 87 fd sbrc r24, 7 - 3bf4: 30 c0 rjmp .+96 ; 0x3c56 - return USB_Endpoint_SelectedFIFO->Position; - else - return (USB_Endpoint_SelectedFIFO->Length - USB_Endpoint_SelectedFIFO->Position); - 3bf6: 80 91 1d 27 lds r24, 0x271D - 3bfa: 90 91 1e 27 lds r25, 0x271E - 3bfe: fc 01 movw r30, r24 - 3c00: e0 5c subi r30, 0xC0 ; 192 - 3c02: ff 4f sbci r31, 0xFF ; 255 - 3c04: e0 80 ld r14, Z - 3c06: 31 96 adiw r30, 0x01 ; 1 - 3c08: 80 81 ld r24, Z - 3c0a: f1 2c mov r15, r1 - 3c0c: e8 1a sub r14, r24 - 3c0e: f1 08 sbc r15, r1 - - if (Endpoint_IsINReady()) - { - uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); - - while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) - 3c10: 20 97 sbiw r28, 0x00 ; 0 - 3c12: a1 f0 breq .+40 ; 0x3c3c - 3c14: 88 e0 ldi r24, 0x08 ; 8 - 3c16: e8 16 cp r14, r24 - 3c18: f1 04 cpc r15, r1 - 3c1a: 28 f0 brcs .+10 ; 0x3c26 - 3c1c: 0f c0 rjmp .+30 ; 0x3c3c - 3c1e: 88 e0 ldi r24, 0x08 ; 8 - 3c20: e8 16 cp r14, r24 - 3c22: f1 04 cpc r15, r1 - 3c24: 59 f0 breq .+22 ; 0x3c3c - { - TEMPLATE_TRANSFER_BYTE(DataStream); - 3c26: f8 01 movw r30, r16 - 3c28: 84 91 lpm r24, Z - 3c2a: 56 d0 rcall .+172 ; 0x3cd8 - TEMPLATE_BUFFER_MOVE(DataStream, 1); - 3c2c: 0f 5f subi r16, 0xFF ; 255 - 3c2e: 1f 4f sbci r17, 0xFF ; 255 - Length--; - 3c30: 21 97 sbiw r28, 0x01 ; 1 - BytesInEndpoint++; - 3c32: ff ef ldi r31, 0xFF ; 255 - 3c34: ef 1a sub r14, r31 - 3c36: ff 0a sbc r15, r31 - - if (Endpoint_IsINReady()) - { - uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); - - while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) - 3c38: 20 97 sbiw r28, 0x00 ; 0 - 3c3a: 89 f7 brne .-30 ; 0x3c1e - TEMPLATE_BUFFER_MOVE(DataStream, 1); - Length--; - BytesInEndpoint++; - } - - LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); - 3c3c: dd 24 eor r13, r13 - 3c3e: d3 94 inc r13 - 3c40: e8 e0 ldi r30, 0x08 ; 8 - 3c42: ee 16 cp r14, r30 - 3c44: f1 04 cpc r15, r1 - 3c46: 09 f0 breq .+2 ; 0x3c4a - 3c48: d1 2c mov r13, r1 - Endpoint_ClearIN(); - 3c4a: 0e d0 rcall .+28 ; 0x3c68 - 3c4c: 7e cf rjmp .-260 ; 0x3b4a - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - - if (Length > USB_ControlRequest.wLength) - Length = USB_ControlRequest.wLength; - else if (!(Length)) - Endpoint_ClearIN(); - 3c4e: 0c d0 rcall .+24 ; 0x3c68 - 3c50: c0 e0 ldi r28, 0x00 ; 0 - 3c52: d0 e0 ldi r29, 0x00 ; 0 - 3c54: 77 cf rjmp .-274 ; 0x3b44 - */ - static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; - static inline uint16_t Endpoint_BytesInEndpoint(void) - { - if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN) - return USB_Endpoint_SelectedFIFO->Position; - 3c56: e0 91 1d 27 lds r30, 0x271D - 3c5a: f0 91 1e 27 lds r31, 0x271E - 3c5e: ef 5b subi r30, 0xBF ; 191 - 3c60: ff 4f sbci r31, 0xFF ; 255 - 3c62: e0 80 ld r14, Z - 3c64: f1 2c mov r15, r1 - 3c66: d4 cf rjmp .-88 ; 0x3c10 - -00003c68 : - USB_Endpoint_SelectedFIFO->Position = 0; -} - -void Endpoint_ClearIN(void) -{ - USB_Endpoint_SelectedHandle->CNT = USB_Endpoint_SelectedFIFO->Position; - 3c68: e0 91 1f 27 lds r30, 0x271F - 3c6c: f0 91 20 27 lds r31, 0x2720 - 3c70: a0 91 1d 27 lds r26, 0x271D - 3c74: b0 91 1e 27 lds r27, 0x271E - 3c78: af 5b subi r26, 0xBF ; 191 - 3c7a: bf 4f sbci r27, 0xFF ; 255 - 3c7c: 8c 91 ld r24, X - 3c7e: 90 e0 ldi r25, 0x00 ; 0 - 3c80: 82 83 std Z+2, r24 ; 0x02 - 3c82: 93 83 std Z+3, r25 ; 0x03 - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 3c84: 80 81 ld r24, Z - 3c86: 8d 79 andi r24, 0x9D ; 157 - 3c88: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3c8a: e0 91 1d 27 lds r30, 0x271D - 3c8e: f0 91 1e 27 lds r31, 0x271E - 3c92: ef 5b subi r30, 0xBF ; 191 - 3c94: ff 4f sbci r31, 0xFF ; 255 - 3c96: 10 82 st Z, r1 - 3c98: 08 95 ret - -00003c9a : -} - -void Endpoint_ClearOUT(void) -{ - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 3c9a: e0 91 1f 27 lds r30, 0x271F - 3c9e: f0 91 20 27 lds r31, 0x2720 - 3ca2: 80 81 ld r24, Z - 3ca4: 8d 79 andi r24, 0x9D ; 157 - 3ca6: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3ca8: e0 91 1d 27 lds r30, 0x271D - 3cac: f0 91 1e 27 lds r31, 0x271E - 3cb0: ef 5b subi r30, 0xBF ; 191 - 3cb2: ff 4f sbci r31, 0xFF ; 255 - 3cb4: 10 82 st Z, r1 - 3cb6: 08 95 ret - -00003cb8 : - } -} - -uint8_t Endpoint_Read_8(void) -{ - return USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++]; - 3cb8: 80 91 1d 27 lds r24, 0x271D - 3cbc: 90 91 1e 27 lds r25, 0x271E - 3cc0: fc 01 movw r30, r24 - 3cc2: ef 5b subi r30, 0xBF ; 191 - 3cc4: ff 4f sbci r31, 0xFF ; 255 - 3cc6: 20 81 ld r18, Z - 3cc8: 31 e0 ldi r19, 0x01 ; 1 - 3cca: 32 0f add r19, r18 - 3ccc: 30 83 st Z, r19 - 3cce: fc 01 movw r30, r24 - 3cd0: e2 0f add r30, r18 - 3cd2: f1 1d adc r31, r1 - 3cd4: 80 81 ld r24, Z -} - 3cd6: 08 95 ret - -00003cd8 : - -void Endpoint_Write_8(const uint8_t Data) -{ - USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; - 3cd8: 20 91 1d 27 lds r18, 0x271D - 3cdc: 30 91 1e 27 lds r19, 0x271E - 3ce0: f9 01 movw r30, r18 - 3ce2: ef 5b subi r30, 0xBF ; 191 - 3ce4: ff 4f sbci r31, 0xFF ; 255 - 3ce6: 90 81 ld r25, Z - 3ce8: 41 e0 ldi r20, 0x01 ; 1 - 3cea: 49 0f add r20, r25 - 3cec: 40 83 st Z, r20 - 3cee: f9 01 movw r30, r18 - 3cf0: e9 0f add r30, r25 - 3cf2: f1 1d adc r31, r1 - 3cf4: 80 83 st Z, r24 - 3cf6: 08 95 ret - -00003cf8 : - -void Endpoint_SelectEndpoint(const uint8_t Address) -{ - uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); - - USB_Endpoint_SelectedEndpoint = Address; - 3cf8: 80 93 21 27 sts 0x2721, r24 - USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; -} - -void Endpoint_SelectEndpoint(const uint8_t Address) -{ - uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); - 3cfc: 28 2f mov r18, r24 - 3cfe: 2f 70 andi r18, 0x0F ; 15 - - USB_Endpoint_SelectedEndpoint = Address; - - Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; - 3d00: 62 2f mov r22, r18 - 3d02: 70 e0 ldi r23, 0x00 ; 0 - 3d04: 94 e8 ldi r25, 0x84 ; 132 - 3d06: 29 9f mul r18, r25 - 3d08: 90 01 movw r18, r0 - 3d0a: 11 24 eor r1, r1 - 3d0c: 2e 5d subi r18, 0xDE ; 222 - 3d0e: 38 4d sbci r19, 0xD8 ; 216 - USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; - 3d10: 40 91 c6 04 lds r20, 0x04C6 - 3d14: 50 91 c7 04 lds r21, 0x04C7 - - if (Address & ENDPOINT_DIR_IN) - 3d18: 87 fd sbrc r24, 7 - 3d1a: 12 c0 rjmp .+36 ; 0x3d40 - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; - } - else - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; - 3d1c: 20 93 1d 27 sts 0x271D, r18 - 3d20: 30 93 1e 27 sts 0x271E, r19 - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; - 3d24: cb 01 movw r24, r22 - 3d26: 82 95 swap r24 - 3d28: 92 95 swap r25 - 3d2a: 90 7f andi r25, 0xF0 ; 240 - 3d2c: 98 27 eor r25, r24 - 3d2e: 80 7f andi r24, 0xF0 ; 240 - 3d30: 98 27 eor r25, r24 - 3d32: 84 0f add r24, r20 - 3d34: 95 1f adc r25, r21 - 3d36: 80 93 1f 27 sts 0x271F, r24 - 3d3a: 90 93 20 27 sts 0x2720, r25 - 3d3e: 08 95 ret - Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; - USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; - - if (Address & ENDPOINT_DIR_IN) - { - USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; - 3d40: 2e 5b subi r18, 0xBE ; 190 - 3d42: 3f 4f sbci r19, 0xFF ; 255 - 3d44: 20 93 1d 27 sts 0x271D, r18 - 3d48: 30 93 1e 27 sts 0x271E, r19 - USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; - 3d4c: 62 95 swap r22 - 3d4e: 72 95 swap r23 - 3d50: 70 7f andi r23, 0xF0 ; 240 - 3d52: 76 27 eor r23, r22 - 3d54: 60 7f andi r22, 0xF0 ; 240 - 3d56: 76 27 eor r23, r22 - 3d58: 68 5f subi r22, 0xF8 ; 248 - 3d5a: 7f 4f sbci r23, 0xFF ; 255 - 3d5c: 64 0f add r22, r20 - 3d5e: 75 1f adc r23, r21 - 3d60: 60 93 1f 27 sts 0x271F, r22 - 3d64: 70 93 20 27 sts 0x2720, r23 - 3d68: 08 95 ret - -00003d6a : -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); - 3d6a: 80 91 21 27 lds r24, 0x2721 - 3d6e: 80 68 ori r24, 0x80 ; 128 - 3d70: c3 df rcall .-122 ; 0x3cf8 - - return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); - 3d72: e0 91 1f 27 lds r30, 0x271F - 3d76: f0 91 20 27 lds r31, 0x2720 - 3d7a: 80 81 ld r24, Z -} - 3d7c: 86 95 lsr r24 - 3d7e: 81 70 andi r24, 0x01 ; 1 - 3d80: 08 95 ret - -00003d82 : - -bool Endpoint_IsOUTReceived(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 3d82: 80 91 21 27 lds r24, 0x2721 - 3d86: 8f 77 andi r24, 0x7F ; 127 - 3d88: b7 df rcall .-146 ; 0x3cf8 - - if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_TRNCOMPL0_bm) - 3d8a: e0 91 1f 27 lds r30, 0x271F - 3d8e: f0 91 20 27 lds r31, 0x2720 - 3d92: 80 81 ld r24, Z - 3d94: 85 ff sbrs r24, 5 - 3d96: 0c c0 rjmp .+24 ; 0x3db0 - { - USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; - 3d98: 20 91 1d 27 lds r18, 0x271D - 3d9c: 30 91 1e 27 lds r19, 0x271E - 3da0: 82 81 ldd r24, Z+2 ; 0x02 - 3da2: 93 81 ldd r25, Z+3 ; 0x03 - 3da4: f9 01 movw r30, r18 - 3da6: e0 5c subi r30, 0xC0 ; 192 - 3da8: ff 4f sbci r31, 0xFF ; 255 - 3daa: 80 83 st Z, r24 - return true; - 3dac: 81 e0 ldi r24, 0x01 ; 1 - 3dae: 08 95 ret - } - - return false; - 3db0: 80 e0 ldi r24, 0x00 ; 0 -} - 3db2: 08 95 ret - -00003db4 : - -bool Endpoint_IsSETUPReceived(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 3db4: 80 91 21 27 lds r24, 0x2721 - 3db8: 8f 77 andi r24, 0x7F ; 127 - 3dba: 9e df rcall .-196 ; 0x3cf8 - - if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_SETUP_bm) - 3dbc: e0 91 1f 27 lds r30, 0x271F - 3dc0: f0 91 20 27 lds r31, 0x2720 - 3dc4: 80 81 ld r24, Z - 3dc6: 84 ff sbrs r24, 4 - 3dc8: 0c c0 rjmp .+24 ; 0x3de2 - { - USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; - 3dca: 20 91 1d 27 lds r18, 0x271D - 3dce: 30 91 1e 27 lds r19, 0x271E - 3dd2: 82 81 ldd r24, Z+2 ; 0x02 - 3dd4: 93 81 ldd r25, Z+3 ; 0x03 - 3dd6: f9 01 movw r30, r18 - 3dd8: e0 5c subi r30, 0xC0 ; 192 - 3dda: ff 4f sbci r31, 0xFF ; 255 - 3ddc: 80 83 st Z, r24 - return true; - 3dde: 81 e0 ldi r24, 0x01 ; 1 - 3de0: 08 95 ret - } - - return false; - 3de2: 80 e0 ldi r24, 0x00 ; 0 -} - 3de4: 08 95 ret - -00003de6 : - -void Endpoint_ClearSETUP(void) -{ - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); - 3de6: 80 91 21 27 lds r24, 0x2721 - 3dea: 8f 77 andi r24, 0x7F ; 127 - 3dec: 85 df rcall .-246 ; 0x3cf8 - USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); - 3dee: e0 91 1f 27 lds r30, 0x271F - 3df2: f0 91 20 27 lds r31, 0x2720 - 3df6: 80 81 ld r24, Z - 3df8: 8d 78 andi r24, 0x8D ; 141 - 3dfa: 80 83 st Z, r24 - USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; - 3dfc: e0 91 1f 27 lds r30, 0x271F - 3e00: f0 91 20 27 lds r31, 0x2720 - 3e04: 80 81 ld r24, Z - 3e06: 81 60 ori r24, 0x01 ; 1 - 3e08: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3e0a: e0 91 1d 27 lds r30, 0x271D - 3e0e: f0 91 1e 27 lds r31, 0x271E - 3e12: ef 5b subi r30, 0xBF ; 191 - 3e14: ff 4f sbci r31, 0xFF ; 255 - 3e16: 10 82 st Z, r1 - - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); - 3e18: 80 91 21 27 lds r24, 0x2721 - 3e1c: 80 68 ori r24, 0x80 ; 128 - 3e1e: 6c df rcall .-296 ; 0x3cf8 - USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; - 3e20: e0 91 1f 27 lds r30, 0x271F - 3e24: f0 91 20 27 lds r31, 0x2720 - 3e28: 80 81 ld r24, Z - 3e2a: 81 60 ori r24, 0x01 ; 1 - 3e2c: 80 83 st Z, r24 - USB_Endpoint_SelectedFIFO->Position = 0; - 3e2e: e0 91 1d 27 lds r30, 0x271D - 3e32: f0 91 1e 27 lds r31, 0x271E - 3e36: ef 5b subi r30, 0xBF ; 191 - 3e38: ff 4f sbci r31, 0xFF ; 255 - 3e3a: 10 82 st Z, r1 - 3e3c: 08 95 ret - -00003e3e : - USB_Endpoint_SelectedFIFO->Position = 0; -} - -void Endpoint_StallTransaction(void) -{ - USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; - 3e3e: e0 91 1f 27 lds r30, 0x271F - 3e42: f0 91 20 27 lds r31, 0x2720 - 3e46: 81 81 ldd r24, Z+1 ; 0x01 - 3e48: 84 60 ori r24, 0x04 ; 4 - 3e4a: 81 83 std Z+1, r24 ; 0x01 - - if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc) - 3e4c: e0 91 1f 27 lds r30, 0x271F - 3e50: f0 91 20 27 lds r31, 0x2720 - 3e54: 81 81 ldd r24, Z+1 ; 0x01 - 3e56: 80 7c andi r24, 0xC0 ; 192 - 3e58: 80 34 cpi r24, 0x40 ; 64 - 3e5a: 09 f0 breq .+2 ; 0x3e5e - 3e5c: 08 95 ret - { - Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN); - 3e5e: 80 91 21 27 lds r24, 0x2721 - 3e62: 80 58 subi r24, 0x80 ; 128 - 3e64: 49 df rcall .-366 ; 0x3cf8 - USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; - 3e66: e0 91 1f 27 lds r30, 0x271F - 3e6a: f0 91 20 27 lds r31, 0x2720 - 3e6e: 81 81 ldd r24, Z+1 ; 0x01 - 3e70: 84 60 ori r24, 0x04 ; 4 - 3e72: 81 83 std Z+1, r24 ; 0x01 - 3e74: 08 95 ret - -00003e76 : -} - -bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address, - const uint8_t Config, - const uint8_t Size) -{ - 3e76: 1f 93 push r17 - 3e78: cf 93 push r28 - 3e7a: df 93 push r29 - 3e7c: 00 d0 rcall .+0 ; 0x3e7e - 3e7e: cd b7 in r28, 0x3d ; 61 - 3e80: de b7 in r29, 0x3e ; 62 - 3e82: 18 2f mov r17, r24 - Endpoint_SelectEndpoint(Address); - 3e84: 4a 83 std Y+2, r20 ; 0x02 - 3e86: 69 83 std Y+1, r22 ; 0x01 - 3e88: 37 df rcall .-402 ; 0x3cf8 - - USB_Endpoint_SelectedHandle->CTRL = 0; - 3e8a: e0 91 1f 27 lds r30, 0x271F - 3e8e: f0 91 20 27 lds r31, 0x2720 - 3e92: 11 82 std Z+1, r1 ; 0x01 - USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; - 3e94: e0 91 1f 27 lds r30, 0x271F - 3e98: f0 91 20 27 lds r31, 0x2720 - 3e9c: 4a 81 ldd r20, Y+2 ; 0x02 - 3e9e: 69 81 ldd r22, Y+1 ; 0x01 - 3ea0: 17 fd sbrc r17, 7 - 3ea2: 20 c0 rjmp .+64 ; 0x3ee4 - 3ea4: 10 82 st Z, r1 - USB_Endpoint_SelectedHandle->CTRL = Config; - 3ea6: e0 91 1f 27 lds r30, 0x271F - 3eaa: f0 91 20 27 lds r31, 0x2720 - 3eae: 61 83 std Z+1, r22 ; 0x01 - USB_Endpoint_SelectedHandle->CNT = 0; - 3eb0: e0 91 1f 27 lds r30, 0x271F - 3eb4: f0 91 20 27 lds r31, 0x2720 - 3eb8: 12 82 std Z+2, r1 ; 0x02 - 3eba: 13 82 std Z+3, r1 ; 0x03 - USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; - 3ebc: 80 91 1d 27 lds r24, 0x271D - 3ec0: 90 91 1e 27 lds r25, 0x271E - 3ec4: 84 83 std Z+4, r24 ; 0x04 - 3ec6: 95 83 std Z+5, r25 ; 0x05 - - USB_Endpoint_SelectedFIFO->Length = (Address & ENDPOINT_DIR_IN) ? Size : 0; - 3ec8: 40 e0 ldi r20, 0x00 ; 0 - 3eca: fc 01 movw r30, r24 - 3ecc: e0 5c subi r30, 0xC0 ; 192 - 3ece: ff 4f sbci r31, 0xFF ; 255 - 3ed0: 40 83 st Z, r20 - USB_Endpoint_SelectedFIFO->Position = 0; - 3ed2: 31 96 adiw r30, 0x01 ; 1 - 3ed4: 10 82 st Z, r1 - - return true; -} - 3ed6: 81 e0 ldi r24, 0x01 ; 1 - 3ed8: 0f 90 pop r0 - 3eda: 0f 90 pop r0 - 3edc: df 91 pop r29 - 3ede: cf 91 pop r28 - 3ee0: 1f 91 pop r17 - 3ee2: 08 95 ret - const uint8_t Size) -{ - Endpoint_SelectEndpoint(Address); - - USB_Endpoint_SelectedHandle->CTRL = 0; - USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; - 3ee4: 82 e0 ldi r24, 0x02 ; 2 - 3ee6: 80 83 st Z, r24 - USB_Endpoint_SelectedHandle->CTRL = Config; - 3ee8: e0 91 1f 27 lds r30, 0x271F - 3eec: f0 91 20 27 lds r31, 0x2720 - 3ef0: 61 83 std Z+1, r22 ; 0x01 - USB_Endpoint_SelectedHandle->CNT = 0; - 3ef2: e0 91 1f 27 lds r30, 0x271F - 3ef6: f0 91 20 27 lds r31, 0x2720 - 3efa: 12 82 std Z+2, r1 ; 0x02 - 3efc: 13 82 std Z+3, r1 ; 0x03 - USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; - 3efe: 80 91 1d 27 lds r24, 0x271D - 3f02: 90 91 1e 27 lds r25, 0x271E - 3f06: 84 83 std Z+4, r24 ; 0x04 - 3f08: 95 83 std Z+5, r25 ; 0x05 - 3f0a: df cf rjmp .-66 ; 0x3eca - -00003f0c : - } -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - const uint8_t Entries) -{ - 3f0c: cf 92 push r12 - 3f0e: df 92 push r13 - 3f10: ef 92 push r14 - 3f12: ff 92 push r15 - 3f14: 0f 93 push r16 - 3f16: 1f 93 push r17 - 3f18: cf 93 push r28 - 3f1a: df 93 push r29 - 3f1c: 1f 92 push r1 - 3f1e: cd b7 in r28, 0x3d ; 61 - 3f20: de b7 in r29, 0x3e ; 62 - 3f22: f6 2e mov r15, r22 - for (uint8_t i = 0; i < Entries; i++) - 3f24: 66 23 and r22, r22 - 3f26: 09 f4 brne .+2 ; 0x3f2a - 3f28: 3e c0 rjmp .+124 ; 0x3fa6 - 3f2a: 6c 01 movw r12, r24 - 3f2c: 00 e0 ldi r16, 0x00 ; 0 - { - if (!(Table[i].Address)) - 3f2e: d6 01 movw r26, r12 - 3f30: 1c 91 ld r17, X - 3f32: 11 23 and r17, r17 - 3f34: 91 f1 breq .+100 ; 0x3f9a - continue; - - if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) - 3f36: d6 01 movw r26, r12 - 3f38: 11 96 adiw r26, 0x01 ; 1 - 3f3a: ed 91 ld r30, X+ - 3f3c: fc 91 ld r31, X - 3f3e: 12 97 sbiw r26, 0x02 ; 2 - 3f40: 13 96 adiw r26, 0x03 ; 3 - 3f42: 8c 91 ld r24, X - 3f44: 13 97 sbiw r26, 0x03 ; 3 - 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)); - 3f46: 14 96 adiw r26, 0x04 ; 4 - 3f48: 9c 91 ld r25, X - 3f4a: 92 30 cpi r25, 0x02 ; 2 - 3f4c: 08 f4 brcc .+2 ; 0x3f50 - 3f4e: 45 c0 rjmp .+138 ; 0x3fda - 3f50: 98 e1 ldi r25, 0x18 ; 24 - 3f52: 48 e1 ldi r20, 0x18 ; 24 - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) - { - uint8_t MaskVal = 0; - uint16_t CheckBytes = 8; - - while (CheckBytes < Bytes) - 3f54: e9 30 cpi r30, 0x09 ; 9 - 3f56: f1 05 cpc r31, r1 - 3f58: 50 f0 brcs .+20 ; 0x3f6e - 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; - 3f5a: 28 e0 ldi r18, 0x08 ; 8 - 3f5c: 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; - 3f5e: 90 e0 ldi r25, 0x00 ; 0 - uint16_t CheckBytes = 8; - - while (CheckBytes < Bytes) - { - MaskVal++; - 3f60: 9f 5f subi r25, 0xFF ; 255 - CheckBytes <<= 1; - 3f62: 22 0f add r18, r18 - 3f64: 33 1f adc r19, r19 - static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) - { - uint8_t MaskVal = 0; - uint16_t CheckBytes = 8; - - while (CheckBytes < Bytes) - 3f66: 2e 17 cp r18, r30 - 3f68: 3f 07 cpc r19, r31 - 3f6a: d0 f3 brcs .-12 ; 0x3f60 - 3f6c: 94 2b or r25, r20 - const uint16_t Size, - const uint8_t Banks) - { - uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); - - if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) - 3f6e: 21 2f mov r18, r17 - 3f70: 2f 70 andi r18, 0x0F ; 15 - 3f72: 30 e0 ldi r19, 0x00 ; 0 - 3f74: 26 30 cpi r18, 0x06 ; 6 - 3f76: 31 05 cpc r19, r1 - 3f78: 9c f5 brge .+102 ; 0x3fe0 - return false; - - // TODO - Fix once limitations are lifted - EPConfigMask &= ~USB_EP_PINGPONG_bm; - 3f7a: 9f 7e andi r25, 0xEF ; 239 - if (Size > 64) - 3f7c: e1 34 cpi r30, 0x41 ; 65 - 3f7e: f1 05 cpc r31, r1 - 3f80: 78 f5 brcc .+94 ; 0x3fe0 - return false; - - switch (Type) - 3f82: 88 23 and r24, r24 - 3f84: 01 f1 breq .+64 ; 0x3fc6 - 3f86: 81 30 cpi r24, 0x01 ; 1 - 3f88: c9 f4 brne .+50 ; 0x3fbc - { - case EP_TYPE_CONTROL: - EPConfigMask |= USB_EP_TYPE_CONTROL_gc; - break; - case EP_TYPE_ISOCHRONOUS: - EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; - 3f8a: 90 6c ori r25, 0xC0 ; 192 - 3f8c: ee 2e mov r14, r30 - } - - if (Type == EP_TYPE_CONTROL) - Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 3f8e: 4e 2d mov r20, r14 - 3f90: 69 2f mov r22, r25 - 3f92: 81 2f mov r24, r17 - 3f94: 70 df rcall .-288 ; 0x3e76 - 3f96: 88 23 and r24, r24 - 3f98: 19 f1 breq .+70 ; 0x3fe0 -} - -bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, - const uint8_t Entries) -{ - for (uint8_t i = 0; i < Entries; i++) - 3f9a: 0f 5f subi r16, 0xFF ; 255 - 3f9c: b5 e0 ldi r27, 0x05 ; 5 - 3f9e: cb 0e add r12, r27 - 3fa0: d1 1c adc r13, r1 - 3fa2: 0f 11 cpse r16, r15 - 3fa4: c4 cf rjmp .-120 ; 0x3f2e - { - return false; - } - } - - return true; - 3fa6: 81 e0 ldi r24, 0x01 ; 1 -} - 3fa8: 0f 90 pop r0 - 3faa: df 91 pop r29 - 3fac: cf 91 pop r28 - 3fae: 1f 91 pop r17 - 3fb0: 0f 91 pop r16 - 3fb2: ff 90 pop r15 - 3fb4: ef 90 pop r14 - 3fb6: df 90 pop r13 - 3fb8: cf 90 pop r12 - 3fba: 08 95 ret - break; - case EP_TYPE_ISOCHRONOUS: - EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; - break; - default: - EPConfigMask |= USB_EP_TYPE_BULK_gc; - 3fbc: 90 68 ori r25, 0x80 ; 128 - break; - } - - if (Type == EP_TYPE_CONTROL) - 3fbe: 88 23 and r24, r24 - 3fc0: 19 f0 breq .+6 ; 0x3fc8 - 3fc2: ee 2e mov r14, r30 - 3fc4: e4 cf rjmp .-56 ; 0x3f8e - return false; - - switch (Type) - { - case EP_TYPE_CONTROL: - EPConfigMask |= USB_EP_TYPE_CONTROL_gc; - 3fc6: 90 64 ori r25, 0x40 ; 64 - EPConfigMask |= USB_EP_TYPE_BULK_gc; - break; - } - - if (Type == EP_TYPE_CONTROL) - Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 3fc8: ee 2e mov r14, r30 - 3fca: 4e 2f mov r20, r30 - 3fcc: 69 2f mov r22, r25 - 3fce: 80 e8 ldi r24, 0x80 ; 128 - 3fd0: 81 0f add r24, r17 - 3fd2: 99 83 std Y+1, r25 ; 0x01 - 3fd4: 50 df rcall .-352 ; 0x3e76 - 3fd6: 99 81 ldd r25, Y+1 ; 0x01 - 3fd8: da cf rjmp .-76 ; 0x3f8e - 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)); - 3fda: 98 e0 ldi r25, 0x08 ; 8 - 3fdc: 48 e0 ldi r20, 0x08 ; 8 - 3fde: ba cf rjmp .-140 ; 0x3f54 - if (!(Table[i].Address)) - continue; - - if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) - { - return false; - 3fe0: 80 e0 ldi r24, 0x00 ; 0 - 3fe2: e2 cf rjmp .-60 ; 0x3fa8 - -00003fe4 : - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 3fe4: e0 ec ldi r30, 0xC0 ; 192 - 3fe6: f4 e0 ldi r31, 0x04 ; 4 - 3fe8: a6 81 ldd r26, Z+6 ; 0x06 - 3fea: b7 81 ldd r27, Z+7 ; 0x07 - 3fec: 19 96 adiw r26, 0x09 ; 9 - 3fee: 1c 92 st X, r1 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 3ff0: a6 81 ldd r26, Z+6 ; 0x06 - 3ff2: b7 81 ldd r27, Z+7 ; 0x07 - 3ff4: 11 96 adiw r26, 0x01 ; 1 - 3ff6: 1c 92 st X, r1 - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 3ff8: a6 81 ldd r26, Z+6 ; 0x06 - 3ffa: b7 81 ldd r27, Z+7 ; 0x07 - 3ffc: 59 96 adiw r26, 0x19 ; 25 - 3ffe: 1c 92 st X, r1 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4000: a6 81 ldd r26, Z+6 ; 0x06 - 4002: b7 81 ldd r27, Z+7 ; 0x07 - 4004: 51 96 adiw r26, 0x11 ; 17 - 4006: 1c 92 st X, r1 - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4008: a6 81 ldd r26, Z+6 ; 0x06 - 400a: b7 81 ldd r27, Z+7 ; 0x07 - 400c: 99 96 adiw r26, 0x29 ; 41 - 400e: 1c 92 st X, r1 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4010: a6 81 ldd r26, Z+6 ; 0x06 - 4012: b7 81 ldd r27, Z+7 ; 0x07 - 4014: 91 96 adiw r26, 0x21 ; 33 - 4016: 1c 92 st X, r1 - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4018: a6 81 ldd r26, Z+6 ; 0x06 - 401a: b7 81 ldd r27, Z+7 ; 0x07 - 401c: d9 96 adiw r26, 0x39 ; 57 - 401e: 1c 92 st X, r1 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4020: a6 81 ldd r26, Z+6 ; 0x06 - 4022: b7 81 ldd r27, Z+7 ; 0x07 - 4024: d1 96 adiw r26, 0x31 ; 49 - 4026: 1c 92 st X, r1 - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 4028: a6 81 ldd r26, Z+6 ; 0x06 - 402a: b7 81 ldd r27, Z+7 ; 0x07 - 402c: a7 5b subi r26, 0xB7 ; 183 - 402e: bf 4f sbci r27, 0xFF ; 255 - 4030: 1c 92 st X, r1 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4032: a6 81 ldd r26, Z+6 ; 0x06 - 4034: b7 81 ldd r27, Z+7 ; 0x07 - 4036: af 5b subi r26, 0xBF ; 191 - 4038: bf 4f sbci r27, 0xFF ; 255 - 403a: 1c 92 st X, r1 - -void Endpoint_ClearEndpoints(void) -{ - for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) - { - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; - 403c: a6 81 ldd r26, Z+6 ; 0x06 - 403e: b7 81 ldd r27, Z+7 ; 0x07 - 4040: a7 5a subi r26, 0xA7 ; 167 - 4042: bf 4f sbci r27, 0xFF ; 255 - 4044: 1c 92 st X, r1 - ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; - 4046: 06 80 ldd r0, Z+6 ; 0x06 - 4048: f7 81 ldd r31, Z+7 ; 0x07 - 404a: e0 2d mov r30, r0 - 404c: ef 5a subi r30, 0xAF ; 175 - 404e: ff 4f sbci r31, 0xFF ; 255 - 4050: 10 82 st Z, r1 - 4052: 08 95 ret - -00004054 : - } -} - -void Endpoint_ClearStatusStage(void) -{ - if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) - 4054: 80 91 15 27 lds r24, 0x2715 - 4058: 87 ff sbrs r24, 7 - 405a: 05 c0 rjmp .+10 ; 0x4066 - 405c: 0c c0 rjmp .+24 ; 0x4076 - } - else - { - while (!(Endpoint_IsINReady())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - 405e: 80 91 14 27 lds r24, 0x2714 - 4062: 88 23 and r24, r24 - 4064: 61 f0 breq .+24 ; 0x407e - - Endpoint_ClearOUT(); - } - else - { - while (!(Endpoint_IsINReady())) - 4066: 81 de rcall .-766 ; 0x3d6a - 4068: 88 23 and r24, r24 - 406a: c9 f3 breq .-14 ; 0x405e - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - - Endpoint_ClearIN(); - 406c: fd cd rjmp .-1030 ; 0x3c68 -{ - if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) - { - while (!(Endpoint_IsOUTReceived())) - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - 406e: 80 91 14 27 lds r24, 0x2714 - 4072: 88 23 and r24, r24 - 4074: 21 f0 breq .+8 ; 0x407e - -void Endpoint_ClearStatusStage(void) -{ - if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) - { - while (!(Endpoint_IsOUTReceived())) - 4076: 85 de rcall .-758 ; 0x3d82 - 4078: 88 23 and r24, r24 - 407a: c9 f3 breq .-14 ; 0x406e - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - - Endpoint_ClearOUT(); - 407c: 0e ce rjmp .-996 ; 0x3c9a - 407e: 08 95 ret - -00004080 : - } -} - -#if !defined(CONTROL_ONLY_DEVICE) -uint8_t Endpoint_WaitUntilReady(void) -{ - 4080: 1f 93 push r17 - 4082: cf 93 push r28 - 4084: df 93 push r29 - * \return Current USB frame number from the USB controller. - */ - static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; - static inline uint16_t USB_Device_GetFrameNumber(void) - { - return ((USB_EndpointTable_t*)USB.EPPTR)->FrameNum; - 4086: e0 91 c6 04 lds r30, 0x04C6 - 408a: f0 91 c7 04 lds r31, 0x04C7 - 408e: e0 5a subi r30, 0xA0 ; 160 - 4090: ff 4f sbci r31, 0xFF ; 255 - 4092: c0 81 ld r28, Z - 4094: d1 81 ldd r29, Z+1 ; 0x01 - #if (USB_STREAM_TIMEOUT_MS < 0xFF) - uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS; - 4096: 14 e6 ldi r17, 0x64 ; 100 - * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask. - */ - static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; - static inline uint8_t Endpoint_GetEndpointDirection(void) - { - return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN); - 4098: 80 91 21 27 lds r24, 0x2721 - 409c: 80 78 andi r24, 0x80 ; 128 - - uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); - - for (;;) - { - if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) - 409e: 80 38 cpi r24, 0x80 ; 128 - 40a0: 31 f1 breq .+76 ; 0x40ee - if (Endpoint_IsINReady()) - return ENDPOINT_READYWAIT_NoError; - } - else - { - if (Endpoint_IsOUTReceived()) - 40a2: 6f de rcall .-802 ; 0x3d82 - 40a4: 81 11 cpse r24, r1 - 40a6: 26 c0 rjmp .+76 ; 0x40f4 - return ENDPOINT_READYWAIT_NoError; - } - - uint8_t USB_DeviceState_LCL = USB_DeviceState; - 40a8: 80 91 14 27 lds r24, 0x2714 - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - 40ac: 88 23 and r24, r24 - 40ae: 39 f1 breq .+78 ; 0x40fe - return ENDPOINT_READYWAIT_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - 40b0: 85 30 cpi r24, 0x05 ; 5 - 40b2: 51 f1 breq .+84 ; 0x4108 - * \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); - 40b4: e0 91 1f 27 lds r30, 0x271F - 40b8: f0 91 20 27 lds r31, 0x2720 - 40bc: 81 81 ldd r24, Z+1 ; 0x01 - return ENDPOINT_READYWAIT_BusSuspended; - else if (Endpoint_IsStalled()) - 40be: 82 fd sbrc r24, 2 - 40c0: 28 c0 rjmp .+80 ; 0x4112 - 40c2: e0 91 c6 04 lds r30, 0x04C6 - 40c6: f0 91 c7 04 lds r31, 0x04C7 - 40ca: e0 5a subi r30, 0xA0 ; 160 - 40cc: ff 4f sbci r31, 0xFF ; 255 - 40ce: 80 81 ld r24, Z - 40d0: 91 81 ldd r25, Z+1 ; 0x01 - return ENDPOINT_READYWAIT_EndpointStalled; - - uint16_t CurrentFrameNumber = USB_Device_GetFrameNumber(); - - if (CurrentFrameNumber != PreviousFrameNumber) - 40d2: c8 17 cp r28, r24 - 40d4: d9 07 cpc r29, r25 - 40d6: 01 f3 breq .-64 ; 0x4098 - { - PreviousFrameNumber = CurrentFrameNumber; - - if (!(TimeoutMSRem--)) - 40d8: 2f ef ldi r18, 0xFF ; 255 - 40da: 21 0f add r18, r17 - 40dc: 11 23 and r17, r17 - 40de: f1 f0 breq .+60 ; 0x411c - 40e0: ec 01 movw r28, r24 - 40e2: 12 2f mov r17, r18 - * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask. - */ - static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; - static inline uint8_t Endpoint_GetEndpointDirection(void) - { - return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN); - 40e4: 80 91 21 27 lds r24, 0x2721 - 40e8: 80 78 andi r24, 0x80 ; 128 - - uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); - - for (;;) - { - if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) - 40ea: 80 38 cpi r24, 0x80 ; 128 - 40ec: d1 f6 brne .-76 ; 0x40a2 - { - if (Endpoint_IsINReady()) - 40ee: 3d de rcall .-902 ; 0x3d6a - 40f0: 88 23 and r24, r24 - 40f2: d1 f2 breq .-76 ; 0x40a8 - return ENDPOINT_READYWAIT_NoError; - 40f4: 80 e0 ldi r24, 0x00 ; 0 - - if (!(TimeoutMSRem--)) - return ENDPOINT_READYWAIT_Timeout; - } - } -} - 40f6: df 91 pop r29 - 40f8: cf 91 pop r28 - 40fa: 1f 91 pop r17 - 40fc: 08 95 ret - } - - uint8_t USB_DeviceState_LCL = USB_DeviceState; - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_READYWAIT_DeviceDisconnected; - 40fe: 82 e0 ldi r24, 0x02 ; 2 - - if (!(TimeoutMSRem--)) - return ENDPOINT_READYWAIT_Timeout; - } - } -} - 4100: df 91 pop r29 - 4102: cf 91 pop r28 - 4104: 1f 91 pop r17 - 4106: 08 95 ret - uint8_t USB_DeviceState_LCL = USB_DeviceState; - - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_READYWAIT_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_READYWAIT_BusSuspended; - 4108: 83 e0 ldi r24, 0x03 ; 3 - - if (!(TimeoutMSRem--)) - return ENDPOINT_READYWAIT_Timeout; - } - } -} - 410a: df 91 pop r29 - 410c: cf 91 pop r28 - 410e: 1f 91 pop r17 - 4110: 08 95 ret - if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) - return ENDPOINT_READYWAIT_DeviceDisconnected; - else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) - return ENDPOINT_READYWAIT_BusSuspended; - else if (Endpoint_IsStalled()) - return ENDPOINT_READYWAIT_EndpointStalled; - 4112: 81 e0 ldi r24, 0x01 ; 1 - - if (!(TimeoutMSRem--)) - return ENDPOINT_READYWAIT_Timeout; - } - } -} - 4114: df 91 pop r29 - 4116: cf 91 pop r28 - 4118: 1f 91 pop r17 - 411a: 08 95 ret - if (CurrentFrameNumber != PreviousFrameNumber) - { - PreviousFrameNumber = CurrentFrameNumber; - - if (!(TimeoutMSRem--)) - return ENDPOINT_READYWAIT_Timeout; - 411c: 84 e0 ldi r24, 0x04 ; 4 - } - } -} - 411e: df 91 pop r29 - 4120: cf 91 pop r28 - 4122: 1f 91 pop r17 - 4124: 08 95 ret - -00004126 : - USB_ResetInterface(); -} - -void USB_Disable(void) -{ - USB_INT_DisableAllInterrupts(); - 4126: 62 d0 rcall .+196 ; 0x41ec - USB_INT_ClearAllInterrupts(); - 4128: 68 d0 rcall .+208 ; 0x41fa - * 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; - 412a: e0 ec ldi r30, 0xC0 ; 192 - 412c: f4 e0 ldi r31, 0x04 ; 4 - 412e: 81 81 ldd r24, Z+1 ; 0x01 - 4130: 8e 7f andi r24, 0xFE ; 254 - 4132: 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; - 4134: 80 81 ld r24, Z - 4136: 8f 77 andi r24, 0x7F ; 127 - 4138: 80 83 st Z, r24 - - USB_Detach(); - USB_Controller_Disable(); - - USB_IsInitialized = false; - 413a: 10 92 13 27 sts 0x2713, r1 - 413e: 08 95 ret - -00004140 : -} - -void USB_ResetInterface(void) -{ - 4140: cf 93 push r28 - 4142: 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); - 4144: e0 e4 ldi r30, 0x40 ; 64 - 4146: f0 e0 ldi r31, 0x00 ; 0 - 4148: 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); - 414a: 84 81 ldd r24, Z+4 ; 0x04 - 414c: 81 60 ori r24, 0x01 ; 1 - 414e: 84 83 std Z+4, r24 ; 0x04 - else - CLK.USBCTRL |= (CLK_USBSRC_RC32M_gc | CLK_USBSEN_bm); - - USB_Device_SetDeviceAddress(0); - - USB_INT_DisableAllInterrupts(); - 4150: 4d d0 rcall .+154 ; 0x41ec - USB_INT_ClearAllInterrupts(); - 4152: 53 d0 rcall .+166 ; 0x41fa - } - - static inline void USB_Controller_Reset(void) ATTR_ALWAYS_INLINE; - static inline void USB_Controller_Reset(void) - { - USB.CTRLA &= ~USB_ENABLE_bm; - 4154: c0 ec ldi r28, 0xC0 ; 192 - 4156: d4 e0 ldi r29, 0x04 ; 4 - 4158: 88 81 ld r24, Y - 415a: 8f 77 andi r24, 0x7F ; 127 - 415c: 88 83 st Y, r24 - USB.CTRLA |= USB_ENABLE_bm; - 415e: 88 81 ld r24, Y - 4160: 80 68 ori r24, 0x80 ; 128 - 4162: 88 83 st Y, r24 -} - -#if defined(USB_CAN_BE_DEVICE) -static void USB_Init_Device(void) -{ - USB_DeviceState = DEVICE_STATE_Unattached; - 4164: 10 92 14 27 sts 0x2714, r1 - USB_Device_ConfigurationNumber = 0; - 4168: 10 92 10 27 sts 0x2710, r1 - - #if !defined(NO_DEVICE_REMOTE_WAKEUP) - USB_Device_RemoteWakeupEnabled = false; - 416c: 10 92 12 27 sts 0x2712, r1 - #endif - - #if !defined(NO_DEVICE_SELF_POWER) - USB_Device_CurrentlySelfPowered = false; - 4170: 10 92 11 27 sts 0x2711, r1 - } - - static inline void USB_Device_SetFullSpeed(void) ATTR_ALWAYS_INLINE; - static inline void USB_Device_SetFullSpeed(void) - { - USB.CTRLA |= USB_SPEED_bm; - 4174: 88 81 ld r24, Y - 4176: 80 64 ori r24, 0x40 ; 64 - 4178: 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); - 417a: 48 e0 ldi r20, 0x08 ; 8 - 417c: 68 e4 ldi r22, 0x48 ; 72 - 417e: 80 e8 ldi r24, 0x80 ; 128 - 4180: 7a de rcall .-780 ; 0x3e76 - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 4182: 48 e0 ldi r20, 0x08 ; 8 - 4184: 68 e4 ldi r22, 0x48 ; 72 - 4186: 80 e0 ldi r24, 0x00 ; 0 - 4188: 76 de rcall .-788 ; 0x3e76 - static inline void USB_INT_Enable(const uint8_t Interrupt) - { - switch (Interrupt) - { - case USB_INT_BUSEVENTI: - USB.INTCTRLA |= USB_BUSEVIE_bm; - 418a: 88 85 ldd r24, Y+8 ; 0x08 - 418c: 80 64 ori r24, 0x40 ; 64 - 418e: 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; - 4190: 89 81 ldd r24, Y+1 ; 0x01 - 4192: 81 60 ori r24, 0x01 ; 1 - 4194: 89 83 std Y+1, r24 ; 0x01 - USB_INT_DisableAllInterrupts(); - USB_INT_ClearAllInterrupts(); - - USB_Controller_Reset(); - USB_Init_Device(); -} - 4196: df 91 pop r29 - 4198: cf 91 pop r28 - 419a: 08 95 ret - -0000419c : - #if (ARCH == ARCH_AVR8) - return SREG; - #elif (ARCH == ARCH_UC3) - return __builtin_mfsr(AVR32_SR); - #elif (ARCH == ARCH_XMEGA) - return SREG; - 419c: 2f b7 in r18, 0x3f ; 63 - #if (ARCH == ARCH_AVR8) - cli(); - #elif (ARCH == ARCH_UC3) - __builtin_ssrf(AVR32_SR_GM_OFFSET); - #elif (ARCH == ARCH_XMEGA) - cli(); - 419e: f8 94 cli - #endif - - uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); - GlobalInterruptDisable(); - - NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; - 41a0: 82 e0 ldi r24, 0x02 ; 2 - 41a2: e0 ec ldi r30, 0xC0 ; 192 - 41a4: f1 e0 ldi r31, 0x01 ; 1 - 41a6: 82 87 std Z+10, r24 ; 0x0a - USB.CAL0 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL0)); - 41a8: ea e1 ldi r30, 0x1A ; 26 - 41aa: f0 e0 ldi r31, 0x00 ; 0 - 41ac: e4 91 lpm r30, Z - 41ae: a0 ec ldi r26, 0xC0 ; 192 - 41b0: b4 e0 ldi r27, 0x04 ; 4 - 41b2: da 96 adiw r26, 0x3a ; 58 - 41b4: ec 93 st X, r30 - 41b6: da 97 sbiw r26, 0x3a ; 58 - USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1)); - 41b8: eb e1 ldi r30, 0x1B ; 27 - 41ba: f0 e0 ldi r31, 0x00 ; 0 - 41bc: e4 91 lpm r30, Z - 41be: db 96 adiw r26, 0x3b ; 59 - 41c0: ec 93 st X, r30 - 41c2: db 97 sbiw r26, 0x3b ; 59 - NVM.CMD = NVM_CMD_NO_OPERATION_gc; - 41c4: e0 ec ldi r30, 0xC0 ; 192 - 41c6: f1 e0 ldi r31, 0x01 ; 1 - 41c8: 12 86 std Z+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)); - 41ca: 8b e3 ldi r24, 0x3B ; 59 - 41cc: 9a e2 ldi r25, 0x2A ; 42 - 41ce: 8e 7f andi r24, 0xFE ; 254 - 41d0: 16 96 adiw r26, 0x06 ; 6 - 41d2: 8d 93 st X+, r24 - 41d4: 9c 93 st X, r25 - 41d6: 17 97 sbiw r26, 0x07 ; 7 - USB.CTRLA = (USB_STFRNUM_bm | ((ENDPOINT_TOTAL_ENDPOINTS - 1) << USB_MAXEP_gp)); - 41d8: 85 e1 ldi r24, 0x15 ; 21 - 41da: 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); - 41dc: 82 e0 ldi r24, 0x02 ; 2 - 41de: 18 96 adiw r26, 0x08 ; 8 - 41e0: 8c 93 st X, r24 - if (GlobalIntState & AVR32_SR_GM) - __builtin_ssrf(AVR32_SR_GM_OFFSET); - else - __builtin_csrf(AVR32_SR_GM_OFFSET); - #elif (ARCH == ARCH_XMEGA) - SREG = GlobalIntState; - 41e2: 2f bf out 0x3f, r18 ; 63 - - #if defined(USB_CAN_BE_BOTH) - USB_CurrentMode = Mode; - #endif - - USB_IsInitialized = true; - 41e4: 81 e0 ldi r24, 0x01 ; 1 - 41e6: 80 93 13 27 sts 0x2713, r24 - - USB_ResetInterface(); - 41ea: aa cf rjmp .-172 ; 0x4140 - -000041ec : -#define __INCLUDE_FROM_USB_DRIVER -#include "../USBInterrupt.h" - -void USB_INT_DisableAllInterrupts(void) -{ - USB.INTCTRLA &= USB_INTLVL_gm; - 41ec: e0 ec ldi r30, 0xC0 ; 192 - 41ee: f4 e0 ldi r31, 0x04 ; 4 - 41f0: 80 85 ldd r24, Z+8 ; 0x08 - 41f2: 83 70 andi r24, 0x03 ; 3 - 41f4: 80 87 std Z+8, r24 ; 0x08 - USB.INTCTRLB = 0; - 41f6: 11 86 std Z+9, r1 ; 0x09 - 41f8: 08 95 ret - -000041fa : -} - -void USB_INT_ClearAllInterrupts(void) -{ - USB.INTFLAGSACLR = 0xFF; - 41fa: e0 ec ldi r30, 0xC0 ; 192 - 41fc: f4 e0 ldi r31, 0x04 ; 4 - 41fe: 8f ef ldi r24, 0xFF ; 255 - 4200: 82 87 std Z+10, r24 ; 0x0a - USB.INTFLAGSBCLR = 0xFF; - 4202: 84 87 std Z+12, r24 ; 0x0c - 4204: 08 95 ret - -00004206 <__vector_125>: -} - -ISR(USB_BUSEVENT_vect) -{ - 4206: 1f 92 push r1 - 4208: 0f 92 push r0 - 420a: 0f b6 in r0, 0x3f ; 63 - 420c: 0f 92 push r0 - 420e: 11 24 eor r1, r1 - 4210: 2f 93 push r18 - 4212: 3f 93 push r19 - 4214: 4f 93 push r20 - 4216: 5f 93 push r21 - 4218: 6f 93 push r22 - 421a: 7f 93 push r23 - 421c: 8f 93 push r24 - 421e: 9f 93 push r25 - 4220: af 93 push r26 - 4222: bf 93 push r27 - 4224: ef 93 push r30 - 4226: 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); - 4228: 80 91 ca 04 lds r24, 0x04CA - #if !defined(NO_SOF_EVENTS) - if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) - 422c: 87 fd sbrc r24, 7 - 422e: 4d c0 rjmp .+154 ; 0x42ca <__vector_125+0xc4> - static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) - { - switch (Interrupt) - { - case USB_INT_BUSEVENTI_Suspend: - return ((USB.INTFLAGSACLR & USB_SUSPENDIF_bm) ? true : false); - 4230: 80 91 ca 04 lds r24, 0x04CA - - EVENT_USB_Device_StartOfFrame(); - } - #endif - - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) - 4234: 86 fd sbrc r24, 6 - 4236: 41 c0 rjmp .+130 ; 0x42ba <__vector_125+0xb4> - case USB_INT_BUSEVENTI_Resume: - return ((USB.INTFLAGSACLR & USB_RESUMEIF_bm) ? true : false); - 4238: 80 91 ca 04 lds r24, 0x04CA - USB_DeviceState = DEVICE_STATE_Suspended; - EVENT_USB_Device_Suspend(); - #endif - } - - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Resume)) - 423c: 85 ff sbrs r24, 5 - 423e: 0c c0 rjmp .+24 ; 0x4258 <__vector_125+0x52> - { - case USB_INT_BUSEVENTI_Suspend: - USB.INTFLAGSACLR = USB_SUSPENDIF_bm; - break; - case USB_INT_BUSEVENTI_Resume: - USB.INTFLAGSACLR = USB_RESUMEIF_bm; - 4240: 80 e2 ldi r24, 0x20 ; 32 - 4242: 80 93 ca 04 sts 0x04CA, r24 - { - USB_INT_Clear(USB_INT_BUSEVENTI_Resume); - - if (USB_Device_ConfigurationNumber) - 4246: 80 91 10 27 lds r24, 0x2710 - 424a: 88 23 and r24, r24 - 424c: 71 f1 breq .+92 ; 0x42aa <__vector_125+0xa4> - USB_DeviceState = DEVICE_STATE_Configured; - 424e: 84 e0 ldi r24, 0x04 ; 4 - 4250: 80 93 14 27 sts 0x2714, r24 - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; - - #if !defined(NO_LIMITED_CONTROLLER_CONNECT) - EVENT_USB_Device_Connect(); - 4254: 0e 94 02 0d call 0x1a04 ; 0x1a04 - 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); - 4258: 80 91 ca 04 lds r24, 0x04CA - #else - EVENT_USB_Device_WakeUp(); - #endif - } - - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Reset)) - 425c: 84 ff sbrs r24, 4 - 425e: 14 c0 rjmp .+40 ; 0x4288 <__vector_125+0x82> - break; - case USB_INT_BUSEVENTI_Resume: - USB.INTFLAGSACLR = USB_RESUMEIF_bm; - break; - case USB_INT_BUSEVENTI_Reset: - USB.INTFLAGSACLR = USB_RSTIF_bm; - 4260: 80 e1 ldi r24, 0x10 ; 16 - 4262: 80 93 ca 04 sts 0x04CA, r24 - { - USB_INT_Clear(USB_INT_BUSEVENTI_Reset); - - USB_DeviceState = DEVICE_STATE_Default; - 4266: 82 e0 ldi r24, 0x02 ; 2 - 4268: 80 93 14 27 sts 0x2714, r24 - USB_Device_ConfigurationNumber = 0; - 426c: 10 92 10 27 sts 0x2710, r1 - } - - static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; - static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) - { - USB.ADDR = Address; - 4270: 10 92 c3 04 sts 0x04C3, r1 - - USB_Device_EnableDeviceAddress(0); - - Endpoint_ClearEndpoints(); - 4274: b7 de rcall .-658 ; 0x3fe4 - EPConfigMask |= USB_EP_TYPE_BULK_gc; - break; - } - - if (Type == EP_TYPE_CONTROL) - Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); - 4276: 48 e0 ldi r20, 0x08 ; 8 - 4278: 68 e4 ldi r22, 0x48 ; 72 - 427a: 80 e8 ldi r24, 0x80 ; 128 - 427c: fc dd rcall .-1032 ; 0x3e76 - - return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); - 427e: 48 e0 ldi r20, 0x08 ; 8 - 4280: 68 e4 ldi r22, 0x48 ; 72 - 4282: 80 e0 ldi r24, 0x00 ; 0 - 4284: f8 dd rcall .-1040 ; 0x3e76 - Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL, - USB_Device_ControlEndpointSize, 1); - - EVENT_USB_Device_Reset(); - 4286: 35 db rcall .-2454 ; 0x38f2 - } -} - 4288: ff 91 pop r31 - 428a: ef 91 pop r30 - 428c: bf 91 pop r27 - 428e: af 91 pop r26 - 4290: 9f 91 pop r25 - 4292: 8f 91 pop r24 - 4294: 7f 91 pop r23 - 4296: 6f 91 pop r22 - 4298: 5f 91 pop r21 - 429a: 4f 91 pop r20 - 429c: 3f 91 pop r19 - 429e: 2f 91 pop r18 - 42a0: 0f 90 pop r0 - 42a2: 0f be out 0x3f, r0 ; 63 - 42a4: 0f 90 pop r0 - 42a6: 1f 90 pop r1 - 42a8: 18 95 reti - } - - static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; - static inline bool USB_Device_IsAddressSet(void) - { - return ((USB.ADDR != 0) ? true : false); - 42aa: 80 91 c3 04 lds r24, 0x04C3 - USB_INT_Clear(USB_INT_BUSEVENTI_Resume); - - if (USB_Device_ConfigurationNumber) - USB_DeviceState = DEVICE_STATE_Configured; - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; - 42ae: 81 11 cpse r24, r1 - 42b0: 15 c0 rjmp .+42 ; 0x42dc <__vector_125+0xd6> - 42b2: 81 e0 ldi r24, 0x01 ; 1 - 42b4: 80 93 14 27 sts 0x2714, r24 - 42b8: cd cf rjmp .-102 ; 0x4254 <__vector_125+0x4e> - static inline void USB_INT_Clear(const uint8_t Interrupt) - { - switch (Interrupt) - { - case USB_INT_BUSEVENTI_Suspend: - USB.INTFLAGSACLR = USB_SUSPENDIF_bm; - 42ba: 80 e4 ldi r24, 0x40 ; 64 - 42bc: 80 93 ca 04 sts 0x04CA, r24 - if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) - { - USB_INT_Clear(USB_INT_BUSEVENTI_Suspend); - - #if !defined(NO_LIMITED_CONTROLLER_CONNECT) - USB_DeviceState = DEVICE_STATE_Unattached; - 42c0: 10 92 14 27 sts 0x2714, r1 - EVENT_USB_Device_Disconnect(); - 42c4: 0e 94 07 0d call 0x1a0e ; 0x1a0e - 42c8: b7 cf rjmp .-146 ; 0x4238 <__vector_125+0x32> - switch (Interrupt) - { - case USB_INT_BUSEVENTI: - return ((USB.INTCTRLA & USB_BUSEVIE_bm) ? true : false); - case USB_INT_SOFI: - return ((USB.INTCTRLA & USB_SOFIE_bm) ? true : false); - 42ca: 80 91 c8 04 lds r24, 0x04C8 -} - -ISR(USB_BUSEVENT_vect) -{ - #if !defined(NO_SOF_EVENTS) - if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) - 42ce: 87 ff sbrs r24, 7 - 42d0: af cf rjmp .-162 ; 0x4230 <__vector_125+0x2a> - break; - case USB_INT_BUSEVENTI_Reset: - USB.INTFLAGSACLR = USB_RSTIF_bm; - break; - case USB_INT_SOFI: - USB.INTFLAGSACLR = USB_SOFIF_bm; - 42d2: 80 e8 ldi r24, 0x80 ; 128 - 42d4: 80 93 ca 04 sts 0x04CA, r24 - { - USB_INT_Clear(USB_INT_SOFI); - - EVENT_USB_Device_StartOfFrame(); - 42d8: 0c db rcall .-2536 ; 0x38f2 - 42da: aa cf rjmp .-172 ; 0x4230 <__vector_125+0x2a> - USB_INT_Clear(USB_INT_BUSEVENTI_Resume); - - if (USB_Device_ConfigurationNumber) - USB_DeviceState = DEVICE_STATE_Configured; - else - USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; - 42dc: 83 e0 ldi r24, 0x03 ; 3 - 42de: ea cf rjmp .-44 ; 0x42b4 <__vector_125+0xae> - -000042e0 : - -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); - 42e0: cf 93 push r28 - 42e2: df 93 push r29 - 42e4: ec 01 movw r28, r24 - 42e6: fc 01 movw r30, r24 - 42e8: 70 96 adiw r30, 0x10 ; 16 - 42ea: 8b e0 ldi r24, 0x0B ; 11 - 42ec: df 01 movw r26, r30 - 42ee: 1d 92 st X+, r1 - 42f0: 8a 95 dec r24 - 42f2: e9 f7 brne .-6 ; 0x42ee - 42f4: 82 e0 ldi r24, 0x02 ; 2 - 42f6: 8c 83 std Y+4, r24 ; 0x04 - 42f8: 89 87 std Y+9, r24 ; 0x09 - 42fa: 83 e0 ldi r24, 0x03 ; 3 - 42fc: 8e 87 std Y+14, r24 ; 0x0e - 42fe: 61 e0 ldi r22, 0x01 ; 1 - 4300: ce 01 movw r24, r28 - 4302: 01 96 adiw r24, 0x01 ; 1 - 4304: 03 de rcall .-1018 ; 0x3f0c - 4306: 81 11 cpse r24, r1 - 4308: 04 c0 rjmp .+8 ; 0x4312 - 430a: 80 e0 ldi r24, 0x00 ; 0 - 430c: df 91 pop r29 - 430e: cf 91 pop r28 - 4310: 08 95 ret - 4312: 61 e0 ldi r22, 0x01 ; 1 - 4314: ce 01 movw r24, r28 - 4316: 06 96 adiw r24, 0x06 ; 6 - 4318: f9 dd rcall .-1038 ; 0x3f0c - 431a: 88 23 and r24, r24 - 431c: b1 f3 breq .-20 ; 0x430a - 431e: 61 e0 ldi r22, 0x01 ; 1 - 4320: ce 01 movw r24, r28 - 4322: 0b 96 adiw r24, 0x0b ; 11 - 4324: df 91 pop r29 - 4326: cf 91 pop r28 - 4328: f1 cd rjmp .-1054 ; 0x3f0c - -0000432a : - 432a: cf 93 push r28 - 432c: df 93 push r29 - 432e: eb 01 movw r28, r22 - 4330: 20 91 14 27 lds r18, 0x2714 - 4334: 24 30 cpi r18, 0x04 ; 4 - 4336: 21 f0 breq .+8 ; 0x4340 - 4338: 82 e0 ldi r24, 0x02 ; 2 - 433a: df 91 pop r29 - 433c: cf 91 pop r28 - 433e: 08 95 ret - 4340: fc 01 movw r30, r24 - 4342: 44 89 ldd r20, Z+20 ; 0x14 - 4344: 55 89 ldd r21, Z+21 ; 0x15 - 4346: 66 89 ldd r22, Z+22 ; 0x16 - 4348: 77 89 ldd r23, Z+23 ; 0x17 - 434a: 45 2b or r20, r21 - 434c: 46 2b or r20, r22 - 434e: 47 2b or r20, r23 - 4350: 99 f3 breq .-26 ; 0x4338 - 4352: 81 81 ldd r24, Z+1 ; 0x01 - 4354: d1 dc rcall .-1630 ; 0x3cf8 - 4356: fe 01 movw r30, r28 - 4358: 01 90 ld r0, Z+ - 435a: 00 20 and r0, r0 - 435c: e9 f7 brne .-6 ; 0x4358 - 435e: bf 01 movw r22, r30 - 4360: 61 50 subi r22, 0x01 ; 1 - 4362: 71 09 sbc r23, r1 - 4364: 6c 1b sub r22, r28 - 4366: 7d 0b sbc r23, r29 - 4368: 40 e0 ldi r20, 0x00 ; 0 - 436a: 50 e0 ldi r21, 0x00 ; 0 - 436c: ce 01 movw r24, r28 - 436e: df 91 pop r29 - 4370: cf 91 pop r28 - 4372: d5 ca rjmp .-2646 ; 0x391e - -00004374 : - 4374: ef 92 push r14 - 4376: ff 92 push r15 - 4378: 0f 93 push r16 - 437a: 1f 93 push r17 - 437c: cf 93 push r28 - 437e: df 93 push r29 - 4380: eb 01 movw r28, r22 - 4382: 7a 01 movw r14, r20 - 4384: 20 91 14 27 lds r18, 0x2714 - 4388: 24 30 cpi r18, 0x04 ; 4 - 438a: 41 f0 breq .+16 ; 0x439c - 438c: 82 e0 ldi r24, 0x02 ; 2 - 438e: df 91 pop r29 - 4390: cf 91 pop r28 - 4392: 1f 91 pop r17 - 4394: 0f 91 pop r16 - 4396: ff 90 pop r15 - 4398: ef 90 pop r14 - 439a: 08 95 ret - 439c: fc 01 movw r30, r24 - 439e: 04 89 ldd r16, Z+20 ; 0x14 - 43a0: 15 89 ldd r17, Z+21 ; 0x15 - 43a2: 26 89 ldd r18, Z+22 ; 0x16 - 43a4: 37 89 ldd r19, Z+23 ; 0x17 - 43a6: 01 2b or r16, r17 - 43a8: 02 2b or r16, r18 - 43aa: 03 2b or r16, r19 - 43ac: 79 f3 breq .-34 ; 0x438c - 43ae: 81 81 ldd r24, Z+1 ; 0x01 - 43b0: a3 dc rcall .-1722 ; 0x3cf8 - 43b2: 40 e0 ldi r20, 0x00 ; 0 - 43b4: 50 e0 ldi r21, 0x00 ; 0 - 43b6: b7 01 movw r22, r14 - 43b8: ce 01 movw r24, r28 - 43ba: df 91 pop r29 - 43bc: cf 91 pop r28 - 43be: 1f 91 pop r17 - 43c0: 0f 91 pop r16 - 43c2: ff 90 pop r15 - 43c4: ef 90 pop r14 - 43c6: ab ca rjmp .-2730 ; 0x391e - -000043c8 : - 43c8: 0f 93 push r16 - 43ca: 1f 93 push r17 - 43cc: cf 93 push r28 - 43ce: df 93 push r29 - 43d0: 1f 92 push r1 - 43d2: cd b7 in r28, 0x3d ; 61 - 43d4: de b7 in r29, 0x3e ; 62 - 43d6: 20 91 14 27 lds r18, 0x2714 - 43da: 24 30 cpi r18, 0x04 ; 4 - 43dc: 39 f0 breq .+14 ; 0x43ec - 43de: 82 e0 ldi r24, 0x02 ; 2 - 43e0: 0f 90 pop r0 - 43e2: df 91 pop r29 - 43e4: cf 91 pop r28 - 43e6: 1f 91 pop r17 - 43e8: 0f 91 pop r16 - 43ea: 08 95 ret - 43ec: fc 01 movw r30, r24 - 43ee: 04 89 ldd r16, Z+20 ; 0x14 - 43f0: 15 89 ldd r17, Z+21 ; 0x15 - 43f2: 26 89 ldd r18, Z+22 ; 0x16 - 43f4: 37 89 ldd r19, Z+23 ; 0x17 - 43f6: 01 2b or r16, r17 - 43f8: 02 2b or r16, r18 - 43fa: 03 2b or r16, r19 - 43fc: 81 f3 breq .-32 ; 0x43de - 43fe: 81 81 ldd r24, Z+1 ; 0x01 - 4400: 69 83 std Y+1, r22 ; 0x01 - 4402: 7a dc rcall .-1804 ; 0x3cf8 - 4404: 20 91 1d 27 lds r18, 0x271D - 4408: 30 91 1e 27 lds r19, 0x271E - 440c: f9 01 movw r30, r18 - 440e: ef 5b subi r30, 0xBF ; 191 - 4410: ff 4f sbci r31, 0xFF ; 255 - 4412: 90 81 ld r25, Z - 4414: 31 97 sbiw r30, 0x01 ; 1 - 4416: 80 81 ld r24, Z - 4418: 69 81 ldd r22, Y+1 ; 0x01 - 441a: 98 17 cp r25, r24 - 441c: 30 f0 brcs .+12 ; 0x442a - 441e: 69 83 std Y+1, r22 ; 0x01 - 4420: 23 dc rcall .-1978 ; 0x3c68 - 4422: 2e de rcall .-932 ; 0x4080 - 4424: 69 81 ldd r22, Y+1 ; 0x01 - 4426: 81 11 cpse r24, r1 - 4428: db cf rjmp .-74 ; 0x43e0 - 442a: 86 2f mov r24, r22 - 442c: 55 dc rcall .-1878 ; 0x3cd8 - 442e: 80 e0 ldi r24, 0x00 ; 0 - 4430: d7 cf rjmp .-82 ; 0x43e0 - -00004432 : - 4432: cf 93 push r28 - 4434: df 93 push r29 - 4436: 20 91 14 27 lds r18, 0x2714 - 443a: 24 30 cpi r18, 0x04 ; 4 - 443c: 21 f0 breq .+8 ; 0x4446 - 443e: 82 e0 ldi r24, 0x02 ; 2 - 4440: df 91 pop r29 - 4442: cf 91 pop r28 - 4444: 08 95 ret - 4446: fc 01 movw r30, r24 - 4448: 44 89 ldd r20, Z+20 ; 0x14 - 444a: 55 89 ldd r21, Z+21 ; 0x15 - 444c: 66 89 ldd r22, Z+22 ; 0x16 - 444e: 77 89 ldd r23, Z+23 ; 0x17 - 4450: 45 2b or r20, r21 - 4452: 46 2b or r20, r22 - 4454: 47 2b or r20, r23 - 4456: 99 f3 breq .-26 ; 0x443e - 4458: 81 81 ldd r24, Z+1 ; 0x01 - 445a: 4e dc rcall .-1892 ; 0x3cf8 - 445c: 80 91 21 27 lds r24, 0x2721 - 4460: 20 91 1d 27 lds r18, 0x271D - 4464: 30 91 1e 27 lds r19, 0x271E - 4468: f9 01 movw r30, r18 - 446a: 87 fd sbrc r24, 7 - 446c: 1b c0 rjmp .+54 ; 0x44a4 - 446e: e0 5c subi r30, 0xC0 ; 192 - 4470: ff 4f sbci r31, 0xFF ; 255 - 4472: 80 81 ld r24, Z - 4474: 31 96 adiw r30, 0x01 ; 1 - 4476: 40 81 ld r20, Z - 4478: 90 e0 ldi r25, 0x00 ; 0 - 447a: 84 1b sub r24, r20 - 447c: 91 09 sbc r25, r1 - 447e: 89 2b or r24, r25 - 4480: 11 f4 brne .+4 ; 0x4486 - 4482: 80 e0 ldi r24, 0x00 ; 0 - 4484: dd cf rjmp .-70 ; 0x4440 - 4486: f9 01 movw r30, r18 - 4488: ef 5b subi r30, 0xBF ; 191 - 448a: ff 4f sbci r31, 0xFF ; 255 - 448c: d0 81 ld r29, Z - 448e: 31 97 sbiw r30, 0x01 ; 1 - 4490: c0 81 ld r28, Z - 4492: ea db rcall .-2092 ; 0x3c68 - 4494: dc 17 cp r29, r28 - 4496: a8 f3 brcs .-22 ; 0x4482 - 4498: f3 dd rcall .-1050 ; 0x4080 - 449a: 81 11 cpse r24, r1 - 449c: d1 cf rjmp .-94 ; 0x4440 - 449e: e4 db rcall .-2104 ; 0x3c68 - 44a0: 80 e0 ldi r24, 0x00 ; 0 - 44a2: ce cf rjmp .-100 ; 0x4440 - 44a4: ef 5b subi r30, 0xBF ; 191 - 44a6: ff 4f sbci r31, 0xFF ; 255 - 44a8: 80 81 ld r24, Z - 44aa: 90 e0 ldi r25, 0x00 ; 0 - 44ac: e8 cf rjmp .-48 ; 0x447e - -000044ae : - 44ae: cf 93 push r28 - 44b0: df 93 push r29 - 44b2: ec 01 movw r28, r24 - 44b4: 80 91 14 27 lds r24, 0x2714 - 44b8: 84 30 cpi r24, 0x04 ; 4 - 44ba: 19 f0 breq .+6 ; 0x44c2 - 44bc: df 91 pop r29 - 44be: cf 91 pop r28 - 44c0: 08 95 ret - 44c2: 4c 89 ldd r20, Y+20 ; 0x14 - 44c4: 5d 89 ldd r21, Y+21 ; 0x15 - 44c6: 6e 89 ldd r22, Y+22 ; 0x16 - 44c8: 7f 89 ldd r23, Y+23 ; 0x17 - 44ca: 45 2b or r20, r21 - 44cc: 46 2b or r20, r22 - 44ce: 47 2b or r20, r23 - 44d0: a9 f3 breq .-22 ; 0x44bc - 44d2: 89 81 ldd r24, Y+1 ; 0x01 - 44d4: 11 dc rcall .-2014 ; 0x3cf8 - 44d6: 49 dc rcall .-1902 ; 0x3d6a - 44d8: 88 23 and r24, r24 - 44da: 81 f3 breq .-32 ; 0x44bc - 44dc: ce 01 movw r24, r28 - 44de: df 91 pop r29 - 44e0: cf 91 pop r28 - 44e2: a7 cf rjmp .-178 ; 0x4432 - -000044e4 : - 44e4: cf 93 push r28 - 44e6: df 93 push r29 - 44e8: 20 91 14 27 lds r18, 0x2714 - 44ec: 24 30 cpi r18, 0x04 ; 4 - 44ee: a9 f5 brne .+106 ; 0x455a - 44f0: fc 01 movw r30, r24 - 44f2: 44 89 ldd r20, Z+20 ; 0x14 - 44f4: 55 89 ldd r21, Z+21 ; 0x15 - 44f6: 66 89 ldd r22, Z+22 ; 0x16 - 44f8: 77 89 ldd r23, Z+23 ; 0x17 - 44fa: 45 2b or r20, r21 - 44fc: 46 2b or r20, r22 - 44fe: 47 2b or r20, r23 - 4500: 61 f1 breq .+88 ; 0x455a - 4502: 86 81 ldd r24, Z+6 ; 0x06 - 4504: f9 db rcall .-2062 ; 0x3cf8 - 4506: 3d dc rcall .-1926 ; 0x3d82 - 4508: 88 23 and r24, r24 - 450a: 39 f1 breq .+78 ; 0x455a - 450c: 80 91 21 27 lds r24, 0x2721 - 4510: 40 91 1d 27 lds r20, 0x271D - 4514: 50 91 1e 27 lds r21, 0x271E - 4518: fa 01 movw r30, r20 - 451a: 87 fd sbrc r24, 7 - 451c: 3a c0 rjmp .+116 ; 0x4592 - 451e: e0 5c subi r30, 0xC0 ; 192 - 4520: ff 4f sbci r31, 0xFF ; 255 - 4522: 80 81 ld r24, Z - 4524: 31 96 adiw r30, 0x01 ; 1 - 4526: 20 81 ld r18, Z - 4528: 90 e0 ldi r25, 0x00 ; 0 - 452a: 82 1b sub r24, r18 - 452c: 91 09 sbc r25, r1 - 452e: 89 2b or r24, r25 - 4530: c9 f4 brne .+50 ; 0x4564 - 4532: cf ef ldi r28, 0xFF ; 255 - 4534: df ef ldi r29, 0xFF ; 255 - 4536: 80 91 21 27 lds r24, 0x2721 - 453a: fa 01 movw r30, r20 - 453c: 87 fd sbrc r24, 7 - 453e: 1e c0 rjmp .+60 ; 0x457c - 4540: e0 5c subi r30, 0xC0 ; 192 - 4542: ff 4f sbci r31, 0xFF ; 255 - 4544: 20 81 ld r18, Z - 4546: 31 96 adiw r30, 0x01 ; 1 - 4548: 80 81 ld r24, Z - 454a: 30 e0 ldi r19, 0x00 ; 0 - 454c: 28 1b sub r18, r24 - 454e: 31 09 sbc r19, r1 - 4550: d9 f0 breq .+54 ; 0x4588 - 4552: ce 01 movw r24, r28 - 4554: df 91 pop r29 - 4556: cf 91 pop r28 - 4558: 08 95 ret - 455a: 8f ef ldi r24, 0xFF ; 255 - 455c: 9f ef ldi r25, 0xFF ; 255 - 455e: df 91 pop r29 - 4560: cf 91 pop r28 - 4562: 08 95 ret - 4564: a9 db rcall .-2222 ; 0x3cb8 - 4566: c8 2f mov r28, r24 - 4568: d0 e0 ldi r29, 0x00 ; 0 - 456a: 40 91 1d 27 lds r20, 0x271D - 456e: 50 91 1e 27 lds r21, 0x271E - 4572: 80 91 21 27 lds r24, 0x2721 - 4576: fa 01 movw r30, r20 - 4578: 87 ff sbrs r24, 7 - 457a: e2 cf rjmp .-60 ; 0x4540 - 457c: ef 5b subi r30, 0xBF ; 191 - 457e: ff 4f sbci r31, 0xFF ; 255 - 4580: 20 81 ld r18, Z - 4582: 30 e0 ldi r19, 0x00 ; 0 - 4584: 23 2b or r18, r19 - 4586: 29 f7 brne .-54 ; 0x4552 - 4588: 88 db rcall .-2288 ; 0x3c9a - 458a: ce 01 movw r24, r28 - 458c: df 91 pop r29 - 458e: cf 91 pop r28 - 4590: 08 95 ret - 4592: ef 5b subi r30, 0xBF ; 191 - 4594: ff 4f sbci r31, 0xFF ; 255 - 4596: 80 81 ld r24, Z - 4598: 90 e0 ldi r25, 0x00 ; 0 - 459a: c9 cf rjmp .-110 ; 0x452e - -0000459c : - return ReceivedByte; -} -#endif - -void CDC_Device_Event_Stub(void) -{ - 459c: 08 95 ret - -0000459e : -#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) -{ - 459e: ff 92 push r15 - 45a0: 0f 93 push r16 - 45a2: 1f 93 push r17 - 45a4: cf 93 push r28 - 45a6: df 93 push r29 - 45a8: ec 01 movw r28, r24 - if (!(Endpoint_IsSETUPReceived())) - 45aa: 04 dc rcall .-2040 ; 0x3db4 - 45ac: 88 23 and r24, r24 - 45ae: 49 f0 breq .+18 ; 0x45c2 - return; - - if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) - 45b0: 88 81 ld r24, Y - 45b2: 90 e0 ldi r25, 0x00 ; 0 - 45b4: 20 91 19 27 lds r18, 0x2719 - 45b8: 30 91 1a 27 lds r19, 0x271A - 45bc: 28 17 cp r18, r24 - 45be: 39 07 cpc r19, r25 - 45c0: 31 f0 breq .+12 ; 0x45ce - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 45c2: df 91 pop r29 - 45c4: cf 91 pop r28 - 45c6: 1f 91 pop r17 - 45c8: 0f 91 pop r16 - 45ca: ff 90 pop r15 - 45cc: 08 95 ret - return; - - if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) - return; - - switch (USB_ControlRequest.bRequest) - 45ce: 80 91 16 27 lds r24, 0x2716 - 45d2: 81 32 cpi r24, 0x21 ; 33 - 45d4: 09 f4 brne .+2 ; 0x45d8 - 45d6: 48 c0 rjmp .+144 ; 0x4668 - 45d8: a0 f0 brcs .+40 ; 0x4602 - 45da: 82 32 cpi r24, 0x22 ; 34 - 45dc: 09 f4 brne .+2 ; 0x45e0 - 45de: 65 c0 rjmp .+202 ; 0x46aa - 45e0: 83 32 cpi r24, 0x23 ; 35 - 45e2: 79 f7 brne .-34 ; 0x45c2 - EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - } - - break; - case CDC_REQ_SendBreak: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 45e4: 80 91 15 27 lds r24, 0x2715 - 45e8: 81 32 cpi r24, 0x21 ; 33 - 45ea: 59 f7 brne .-42 ; 0x45c2 - { - Endpoint_ClearSETUP(); - 45ec: fc db rcall .-2056 ; 0x3de6 - Endpoint_ClearStatusStage(); - 45ee: 32 dd rcall .-1436 ; 0x4054 - - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - 45f0: 60 91 17 27 lds r22, 0x2717 - 45f4: ce 01 movw r24, r28 - } - - break; - } -} - 45f6: df 91 pop r29 - 45f8: cf 91 pop r28 - 45fa: 1f 91 pop r17 - 45fc: 0f 91 pop r16 - 45fe: 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); - 4600: cd cf rjmp .-102 ; 0x459c - return; - - if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) - return; - - switch (USB_ControlRequest.bRequest) - 4602: 80 32 cpi r24, 0x20 ; 32 - 4604: f1 f6 brne .-68 ; 0x45c2 - Endpoint_ClearStatusStage(); - } - - break; - case CDC_REQ_SetLineEncoding: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 4606: 80 91 15 27 lds r24, 0x2715 - 460a: 81 32 cpi r24, 0x21 ; 33 - 460c: d1 f6 brne .-76 ; 0x45c2 - { - Endpoint_ClearSETUP(); - 460e: eb db rcall .-2090 ; 0x3de6 - - while (!(Endpoint_IsOUTReceived())) - 4610: 04 c0 rjmp .+8 ; 0x461a - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - 4612: 80 91 14 27 lds r24, 0x2714 - 4616: 88 23 and r24, r24 - 4618: a1 f2 breq .-88 ; 0x45c2 - case CDC_REQ_SetLineEncoding: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - { - Endpoint_ClearSETUP(); - - while (!(Endpoint_IsOUTReceived())) - 461a: b3 db rcall .-2202 ; 0x3d82 - 461c: 88 23 and r24, r24 - 461e: c9 f3 breq .-14 ; 0x4612 - * \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(); - 4620: 4b db rcall .-2410 ; 0x3cb8 - 4622: 08 2f mov r16, r24 - uint32_t Byte1 = Endpoint_Read_8(); - 4624: 49 db rcall .-2414 ; 0x3cb8 - 4626: 18 2f mov r17, r24 - uint32_t Byte2 = Endpoint_Read_8(); - 4628: 47 db rcall .-2418 ; 0x3cb8 - 462a: f8 2e mov r15, r24 - uint32_t Byte3 = Endpoint_Read_8(); - 462c: 45 db rcall .-2422 ; 0x3cb8 - 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(); - 462e: 4f 2d mov r20, r15 - 4630: 50 e0 ldi r21, 0x00 ; 0 - 4632: 60 e0 ldi r22, 0x00 ; 0 - 4634: 70 e0 ldi r23, 0x00 ; 0 - uint32_t Byte3 = Endpoint_Read_8(); - - return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0); - 4636: ba 01 movw r22, r20 - 4638: 55 27 eor r21, r21 - 463a: 44 27 eor r20, r20 - 463c: 78 2b or r23, r24 - 463e: 40 2b or r20, r16 - 4640: 51 2b or r21, r17 - { - if (USB_DeviceState == DEVICE_STATE_Unattached) - return; - } - - CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE(); - 4642: 4c 8b std Y+20, r20 ; 0x14 - 4644: 5d 8b std Y+21, r21 ; 0x15 - 4646: 6e 8b std Y+22, r22 ; 0x16 - 4648: 7f 8b std Y+23, r23 ; 0x17 - CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8(); - 464a: 36 db rcall .-2452 ; 0x3cb8 - 464c: 88 8f std Y+24, r24 ; 0x18 - CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8(); - 464e: 34 db rcall .-2456 ; 0x3cb8 - 4650: 89 8f std Y+25, r24 ; 0x19 - CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); - 4652: 32 db rcall .-2460 ; 0x3cb8 - 4654: 8a 8f std Y+26, r24 ; 0x1a - - Endpoint_ClearOUT(); - 4656: 21 db rcall .-2494 ; 0x3c9a - Endpoint_ClearStatusStage(); - 4658: fd dc rcall .-1542 ; 0x4054 - - EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - 465a: ce 01 movw r24, r28 - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 465c: df 91 pop r29 - 465e: cf 91 pop r28 - 4660: 1f 91 pop r17 - 4662: 0f 91 pop r16 - 4664: ff 90 pop r15 - CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); - - Endpoint_ClearOUT(); - Endpoint_ClearStatusStage(); - - EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - 4666: 9a cf rjmp .-204 ; 0x459c - return; - - switch (USB_ControlRequest.bRequest) - { - case CDC_REQ_GetLineEncoding: - if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) - 4668: 80 91 15 27 lds r24, 0x2715 - 466c: 81 3a cpi r24, 0xA1 ; 161 - 466e: 09 f0 breq .+2 ; 0x4672 - 4670: a8 cf rjmp .-176 ; 0x45c2 - { - Endpoint_ClearSETUP(); - 4672: b9 db rcall .-2190 ; 0x3de6 - - while (!(Endpoint_IsINReady())); - 4674: 7a db rcall .-2316 ; 0x3d6a - 4676: 88 23 and r24, r24 - 4678: e9 f3 breq .-6 ; 0x4674 - - Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS); - 467a: 8c 89 ldd r24, Y+20 ; 0x14 - 467c: fd 88 ldd r15, Y+21 ; 0x15 - 467e: 0e 89 ldd r16, Y+22 ; 0x16 - 4680: 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); - 4682: 2a db rcall .-2476 ; 0x3cd8 - Endpoint_Write_8(Data >> 8); - 4684: 8f 2d mov r24, r15 - 4686: 28 db rcall .-2480 ; 0x3cd8 - Endpoint_Write_8(Data >> 16); - 4688: 80 2f mov r24, r16 - 468a: 26 db rcall .-2484 ; 0x3cd8 - Endpoint_Write_8(Data >> 24); - 468c: 81 2f mov r24, r17 - 468e: 24 db rcall .-2488 ; 0x3cd8 - Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat); - 4690: 88 8d ldd r24, Y+24 ; 0x18 - 4692: 22 db rcall .-2492 ; 0x3cd8 - Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType); - 4694: 89 8d ldd r24, Y+25 ; 0x19 - 4696: 20 db rcall .-2496 ; 0x3cd8 - Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits); - 4698: 8a 8d ldd r24, Y+26 ; 0x1a - 469a: 1e db rcall .-2500 ; 0x3cd8 - - Endpoint_ClearIN(); - 469c: e5 da rcall .-2614 ; 0x3c68 - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 469e: df 91 pop r29 - 46a0: cf 91 pop r28 - 46a2: 1f 91 pop r17 - 46a4: 0f 91 pop r16 - 46a6: 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(); - 46a8: d5 cc rjmp .-1622 ; 0x4054 - EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); - } - - break; - case CDC_REQ_SetControlLineState: - if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) - 46aa: 80 91 15 27 lds r24, 0x2715 - 46ae: 81 32 cpi r24, 0x21 ; 33 - 46b0: 09 f0 breq .+2 ; 0x46b4 - 46b2: 87 cf rjmp .-242 ; 0x45c2 - { - Endpoint_ClearSETUP(); - 46b4: 98 db rcall .-2256 ; 0x3de6 - Endpoint_ClearStatusStage(); - 46b6: ce dc rcall .-1636 ; 0x4054 - - CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; - 46b8: 80 91 17 27 lds r24, 0x2717 - 46bc: 90 91 18 27 lds r25, 0x2718 - 46c0: 88 8b std Y+16, r24 ; 0x10 - 46c2: 99 8b std Y+17, r25 ; 0x11 - - EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - 46c4: ce 01 movw r24, r28 - EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); - } - - break; - } -} - 46c6: df 91 pop r29 - 46c8: cf 91 pop r28 - 46ca: 1f 91 pop r17 - 46cc: 0f 91 pop r16 - 46ce: ff 90 pop r15 - Endpoint_ClearSETUP(); - Endpoint_ClearStatusStage(); - - CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; - - EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); - 46d0: 65 cf rjmp .-310 ; 0x459c - -000046d2 <__tablejump2__>: - 46d2: ee 0f add r30, r30 - 46d4: ff 1f adc r31, r31 - -000046d6 <__tablejump__>: - 46d6: 05 90 lpm r0, Z+ - 46d8: f4 91 lpm r31, Z - 46da: e0 2d mov r30, r0 - 46dc: 09 94 ijmp - -000046de <__mulshisi3>: - 46de: b7 ff sbrs r27, 7 - 46e0: 04 c0 rjmp .+8 ; 0x46ea <__muluhisi3> - -000046e2 <__mulohisi3>: - 46e2: 03 d0 rcall .+6 ; 0x46ea <__muluhisi3> - 46e4: 82 1b sub r24, r18 - 46e6: 93 0b sbc r25, r19 - 46e8: 08 95 ret - -000046ea <__muluhisi3>: - 46ea: 09 d0 rcall .+18 ; 0x46fe <__umulhisi3> - 46ec: a5 9f mul r26, r21 - 46ee: 90 0d add r25, r0 - 46f0: b4 9f mul r27, r20 - 46f2: 90 0d add r25, r0 - 46f4: a4 9f mul r26, r20 - 46f6: 80 0d add r24, r0 - 46f8: 91 1d adc r25, r1 - 46fa: 11 24 eor r1, r1 - 46fc: 08 95 ret - -000046fe <__umulhisi3>: - 46fe: a2 9f mul r26, r18 - 4700: b0 01 movw r22, r0 - 4702: b3 9f mul r27, r19 - 4704: c0 01 movw r24, r0 - 4706: a3 9f mul r26, r19 - 4708: 70 0d add r23, r0 - 470a: 81 1d adc r24, r1 - 470c: 11 24 eor r1, r1 - 470e: 91 1d adc r25, r1 - 4710: b2 9f mul r27, r18 - 4712: 70 0d add r23, r0 - 4714: 81 1d adc r24, r1 - 4716: 11 24 eor r1, r1 - 4718: 91 1d adc r25, r1 - 471a: 08 95 ret - -0000471c : - 471c: 8f 92 push r8 - 471e: 9f 92 push r9 - 4720: af 92 push r10 - 4722: bf 92 push r11 - 4724: cf 92 push r12 - 4726: df 92 push r13 - 4728: ef 92 push r14 - 472a: ff 92 push r15 - 472c: cf 93 push r28 - 472e: df 93 push r29 - 4730: ec 01 movw r28, r24 - 4732: 68 81 ld r22, Y - 4734: 79 81 ldd r23, Y+1 ; 0x01 - 4736: 8a 81 ldd r24, Y+2 ; 0x02 - 4738: 9b 81 ldd r25, Y+3 ; 0x03 - 473a: 61 15 cp r22, r1 - 473c: 71 05 cpc r23, r1 - 473e: 81 05 cpc r24, r1 - 4740: 91 05 cpc r25, r1 - 4742: 21 f4 brne .+8 ; 0x474c - 4744: 64 e2 ldi r22, 0x24 ; 36 - 4746: 79 ed ldi r23, 0xD9 ; 217 - 4748: 8b e5 ldi r24, 0x5B ; 91 - 474a: 97 e0 ldi r25, 0x07 ; 7 - 474c: 2d e1 ldi r18, 0x1D ; 29 - 474e: 33 ef ldi r19, 0xF3 ; 243 - 4750: 41 e0 ldi r20, 0x01 ; 1 - 4752: 50 e0 ldi r21, 0x00 ; 0 - 4754: 31 d3 rcall .+1634 ; 0x4db8 <__divmodsi4> - 4756: 49 01 movw r8, r18 - 4758: 5a 01 movw r10, r20 - 475a: 9b 01 movw r18, r22 - 475c: ac 01 movw r20, r24 - 475e: a7 ea ldi r26, 0xA7 ; 167 - 4760: b1 e4 ldi r27, 0x41 ; 65 - 4762: c3 df rcall .-122 ; 0x46ea <__muluhisi3> - 4764: 6b 01 movw r12, r22 - 4766: 7c 01 movw r14, r24 - 4768: ac ee ldi r26, 0xEC ; 236 - 476a: b4 ef ldi r27, 0xF4 ; 244 - 476c: a5 01 movw r20, r10 - 476e: 94 01 movw r18, r8 - 4770: b8 df rcall .-144 ; 0x46e2 <__mulohisi3> - 4772: c6 0e add r12, r22 - 4774: d7 1e adc r13, r23 - 4776: e8 1e adc r14, r24 - 4778: f9 1e adc r15, r25 - 477a: f7 fe sbrs r15, 7 - 477c: 06 c0 rjmp .+12 ; 0x478a - 477e: 81 e0 ldi r24, 0x01 ; 1 - 4780: c8 1a sub r12, r24 - 4782: d1 08 sbc r13, r1 - 4784: e1 08 sbc r14, r1 - 4786: 80 e8 ldi r24, 0x80 ; 128 - 4788: f8 0a sbc r15, r24 - 478a: c8 82 st Y, r12 - 478c: d9 82 std Y+1, r13 ; 0x01 - 478e: ea 82 std Y+2, r14 ; 0x02 - 4790: fb 82 std Y+3, r15 ; 0x03 - 4792: c6 01 movw r24, r12 - 4794: 9f 77 andi r25, 0x7F ; 127 - 4796: df 91 pop r29 - 4798: cf 91 pop r28 - 479a: ff 90 pop r15 - 479c: ef 90 pop r14 - 479e: df 90 pop r13 - 47a0: cf 90 pop r12 - 47a2: bf 90 pop r11 - 47a4: af 90 pop r10 - 47a6: 9f 90 pop r9 - 47a8: 8f 90 pop r8 - 47aa: 08 95 ret - -000047ac : - 47ac: b7 cf rjmp .-146 ; 0x471c - -000047ae : - 47ae: 8c e1 ldi r24, 0x1C ; 28 - 47b0: 90 e2 ldi r25, 0x20 ; 32 - 47b2: b4 cf rjmp .-152 ; 0x471c - -000047b4 : - 47b4: a0 e0 ldi r26, 0x00 ; 0 - 47b6: b0 e0 ldi r27, 0x00 ; 0 - 47b8: 80 93 1c 20 sts 0x201C, r24 - 47bc: 90 93 1d 20 sts 0x201D, r25 - 47c0: a0 93 1e 20 sts 0x201E, r26 - 47c4: b0 93 1f 20 sts 0x201F, r27 - 47c8: 08 95 ret - -000047ca : - 47ca: fb 01 movw r30, r22 - 47cc: dc 01 movw r26, r24 - 47ce: 02 c0 rjmp .+4 ; 0x47d4 - 47d0: 05 90 lpm r0, Z+ - 47d2: 0d 92 st X+, r0 - 47d4: 41 50 subi r20, 0x01 ; 1 - 47d6: 50 40 sbci r21, 0x00 ; 0 - 47d8: d8 f7 brcc .-10 ; 0x47d0 - 47da: 08 95 ret - -000047dc : - 47dc: fb 01 movw r30, r22 - 47de: dc 01 movw r26, r24 - 47e0: 8d 91 ld r24, X+ - 47e2: 05 90 lpm r0, Z+ - 47e4: 80 19 sub r24, r0 - 47e6: 01 10 cpse r0, r1 - 47e8: d9 f3 breq .-10 ; 0x47e0 - 47ea: 99 0b sbc r25, r25 - 47ec: 08 95 ret - -000047ee : - 47ee: fb 01 movw r30, r22 - 47f0: dc 01 movw r26, r24 - 47f2: 41 50 subi r20, 0x01 ; 1 - 47f4: 50 40 sbci r21, 0x00 ; 0 - 47f6: 48 f0 brcs .+18 ; 0x480a - 47f8: 05 90 lpm r0, Z+ - 47fa: 0d 92 st X+, r0 - 47fc: 00 20 and r0, r0 - 47fe: c9 f7 brne .-14 ; 0x47f2 - 4800: 01 c0 rjmp .+2 ; 0x4804 - 4802: 1d 92 st X+, r1 - 4804: 41 50 subi r20, 0x01 ; 1 - 4806: 50 40 sbci r21, 0x00 ; 0 - 4808: e0 f7 brcc .-8 ; 0x4802 - 480a: 08 95 ret - -0000480c : - 480c: fb 01 movw r30, r22 - 480e: dc 01 movw r26, r24 - 4810: 02 c0 rjmp .+4 ; 0x4816 - 4812: 01 90 ld r0, Z+ - 4814: 0d 92 st X+, r0 - 4816: 41 50 subi r20, 0x01 ; 1 - 4818: 50 40 sbci r21, 0x00 ; 0 - 481a: d8 f7 brcc .-10 ; 0x4812 - 481c: 08 95 ret - -0000481e : - 481e: ae e0 ldi r26, 0x0E ; 14 - 4820: b0 e0 ldi r27, 0x00 ; 0 - 4822: e4 e1 ldi r30, 0x14 ; 20 - 4824: f4 e2 ldi r31, 0x24 ; 36 - 4826: f2 c2 rjmp .+1508 ; 0x4e0c <__prologue_saves__+0x1c> - 4828: 0d 89 ldd r16, Y+21 ; 0x15 - 482a: 1e 89 ldd r17, Y+22 ; 0x16 - 482c: 8f 89 ldd r24, Y+23 ; 0x17 - 482e: 98 8d ldd r25, Y+24 ; 0x18 - 4830: 2e e0 ldi r18, 0x0E ; 14 - 4832: 2c 83 std Y+4, r18 ; 0x04 - 4834: 09 83 std Y+1, r16 ; 0x01 - 4836: 1a 83 std Y+2, r17 ; 0x02 - 4838: 97 ff sbrs r25, 7 - 483a: 02 c0 rjmp .+4 ; 0x4840 - 483c: 80 e0 ldi r24, 0x00 ; 0 - 483e: 90 e8 ldi r25, 0x80 ; 128 - 4840: 01 97 sbiw r24, 0x01 ; 1 - 4842: 8d 83 std Y+5, r24 ; 0x05 - 4844: 9e 83 std Y+6, r25 ; 0x06 - 4846: ae 01 movw r20, r28 - 4848: 45 5e subi r20, 0xE5 ; 229 - 484a: 5f 4f sbci r21, 0xFF ; 255 - 484c: 69 8d ldd r22, Y+25 ; 0x19 - 484e: 7a 8d ldd r23, Y+26 ; 0x1a - 4850: ce 01 movw r24, r28 - 4852: 01 96 adiw r24, 0x01 ; 1 - 4854: 11 d0 rcall .+34 ; 0x4878 - 4856: 4d 81 ldd r20, Y+5 ; 0x05 - 4858: 5e 81 ldd r21, Y+6 ; 0x06 - 485a: 57 fd sbrc r21, 7 - 485c: 0a c0 rjmp .+20 ; 0x4872 - 485e: 2f 81 ldd r18, Y+7 ; 0x07 - 4860: 38 85 ldd r19, Y+8 ; 0x08 - 4862: 42 17 cp r20, r18 - 4864: 53 07 cpc r21, r19 - 4866: 0c f4 brge .+2 ; 0x486a - 4868: 9a 01 movw r18, r20 - 486a: f8 01 movw r30, r16 - 486c: e2 0f add r30, r18 - 486e: f3 1f adc r31, r19 - 4870: 10 82 st Z, r1 - 4872: 2e 96 adiw r28, 0x0e ; 14 - 4874: e4 e0 ldi r30, 0x04 ; 4 - 4876: e3 c2 rjmp .+1478 ; 0x4e3e <__epilogue_restores__+0x1c> - -00004878 : - 4878: ac e0 ldi r26, 0x0C ; 12 - 487a: b0 e0 ldi r27, 0x00 ; 0 - 487c: e1 e4 ldi r30, 0x41 ; 65 - 487e: f4 e2 ldi r31, 0x24 ; 36 - 4880: b7 c2 rjmp .+1390 ; 0x4df0 <__prologue_saves__> - 4882: 7c 01 movw r14, r24 - 4884: 6b 01 movw r12, r22 - 4886: 8a 01 movw r16, r20 - 4888: fc 01 movw r30, r24 - 488a: 16 82 std Z+6, r1 ; 0x06 - 488c: 17 82 std Z+7, r1 ; 0x07 - 488e: 83 81 ldd r24, Z+3 ; 0x03 - 4890: 81 ff sbrs r24, 1 - 4892: b0 c1 rjmp .+864 ; 0x4bf4 - 4894: ce 01 movw r24, r28 - 4896: 01 96 adiw r24, 0x01 ; 1 - 4898: 4c 01 movw r8, r24 - 489a: f7 01 movw r30, r14 - 489c: 93 81 ldd r25, Z+3 ; 0x03 - 489e: f6 01 movw r30, r12 - 48a0: 93 fd sbrc r25, 3 - 48a2: 85 91 lpm r24, Z+ - 48a4: 93 ff sbrs r25, 3 - 48a6: 81 91 ld r24, Z+ - 48a8: 6f 01 movw r12, r30 - 48aa: 88 23 and r24, r24 - 48ac: 09 f4 brne .+2 ; 0x48b0 - 48ae: 9e c1 rjmp .+828 ; 0x4bec - 48b0: 85 32 cpi r24, 0x25 ; 37 - 48b2: 39 f4 brne .+14 ; 0x48c2 - 48b4: 93 fd sbrc r25, 3 - 48b6: 85 91 lpm r24, Z+ - 48b8: 93 ff sbrs r25, 3 - 48ba: 81 91 ld r24, Z+ - 48bc: 6f 01 movw r12, r30 - 48be: 85 32 cpi r24, 0x25 ; 37 - 48c0: 21 f4 brne .+8 ; 0x48ca - 48c2: b7 01 movw r22, r14 - 48c4: 90 e0 ldi r25, 0x00 ; 0 - 48c6: e8 d1 rcall .+976 ; 0x4c98 - 48c8: e8 cf rjmp .-48 ; 0x489a - 48ca: 51 2c mov r5, r1 - 48cc: 31 2c mov r3, r1 - 48ce: 20 e0 ldi r18, 0x00 ; 0 - 48d0: 20 32 cpi r18, 0x20 ; 32 - 48d2: a0 f4 brcc .+40 ; 0x48fc - 48d4: 8b 32 cpi r24, 0x2B ; 43 - 48d6: 69 f0 breq .+26 ; 0x48f2 - 48d8: 30 f4 brcc .+12 ; 0x48e6 - 48da: 80 32 cpi r24, 0x20 ; 32 - 48dc: 59 f0 breq .+22 ; 0x48f4 - 48de: 83 32 cpi r24, 0x23 ; 35 - 48e0: 69 f4 brne .+26 ; 0x48fc - 48e2: 20 61 ori r18, 0x10 ; 16 - 48e4: 2c c0 rjmp .+88 ; 0x493e - 48e6: 8d 32 cpi r24, 0x2D ; 45 - 48e8: 39 f0 breq .+14 ; 0x48f8 - 48ea: 80 33 cpi r24, 0x30 ; 48 - 48ec: 39 f4 brne .+14 ; 0x48fc - 48ee: 21 60 ori r18, 0x01 ; 1 - 48f0: 26 c0 rjmp .+76 ; 0x493e - 48f2: 22 60 ori r18, 0x02 ; 2 - 48f4: 24 60 ori r18, 0x04 ; 4 - 48f6: 23 c0 rjmp .+70 ; 0x493e - 48f8: 28 60 ori r18, 0x08 ; 8 - 48fa: 21 c0 rjmp .+66 ; 0x493e - 48fc: 27 fd sbrc r18, 7 - 48fe: 27 c0 rjmp .+78 ; 0x494e - 4900: 30 ed ldi r19, 0xD0 ; 208 - 4902: 38 0f add r19, r24 - 4904: 3a 30 cpi r19, 0x0A ; 10 - 4906: 78 f4 brcc .+30 ; 0x4926 - 4908: 26 ff sbrs r18, 6 - 490a: 06 c0 rjmp .+12 ; 0x4918 - 490c: fa e0 ldi r31, 0x0A ; 10 - 490e: 5f 9e mul r5, r31 - 4910: 30 0d add r19, r0 - 4912: 11 24 eor r1, r1 - 4914: 53 2e mov r5, r19 - 4916: 13 c0 rjmp .+38 ; 0x493e - 4918: 8a e0 ldi r24, 0x0A ; 10 - 491a: 38 9e mul r3, r24 - 491c: 30 0d add r19, r0 - 491e: 11 24 eor r1, r1 - 4920: 33 2e mov r3, r19 - 4922: 20 62 ori r18, 0x20 ; 32 - 4924: 0c c0 rjmp .+24 ; 0x493e - 4926: 8e 32 cpi r24, 0x2E ; 46 - 4928: 21 f4 brne .+8 ; 0x4932 - 492a: 26 fd sbrc r18, 6 - 492c: 5f c1 rjmp .+702 ; 0x4bec - 492e: 20 64 ori r18, 0x40 ; 64 - 4930: 06 c0 rjmp .+12 ; 0x493e - 4932: 8c 36 cpi r24, 0x6C ; 108 - 4934: 11 f4 brne .+4 ; 0x493a - 4936: 20 68 ori r18, 0x80 ; 128 - 4938: 02 c0 rjmp .+4 ; 0x493e - 493a: 88 36 cpi r24, 0x68 ; 104 - 493c: 41 f4 brne .+16 ; 0x494e - 493e: f6 01 movw r30, r12 - 4940: 93 fd sbrc r25, 3 - 4942: 85 91 lpm r24, Z+ - 4944: 93 ff sbrs r25, 3 - 4946: 81 91 ld r24, Z+ - 4948: 6f 01 movw r12, r30 - 494a: 81 11 cpse r24, r1 - 494c: c1 cf rjmp .-126 ; 0x48d0 - 494e: 98 2f mov r25, r24 - 4950: 9f 7d andi r25, 0xDF ; 223 - 4952: 95 54 subi r25, 0x45 ; 69 - 4954: 93 30 cpi r25, 0x03 ; 3 - 4956: 28 f4 brcc .+10 ; 0x4962 - 4958: 0c 5f subi r16, 0xFC ; 252 - 495a: 1f 4f sbci r17, 0xFF ; 255 - 495c: ff e3 ldi r31, 0x3F ; 63 - 495e: f9 83 std Y+1, r31 ; 0x01 - 4960: 0d c0 rjmp .+26 ; 0x497c - 4962: 83 36 cpi r24, 0x63 ; 99 - 4964: 31 f0 breq .+12 ; 0x4972 - 4966: 83 37 cpi r24, 0x73 ; 115 - 4968: 71 f0 breq .+28 ; 0x4986 - 496a: 83 35 cpi r24, 0x53 ; 83 - 496c: 09 f0 breq .+2 ; 0x4970 - 496e: 57 c0 rjmp .+174 ; 0x4a1e - 4970: 21 c0 rjmp .+66 ; 0x49b4 - 4972: f8 01 movw r30, r16 - 4974: 80 81 ld r24, Z - 4976: 89 83 std Y+1, r24 ; 0x01 - 4978: 0e 5f subi r16, 0xFE ; 254 - 497a: 1f 4f sbci r17, 0xFF ; 255 - 497c: 44 24 eor r4, r4 - 497e: 43 94 inc r4 - 4980: 51 2c mov r5, r1 - 4982: 54 01 movw r10, r8 - 4984: 14 c0 rjmp .+40 ; 0x49ae - 4986: 38 01 movw r6, r16 - 4988: f2 e0 ldi r31, 0x02 ; 2 - 498a: 6f 0e add r6, r31 - 498c: 71 1c adc r7, r1 - 498e: f8 01 movw r30, r16 - 4990: a0 80 ld r10, Z - 4992: b1 80 ldd r11, Z+1 ; 0x01 - 4994: 26 ff sbrs r18, 6 - 4996: 03 c0 rjmp .+6 ; 0x499e - 4998: 65 2d mov r22, r5 - 499a: 70 e0 ldi r23, 0x00 ; 0 - 499c: 02 c0 rjmp .+4 ; 0x49a2 - 499e: 6f ef ldi r22, 0xFF ; 255 - 49a0: 7f ef ldi r23, 0xFF ; 255 - 49a2: c5 01 movw r24, r10 - 49a4: 2c 87 std Y+12, r18 ; 0x0c - 49a6: 6d d1 rcall .+730 ; 0x4c82 - 49a8: 2c 01 movw r4, r24 - 49aa: 83 01 movw r16, r6 - 49ac: 2c 85 ldd r18, Y+12 ; 0x0c - 49ae: 2f 77 andi r18, 0x7F ; 127 - 49b0: 22 2e mov r2, r18 - 49b2: 16 c0 rjmp .+44 ; 0x49e0 - 49b4: 38 01 movw r6, r16 - 49b6: f2 e0 ldi r31, 0x02 ; 2 - 49b8: 6f 0e add r6, r31 - 49ba: 71 1c adc r7, r1 - 49bc: f8 01 movw r30, r16 - 49be: a0 80 ld r10, Z - 49c0: b1 80 ldd r11, Z+1 ; 0x01 - 49c2: 26 ff sbrs r18, 6 - 49c4: 03 c0 rjmp .+6 ; 0x49cc - 49c6: 65 2d mov r22, r5 - 49c8: 70 e0 ldi r23, 0x00 ; 0 - 49ca: 02 c0 rjmp .+4 ; 0x49d0 - 49cc: 6f ef ldi r22, 0xFF ; 255 - 49ce: 7f ef ldi r23, 0xFF ; 255 - 49d0: c5 01 movw r24, r10 - 49d2: 2c 87 std Y+12, r18 ; 0x0c - 49d4: 4b d1 rcall .+662 ; 0x4c6c - 49d6: 2c 01 movw r4, r24 - 49d8: 2c 85 ldd r18, Y+12 ; 0x0c - 49da: 20 68 ori r18, 0x80 ; 128 - 49dc: 22 2e mov r2, r18 - 49de: 83 01 movw r16, r6 - 49e0: 23 fc sbrc r2, 3 - 49e2: 19 c0 rjmp .+50 ; 0x4a16 - 49e4: 83 2d mov r24, r3 - 49e6: 90 e0 ldi r25, 0x00 ; 0 - 49e8: 48 16 cp r4, r24 - 49ea: 59 06 cpc r5, r25 - 49ec: a0 f4 brcc .+40 ; 0x4a16 - 49ee: b7 01 movw r22, r14 - 49f0: 80 e2 ldi r24, 0x20 ; 32 - 49f2: 90 e0 ldi r25, 0x00 ; 0 - 49f4: 51 d1 rcall .+674 ; 0x4c98 - 49f6: 3a 94 dec r3 - 49f8: f5 cf rjmp .-22 ; 0x49e4 - 49fa: f5 01 movw r30, r10 - 49fc: 27 fc sbrc r2, 7 - 49fe: 85 91 lpm r24, Z+ - 4a00: 27 fe sbrs r2, 7 - 4a02: 81 91 ld r24, Z+ - 4a04: 5f 01 movw r10, r30 - 4a06: b7 01 movw r22, r14 - 4a08: 90 e0 ldi r25, 0x00 ; 0 - 4a0a: 46 d1 rcall .+652 ; 0x4c98 - 4a0c: 31 10 cpse r3, r1 - 4a0e: 3a 94 dec r3 - 4a10: f1 e0 ldi r31, 0x01 ; 1 - 4a12: 4f 1a sub r4, r31 - 4a14: 51 08 sbc r5, r1 - 4a16: 41 14 cp r4, r1 - 4a18: 51 04 cpc r5, r1 - 4a1a: 79 f7 brne .-34 ; 0x49fa - 4a1c: de c0 rjmp .+444 ; 0x4bda - 4a1e: 84 36 cpi r24, 0x64 ; 100 - 4a20: 11 f0 breq .+4 ; 0x4a26 - 4a22: 89 36 cpi r24, 0x69 ; 105 - 4a24: 31 f5 brne .+76 ; 0x4a72 - 4a26: f8 01 movw r30, r16 - 4a28: 27 ff sbrs r18, 7 - 4a2a: 07 c0 rjmp .+14 ; 0x4a3a - 4a2c: 60 81 ld r22, Z - 4a2e: 71 81 ldd r23, Z+1 ; 0x01 - 4a30: 82 81 ldd r24, Z+2 ; 0x02 - 4a32: 93 81 ldd r25, Z+3 ; 0x03 - 4a34: 0c 5f subi r16, 0xFC ; 252 - 4a36: 1f 4f sbci r17, 0xFF ; 255 - 4a38: 08 c0 rjmp .+16 ; 0x4a4a - 4a3a: 60 81 ld r22, Z - 4a3c: 71 81 ldd r23, Z+1 ; 0x01 - 4a3e: 88 27 eor r24, r24 - 4a40: 77 fd sbrc r23, 7 - 4a42: 80 95 com r24 - 4a44: 98 2f mov r25, r24 - 4a46: 0e 5f subi r16, 0xFE ; 254 - 4a48: 1f 4f sbci r17, 0xFF ; 255 - 4a4a: 2f 76 andi r18, 0x6F ; 111 - 4a4c: b2 2e mov r11, r18 - 4a4e: 97 ff sbrs r25, 7 - 4a50: 09 c0 rjmp .+18 ; 0x4a64 - 4a52: 90 95 com r25 - 4a54: 80 95 com r24 - 4a56: 70 95 com r23 - 4a58: 61 95 neg r22 - 4a5a: 7f 4f sbci r23, 0xFF ; 255 - 4a5c: 8f 4f sbci r24, 0xFF ; 255 - 4a5e: 9f 4f sbci r25, 0xFF ; 255 - 4a60: 20 68 ori r18, 0x80 ; 128 - 4a62: b2 2e mov r11, r18 - 4a64: 2a e0 ldi r18, 0x0A ; 10 - 4a66: 30 e0 ldi r19, 0x00 ; 0 - 4a68: a4 01 movw r20, r8 - 4a6a: 48 d1 rcall .+656 ; 0x4cfc <__ultoa_invert> - 4a6c: a8 2e mov r10, r24 - 4a6e: a8 18 sub r10, r8 - 4a70: 43 c0 rjmp .+134 ; 0x4af8 - 4a72: 85 37 cpi r24, 0x75 ; 117 - 4a74: 29 f4 brne .+10 ; 0x4a80 - 4a76: 2f 7e andi r18, 0xEF ; 239 - 4a78: b2 2e mov r11, r18 - 4a7a: 2a e0 ldi r18, 0x0A ; 10 - 4a7c: 30 e0 ldi r19, 0x00 ; 0 - 4a7e: 25 c0 rjmp .+74 ; 0x4aca - 4a80: f2 2f mov r31, r18 - 4a82: f9 7f andi r31, 0xF9 ; 249 - 4a84: bf 2e mov r11, r31 - 4a86: 8f 36 cpi r24, 0x6F ; 111 - 4a88: c1 f0 breq .+48 ; 0x4aba - 4a8a: 18 f4 brcc .+6 ; 0x4a92 - 4a8c: 88 35 cpi r24, 0x58 ; 88 - 4a8e: 79 f0 breq .+30 ; 0x4aae - 4a90: ad c0 rjmp .+346 ; 0x4bec - 4a92: 80 37 cpi r24, 0x70 ; 112 - 4a94: 19 f0 breq .+6 ; 0x4a9c - 4a96: 88 37 cpi r24, 0x78 ; 120 - 4a98: 21 f0 breq .+8 ; 0x4aa2 - 4a9a: a8 c0 rjmp .+336 ; 0x4bec - 4a9c: 2f 2f mov r18, r31 - 4a9e: 20 61 ori r18, 0x10 ; 16 - 4aa0: b2 2e mov r11, r18 - 4aa2: b4 fe sbrs r11, 4 - 4aa4: 0d c0 rjmp .+26 ; 0x4ac0 - 4aa6: 8b 2d mov r24, r11 - 4aa8: 84 60 ori r24, 0x04 ; 4 - 4aaa: b8 2e mov r11, r24 - 4aac: 09 c0 rjmp .+18 ; 0x4ac0 - 4aae: 24 ff sbrs r18, 4 - 4ab0: 0a c0 rjmp .+20 ; 0x4ac6 - 4ab2: 9f 2f mov r25, r31 - 4ab4: 96 60 ori r25, 0x06 ; 6 - 4ab6: b9 2e mov r11, r25 - 4ab8: 06 c0 rjmp .+12 ; 0x4ac6 - 4aba: 28 e0 ldi r18, 0x08 ; 8 - 4abc: 30 e0 ldi r19, 0x00 ; 0 - 4abe: 05 c0 rjmp .+10 ; 0x4aca - 4ac0: 20 e1 ldi r18, 0x10 ; 16 - 4ac2: 30 e0 ldi r19, 0x00 ; 0 - 4ac4: 02 c0 rjmp .+4 ; 0x4aca - 4ac6: 20 e1 ldi r18, 0x10 ; 16 - 4ac8: 32 e0 ldi r19, 0x02 ; 2 - 4aca: f8 01 movw r30, r16 - 4acc: b7 fe sbrs r11, 7 - 4ace: 07 c0 rjmp .+14 ; 0x4ade - 4ad0: 60 81 ld r22, Z - 4ad2: 71 81 ldd r23, Z+1 ; 0x01 - 4ad4: 82 81 ldd r24, Z+2 ; 0x02 - 4ad6: 93 81 ldd r25, Z+3 ; 0x03 - 4ad8: 0c 5f subi r16, 0xFC ; 252 - 4ada: 1f 4f sbci r17, 0xFF ; 255 - 4adc: 06 c0 rjmp .+12 ; 0x4aea - 4ade: 60 81 ld r22, Z - 4ae0: 71 81 ldd r23, Z+1 ; 0x01 - 4ae2: 80 e0 ldi r24, 0x00 ; 0 - 4ae4: 90 e0 ldi r25, 0x00 ; 0 - 4ae6: 0e 5f subi r16, 0xFE ; 254 - 4ae8: 1f 4f sbci r17, 0xFF ; 255 - 4aea: a4 01 movw r20, r8 - 4aec: 07 d1 rcall .+526 ; 0x4cfc <__ultoa_invert> - 4aee: a8 2e mov r10, r24 - 4af0: a8 18 sub r10, r8 - 4af2: fb 2d mov r31, r11 - 4af4: ff 77 andi r31, 0x7F ; 127 - 4af6: bf 2e mov r11, r31 - 4af8: b6 fe sbrs r11, 6 - 4afa: 0b c0 rjmp .+22 ; 0x4b12 - 4afc: 2b 2d mov r18, r11 - 4afe: 2e 7f andi r18, 0xFE ; 254 - 4b00: a5 14 cp r10, r5 - 4b02: 50 f4 brcc .+20 ; 0x4b18 - 4b04: b4 fe sbrs r11, 4 - 4b06: 0a c0 rjmp .+20 ; 0x4b1c - 4b08: b2 fc sbrc r11, 2 - 4b0a: 08 c0 rjmp .+16 ; 0x4b1c - 4b0c: 2b 2d mov r18, r11 - 4b0e: 2e 7e andi r18, 0xEE ; 238 - 4b10: 05 c0 rjmp .+10 ; 0x4b1c - 4b12: 7a 2c mov r7, r10 - 4b14: 2b 2d mov r18, r11 - 4b16: 03 c0 rjmp .+6 ; 0x4b1e - 4b18: 7a 2c mov r7, r10 - 4b1a: 01 c0 rjmp .+2 ; 0x4b1e - 4b1c: 75 2c mov r7, r5 - 4b1e: 24 ff sbrs r18, 4 - 4b20: 0d c0 rjmp .+26 ; 0x4b3c - 4b22: fe 01 movw r30, r28 - 4b24: ea 0d add r30, r10 - 4b26: f1 1d adc r31, r1 - 4b28: 80 81 ld r24, Z - 4b2a: 80 33 cpi r24, 0x30 ; 48 - 4b2c: 11 f4 brne .+4 ; 0x4b32 - 4b2e: 29 7e andi r18, 0xE9 ; 233 - 4b30: 09 c0 rjmp .+18 ; 0x4b44 - 4b32: 22 ff sbrs r18, 2 - 4b34: 06 c0 rjmp .+12 ; 0x4b42 - 4b36: 73 94 inc r7 - 4b38: 73 94 inc r7 - 4b3a: 04 c0 rjmp .+8 ; 0x4b44 - 4b3c: 82 2f mov r24, r18 - 4b3e: 86 78 andi r24, 0x86 ; 134 - 4b40: 09 f0 breq .+2 ; 0x4b44 - 4b42: 73 94 inc r7 - 4b44: 23 fd sbrc r18, 3 - 4b46: 12 c0 rjmp .+36 ; 0x4b6c - 4b48: 20 ff sbrs r18, 0 - 4b4a: 06 c0 rjmp .+12 ; 0x4b58 - 4b4c: 5a 2c mov r5, r10 - 4b4e: 73 14 cp r7, r3 - 4b50: 18 f4 brcc .+6 ; 0x4b58 - 4b52: 53 0c add r5, r3 - 4b54: 57 18 sub r5, r7 - 4b56: 73 2c mov r7, r3 - 4b58: 73 14 cp r7, r3 - 4b5a: 60 f4 brcc .+24 ; 0x4b74 - 4b5c: b7 01 movw r22, r14 - 4b5e: 80 e2 ldi r24, 0x20 ; 32 - 4b60: 90 e0 ldi r25, 0x00 ; 0 - 4b62: 2c 87 std Y+12, r18 ; 0x0c - 4b64: 99 d0 rcall .+306 ; 0x4c98 - 4b66: 73 94 inc r7 - 4b68: 2c 85 ldd r18, Y+12 ; 0x0c - 4b6a: f6 cf rjmp .-20 ; 0x4b58 - 4b6c: 73 14 cp r7, r3 - 4b6e: 10 f4 brcc .+4 ; 0x4b74 - 4b70: 37 18 sub r3, r7 - 4b72: 01 c0 rjmp .+2 ; 0x4b76 - 4b74: 31 2c mov r3, r1 - 4b76: 24 ff sbrs r18, 4 - 4b78: 11 c0 rjmp .+34 ; 0x4b9c - 4b7a: b7 01 movw r22, r14 - 4b7c: 80 e3 ldi r24, 0x30 ; 48 - 4b7e: 90 e0 ldi r25, 0x00 ; 0 - 4b80: 2c 87 std Y+12, r18 ; 0x0c - 4b82: 8a d0 rcall .+276 ; 0x4c98 - 4b84: 2c 85 ldd r18, Y+12 ; 0x0c - 4b86: 22 ff sbrs r18, 2 - 4b88: 16 c0 rjmp .+44 ; 0x4bb6 - 4b8a: 21 ff sbrs r18, 1 - 4b8c: 03 c0 rjmp .+6 ; 0x4b94 - 4b8e: 88 e5 ldi r24, 0x58 ; 88 - 4b90: 90 e0 ldi r25, 0x00 ; 0 - 4b92: 02 c0 rjmp .+4 ; 0x4b98 - 4b94: 88 e7 ldi r24, 0x78 ; 120 - 4b96: 90 e0 ldi r25, 0x00 ; 0 - 4b98: b7 01 movw r22, r14 - 4b9a: 0c c0 rjmp .+24 ; 0x4bb4 - 4b9c: 82 2f mov r24, r18 - 4b9e: 86 78 andi r24, 0x86 ; 134 - 4ba0: 51 f0 breq .+20 ; 0x4bb6 - 4ba2: 21 fd sbrc r18, 1 - 4ba4: 02 c0 rjmp .+4 ; 0x4baa - 4ba6: 80 e2 ldi r24, 0x20 ; 32 - 4ba8: 01 c0 rjmp .+2 ; 0x4bac - 4baa: 8b e2 ldi r24, 0x2B ; 43 - 4bac: 27 fd sbrc r18, 7 - 4bae: 8d e2 ldi r24, 0x2D ; 45 - 4bb0: b7 01 movw r22, r14 - 4bb2: 90 e0 ldi r25, 0x00 ; 0 - 4bb4: 71 d0 rcall .+226 ; 0x4c98 - 4bb6: a5 14 cp r10, r5 - 4bb8: 30 f4 brcc .+12 ; 0x4bc6 - 4bba: b7 01 movw r22, r14 - 4bbc: 80 e3 ldi r24, 0x30 ; 48 - 4bbe: 90 e0 ldi r25, 0x00 ; 0 - 4bc0: 6b d0 rcall .+214 ; 0x4c98 - 4bc2: 5a 94 dec r5 - 4bc4: f8 cf rjmp .-16 ; 0x4bb6 - 4bc6: aa 94 dec r10 - 4bc8: f4 01 movw r30, r8 - 4bca: ea 0d add r30, r10 - 4bcc: f1 1d adc r31, r1 - 4bce: 80 81 ld r24, Z - 4bd0: b7 01 movw r22, r14 - 4bd2: 90 e0 ldi r25, 0x00 ; 0 - 4bd4: 61 d0 rcall .+194 ; 0x4c98 - 4bd6: a1 10 cpse r10, r1 - 4bd8: f6 cf rjmp .-20 ; 0x4bc6 - 4bda: 33 20 and r3, r3 - 4bdc: 09 f4 brne .+2 ; 0x4be0 - 4bde: 5d ce rjmp .-838 ; 0x489a - 4be0: b7 01 movw r22, r14 - 4be2: 80 e2 ldi r24, 0x20 ; 32 - 4be4: 90 e0 ldi r25, 0x00 ; 0 - 4be6: 58 d0 rcall .+176 ; 0x4c98 - 4be8: 3a 94 dec r3 - 4bea: f7 cf rjmp .-18 ; 0x4bda - 4bec: f7 01 movw r30, r14 - 4bee: 86 81 ldd r24, Z+6 ; 0x06 - 4bf0: 97 81 ldd r25, Z+7 ; 0x07 - 4bf2: 02 c0 rjmp .+4 ; 0x4bf8 - 4bf4: 8f ef ldi r24, 0xFF ; 255 - 4bf6: 9f ef ldi r25, 0xFF ; 255 - 4bf8: 2c 96 adiw r28, 0x0c ; 12 - 4bfa: e2 e1 ldi r30, 0x12 ; 18 - 4bfc: 12 c1 rjmp .+548 ; 0x4e22 <__epilogue_restores__> - -00004bfe <__eerd_block_x32a4u>: - 4bfe: e0 ec ldi r30, 0xC0 ; 192 - 4c00: f1 e0 ldi r31, 0x01 ; 1 - 4c02: a7 85 ldd r26, Z+15 ; 0x0f - 4c04: a7 fd sbrc r26, 7 - 4c06: fd cf rjmp .-6 ; 0x4c02 <__eerd_block_x32a4u+0x4> - 4c08: a4 85 ldd r26, Z+12 ; 0x0c - 4c0a: a8 60 ori r26, 0x08 ; 8 - 4c0c: a4 87 std Z+12, r26 ; 0x0c - 4c0e: 60 50 subi r22, 0x00 ; 0 - 4c10: 70 4f sbci r23, 0xF0 ; 240 - 4c12: fc cd rjmp .-1032 ; 0x480c - -00004c14 <__eewr_block_x32a4u>: - 4c14: dc 01 movw r26, r24 - 4c16: cb 01 movw r24, r22 - 4c18: 02 c0 rjmp .+4 ; 0x4c1e <__eewr_block_x32a4u+0xa> - 4c1a: 2d 91 ld r18, X+ - 4c1c: 05 d0 rcall .+10 ; 0x4c28 <__eewr_r18_x32a4u> - 4c1e: 41 50 subi r20, 0x01 ; 1 - 4c20: 50 40 sbci r21, 0x00 ; 0 - 4c22: d8 f7 brcc .-10 ; 0x4c1a <__eewr_block_x32a4u+0x6> - 4c24: 08 95 ret - -00004c26 <__eewr_byte_x32a4u>: - 4c26: 26 2f mov r18, r22 - -00004c28 <__eewr_r18_x32a4u>: - 4c28: e0 ec ldi r30, 0xC0 ; 192 - 4c2a: f1 e0 ldi r31, 0x01 ; 1 - 4c2c: 37 85 ldd r19, Z+15 ; 0x0f - 4c2e: 37 fd sbrc r19, 7 - 4c30: fd cf rjmp .-6 ; 0x4c2c <__eewr_r18_x32a4u+0x4> - 4c32: 34 85 ldd r19, Z+12 ; 0x0c - 4c34: 37 7f andi r19, 0xF7 ; 247 - 4c36: 34 87 std Z+12, r19 ; 0x0c - 4c38: 37 85 ldd r19, Z+15 ; 0x0f - 4c3a: 31 ff sbrs r19, 1 - 4c3c: 09 c0 rjmp .+18 ; 0x4c50 <__eewr_r18_x32a4u+0x28> - 4c3e: 36 e3 ldi r19, 0x36 ; 54 - 4c40: 32 87 std Z+10, r19 ; 0x0a - 4c42: 38 ed ldi r19, 0xD8 ; 216 - 4c44: 34 bf out 0x34, r19 ; 52 - 4c46: 31 e0 ldi r19, 0x01 ; 1 - 4c48: 33 87 std Z+11, r19 ; 0x0b - 4c4a: 37 85 ldd r19, Z+15 ; 0x0f - 4c4c: 37 fd sbrc r19, 7 - 4c4e: fd cf rjmp .-6 ; 0x4c4a <__eewr_r18_x32a4u+0x22> - 4c50: 33 e3 ldi r19, 0x33 ; 51 - 4c52: 32 87 std Z+10, r19 ; 0x0a - 4c54: 80 83 st Z, r24 - 4c56: 91 83 std Z+1, r25 ; 0x01 - 4c58: 12 82 std Z+2, r1 ; 0x02 - 4c5a: 24 83 std Z+4, r18 ; 0x04 - 4c5c: 25 e3 ldi r18, 0x35 ; 53 - 4c5e: 22 87 std Z+10, r18 ; 0x0a - 4c60: 28 ed ldi r18, 0xD8 ; 216 - 4c62: 31 e0 ldi r19, 0x01 ; 1 - 4c64: 24 bf out 0x34, r18 ; 52 - 4c66: 33 87 std Z+11, r19 ; 0x0b - 4c68: 01 96 adiw r24, 0x01 ; 1 - 4c6a: 08 95 ret - -00004c6c : - 4c6c: fc 01 movw r30, r24 - 4c6e: 05 90 lpm r0, Z+ - 4c70: 61 50 subi r22, 0x01 ; 1 - 4c72: 70 40 sbci r23, 0x00 ; 0 - 4c74: 01 10 cpse r0, r1 - 4c76: d8 f7 brcc .-10 ; 0x4c6e - 4c78: 80 95 com r24 - 4c7a: 90 95 com r25 - 4c7c: 8e 0f add r24, r30 - 4c7e: 9f 1f adc r25, r31 - 4c80: 08 95 ret - -00004c82 : - 4c82: fc 01 movw r30, r24 - 4c84: 61 50 subi r22, 0x01 ; 1 - 4c86: 70 40 sbci r23, 0x00 ; 0 - 4c88: 01 90 ld r0, Z+ - 4c8a: 01 10 cpse r0, r1 - 4c8c: d8 f7 brcc .-10 ; 0x4c84 - 4c8e: 80 95 com r24 - 4c90: 90 95 com r25 - 4c92: 8e 0f add r24, r30 - 4c94: 9f 1f adc r25, r31 - 4c96: 08 95 ret - -00004c98 : - 4c98: 0f 93 push r16 - 4c9a: 1f 93 push r17 - 4c9c: cf 93 push r28 - 4c9e: df 93 push r29 - 4ca0: 18 2f mov r17, r24 - 4ca2: 09 2f mov r16, r25 - 4ca4: eb 01 movw r28, r22 - 4ca6: 8b 81 ldd r24, Y+3 ; 0x03 - 4ca8: 81 fd sbrc r24, 1 - 4caa: 03 c0 rjmp .+6 ; 0x4cb2 - 4cac: 8f ef ldi r24, 0xFF ; 255 - 4cae: 9f ef ldi r25, 0xFF ; 255 - 4cb0: 20 c0 rjmp .+64 ; 0x4cf2 - 4cb2: 82 ff sbrs r24, 2 - 4cb4: 10 c0 rjmp .+32 ; 0x4cd6 - 4cb6: 4e 81 ldd r20, Y+6 ; 0x06 - 4cb8: 5f 81 ldd r21, Y+7 ; 0x07 - 4cba: 2c 81 ldd r18, Y+4 ; 0x04 - 4cbc: 3d 81 ldd r19, Y+5 ; 0x05 - 4cbe: 42 17 cp r20, r18 - 4cc0: 53 07 cpc r21, r19 - 4cc2: 7c f4 brge .+30 ; 0x4ce2 - 4cc4: e8 81 ld r30, Y - 4cc6: f9 81 ldd r31, Y+1 ; 0x01 - 4cc8: 9f 01 movw r18, r30 - 4cca: 2f 5f subi r18, 0xFF ; 255 - 4ccc: 3f 4f sbci r19, 0xFF ; 255 - 4cce: 28 83 st Y, r18 - 4cd0: 39 83 std Y+1, r19 ; 0x01 - 4cd2: 10 83 st Z, r17 - 4cd4: 06 c0 rjmp .+12 ; 0x4ce2 - 4cd6: e8 85 ldd r30, Y+8 ; 0x08 - 4cd8: f9 85 ldd r31, Y+9 ; 0x09 - 4cda: 81 2f mov r24, r17 - 4cdc: 09 95 icall - 4cde: 89 2b or r24, r25 - 4ce0: 29 f7 brne .-54 ; 0x4cac - 4ce2: 2e 81 ldd r18, Y+6 ; 0x06 - 4ce4: 3f 81 ldd r19, Y+7 ; 0x07 - 4ce6: 2f 5f subi r18, 0xFF ; 255 - 4ce8: 3f 4f sbci r19, 0xFF ; 255 - 4cea: 2e 83 std Y+6, r18 ; 0x06 - 4cec: 3f 83 std Y+7, r19 ; 0x07 - 4cee: 81 2f mov r24, r17 - 4cf0: 90 2f mov r25, r16 - 4cf2: df 91 pop r29 - 4cf4: cf 91 pop r28 - 4cf6: 1f 91 pop r17 - 4cf8: 0f 91 pop r16 - 4cfa: 08 95 ret - -00004cfc <__ultoa_invert>: - 4cfc: fa 01 movw r30, r20 - 4cfe: aa 27 eor r26, r26 - 4d00: 28 30 cpi r18, 0x08 ; 8 - 4d02: 51 f1 breq .+84 ; 0x4d58 <__ultoa_invert+0x5c> - 4d04: 20 31 cpi r18, 0x10 ; 16 - 4d06: 81 f1 breq .+96 ; 0x4d68 <__ultoa_invert+0x6c> - 4d08: e8 94 clt - 4d0a: 6f 93 push r22 - 4d0c: 6e 7f andi r22, 0xFE ; 254 - 4d0e: 6e 5f subi r22, 0xFE ; 254 - 4d10: 7f 4f sbci r23, 0xFF ; 255 - 4d12: 8f 4f sbci r24, 0xFF ; 255 - 4d14: 9f 4f sbci r25, 0xFF ; 255 - 4d16: af 4f sbci r26, 0xFF ; 255 - 4d18: b1 e0 ldi r27, 0x01 ; 1 - 4d1a: 3e d0 rcall .+124 ; 0x4d98 <__ultoa_invert+0x9c> - 4d1c: b4 e0 ldi r27, 0x04 ; 4 - 4d1e: 3c d0 rcall .+120 ; 0x4d98 <__ultoa_invert+0x9c> - 4d20: 67 0f add r22, r23 - 4d22: 78 1f adc r23, r24 - 4d24: 89 1f adc r24, r25 - 4d26: 9a 1f adc r25, r26 - 4d28: a1 1d adc r26, r1 - 4d2a: 68 0f add r22, r24 - 4d2c: 79 1f adc r23, r25 - 4d2e: 8a 1f adc r24, r26 - 4d30: 91 1d adc r25, r1 - 4d32: a1 1d adc r26, r1 - 4d34: 6a 0f add r22, r26 - 4d36: 71 1d adc r23, r1 - 4d38: 81 1d adc r24, r1 - 4d3a: 91 1d adc r25, r1 - 4d3c: a1 1d adc r26, r1 - 4d3e: 20 d0 rcall .+64 ; 0x4d80 <__ultoa_invert+0x84> - 4d40: 09 f4 brne .+2 ; 0x4d44 <__ultoa_invert+0x48> - 4d42: 68 94 set - 4d44: 3f 91 pop r19 - 4d46: 2a e0 ldi r18, 0x0A ; 10 - 4d48: 26 9f mul r18, r22 - 4d4a: 11 24 eor r1, r1 - 4d4c: 30 19 sub r19, r0 - 4d4e: 30 5d subi r19, 0xD0 ; 208 - 4d50: 31 93 st Z+, r19 - 4d52: de f6 brtc .-74 ; 0x4d0a <__ultoa_invert+0xe> - 4d54: cf 01 movw r24, r30 - 4d56: 08 95 ret - 4d58: 46 2f mov r20, r22 - 4d5a: 47 70 andi r20, 0x07 ; 7 - 4d5c: 40 5d subi r20, 0xD0 ; 208 - 4d5e: 41 93 st Z+, r20 - 4d60: b3 e0 ldi r27, 0x03 ; 3 - 4d62: 0f d0 rcall .+30 ; 0x4d82 <__ultoa_invert+0x86> - 4d64: c9 f7 brne .-14 ; 0x4d58 <__ultoa_invert+0x5c> - 4d66: f6 cf rjmp .-20 ; 0x4d54 <__ultoa_invert+0x58> - 4d68: 46 2f mov r20, r22 - 4d6a: 4f 70 andi r20, 0x0F ; 15 - 4d6c: 40 5d subi r20, 0xD0 ; 208 - 4d6e: 4a 33 cpi r20, 0x3A ; 58 - 4d70: 18 f0 brcs .+6 ; 0x4d78 <__ultoa_invert+0x7c> - 4d72: 49 5d subi r20, 0xD9 ; 217 - 4d74: 31 fd sbrc r19, 1 - 4d76: 40 52 subi r20, 0x20 ; 32 - 4d78: 41 93 st Z+, r20 - 4d7a: 02 d0 rcall .+4 ; 0x4d80 <__ultoa_invert+0x84> - 4d7c: a9 f7 brne .-22 ; 0x4d68 <__ultoa_invert+0x6c> - 4d7e: ea cf rjmp .-44 ; 0x4d54 <__ultoa_invert+0x58> - 4d80: b4 e0 ldi r27, 0x04 ; 4 - 4d82: a6 95 lsr r26 - 4d84: 97 95 ror r25 - 4d86: 87 95 ror r24 - 4d88: 77 95 ror r23 - 4d8a: 67 95 ror r22 - 4d8c: ba 95 dec r27 - 4d8e: c9 f7 brne .-14 ; 0x4d82 <__ultoa_invert+0x86> - 4d90: 00 97 sbiw r24, 0x00 ; 0 - 4d92: 61 05 cpc r22, r1 - 4d94: 71 05 cpc r23, r1 - 4d96: 08 95 ret - 4d98: 9b 01 movw r18, r22 - 4d9a: ac 01 movw r20, r24 - 4d9c: 0a 2e mov r0, r26 - 4d9e: 06 94 lsr r0 - 4da0: 57 95 ror r21 - 4da2: 47 95 ror r20 - 4da4: 37 95 ror r19 - 4da6: 27 95 ror r18 - 4da8: ba 95 dec r27 - 4daa: c9 f7 brne .-14 ; 0x4d9e <__ultoa_invert+0xa2> - 4dac: 62 0f add r22, r18 - 4dae: 73 1f adc r23, r19 - 4db0: 84 1f adc r24, r20 - 4db2: 95 1f adc r25, r21 - 4db4: a0 1d adc r26, r0 - 4db6: 08 95 ret - -00004db8 <__divmodsi4>: - 4db8: 05 2e mov r0, r21 - 4dba: 97 fb bst r25, 7 - 4dbc: 16 f4 brtc .+4 ; 0x4dc2 <__divmodsi4+0xa> - 4dbe: 00 94 com r0 - 4dc0: 0f d0 rcall .+30 ; 0x4de0 <__negsi2> - 4dc2: 57 fd sbrc r21, 7 - 4dc4: 05 d0 rcall .+10 ; 0x4dd0 <__divmodsi4_neg2> - 4dc6: 45 d0 rcall .+138 ; 0x4e52 <__udivmodsi4> - 4dc8: 07 fc sbrc r0, 7 - 4dca: 02 d0 rcall .+4 ; 0x4dd0 <__divmodsi4_neg2> - 4dcc: 46 f4 brtc .+16 ; 0x4dde <__divmodsi4_exit> - 4dce: 08 c0 rjmp .+16 ; 0x4de0 <__negsi2> - -00004dd0 <__divmodsi4_neg2>: - 4dd0: 50 95 com r21 - 4dd2: 40 95 com r20 - 4dd4: 30 95 com r19 - 4dd6: 21 95 neg r18 - 4dd8: 3f 4f sbci r19, 0xFF ; 255 - 4dda: 4f 4f sbci r20, 0xFF ; 255 - 4ddc: 5f 4f sbci r21, 0xFF ; 255 - -00004dde <__divmodsi4_exit>: - 4dde: 08 95 ret - -00004de0 <__negsi2>: - 4de0: 90 95 com r25 - 4de2: 80 95 com r24 - 4de4: 70 95 com r23 - 4de6: 61 95 neg r22 - 4de8: 7f 4f sbci r23, 0xFF ; 255 - 4dea: 8f 4f sbci r24, 0xFF ; 255 - 4dec: 9f 4f sbci r25, 0xFF ; 255 - 4dee: 08 95 ret - -00004df0 <__prologue_saves__>: - 4df0: 2f 92 push r2 - 4df2: 3f 92 push r3 - 4df4: 4f 92 push r4 - 4df6: 5f 92 push r5 - 4df8: 6f 92 push r6 - 4dfa: 7f 92 push r7 - 4dfc: 8f 92 push r8 - 4dfe: 9f 92 push r9 - 4e00: af 92 push r10 - 4e02: bf 92 push r11 - 4e04: cf 92 push r12 - 4e06: df 92 push r13 - 4e08: ef 92 push r14 - 4e0a: ff 92 push r15 - 4e0c: 0f 93 push r16 - 4e0e: 1f 93 push r17 - 4e10: cf 93 push r28 - 4e12: df 93 push r29 - 4e14: cd b7 in r28, 0x3d ; 61 - 4e16: de b7 in r29, 0x3e ; 62 - 4e18: ca 1b sub r28, r26 - 4e1a: db 0b sbc r29, r27 - 4e1c: cd bf out 0x3d, r28 ; 61 - 4e1e: de bf out 0x3e, r29 ; 62 - 4e20: 09 94 ijmp - -00004e22 <__epilogue_restores__>: - 4e22: 2a 88 ldd r2, Y+18 ; 0x12 - 4e24: 39 88 ldd r3, Y+17 ; 0x11 - 4e26: 48 88 ldd r4, Y+16 ; 0x10 - 4e28: 5f 84 ldd r5, Y+15 ; 0x0f - 4e2a: 6e 84 ldd r6, Y+14 ; 0x0e - 4e2c: 7d 84 ldd r7, Y+13 ; 0x0d - 4e2e: 8c 84 ldd r8, Y+12 ; 0x0c - 4e30: 9b 84 ldd r9, Y+11 ; 0x0b - 4e32: aa 84 ldd r10, Y+10 ; 0x0a - 4e34: b9 84 ldd r11, Y+9 ; 0x09 - 4e36: c8 84 ldd r12, Y+8 ; 0x08 - 4e38: df 80 ldd r13, Y+7 ; 0x07 - 4e3a: ee 80 ldd r14, Y+6 ; 0x06 - 4e3c: fd 80 ldd r15, Y+5 ; 0x05 - 4e3e: 0c 81 ldd r16, Y+4 ; 0x04 - 4e40: 1b 81 ldd r17, Y+3 ; 0x03 - 4e42: aa 81 ldd r26, Y+2 ; 0x02 - 4e44: b9 81 ldd r27, Y+1 ; 0x01 - 4e46: ce 0f add r28, r30 - 4e48: d1 1d adc r29, r1 - 4e4a: cd bf out 0x3d, r28 ; 61 - 4e4c: de bf out 0x3e, r29 ; 62 - 4e4e: ed 01 movw r28, r26 - 4e50: 08 95 ret - -00004e52 <__udivmodsi4>: - 4e52: a1 e2 ldi r26, 0x21 ; 33 - 4e54: 1a 2e mov r1, r26 - 4e56: aa 1b sub r26, r26 - 4e58: bb 1b sub r27, r27 - 4e5a: fd 01 movw r30, r26 - 4e5c: 0d c0 rjmp .+26 ; 0x4e78 <__udivmodsi4_ep> - -00004e5e <__udivmodsi4_loop>: - 4e5e: aa 1f adc r26, r26 - 4e60: bb 1f adc r27, r27 - 4e62: ee 1f adc r30, r30 - 4e64: ff 1f adc r31, r31 - 4e66: a2 17 cp r26, r18 - 4e68: b3 07 cpc r27, r19 - 4e6a: e4 07 cpc r30, r20 - 4e6c: f5 07 cpc r31, r21 - 4e6e: 20 f0 brcs .+8 ; 0x4e78 <__udivmodsi4_ep> - 4e70: a2 1b sub r26, r18 - 4e72: b3 0b sbc r27, r19 - 4e74: e4 0b sbc r30, r20 - 4e76: f5 0b sbc r31, r21 - -00004e78 <__udivmodsi4_ep>: - 4e78: 66 1f adc r22, r22 - 4e7a: 77 1f adc r23, r23 - 4e7c: 88 1f adc r24, r24 - 4e7e: 99 1f adc r25, r25 - 4e80: 1a 94 dec r1 - 4e82: 69 f7 brne .-38 ; 0x4e5e <__udivmodsi4_loop> - 4e84: 60 95 com r22 - 4e86: 70 95 com r23 - 4e88: 80 95 com r24 - 4e8a: 90 95 com r25 - 4e8c: 9b 01 movw r18, r22 - 4e8e: ac 01 movw r20, r24 - 4e90: bd 01 movw r22, r26 - 4e92: cf 01 movw r24, r30 - 4e94: 08 95 ret - -00004e96 <_exit>: - 4e96: f8 94 cli - -00004e98 <__stop_program>: - 4e98: ff cf rjmp .-2 ; 0x4e98 <__stop_program> + +Chameleon-Mini.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .text 0000628e 00000000 00000000 000000b4 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 .data 00000092 00802000 0000628e 00006342 2**0 + CONTENTS, ALLOC, LOAD, DATA + 2 .bss 00000e37 00802092 00802092 000063d4 2**0 + ALLOC + 3 .eeprom 00000033 00810000 00810000 000063d4 2**0 + CONTENTS, ALLOC, LOAD, DATA + 4 .stab 000015a8 00000000 00000000 00006408 2**2 + CONTENTS, READONLY, DEBUGGING + 5 .stabstr 00000788 00000000 00000000 000079b0 2**0 + CONTENTS, READONLY, DEBUGGING + 6 .comment 0000002f 00000000 00000000 00008138 2**0 + CONTENTS, READONLY + 7 .debug_aranges 00000d80 00000000 00000000 00008167 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_info 0001c598 00000000 00000000 00008ee7 2**0 + CONTENTS, READONLY, DEBUGGING + 9 .debug_abbrev 00006309 00000000 00000000 0002547f 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_line 0000d67b 00000000 00000000 0002b788 2**0 + CONTENTS, READONLY, DEBUGGING + 11 .debug_frame 00002304 00000000 00000000 00038e04 2**2 + CONTENTS, READONLY, DEBUGGING + 12 .debug_str 00007fb5 00000000 00000000 0003b108 2**0 + CONTENTS, READONLY, DEBUGGING + 13 .debug_loc 0000eb2a 00000000 00000000 000430bd 2**0 + CONTENTS, READONLY, DEBUGGING + 14 .debug_ranges 00001de0 00000000 00000000 00051be7 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 6d c4 rjmp .+2266 ; 0x8dc <__ctors_end> + 2: 00 00 nop + 4: 87 c4 rjmp .+2318 ; 0x914 <__bad_interrupt> + 6: 00 00 nop + 8: 85 c4 rjmp .+2314 ; 0x914 <__bad_interrupt> + a: 00 00 nop + c: 83 c4 rjmp .+2310 ; 0x914 <__bad_interrupt> + e: 00 00 nop + 10: 81 c4 rjmp .+2306 ; 0x914 <__bad_interrupt> + 12: 00 00 nop + 14: 7f c4 rjmp .+2302 ; 0x914 <__bad_interrupt> + 16: 00 00 nop + 18: 7d c4 rjmp .+2298 ; 0x914 <__bad_interrupt> + 1a: 00 00 nop + 1c: 7b c4 rjmp .+2294 ; 0x914 <__bad_interrupt> + 1e: 00 00 nop + 20: 79 c4 rjmp .+2290 ; 0x914 <__bad_interrupt> + 22: 00 00 nop + 24: 77 c4 rjmp .+2286 ; 0x914 <__bad_interrupt> + 26: 00 00 nop + 28: 03 c5 rjmp .+2566 ; 0xa30 <__vector_10> + 2a: 00 00 nop + 2c: 73 c4 rjmp .+2278 ; 0x914 <__bad_interrupt> + 2e: 00 00 nop + 30: 71 c4 rjmp .+2274 ; 0x914 <__bad_interrupt> + 32: 00 00 nop + 34: 6f c4 rjmp .+2270 ; 0x914 <__bad_interrupt> + 36: 00 00 nop + 38: 6d c4 rjmp .+2266 ; 0x914 <__bad_interrupt> + 3a: 00 00 nop + 3c: 6b c4 rjmp .+2262 ; 0x914 <__bad_interrupt> + 3e: 00 00 nop + 40: 69 c4 rjmp .+2258 ; 0x914 <__bad_interrupt> + 42: 00 00 nop + 44: 67 c4 rjmp .+2254 ; 0x914 <__bad_interrupt> + 46: 00 00 nop + 48: 65 c4 rjmp .+2250 ; 0x914 <__bad_interrupt> + 4a: 00 00 nop + 4c: 63 c4 rjmp .+2246 ; 0x914 <__bad_interrupt> + 4e: 00 00 nop + 50: 61 c4 rjmp .+2242 ; 0x914 <__bad_interrupt> + 52: 00 00 nop + 54: 5f c4 rjmp .+2238 ; 0x914 <__bad_interrupt> + 56: 00 00 nop + 58: 0c 94 0c 17 jmp 0x2e18 ; 0x2e18 <__vector_22> + 5c: 5b c4 rjmp .+2230 ; 0x914 <__bad_interrupt> + 5e: 00 00 nop + 60: 59 c4 rjmp .+2226 ; 0x914 <__bad_interrupt> + 62: 00 00 nop + 64: 57 c4 rjmp .+2222 ; 0x914 <__bad_interrupt> + 66: 00 00 nop + 68: 55 c4 rjmp .+2218 ; 0x914 <__bad_interrupt> + 6a: 00 00 nop + 6c: 53 c4 rjmp .+2214 ; 0x914 <__bad_interrupt> + 6e: 00 00 nop + 70: 51 c4 rjmp .+2210 ; 0x914 <__bad_interrupt> + 72: 00 00 nop + 74: 4f c4 rjmp .+2206 ; 0x914 <__bad_interrupt> + 76: 00 00 nop + 78: 4d c4 rjmp .+2202 ; 0x914 <__bad_interrupt> + 7a: 00 00 nop + 7c: 4b c4 rjmp .+2198 ; 0x914 <__bad_interrupt> + 7e: 00 00 nop + 80: 49 c4 rjmp .+2194 ; 0x914 <__bad_interrupt> + 82: 00 00 nop + 84: 47 c4 rjmp .+2190 ; 0x914 <__bad_interrupt> + 86: 00 00 nop + 88: 0c 94 db 16 jmp 0x2db6 ; 0x2db6 <__vector_34> + 8c: 43 c4 rjmp .+2182 ; 0x914 <__bad_interrupt> + 8e: 00 00 nop + 90: 41 c4 rjmp .+2178 ; 0x914 <__bad_interrupt> + 92: 00 00 nop + 94: 3f c4 rjmp .+2174 ; 0x914 <__bad_interrupt> + 96: 00 00 nop + 98: 3d c4 rjmp .+2170 ; 0x914 <__bad_interrupt> + 9a: 00 00 nop + 9c: 3b c4 rjmp .+2166 ; 0x914 <__bad_interrupt> + 9e: 00 00 nop + a0: 39 c4 rjmp .+2162 ; 0x914 <__bad_interrupt> + a2: 00 00 nop + a4: 37 c4 rjmp .+2158 ; 0x914 <__bad_interrupt> + a6: 00 00 nop + a8: 35 c4 rjmp .+2154 ; 0x914 <__bad_interrupt> + aa: 00 00 nop + ac: 33 c4 rjmp .+2150 ; 0x914 <__bad_interrupt> + ae: 00 00 nop + b0: 31 c4 rjmp .+2146 ; 0x914 <__bad_interrupt> + b2: 00 00 nop + b4: 2f c4 rjmp .+2142 ; 0x914 <__bad_interrupt> + b6: 00 00 nop + b8: 2d c4 rjmp .+2138 ; 0x914 <__bad_interrupt> + ba: 00 00 nop + bc: 2b c4 rjmp .+2134 ; 0x914 <__bad_interrupt> + be: 00 00 nop + c0: 29 c4 rjmp .+2130 ; 0x914 <__bad_interrupt> + c2: 00 00 nop + c4: 27 c4 rjmp .+2126 ; 0x914 <__bad_interrupt> + c6: 00 00 nop + c8: 25 c4 rjmp .+2122 ; 0x914 <__bad_interrupt> + ca: 00 00 nop + cc: 23 c4 rjmp .+2118 ; 0x914 <__bad_interrupt> + ce: 00 00 nop + d0: 21 c4 rjmp .+2114 ; 0x914 <__bad_interrupt> + d2: 00 00 nop + d4: 1f c4 rjmp .+2110 ; 0x914 <__bad_interrupt> + d6: 00 00 nop + d8: 1d c4 rjmp .+2106 ; 0x914 <__bad_interrupt> + da: 00 00 nop + dc: 1b c4 rjmp .+2102 ; 0x914 <__bad_interrupt> + de: 00 00 nop + e0: 19 c4 rjmp .+2098 ; 0x914 <__bad_interrupt> + e2: 00 00 nop + e4: 17 c4 rjmp .+2094 ; 0x914 <__bad_interrupt> + e6: 00 00 nop + e8: 15 c4 rjmp .+2090 ; 0x914 <__bad_interrupt> + ea: 00 00 nop + ec: 13 c4 rjmp .+2086 ; 0x914 <__bad_interrupt> + ee: 00 00 nop + f0: 11 c4 rjmp .+2082 ; 0x914 <__bad_interrupt> + f2: 00 00 nop + f4: 0f c4 rjmp .+2078 ; 0x914 <__bad_interrupt> + f6: 00 00 nop + f8: 0d c4 rjmp .+2074 ; 0x914 <__bad_interrupt> + fa: 00 00 nop + fc: 0b c4 rjmp .+2070 ; 0x914 <__bad_interrupt> + fe: 00 00 nop + 100: 09 c4 rjmp .+2066 ; 0x914 <__bad_interrupt> + 102: 00 00 nop + 104: 07 c4 rjmp .+2062 ; 0x914 <__bad_interrupt> + 106: 00 00 nop + 108: 05 c4 rjmp .+2058 ; 0x914 <__bad_interrupt> + 10a: 00 00 nop + 10c: 03 c4 rjmp .+2054 ; 0x914 <__bad_interrupt> + 10e: 00 00 nop + 110: 01 c4 rjmp .+2050 ; 0x914 <__bad_interrupt> + 112: 00 00 nop + 114: ff c3 rjmp .+2046 ; 0x914 <__bad_interrupt> + 116: 00 00 nop + 118: fd c3 rjmp .+2042 ; 0x914 <__bad_interrupt> + 11a: 00 00 nop + 11c: fb c3 rjmp .+2038 ; 0x914 <__bad_interrupt> + 11e: 00 00 nop + 120: f9 c3 rjmp .+2034 ; 0x914 <__bad_interrupt> + 122: 00 00 nop + 124: f7 c3 rjmp .+2030 ; 0x914 <__bad_interrupt> + 126: 00 00 nop + 128: f5 c3 rjmp .+2026 ; 0x914 <__bad_interrupt> + 12a: 00 00 nop + 12c: f3 c3 rjmp .+2022 ; 0x914 <__bad_interrupt> + 12e: 00 00 nop + 130: f1 c3 rjmp .+2018 ; 0x914 <__bad_interrupt> + 132: 00 00 nop + 134: ef c3 rjmp .+2014 ; 0x914 <__bad_interrupt> + 136: 00 00 nop + 138: ed c3 rjmp .+2010 ; 0x914 <__bad_interrupt> + 13a: 00 00 nop + 13c: eb c3 rjmp .+2006 ; 0x914 <__bad_interrupt> + 13e: 00 00 nop + 140: e9 c3 rjmp .+2002 ; 0x914 <__bad_interrupt> + 142: 00 00 nop + 144: e7 c3 rjmp .+1998 ; 0x914 <__bad_interrupt> + 146: 00 00 nop + 148: e5 c3 rjmp .+1994 ; 0x914 <__bad_interrupt> + 14a: 00 00 nop + 14c: 0c 94 b0 17 jmp 0x2f60 ; 0x2f60 <__vector_83> + 150: e1 c3 rjmp .+1986 ; 0x914 <__bad_interrupt> + 152: 00 00 nop + 154: df c3 rjmp .+1982 ; 0x914 <__bad_interrupt> + 156: 00 00 nop + 158: dd c3 rjmp .+1978 ; 0x914 <__bad_interrupt> + 15a: 00 00 nop + 15c: db c3 rjmp .+1974 ; 0x914 <__bad_interrupt> + 15e: 00 00 nop + 160: d9 c3 rjmp .+1970 ; 0x914 <__bad_interrupt> + 162: 00 00 nop + 164: d7 c3 rjmp .+1966 ; 0x914 <__bad_interrupt> + 166: 00 00 nop + 168: d5 c3 rjmp .+1962 ; 0x914 <__bad_interrupt> + 16a: 00 00 nop + 16c: d3 c3 rjmp .+1958 ; 0x914 <__bad_interrupt> + 16e: 00 00 nop + 170: d1 c3 rjmp .+1954 ; 0x914 <__bad_interrupt> + 172: 00 00 nop + 174: cf c3 rjmp .+1950 ; 0x914 <__bad_interrupt> + 176: 00 00 nop + 178: cd c3 rjmp .+1946 ; 0x914 <__bad_interrupt> + 17a: 00 00 nop + 17c: cb c3 rjmp .+1942 ; 0x914 <__bad_interrupt> + 17e: 00 00 nop + 180: c9 c3 rjmp .+1938 ; 0x914 <__bad_interrupt> + 182: 00 00 nop + 184: c7 c3 rjmp .+1934 ; 0x914 <__bad_interrupt> + 186: 00 00 nop + 188: c5 c3 rjmp .+1930 ; 0x914 <__bad_interrupt> + 18a: 00 00 nop + 18c: c3 c3 rjmp .+1926 ; 0x914 <__bad_interrupt> + 18e: 00 00 nop + 190: c1 c3 rjmp .+1922 ; 0x914 <__bad_interrupt> + 192: 00 00 nop + 194: bf c3 rjmp .+1918 ; 0x914 <__bad_interrupt> + 196: 00 00 nop + 198: bd c3 rjmp .+1914 ; 0x914 <__bad_interrupt> + 19a: 00 00 nop + 19c: bb c3 rjmp .+1910 ; 0x914 <__bad_interrupt> + 19e: 00 00 nop + 1a0: b9 c3 rjmp .+1906 ; 0x914 <__bad_interrupt> + 1a2: 00 00 nop + 1a4: b7 c3 rjmp .+1902 ; 0x914 <__bad_interrupt> + 1a6: 00 00 nop + 1a8: b5 c3 rjmp .+1898 ; 0x914 <__bad_interrupt> + 1aa: 00 00 nop + 1ac: b3 c3 rjmp .+1894 ; 0x914 <__bad_interrupt> + 1ae: 00 00 nop + 1b0: b1 c3 rjmp .+1890 ; 0x914 <__bad_interrupt> + 1b2: 00 00 nop + 1b4: af c3 rjmp .+1886 ; 0x914 <__bad_interrupt> + 1b6: 00 00 nop + 1b8: ad c3 rjmp .+1882 ; 0x914 <__bad_interrupt> + 1ba: 00 00 nop + 1bc: ab c3 rjmp .+1878 ; 0x914 <__bad_interrupt> + 1be: 00 00 nop + 1c0: a9 c3 rjmp .+1874 ; 0x914 <__bad_interrupt> + 1c2: 00 00 nop + 1c4: a7 c3 rjmp .+1870 ; 0x914 <__bad_interrupt> + 1c6: 00 00 nop + 1c8: a5 c3 rjmp .+1866 ; 0x914 <__bad_interrupt> + 1ca: 00 00 nop + 1cc: a3 c3 rjmp .+1862 ; 0x914 <__bad_interrupt> + 1ce: 00 00 nop + 1d0: a1 c3 rjmp .+1858 ; 0x914 <__bad_interrupt> + 1d2: 00 00 nop + 1d4: 9f c3 rjmp .+1854 ; 0x914 <__bad_interrupt> + 1d6: 00 00 nop + 1d8: 9d c3 rjmp .+1850 ; 0x914 <__bad_interrupt> + 1da: 00 00 nop + 1dc: 9b c3 rjmp .+1846 ; 0x914 <__bad_interrupt> + 1de: 00 00 nop + 1e0: 99 c3 rjmp .+1842 ; 0x914 <__bad_interrupt> + 1e2: 00 00 nop + 1e4: 97 c3 rjmp .+1838 ; 0x914 <__bad_interrupt> + 1e6: 00 00 nop + 1e8: 95 c3 rjmp .+1834 ; 0x914 <__bad_interrupt> + 1ea: 00 00 nop + 1ec: 93 c3 rjmp .+1830 ; 0x914 <__bad_interrupt> + 1ee: 00 00 nop + 1f0: 91 c3 rjmp .+1826 ; 0x914 <__bad_interrupt> + 1f2: 00 00 nop + 1f4: 0c 94 da 2a jmp 0x55b4 ; 0x55b4 <__vector_125> + 1f8: 8d c3 rjmp .+1818 ; 0x914 <__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: 00 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 .NONE........... + 298: 00 a0 05 a1 05 a2 05 a3 05 a4 05 a5 05 a8 05 a9 ................ + 2a8: 05 00 00 00 01 01 4d 46 5f 55 4c 54 52 41 4c 49 ......MF_ULTRALI + 2b8: 47 48 54 00 00 00 a1 18 d8 18 89 19 8d 19 91 19 GHT............. + 2c8: 92 19 e4 1a f7 1a 40 00 07 00 02 4d 46 5f 43 4c ......@....MF_CL + 2d8: 41 53 53 49 43 5f 31 4b 00 00 00 a1 18 d8 18 36 ASSIC_1K.......6 + 2e8: 1b 69 1b 6d 1b 6e 1b 32 21 53 21 00 04 04 00 03 .i.m.n.2!S!..... + 2f8: 4d 46 5f 50 4c 55 53 31 4b 5f 37 42 00 00 00 00 MF_PLUS1K_7B.... + 308: a1 18 d8 18 45 1b 69 1b 6d 1b 6e 1b 32 21 53 21 ....E.i.m.n.2!S! + 318: 00 04 07 00 04 4d 46 5f 43 4c 41 53 53 49 43 5f .....MF_CLASSIC_ + 328: 34 4b 00 00 00 a1 18 d8 18 5a 1b 69 1b 6d 1b 6e 4K.......Z.i.m.n + 338: 1b 32 21 53 21 00 10 04 00 05 49 53 4f 31 34 34 .2!S!.....ISO144 + 348: 34 33 41 5f 53 4e 49 46 46 00 a1 18 d8 18 a2 05 43A_SNIFF....... + 358: a3 05 a4 05 a5 05 a8 05 a9 05 00 00 00 01 .............. + +00000366 : + 366: 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 00 NONE............ + 376: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 386: 55 49 44 5f 52 41 4e 44 4f 4d 00 00 00 00 00 00 UID_RANDOM...... + 396: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 3a6: 55 49 44 5f 4c 45 46 54 5f 49 4e 43 52 45 4d 45 UID_LEFT_INCREME + 3b6: 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 NT.............. + 3c6: 55 49 44 5f 52 49 47 48 54 5f 49 4e 43 52 45 4d UID_RIGHT_INCREM + 3d6: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. + 3e6: 55 49 44 5f 4c 45 46 54 5f 44 45 43 52 45 4d 45 UID_LEFT_DECREME + 3f6: 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 NT.............. + 406: 55 49 44 5f 52 49 47 48 54 5f 44 45 43 52 45 4d UID_RIGHT_DECREM + 416: 45 4e 54 00 00 00 00 00 00 00 00 00 00 00 00 00 ENT............. + 426: 43 59 43 4c 45 5f 53 45 54 54 49 4e 47 53 00 00 CYCLE_SETTINGS.. + 436: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 446: 53 54 4f 52 45 5f 4d 45 4d 00 00 00 00 00 00 00 STORE_MEM....... + 456: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 466: 52 45 43 41 4c 4c 5f 4d 45 4d 00 00 00 00 00 00 RECALL_MEM...... + 476: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +00000486 : + 486: 4f 46 46 00 00 00 00 00 00 00 00 00 00 00 00 00 OFF............. + 496: 4d 45 4d 4f 52 59 00 00 00 00 00 00 00 00 00 00 MEMORY.......... + 4a6: 54 45 52 4d 49 4e 41 4c 00 00 00 00 00 00 00 00 TERMINAL........ + +000004b6 <__c.6349>: + 4b6: 2c 00 ,. + +000004b8 : + 4b8: 4e 4f 4e 45 00 00 00 00 00 00 00 00 00 00 00 00 NONE............ + 4c8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 4d8: 54 45 52 4d 49 4e 41 4c 5f 43 4f 4e 4e 00 00 00 TERMINAL_CONN... + 4e8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 4f8: 54 45 52 4d 49 4e 41 4c 5f 52 58 54 58 00 00 00 TERMINAL_RXTX... + 508: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 518: 53 45 54 54 49 4e 47 5f 43 48 41 4e 47 45 00 00 SETTING_CHANGE.. + 528: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 538: 4d 45 4d 4f 52 59 5f 53 54 4f 52 45 44 00 00 00 MEMORY_STORED... + 548: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 558: 4d 45 4d 4f 52 59 5f 43 48 41 4e 47 45 44 00 00 MEMORY_CHANGED.. + 568: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 578: 43 4f 44 45 43 5f 52 58 00 00 00 00 00 00 00 00 CODEC_RX........ + 588: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 598: 43 4f 44 45 43 5f 54 58 00 00 00 00 00 00 00 00 CODEC_TX........ + 5a8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + +000005b8 <__c.6462>: + 5b8: 43 68 61 6d 65 6c 65 6f 6e 2d 4d 69 6e 69 20 25 Chameleon-Mini % + 5c8: 53 20 75 73 69 6e 67 20 4c 55 46 41 20 25 53 20 S using LUFA %S + 5d8: 63 6f 6d 70 69 6c 65 64 20 77 69 74 68 20 41 56 compiled with AV + 5e8: 52 2d 47 43 43 20 25 53 00 R-GCC %S. + +000005f1 <__c.6464>: + 5f1: 31 35 30 32 32 33 00 150223. + +000005f8 <__c.6466>: + 5f8: 31 33 30 39 30 31 00 130901. + +000005ff <__c.6468>: + 5ff: 34 2e 37 2e 32 00 4.7.2. + +00000605 <__c.6473>: + 605: 25 73 00 %s. + +00000608 <__c.6491>: + 608: 52 41 4e 44 4f 4d 00 RANDOM. + +0000060f <__c.6518>: + 60f: 25 75 00 %u. + +00000612 <__c.6523>: + 612: 25 75 00 %u. + +00000615 <__c.6573>: + 615: 25 53 2c 25 53 00 %S,%S. + +0000061b <__c.6575>: + 61b: 4c 4f 41 44 42 49 4e 00 LOADBIN. + +00000623 <__c.6577>: + 623: 43 4c 45 41 52 00 CLEAR. + +00000629 <__c.6582>: + 629: 25 75 00 %u. + +0000062c <__c.6587>: + 62c: 4c 4f 41 44 42 49 4e 00 LOADBIN. + +00000634 <__c.6589>: + 634: 43 4c 45 41 52 00 CLEAR. + +0000063a <__c.6619>: + 63a: 25 35 75 20 6d 56 00 %5u mV. + +00000641 : + 641: 56 45 52 53 49 4f 4e 00 00 00 00 00 00 00 00 00 VERSION......... + 651: 00 00 00 00 4f 11 43 4f 4e 46 49 47 00 00 00 00 ....O.CONFIG.... + 661: 00 00 00 00 00 00 8c 11 83 11 6d 11 55 49 44 00 ..........m.UID. + 671: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b9 11 ................ + 681: 92 11 52 45 41 44 4f 4e 4c 59 00 00 00 00 00 00 ..READONLY...... + 691: 00 00 00 00 24 12 12 12 55 50 4c 4f 41 44 00 00 ....$...UPLOAD.. + 6a1: 00 00 00 00 00 00 00 00 38 12 00 00 00 00 44 4f ........8.....DO + 6b1: 57 4e 4c 4f 41 44 00 00 00 00 00 00 00 00 3d 12 WNLOAD........=. + 6c1: 00 00 00 00 52 45 53 45 54 00 00 00 00 00 00 00 ....RESET....... + 6d1: 00 00 00 00 42 12 00 00 00 00 55 50 47 52 41 44 ....B.....UPGRAD + 6e1: 45 00 00 00 00 00 00 00 00 00 4d 12 00 00 00 00 E.........M..... + 6f1: 4d 45 4d 53 49 5a 45 00 00 00 00 00 00 00 00 00 MEMSIZE......... + 701: 00 00 00 00 58 12 55 49 44 53 49 5a 45 00 00 00 ....X.UIDSIZE... + 711: 00 00 00 00 00 00 00 00 00 00 70 12 42 55 54 54 ..........p.BUTT + 721: 4f 4e 00 00 00 00 00 00 00 00 00 00 86 12 92 12 ON.............. + 731: 8b 12 42 55 54 54 4f 4e 5f 4c 4f 4e 47 00 00 00 ..BUTTON_LONG... + 741: 00 00 9c 12 a8 12 a1 12 4c 45 44 47 52 45 45 4e ........LEDGREEN + 751: 00 00 00 00 00 00 00 00 b2 12 be 12 b7 12 4c 45 ..............LE + 761: 44 52 45 44 00 00 00 00 00 00 00 00 00 00 c8 12 DRED............ + 771: d4 12 cd 12 4c 4f 47 4d 4f 44 45 00 00 00 00 00 ....LOGMODE..... + 781: 00 00 00 00 de 12 e8 12 e3 12 4c 4f 47 4d 45 4d ..........LOGMEM + 791: 00 00 00 00 00 00 00 00 00 00 f0 12 24 13 0a 13 ............$... + 7a1: 53 45 54 54 49 4e 47 00 00 00 00 00 00 00 00 00 SETTING......... + 7b1: 00 00 49 13 44 13 43 4c 45 41 52 00 00 00 00 00 ..I.D.CLEAR..... + 7c1: 00 00 00 00 00 00 51 13 00 00 00 00 48 45 4c 50 ......Q.....HELP + 7d1: 00 00 00 00 00 00 00 00 00 00 00 00 55 13 00 00 ............U... + 7e1: 00 00 52 53 53 49 00 00 00 00 00 00 00 00 00 00 ..RSSI.......... + 7f1: 00 00 00 00 00 00 a1 13 00 00 00 00 00 00 00 00 ................ + 801: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .............. + +0000080f <__c.6126>: + 80f: 0d 0a 00 ... + +00000812 <__c.6128>: + 812: 0d 0a 00 ... + +00000815 : + 815: 64 31 30 30 3a 4f 4b 00 00 00 00 00 00 00 00 00 d100:OK......... + 825: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 835: 00 65 31 30 31 3a 4f 4b 20 57 49 54 48 20 54 45 .e101:OK WITH TE + 845: 58 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 XT.............. + 855: 00 00 6e 31 31 30 3a 57 41 49 54 49 4e 47 20 46 ..n110:WAITING F + 865: 4f 52 20 58 4d 4f 44 45 4d 00 00 00 00 00 00 00 OR XMODEM....... + 875: 00 00 00 c8 32 30 30 3a 55 4e 4b 4e 4f 57 4e 20 ....200:UNKNOWN + 885: 43 4f 4d 4d 41 4e 44 00 00 00 00 00 00 00 00 00 COMMAND......... + 895: 00 00 00 00 c9 32 30 31 3a 49 4e 56 41 4c 49 44 .....201:INVALID + 8a5: 20 43 4f 4d 4d 41 4e 44 20 55 53 41 47 45 00 00 COMMAND USAGE.. + 8b5: 00 00 00 00 00 ca 32 30 32 3a 49 4e 56 41 4c 49 ......202:INVALI + 8c5: 44 20 50 41 52 41 4d 45 54 45 52 00 00 00 00 00 D PARAMETER..... + 8d5: 00 00 00 00 00 00 00 ....... + +000008dc <__ctors_end>: + 8dc: 11 24 eor r1, r1 + 8de: 1f be out 0x3f, r1 ; 63 + 8e0: cf ef ldi r28, 0xFF ; 255 + 8e2: df e2 ldi r29, 0x2F ; 47 + 8e4: de bf out 0x3e, r29 ; 62 + 8e6: cd bf out 0x3d, r28 ; 61 + +000008e8 <__do_copy_data>: + 8e8: 10 e2 ldi r17, 0x20 ; 32 + 8ea: a0 e0 ldi r26, 0x00 ; 0 + 8ec: b0 e2 ldi r27, 0x20 ; 32 + 8ee: ee e8 ldi r30, 0x8E ; 142 + 8f0: f2 e6 ldi r31, 0x62 ; 98 + 8f2: 02 c0 rjmp .+4 ; 0x8f8 <__do_copy_data+0x10> + 8f4: 05 90 lpm r0, Z+ + 8f6: 0d 92 st X+, r0 + 8f8: a2 39 cpi r26, 0x92 ; 146 + 8fa: b1 07 cpc r27, r17 + 8fc: d9 f7 brne .-10 ; 0x8f4 <__do_copy_data+0xc> + +000008fe <__do_clear_bss>: + 8fe: 2e e2 ldi r18, 0x2E ; 46 + 900: a2 e9 ldi r26, 0x92 ; 146 + 902: b0 e2 ldi r27, 0x20 ; 32 + 904: 01 c0 rjmp .+2 ; 0x908 <.do_clear_bss_start> + +00000906 <.do_clear_bss_loop>: + 906: 1d 92 st X+, r1 + +00000908 <.do_clear_bss_start>: + 908: a9 3c cpi r26, 0xC9 ; 201 + 90a: b2 07 cpc r27, r18 + 90c: e1 f7 brne .-8 ; 0x906 <.do_clear_bss_loop> + 90e: 03 d0 rcall .+6 ; 0x916
+ 910: 0c 94 45 31 jmp 0x628a ; 0x628a <_exit> + +00000914 <__bad_interrupt>: + 914: 87 c0 rjmp .+270 ; 0xa24 <__vector_default> + +00000916
: +#include "Chameleon-Mini.h" + +int main(void) +{ + SystemInit(); + 916: 8d d0 rcall .+282 ; 0xa32 + SettingsLoad(); + 918: 0e 94 34 0e call 0x1c68 ; 0x1c68 + LogInit(); + 91c: 0e 94 d2 0d call 0x1ba4 ; 0x1ba4 + LEDInit(); + 920: 0e 94 1d 0f call 0x1e3a ; 0x1e3a + MemoryInit(); + 924: fd d2 rcall .+1530 ; 0xf20 + ConfigurationInit(); + 926: 31 d1 rcall .+610 ; 0xb8a + TerminalInit(); + 928: 0e 94 db 10 call 0x21b6 ; 0x21b6 + RandomInit(); + 92c: a4 d1 rcall .+840 ; 0xc76 + ButtonInit(); + 92e: 95 d7 rcall .+3882 ; 0x185a +#define ANTENNA_LEVEL_DENOMINATOR (ANTENNA_LEVEL_SCALE) + +static inline +void AntennaLevelInit(void) +{ + ADCA.CTRLA = ADC_ENABLE_bm; + 930: 81 e0 ldi r24, 0x01 ; 1 + 932: 80 93 00 02 sts 0x0200, r24 + ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc; + 936: 10 92 01 02 sts 0x0201, r1 + ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_BANDGAP_bm; + 93a: 92 e0 ldi r25, 0x02 ; 2 + 93c: 90 93 02 02 sts 0x0202, r25 + ADCA.PRESCALER = ADC_PRESCALER_DIV32_gc; + 940: 93 e0 ldi r25, 0x03 ; 3 + 942: 90 93 04 02 sts 0x0204, r25 + ADCA.CH0.CTRL = ADC_CH_INPUTMODE_SINGLEENDED_gc; + 946: 80 93 20 02 sts 0x0220, r24 + ADCA.CH0.MUXCTRL = ADC_CH_MUXPOS_PIN7_gc; + 94a: 88 e3 ldi r24, 0x38 ; 56 + 94c: 80 93 21 02 sts 0x0221, r24 + AntennaLevelInit(); + + SystemInterruptInit(); + 950: f1 d0 rcall .+482 ; 0xb34 + asm volatile("sleep"); +} + +INLINE void SystemSleepEnable(void) +{ + SLEEP.CTRL |= SLEEP_SEN_bm; + 952: 80 91 48 00 lds r24, 0x0048 + 956: 81 60 ori r24, 0x01 ; 1 + 958: 80 93 48 00 sts 0x0048, r24 +{ + if (RTC.INTFLAGS & RTC_COMPIF_bm) { + while(RTC.STATUS & RTC_SYNCBUSY_bm) + ; + + RTC.INTFLAGS = RTC_COMPIF_bm; + 95c: c2 e0 ldi r28, 0x02 ; 2 + 95e: 0e c0 rjmp .+28 ; 0x97c + ButtonTick(); + LogTick(); + LEDTick(); + } + + TerminalTask(); + 960: 0e 94 e0 10 call 0x21c0 ; 0x21c0 +INLINE void ApplicationInit(void) { + ActiveConfiguration.ApplicationInitFunc(); +} + +INLINE void ApplicationTask(void) { + ActiveConfiguration.ApplicationTaskFunc(); + 964: e0 91 fb 28 lds r30, 0x28FB + 968: f0 91 fc 28 lds r31, 0x28FC + 96c: 09 95 icall + ApplicationTask(); + LogTask(); + 96e: 0e 94 48 0d call 0x1a90 ; 0x1a90 +INLINE void CodecInit(void) { + ActiveConfiguration.CodecInitFunc(); +} + +INLINE void CodecTask(void) { + ActiveConfiguration.CodecTaskFunc(); + 972: e0 91 f5 28 lds r30, 0x28F5 + 976: f0 91 f6 28 lds r31, 0x28F6 + 97a: 09 95 icall +INLINE void SystemSleepDisable(void); +INLINE void SystemSleepSetMode(uint8_t SleepMode); + +INLINE bool SystemTick100ms(void) +{ + if (RTC.INTFLAGS & RTC_COMPIF_bm) { + 97c: 80 91 03 04 lds r24, 0x0403 + 980: 81 ff sbrs r24, 1 + 982: ee cf rjmp .-36 ; 0x960 + while(RTC.STATUS & RTC_SYNCBUSY_bm) + 984: 80 91 01 04 lds r24, 0x0401 + 988: 80 fd sbrc r24, 0 + 98a: fc cf rjmp .-8 ; 0x984 + ; + + RTC.INTFLAGS = RTC_COMPIF_bm; + 98c: c0 93 03 04 sts 0x0403, r28 + SystemInterruptInit(); + SystemSleepEnable(); + + while(1) { + if (SystemTick100ms()) { + RandomTick(); + 990: 85 d1 rcall .+778 ; 0xc9c + TerminalTick(); + 992: 0e 94 01 11 call 0x2202 ; 0x2202 + ButtonTick(); + 996: 68 d7 rcall .+3792 ; 0x1868 + LogTick(); + 998: 0e 94 47 0d call 0x1a8e ; 0x1a8e + LEDTick(); + 99c: 0e 94 22 0f call 0x1e44 ; 0x1e44 + 9a0: df cf rjmp .-66 ; 0x960 + +000009a2 : + break; + } + + *DescriptorAddress = Address; + return Size; +} + 9a2: 29 2f mov r18, r25 + 9a4: 33 27 eor r19, r19 + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; + + switch (DescriptorType) + 9a6: 22 30 cpi r18, 0x02 ; 2 + 9a8: 31 05 cpc r19, r1 + 9aa: 39 f1 breq .+78 ; 0x9fa + 9ac: 23 30 cpi r18, 0x03 ; 3 + 9ae: 31 05 cpc r19, r1 + 9b0: a9 f0 breq .+42 ; 0x9dc + 9b2: 21 30 cpi r18, 0x01 ; 1 + 9b4: 31 05 cpc r19, r1 + 9b6: 49 f0 breq .+18 ; 0x9ca +{ + const uint8_t DescriptorType = (wValue >> 8); + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; + 9b8: 20 e0 ldi r18, 0x00 ; 0 + 9ba: 30 e0 ldi r19, 0x00 ; 0 + const void** const DescriptorAddress) +{ + const uint8_t DescriptorType = (wValue >> 8); + const uint8_t DescriptorNumber = (wValue & 0xFF); + + const void* Address = NULL; + 9bc: 80 e0 ldi r24, 0x00 ; 0 + 9be: 90 e0 ldi r25, 0x00 ; 0 + } + + break; + } + + *DescriptorAddress = Address; + 9c0: fa 01 movw r30, r20 + 9c2: 80 83 st Z, r24 + 9c4: 91 83 std Z+1, r25 ; 0x01 + return Size; +} + 9c6: c9 01 movw r24, r18 + 9c8: 08 95 ret + + switch (DescriptorType) + { + case DTYPE_Device: + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + 9ca: 22 e1 ldi r18, 0x12 ; 18 + 9cc: 30 e0 ldi r19, 0x00 ; 0 + uint16_t Size = NO_DESCRIPTOR; + + switch (DescriptorType) + { + case DTYPE_Device: + Address = &DeviceDescriptor; + 9ce: 86 e7 ldi r24, 0x76 ; 118 + 9d0: 92 e0 ldi r25, 0x02 ; 2 + } + + break; + } + + *DescriptorAddress = Address; + 9d2: fa 01 movw r30, r20 + 9d4: 80 83 st Z, r24 + 9d6: 91 83 std Z+1, r25 ; 0x01 + return Size; +} + 9d8: c9 01 movw r24, r18 + 9da: 08 95 ret + 9dc: 99 27 eor r25, r25 + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + Size = sizeof(USB_Descriptor_Configuration_t); + break; + case DTYPE_String: + switch (DescriptorNumber) + 9de: 81 30 cpi r24, 0x01 ; 1 + 9e0: 91 05 cpc r25, r1 + 9e2: a1 f0 breq .+40 ; 0xa0c + 9e4: 82 30 cpi r24, 0x02 ; 2 + 9e6: 91 05 cpc r25, r1 + 9e8: b9 f0 breq .+46 ; 0xa18 + 9ea: 89 2b or r24, r25 + 9ec: 29 f7 brne .-54 ; 0x9b8 + { + case 0x00: + Address = &LanguageString; + Size = pgm_read_byte(&LanguageString.Header.Size); + 9ee: e4 e3 ldi r30, 0x34 ; 52 + 9f0: f2 e0 ldi r31, 0x02 ; 2 + 9f2: 24 91 lpm r18, Z + 9f4: 30 e0 ldi r19, 0x00 ; 0 + break; + case DTYPE_String: + switch (DescriptorNumber) + { + case 0x00: + Address = &LanguageString; + 9f6: cf 01 movw r24, r30 + Size = pgm_read_byte(&LanguageString.Header.Size); + break; + 9f8: e3 cf rjmp .-58 ; 0x9c0 + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + break; + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + Size = sizeof(USB_Descriptor_Configuration_t); + 9fa: 2e e3 ldi r18, 0x3E ; 62 + 9fc: 30 e0 ldi r19, 0x00 ; 0 + case DTYPE_Device: + Address = &DeviceDescriptor; + Size = sizeof(USB_Descriptor_Device_t); + break; + case DTYPE_Configuration: + Address = &ConfigurationDescriptor; + 9fe: 88 e3 ldi r24, 0x38 ; 56 + a00: 92 e0 ldi r25, 0x02 ; 2 + } + + break; + } + + *DescriptorAddress = Address; + a02: fa 01 movw r30, r20 + a04: 80 83 st Z, r24 + a06: 91 83 std Z+1, r25 ; 0x01 + return Size; +} + a08: c9 01 movw r24, r18 + a0a: 08 95 ret + Address = &LanguageString; + Size = pgm_read_byte(&LanguageString.Header.Size); + break; + case 0x01: + Address = &ManufacturerString; + Size = pgm_read_byte(&ManufacturerString.Header.Size); + a0c: ea e1 ldi r30, 0x1A ; 26 + a0e: f2 e0 ldi r31, 0x02 ; 2 + a10: 24 91 lpm r18, Z + a12: 30 e0 ldi r19, 0x00 ; 0 + case 0x00: + Address = &LanguageString; + Size = pgm_read_byte(&LanguageString.Header.Size); + break; + case 0x01: + Address = &ManufacturerString; + a14: cf 01 movw r24, r30 + Size = pgm_read_byte(&ManufacturerString.Header.Size); + break; + a16: d4 cf rjmp .-88 ; 0x9c0 + case 0x02: + Address = &ProductString; + Size = pgm_read_byte(&ProductString.Header.Size); + a18: ec ef ldi r30, 0xFC ; 252 + a1a: f1 e0 ldi r31, 0x01 ; 1 + a1c: 24 91 lpm r18, Z + a1e: 30 e0 ldi r19, 0x00 ; 0 + case 0x01: + Address = &ManufacturerString; + Size = pgm_read_byte(&ManufacturerString.Header.Size); + break; + case 0x02: + Address = &ProductString; + a20: cf 01 movw r24, r30 + Size = pgm_read_byte(&ProductString.Header.Size); + break; + a22: ce cf rjmp .-100 ; 0x9c0 + +00000a24 <__vector_default>: +#include "System.h" +#include "LED.h" +#include + +ISR(BADISR_vect) +{ + a24: 1f 92 push r1 + a26: 0f 92 push r0 + a28: 0f b6 in r0, 0x3f ; 63 + a2a: 0f 92 push r0 + a2c: 11 24 eor r1, r1 + a2e: ff cf rjmp .-2 ; 0xa2e <__vector_default+0xa> + +00000a30 <__vector_10>: + while(1); +} + +EMPTY_INTERRUPT(RTC_OVF_vect); + a30: 18 95 reti + +00000a32 : + +void SystemInit(void) +{ + if (RST.STATUS & RST_WDRF_bm) { + a32: 80 91 78 00 lds r24, 0x0078 + a36: 83 ff sbrs r24, 3 + a38: 0a c0 rjmp .+20 ; 0xa4e + /* On Watchdog reset clear WDRF bit, disable watchdog + * and jump into bootloader */ + RST.STATUS = RST_WDRF_bm; + a3a: 88 e0 ldi r24, 0x08 ; 8 + a3c: 80 93 78 00 sts 0x0078, r24 + + CCP = CCP_IOREG_gc; + a40: 88 ed ldi r24, 0xD8 ; 216 + a42: 84 bf out 0x34, r24 ; 52 + WDT.CTRL = WDT_CEN_bm; + a44: 81 e0 ldi r24, 0x01 ; 1 + a46: 80 93 80 00 sts 0x0080, r24 + + asm volatile ("jmp %0"::"i" (BOOT_SECTION_START + 0x1FC)); + a4a: fd 95 fe c0 jmp 0x7f81fc ; 0x7f81fc <__data_load_end+0x7f1edc> + } + + /* 32MHz system clock using internal RC and 32K DFLL*/ + OSC.CTRL |= OSC_RC32MEN_bm | OSC_RC32KEN_bm; + a4e: 80 91 50 00 lds r24, 0x0050 + a52: 86 60 ori r24, 0x06 ; 6 + a54: 80 93 50 00 sts 0x0050, r24 + while(!(OSC.STATUS & OSC_RC32MRDY_bm)) + a58: 80 91 51 00 lds r24, 0x0051 + a5c: 81 ff sbrs r24, 1 + a5e: fc cf rjmp .-8 ; 0xa58 + ; + while(!(OSC.STATUS & OSC_RC32KRDY_bm)) + a60: 80 91 51 00 lds r24, 0x0051 + a64: 82 ff sbrs r24, 2 + a66: fc cf rjmp .-8 ; 0xa60 + ; + + OSC.DFLLCTRL = OSC_RC32MCREF_RC32K_gc; + a68: 10 92 56 00 sts 0x0056, r1 + DFLLRC32M.CTRL = DFLL_ENABLE_bm; + a6c: 21 e0 ldi r18, 0x01 ; 1 + a6e: 20 93 60 00 sts 0x0060, r18 + + CCP = CCP_IOREG_gc; + a72: 88 ed ldi r24, 0xD8 ; 216 + a74: 84 bf out 0x34, r24 ; 52 + CLK.CTRL = CLK_SCLKSEL_RC32M_gc; + a76: 20 93 40 00 sts 0x0040, r18 + + /* Use TCE0 as system tick */ + TCE0.PER = F_CPU / 256 / SYSTEM_TICK_FREQ - 1; + a7a: 83 ed ldi r24, 0xD3 ; 211 + a7c: 90 e3 ldi r25, 0x30 ; 48 + a7e: 80 93 26 0a sts 0x0A26, r24 + a82: 90 93 27 0a sts 0x0A27, r25 + TCE0.CTRLA = TC_CLKSEL_DIV256_gc; + a86: 86 e0 ldi r24, 0x06 ; 6 + a88: 80 93 00 0a sts 0x0A00, r24 + + /* Enable RTC with roughly 1kHz clock for system tick + * and to wake up while sleeping. */ + CLK.RTCCTRL = CLK_RTCSRC_ULP_gc | CLK_RTCEN_bm; + a8c: 20 93 43 00 sts 0x0043, r18 + RTC.PER = 1000 / SYSTEM_TICK_FREQ - 1; + a90: 83 e6 ldi r24, 0x63 ; 99 + a92: 90 e0 ldi r25, 0x00 ; 0 + a94: 80 93 0a 04 sts 0x040A, r24 + a98: 90 93 0b 04 sts 0x040B, r25 + RTC.COMP = 1000 / SYSTEM_TICK_FREQ - 1; + a9c: 80 93 0c 04 sts 0x040C, r24 + aa0: 90 93 0d 04 sts 0x040D, r25 + RTC.CTRL = RTC_PRESCALER_DIV1_gc; + aa4: 20 93 00 04 sts 0x0400, r18 + RTC.INTCTRL = RTC_OVFINTLVL_LO_gc; + aa8: 20 93 02 04 sts 0x0402, r18 + + + /* Enable EEPROM data memory mapping */ + NVM.CTRLB |= NVM_EEMAPEN_bm; + aac: 80 91 cc 01 lds r24, 0x01CC + ab0: 88 60 ori r24, 0x08 ; 8 + ab2: 80 93 cc 01 sts 0x01CC, r24 + ab6: 08 95 ret + +00000ab8 : +} + +void SystemReset(void) +{ + CCP = CCP_IOREG_gc; + ab8: 88 ed ldi r24, 0xD8 ; 216 + aba: 84 bf out 0x34, r24 ; 52 + RST.CTRL = RST_SWRST_bm; + abc: 81 e0 ldi r24, 0x01 ; 1 + abe: e8 e7 ldi r30, 0x78 ; 120 + ac0: f0 e0 ldi r31, 0x00 ; 0 + ac2: 81 83 std Z+1, r24 ; 0x01 + ac4: 08 95 ret + +00000ac6 : +} + +void SystemEnterBootloader(void) +{ + /* Use Watchdog timer to reset into bootloader. */ + CCP = CCP_IOREG_gc; + ac6: 88 ed ldi r24, 0xD8 ; 216 + ac8: 84 bf out 0x34, r24 ; 52 + WDT.CTRL = WDT_PER_500CLK_gc | WDT_ENABLE_bm | WDT_CEN_bm; + aca: 8b e1 ldi r24, 0x1B ; 27 + acc: 80 93 80 00 sts 0x0080, r24 + ad0: 08 95 ret + +00000ad2 : + SLEEP.CTRL |= SLEEP_SEN_bm; +} + +INLINE void SystemSleepDisable(void) +{ + SLEEP.CTRL &= ~SLEEP_SEN_bm; + ad2: 80 91 48 00 lds r24, 0x0048 + ad6: 8e 7f andi r24, 0xFE ; 254 + ad8: 80 93 48 00 sts 0x0048, r24 +void SystemStartUSBClock(void) +{ + SystemSleepDisable(); + + /* 48MHz USB Clock using 12MHz XTAL */ + OSC.XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; + adc: 8b ec ldi r24, 0xCB ; 203 + ade: 80 93 52 00 sts 0x0052, r24 + OSC.CTRL |= OSC_XOSCEN_bm; + ae2: 80 91 50 00 lds r24, 0x0050 + ae6: 88 60 ori r24, 0x08 ; 8 + ae8: 80 93 50 00 sts 0x0050, r24 + while(!(OSC.STATUS & OSC_XOSCRDY_bm)) + aec: 80 91 51 00 lds r24, 0x0051 + af0: 83 ff sbrs r24, 3 + af2: fc cf rjmp .-8 ; 0xaec + ; + + OSC.PLLCTRL = OSC_PLLSRC_XOSC_gc | (4 << OSC_PLLFAC_gp); + af4: 84 ec ldi r24, 0xC4 ; 196 + af6: 80 93 55 00 sts 0x0055, r24 + + OSC.CTRL |= OSC_PLLEN_bm; + afa: 80 91 50 00 lds r24, 0x0050 + afe: 80 61 ori r24, 0x10 ; 16 + b00: 80 93 50 00 sts 0x0050, r24 + while(!(OSC.STATUS & OSC_PLLRDY_bm)) + b04: 80 91 51 00 lds r24, 0x0051 + b08: 84 ff sbrs r24, 4 + b0a: fc cf rjmp .-8 ; 0xb04 + ; +} + b0c: 08 95 ret + +00000b0e : + asm volatile("sleep"); +} + +INLINE void SystemSleepEnable(void) +{ + SLEEP.CTRL |= SLEEP_SEN_bm; + b0e: e8 e4 ldi r30, 0x48 ; 72 + b10: f0 e0 ldi r31, 0x00 ; 0 + b12: 80 81 ld r24, Z + b14: 81 60 ori r24, 0x01 ; 1 + b16: 80 83 st Z, r24 +void SystemStopUSBClock(void) +{ + SystemSleepEnable(); + + /* Disable USB Clock to minimize power consumption */ + CLK.USBCTRL &= ~CLK_USBSEN_bm; + b18: e0 e4 ldi r30, 0x40 ; 64 + b1a: f0 e0 ldi r31, 0x00 ; 0 + b1c: 84 81 ldd r24, Z+4 ; 0x04 + b1e: 8e 7f andi r24, 0xFE ; 254 + b20: 84 83 std Z+4, r24 ; 0x04 + OSC.CTRL &= ~OSC_PLLEN_bm; + b22: e0 e5 ldi r30, 0x50 ; 80 + b24: f0 e0 ldi r31, 0x00 ; 0 + b26: 80 81 ld r24, Z + b28: 8f 7e andi r24, 0xEF ; 239 + b2a: 80 83 st Z, r24 + OSC.CTRL &= ~OSC_XOSCEN_bm; + b2c: 80 81 ld r24, Z + b2e: 87 7f andi r24, 0xF7 ; 247 + b30: 80 83 st Z, r24 + b32: 08 95 ret + +00000b34 : +} + +void SystemInterruptInit(void) +{ + /* Enable all interrupt levels */ + PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; + b34: 87 e0 ldi r24, 0x07 ; 7 + b36: e0 ea ldi r30, 0xA0 ; 160 + b38: f0 e0 ldi r31, 0x00 ; 0 + b3a: 82 83 std Z+2, r24 ; 0x02 + sei(); + b3c: 78 94 sei + b3e: 08 95 ret + +00000b40 : + +/* Include all Codecs and Applications */ +#include "Codec/Codec.h" +#include "Application/Application.h" + +static void CodecInitDummy(void) { } + b40: 08 95 ret + +00000b42 : +static void CodecTaskDummy(void) { } + b42: 08 95 ret + +00000b44 : +static void ApplicationInitDummy(void) {} + b44: 08 95 ret + +00000b46 : +static void ApplicationResetDummy(void) {} + b46: 08 95 ret + +00000b48 : +static void ApplicationTaskDummy(void) {} + b48: 08 95 ret + +00000b4a : +static uint16_t ApplicationProcessDummy(uint8_t* ByteBuffer, uint16_t ByteCount) { return 0; } + b4a: 80 e0 ldi r24, 0x00 ; 0 + b4c: 90 e0 ldi r25, 0x00 ; 0 + b4e: 08 95 ret + +00000b50 : +static void ApplicationGetUidDummy(ConfigurationUidType Uid) { } + b50: 08 95 ret + +00000b52 : +static void ApplicationSetUidDummy(ConfigurationUidType Uid) { } + b52: 08 95 ret + +00000b54 : + ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); +} + +void ConfigurationSetById( ConfigurationEnum Configuration ) +{ + GlobalSettings.ActiveSettingPtr->Configuration = Configuration; + b54: e0 91 0a 29 lds r30, 0x290A + b58: f0 91 0b 29 lds r31, 0x290B + b5c: 83 83 std Z+3, r24 ; 0x03 + + /* Copy struct from PROGMEM to RAM */ + memcpy_P(&ActiveConfiguration, + &ConfigurationTable[Configuration], sizeof(ConfigurationType)); + b5e: 95 e2 ldi r25, 0x25 ; 37 + b60: 89 9f mul r24, r25 + b62: b0 01 movw r22, r0 + b64: 11 24 eor r1, r1 + b66: 68 57 subi r22, 0x78 ; 120 + b68: 7d 4f sbci r23, 0xFD ; 253 +void ConfigurationSetById( ConfigurationEnum Configuration ) +{ + GlobalSettings.ActiveSettingPtr->Configuration = Configuration; + + /* Copy struct from PROGMEM to RAM */ + memcpy_P(&ActiveConfiguration, + b6a: 45 e2 ldi r20, 0x25 ; 37 + b6c: 50 e0 ldi r21, 0x00 ; 0 + b6e: 82 ee ldi r24, 0xE2 ; 226 + b70: 98 e2 ldi r25, 0x28 ; 40 + b72: 0e 94 cc 2d call 0x5b98 ; 0x5b98 +#include "MifareClassic.h" + + +/* Function wrappers */ +INLINE void ApplicationInit(void) { + ActiveConfiguration.ApplicationInitFunc(); + b76: e0 91 f7 28 lds r30, 0x28F7 + b7a: f0 91 f8 28 lds r31, 0x28F8 + b7e: 09 95 icall +#define CODEC_CARRIER_FREQ 13560000 + +extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE]; + +INLINE void CodecInit(void) { + ActiveConfiguration.CodecInitFunc(); + b80: e0 91 f3 28 lds r30, 0x28F3 + b84: f0 91 f4 28 lds r31, 0x28F4 + b88: 09 94 ijmp + +00000b8a : + +ConfigurationType ActiveConfiguration; + +void ConfigurationInit(void) +{ + ConfigurationSetById(GlobalSettings.ActiveSettingPtr->Configuration); + b8a: e0 91 0a 29 lds r30, 0x290A + b8e: f0 91 0b 29 lds r31, 0x290B + b92: 83 81 ldd r24, Z+3 ; 0x03 + b94: df cf rjmp .-66 ; 0xb54 + +00000b96 : + ApplicationInit(); + CodecInit(); +} + +bool ConfigurationSetByName(const char* ConfigurationName) +{ + b96: 0f 93 push r16 + b98: 1f 93 push r17 + b9a: cf 93 push r28 + b9c: df 93 push r29 + b9e: 20 e0 ldi r18, 0x00 ; 0 + ba0: 30 e0 ldi r19, 0x00 ; 0 + uint8_t i; + + /* Loop through table trying to find the configuration */ + for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { + const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; + ba2: 15 e2 ldi r17, 0x25 ; 37 + + ApplicationInit(); + CodecInit(); +} + +bool ConfigurationSetByName(const char* ConfigurationName) + ba4: ac 01 movw r20, r24 + ba6: 4f 5f subi r20, 0xFF ; 255 + ba8: 5f 4f sbci r21, 0xFF ; 255 + baa: 02 2f mov r16, r18 +{ + uint8_t i; + + /* Loop through table trying to find the configuration */ + for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { + const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; + bac: 12 9f mul r17, r18 + bae: f0 01 movw r30, r0 + bb0: 13 9f mul r17, r19 + bb2: f0 0d add r31, r0 + bb4: 11 24 eor r1, r1 + bb6: e7 57 subi r30, 0x77 ; 119 + bb8: fd 4f sbci r31, 0xFD ; 253 + const char* pRequestedConfigName = ConfigurationName; + bool StringMismatch = false; + char c = pgm_read_byte(pTableConfigName); + bba: 64 91 lpm r22, Z + + /* Try to keep running until both strings end at the same point */ + while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { + bbc: 61 11 cpse r22, r1 + bbe: 0f c0 rjmp .+30 ; 0xbde + uint8_t i; + + /* Loop through table trying to find the configuration */ + for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { + const char* pTableConfigName = ConfigurationTable[i].ConfigurationName; + const char* pRequestedConfigName = ConfigurationName; + bc0: ec 01 movw r28, r24 + bool StringMismatch = false; + char c = pgm_read_byte(pTableConfigName); + + /* Try to keep running until both strings end at the same point */ + while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { + bc2: 68 81 ld r22, Y + bc4: 66 23 and r22, r22 + bc6: 01 f1 breq .+64 ; 0xc08 + bc8: 2f 5f subi r18, 0xFF ; 255 + bca: 3f 4f sbci r19, 0xFF ; 255 +bool ConfigurationSetByName(const char* ConfigurationName) +{ + uint8_t i; + + /* Loop through table trying to find the configuration */ + for (i=0; i<(sizeof(ConfigurationTable) / sizeof(*ConfigurationTable)); i++) { + bcc: 26 30 cpi r18, 0x06 ; 6 + bce: 31 05 cpc r19, r1 + bd0: 61 f7 brne .-40 ; 0xbaa + ConfigurationSetById(i); + return true; + } + } + + return false; + bd2: 80 e0 ldi r24, 0x00 ; 0 +} + bd4: df 91 pop r29 + bd6: cf 91 pop r28 + bd8: 1f 91 pop r17 + bda: 0f 91 pop r16 + bdc: 08 95 ret + bool StringMismatch = false; + char c = pgm_read_byte(pTableConfigName); + + /* Try to keep running until both strings end at the same point */ + while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { + if ( (c == '\0') || (*pRequestedConfigName == '\0') ) { + bde: dc 01 movw r26, r24 + be0: 7c 91 ld r23, X + be2: 77 23 and r23, r23 + be4: 89 f3 breq .-30 ; 0xbc8 + /* One String ended before the other did -> unequal length */ + StringMismatch = true; + break; + } + + if (c != *pRequestedConfigName) { + be6: 67 13 cpse r22, r23 + be8: ef cf rjmp .-34 ; 0xbc8 + + ApplicationInit(); + CodecInit(); +} + +bool ConfigurationSetByName(const char* ConfigurationName) + bea: da 01 movw r26, r20 + bec: 05 c0 rjmp .+10 ; 0xbf8 + bool StringMismatch = false; + char c = pgm_read_byte(pTableConfigName); + + /* Try to keep running until both strings end at the same point */ + while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { + if ( (c == '\0') || (*pRequestedConfigName == '\0') ) { + bee: 7d 91 ld r23, X+ + bf0: 77 23 and r23, r23 + bf2: 51 f3 breq .-44 ; 0xbc8 + /* One String ended before the other did -> unequal length */ + StringMismatch = true; + break; + } + + if (c != *pRequestedConfigName) { + bf4: 76 13 cpse r23, r22 + bf6: e8 cf rjmp .-48 ; 0xbc8 + StringMismatch = true; + break; + } + + /* Proceed to next character */ + pTableConfigName++; + bf8: 31 96 adiw r30, 0x01 ; 1 + pRequestedConfigName++; + bfa: ed 01 movw r28, r26 + + c = pgm_read_byte(pTableConfigName); + bfc: 64 91 lpm r22, Z + const char* pRequestedConfigName = ConfigurationName; + bool StringMismatch = false; + char c = pgm_read_byte(pTableConfigName); + + /* Try to keep running until both strings end at the same point */ + while ( !(c == '\0' && *pRequestedConfigName == '\0') ) { + bfe: 61 11 cpse r22, r1 + c00: f6 cf rjmp .-20 ; 0xbee + c02: 68 81 ld r22, Y + c04: 61 11 cpse r22, r1 + c06: e0 cf rjmp .-64 ; 0xbc8 + c = pgm_read_byte(pTableConfigName); + } + + if (!StringMismatch) { + /* Configuration found */ + ConfigurationSetById(i); + c08: 80 2f mov r24, r16 + c0a: a4 df rcall .-184 ; 0xb54 + return true; + c0c: 81 e0 ldi r24, 0x01 ; 1 + } + } + + return false; +} + c0e: df 91 pop r29 + c10: cf 91 pop r28 + c12: 1f 91 pop r17 + c14: 0f 91 pop r16 + c16: 08 95 ret + +00000c18 : + +void ConfigurationGetList(char* ConfigListOut, uint16_t ByteCount) +{ + c18: cf 93 push r28 + c1a: df 93 push r29 + c1c: ec 01 movw r28, r24 + uint8_t i; + + /* Account for '\0' */ + ByteCount--; + c1e: 61 50 subi r22, 0x01 ; 1 + c20: 71 09 sbc r23, r1 + c22: 80 e0 ldi r24, 0x00 ; 0 + c24: 90 e0 ldi r25, 0x00 ; 0 + + for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { + c38: 24 91 lpm r18, Z + c3a: 22 23 and r18, r18 + c3c: 81 f0 breq .+32 ; 0xc5e + c3e: 61 31 cpi r22, 0x11 ; 17 + c40: 71 05 cpc r23, r1 + c42: 68 f0 brcs .+26 ; 0xc5e + c44: de 01 movw r26, r28 + c46: 03 c0 rjmp .+6 ; 0xc4e + c48: 60 31 cpi r22, 0x10 ; 16 + c4a: 71 05 cpc r23, r1 + c4c: 41 f0 breq .+16 ; 0xc5e + /* While not end-of-string and enough buffer to + * put a complete configuration name */ + *ConfigListOut++ = c; + c4e: 2d 93 st X+, r18 + c50: ed 01 movw r28, r26 + ConfigName++; + c52: 31 96 adiw r30, 0x01 ; 1 + ByteCount--; + c54: 61 50 subi r22, 0x01 ; 1 + c56: 71 09 sbc r23, r1 + + for (i=0; i CONFIGURATION_NAME_LENGTH_MAX) { + c58: 24 91 lpm r18, Z + c5a: 21 11 cpse r18, r1 + c5c: f5 cf rjmp .-22 ; 0xc48 + *ConfigListOut++ = c; + ConfigName++; + ByteCount--; + } + + if ( i < (CONFIG_COUNT - 1) ) { + c5e: 85 30 cpi r24, 0x05 ; 5 + c60: 91 05 cpc r25, r1 + c62: 21 f4 brne .+8 ; 0xc6c + *ConfigListOut++ = ','; + ByteCount--; + } + } + + *ConfigListOut = '\0'; + c64: 18 82 st Y, r1 +} + c66: df 91 pop r29 + c68: cf 91 pop r28 + c6a: 08 95 ret + ByteCount--; + } + + if ( i < (CONFIG_COUNT - 1) ) { + /* No comma on last configuration */ + *ConfigListOut++ = ','; + c6c: 49 93 st Y+, r20 + ByteCount--; + c6e: 61 50 subi r22, 0x01 ; 1 + c70: 71 09 sbc r23, r1 + c72: 01 96 adiw r24, 0x01 ; 1 + c74: da cf rjmp .-76 ; 0xc2a + +00000c76 : +#include "Random.h" + +#include + +void RandomInit(void) +{ + c76: 08 95 ret + +00000c78 : + +} + +uint8_t RandomGetByte(void) +{ + return rand() & 0xFF; + c78: 0c 94 be 2d jmp 0x5b7c ; 0x5b7c +} + c7c: 08 95 ret + +00000c7e : + +void RandomGetBuffer(void* Buffer, uint8_t ByteCount) +{ + c7e: 1f 93 push r17 + c80: cf 93 push r28 + c82: df 93 push r29 + c84: 16 2f mov r17, r22 + uint8_t* BufferPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + c86: 66 23 and r22, r22 + c88: 29 f0 breq .+10 ; 0xc94 + c8a: ec 01 movw r28, r24 + *BufferPtr++ = RandomGetByte(); + c8c: f5 df rcall .-22 ; 0xc78 + c8e: 89 93 st Y+, r24 + c90: 11 50 subi r17, 0x01 ; 1 + +void RandomGetBuffer(void* Buffer, uint8_t ByteCount) +{ + uint8_t* BufferPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + c92: e1 f7 brne .-8 ; 0xc8c + *BufferPtr++ = RandomGetByte(); + } +} + c94: df 91 pop r29 + c96: cf 91 pop r28 + c98: 1f 91 pop r17 + c9a: 08 95 ret + +00000c9c : + +void RandomTick(void) +{ + rand(); + c9c: 0e 94 be 2d call 0x5b7c ; 0x5b7c + rand(); + ca0: 0e 94 be 2d call 0x5b7c ; 0x5b7c + rand(); + ca4: 0e 94 be 2d call 0x5b7c ; 0x5b7c + rand(); + ca8: 0c 94 be 2d jmp 0x5b7c ; 0x5b7c + +00000cac : +#include "Common.h" + +uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) +{ + cac: cf 93 push r28 + cae: df 93 push r29 + cb0: dc 01 movw r26, r24 + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t CharCount = 0; + + /* Account for '\0' at the end */ + MaxChars--; + cb2: 61 50 subi r22, 0x01 ; 1 + cb4: 71 09 sbc r23, r1 + + while( (ByteCount > 0) && (MaxChars >= 2) ) { + cb6: 21 15 cp r18, r1 + cb8: 31 05 cpc r19, r1 + cba: 99 f1 breq .+102 ; 0xd22 + cbc: 62 30 cpi r22, 0x02 ; 2 + cbe: 71 05 cpc r23, r1 + cc0: 80 f1 brcs .+96 ; 0xd22 + cc2: fa 01 movw r30, r20 +#include "Common.h" + +uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) + cc4: 24 0f add r18, r20 + cc6: 35 1f adc r19, r21 + cc8: 21 50 subi r18, 0x01 ; 1 + cca: 31 09 sbc r19, r1 +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t CharCount = 0; + ccc: 40 e0 ldi r20, 0x00 ; 0 + cce: 50 e0 ldi r21, 0x00 ; 0 + cd0: 17 c0 rjmp .+46 ; 0xd00 + MaxChars--; + + while( (ByteCount > 0) && (MaxChars >= 2) ) { + uint8_t Byte = *ByteBuffer; + + HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); + cd2: d0 5d subi r29, 0xD0 ; 208 + cd4: dc 93 st X, r29 + HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); + cd6: cf 70 andi r28, 0x0F ; 15 + cd8: 8c 2f mov r24, r28 + cda: 90 e0 ldi r25, 0x00 ; 0 + cdc: 0a 97 sbiw r24, 0x0a ; 10 + cde: fc f4 brge .+62 ; 0xd1e + ce0: c0 5d subi r28, 0xD0 ; 208 + ce2: 11 96 adiw r26, 0x01 ; 1 + ce4: cc 93 st X, r28 + ce6: 11 97 sbiw r26, 0x01 ; 1 + + HexOut += 2; + ce8: 12 96 adiw r26, 0x02 ; 2 + MaxChars -= 2; + cea: 62 50 subi r22, 0x02 ; 2 + cec: 71 09 sbc r23, r1 + CharCount += 2; + cee: 4e 5f subi r20, 0xFE ; 254 + cf0: 5f 4f sbci r21, 0xFF ; 255 + uint16_t CharCount = 0; + + /* Account for '\0' at the end */ + MaxChars--; + + while( (ByteCount > 0) && (MaxChars >= 2) ) { + cf2: e2 17 cp r30, r18 + cf4: f3 07 cpc r31, r19 + cf6: b9 f0 breq .+46 ; 0xd26 + cf8: 31 96 adiw r30, 0x01 ; 1 + cfa: 62 30 cpi r22, 0x02 ; 2 + cfc: 71 05 cpc r23, r1 + cfe: 98 f0 brcs .+38 ; 0xd26 + uint8_t Byte = *ByteBuffer; + d00: c0 81 ld r28, Z + + HexOut[0] = NIBBLE_TO_HEXCHAR( (Byte >> 4) & 0x0F ); + d02: dc 2f mov r29, r28 + d04: d2 95 swap r29 + d06: df 70 andi r29, 0x0F ; 15 + d08: 8d 2f mov r24, r29 + d0a: 90 e0 ldi r25, 0x00 ; 0 + d0c: 0a 97 sbiw r24, 0x0a ; 10 + d0e: 0c f3 brlt .-62 ; 0xcd2 + d10: d9 5c subi r29, 0xC9 ; 201 + d12: dc 93 st X, r29 + HexOut[1] = NIBBLE_TO_HEXCHAR( (Byte >> 0) & 0x0F ); + d14: cf 70 andi r28, 0x0F ; 15 + d16: 8c 2f mov r24, r28 + d18: 90 e0 ldi r25, 0x00 ; 0 + d1a: 0a 97 sbiw r24, 0x0a ; 10 + d1c: 0c f3 brlt .-62 ; 0xce0 + d1e: c9 5c subi r28, 0xC9 ; 201 + d20: e0 cf rjmp .-64 ; 0xce2 +#include "Common.h" + +uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t CharCount = 0; + d22: 40 e0 ldi r20, 0x00 ; 0 + d24: 50 e0 ldi r21, 0x00 ; 0 + CharCount += 2; + ByteBuffer++; + ByteCount -= 1; + } + + *HexOut = '\0'; + d26: 1c 92 st X, r1 + + return CharCount; +} + d28: ca 01 movw r24, r20 + d2a: df 91 pop r29 + d2c: cf 91 pop r28 + d2e: 08 95 ret + +00000d30 : + +uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) +{ + d30: fa 01 movw r30, r20 + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t ByteCount = 0; + + while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { + d32: 40 81 ld r20, Z + d34: 44 23 and r20, r20 + d36: f1 f1 breq .+124 ; 0xdb4 + d38: 51 81 ldd r21, Z+1 ; 0x01 + d3a: 55 23 and r21, r21 + d3c: d9 f1 breq .+118 ; 0xdb4 + d3e: 61 15 cp r22, r1 + d40: 71 05 cpc r23, r1 + d42: c1 f1 breq .+112 ; 0xdb4 + d44: dc 01 movw r26, r24 + d46: 20 e0 ldi r18, 0x00 ; 0 + d48: 30 e0 ldi r19, 0x00 ; 0 + d4a: 13 c0 rjmp .+38 ; 0xd72 + if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { + uint8_t Byte = 0; + + Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; + d4c: 42 95 swap r20 + d4e: 40 7f andi r20, 0xF0 ; 240 + Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; + d50: 51 34 cpi r21, 0x41 ; 65 + d52: 28 f5 brcc .+74 ; 0xd9e + d54: 58 2f mov r21, r24 + d56: 45 2b or r20, r21 + + *ByteBuffer = Byte; + d58: 4d 93 st X+, r20 + + ByteBuffer++; + MaxBytes--; + ByteCount++; + d5a: 2f 5f subi r18, 0xFF ; 255 + d5c: 3f 4f sbci r19, 0xFF ; 255 + HexIn += 2; + d5e: 32 96 adiw r30, 0x02 ; 2 +uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t ByteCount = 0; + + while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { + d60: 40 81 ld r20, Z + d62: 44 23 and r20, r20 + d64: 29 f1 breq .+74 ; 0xdb0 + d66: 51 81 ldd r21, Z+1 ; 0x01 + d68: 55 23 and r21, r21 + d6a: 21 f1 breq .+72 ; 0xdb4 + d6c: 62 17 cp r22, r18 + d6e: 73 07 cpc r23, r19 + d70: f9 f0 breq .+62 ; 0xdb0 + if (VALID_HEXCHAR(HexIn[0]) && VALID_HEXCHAR(HexIn[1])) { + d72: 84 2f mov r24, r20 + d74: 80 53 subi r24, 0x30 ; 48 + d76: 8a 30 cpi r24, 0x0A ; 10 + d78: 18 f0 brcs .+6 ; 0xd80 + d7a: 81 51 subi r24, 0x11 ; 17 + d7c: 86 30 cpi r24, 0x06 ; 6 + d7e: d0 f4 brcc .+52 ; 0xdb4 + d80: 85 2f mov r24, r21 + d82: 80 53 subi r24, 0x30 ; 48 + d84: 8a 30 cpi r24, 0x0A ; 10 + d86: 20 f0 brcs .+8 ; 0xd90 + d88: 95 2f mov r25, r21 + d8a: 91 54 subi r25, 0x41 ; 65 + d8c: 96 30 cpi r25, 0x06 ; 6 + d8e: 90 f4 brcc .+36 ; 0xdb4 + uint8_t Byte = 0; + + Byte |= HEXCHAR_TO_NIBBLE(HexIn[0]) << 4; + d90: 41 34 cpi r20, 0x41 ; 65 + d92: e0 f2 brcs .-72 ; 0xd4c + d94: 42 95 swap r20 + d96: 40 7f andi r20, 0xF0 ; 240 + d98: 40 57 subi r20, 0x70 ; 112 + Byte |= HEXCHAR_TO_NIBBLE(HexIn[1]) << 0; + d9a: 51 34 cpi r21, 0x41 ; 65 + d9c: d8 f2 brcs .-74 ; 0xd54 + d9e: 57 53 subi r21, 0x37 ; 55 + da0: 45 2b or r20, r21 + + *ByteBuffer = Byte; + da2: 4d 93 st X+, r20 + + ByteBuffer++; + MaxBytes--; + ByteCount++; + da4: 2f 5f subi r18, 0xFF ; 255 + da6: 3f 4f sbci r19, 0xFF ; 255 + HexIn += 2; + da8: 32 96 adiw r30, 0x02 ; 2 +uint16_t HexStringToBuffer(void* Buffer, uint16_t MaxBytes, const char* HexIn) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + uint16_t ByteCount = 0; + + while( (HexIn[0] != '\0') && (HexIn[1] != '\0') && (MaxBytes > 0) ) { + daa: 40 81 ld r20, Z + dac: 41 11 cpse r20, r1 + dae: db cf rjmp .-74 ; 0xd66 + /* Odd number of characters */ + return 0; + } + + return ByteCount; +} + db0: c9 01 movw r24, r18 + db2: 08 95 ret + } + } + + if ( (HexIn[0] != '\0') && (HexIn[1] == '\0') ) { + /* Odd number of characters */ + return 0; + db4: 20 e0 ldi r18, 0x00 ; 0 + db6: 30 e0 ldi r19, 0x00 ; 0 + } + + return ByteCount; +} + db8: c9 01 movw r24, r18 + dba: 08 95 ret + +00000dbc : + MemoryRecall(); +} + +void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) +{ + uint8_t* SrcPtr = &Memory[Address]; + dbc: fb 01 movw r30, r22 + dbe: ee 56 subi r30, 0x6E ; 110 + dc0: ff 4d sbci r31, 0xDF ; 223 + uint8_t* DstPtr = (uint8_t*) Buffer; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + dc2: a0 e0 ldi r26, 0x00 ; 0 + dc4: b4 e0 ldi r27, 0x04 ; 4 + dc6: a6 1b sub r26, r22 + dc8: b7 0b sbc r27, r23 + dca: 9a 01 movw r18, r20 + dcc: a4 17 cp r26, r20 + dce: b5 07 cpc r27, r21 + dd0: 08 f4 brcc .+2 ; 0xdd4 + dd2: 9d 01 movw r18, r26 + + while(ByteCount--) { + dd4: 21 15 cp r18, r1 + dd6: 31 05 cpc r19, r1 + dd8: 41 f0 breq .+16 ; 0xdea + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); +} + +void MemoryReadBlock(void* Buffer, uint16_t Address, uint16_t ByteCount) + dda: 2e 0f add r18, r30 + ddc: 3f 1f adc r19, r31 +{ + uint8_t* SrcPtr = &Memory[Address]; + uint8_t* DstPtr = (uint8_t*) Buffer; + dde: dc 01 movw r26, r24 + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + de0: 81 91 ld r24, Z+ + de2: 8d 93 st X+, r24 + uint8_t* DstPtr = (uint8_t*) Buffer; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + de4: e2 17 cp r30, r18 + de6: f3 07 cpc r31, r19 + de8: d9 f7 brne .-10 ; 0xde0 + dea: 08 95 ret + +00000dec : +} + +void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) +{ + uint8_t* SrcPtr = (uint8_t*) Buffer; + uint8_t* DstPtr = &Memory[Address]; + dec: db 01 movw r26, r22 + dee: ae 56 subi r26, 0x6E ; 110 + df0: bf 4d sbci r27, 0xDF ; 223 + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + df2: e0 e0 ldi r30, 0x00 ; 0 + df4: f4 e0 ldi r31, 0x04 ; 4 + df6: e6 1b sub r30, r22 + df8: f7 0b sbc r31, r23 + dfa: 9a 01 movw r18, r20 + dfc: e4 17 cp r30, r20 + dfe: f5 07 cpc r31, r21 + e00: 08 f4 brcc .+2 ; 0xe04 + e02: 9f 01 movw r18, r30 + + while(ByteCount--) { + e04: 21 15 cp r18, r1 + e06: 31 05 cpc r19, r1 + e08: 49 f0 breq .+18 ; 0xe1c + e0a: fc 01 movw r30, r24 + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + } +} + +void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) + e0c: c9 01 movw r24, r18 + e0e: 8e 0f add r24, r30 + e10: 9f 1f adc r25, r31 + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + e12: 21 91 ld r18, Z+ + e14: 2d 93 st X+, r18 + uint8_t* DstPtr = &Memory[Address]; + + /* Prevent Buf Ovfs */ + ByteCount = MIN(ByteCount, MEMORY_SIZE_PER_SETTING - Address); + + while(ByteCount--) { + e16: e8 17 cp r30, r24 + e18: f9 07 cpc r31, r25 + e1a: d9 f7 brne .-10 ; 0xe12 + *DstPtr++ = *SrcPtr++; + } + + LEDTrigger(LED_MEMORY_CHANGED, LED_ON); + e1c: 61 e1 ldi r22, 0x11 ; 17 + e1e: 85 e0 ldi r24, 0x05 ; 5 + e20: 0c 94 af 0f jmp 0x1f5e ; 0x1f5e + +00000e24 : +} + +void MemoryClear(void) +{ + e24: e2 e9 ldi r30, 0x92 ; 146 + e26: f0 e2 ldi r31, 0x20 ; 32 + for (uint16_t i=0; i + Memory[i] = 0; + } +} + e32: 08 95 ret + +00000e34 : + +void MemoryRecall(void) +{ + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + e34: 80 91 09 29 lds r24, 0x2909 + e38: 90 e0 ldi r25, 0x00 ; 0 + e3a: a0 e0 ldi r26, 0x00 ; 0 + e3c: b0 e0 ldi r27, 0x00 ; 0 + e3e: 4a e0 ldi r20, 0x0A ; 10 + e40: 88 0f add r24, r24 + e42: 99 1f adc r25, r25 + e44: aa 1f adc r26, r26 + e46: bb 1f adc r27, r27 + e48: 4a 95 dec r20 + e4a: d1 f7 brne .-12 ; 0xe40 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + e4c: 40 e1 ldi r20, 0x10 ; 16 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + e4e: 57 ed ldi r21, 0xD7 ; 215 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + e50: 30 e4 ldi r19, 0x40 ; 64 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + e52: 40 93 66 06 sts 0x0666, r20 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + e56: 50 93 a0 09 sts 0x09A0, r21 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + e5a: 20 91 a1 09 lds r18, 0x09A1 + e5e: 26 ff sbrs r18, 6 + e60: fc cf rjmp .-8 ; 0xe5a + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + e62: 30 93 a1 09 sts 0x09A1, r19 + + return MEMORY_FLASH_USART.DATA; + e66: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + e6a: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + e6e: 20 91 a1 09 lds r18, 0x09A1 + e72: 26 ff sbrs r18, 6 + e74: fc cf rjmp .-8 ; 0xe6e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + e76: 30 93 a1 09 sts 0x09A1, r19 + + return MEMORY_FLASH_USART.DATA; + e7a: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + e7e: 40 93 65 06 sts 0x0665, r20 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashRead(void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(FlashIsBusy()); + e82: 27 ff sbrs r18, 7 + e84: e6 cf rjmp .-52 ; 0xe52 + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + e86: 20 e1 ldi r18, 0x10 ; 16 + e88: 20 93 66 06 sts 0x0666, r18 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + e8c: 23 e0 ldi r18, 0x03 ; 3 + e8e: 20 93 a0 09 sts 0x09A0, r18 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + e92: 20 91 a1 09 lds r18, 0x09A1 + e96: 26 ff sbrs r18, 6 + e98: fc cf rjmp .-8 ; 0xe92 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + e9a: 20 e4 ldi r18, 0x40 ; 64 + e9c: 20 93 a1 09 sts 0x09A1, r18 + + return MEMORY_FLASH_USART.DATA; + ea0: 20 91 a0 09 lds r18, 0x09A0 +{ + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(0x03); + SPITransferByte( (Address >> 16) & 0xFF ); + ea4: ad 01 movw r20, r26 + ea6: 66 27 eor r22, r22 + ea8: 77 27 eor r23, r23 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + eaa: 40 93 a0 09 sts 0x09A0, r20 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + eae: 20 91 a1 09 lds r18, 0x09A1 + eb2: 26 ff sbrs r18, 6 + eb4: fc cf rjmp .-8 ; 0xeae + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + eb6: 20 e4 ldi r18, 0x40 ; 64 + eb8: 20 93 a1 09 sts 0x09A1, r18 + + return MEMORY_FLASH_USART.DATA; + ebc: 20 91 a0 09 lds r18, 0x09A0 + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(0x03); + SPITransferByte( (Address >> 16) & 0xFF ); + SPITransferByte( (Address >> 8) & 0xFF ); + ec0: 89 2f mov r24, r25 + ec2: 9a 2f mov r25, r26 + ec4: ab 2f mov r26, r27 + ec6: bb 27 eor r27, r27 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + ec8: 80 93 a0 09 sts 0x09A0, r24 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + ecc: 80 91 a1 09 lds r24, 0x09A1 + ed0: 86 ff sbrs r24, 6 + ed2: fc cf rjmp .-8 ; 0xecc + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + ed4: 80 e4 ldi r24, 0x40 ; 64 + ed6: 80 93 a1 09 sts 0x09A1, r24 + + return MEMORY_FLASH_USART.DATA; + eda: 80 91 a0 09 lds r24, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + ede: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + ee2: 80 91 a1 09 lds r24, 0x09A1 + ee6: 86 ff sbrs r24, 6 + ee8: fc cf rjmp .-8 ; 0xee2 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + eea: 80 e4 ldi r24, 0x40 ; 64 + eec: 80 93 a1 09 sts 0x09A1, r24 + + return MEMORY_FLASH_USART.DATA; + ef0: 80 91 a0 09 lds r24, 0x09A0 +} + +INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + ef4: e2 e9 ldi r30, 0x92 ; 146 + ef6: f0 e2 ldi r31, 0x20 ; 32 + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = 0; + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + ef8: 90 e4 ldi r25, 0x40 ; 64 +INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = 0; + efa: 10 92 a0 09 sts 0x09A0, r1 + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + efe: 80 91 a1 09 lds r24, 0x09A1 + f02: 86 ff sbrs r24, 6 + f04: fc cf rjmp .-8 ; 0xefe + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + f06: 90 93 a1 09 sts 0x09A1, r25 + *ByteBuffer++ = MEMORY_FLASH_USART.DATA; + f0a: 80 91 a0 09 lds r24, 0x09A0 + f0e: 81 93 st Z+, r24 + +INLINE void SPIReadBlock(void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + f10: 84 e2 ldi r24, 0x24 ; 36 + f12: e2 39 cpi r30, 0x92 ; 146 + f14: f8 07 cpc r31, r24 + f16: 89 f7 brne .-30 ; 0xefa + SPITransferByte(0x03); + SPITransferByte( (Address >> 16) & 0xFF ); + SPITransferByte( (Address >> 8) & 0xFF ); + SPITransferByte( (Address >> 0) & 0xFF ); + SPIReadBlock(Buffer, ByteCount); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + f18: 80 e1 ldi r24, 0x10 ; 16 + f1a: 80 93 65 06 sts 0x0665, r24 + f1e: 08 95 ret + +00000f20 : + SPITransferByte( 0 ); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +void MemoryInit(void) +{ + f20: cf 93 push r28 + f22: df 93 push r29 + f24: 00 d0 rcall .+0 ; 0xf26 + f26: 00 d0 rcall .+0 ; 0xf28 + f28: cd b7 in r28, 0x3d ; 61 + f2a: de b7 in r29, 0x3e ; 62 + /* Configure MEMORY_FLASH_USART for SPI master mode 0 with maximum clock frequency */ + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + f2c: 80 e1 ldi r24, 0x10 ; 16 + f2e: 80 93 65 06 sts 0x0665, r24 + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_SCK; + f32: 92 e0 ldi r25, 0x02 ; 2 + f34: 90 93 66 06 sts 0x0666, r25 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_MOSI; + f38: 98 e0 ldi r25, 0x08 ; 8 + f3a: 90 93 65 06 sts 0x0665, r25 + + MEMORY_FLASH_PORT.DIRSET = MEMORY_FLASH_SCK | MEMORY_FLASH_MOSI | MEMORY_FLASH_CS; + f3e: 9a e1 ldi r25, 0x1A ; 26 + f40: 90 93 61 06 sts 0x0661, r25 + + MEMORY_FLASH_USART.BAUDCTRLA = 15;//0; + f44: 9f e0 ldi r25, 0x0F ; 15 + f46: 90 93 a6 09 sts 0x09A6, r25 + MEMORY_FLASH_USART.BAUDCTRLB = 0; + f4a: 10 92 a7 09 sts 0x09A7, r1 + MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; // | USART_CHSIZE_8BIT_gc; + f4e: 90 ec ldi r25, 0xC0 ; 192 + f50: 90 93 a5 09 sts 0x09A5, r25 + MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; + f54: 98 e1 ldi r25, 0x18 ; 24 + f56: 90 93 a4 09 sts 0x09A4, r25 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + f5a: 80 93 66 06 sts 0x0666, r24 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + f5e: 87 ed ldi r24, 0xD7 ; 215 + f60: 80 93 a0 09 sts 0x09A0, r24 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + f64: 80 91 a1 09 lds r24, 0x09A1 + f68: 86 ff sbrs r24, 6 + f6a: fc cf rjmp .-8 ; 0xf64 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + f6c: 80 e4 ldi r24, 0x40 ; 64 + f6e: 80 93 a1 09 sts 0x09A1, r24 + + return MEMORY_FLASH_USART.DATA; + f72: 80 91 a0 09 lds r24, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + f76: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + f7a: 80 91 a1 09 lds r24, 0x09A1 + f7e: 86 ff sbrs r24, 6 + f80: fc cf rjmp .-8 ; 0xf7a + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + f82: 80 e4 ldi r24, 0x40 ; 64 + f84: 80 93 a1 09 sts 0x09A1, r24 + + return MEMORY_FLASH_USART.DATA; + f88: 80 91 a0 09 lds r24, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + f8c: 90 e1 ldi r25, 0x10 ; 16 + f8e: 90 93 65 06 sts 0x0665, r25 + MEMORY_FLASH_USART.BAUDCTRLB = 0; + MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; // | USART_CHSIZE_8BIT_gc; + MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; + + + if ( !(FlashReadStatusRegister() & FLASH_STATUS_REG_PAGESIZE_BIT) ) { + f92: 80 fd sbrc r24, 0 + f94: 3e c0 rjmp .+124 ; 0x1012 + return !(FlashReadStatusRegister() & FLASH_STATUS_REG_READY_BIT); +} + +INLINE void FlashConfigurePageSize(void) +{ + uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; + f96: 8d e3 ldi r24, 0x3D ; 61 + f98: 89 83 std Y+1, r24 ; 0x01 + f9a: 8a e2 ldi r24, 0x2A ; 42 + f9c: 8a 83 std Y+2, r24 ; 0x02 + f9e: 80 e8 ldi r24, 0x80 ; 128 + fa0: 8b 83 std Y+3, r24 ; 0x03 + fa2: 86 ea ldi r24, 0xA6 ; 166 + fa4: 8c 83 std Y+4, r24 ; 0x04 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + fa6: 20 e1 ldi r18, 0x10 ; 16 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + fa8: 37 ed ldi r19, 0xD7 ; 215 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + faa: 90 e4 ldi r25, 0x40 ; 64 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + fac: 20 93 66 06 sts 0x0666, r18 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + fb0: 30 93 a0 09 sts 0x09A0, r19 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + fb4: 80 91 a1 09 lds r24, 0x09A1 + fb8: 86 ff sbrs r24, 6 + fba: fc cf rjmp .-8 ; 0xfb4 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + fbc: 90 93 a1 09 sts 0x09A1, r25 + + return MEMORY_FLASH_USART.DATA; + fc0: 80 91 a0 09 lds r24, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + fc4: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + fc8: 80 91 a1 09 lds r24, 0x09A1 + fcc: 86 ff sbrs r24, 6 + fce: fc cf rjmp .-8 ; 0xfc8 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + fd0: 90 93 a1 09 sts 0x09A1, r25 + + return MEMORY_FLASH_USART.DATA; + fd4: 80 91 a0 09 lds r24, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + fd8: 20 93 65 06 sts 0x0665, r18 + +INLINE void FlashConfigurePageSize(void) +{ + uint8_t Sequence[] = {0x3D, 0x2A, 0x80, 0xA6}; + + while(FlashIsBusy()); + fdc: 87 ff sbrs r24, 7 + fde: e6 cf rjmp .-52 ; 0xfac + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + fe0: 80 e1 ldi r24, 0x10 ; 16 + fe2: 80 93 66 06 sts 0x0666, r24 + } +} + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + fe6: fe 01 movw r30, r28 + fe8: 31 96 adiw r30, 0x01 ; 1 + fea: ce 01 movw r24, r28 + fec: 05 96 adiw r24, 0x05 ; 5 + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + fee: 30 e4 ldi r19, 0x40 ; 64 +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + ff0: 21 91 ld r18, Z+ + ff2: 20 93 a0 09 sts 0x09A0, r18 + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + ff6: 20 91 a1 09 lds r18, 0x09A1 + ffa: 26 ff sbrs r18, 6 + ffc: fc cf rjmp .-8 ; 0xff6 + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + ffe: 30 93 a1 09 sts 0x09A1, r19 + MEMORY_FLASH_USART.DATA; /* Flush Buffer */ + 1002: 20 91 a0 09 lds r18, 0x09A0 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 1006: e8 17 cp r30, r24 + 1008: f9 07 cpc r31, r25 + 100a: 91 f7 brne .-28 ; 0xff0 + + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPIWriteBlock(Sequence, sizeof(Sequence)); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 100c: 80 e1 ldi r24, 0x10 ; 16 + 100e: 80 93 65 06 sts 0x0665, r24 + FlashConfigurePageSize(); + } + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); +} + 1012: 24 96 adiw r28, 0x04 ; 4 + 1014: cd bf out 0x3d, r28 ; 61 + 1016: de bf out 0x3e, r29 ; 62 + 1018: df 91 pop r29 + 101a: cf 91 pop r28 + /* Configure for 256 byte Dataflash if not already done. */ + FlashConfigurePageSize(); + } + + /* Load permanent flash contents to memory at startup */ + MemoryRecall(); + 101c: 0b cf rjmp .-490 ; 0xe34 + +0000101e : + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); +} + +void MemoryStore(void) +{ + 101e: 4f 92 push r4 + 1020: 5f 92 push r5 + 1022: 6f 92 push r6 + 1024: 7f 92 push r7 + 1026: 8f 92 push r8 + 1028: 9f 92 push r9 + 102a: af 92 push r10 + 102c: bf 92 push r11 + 102e: cf 92 push r12 + 1030: df 92 push r13 + 1032: ef 92 push r14 + 1034: ff 92 push r15 + 1036: 0f 93 push r16 + 1038: 1f 93 push r17 + 103a: cf 93 push r28 + 103c: df 93 push r29 + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + 103e: 80 91 09 29 lds r24, 0x2909 + 1042: 90 e0 ldi r25, 0x00 ; 0 + 1044: a0 e0 ldi r26, 0x00 ; 0 + 1046: b0 e0 ldi r27, 0x00 ; 0 + 1048: 6a e0 ldi r22, 0x0A ; 10 + 104a: 88 0f add r24, r24 + 104c: 99 1f adc r25, r25 + 104e: aa 1f adc r26, r26 + 1050: bb 1f adc r27, r27 + 1052: 6a 95 dec r22 + 1054: d1 f7 brne .-12 ; 0x104a + 1056: e2 e9 ldi r30, 0x92 ; 146 + 1058: f0 e2 ldi r31, 0x20 ; 32 + 105a: 00 e0 ldi r16, 0x00 ; 0 + 105c: 14 e0 ldi r17, 0x04 ; 4 +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + 105e: e1 2c mov r14, r1 + 1060: ff 24 eor r15, r15 + 1062: f3 94 inc r15 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1064: c0 e1 ldi r28, 0x10 ; 16 + 1066: cc 2e mov r12, r28 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1068: d7 ed ldi r29, 0xD7 ; 215 + 106a: bd 2e mov r11, r29 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 106c: 20 e4 ldi r18, 0x40 ; 64 + 106e: d2 2e mov r13, r18 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1070: 30 e1 ldi r19, 0x10 ; 16 + 1072: a3 2e mov r10, r19 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1074: 47 ed ldi r20, 0xD7 ; 215 + 1076: 94 2e mov r9, r20 + 1078: 53 e5 ldi r21, 0x53 ; 83 + 107a: 45 2e mov r4, r21 + 107c: 64 e8 ldi r22, 0x84 ; 132 + 107e: 56 2e mov r5, r22 + 1080: 73 e8 ldi r23, 0x83 ; 131 + 1082: 67 2e mov r6, r23 +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + 1084: 49 2f mov r20, r25 + 1086: 5a 2f mov r21, r26 + 1088: 6b 2f mov r22, r27 + 108a: 77 27 eor r23, r23 + 108c: 85 2e mov r8, r21 + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + 108e: 38 2f mov r19, r24 + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + 1090: e7 01 movw r28, r14 + 1092: c8 1b sub r28, r24 + 1094: d1 09 sbc r29, r1 + 1096: 0c 17 cp r16, r28 + 1098: 1d 07 cpc r17, r29 + 109a: 08 f4 brcc .+2 ; 0x109e + 109c: e8 01 movw r28, r16 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 109e: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 10a2: 90 92 a0 09 sts 0x09A0, r9 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 10a6: 20 91 a1 09 lds r18, 0x09A1 + 10aa: 26 ff sbrs r18, 6 + 10ac: fc cf rjmp .-8 ; 0x10a6 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 10ae: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 10b2: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 10b6: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 10ba: 20 91 a1 09 lds r18, 0x09A1 + 10be: 26 ff sbrs r18, 6 + 10c0: fc cf rjmp .-8 ; 0x10ba + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 10c2: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 10c6: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 10ca: c0 92 65 06 sts 0x0665, r12 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashMemoryToBuffer(uint16_t PageAddress) +{ + while(FlashIsBusy()); + 10ce: 27 ff sbrs r18, 7 + 10d0: e6 cf rjmp .-52 ; 0x109e + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 10d2: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 10d6: 40 92 a0 09 sts 0x09A0, r4 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 10da: 20 91 a1 09 lds r18, 0x09A1 + 10de: 26 ff sbrs r18, 6 + 10e0: fc cf rjmp .-8 ; 0x10da + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 10e2: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 10e6: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 10ea: 80 92 a0 09 sts 0x09A0, r8 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 10ee: 20 91 a1 09 lds r18, 0x09A1 + 10f2: 26 ff sbrs r18, 6 + 10f4: fc cf rjmp .-8 ; 0x10ee + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 10f6: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 10fa: 20 91 a0 09 lds r18, 0x09A0 + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_MEM_TO_BUF1); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + 10fe: 74 2e mov r7, r20 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1100: 40 93 a0 09 sts 0x09A0, r20 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1104: 20 91 a1 09 lds r18, 0x09A1 + 1108: 26 ff sbrs r18, 6 + 110a: fc cf rjmp .-8 ; 0x1104 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 110c: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1110: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1114: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1118: 20 91 a1 09 lds r18, 0x09A1 + 111c: 26 ff sbrs r18, 6 + 111e: fc cf rjmp .-8 ; 0x1118 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1120: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1124: 20 91 a0 09 lds r18, 0x09A0 + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_MEM_TO_BUF1); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + SPITransferByte( 0 ); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1128: c0 92 65 06 sts 0x0665, r12 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 112c: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1130: b0 92 a0 09 sts 0x09A0, r11 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1134: 20 91 a1 09 lds r18, 0x09A1 + 1138: 26 ff sbrs r18, 6 + 113a: fc cf rjmp .-8 ; 0x1134 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 113c: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1140: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1144: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1148: 20 91 a1 09 lds r18, 0x09A1 + 114c: 26 ff sbrs r18, 6 + 114e: fc cf rjmp .-8 ; 0x1148 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1150: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1154: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1158: c0 92 65 06 sts 0x0665, r12 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashWriteBuffer(const void* Buffer, uint8_t Address, uint16_t ByteCount) +{ + while(FlashIsBusy()); + 115c: 27 ff sbrs r18, 7 + 115e: e6 cf rjmp .-52 ; 0x112c + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1160: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1164: 50 92 a0 09 sts 0x09A0, r5 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1168: 20 91 a1 09 lds r18, 0x09A1 + 116c: 26 ff sbrs r18, 6 + 116e: fc cf rjmp .-8 ; 0x1168 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1170: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1174: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1178: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 117c: 20 91 a1 09 lds r18, 0x09A1 + 1180: 26 ff sbrs r18, 6 + 1182: fc cf rjmp .-8 ; 0x117c + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1184: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1188: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 118c: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1190: 20 91 a1 09 lds r18, 0x09A1 + 1194: 26 ff sbrs r18, 6 + 1196: fc cf rjmp .-8 ; 0x1190 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1198: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 119c: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 11a0: 30 93 a0 09 sts 0x09A0, r19 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11a4: 20 91 a1 09 lds r18, 0x09A1 + 11a8: 26 ff sbrs r18, 6 + 11aa: fc cf rjmp .-8 ; 0x11a4 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 11ac: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 11b0: 20 91 a0 09 lds r18, 0x09A0 +{ + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); +} + +void MemoryStore(void) + 11b4: 9f 01 movw r18, r30 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 11b6: 20 97 sbiw r28, 0x00 ; 0 + 11b8: 81 f0 breq .+32 ; 0x11da +{ + /* Recall memory from permanent flash */ + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); +} + +void MemoryStore(void) + 11ba: 2c 0f add r18, r28 + 11bc: 3d 1f adc r19, r29 +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + 11be: 41 91 ld r20, Z+ + 11c0: 40 93 a0 09 sts 0x09A0, r20 + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11c4: 40 91 a1 09 lds r20, 0x09A1 + 11c8: 46 ff sbrs r20, 6 + 11ca: fc cf rjmp .-8 ; 0x11c4 + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 11cc: d0 92 a1 09 sts 0x09A1, r13 + MEMORY_FLASH_USART.DATA; /* Flush Buffer */ + 11d0: 40 91 a0 09 lds r20, 0x09A0 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 11d4: e2 17 cp r30, r18 + 11d6: f3 07 cpc r31, r19 + 11d8: 91 f7 brne .-28 ; 0x11be + SPITransferByte(FLASH_CMD_BUF1_WRITE); + SPITransferByte( 0 ); + SPITransferByte( 0 ); + SPITransferByte( Address ); + SPIWriteBlock(Buffer, ByteCount); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 11da: c0 92 65 06 sts 0x0665, r12 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 11de: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 11e2: b0 92 a0 09 sts 0x09A0, r11 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11e6: 40 91 a1 09 lds r20, 0x09A1 + 11ea: 46 ff sbrs r20, 6 + 11ec: fc cf rjmp .-8 ; 0x11e6 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 11ee: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 11f2: 40 91 a0 09 lds r20, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 11f6: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 11fa: 40 91 a1 09 lds r20, 0x09A1 + 11fe: 46 ff sbrs r20, 6 + 1200: fc cf rjmp .-8 ; 0x11fa + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1202: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1206: 40 91 a0 09 lds r20, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 120a: c0 92 65 06 sts 0x0665, r12 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashBufferToMemory(uint16_t PageAddress) +{ + while(FlashIsBusy()); + 120e: 47 ff sbrs r20, 7 + 1210: e6 cf rjmp .-52 ; 0x11de + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1212: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1216: 60 92 a0 09 sts 0x09A0, r6 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 121a: 40 91 a1 09 lds r20, 0x09A1 + 121e: 46 ff sbrs r20, 6 + 1220: fc cf rjmp .-8 ; 0x121a + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1222: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1226: 40 91 a0 09 lds r20, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 122a: 80 92 a0 09 sts 0x09A0, r8 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 122e: 40 91 a1 09 lds r20, 0x09A1 + 1232: 46 ff sbrs r20, 6 + 1234: fc cf rjmp .-8 ; 0x122e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1236: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 123a: 40 91 a0 09 lds r20, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 123e: 70 92 a0 09 sts 0x09A0, r7 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1242: 40 91 a1 09 lds r20, 0x09A1 + 1246: 46 ff sbrs r20, 6 + 1248: fc cf rjmp .-8 ; 0x1242 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 124a: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 124e: 40 91 a0 09 lds r20, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1252: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1256: 40 91 a1 09 lds r20, 0x09A1 + 125a: 46 ff sbrs r20, 6 + 125c: fc cf rjmp .-8 ; 0x1256 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 125e: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1262: 40 91 a0 09 lds r20, 0x09A0 + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_BUF1_TO_MEM_ERASE); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + SPITransferByte( 0 ); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1266: c0 92 65 06 sts 0x0665, r12 + + FlashMemoryToBuffer(PageAddress); + FlashWriteBuffer(Buffer, ByteAddress, PageBytes); + FlashBufferToMemory(PageAddress); + + ByteCount -= PageBytes; + 126a: 0c 1b sub r16, r28 + 126c: 1d 0b sbc r17, r29 + Address += PageBytes; + 126e: 8c 0f add r24, r28 + 1270: 9d 1f adc r25, r29 + 1272: a1 1d adc r26, r1 + 1274: b1 1d adc r27, r1 + Buffer += PageBytes; + 1276: f9 01 movw r30, r18 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + 1278: 01 15 cp r16, r1 + 127a: 11 05 cpc r17, r1 + 127c: 09 f0 breq .+2 ; 0x1280 + 127e: 02 cf rjmp .-508 ; 0x1084 +void MemoryStore(void) +{ + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + + LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); + 1280: 60 e1 ldi r22, 0x10 ; 16 + 1282: 85 e0 ldi r24, 0x05 ; 5 + 1284: 6c d6 rcall .+3288 ; 0x1f5e + LEDTrigger(LED_MEMORY_STORED, LED_PULSE); + 1286: 63 e1 ldi r22, 0x13 ; 19 + 1288: 84 e0 ldi r24, 0x04 ; 4 +} + 128a: df 91 pop r29 + 128c: cf 91 pop r28 + 128e: 1f 91 pop r17 + 1290: 0f 91 pop r16 + 1292: ff 90 pop r15 + 1294: ef 90 pop r14 + 1296: df 90 pop r13 + 1298: cf 90 pop r12 + 129a: bf 90 pop r11 + 129c: af 90 pop r10 + 129e: 9f 90 pop r9 + 12a0: 8f 90 pop r8 + 12a2: 7f 90 pop r7 + 12a4: 6f 90 pop r6 + 12a6: 5f 90 pop r5 + 12a8: 4f 90 pop r4 +{ + /* Store current memory into permanent flash */ + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + + LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); + LEDTrigger(LED_MEMORY_STORED, LED_PULSE); + 12aa: 59 c6 rjmp .+3250 ; 0x1f5e + +000012ac : +} + +bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) +{ + 12ac: 2f 92 push r2 + 12ae: 3f 92 push r3 + 12b0: 4f 92 push r4 + 12b2: 5f 92 push r5 + 12b4: 6f 92 push r6 + 12b6: 7f 92 push r7 + 12b8: 8f 92 push r8 + 12ba: 9f 92 push r9 + 12bc: af 92 push r10 + 12be: bf 92 push r11 + 12c0: cf 92 push r12 + 12c2: df 92 push r13 + 12c4: ef 92 push r14 + 12c6: ff 92 push r15 + 12c8: 0f 93 push r16 + 12ca: 1f 93 push r17 + 12cc: cf 93 push r28 + 12ce: df 93 push r29 + 12d0: cd b7 in r28, 0x3d ; 61 + 12d2: de b7 in r29, 0x3e ; 62 + 12d4: 2b 97 sbiw r28, 0x0b ; 11 + 12d6: cd bf out 0x3d, r28 ; 61 + 12d8: de bf out 0x3e, r29 ; 62 + 12da: 8d 83 std Y+5, r24 ; 0x05 + 12dc: 29 2e mov r2, r25 + 12de: 59 01 movw r10, r18 + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + 12e0: 41 15 cp r20, r1 + 12e2: 84 e0 ldi r24, 0x04 ; 4 + 12e4: 58 07 cpc r21, r24 + 12e6: 61 05 cpc r22, r1 + 12e8: 71 05 cpc r23, r1 + 12ea: 08 f0 brcs .+2 ; 0x12ee + 12ec: 85 c1 rjmp .+778 ; 0x15f8 + /* Prevent writing out of bounds by silently ignoring it */ + return true; + } else { + /* Calculate bytes left in memory and start writing */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING; + 12ee: 80 91 09 29 lds r24, 0x2909 + 12f2: 90 e0 ldi r25, 0x00 ; 0 + 12f4: a0 e0 ldi r26, 0x00 ; 0 + 12f6: b0 e0 ldi r27, 0x00 ; 0 + 12f8: fa e0 ldi r31, 0x0A ; 10 + 12fa: 88 0f add r24, r24 + 12fc: 99 1f adc r25, r25 + 12fe: aa 1f adc r26, r26 + 1300: bb 1f adc r27, r27 + 1302: fa 95 dec r31 + 1304: d1 f7 brne .-12 ; 0x12fa + 1306: 84 0f add r24, r20 + 1308: 95 1f adc r25, r21 + 130a: a6 1f adc r26, r22 + 130c: b7 1f adc r27, r23 + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + /* Prevent writing out of bounds by silently ignoring it */ + return true; + } else { + /* Calculate bytes left in memory and start writing */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + 130e: 00 e0 ldi r16, 0x00 ; 0 + 1310: 14 e0 ldi r17, 0x04 ; 4 + 1312: 20 e0 ldi r18, 0x00 ; 0 + 1314: 30 e0 ldi r19, 0x00 ; 0 + 1316: 04 1b sub r16, r20 + 1318: 15 0b sbc r17, r21 + 131a: 26 0b sbc r18, r22 + 131c: 37 0b sbc r19, r23 + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 131e: 65 01 movw r12, r10 + 1320: e1 2c mov r14, r1 + 1322: f1 2c mov r15, r1 + 1324: c9 82 std Y+1, r12 ; 0x01 + 1326: da 82 std Y+2, r13 ; 0x02 + 1328: eb 82 std Y+3, r14 ; 0x03 + 132a: fc 82 std Y+4, r15 ; 0x04 + 132c: 0c 15 cp r16, r12 + 132e: 1d 05 cpc r17, r13 + 1330: 2e 05 cpc r18, r14 + 1332: 3f 05 cpc r19, r15 + 1334: 08 f4 brcc .+2 ; 0x1338 + 1336: 7a c1 rjmp .+756 ; 0x162c + 1338: 09 81 ldd r16, Y+1 ; 0x01 + 133a: 1a 81 ldd r17, Y+2 ; 0x02 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + 133c: 01 15 cp r16, r1 + 133e: 11 05 cpc r17, r1 + 1340: 09 f4 brne .+2 ; 0x1344 + 1342: 5a c1 rjmp .+692 ; 0x15f8 + 1344: 2d 81 ldd r18, Y+5 ; 0x05 + 1346: 32 2d mov r19, r2 + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + 1348: e1 2c mov r14, r1 + 134a: ff 24 eor r15, r15 + 134c: f3 94 inc r15 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 134e: e0 e1 ldi r30, 0x10 ; 16 + 1350: ce 2e mov r12, r30 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1352: f7 ed ldi r31, 0xD7 ; 215 + 1354: bf 2e mov r11, r31 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1356: e0 e4 ldi r30, 0x40 ; 64 + 1358: de 2e mov r13, r30 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 135a: f0 e1 ldi r31, 0x10 ; 16 + 135c: af 2e mov r10, r31 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 135e: e7 ed ldi r30, 0xD7 ; 215 + 1360: 9e 2e mov r9, r30 + 1362: f3 e5 ldi r31, 0x53 ; 83 + 1364: 6f 2e mov r6, r31 + 1366: e4 e8 ldi r30, 0x84 ; 132 + 1368: 8e 2e mov r8, r30 + 136a: 2a 87 std Y+10, r18 ; 0x0a + 136c: 3b 87 std Y+11, r19 ; 0x0b + 136e: 4e 83 std Y+6, r20 ; 0x06 + 1370: 5f 83 std Y+7, r21 ; 0x07 + 1372: 68 87 std Y+8, r22 ; 0x08 + 1374: 79 87 std Y+9, r23 ; 0x09 + 1376: 36 2c mov r3, r6 +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + uint16_t PageAddress = Address / FLASH_PAGE_SIZE; + 1378: 49 2e mov r4, r25 + 137a: 5a 2e mov r5, r26 + 137c: 6b 2e mov r6, r27 + 137e: 77 24 eor r7, r7 + 1380: 45 2d mov r20, r5 + uint8_t ByteAddress = Address % FLASH_PAGE_SIZE; + 1382: 38 2f mov r19, r24 + uint16_t PageBytes = MIN(FLASH_PAGE_SIZE - ByteAddress, ByteCount); + 1384: b7 01 movw r22, r14 + 1386: 68 1b sub r22, r24 + 1388: 71 09 sbc r23, r1 + 138a: 06 17 cp r16, r22 + 138c: 17 07 cpc r17, r23 + 138e: 08 f0 brcs .+2 ; 0x1392 + 1390: 4a c1 rjmp .+660 ; 0x1626 + 1392: b8 01 movw r22, r16 + 1394: ea 85 ldd r30, Y+10 ; 0x0a + 1396: fb 85 ldd r31, Y+11 ; 0x0b + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1398: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 139c: 90 92 a0 09 sts 0x09A0, r9 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 13a0: 20 91 a1 09 lds r18, 0x09A1 + 13a4: 26 ff sbrs r18, 6 + 13a6: fc cf rjmp .-8 ; 0x13a0 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 13a8: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 13ac: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 13b0: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 13b4: 20 91 a1 09 lds r18, 0x09A1 + 13b8: 26 ff sbrs r18, 6 + 13ba: fc cf rjmp .-8 ; 0x13b4 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 13bc: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 13c0: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 13c4: c0 92 65 06 sts 0x0665, r12 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashMemoryToBuffer(uint16_t PageAddress) +{ + while(FlashIsBusy()); + 13c8: 27 ff sbrs r18, 7 + 13ca: e6 cf rjmp .-52 ; 0x1398 + 13cc: ea 87 std Y+10, r30 ; 0x0a + 13ce: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 13d0: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 13d4: 30 92 a0 09 sts 0x09A0, r3 + 13d8: ea 85 ldd r30, Y+10 ; 0x0a + 13da: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 13dc: 20 91 a1 09 lds r18, 0x09A1 + 13e0: 26 ff sbrs r18, 6 + 13e2: fc cf rjmp .-8 ; 0x13dc + 13e4: ea 87 std Y+10, r30 ; 0x0a + 13e6: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 13e8: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 13ec: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 13f0: 40 93 a0 09 sts 0x09A0, r20 + 13f4: ea 85 ldd r30, Y+10 ; 0x0a + 13f6: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 13f8: 20 91 a1 09 lds r18, 0x09A1 + 13fc: 26 ff sbrs r18, 6 + 13fe: fc cf rjmp .-8 ; 0x13f8 + 1400: ea 87 std Y+10, r30 ; 0x0a + 1402: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1404: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1408: 20 91 a0 09 lds r18, 0x09A0 + while(FlashIsBusy()); + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_MEM_TO_BUF1); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + 140c: 54 2d mov r21, r4 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 140e: 40 92 a0 09 sts 0x09A0, r4 + 1412: ea 85 ldd r30, Y+10 ; 0x0a + 1414: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1416: 20 91 a1 09 lds r18, 0x09A1 + 141a: 26 ff sbrs r18, 6 + 141c: fc cf rjmp .-8 ; 0x1416 + 141e: ea 87 std Y+10, r30 ; 0x0a + 1420: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1422: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1426: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 142a: 10 92 a0 09 sts 0x09A0, r1 + 142e: ea 85 ldd r30, Y+10 ; 0x0a + 1430: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1432: 20 91 a1 09 lds r18, 0x09A1 + 1436: 26 ff sbrs r18, 6 + 1438: fc cf rjmp .-8 ; 0x1432 + 143a: ea 87 std Y+10, r30 ; 0x0a + 143c: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 143e: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1442: 20 91 a0 09 lds r18, 0x09A0 + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_MEM_TO_BUF1); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + SPITransferByte( 0 ); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1446: c0 92 65 06 sts 0x0665, r12 + 144a: ea 85 ldd r30, Y+10 ; 0x0a + 144c: fb 85 ldd r31, Y+11 ; 0x0b + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 144e: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1452: b0 92 a0 09 sts 0x09A0, r11 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1456: 20 91 a1 09 lds r18, 0x09A1 + 145a: 26 ff sbrs r18, 6 + 145c: fc cf rjmp .-8 ; 0x1456 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 145e: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1462: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1466: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 146a: 20 91 a1 09 lds r18, 0x09A1 + 146e: 26 ff sbrs r18, 6 + 1470: fc cf rjmp .-8 ; 0x146a + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1472: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1476: 20 91 a0 09 lds r18, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 147a: c0 92 65 06 sts 0x0665, r12 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashWriteBuffer(const void* Buffer, uint8_t Address, uint16_t ByteCount) +{ + while(FlashIsBusy()); + 147e: 27 ff sbrs r18, 7 + 1480: e6 cf rjmp .-52 ; 0x144e + 1482: ea 87 std Y+10, r30 ; 0x0a + 1484: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1486: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 148a: 80 92 a0 09 sts 0x09A0, r8 + 148e: ea 85 ldd r30, Y+10 ; 0x0a + 1490: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1492: 20 91 a1 09 lds r18, 0x09A1 + 1496: 26 ff sbrs r18, 6 + 1498: fc cf rjmp .-8 ; 0x1492 + 149a: ea 87 std Y+10, r30 ; 0x0a + 149c: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 149e: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 14a2: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 14a6: 10 92 a0 09 sts 0x09A0, r1 + 14aa: ea 85 ldd r30, Y+10 ; 0x0a + 14ac: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 14ae: 20 91 a1 09 lds r18, 0x09A1 + 14b2: 26 ff sbrs r18, 6 + 14b4: fc cf rjmp .-8 ; 0x14ae + 14b6: ea 87 std Y+10, r30 ; 0x0a + 14b8: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 14ba: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 14be: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 14c2: 10 92 a0 09 sts 0x09A0, r1 + 14c6: ea 85 ldd r30, Y+10 ; 0x0a + 14c8: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 14ca: 20 91 a1 09 lds r18, 0x09A1 + 14ce: 26 ff sbrs r18, 6 + 14d0: fc cf rjmp .-8 ; 0x14ca + 14d2: ea 87 std Y+10, r30 ; 0x0a + 14d4: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 14d6: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 14da: 20 91 a0 09 lds r18, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 14de: 30 93 a0 09 sts 0x09A0, r19 + 14e2: ea 85 ldd r30, Y+10 ; 0x0a + 14e4: fb 85 ldd r31, Y+11 ; 0x0b + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 14e6: 20 91 a1 09 lds r18, 0x09A1 + 14ea: 26 ff sbrs r18, 6 + 14ec: fc cf rjmp .-8 ; 0x14e6 + 14ee: ea 87 std Y+10, r30 ; 0x0a + 14f0: fb 87 std Y+11, r31 ; 0x0b + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 14f2: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 14f6: 20 91 a0 09 lds r18, 0x09A0 + + LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); + LEDTrigger(LED_MEMORY_STORED, LED_PULSE); +} + +bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 14fa: 2a 85 ldd r18, Y+10 ; 0x0a + 14fc: 3b 85 ldd r19, Y+11 ; 0x0b + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 14fe: 61 15 cp r22, r1 + 1500: 71 05 cpc r23, r1 + 1502: 91 f0 breq .+36 ; 0x1528 + + LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); + LEDTrigger(LED_MEMORY_STORED, LED_PULSE); +} + +bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 1504: 26 0f add r18, r22 + 1506: 37 1f adc r19, r23 + 1508: ea 85 ldd r30, Y+10 ; 0x0a + 150a: fb 85 ldd r31, Y+11 ; 0x0b +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + MEMORY_FLASH_USART.DATA = *ByteBuffer++; + 150c: 71 90 ld r7, Z+ + 150e: 70 92 a0 09 sts 0x09A0, r7 + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1512: 70 90 a1 09 lds r7, 0x09A1 + 1516: 76 fe sbrs r7, 6 + 1518: fc cf rjmp .-8 ; 0x1512 + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 151a: d0 92 a1 09 sts 0x09A1, r13 + MEMORY_FLASH_USART.DATA; /* Flush Buffer */ + 151e: 70 90 a0 09 lds r7, 0x09A0 + +INLINE void SPIWriteBlock(const void* Buffer, uint16_t ByteCount) +{ + uint8_t* ByteBuffer = (uint8_t*) Buffer; + + while(ByteCount-- > 0) { + 1522: e2 17 cp r30, r18 + 1524: f3 07 cpc r31, r19 + 1526: 91 f7 brne .-28 ; 0x150c + SPITransferByte(FLASH_CMD_BUF1_WRITE); + SPITransferByte( 0 ); + SPITransferByte( 0 ); + SPITransferByte( Address ); + SPIWriteBlock(Buffer, ByteCount); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1528: c0 92 65 06 sts 0x0665, r12 + +INLINE uint8_t FlashReadStatusRegister(void) +{ + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 152c: c0 92 66 06 sts 0x0666, r12 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1530: b0 92 a0 09 sts 0x09A0, r11 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1534: e0 91 a1 09 lds r30, 0x09A1 + 1538: e6 ff sbrs r30, 6 + 153a: fc cf rjmp .-8 ; 0x1534 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 153c: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1540: e0 91 a0 09 lds r30, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1544: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1548: e0 91 a1 09 lds r30, 0x09A1 + 154c: e6 ff sbrs r30, 6 + 154e: fc cf rjmp .-8 ; 0x1548 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1550: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1554: e0 91 a0 09 lds r30, 0x09A0 + uint8_t Register; + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_STATUS_REG_READ); + Register = SPITransferByte(0); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 1558: c0 92 65 06 sts 0x0665, r12 + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashBufferToMemory(uint16_t PageAddress) +{ + while(FlashIsBusy()); + 155c: e7 ff sbrs r30, 7 + 155e: e6 cf rjmp .-52 ; 0x152c + + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + 1560: a0 92 66 06 sts 0x0666, r10 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 1564: e3 e8 ldi r30, 0x83 ; 131 + 1566: e0 93 a0 09 sts 0x09A0, r30 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 156a: e0 91 a1 09 lds r30, 0x09A1 + 156e: e6 ff sbrs r30, 6 + 1570: fc cf rjmp .-8 ; 0x156a + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1572: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 1576: e0 91 a0 09 lds r30, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 157a: 40 93 a0 09 sts 0x09A0, r20 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 157e: 40 91 a1 09 lds r20, 0x09A1 + 1582: 46 ff sbrs r20, 6 + 1584: fc cf rjmp .-8 ; 0x157e + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 1586: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 158a: 40 91 a0 09 lds r20, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 158e: 50 93 a0 09 sts 0x09A0, r21 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 1592: 40 91 a1 09 lds r20, 0x09A1 + 1596: 46 ff sbrs r20, 6 + 1598: fc cf rjmp .-8 ; 0x1592 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 159a: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 159e: 40 91 a0 09 lds r20, 0x09A0 + +static uint8_t Memory[MEMORY_SIZE_PER_SETTING]; + +INLINE uint8_t SPITransferByte(uint8_t Data) +{ + MEMORY_FLASH_USART.DATA = Data; + 15a2: 10 92 a0 09 sts 0x09A0, r1 + + while (!(MEMORY_FLASH_USART.STATUS & USART_TXCIF_bm)); + 15a6: 40 91 a1 09 lds r20, 0x09A1 + 15aa: 46 ff sbrs r20, 6 + 15ac: fc cf rjmp .-8 ; 0x15a6 + + MEMORY_FLASH_USART.STATUS = USART_TXCIF_bm; + 15ae: d0 92 a1 09 sts 0x09A1, r13 + + return MEMORY_FLASH_USART.DATA; + 15b2: 40 91 a0 09 lds r20, 0x09A0 + MEMORY_FLASH_PORT.OUTCLR = MEMORY_FLASH_CS; + SPITransferByte(FLASH_CMD_BUF1_TO_MEM_ERASE); + SPITransferByte( (PageAddress >> 8) & 0xFF ); + SPITransferByte( (PageAddress >> 0) & 0xFF ); + SPITransferByte( 0 ); + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; + 15b6: c0 92 65 06 sts 0x0665, r12 + + FlashMemoryToBuffer(PageAddress); + FlashWriteBuffer(Buffer, ByteAddress, PageBytes); + FlashBufferToMemory(PageAddress); + + ByteCount -= PageBytes; + 15ba: 06 1b sub r16, r22 + 15bc: 17 0b sbc r17, r23 + Address += PageBytes; + 15be: 86 0f add r24, r22 + 15c0: 97 1f adc r25, r23 + 15c2: a1 1d adc r26, r1 + 15c4: b1 1d adc r27, r1 + Buffer += PageBytes; + 15c6: 2a 87 std Y+10, r18 ; 0x0a + 15c8: 3b 87 std Y+11, r19 ; 0x0b + MEMORY_FLASH_PORT.OUTSET = MEMORY_FLASH_CS; +} + +INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) +{ + while(ByteCount > 0) { + 15ca: 01 15 cp r16, r1 + 15cc: 11 05 cpc r17, r1 + 15ce: 09 f0 breq .+2 ; 0x15d2 + 15d0: d3 ce rjmp .-602 ; 0x1378 + 15d2: 4e 81 ldd r20, Y+6 ; 0x06 + 15d4: 5f 81 ldd r21, Y+7 ; 0x07 + 15d6: 68 85 ldd r22, Y+8 ; 0x08 + 15d8: 79 85 ldd r23, Y+9 ; 0x09 + + /* Store into flash */ + FlashWrite(Buffer, FlashAddress, ByteCount); + + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + 15da: da 01 movw r26, r20 + 15dc: ae 56 subi r26, 0x6E ; 110 + 15de: bf 4d sbci r27, 0xDF ; 223 + 15e0: 2d 81 ldd r18, Y+5 ; 0x05 + 15e2: 32 2d mov r19, r2 + + LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); + LEDTrigger(LED_MEMORY_STORED, LED_PULSE); +} + +bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 15e4: 89 81 ldd r24, Y+1 ; 0x01 + 15e6: 9a 81 ldd r25, Y+2 ; 0x02 + 15e8: 8a 0f add r24, r26 + 15ea: 9b 1f adc r25, r27 + 15ec: f9 01 movw r30, r18 + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + uint8_t* SrcPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + 15ee: 21 91 ld r18, Z+ + 15f0: 2d 93 st X+, r18 + + /* Store to local memory */ + uint8_t* DstPtr = &Memory[BlockAddress]; + uint8_t* SrcPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 15f2: a8 17 cp r26, r24 + 15f4: b9 07 cpc r27, r25 + 15f6: d9 f7 brne .-10 ; 0x15ee + } + + return true; + } + +} + 15f8: 81 e0 ldi r24, 0x01 ; 1 + 15fa: 2b 96 adiw r28, 0x0b ; 11 + 15fc: cd bf out 0x3d, r28 ; 61 + 15fe: de bf out 0x3e, r29 ; 62 + 1600: df 91 pop r29 + 1602: cf 91 pop r28 + 1604: 1f 91 pop r17 + 1606: 0f 91 pop r16 + 1608: ff 90 pop r15 + 160a: ef 90 pop r14 + 160c: df 90 pop r13 + 160e: cf 90 pop r12 + 1610: bf 90 pop r11 + 1612: af 90 pop r10 + 1614: 9f 90 pop r9 + 1616: 8f 90 pop r8 + 1618: 7f 90 pop r7 + 161a: 6f 90 pop r6 + 161c: 5f 90 pop r5 + 161e: 4f 90 pop r4 + 1620: 3f 90 pop r3 + 1622: 2f 90 pop r2 + 1624: 08 95 ret + 1626: ea 85 ldd r30, Y+10 ; 0x0a + 1628: fb 85 ldd r31, Y+11 ; 0x0b + 162a: b6 ce rjmp .-660 ; 0x1398 + return true; + } else { + /* Calculate bytes left in memory and start writing */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 162c: 09 83 std Y+1, r16 ; 0x01 + 162e: 1a 83 std Y+2, r17 ; 0x02 + 1630: 2b 83 std Y+3, r18 ; 0x03 + 1632: 3c 83 std Y+4, r19 ; 0x04 + 1634: 81 ce rjmp .-766 ; 0x1338 + +00001636 : + } + +} + +bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) +{ + 1636: cf 92 push r12 + 1638: df 92 push r13 + 163a: ef 92 push r14 + 163c: ff 92 push r15 + 163e: 0f 93 push r16 + 1640: 1f 93 push r17 + 1642: 69 01 movw r12, r18 + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + 1644: 41 15 cp r20, r1 + 1646: 24 e0 ldi r18, 0x04 ; 4 + 1648: 52 07 cpc r21, r18 + 164a: 61 05 cpc r22, r1 + 164c: 71 05 cpc r23, r1 + 164e: 40 f5 brcc .+80 ; 0x16a0 + /* There are bytes out of bounds to be read. Notify that we are done. */ + return false; + } else { + /* Calculate bytes left in memory and issue reading */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + 1650: 00 e0 ldi r16, 0x00 ; 0 + 1652: 14 e0 ldi r17, 0x04 ; 4 + 1654: 20 e0 ldi r18, 0x00 ; 0 + 1656: 30 e0 ldi r19, 0x00 ; 0 + 1658: 04 1b sub r16, r20 + 165a: 15 0b sbc r17, r21 + 165c: 26 0b sbc r18, r22 + 165e: 37 0b sbc r19, r23 + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 1660: e1 2c mov r14, r1 + 1662: f1 2c mov r15, r1 + 1664: 0c 15 cp r16, r12 + 1666: 1d 05 cpc r17, r13 + 1668: 2e 05 cpc r18, r14 + 166a: 3f 05 cpc r19, r15 + 166c: b0 f0 brcs .+44 ; 0x169a + + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + uint8_t* SrcPtr = &Memory[BlockAddress]; + 166e: 4e 56 subi r20, 0x6E ; 110 + 1670: 5f 4d sbci r21, 0xDF ; 223 + + while(ByteCount--) { + 1672: c1 14 cp r12, r1 + 1674: d1 04 cpc r13, r1 + 1676: 49 f0 breq .+18 ; 0x168a + 1678: da 01 movw r26, r20 + return true; + } + +} + +bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 167a: c8 0e add r12, r24 + 167c: d9 1e adc r13, r25 + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + 167e: fc 01 movw r30, r24 + uint8_t* SrcPtr = &Memory[BlockAddress]; + + while(ByteCount--) { + *DstPtr++ = *SrcPtr++; + 1680: 8d 91 ld r24, X+ + 1682: 81 93 st Z+, r24 + + /* Output local memory contents */ + uint8_t* DstPtr = (uint8_t*) Buffer; + uint8_t* SrcPtr = &Memory[BlockAddress]; + + while(ByteCount--) { + 1684: ec 15 cp r30, r12 + 1686: fd 05 cpc r31, r13 + 1688: d9 f7 brne .-10 ; 0x1680 + *DstPtr++ = *SrcPtr++; + } + + return true; + 168a: 81 e0 ldi r24, 0x01 ; 1 + } +} + 168c: 1f 91 pop r17 + 168e: 0f 91 pop r16 + 1690: ff 90 pop r15 + 1692: ef 90 pop r14 + 1694: df 90 pop r13 + 1696: cf 90 pop r12 + 1698: 08 95 ret + return false; + } else { + /* Calculate bytes left in memory and issue reading */ + uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; + //uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + ByteCount = MIN(ByteCount, BytesLeft); + 169a: 68 01 movw r12, r16 + 169c: 79 01 movw r14, r18 + 169e: e7 cf rjmp .-50 ; 0x166e + +bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) +{ + if (BlockAddress >= MEMORY_SIZE_PER_SETTING) { + /* There are bytes out of bounds to be read. Notify that we are done. */ + return false; + 16a0: 80 e0 ldi r24, 0x00 ; 0 + *DstPtr++ = *SrcPtr++; + } + + return true; + } +} + 16a2: 1f 91 pop r17 + 16a4: 0f 91 pop r16 + 16a6: ff 90 pop r15 + 16a8: ef 90 pop r14 + 16aa: df 90 pop r13 + 16ac: cf 90 pop r12 + 16ae: 08 95 ret + +000016b0 : + [BUTTON_ACTION_STORE_MEM] = "STORE_MEM", + [BUTTON_ACTION_RECALL_MEM] = "RECALL_MEM", +}; + +static void ExecuteButtonAction(ButtonActionEnum ButtonAction) +{ + 16b0: ff 92 push r15 + 16b2: 0f 93 push r16 + 16b4: 1f 93 push r17 + 16b6: cf 93 push r28 + 16b8: df 93 push r29 + 16ba: cd b7 in r28, 0x3d ; 61 + 16bc: de b7 in r29, 0x3e ; 62 + 16be: a0 97 sbiw r28, 0x20 ; 32 + 16c0: cd bf out 0x3d, r28 ; 61 + 16c2: de bf out 0x3e, r29 ; 62 + uint8_t UidBuffer[32]; + + if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { + 16c4: 81 30 cpi r24, 0x01 ; 1 + 16c6: e9 f0 breq .+58 ; 0x1702 + for (uint8_t i=0; i + 16cc: 55 c0 rjmp .+170 ; 0x1778 + UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { + 16ce: 83 30 cpi r24, 0x03 ; 3 + 16d0: 09 f4 brne .+2 ; 0x16d4 + 16d2: 74 c0 rjmp .+232 ; 0x17bc + UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + 16d4: 84 30 cpi r24, 0x04 ; 4 + 16d6: 79 f1 breq .+94 ; 0x1736 + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + 16d8: 85 30 cpi r24, 0x05 ; 5 + 16da: 09 f4 brne .+2 ; 0x16de + 16dc: 94 c0 rjmp .+296 ; 0x1806 + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { + 16de: 86 30 cpi r24, 0x06 ; 6 + 16e0: 09 f4 brne .+2 ; 0x16e4 + 16e2: b3 c0 rjmp .+358 ; 0x184a + SettingsCycle(); + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + 16e4: 87 30 cpi r24, 0x07 ; 7 + 16e6: 09 f4 brne .+2 ; 0x16ea + 16e8: b2 c0 rjmp .+356 ; 0x184e + MemoryStore(); + } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { + 16ea: 88 30 cpi r24, 0x08 ; 8 + 16ec: 09 f4 brne .+2 ; 0x16f0 + 16ee: 89 c0 rjmp .+274 ; 0x1802 + MemoryRecall(); + } +} + 16f0: a0 96 adiw r28, 0x20 ; 32 + 16f2: cd bf out 0x3d, r28 ; 61 + 16f4: de bf out 0x3e, r29 ; 62 + 16f6: df 91 pop r29 + 16f8: cf 91 pop r28 + 16fa: 1f 91 pop r17 + 16fc: 0f 91 pop r16 + 16fe: ff 90 pop r15 + 1700: 08 95 ret +static void ExecuteButtonAction(ButtonActionEnum ButtonAction) +{ + uint8_t UidBuffer[32]; + + if (ButtonAction == BUTTON_ACTION_UID_RANDOM) { + for (uint8_t i=0; i + 170a: a3 c0 rjmp .+326 ; 0x1852 + 170c: f1 2c mov r15, r1 + 170e: 8e 01 movw r16, r28 + 1710: 0f 5f subi r16, 0xFF ; 255 + 1712: 1f 4f sbci r17, 0xFF ; 255 + UidBuffer[i] = RandomGetByte(); + 1714: b1 da rcall .-2718 ; 0xc78 + 1716: f8 01 movw r30, r16 + 1718: ef 0d add r30, r15 + 171a: f1 1d adc r31, r1 + 171c: 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 +INLINE void ApplicationGetUid(ConfigurationUidType Uid) { + ActiveConfiguration.ApplicationGetUidFunc(Uid); +} + +INLINE void ApplicationSetUid(ConfigurationUidType Uid) { + ActiveConfiguration.ApplicationSetUidFunc(Uid); + 1728: e0 91 01 29 lds r30, 0x2901 + 172c: f0 91 02 29 lds r31, 0x2902 + 1730: c8 01 movw r24, r16 + 1732: 09 95 icall + 1734: dd cf rjmp .-70 ; 0x16f0 + ActiveConfiguration.ApplicationResetFunc(); + //LogEntry(LOG_INFO_APP_RESET, NULL, 0); +} + +INLINE void ApplicationGetUid(ConfigurationUidType Uid) { + ActiveConfiguration.ApplicationGetUidFunc(Uid); + 1736: e0 91 ff 28 lds r30, 0x28FF + 173a: f0 91 00 29 lds r31, 0x2900 + 173e: 8e 01 movw r16, r28 + 1740: 0f 5f subi r16, 0xFF ; 255 + 1742: 1f 4f sbci r17, 0xFF ; 255 + 1744: c8 01 movw r24, r16 + 1746: 09 95 icall + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i + 1750: f8 01 movw r30, r16 + [BUTTON_ACTION_CYCLE_SETTINGS] = "CYCLE_SETTINGS", + [BUTTON_ACTION_STORE_MEM] = "STORE_MEM", + [BUTTON_ACTION_RECALL_MEM] = "RECALL_MEM", +}; + +static void ExecuteButtonAction(ButtonActionEnum ButtonAction) + 1752: ce 01 movw r24, r28 + 1754: 02 96 adiw r24, 0x02 ; 2 + 1756: 21 50 subi r18, 0x01 ; 1 + 1758: 82 0f add r24, r18 + 175a: 91 1d adc r25, r1 + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + 175c: 21 e0 ldi r18, 0x01 ; 1 + uint8_t i; + + for (i=0; i + if (UidBuffer[i] == 0x00) { + 1762: 30 81 ld r19, Z + 1764: 21 e0 ldi r18, 0x01 ; 1 + 1766: 31 11 cpse r19, r1 + 1768: 20 e0 ldi r18, 0x00 ; 0 + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + 176a: 31 50 subi r19, 0x01 ; 1 + 176c: 30 83 st Z, r19 + 176e: 31 96 adiw r30, 0x01 ; 1 + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i + 1776: d8 cf rjmp .-80 ; 0x1728 + 1778: e0 91 ff 28 lds r30, 0x28FF + 177c: f0 91 00 29 lds r31, 0x2900 + 1780: 8e 01 movw r16, r28 + 1782: 0f 5f subi r16, 0xFF ; 255 + 1784: 1f 4f sbci r17, 0xFF ; 255 + 1786: c8 01 movw r24, r16 + 1788: 09 95 icall + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i + 1792: f8 01 movw r30, r16 + [BUTTON_ACTION_CYCLE_SETTINGS] = "CYCLE_SETTINGS", + [BUTTON_ACTION_STORE_MEM] = "STORE_MEM", + [BUTTON_ACTION_RECALL_MEM] = "RECALL_MEM", +}; + +static void ExecuteButtonAction(ButtonActionEnum ButtonAction) + 1794: ce 01 movw r24, r28 + 1796: 02 96 adiw r24, 0x02 ; 2 + 1798: 21 50 subi r18, 0x01 ; 1 + 179a: 82 0f add r24, r18 + 179c: 91 1d adc r25, r1 + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + 179e: 21 e0 ldi r18, 0x01 ; 1 + uint8_t i; + + for (i=0; i + if (UidBuffer[i] == 0xFF) { + 17a4: 30 81 ld r19, Z + 17a6: 21 e0 ldi r18, 0x01 ; 1 + 17a8: 3f 3f cpi r19, 0xFF ; 255 + 17aa: 09 f0 breq .+2 ; 0x17ae + 17ac: 20 e0 ldi r18, 0x00 ; 0 + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; + 17ae: 3f 5f subi r19, 0xFF ; 255 + 17b0: 30 83 st Z, r19 + 17b2: 31 96 adiw r30, 0x01 ; 1 + } else if (ButtonAction == BUTTON_ACTION_UID_LEFT_INCREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i; + + for (i=0; i + 17ba: b6 cf rjmp .-148 ; 0x1728 + 17bc: e0 91 ff 28 lds r30, 0x28FF + 17c0: f0 91 00 29 lds r31, 0x2900 + 17c4: 8e 01 movw r16, r28 + 17c6: 0f 5f subi r16, 0xFF ; 255 + 17c8: 1f 4f sbci r17, 0xFF ; 255 + 17ca: c8 01 movw r24, r16 + 17cc: 09 95 icall + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i = ActiveConfiguration.UidSize; + 17ce: 20 91 05 29 lds r18, 0x2905 + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + 17d2: 31 e0 ldi r19, 0x01 ; 1 + uint8_t i = ActiveConfiguration.UidSize; + + while(i-- > 0) { + 17d4: 21 50 subi r18, 0x01 ; 1 + 17d6: 08 f4 brcc .+2 ; 0x17da + 17d8: a7 cf rjmp .-178 ; 0x1728 + if (Carry) { + 17da: 33 23 and r19, r19 + 17dc: d9 f3 breq .-10 ; 0x17d4 + if (UidBuffer[i] == 0xFF) { + 17de: 82 2f mov r24, r18 + 17e0: 90 e0 ldi r25, 0x00 ; 0 + 17e2: f8 01 movw r30, r16 + 17e4: e8 0f add r30, r24 + 17e6: f9 1f adc r31, r25 + 17e8: 40 81 ld r20, Z + 17ea: 31 e0 ldi r19, 0x01 ; 1 + 17ec: 4f 3f cpi r20, 0xFF ; 255 + 17ee: 09 f0 breq .+2 ; 0x17f2 + 17f0: 30 e0 ldi r19, 0x00 ; 0 + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] + 1) & 0xFF; + 17f2: f8 01 movw r30, r16 + 17f4: e8 0f add r30, r24 + 17f6: f9 1f adc r31, r25 + 17f8: 4f 5f subi r20, 0xFF ; 255 + 17fa: 40 83 st Z, r20 + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_INCREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i = ActiveConfiguration.UidSize; + + while(i-- > 0) { + 17fc: 21 50 subi r18, 0x01 ; 1 + 17fe: 68 f7 brcc .-38 ; 0x17da + 1800: 93 cf rjmp .-218 ; 0x1728 + } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { + SettingsCycle(); + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + MemoryStore(); + } else if (ButtonAction == BUTTON_ACTION_RECALL_MEM) { + MemoryRecall(); + 1802: 18 db rcall .-2512 ; 0xe34 + 1804: 75 cf rjmp .-278 ; 0x16f0 + 1806: e0 91 ff 28 lds r30, 0x28FF + 180a: f0 91 00 29 lds r31, 0x2900 + 180e: 8e 01 movw r16, r28 + 1810: 0f 5f subi r16, 0xFF ; 255 + 1812: 1f 4f sbci r17, 0xFF ; 255 + 1814: c8 01 movw r24, r16 + 1816: 09 95 icall + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i = ActiveConfiguration.UidSize; + 1818: 20 91 05 29 lds r18, 0x2905 + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + 181c: 31 e0 ldi r19, 0x01 ; 1 + uint8_t i = ActiveConfiguration.UidSize; + + while(i-- > 0) { + 181e: 21 50 subi r18, 0x01 ; 1 + 1820: 08 f4 brcc .+2 ; 0x1824 + 1822: 82 cf rjmp .-252 ; 0x1728 + if (Carry) { + 1824: 33 23 and r19, r19 + 1826: d9 f3 breq .-10 ; 0x181e + if (UidBuffer[i] == 0x00) { + 1828: 82 2f mov r24, r18 + 182a: 90 e0 ldi r25, 0x00 ; 0 + 182c: f8 01 movw r30, r16 + 182e: e8 0f add r30, r24 + 1830: f9 1f adc r31, r25 + 1832: 40 81 ld r20, Z + 1834: 31 e0 ldi r19, 0x01 ; 1 + 1836: 41 11 cpse r20, r1 + 1838: 30 e0 ldi r19, 0x00 ; 0 + Carry = 1; + } else { + Carry = 0; + } + + UidBuffer[i] = (UidBuffer[i] - 1) & 0xFF; + 183a: f8 01 movw r30, r16 + 183c: e8 0f add r30, r24 + 183e: f9 1f adc r31, r25 + 1840: 41 50 subi r20, 0x01 ; 1 + 1842: 40 83 st Z, r20 + } else if (ButtonAction == BUTTON_ACTION_UID_RIGHT_DECREMENT) { + ApplicationGetUid(UidBuffer); + bool Carry = 1; + uint8_t i = ActiveConfiguration.UidSize; + + while(i-- > 0) { + 1844: 21 50 subi r18, 0x01 ; 1 + 1846: 70 f7 brcc .-36 ; 0x1824 + 1848: 6f cf rjmp .-290 ; 0x1728 + } + } + + ApplicationSetUid(UidBuffer); + } else if (ButtonAction == BUTTON_ACTION_CYCLE_SETTINGS) { + SettingsCycle(); + 184a: 50 d2 rcall .+1184 ; 0x1cec + 184c: 51 cf rjmp .-350 ; 0x16f0 + } else if (ButtonAction == BUTTON_ACTION_STORE_MEM) { + MemoryStore(); + 184e: e7 db rcall .-2098 ; 0x101e + 1850: 4f cf rjmp .-354 ; 0x16f0 + 1852: 8e 01 movw r16, r28 + 1854: 0f 5f subi r16, 0xFF ; 255 + 1856: 1f 4f sbci r17, 0xFF ; 255 + 1858: 67 cf rjmp .-306 ; 0x1728 + +0000185a : + } +} + +void ButtonInit(void) +{ + BUTTON_PORT.DIRCLR = BUTTON_MASK; + 185a: e0 e0 ldi r30, 0x00 ; 0 + 185c: f6 e0 ldi r31, 0x06 ; 6 + 185e: 80 e4 ldi r24, 0x40 ; 64 + 1860: 82 83 std Z+2, r24 ; 0x02 + BUTTON_PORT.BUTTON_PINCTRL = PORT_OPC_PULLUP_gc; + 1862: 88 e1 ldi r24, 0x18 ; 24 + 1864: 86 8b std Z+22, r24 ; 0x16 + 1866: 08 95 ret + +00001868 : +} + +void ButtonTick(void) +{ + static uint8_t PressTickCounter = 0; + uint8_t ThisButtonState = ~BUTTON_PORT.IN; + 1868: 80 91 08 06 lds r24, 0x0608 + + if (ThisButtonState & BUTTON_MASK) { + 186c: 86 ff sbrs r24, 6 + 186e: 08 c0 rjmp .+16 ; 0x1880 + /* 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) ) { + 1870: 80 91 92 24 lds r24, 0x2492 + 1874: 81 50 subi r24, 0x01 ; 1 + 1876: 8a 30 cpi r24, 0x0A ; 10 + 1878: a8 f0 brcs .+42 ; 0x18a4 + /* We have a short button press */ + ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonAction); + } + + PressTickCounter = 0; + 187a: 10 92 92 24 sts 0x2492, r1 + 187e: 08 95 ret + static uint8_t PressTickCounter = 0; + uint8_t ThisButtonState = ~BUTTON_PORT.IN; + + if (ThisButtonState & BUTTON_MASK) { + /* Button is currently pressed */ + if (PressTickCounter < LONG_PRESS_TICK_COUNT) { + 1880: 80 91 92 24 lds r24, 0x2492 + 1884: 8a 30 cpi r24, 0x0A ; 10 + 1886: 50 f0 brcs .+20 ; 0x189c + /* Count ticks while button is being pressed */ + PressTickCounter++; + } else if (PressTickCounter == LONG_PRESS_TICK_COUNT) { + 1888: 8a 30 cpi r24, 0x0A ; 10 + 188a: c9 f7 brne .-14 ; 0x187e + /* Long button press detected execute button action and advance PressTickCounter + * to an invalid state. */ + ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonLongAction); + 188c: e0 91 0a 29 lds r30, 0x290A + 1890: f0 91 0b 29 lds r31, 0x290B + 1894: 81 81 ldd r24, Z+1 ; 0x01 + 1896: 0c df rcall .-488 ; 0x16b0 + PressTickCounter++; + 1898: 80 91 92 24 lds r24, 0x2492 + 189c: 8f 5f subi r24, 0xFF ; 255 + 189e: 80 93 92 24 sts 0x2492, r24 + 18a2: 08 95 ret + } 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) ) { + /* We have a short button press */ + ExecuteButtonAction(GlobalSettings.ActiveSettingPtr->ButtonAction); + 18a4: e0 91 0a 29 lds r30, 0x290A + 18a8: f0 91 0b 29 lds r31, 0x290B + 18ac: 80 81 ld r24, Z + 18ae: 00 df rcall .-512 ; 0x16b0 + 18b0: e4 cf rjmp .-56 ; 0x187a + +000018b2 : + PressTickCounter = 0; + } +} + +void ButtonGetActionList(char* ListOut, uint16_t BufferSize) +{ + 18b2: cf 93 push r28 + 18b4: df 93 push r29 + 18b6: ec 01 movw r28, r24 + uint8_t i; + + /* Account for '\0' */ + BufferSize--; + 18b8: 61 50 subi r22, 0x01 ; 1 + 18ba: 71 09 sbc r23, r1 + 18bc: 80 e0 ldi r24, 0x00 ; 0 + 18be: 90 e0 ldi r25, 0x00 ; 0 + BufferSize--; + } + + if ( i < (BUTTON_ACTION_COUNT - 1) ) { + /* No comma on last configuration */ + *ListOut++ = ','; + 18c0: 3c e2 ldi r19, 0x2C ; 44 + + /* Account for '\0' */ + BufferSize--; + + for (i=0; i sizeof(ButtonActionTable[i]) ) { + 18d8: 24 91 lpm r18, Z + 18da: 22 23 and r18, r18 + 18dc: 81 f0 breq .+32 ; 0x18fe + 18de: 61 32 cpi r22, 0x21 ; 33 + 18e0: 71 05 cpc r23, r1 + 18e2: 68 f0 brcs .+26 ; 0x18fe + 18e4: de 01 movw r26, r28 + 18e6: 03 c0 rjmp .+6 ; 0x18ee + 18e8: 60 32 cpi r22, 0x20 ; 32 + 18ea: 71 05 cpc r23, r1 + 18ec: 41 f0 breq .+16 ; 0x18fe + /* While not end-of-string and enough buffer to + * put a complete configuration name */ + *ListOut++ = c; + 18ee: 2d 93 st X+, r18 + 18f0: ed 01 movw r28, r26 + ActionName++; + 18f2: 31 96 adiw r30, 0x01 ; 1 + BufferSize--; + 18f4: 61 50 subi r22, 0x01 ; 1 + 18f6: 71 09 sbc r23, r1 + + for (i=0; i sizeof(ButtonActionTable[i]) ) { + 18f8: 24 91 lpm r18, Z + 18fa: 21 11 cpse r18, r1 + 18fc: f5 cf rjmp .-22 ; 0x18e8 + *ListOut++ = c; + ActionName++; + BufferSize--; + } + + if ( i < (BUTTON_ACTION_COUNT - 1) ) { + 18fe: 88 30 cpi r24, 0x08 ; 8 + 1900: 91 05 cpc r25, r1 + 1902: 21 f4 brne .+8 ; 0x190c + *ListOut++ = ','; + BufferSize--; + } + } + + *ListOut = '\0'; + 1904: 18 82 st Y, r1 +} + 1906: df 91 pop r29 + 1908: cf 91 pop r28 + 190a: 08 95 ret + BufferSize--; + } + + if ( i < (BUTTON_ACTION_COUNT - 1) ) { + /* No comma on last configuration */ + *ListOut++ = ','; + 190c: 39 93 st Y+, r19 + BufferSize--; + 190e: 61 50 subi r22, 0x01 ; 1 + 1910: 71 09 sbc r23, r1 + 1912: 01 96 adiw r24, 0x01 ; 1 + 1914: d6 cf rjmp .-84 ; 0x18c2 + +00001916 : + + *ListOut = '\0'; +} + +void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action) +{ + 1916: 88 23 and r24, r24 + 1918: 19 f0 breq .+6 ; 0x1920 + 191a: 81 30 cpi r24, 0x01 ; 1 + 191c: 91 f0 breq .+36 ; 0x1942 + 191e: 08 95 ret + } +#else + /* Write button action to all settings when using global settings */ + for (uint8_t i=0; i: + } +#endif +} + +void ButtonGetActionByName(ButtonTypeEnum Type, char* ActionOut, uint16_t BufferSize) +{ + 1964: fb 01 movw r30, r22 + if (Type == BUTTON_PRESS_SHORT) { + 1966: 88 23 and r24, r24 + 1968: 21 f0 breq .+8 ; 0x1972 + strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonAction], BufferSize); + } else if (Type == BUTTON_PRESS_LONG) { + 196a: 81 30 cpi r24, 0x01 ; 1 + 196c: 81 f0 breq .+32 ; 0x198e + strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonLongAction], BufferSize); + } else { + /* Should not happen (TM) */ + *ActionOut = '\0'; + 196e: 10 82 st Z, r1 + 1970: 08 95 ret +} + +void ButtonGetActionByName(ButtonTypeEnum Type, char* ActionOut, uint16_t BufferSize) +{ + if (Type == BUTTON_PRESS_SHORT) { + strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonAction], BufferSize); + 1972: a0 91 0a 29 lds r26, 0x290A + 1976: b0 91 0b 29 lds r27, 0x290B + 197a: 6c 91 ld r22, X + } else if (Type == BUTTON_PRESS_LONG) { + strncpy_P(ActionOut, ButtonActionTable[GlobalSettings.ActiveSettingPtr->ButtonLongAction], BufferSize); + 197c: 80 e2 ldi r24, 0x20 ; 32 + 197e: 68 9f mul r22, r24 + 1980: b0 01 movw r22, r0 + 1982: 11 24 eor r1, r1 + 1984: 6a 59 subi r22, 0x9A ; 154 + 1986: 7c 4f sbci r23, 0xFC ; 252 + 1988: cf 01 movw r24, r30 + 198a: 0c 94 ee 2d jmp 0x5bdc ; 0x5bdc + 198e: a0 91 0a 29 lds r26, 0x290A + 1992: b0 91 0b 29 lds r27, 0x290B + 1996: 11 96 adiw r26, 0x01 ; 1 + 1998: 6c 91 ld r22, X + 199a: f0 cf rjmp .-32 ; 0x197c + +0000199c : + *ActionOut = '\0'; + } +} + +bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action) +{ + 199c: 1f 93 push r17 + 199e: cf 93 push r28 + 19a0: df 93 push r29 + 19a2: 18 2f mov r17, r24 + 19a4: eb 01 movw r28, r22 + uint8_t i; + + for (i=0; i + 19b0: 89 2b or r24, r25 + 19b2: f1 f1 breq .+124 ; 0x1a30 + 19b4: 66 e8 ldi r22, 0x86 ; 134 + 19b6: 73 e0 ldi r23, 0x03 ; 3 + 19b8: ce 01 movw r24, r28 + 19ba: 0e 94 d5 2d call 0x5baa ; 0x5baa + 19be: 89 2b or r24, r25 + 19c0: 09 f4 brne .+2 ; 0x19c4 + 19c2: 3e c0 rjmp .+124 ; 0x1a40 + 19c4: 66 ea ldi r22, 0xA6 ; 166 + 19c6: 73 e0 ldi r23, 0x03 ; 3 + 19c8: ce 01 movw r24, r28 + 19ca: 0e 94 d5 2d call 0x5baa ; 0x5baa + 19ce: 89 2b or r24, r25 + 19d0: c9 f1 breq .+114 ; 0x1a44 + 19d2: 66 ec ldi r22, 0xC6 ; 198 + 19d4: 73 e0 ldi r23, 0x03 ; 3 + 19d6: ce 01 movw r24, r28 + 19d8: 0e 94 d5 2d call 0x5baa ; 0x5baa + 19dc: 89 2b or r24, r25 + 19de: a1 f1 breq .+104 ; 0x1a48 + 19e0: 66 ee ldi r22, 0xE6 ; 230 + 19e2: 73 e0 ldi r23, 0x03 ; 3 + 19e4: ce 01 movw r24, r28 + 19e6: 0e 94 d5 2d call 0x5baa ; 0x5baa + 19ea: 89 2b or r24, r25 + 19ec: 79 f1 breq .+94 ; 0x1a4c + 19ee: 66 e0 ldi r22, 0x06 ; 6 + 19f0: 74 e0 ldi r23, 0x04 ; 4 + 19f2: ce 01 movw r24, r28 + 19f4: 0e 94 d5 2d call 0x5baa ; 0x5baa + 19f8: 89 2b or r24, r25 + 19fa: 51 f1 breq .+84 ; 0x1a50 + 19fc: 66 e2 ldi r22, 0x26 ; 38 + 19fe: 74 e0 ldi r23, 0x04 ; 4 + 1a00: ce 01 movw r24, r28 + 1a02: 0e 94 d5 2d call 0x5baa ; 0x5baa + 1a06: 89 2b or r24, r25 + 1a08: 29 f1 breq .+74 ; 0x1a54 + 1a0a: 66 e4 ldi r22, 0x46 ; 70 + 1a0c: 74 e0 ldi r23, 0x04 ; 4 + 1a0e: ce 01 movw r24, r28 + 1a10: 0e 94 d5 2d call 0x5baa ; 0x5baa + 1a14: 89 2b or r24, r25 + 1a16: 01 f1 breq .+64 ; 0x1a58 + 1a18: 66 e6 ldi r22, 0x66 ; 102 + 1a1a: 74 e0 ldi r23, 0x04 ; 4 + 1a1c: ce 01 movw r24, r28 + 1a1e: 0e 94 d5 2d call 0x5baa ; 0x5baa + 1a22: 89 2b or r24, r25 + 1a24: d9 f0 breq .+54 ; 0x1a5c + return true; + } + } + + /* Button action not found */ + return false; + 1a26: 80 e0 ldi r24, 0x00 ; 0 +} + 1a28: df 91 pop r29 + 1a2a: cf 91 pop r28 + 1a2c: 1f 91 pop r17 + 1a2e: 08 95 ret + +bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action) +{ + uint8_t i; + + for (i=0; i + return true; + 1a36: 81 e0 ldi r24, 0x01 ; 1 + } + } + + /* Button action not found */ + return false; +} + 1a38: df 91 pop r29 + 1a3a: cf 91 pop r28 + 1a3c: 1f 91 pop r17 + 1a3e: 08 95 ret + +bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action) +{ + uint8_t i; + + for (i=0; i + 1a44: 62 e0 ldi r22, 0x02 ; 2 + 1a46: f5 cf rjmp .-22 ; 0x1a32 + 1a48: 63 e0 ldi r22, 0x03 ; 3 + 1a4a: f3 cf rjmp .-26 ; 0x1a32 + 1a4c: 64 e0 ldi r22, 0x04 ; 4 + 1a4e: f1 cf rjmp .-30 ; 0x1a32 + 1a50: 65 e0 ldi r22, 0x05 ; 5 + 1a52: ef cf rjmp .-34 ; 0x1a32 + 1a54: 66 e0 ldi r22, 0x06 ; 6 + 1a56: ed cf rjmp .-38 ; 0x1a32 + 1a58: 67 e0 ldi r22, 0x07 ; 7 + 1a5a: eb cf rjmp .-42 ; 0x1a32 + if (strcmp_P(Action, ButtonActionTable[i]) == 0) { + 1a5c: 68 e0 ldi r22, 0x08 ; 8 + 1a5e: e9 cf rjmp .-46 ; 0x1a32 + +00001a60 : + [LOG_MODE_MEMORY] = "MEMORY", + [LOG_MODE_TERMINAL] = "TERMINAL" +}; + +static void LogFuncOff(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + 1a60: 08 95 ret + +00001a62 : + LogSetModeById(LOG_MODE_OFF); + } +} + +static void LogFuncTerminal(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + 1a62: 1f 93 push r17 + 1a64: cf 93 push r28 + 1a66: df 93 push r29 + 1a68: eb 01 movw r28, r22 + 1a6a: 14 2f mov r17, r20 +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); } +INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } + 1a6c: 68 2f mov r22, r24 + 1a6e: 80 e0 ldi r24, 0x00 ; 0 + 1a70: 90 e2 ldi r25, 0x20 ; 32 + 1a72: 0e 94 bf 2b call 0x577e ; 0x577e + 1a76: 61 2f mov r22, r17 + 1a78: 80 e0 ldi r24, 0x00 ; 0 + 1a7a: 90 e2 ldi r25, 0x20 ; 32 + 1a7c: 0e 94 bf 2b call 0x577e ; 0x577e + TerminalSendByte((uint8_t) Entry); + TerminalSendByte((uint8_t) Length); + TerminalSendBlock(Data, Length); + 1a80: 61 2f mov r22, r17 + 1a82: 70 e0 ldi r23, 0x00 ; 0 + 1a84: ce 01 movw r24, r28 +} + 1a86: df 91 pop r29 + 1a88: cf 91 pop r28 + 1a8a: 1f 91 pop r17 + +static void LogFuncTerminal(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + TerminalSendByte((uint8_t) Entry); + TerminalSendByte((uint8_t) Length); + TerminalSendBlock(Data, Length); + 1a8c: 8e c3 rjmp .+1820 ; 0x21aa + +00001a8e : + LogMemClear(); + LogSetModeById(GlobalSettings.ActiveSettingPtr->LogMode); +} + +void LogTick(void) +{ + 1a8e: 08 95 ret + +00001a90 : + +} + +void LogTask(void) +{ + 1a90: 08 95 ret + +00001a92 : + +} + +bool LogMemLoadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) +{ + if (BlockAddress < sizeof(LogMem)) { + 1a92: 41 15 cp r20, r1 + 1a94: e4 e0 ldi r30, 0x04 ; 4 + 1a96: 5e 07 cpc r21, r30 + 1a98: 61 05 cpc r22, r1 + 1a9a: 71 05 cpc r23, r1 + 1a9c: 80 f4 brcc .+32 ; 0x1abe + uint8_t* DataPtr = (uint8_t*) Buffer; + uint8_t* MemPtr = &LogMem[BlockAddress]; + 1a9e: 4d 56 subi r20, 0x6D ; 109 + 1aa0: 5b 4d sbci r21, 0xDB ; 219 + + while(ByteCount-- > 0) { + 1aa2: 21 15 cp r18, r1 + 1aa4: 31 05 cpc r19, r1 + 1aa6: 49 f0 breq .+18 ; 0x1aba + 1aa8: da 01 movw r26, r20 +void LogTask(void) +{ + +} + +bool LogMemLoadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) + 1aaa: 28 0f add r18, r24 + 1aac: 39 1f adc r19, r25 +{ + if (BlockAddress < sizeof(LogMem)) { + uint8_t* DataPtr = (uint8_t*) Buffer; + 1aae: fc 01 movw r30, r24 + uint8_t* MemPtr = &LogMem[BlockAddress]; + + while(ByteCount-- > 0) { + *DataPtr++ = *MemPtr++; + 1ab0: 8d 91 ld r24, X+ + 1ab2: 81 93 st Z+, r24 +{ + if (BlockAddress < sizeof(LogMem)) { + uint8_t* DataPtr = (uint8_t*) Buffer; + uint8_t* MemPtr = &LogMem[BlockAddress]; + + while(ByteCount-- > 0) { + 1ab4: e2 17 cp r30, r18 + 1ab6: f3 07 cpc r31, r19 + 1ab8: d9 f7 brne .-10 ; 0x1ab0 + *DataPtr++ = *MemPtr++; + } + + return true; + 1aba: 81 e0 ldi r24, 0x01 ; 1 + 1abc: 08 95 ret + } else { + return false; + 1abe: 80 e0 ldi r24, 0x00 ; 0 + } +} + 1ac0: 08 95 ret + +00001ac2 : + +void LogMemClear(void) +{ + 1ac2: e3 e9 ldi r30, 0x93 ; 147 + 1ac4: f4 e2 ldi r31, 0x24 ; 36 + uint16_t i; + + for (i=0; i + LogMem[i] = (uint8_t) LOG_EMPTY; + } + + LogMemPtr = LogMem; + 1ad2: 83 e9 ldi r24, 0x93 ; 147 + 1ad4: 94 e2 ldi r25, 0x24 ; 36 + 1ad6: 80 93 93 28 sts 0x2893, r24 + 1ada: 90 93 94 28 sts 0x2894, r25 + LogMemLeft = sizeof(LogMem); + 1ade: 80 e0 ldi r24, 0x00 ; 0 + 1ae0: 94 e0 ldi r25, 0x04 ; 4 + 1ae2: 80 93 95 28 sts 0x2895, r24 + 1ae6: 90 93 96 28 sts 0x2896, r25 + 1aea: 08 95 ret + +00001aec : +} + +uint16_t LogMemFree(void) +{ + return LogMemLeft; +} + 1aec: 80 91 95 28 lds r24, 0x2895 + 1af0: 90 91 96 28 lds r25, 0x2896 + 1af4: 08 95 ret + +00001af6 : + +void LogSetModeById(LogModeEnum Mode) +{ + GlobalSettings.ActiveSettingPtr->LogMode = Mode; + 1af6: e0 91 0a 29 lds r30, 0x290A + 1afa: f0 91 0b 29 lds r31, 0x290B + 1afe: 82 83 std Z+2, r24 ; 0x02 + + switch(Mode) { + 1b00: 81 30 cpi r24, 0x01 ; 1 + 1b02: 91 f0 breq .+36 ; 0x1b28 + 1b04: 38 f4 brcc .+14 ; 0x1b14 + case LOG_MODE_OFF: + LogFunc = LogFuncOff; + 1b06: 80 e3 ldi r24, 0x30 ; 48 + 1b08: 9d e0 ldi r25, 0x0D ; 13 + 1b0a: 80 93 07 29 sts 0x2907, r24 + 1b0e: 90 93 08 29 sts 0x2908, r25 + break; + 1b12: 08 95 ret + +void LogSetModeById(LogModeEnum Mode) +{ + GlobalSettings.ActiveSettingPtr->LogMode = Mode; + + switch(Mode) { + 1b14: 82 30 cpi r24, 0x02 ; 2 + 1b16: 09 f0 breq .+2 ; 0x1b1a + 1b18: 08 95 ret + case LOG_MODE_MEMORY: + LogFunc = LogFuncMemory; + break; + + case LOG_MODE_TERMINAL: + LogFunc = LogFuncTerminal; + 1b1a: 81 e3 ldi r24, 0x31 ; 49 + 1b1c: 9d e0 ldi r25, 0x0D ; 13 + 1b1e: 80 93 07 29 sts 0x2907, r24 + 1b22: 90 93 08 29 sts 0x2908, r25 + 1b26: 08 95 ret + case LOG_MODE_OFF: + LogFunc = LogFuncOff; + break; + + case LOG_MODE_MEMORY: + LogFunc = LogFuncMemory; + 1b28: 8b e9 ldi r24, 0x9B ; 155 + 1b2a: 9d e0 ldi r25, 0x0D ; 13 + 1b2c: 80 93 07 29 sts 0x2907, r24 + 1b30: 90 93 08 29 sts 0x2908, r25 + break; + 1b34: 08 95 ret + +00001b36 : + /* Do nothing */ +} + +static void LogFuncMemory(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + if (LogMemLeft >= (Length + 2)) { + 1b36: 20 91 95 28 lds r18, 0x2895 + 1b3a: 30 91 96 28 lds r19, 0x2896 + 1b3e: e4 2f mov r30, r20 + 1b40: f0 e0 ldi r31, 0x00 ; 0 + 1b42: df 01 movw r26, r30 + 1b44: 12 96 adiw r26, 0x02 ; 2 + 1b46: 2a 17 cp r18, r26 + 1b48: 3b 07 cpc r19, r27 + 1b4a: 50 f1 brcs .+84 ; 0x1ba0 + LogMemLeft -= Length + 2; + 1b4c: 22 50 subi r18, 0x02 ; 2 + 1b4e: 31 09 sbc r19, r1 + 1b50: 2e 1b sub r18, r30 + 1b52: 3f 0b sbc r19, r31 + 1b54: 20 93 95 28 sts 0x2895, r18 + 1b58: 30 93 96 28 sts 0x2896, r19 + + uint8_t* DataPtr = (uint8_t*) Data; + + *LogMemPtr++ = (uint8_t) Entry; + 1b5c: e0 91 93 28 lds r30, 0x2893 + 1b60: f0 91 94 28 lds r31, 0x2894 + 1b64: 80 83 st Z, r24 + *LogMemPtr++ = (uint8_t) Length; + 1b66: 41 83 std Z+1, r20 ; 0x01 + 1b68: 9f 01 movw r18, r30 + 1b6a: 2e 5f subi r18, 0xFE ; 254 + 1b6c: 3f 4f sbci r19, 0xFF ; 255 + 1b6e: 20 93 93 28 sts 0x2893, r18 + 1b72: 30 93 94 28 sts 0x2894, r19 + + while(Length--) { + 1b76: 84 2f mov r24, r20 + 1b78: 81 50 subi r24, 0x01 ; 1 + 1b7a: 44 23 and r20, r20 + 1b7c: 81 f0 breq .+32 ; 0x1b9e + 1b7e: fb 01 movw r30, r22 + 1b80: d9 01 movw r26, r18 + 1b82: 98 2f mov r25, r24 + *LogMemPtr++ = *DataPtr++; + 1b84: 41 91 ld r20, Z+ + 1b86: 4d 93 st X+, r20 + uint8_t* DataPtr = (uint8_t*) Data; + + *LogMemPtr++ = (uint8_t) Entry; + *LogMemPtr++ = (uint8_t) Length; + + while(Length--) { + 1b88: 91 50 subi r25, 0x01 ; 1 + 1b8a: e0 f7 brcc .-8 ; 0x1b84 +static void LogFuncOff(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + /* Do nothing */ +} + +static void LogFuncMemory(LogEntryEnum Entry, void* Data, uint8_t Length) + 1b8c: 90 e0 ldi r25, 0x00 ; 0 + 1b8e: 01 96 adiw r24, 0x01 ; 1 + 1b90: 82 0f add r24, r18 + 1b92: 93 1f adc r25, r19 + 1b94: 80 93 93 28 sts 0x2893, r24 + 1b98: 90 93 94 28 sts 0x2894, r25 + 1b9c: 08 95 ret + 1b9e: 08 95 ret + while(Length--) { + *LogMemPtr++ = *DataPtr++; + } + } else { + /* If memory full. Deactivate logmode */ + LogSetModeById(LOG_MODE_OFF); + 1ba0: 80 e0 ldi r24, 0x00 ; 0 + 1ba2: a9 cf rjmp .-174 ; 0x1af6 + +00001ba4 : + TerminalSendBlock(Data, Length); +} + +void LogInit(void) +{ + LogMemClear(); + 1ba4: 8e df rcall .-228 ; 0x1ac2 + LogSetModeById(GlobalSettings.ActiveSettingPtr->LogMode); + 1ba6: e0 91 0a 29 lds r30, 0x290A + 1baa: f0 91 0b 29 lds r31, 0x290B + 1bae: 82 81 ldd r24, Z+2 ; 0x02 + 1bb0: a2 cf rjmp .-188 ; 0x1af6 + +00001bb2 : + } + +} + +bool LogSetModeByName(const char* Name) +{ + 1bb2: cf 93 push r28 + 1bb4: df 93 push r29 + 1bb6: ec 01 movw r28, r24 + uint8_t i; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + if (strcmp_P(Name, LogModeTable[i]) == 0) { + 1bb8: 66 e8 ldi r22, 0x86 ; 134 + 1bba: 74 e0 ldi r23, 0x04 ; 4 + 1bbc: 0e 94 d5 2d call 0x5baa ; 0x5baa + 1bc0: 89 2b or r24, r25 + 1bc2: 91 f0 breq .+36 ; 0x1be8 + 1bc4: 66 e9 ldi r22, 0x96 ; 150 + 1bc6: 74 e0 ldi r23, 0x04 ; 4 + 1bc8: ce 01 movw r24, r28 + 1bca: 0e 94 d5 2d call 0x5baa ; 0x5baa + 1bce: 89 2b or r24, r25 + 1bd0: 89 f0 breq .+34 ; 0x1bf4 + 1bd2: 66 ea ldi r22, 0xA6 ; 166 + 1bd4: 74 e0 ldi r23, 0x04 ; 4 + 1bd6: ce 01 movw r24, r28 + 1bd8: 0e 94 d5 2d call 0x5baa ; 0x5baa + 1bdc: 89 2b or r24, r25 + 1bde: 61 f0 breq .+24 ; 0x1bf8 + LogSetModeById(i); + return true; + } + } + + return false; + 1be0: 80 e0 ldi r24, 0x00 ; 0 +} + 1be2: df 91 pop r29 + 1be4: cf 91 pop r28 + 1be6: 08 95 ret + +bool LogSetModeByName(const char* Name) +{ + uint8_t i; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + 1be8: 80 e0 ldi r24, 0x00 ; 0 + if (strcmp_P(Name, LogModeTable[i]) == 0) { + LogSetModeById(i); + 1bea: 85 df rcall .-246 ; 0x1af6 + return true; + 1bec: 81 e0 ldi r24, 0x01 ; 1 + } + } + + return false; +} + 1bee: df 91 pop r29 + 1bf0: cf 91 pop r28 + 1bf2: 08 95 ret + +bool LogSetModeByName(const char* Name) +{ + uint8_t i; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + 1bf4: 81 e0 ldi r24, 0x01 ; 1 + 1bf6: f9 cf rjmp .-14 ; 0x1bea + if (strcmp_P(Name, LogModeTable[i]) == 0) { + 1bf8: 82 e0 ldi r24, 0x02 ; 2 + 1bfa: f7 cf rjmp .-18 ; 0x1bea + +00001bfc : + + return false; +} + +void LogGetModeByName(char* Name, uint16_t BufferSize) +{ + 1bfc: ab 01 movw r20, r22 + strncpy_P(Name, LogModeTable[GlobalSettings.ActiveSettingPtr->LogMode], BufferSize); + 1bfe: e0 91 0a 29 lds r30, 0x290A + 1c02: f0 91 0b 29 lds r31, 0x290B + 1c06: 62 81 ldd r22, Z+2 ; 0x02 + 1c08: 20 e1 ldi r18, 0x10 ; 16 + 1c0a: 62 9f mul r22, r18 + 1c0c: b0 01 movw r22, r0 + 1c0e: 11 24 eor r1, r1 + 1c10: 6a 57 subi r22, 0x7A ; 122 + 1c12: 7b 4f sbci r23, 0xFB ; 251 + 1c14: 0c 94 ee 2d jmp 0x5bdc ; 0x5bdc + +00001c18 : +} + +void LogGetModeList(char* List, uint16_t BufferSize) +{ + 1c18: 0f 93 push r16 + 1c1a: 1f 93 push r17 + 1c1c: cf 93 push r28 + 1c1e: df 93 push r29 + 1c20: ec 01 movw r28, r24 + 1c22: 8b 01 movw r16, r22 + uint8_t i; + + *List = '\0'; + 1c24: 18 82 st Y, r1 + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + strncat_P(List, LogModeTable[i], BufferSize); + 1c26: ab 01 movw r20, r22 + 1c28: 66 e8 ldi r22, 0x86 ; 134 + 1c2a: 74 e0 ldi r23, 0x04 ; 4 + 1c2c: 0e 94 de 2d call 0x5bbc ; 0x5bbc + + if (i < (sizeof(LogModeTable) / sizeof(*LogModeTable) - 1)) { + strncat_P(List, PSTR(","), BufferSize); + 1c30: a8 01 movw r20, r16 + 1c32: 66 eb ldi r22, 0xB6 ; 182 + 1c34: 74 e0 ldi r23, 0x04 ; 4 + 1c36: ce 01 movw r24, r28 + 1c38: 0e 94 de 2d call 0x5bbc ; 0x5bbc + uint8_t i; + + *List = '\0'; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + strncat_P(List, LogModeTable[i], BufferSize); + 1c3c: a8 01 movw r20, r16 + 1c3e: 66 e9 ldi r22, 0x96 ; 150 + 1c40: 74 e0 ldi r23, 0x04 ; 4 + 1c42: ce 01 movw r24, r28 + 1c44: 0e 94 de 2d call 0x5bbc ; 0x5bbc + + if (i < (sizeof(LogModeTable) / sizeof(*LogModeTable) - 1)) { + strncat_P(List, PSTR(","), BufferSize); + 1c48: a8 01 movw r20, r16 + 1c4a: 66 eb ldi r22, 0xB6 ; 182 + 1c4c: 74 e0 ldi r23, 0x04 ; 4 + 1c4e: ce 01 movw r24, r28 + 1c50: 0e 94 de 2d call 0x5bbc ; 0x5bbc + uint8_t i; + + *List = '\0'; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + strncat_P(List, LogModeTable[i], BufferSize); + 1c54: a8 01 movw r20, r16 + 1c56: 66 ea ldi r22, 0xA6 ; 166 + 1c58: 74 e0 ldi r23, 0x04 ; 4 + 1c5a: ce 01 movw r24, r28 + + if (i < (sizeof(LogModeTable) / sizeof(*LogModeTable) - 1)) { + strncat_P(List, PSTR(","), BufferSize); + } + } +} + 1c5c: df 91 pop r29 + 1c5e: cf 91 pop r28 + 1c60: 1f 91 pop r17 + 1c62: 0f 91 pop r16 + uint8_t i; + + *List = '\0'; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + strncat_P(List, LogModeTable[i], BufferSize); + 1c64: 0c 94 de 2d jmp 0x5bbc ; 0x5bbc + +00001c68 : + .LEDGreenFunction = DEFAULT_GREEN_LED_ACTION + } } +}; + +void SettingsLoad(void) { + eeprom_read_block(&GlobalSettings, &StoredSettings, sizeof(SettingsType)); + 1c68: 43 e3 ldi r20, 0x33 ; 51 + 1c6a: 50 e0 ldi r21, 0x00 ; 0 + 1c6c: 60 e0 ldi r22, 0x00 ; 0 + 1c6e: 70 e0 ldi r23, 0x00 ; 0 + 1c70: 89 e0 ldi r24, 0x09 ; 9 + 1c72: 99 e2 ldi r25, 0x29 ; 41 + 1c74: 0c 94 00 30 jmp 0x6000 ; 0x6000 <__eerd_block_x32a4u> + +00001c78 : +} + +void SettingsSave(void) { +#if ENABLE_EEPROM_SETTINGS + eeprom_write_block(&GlobalSettings, &StoredSettings, sizeof(SettingsType)); + 1c78: 43 e3 ldi r20, 0x33 ; 51 + 1c7a: 50 e0 ldi r21, 0x00 ; 0 + 1c7c: 60 e0 ldi r22, 0x00 ; 0 + 1c7e: 70 e0 ldi r23, 0x00 ; 0 + 1c80: 89 e0 ldi r24, 0x09 ; 9 + 1c82: 99 e2 ldi r25, 0x29 ; 41 + 1c84: 0c 94 0b 30 jmp 0x6016 ; 0x6016 <__eewr_block_x32a4u> + +00001c88 : + break; + } + } +} + +bool SettingsSetActiveById(uint8_t Setting) { + 1c88: 1f 93 push r17 + 1c8a: cf 93 push r28 + 1c8c: df 93 push r29 + 1c8e: 1f 92 push r1 + 1c90: cd b7 in r28, 0x3d ; 61 + 1c92: de b7 in r29, 0x3e ; 62 + if ( (Setting >= SETTINGS_FIRST) && (Setting <= SETTINGS_LAST) ) { + 1c94: 18 2f mov r17, r24 + 1c96: 11 50 subi r17, 0x01 ; 1 + 1c98: 18 30 cpi r17, 0x08 ; 8 + 1c9a: 30 f0 brcs .+12 ; 0x1ca8 + /* Notify LED. blink according to current setting */ + LEDTrigger(LED_SETTING_CHANGE, LED_BLINK + SettingIdx); + + return true; + } else { + return false; + 1c9c: 80 e0 ldi r24, 0x00 ; 0 + } +} + 1c9e: 0f 90 pop r0 + 1ca0: df 91 pop r29 + 1ca2: cf 91 pop r28 + 1ca4: 1f 91 pop r17 + 1ca6: 08 95 ret + +bool SettingsSetActiveById(uint8_t Setting) { + if ( (Setting >= SETTINGS_FIRST) && (Setting <= SETTINGS_LAST) ) { + uint8_t SettingIdx = SETTING_TO_INDEX(Setting); + /* Store current memory contents permanently */ + MemoryStore(); + 1ca8: 89 83 std Y+1, r24 ; 0x01 + 1caa: b9 d9 rcall .-3214 ; 0x101e + + GlobalSettings.ActiveSettingIdx = SettingIdx; + 1cac: 10 93 09 29 sts 0x2909, r17 + GlobalSettings.ActiveSettingPtr = + &GlobalSettings.Settings[SettingIdx]; + 1cb0: 41 2f mov r20, r17 + 1cb2: 50 e0 ldi r21, 0x00 ; 0 + 1cb4: 9a 01 movw r18, r20 + 1cb6: 22 0f add r18, r18 + 1cb8: 33 1f adc r19, r19 + 1cba: 24 0f add r18, r20 + 1cbc: 35 1f adc r19, r21 + 1cbe: 22 0f add r18, r18 + 1cc0: 33 1f adc r19, r19 + 1cc2: 24 5f subi r18, 0xF4 ; 244 + 1cc4: 36 4d sbci r19, 0xD6 ; 214 + uint8_t SettingIdx = SETTING_TO_INDEX(Setting); + /* Store current memory contents permanently */ + MemoryStore(); + + GlobalSettings.ActiveSettingIdx = SettingIdx; + GlobalSettings.ActiveSettingPtr = + 1cc6: 20 93 0a 29 sts 0x290A, r18 + 1cca: 30 93 0b 29 sts 0x290B, r19 + &GlobalSettings.Settings[SettingIdx]; + + /* Settings have changed. Progress changes through system */ + ConfigurationInit(); + 1cce: 0e 94 c5 05 call 0xb8a ; 0xb8a + LogInit(); + 1cd2: 68 df rcall .-304 ; 0x1ba4 + + /* Recall new memory contents */ + MemoryRecall(); + 1cd4: af d8 rcall .-3746 ; 0xe34 + + /* Notify LED. blink according to current setting */ + LEDTrigger(LED_SETTING_CHANGE, LED_BLINK + SettingIdx); + 1cd6: 89 81 ldd r24, Y+1 ; 0x01 + 1cd8: 68 2f mov r22, r24 + 1cda: 61 5e subi r22, 0xE1 ; 225 + 1cdc: 83 e0 ldi r24, 0x03 ; 3 + 1cde: 3f d1 rcall .+638 ; 0x1f5e + + return true; + 1ce0: 81 e0 ldi r24, 0x01 ; 1 + } else { + return false; + } +} + 1ce2: 0f 90 pop r0 + 1ce4: df 91 pop r29 + 1ce6: cf 91 pop r28 + 1ce8: 1f 91 pop r17 + 1cea: 08 95 ret + +00001cec : + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1cec: 20 91 09 29 lds r18, 0x2909 + 1cf0: 30 e0 ldi r19, 0x00 ; 0 + 1cf2: 2f 5f subi r18, 0xFF ; 255 + 1cf4: 3f 4f sbci r19, 0xFF ; 255 + 1cf6: 27 70 andi r18, 0x07 ; 7 + 1cf8: 33 27 eor r19, r19 + 1cfa: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1cfc: 2f 5f subi r18, 0xFF ; 255 + 1cfe: 3f 4f sbci r19, 0xFF ; 255 + 1d00: f9 01 movw r30, r18 + 1d02: ee 0f add r30, r30 + 1d04: ff 1f adc r31, r31 + 1d06: e2 0f add r30, r18 + 1d08: f3 1f adc r31, r19 + 1d0a: ee 0f add r30, r30 + 1d0c: ff 1f adc r31, r31 + 1d0e: e7 5f subi r30, 0xF7 ; 247 + 1d10: f6 4d sbci r31, 0xD6 ; 214 + 1d12: 90 81 ld r25, Z + 1d14: 91 11 cpse r25, r1 + 1d16: 78 c0 rjmp .+240 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1d18: 27 70 andi r18, 0x07 ; 7 + 1d1a: 33 27 eor r19, r19 + 1d1c: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1d1e: 2f 5f subi r18, 0xFF ; 255 + 1d20: 3f 4f sbci r19, 0xFF ; 255 + 1d22: f9 01 movw r30, r18 + 1d24: ee 0f add r30, r30 + 1d26: ff 1f adc r31, r31 + 1d28: e2 0f add r30, r18 + 1d2a: f3 1f adc r31, r19 + 1d2c: ee 0f add r30, r30 + 1d2e: ff 1f adc r31, r31 + 1d30: e7 5f subi r30, 0xF7 ; 247 + 1d32: f6 4d sbci r31, 0xD6 ; 214 + 1d34: 90 81 ld r25, Z + 1d36: 91 11 cpse r25, r1 + 1d38: 67 c0 rjmp .+206 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1d3a: 27 70 andi r18, 0x07 ; 7 + 1d3c: 33 27 eor r19, r19 + 1d3e: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1d40: 2f 5f subi r18, 0xFF ; 255 + 1d42: 3f 4f sbci r19, 0xFF ; 255 + 1d44: f9 01 movw r30, r18 + 1d46: ee 0f add r30, r30 + 1d48: ff 1f adc r31, r31 + 1d4a: e2 0f add r30, r18 + 1d4c: f3 1f adc r31, r19 + 1d4e: ee 0f add r30, r30 + 1d50: ff 1f adc r31, r31 + 1d52: e7 5f subi r30, 0xF7 ; 247 + 1d54: f6 4d sbci r31, 0xD6 ; 214 + 1d56: 90 81 ld r25, Z + 1d58: 91 11 cpse r25, r1 + 1d5a: 56 c0 rjmp .+172 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1d5c: 27 70 andi r18, 0x07 ; 7 + 1d5e: 33 27 eor r19, r19 + 1d60: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1d62: 2f 5f subi r18, 0xFF ; 255 + 1d64: 3f 4f sbci r19, 0xFF ; 255 + 1d66: f9 01 movw r30, r18 + 1d68: ee 0f add r30, r30 + 1d6a: ff 1f adc r31, r31 + 1d6c: e2 0f add r30, r18 + 1d6e: f3 1f adc r31, r19 + 1d70: ee 0f add r30, r30 + 1d72: ff 1f adc r31, r31 + 1d74: e7 5f subi r30, 0xF7 ; 247 + 1d76: f6 4d sbci r31, 0xD6 ; 214 + 1d78: 90 81 ld r25, Z + 1d7a: 91 11 cpse r25, r1 + 1d7c: 45 c0 rjmp .+138 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1d7e: 27 70 andi r18, 0x07 ; 7 + 1d80: 33 27 eor r19, r19 + 1d82: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1d84: 2f 5f subi r18, 0xFF ; 255 + 1d86: 3f 4f sbci r19, 0xFF ; 255 + 1d88: f9 01 movw r30, r18 + 1d8a: ee 0f add r30, r30 + 1d8c: ff 1f adc r31, r31 + 1d8e: e2 0f add r30, r18 + 1d90: f3 1f adc r31, r19 + 1d92: ee 0f add r30, r30 + 1d94: ff 1f adc r31, r31 + 1d96: e7 5f subi r30, 0xF7 ; 247 + 1d98: f6 4d sbci r31, 0xD6 ; 214 + 1d9a: 90 81 ld r25, Z + 1d9c: 91 11 cpse r25, r1 + 1d9e: 34 c0 rjmp .+104 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1da0: 27 70 andi r18, 0x07 ; 7 + 1da2: 33 27 eor r19, r19 + 1da4: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1da6: 2f 5f subi r18, 0xFF ; 255 + 1da8: 3f 4f sbci r19, 0xFF ; 255 + 1daa: f9 01 movw r30, r18 + 1dac: ee 0f add r30, r30 + 1dae: ff 1f adc r31, r31 + 1db0: e2 0f add r30, r18 + 1db2: f3 1f adc r31, r19 + 1db4: ee 0f add r30, r30 + 1db6: ff 1f adc r31, r31 + 1db8: e7 5f subi r30, 0xF7 ; 247 + 1dba: f6 4d sbci r31, 0xD6 ; 214 + 1dbc: 90 81 ld r25, Z + 1dbe: 91 11 cpse r25, r1 + 1dc0: 23 c0 rjmp .+70 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1dc2: 27 70 andi r18, 0x07 ; 7 + 1dc4: 33 27 eor r19, r19 + 1dc6: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1dc8: 2f 5f subi r18, 0xFF ; 255 + 1dca: 3f 4f sbci r19, 0xFF ; 255 + 1dcc: f9 01 movw r30, r18 + 1dce: ee 0f add r30, r30 + 1dd0: ff 1f adc r31, r31 + 1dd2: e2 0f add r30, r18 + 1dd4: f3 1f adc r31, r19 + 1dd6: ee 0f add r30, r30 + 1dd8: ff 1f adc r31, r31 + 1dda: e7 5f subi r30, 0xF7 ; 247 + 1ddc: f6 4d sbci r31, 0xD6 ; 214 + 1dde: 90 81 ld r25, Z + 1de0: 91 11 cpse r25, r1 + 1de2: 12 c0 rjmp .+36 ; 0x1e08 + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; + + while (i-- > 0) { + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; + 1de4: 27 70 andi r18, 0x07 ; 7 + 1de6: 33 27 eor r19, r19 + 1de8: 82 2f mov r24, r18 + + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + 1dea: 2f 5f subi r18, 0xFF ; 255 + 1dec: 3f 4f sbci r19, 0xFF ; 255 + 1dee: f9 01 movw r30, r18 + 1df0: ee 0f add r30, r30 + 1df2: ff 1f adc r31, r31 + 1df4: e2 0f add r30, r18 + 1df6: f3 1f adc r31, r19 + 1df8: ee 0f add r30, r30 + 1dfa: ff 1f adc r31, r31 + 1dfc: e7 5f subi r30, 0xF7 ; 247 + 1dfe: f6 4d sbci r31, 0xD6 ; 214 + 1e00: 90 81 ld r25, Z + 1e02: 91 11 cpse r25, r1 + 1e04: 01 c0 rjmp .+2 ; 0x1e08 + 1e06: 08 95 ret + SettingsSetActiveById(INDEX_TO_SETTING(SettingIdx)); + 1e08: 8f 5f subi r24, 0xFF ; 255 + 1e0a: 3e cf rjmp .-388 ; 0x1c88 + +00001e0c : + return false; + } +} + +uint8_t SettingsGetActiveById(void) { + return INDEX_TO_SETTING(GlobalSettings.ActiveSettingIdx); + 1e0c: 80 91 09 29 lds r24, 0x2909 +} + 1e10: 8f 5f subi r24, 0xFF ; 255 + 1e12: 08 95 ret + +00001e14 : + +void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize) { + 1e14: cf 93 push r28 + 1e16: df 93 push r29 + 1e18: ec 01 movw r28, r24 + SettingOut[0] = SettingsGetActiveById() + '0'; + 1e1a: f8 df rcall .-16 ; 0x1e0c + 1e1c: 80 5d subi r24, 0xD0 ; 208 + 1e1e: 88 83 st Y, r24 + SettingOut[1] = '\0'; + 1e20: 19 82 std Y+1, r1 ; 0x01 +} + 1e22: df 91 pop r29 + 1e24: cf 91 pop r28 + 1e26: 08 95 ret + +00001e28 : + +bool SettingsSetActiveByName(const char* Setting) { + 1e28: fc 01 movw r30, r24 + uint8_t SettingNr = Setting[0] - '0'; + 1e2a: 80 81 ld r24, Z + + if (Setting[1] == '\0') { + 1e2c: 91 81 ldd r25, Z+1 ; 0x01 + 1e2e: 99 23 and r25, r25 + 1e30: 11 f0 breq .+4 ; 0x1e36 + return SettingsSetActiveById(SettingNr); + } else { + return false; + } +} + 1e32: 80 e0 ldi r24, 0x00 ; 0 + 1e34: 08 95 ret + +bool SettingsSetActiveByName(const char* Setting) { + uint8_t SettingNr = Setting[0] - '0'; + + if (Setting[1] == '\0') { + return SettingsSetActiveById(SettingNr); + 1e36: 80 53 subi r24, 0x30 ; 48 + 1e38: 27 cf rjmp .-434 ; 0x1c88 + +00001e3a : + } +} + +void LEDInit(void) +{ + LED_PORT.DIRSET = LED_MASK; + 1e3a: 80 e3 ldi r24, 0x30 ; 48 + 1e3c: e0 e0 ldi r30, 0x00 ; 0 + 1e3e: f6 e0 ldi r31, 0x06 ; 6 + 1e40: 81 83 std Z+1, r24 ; 0x01 + 1e42: 08 95 ret + +00001e44 : + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1e44: 80 91 97 28 lds r24, 0x2897 + 1e48: 82 31 cpi r24, 0x12 ; 18 + 1e4a: 09 f4 brne .+2 ; 0x1e4e + 1e4c: 60 c0 rjmp .+192 ; 0x1f0e + 1e4e: c8 f0 brcs .+50 ; 0x1e82 + 1e50: 83 31 cpi r24, 0x13 ; 19 + 1e52: 01 f1 breq .+64 ; 0x1e94 + 1e54: 98 2f mov r25, r24 + 1e56: 90 52 subi r25, 0x20 ; 32 + 1e58: 98 30 cpi r25, 0x08 ; 8 + 1e5a: 08 f0 brcs .+2 ; 0x1e5e + 1e5c: 4d c0 rjmp .+154 ; 0x1ef8 + *Action = LED_NO_ACTION; + } + break; + + case LED_BLINK_1X ... LED_BLINK_8X: + if (++BlinkPrescaler == BLINK_PRESCALER) { + 1e5e: 90 91 99 28 lds r25, 0x2899 + 1e62: 9f 5f subi r25, 0xFF ; 255 + 1e64: 91 30 cpi r25, 0x01 ; 1 + 1e66: 09 f4 brne .+2 ; 0x1e6a + 1e68: 6b c0 rjmp .+214 ; 0x1f40 + 1e6a: 90 93 99 28 sts 0x2899, r25 + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1e6e: 80 91 98 28 lds r24, 0x2898 + 1e72: 82 31 cpi r24, 0x12 ; 18 + 1e74: e1 f4 brne .+56 ; 0x1eae + LED_PORT.OUTSET = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_TOGGLE: + LED_PORT.OUTTGL = Mask; + 1e76: 80 e2 ldi r24, 0x20 ; 32 + 1e78: 80 93 07 06 sts 0x0607, r24 + *Action = LED_NO_ACTION; + 1e7c: 10 92 98 28 sts 0x2898, r1 + 1e80: 08 95 ret + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1e82: 80 31 cpi r24, 0x10 ; 16 + 1e84: 61 f0 breq .+24 ; 0x1e9e + 1e86: b0 f1 brcs .+108 ; 0x1ef4 + LED_PORT.OUTCLR = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_ON: + LED_PORT.OUTSET = Mask; + 1e88: 80 e1 ldi r24, 0x10 ; 16 + 1e8a: 80 93 05 06 sts 0x0605, r24 + *Action = LED_NO_ACTION; + 1e8e: 10 92 97 28 sts 0x2897, r1 + 1e92: 09 c0 rjmp .+18 ; 0x1ea6 + LED_PORT.OUTTGL = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_PULSE: + if (!(LED_PORT.OUT & Mask)) { + 1e94: 80 91 04 06 lds r24, 0x0604 + 1e98: 84 ff sbrs r24, 4 + 1e9a: 3f c0 rjmp .+126 ; 0x1f1a + LED_PORT.OUTSET = Mask; + } else { + LED_PORT.OUTCLR = Mask; + 1e9c: 80 e1 ldi r24, 0x10 ; 16 + 1e9e: 80 93 06 06 sts 0x0606, r24 + *Action = LED_NO_ACTION; + 1ea2: 10 92 97 28 sts 0x2897, r1 + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1ea6: 80 91 98 28 lds r24, 0x2898 + 1eaa: 82 31 cpi r24, 0x12 ; 18 + 1eac: 21 f3 breq .-56 ; 0x1e76 + 1eae: 83 31 cpi r24, 0x13 ; 19 + 1eb0: 48 f4 brcc .+18 ; 0x1ec4 + 1eb2: 80 31 cpi r24, 0x10 ; 16 + 1eb4: a9 f0 breq .+42 ; 0x1ee0 + 1eb6: d0 f0 brcs .+52 ; 0x1eec + LED_PORT.OUTCLR = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_ON: + LED_PORT.OUTSET = Mask; + 1eb8: 80 e2 ldi r24, 0x20 ; 32 + 1eba: 80 93 05 06 sts 0x0605, r24 + *Action = LED_NO_ACTION; + 1ebe: 10 92 98 28 sts 0x2898, r1 + 1ec2: 08 95 ret + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1ec4: 83 31 cpi r24, 0x13 ; 19 + 1ec6: d9 f0 breq .+54 ; 0x1efe + 1ec8: 98 2f mov r25, r24 + 1eca: 90 52 subi r25, 0x20 ; 32 + 1ecc: 98 30 cpi r25, 0x08 ; 8 + 1ece: 78 f4 brcc .+30 ; 0x1eee + *Action = LED_NO_ACTION; + } + break; + + case LED_BLINK_1X ... LED_BLINK_8X: + if (++BlinkPrescaler == BLINK_PRESCALER) { + 1ed0: 90 91 99 28 lds r25, 0x2899 + 1ed4: 9f 5f subi r25, 0xFF ; 255 + 1ed6: 91 30 cpi r25, 0x01 ; 1 + 1ed8: 21 f1 breq .+72 ; 0x1f22 + 1eda: 90 93 99 28 sts 0x2899, r25 + 1ede: 08 95 ret + + case LED_PULSE: + if (!(LED_PORT.OUT & Mask)) { + LED_PORT.OUTSET = Mask; + } else { + LED_PORT.OUTCLR = Mask; + 1ee0: 80 e2 ldi r24, 0x20 ; 32 + 1ee2: 80 93 06 06 sts 0x0606, r24 + *Action = LED_NO_ACTION; + 1ee6: 10 92 98 28 sts 0x2898, r1 + 1eea: 08 95 ret + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1eec: 81 11 cpse r24, r1 + } + break; + + default: + /* Should not happen (TM) */ + *Action = LED_NO_ACTION; + 1eee: 10 92 98 28 sts 0x2898, r1 + 1ef2: 08 95 ret + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + 1ef4: 88 23 and r24, r24 + 1ef6: b9 f2 breq .-82 ; 0x1ea6 + } + break; + + default: + /* Should not happen (TM) */ + *Action = LED_NO_ACTION; + 1ef8: 10 92 97 28 sts 0x2897, r1 + 1efc: d4 cf rjmp .-88 ; 0x1ea6 + LED_PORT.OUTTGL = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_PULSE: + if (!(LED_PORT.OUT & Mask)) { + 1efe: 80 91 04 06 lds r24, 0x0604 + 1f02: 85 fd sbrc r24, 5 + 1f04: ed cf rjmp .-38 ; 0x1ee0 + BlinkPrescaler = 0; + /* Blink functionality occurs at slower speed than Tick-frequency */ + + if (!(LED_PORT.OUT & Mask)) { + /* LED is off, turn it on */ + LED_PORT.OUTSET = Mask; + 1f06: 80 e2 ldi r24, 0x20 ; 32 + 1f08: 80 93 05 06 sts 0x0605, r24 + 1f0c: 08 95 ret + LED_PORT.OUTSET = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_TOGGLE: + LED_PORT.OUTTGL = Mask; + 1f0e: 80 e1 ldi r24, 0x10 ; 16 + 1f10: 80 93 07 06 sts 0x0607, r24 + *Action = LED_NO_ACTION; + 1f14: 10 92 97 28 sts 0x2897, r1 + 1f18: c6 cf rjmp .-116 ; 0x1ea6 + BlinkPrescaler = 0; + /* Blink functionality occurs at slower speed than Tick-frequency */ + + if (!(LED_PORT.OUT & Mask)) { + /* LED is off, turn it on */ + LED_PORT.OUTSET = Mask; + 1f1a: 80 e1 ldi r24, 0x10 ; 16 + 1f1c: 80 93 05 06 sts 0x0605, r24 + 1f20: c2 cf rjmp .-124 ; 0x1ea6 + } + break; + + case LED_BLINK_1X ... LED_BLINK_8X: + if (++BlinkPrescaler == BLINK_PRESCALER) { + BlinkPrescaler = 0; + 1f22: 10 92 99 28 sts 0x2899, r1 + /* Blink functionality occurs at slower speed than Tick-frequency */ + + if (!(LED_PORT.OUT & Mask)) { + 1f26: 90 91 04 06 lds r25, 0x0604 + 1f2a: 95 ff sbrs r25, 5 + 1f2c: ec cf rjmp .-40 ; 0x1f06 + /* LED is off, turn it on */ + LED_PORT.OUTSET = Mask; + } else { + /* LED is on, turn it off and change state */ + LED_PORT.OUTCLR = Mask; + 1f2e: 90 e2 ldi r25, 0x20 ; 32 + 1f30: 90 93 06 06 sts 0x0606, r25 + + if (*Action == LED_BLINK_1X) { + 1f34: 80 32 cpi r24, 0x20 ; 32 + 1f36: d9 f2 breq .-74 ; 0x1eee + *Action = LED_NO_ACTION; + } else { + /* Still some blinks to do. Use the fact that LED_BLINK_XY are ordered sequentially */ + *Action = *Action - 1; + 1f38: 81 50 subi r24, 0x01 ; 1 + 1f3a: 80 93 98 28 sts 0x2898, r24 + 1f3e: 08 95 ret + } + break; + + case LED_BLINK_1X ... LED_BLINK_8X: + if (++BlinkPrescaler == BLINK_PRESCALER) { + BlinkPrescaler = 0; + 1f40: 10 92 99 28 sts 0x2899, r1 + /* Blink functionality occurs at slower speed than Tick-frequency */ + + if (!(LED_PORT.OUT & Mask)) { + 1f44: 90 91 04 06 lds r25, 0x0604 + 1f48: 94 ff sbrs r25, 4 + 1f4a: e7 cf rjmp .-50 ; 0x1f1a + /* LED is off, turn it on */ + LED_PORT.OUTSET = Mask; + } else { + /* LED is on, turn it off and change state */ + LED_PORT.OUTCLR = Mask; + 1f4c: 90 e1 ldi r25, 0x10 ; 16 + 1f4e: 90 93 06 06 sts 0x0606, r25 + + if (*Action == LED_BLINK_1X) { + 1f52: 80 32 cpi r24, 0x20 ; 32 + 1f54: 89 f2 breq .-94 ; 0x1ef8 + *Action = LED_NO_ACTION; + } else { + /* Still some blinks to do. Use the fact that LED_BLINK_XY are ordered sequentially */ + *Action = *Action - 1; + 1f56: 81 50 subi r24, 0x01 ; 1 + 1f58: 80 93 97 28 sts 0x2897, r24 + 1f5c: a4 cf rjmp .-184 ; 0x1ea6 + +00001f5e : + Tick(LED_GREEN, &LEDGreenAction); +} + +/* TODO: This would be nicer as INLINE */ +void LEDTrigger(LEDFunctionEnum Func, LEDActionEnum Action) { + if (GlobalSettings.ActiveSettingPtr->LEDGreenFunction == Func) { + 1f5e: e0 91 0a 29 lds r30, 0x290A + 1f62: f0 91 0b 29 lds r31, 0x290B + 1f66: 95 81 ldd r25, Z+5 ; 0x05 + 1f68: 98 17 cp r25, r24 + 1f6a: 31 f0 breq .+12 ; 0x1f78 + LEDGreenAction = Action; + } + + if (GlobalSettings.ActiveSettingPtr->LEDRedFunction == Func) { + 1f6c: 94 81 ldd r25, Z+4 ; 0x04 + 1f6e: 98 13 cpse r25, r24 + 1f70: 08 95 ret + LEDRedAction = Action; + 1f72: 60 93 97 28 sts 0x2897, r22 + 1f76: 08 95 ret +} + +/* TODO: This would be nicer as INLINE */ +void LEDTrigger(LEDFunctionEnum Func, LEDActionEnum Action) { + if (GlobalSettings.ActiveSettingPtr->LEDGreenFunction == Func) { + LEDGreenAction = Action; + 1f78: 60 93 98 28 sts 0x2898, r22 + 1f7c: f7 cf rjmp .-18 ; 0x1f6c + +00001f7e : + LEDRedAction = Action; + } +} + +void LEDGetFuncList(char* ListOut, uint16_t BufferSize) +{ + 1f7e: cf 93 push r28 + 1f80: df 93 push r29 + 1f82: ec 01 movw r28, r24 + uint8_t i; + + /* Account for '\0' */ + BufferSize--; + 1f84: 61 50 subi r22, 0x01 ; 1 + 1f86: 71 09 sbc r23, r1 + 1f88: 80 e0 ldi r24, 0x00 ; 0 + 1f8a: 90 e0 ldi r25, 0x00 ; 0 + BufferSize--; + } + + if ( i < (LED_FUNC_COUNT - 1) ) { + /* No comma on last configuration */ + *ListOut++ = ','; + 1f8c: 3c e2 ldi r19, 0x2C ; 44 + + /* Account for '\0' */ + BufferSize--; + + for (i=0; i sizeof(LEDFuncTable[i]) ) { + 1fa4: 24 91 lpm r18, Z + 1fa6: 22 23 and r18, r18 + 1fa8: 81 f0 breq .+32 ; 0x1fca + 1faa: 61 32 cpi r22, 0x21 ; 33 + 1fac: 71 05 cpc r23, r1 + 1fae: 68 f0 brcs .+26 ; 0x1fca + 1fb0: de 01 movw r26, r28 + 1fb2: 03 c0 rjmp .+6 ; 0x1fba + 1fb4: 60 32 cpi r22, 0x20 ; 32 + 1fb6: 71 05 cpc r23, r1 + 1fb8: 41 f0 breq .+16 ; 0x1fca + /* While not end-of-string and enough buffer to + * put a complete configuration name */ + *ListOut++ = c; + 1fba: 2d 93 st X+, r18 + 1fbc: ed 01 movw r28, r26 + FuncName++; + 1fbe: 31 96 adiw r30, 0x01 ; 1 + BufferSize--; + 1fc0: 61 50 subi r22, 0x01 ; 1 + 1fc2: 71 09 sbc r23, r1 + + for (i=0; i sizeof(LEDFuncTable[i]) ) { + 1fc4: 24 91 lpm r18, Z + 1fc6: 21 11 cpse r18, r1 + 1fc8: f5 cf rjmp .-22 ; 0x1fb4 + *ListOut++ = c; + FuncName++; + BufferSize--; + } + + if ( i < (LED_FUNC_COUNT - 1) ) { + 1fca: 87 30 cpi r24, 0x07 ; 7 + 1fcc: 91 05 cpc r25, r1 + 1fce: 21 f4 brne .+8 ; 0x1fd8 + *ListOut++ = ','; + BufferSize--; + } + } + + *ListOut = '\0'; + 1fd0: 18 82 st Y, r1 +} + 1fd2: df 91 pop r29 + 1fd4: cf 91 pop r28 + 1fd6: 08 95 ret + BufferSize--; + } + + if ( i < (LED_FUNC_COUNT - 1) ) { + /* No comma on last configuration */ + *ListOut++ = ','; + 1fd8: 39 93 st Y+, r19 + BufferSize--; + 1fda: 61 50 subi r22, 0x01 ; 1 + 1fdc: 71 09 sbc r23, r1 + 1fde: 01 96 adiw r24, 0x01 ; 1 + 1fe0: d6 cf rjmp .-84 ; 0x1f8e + +00001fe2 : + + *ListOut = '\0'; +} + +void LEDSetFuncById(uint8_t Mask, LEDFunctionEnum Func) +{ + 1fe2: 98 2f mov r25, r24 + 1fe4: 90 71 andi r25, 0x10 ; 16 + 1fe6: 85 fd sbrc r24, 5 + 1fe8: 03 c0 rjmp .+6 ; 0x1ff0 + 1fea: 91 11 cpse r25, r1 + 1fec: 3f c0 rjmp .+126 ; 0x206c + 1fee: 08 95 ret + } +#else + /* Write LED func to all settings when using global settings */ + for (uint8_t i=0; i + } + + if (Mask & LED_RED) { + GlobalSettings.Settings[i].LEDRedFunction = Func; + 1ff8: 60 93 10 29 sts 0x2910, r22 + } +#else + /* Write LED func to all settings when using global settings */ + for (uint8_t i=0; i + LED_PORT.OUTCLR = LED_RED; + 2042: 80 e1 ldi r24, 0x10 ; 16 + 2044: 80 93 06 06 sts 0x0606, r24 + LEDRedAction = LED_NO_ACTION; + 2048: 10 92 97 28 sts 0x2897, r1 + 204c: 08 95 ret + } +#else + /* Write LED func to all settings when using global settings */ + for (uint8_t i=0; i + } + + if (Mask & LED_RED) { + GlobalSettings.Settings[i].LEDRedFunction = Func; + 206c: 60 93 10 29 sts 0x2910, r22 + 2070: 60 93 16 29 sts 0x2916, r22 + 2074: 60 93 1c 29 sts 0x291C, r22 + 2078: 60 93 22 29 sts 0x2922, r22 + 207c: 60 93 28 29 sts 0x2928, r22 + 2080: 60 93 2e 29 sts 0x292E, r22 + 2084: 60 93 34 29 sts 0x2934, r22 + 2088: 60 93 3a 29 sts 0x293A, r22 + 208c: d8 cf rjmp .-80 ; 0x203e + +0000208e : + } + +} + +void LEDGetFuncByName(uint8_t Mask, char* FuncOut, uint16_t BufferSize) +{ + 208e: fb 01 movw r30, r22 + if (Mask == LED_GREEN) { + 2090: 80 32 cpi r24, 0x20 ; 32 + 2092: 21 f0 breq .+8 ; 0x209c + strncpy_P(FuncOut, LEDFuncTable[GlobalSettings.ActiveSettingPtr->LEDGreenFunction], BufferSize); + } else if (Mask == LED_RED) { + 2094: 80 31 cpi r24, 0x10 ; 16 + 2096: 89 f0 breq .+34 ; 0x20ba + strncpy_P(FuncOut, LEDFuncTable[GlobalSettings.ActiveSettingPtr->LEDRedFunction], BufferSize); + } else { + *FuncOut = '\0'; + 2098: 10 82 st Z, r1 + 209a: 08 95 ret +} + +void LEDGetFuncByName(uint8_t Mask, char* FuncOut, uint16_t BufferSize) +{ + if (Mask == LED_GREEN) { + strncpy_P(FuncOut, LEDFuncTable[GlobalSettings.ActiveSettingPtr->LEDGreenFunction], BufferSize); + 209c: a0 91 0a 29 lds r26, 0x290A + 20a0: b0 91 0b 29 lds r27, 0x290B + 20a4: 15 96 adiw r26, 0x05 ; 5 + 20a6: 6c 91 ld r22, X + } else if (Mask == LED_RED) { + strncpy_P(FuncOut, LEDFuncTable[GlobalSettings.ActiveSettingPtr->LEDRedFunction], BufferSize); + 20a8: 80 e2 ldi r24, 0x20 ; 32 + 20aa: 68 9f mul r22, r24 + 20ac: b0 01 movw r22, r0 + 20ae: 11 24 eor r1, r1 + 20b0: 68 54 subi r22, 0x48 ; 72 + 20b2: 7b 4f sbci r23, 0xFB ; 251 + 20b4: cf 01 movw r24, r30 + 20b6: 0c 94 ee 2d jmp 0x5bdc ; 0x5bdc + 20ba: a0 91 0a 29 lds r26, 0x290A + 20be: b0 91 0b 29 lds r27, 0x290B + 20c2: 14 96 adiw r26, 0x04 ; 4 + 20c4: 6c 91 ld r22, X + 20c6: f0 cf rjmp .-32 ; 0x20a8 + +000020c8 : + *FuncOut = '\0'; + } +} + +bool LEDSetFuncByName(uint8_t Mask, const char* FuncName) +{ + 20c8: 1f 93 push r17 + 20ca: cf 93 push r28 + 20cc: df 93 push r29 + 20ce: 18 2f mov r17, r24 + 20d0: eb 01 movw r28, r22 + uint8_t i; + + for (i=0; i + 20dc: 89 2b or r24, r25 + 20de: b1 f1 breq .+108 ; 0x214c + 20e0: 68 ed ldi r22, 0xD8 ; 216 + 20e2: 74 e0 ldi r23, 0x04 ; 4 + 20e4: ce 01 movw r24, r28 + 20e6: 0e 94 d5 2d call 0x5baa ; 0x5baa + 20ea: 89 2b or r24, r25 + 20ec: b9 f1 breq .+110 ; 0x215c + 20ee: 68 ef ldi r22, 0xF8 ; 248 + 20f0: 74 e0 ldi r23, 0x04 ; 4 + 20f2: ce 01 movw r24, r28 + 20f4: 0e 94 d5 2d call 0x5baa ; 0x5baa + 20f8: 89 2b or r24, r25 + 20fa: 91 f1 breq .+100 ; 0x2160 + 20fc: 68 e1 ldi r22, 0x18 ; 24 + 20fe: 75 e0 ldi r23, 0x05 ; 5 + 2100: ce 01 movw r24, r28 + 2102: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2106: 89 2b or r24, r25 + 2108: 69 f1 breq .+90 ; 0x2164 + 210a: 68 e3 ldi r22, 0x38 ; 56 + 210c: 75 e0 ldi r23, 0x05 ; 5 + 210e: ce 01 movw r24, r28 + 2110: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2114: 89 2b or r24, r25 + 2116: 41 f1 breq .+80 ; 0x2168 + 2118: 68 e5 ldi r22, 0x58 ; 88 + 211a: 75 e0 ldi r23, 0x05 ; 5 + 211c: ce 01 movw r24, r28 + 211e: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2122: 89 2b or r24, r25 + 2124: 19 f1 breq .+70 ; 0x216c + 2126: 68 e7 ldi r22, 0x78 ; 120 + 2128: 75 e0 ldi r23, 0x05 ; 5 + 212a: ce 01 movw r24, r28 + 212c: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2130: 89 2b or r24, r25 + 2132: f1 f0 breq .+60 ; 0x2170 + 2134: 68 e9 ldi r22, 0x98 ; 152 + 2136: 75 e0 ldi r23, 0x05 ; 5 + 2138: ce 01 movw r24, r28 + 213a: 0e 94 d5 2d call 0x5baa ; 0x5baa + 213e: 89 2b or r24, r25 + 2140: c9 f0 breq .+50 ; 0x2174 + return true; + } + } + + /* LED Func not found */ + return false; + 2142: 80 e0 ldi r24, 0x00 ; 0 +} + 2144: df 91 pop r29 + 2146: cf 91 pop r28 + 2148: 1f 91 pop r17 + 214a: 08 95 ret + +bool LEDSetFuncByName(uint8_t Mask, const char* FuncName) +{ + uint8_t i; + + for (i=0; i + return true; + 2152: 81 e0 ldi r24, 0x01 ; 1 + } + } + + /* LED Func not found */ + return false; +} + 2154: df 91 pop r29 + 2156: cf 91 pop r28 + 2158: 1f 91 pop r17 + 215a: 08 95 ret + +bool LEDSetFuncByName(uint8_t Mask, const char* FuncName) +{ + uint8_t i; + + for (i=0; i + 2160: 62 e0 ldi r22, 0x02 ; 2 + 2162: f5 cf rjmp .-22 ; 0x214e + 2164: 63 e0 ldi r22, 0x03 ; 3 + 2166: f3 cf rjmp .-26 ; 0x214e + 2168: 64 e0 ldi r22, 0x04 ; 4 + 216a: f1 cf rjmp .-30 ; 0x214e + 216c: 65 e0 ldi r22, 0x05 ; 5 + 216e: ef cf rjmp .-34 ; 0x214e + 2170: 66 e0 ldi r22, 0x06 ; 6 + 2172: ed cf rjmp .-38 ; 0x214e + if (strcmp_P(FuncName, LEDFuncTable[i]) == 0) { + 2174: 67 e0 ldi r22, 0x07 ; 7 + 2176: eb cf rjmp .-42 ; 0x214e + +00002178 : +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); + 2178: bc 01 movw r22, r24 + 217a: 80 e0 ldi r24, 0x00 ; 0 + 217c: 90 e2 ldi r25, 0x20 ; 32 + 217e: 0c 94 6c 2b jmp 0x56d8 ; 0x56d8 + +00002182 : +} + +void TerminalSendStringP(const char* s) { + 2182: cf 93 push r28 + 2184: df 93 push r29 + char c; + + while( (c = pgm_read_byte(s++)) != '\0' ) { + 2186: ec 01 movw r28, r24 + 2188: 21 96 adiw r28, 0x01 ; 1 + 218a: fc 01 movw r30, r24 + 218c: 64 91 lpm r22, Z + 218e: 66 23 and r22, r22 + 2190: 49 f0 breq .+18 ; 0x21a4 +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); } + 2192: 80 e0 ldi r24, 0x00 ; 0 + 2194: 90 e2 ldi r25, 0x20 ; 32 + 2196: 0e 94 bf 2b call 0x577e ; 0x577e + 219a: fe 01 movw r30, r28 + 219c: 21 96 adiw r28, 0x01 ; 1 + 219e: 64 91 lpm r22, Z + 21a0: 61 11 cpse r22, r1 + 21a2: f7 cf rjmp .-18 ; 0x2192 + TerminalSendChar(c); + } +} + 21a4: df 91 pop r29 + 21a6: cf 91 pop r28 + 21a8: 08 95 ret + +000021aa : +#endif + + + +void TerminalSendBlock(void* Buffer, uint16_t ByteCount) +{ + 21aa: ab 01 movw r20, r22 + CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); + 21ac: bc 01 movw r22, r24 + 21ae: 80 e0 ldi r24, 0x00 ; 0 + 21b0: 90 e2 ldi r25, 0x20 ; 32 + 21b2: 0c 94 95 2b jmp 0x572a ; 0x572a + +000021b6 : + } +} + +void TerminalInit(void) +{ + TERMINAL_VBUS_PORT.DIRCLR = TERMINAL_VBUS_MASK; + 21b6: 80 e2 ldi r24, 0x20 ; 32 + 21b8: e0 e6 ldi r30, 0x60 ; 96 + 21ba: f6 e0 ldi r31, 0x06 ; 6 + 21bc: 82 83 std Z+2, r24 ; 0x02 + 21be: 08 95 ret + +000021c0 : +} + +void TerminalTask(void) +{ + 21c0: cf 93 push r28 + 21c2: df 93 push r29 + if (TerminalState == TERMINAL_INITIALIZED) { + 21c4: 80 91 9a 28 lds r24, 0x289A + 21c8: 82 30 cpi r24, 0x02 ; 2 + 21ca: 19 f0 breq .+6 ; 0x21d2 + CDC_Device_USBTask(&TerminalHandle); + USB_USBTask(); + + ProcessByte(); + } +} + 21cc: df 91 pop r29 + 21ce: cf 91 pop r28 + 21d0: 08 95 ret +} + +void TerminalTask(void) +{ + if (TerminalState == TERMINAL_INITIALIZED) { + CDC_Device_USBTask(&TerminalHandle); + 21d2: 80 e0 ldi r24, 0x00 ; 0 + 21d4: 90 e2 ldi r25, 0x20 ; 32 + 21d6: 0e 94 3e 2c call 0x587c ; 0x587c + USB_USBTask(); + 21da: 0e 94 3f 26 call 0x4c7e ; 0x4c7e + CDC_Device_SendData(&TerminalHandle, Buffer, ByteCount); +} + + +static void ProcessByte(void) { + int16_t Byte = CDC_Device_ReceiveByte(&TerminalHandle); + 21de: 80 e0 ldi r24, 0x00 ; 0 + 21e0: 90 e2 ldi r25, 0x20 ; 32 + 21e2: 0e 94 59 2c call 0x58b2 ; 0x58b2 + 21e6: ec 01 movw r28, r24 + + if (Byte >= 0) { + 21e8: 97 fd sbrc r25, 7 + 21ea: f0 cf rjmp .-32 ; 0x21cc + /* Byte received */ + LEDTrigger(LED_TERMINAL_RXTX, LED_PULSE); + 21ec: 63 e1 ldi r22, 0x13 ; 19 + 21ee: 82 e0 ldi r24, 0x02 ; 2 + 21f0: b6 de rcall .-660 ; 0x1f5e + + if (XModemProcessByte(Byte)) { + 21f2: 8c 2f mov r24, r28 + 21f4: 15 d3 rcall .+1578 ; 0x2820 + 21f6: 81 11 cpse r24, r1 + 21f8: e9 cf rjmp .-46 ; 0x21cc + /* XModem handled the byte */ + } else if (CommandLineProcessByte(Byte)) { + 21fa: 8c 2f mov r24, r28 + CDC_Device_USBTask(&TerminalHandle); + USB_USBTask(); + + ProcessByte(); + } +} + 21fc: df 91 pop r29 + 21fe: cf 91 pop r28 + /* Byte received */ + LEDTrigger(LED_TERMINAL_RXTX, LED_PULSE); + + if (XModemProcessByte(Byte)) { + /* XModem handled the byte */ + } else if (CommandLineProcessByte(Byte)) { + 2200: 95 c4 rjmp .+2346 ; 0x2b2c + +00002202 : + } +} + +static void SenseVBus(void) +{ + switch(TerminalState) { + 2202: 80 91 9a 28 lds r24, 0x289A + 2206: 81 30 cpi r24, 0x01 ; 1 + 2208: 09 f1 breq .+66 ; 0x224c + 220a: 38 f0 brcs .+14 ; 0x221a + 220c: 82 30 cpi r24, 0x02 ; 2 + 220e: 71 f1 breq .+92 ; 0x226c + 2210: 83 30 cpi r24, 0x03 ; 3 + 2212: 71 f0 breq .+28 ; 0x2230 + +void TerminalTick(void) +{ + SenseVBus(); + + if (TerminalState == TERMINAL_INITIALIZED) { + 2214: 82 30 cpi r24, 0x02 ; 2 + 2216: 41 f1 breq .+80 ; 0x2268 + 2218: 08 95 ret + +static void SenseVBus(void) +{ + switch(TerminalState) { + case TERMINAL_UNINITIALIZED: + if (TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK) { + 221a: 80 91 68 06 lds r24, 0x0668 + 221e: 85 ff sbrs r24, 5 + 2220: fb cf rjmp .-10 ; 0x2218 + /* Not initialized and VBUS sense high */ + TerminalInitDelay = INIT_DELAY; + 2222: 84 e1 ldi r24, 0x14 ; 20 + 2224: 80 93 1b 20 sts 0x201B, r24 + TerminalState = TERMINAL_INITIALIZING; + 2228: 81 e0 ldi r24, 0x01 ; 1 + 222a: 80 93 9a 28 sts 0x289A, r24 + 222e: 08 95 ret + TerminalState = TERMINAL_UNITIALIZING; + } + break; + + case TERMINAL_UNITIALIZING: + if (--TerminalInitDelay == 0) { + 2230: 80 91 1b 20 lds r24, 0x201B + 2234: 81 50 subi r24, 0x01 ; 1 + 2236: 80 93 1b 20 sts 0x201B, r24 + 223a: 81 11 cpse r24, r1 + 223c: ed cf rjmp .-38 ; 0x2218 + USB_Disable(); + 223e: 0e 94 69 2a call 0x54d2 ; 0x54d2 + SystemStopUSBClock(); + 2242: 0e 94 87 05 call 0xb0e ; 0xb0e + TerminalState = TERMINAL_UNINITIALIZED; + 2246: 10 92 9a 28 sts 0x289A, r1 + 224a: 08 95 ret + TerminalState = TERMINAL_INITIALIZING; + } + break; + + case TERMINAL_INITIALIZING: + if (--TerminalInitDelay == 0) { + 224c: 80 91 1b 20 lds r24, 0x201B + 2250: 81 50 subi r24, 0x01 ; 1 + 2252: 80 93 1b 20 sts 0x201B, r24 + 2256: 81 11 cpse r24, r1 + 2258: df cf rjmp .-66 ; 0x2218 + SystemStartUSBClock(); + 225a: 0e 94 69 05 call 0xad2 ; 0xad2 + USB_Init(); + 225e: 0e 94 a4 2a call 0x5548 ; 0x5548 + TerminalState = TERMINAL_INITIALIZED; + 2262: 82 e0 ldi r24, 0x02 ; 2 + 2264: 80 93 9a 28 sts 0x289A, r24 +void TerminalTick(void) +{ + SenseVBus(); + + if (TerminalState == TERMINAL_INITIALIZED) { + XModemTick(); + 2268: 26 d4 rcall .+2124 ; 0x2ab6 + CommandLineTick(); + 226a: 67 c5 rjmp .+2766 ; 0x2d3a + TerminalState = TERMINAL_INITIALIZED; + } + break; + + case TERMINAL_INITIALIZED: + if (!(TERMINAL_VBUS_PORT.IN & TERMINAL_VBUS_MASK)) { + 226c: 80 91 68 06 lds r24, 0x0668 + 2270: 85 fd sbrc r24, 5 + 2272: fa cf rjmp .-12 ; 0x2268 + /* Initialized and VBUS sense low */ + TerminalInitDelay = INIT_DELAY; + 2274: 84 e1 ldi r24, 0x14 ; 20 + 2276: 80 93 1b 20 sts 0x201B, r24 + TerminalState = TERMINAL_UNITIALIZING; + 227a: 83 e0 ldi r24, 0x03 ; 3 + 227c: 80 93 9a 28 sts 0x289A, r24 + 2280: 08 95 ret + +00002282 : +} + +/** Event handler for the library USB Connection event. */ +void EVENT_USB_Device_Connect(void) +{ + LEDTrigger(LED_TERMINAL_CONN, LED_ON); + 2282: 61 e1 ldi r22, 0x11 ; 17 + 2284: 81 e0 ldi r24, 0x01 ; 1 + 2286: 6b ce rjmp .-810 ; 0x1f5e + +00002288 : +} + +/** Event handler for the library USB Disconnection event. */ +void EVENT_USB_Device_Disconnect(void) +{ + LEDTrigger(LED_TERMINAL_CONN, LED_OFF); + 2288: 60 e1 ldi r22, 0x10 ; 16 + 228a: 81 e0 ldi r24, 0x01 ; 1 + 228c: 68 ce rjmp .-816 ; 0x1f5e + +0000228e : + + +/** Event handler for the library USB Configuration Changed event. */ +void EVENT_USB_Device_ConfigurationChanged(void) +{ + CDC_Device_ConfigureEndpoints(&TerminalHandle); + 228e: 80 e0 ldi r24, 0x00 ; 0 + 2290: 90 e2 ldi r25, 0x20 ; 32 + 2292: 0c 94 47 2b jmp 0x568e ; 0x568e + +00002296 : +} + +/** Event handler for the library USB Control Request reception event. */ +void EVENT_USB_Device_ControlRequest(void) +{ + CDC_Device_ProcessControlRequest(&TerminalHandle); + 2296: 80 e0 ldi r24, 0x00 ; 0 + 2298: 90 e2 ldi r25, 0x20 ; 32 + 229a: 0c 94 b9 2c jmp 0x5972 ; 0x5972 + +0000229e : + +extern const PROGMEM CommandEntryType CommandTable[]; + +CommandStatusIdType CommandGetVersion(char* OutParam) +{ + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR( + 229e: 2f ef ldi r18, 0xFF ; 255 + 22a0: 35 e0 ldi r19, 0x05 ; 5 + 22a2: 3f 93 push r19 + 22a4: 2f 93 push r18 + 22a6: 28 ef ldi r18, 0xF8 ; 248 + 22a8: 35 e0 ldi r19, 0x05 ; 5 + 22aa: 3f 93 push r19 + 22ac: 2f 93 push r18 + 22ae: 21 ef ldi r18, 0xF1 ; 241 + 22b0: 35 e0 ldi r19, 0x05 ; 5 + 22b2: 3f 93 push r19 + 22b4: 2f 93 push r18 + 22b6: 28 eb ldi r18, 0xB8 ; 184 + 22b8: 35 e0 ldi r19, 0x05 ; 5 + 22ba: 3f 93 push r19 + 22bc: 2f 93 push r18 + 22be: 21 e0 ldi r18, 0x01 ; 1 + 22c0: 2f 93 push r18 + 22c2: 1f 92 push r1 + 22c4: 9f 93 push r25 + 22c6: 8f 93 push r24 + 22c8: 0e 94 06 2e call 0x5c0c ; 0x5c0c + "Chameleon-Mini %S using LUFA %S compiled with AVR-GCC %S" + ), PSTR(CHAMELEON_MINI_VERSION_STRING), PSTR(LUFA_VERSION_STRING), PSTR(__VERSION__) + ); + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 22cc: 8d b7 in r24, 0x3d ; 61 + 22ce: 9e b7 in r25, 0x3e ; 62 + 22d0: 0c 96 adiw r24, 0x0c ; 12 + 22d2: 8d bf out 0x3d, r24 ; 61 + 22d4: 9e bf out 0x3e, r25 ; 62 +} + 22d6: 85 e6 ldi r24, 0x65 ; 101 + 22d8: 08 95 ret + +000022da : + +CommandStatusIdType CommandGetConfig(char* OutParam) +{ + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, + 22da: 23 ee ldi r18, 0xE3 ; 227 + 22dc: 38 e2 ldi r19, 0x28 ; 40 + 22de: 3f 93 push r19 + 22e0: 2f 93 push r18 + 22e2: 25 e0 ldi r18, 0x05 ; 5 + 22e4: 36 e0 ldi r19, 0x06 ; 6 + 22e6: 3f 93 push r19 + 22e8: 2f 93 push r18 + 22ea: 21 e0 ldi r18, 0x01 ; 1 + 22ec: 2f 93 push r18 + 22ee: 1f 92 push r1 + 22f0: 9f 93 push r25 + 22f2: 8f 93 push r24 + 22f4: 0e 94 06 2e call 0x5c0c ; 0x5c0c + PSTR("%s"), ActiveConfiguration.ConfigurationName); + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 22f8: 8d b7 in r24, 0x3d ; 61 + 22fa: 9e b7 in r25, 0x3e ; 62 + 22fc: 08 96 adiw r24, 0x08 ; 8 + 22fe: 8d bf out 0x3d, r24 ; 61 + 2300: 9e bf out 0x3e, r25 ; 62 + +} + 2302: 85 e6 ldi r24, 0x65 ; 101 + 2304: 08 95 ret + +00002306 : + +CommandStatusIdType CommandSetConfig(const char* InParam) +{ + if (ConfigurationSetByName(InParam)) { + 2306: 0e 94 cb 05 call 0xb96 ; 0xb96 + 230a: 81 11 cpse r24, r1 + 230c: 02 c0 rjmp .+4 ; 0x2312 + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 230e: 8a ec ldi r24, 0xCA ; 202 + } +} + 2310: 08 95 ret +} + +CommandStatusIdType CommandSetConfig(const char* InParam) +{ + if (ConfigurationSetByName(InParam)) { + SettingsSave(); + 2312: b2 dc rcall .-1692 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 2314: 84 e6 ldi r24, 0x64 ; 100 + 2316: 08 95 ret + +00002318 : + } +} + +CommandStatusIdType CommandExecConfig(char* OutMessage) +{ + ConfigurationGetList(OutMessage, TERMINAL_BUFFER_SIZE); + 2318: 60 e0 ldi r22, 0x00 ; 0 + 231a: 71 e0 ldi r23, 0x01 ; 1 + 231c: 0e 94 0c 06 call 0xc18 ; 0xc18 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2320: 85 e6 ldi r24, 0x65 ; 101 + 2322: 08 95 ret + +00002324 : + +CommandStatusIdType CommandGetUid(char* OutParam) +{ + 2324: 0f 93 push r16 + 2326: 1f 93 push r17 + 2328: cf 93 push r28 + 232a: df 93 push r29 + 232c: cd b7 in r28, 0x3d ; 61 + 232e: de b7 in r29, 0x3e ; 62 + 2330: a1 97 sbiw r28, 0x21 ; 33 + 2332: cd bf out 0x3d, r28 ; 61 + 2334: de bf out 0x3e, r29 ; 62 + 2336: 8c 01 movw r16, r24 + uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; + uint16_t UidSize = ActiveConfiguration.UidSize; + 2338: 20 91 05 29 lds r18, 0x2905 + ActiveConfiguration.ApplicationResetFunc(); + //LogEntry(LOG_INFO_APP_RESET, NULL, 0); +} + +INLINE void ApplicationGetUid(ConfigurationUidType Uid) { + ActiveConfiguration.ApplicationGetUidFunc(Uid); + 233c: e0 91 ff 28 lds r30, 0x28FF + 2340: f0 91 00 29 lds r31, 0x2900 + 2344: ce 01 movw r24, r28 + 2346: 01 96 adiw r24, 0x01 ; 1 + 2348: 29 a3 std Y+33, r18 ; 0x21 + 234a: 09 95 icall + + ApplicationGetUid(UidBuffer); + + BufferToHexString(OutParam, TERMINAL_BUFFER_SIZE, + 234c: 29 a1 ldd r18, Y+33 ; 0x21 + 234e: 30 e0 ldi r19, 0x00 ; 0 + 2350: ae 01 movw r20, r28 + 2352: 4f 5f subi r20, 0xFF ; 255 + 2354: 5f 4f sbci r21, 0xFF ; 255 + 2356: 60 e0 ldi r22, 0x00 ; 0 + 2358: 71 e0 ldi r23, 0x01 ; 1 + 235a: c8 01 movw r24, r16 + 235c: 0e 94 56 06 call 0xcac ; 0xcac + UidBuffer, UidSize); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2360: 85 e6 ldi r24, 0x65 ; 101 + 2362: a1 96 adiw r28, 0x21 ; 33 + 2364: cd bf out 0x3d, r28 ; 61 + 2366: de bf out 0x3e, r29 ; 62 + 2368: df 91 pop r29 + 236a: cf 91 pop r28 + 236c: 1f 91 pop r17 + 236e: 0f 91 pop r16 + 2370: 08 95 ret + +00002372 : + +CommandStatusIdType CommandSetUid(const char* InParam) +{ + 2372: bf 92 push r11 + 2374: cf 92 push r12 + 2376: df 92 push r13 + 2378: ef 92 push r14 + 237a: ff 92 push r15 + 237c: 0f 93 push r16 + 237e: 1f 93 push r17 + 2380: cf 93 push r28 + 2382: df 93 push r29 + 2384: cd b7 in r28, 0x3d ; 61 + 2386: de b7 in r29, 0x3e ; 62 + 2388: a0 97 sbiw r28, 0x20 ; 32 + 238a: cd bf out 0x3d, r28 ; 61 + 238c: de bf out 0x3e, r29 ; 62 + 238e: 8c 01 movw r16, r24 + uint8_t UidBuffer[COMMAND_UID_BUFSIZE]; + uint16_t UidSize = ActiveConfiguration.UidSize; + 2390: c0 90 05 29 lds r12, 0x2905 + 2394: d1 2c mov r13, r1 + + if (strcmp_P(InParam, PSTR(COMMAND_UID_RANDOM)) == 0) { + 2396: 68 e0 ldi r22, 0x08 ; 8 + 2398: 76 e0 ldi r23, 0x06 ; 6 + 239a: 0e 94 d5 2d call 0x5baa ; 0x5baa + 239e: 89 2b or r24, r25 + 23a0: 59 f5 brne .+86 ; 0x23f8 + /* Load with random bytes */ + for (uint8_t i=0; i + 23a8: b1 2c mov r11, r1 + 23aa: ee 24 eor r14, r14 + 23ac: e3 94 inc r14 + 23ae: f1 2c mov r15, r1 + 23b0: ec 0e add r14, r28 + 23b2: fd 1e adc r15, r29 + 23b4: 00 e0 ldi r16, 0x00 ; 0 + 23b6: 10 e0 ldi r17, 0x00 ; 0 + UidBuffer[i] = RandomGetByte(); + 23b8: 0e 94 3c 06 call 0xc78 ; 0xc78 + 23bc: f7 01 movw r30, r14 + 23be: e0 0f add r30, r16 + 23c0: f1 1f adc r31, r17 + 23c2: 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); + 23d0: e0 91 01 29 lds r30, 0x2901 + 23d4: f0 91 02 29 lds r31, 0x2902 + 23d8: c7 01 movw r24, r14 + 23da: 09 95 icall + } + } + + ApplicationSetUid(UidBuffer); + + return COMMAND_INFO_OK_ID; + 23dc: 84 e6 ldi r24, 0x64 ; 100 +} + 23de: a0 96 adiw r28, 0x20 ; 32 + 23e0: cd bf out 0x3d, r28 ; 61 + 23e2: de bf out 0x3e, r29 ; 62 + 23e4: df 91 pop r29 + 23e6: cf 91 pop r28 + 23e8: 1f 91 pop r17 + 23ea: 0f 91 pop r16 + 23ec: ff 90 pop r15 + 23ee: ef 90 pop r14 + 23f0: df 90 pop r13 + 23f2: cf 90 pop r12 + 23f4: bf 90 pop r11 + 23f6: 08 95 ret + for (uint8_t i=0; i + 240e: 8c 15 cp r24, r12 + 2410: 9d 05 cpc r25, r13 + 2412: f1 f2 breq .-68 ; 0x23d0 + /* Malformed input. Abort */ + return COMMAND_ERR_INVALID_PARAM_ID; + 2414: 8a ec ldi r24, 0xCA ; 202 + 2416: e3 cf rjmp .-58 ; 0x23de + 2418: ee 24 eor r14, r14 + 241a: e3 94 inc r14 + 241c: f1 2c mov r15, r1 + 241e: ec 0e add r14, r28 + 2420: fd 1e adc r15, r29 + 2422: d6 cf rjmp .-84 ; 0x23d0 + +00002424 : + return COMMAND_INFO_OK_ID; +} + +CommandStatusIdType CommandGetReadOnly(char* OutParam) +{ + if (ActiveConfiguration.ReadOnly) { + 2424: 20 91 06 29 lds r18, 0x2906 + 2428: 21 11 cpse r18, r1 + 242a: 07 c0 rjmp .+14 ; 0x243a + OutParam[0] = COMMAND_CHAR_TRUE; + } else { + OutParam[0] = COMMAND_CHAR_FALSE; + 242c: 20 e3 ldi r18, 0x30 ; 48 + 242e: fc 01 movw r30, r24 + 2430: 20 83 st Z, r18 + } + + OutParam[1] = '\0'; + 2432: fc 01 movw r30, r24 + 2434: 11 82 std Z+1, r1 ; 0x01 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2436: 85 e6 ldi r24, 0x65 ; 101 + 2438: 08 95 ret +} + +CommandStatusIdType CommandGetReadOnly(char* OutParam) +{ + if (ActiveConfiguration.ReadOnly) { + OutParam[0] = COMMAND_CHAR_TRUE; + 243a: 21 e3 ldi r18, 0x31 ; 49 + 243c: fc 01 movw r30, r24 + 243e: 20 83 st Z, r18 + } else { + OutParam[0] = COMMAND_CHAR_FALSE; + } + + OutParam[1] = '\0'; + 2440: fc 01 movw r30, r24 + 2442: 11 82 std Z+1, r1 ; 0x01 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2444: 85 e6 ldi r24, 0x65 ; 101 + 2446: 08 95 ret + +00002448 : + +CommandStatusIdType CommandSetReadOnly(const char* InParam) +{ + if (InParam[1] == '\0') { + 2448: fc 01 movw r30, r24 + 244a: 21 81 ldd r18, Z+1 ; 0x01 + 244c: 21 11 cpse r18, r1 + 244e: 05 c0 rjmp .+10 ; 0x245a + if (InParam[0] == COMMAND_CHAR_TRUE) { + 2450: 80 81 ld r24, Z + 2452: 81 33 cpi r24, 0x31 ; 49 + 2454: 41 f0 breq .+16 ; 0x2466 + ActiveConfiguration.ReadOnly = true; + return COMMAND_INFO_OK_ID; + } else if (InParam[0] == COMMAND_CHAR_FALSE) { + 2456: 80 33 cpi r24, 0x30 ; 48 + 2458: 11 f0 breq .+4 ; 0x245e + ActiveConfiguration.ReadOnly = false; + return COMMAND_INFO_OK_ID; + } + } + + return COMMAND_ERR_INVALID_PARAM_ID; + 245a: 8a ec ldi r24, 0xCA ; 202 +} + 245c: 08 95 ret + if (InParam[1] == '\0') { + if (InParam[0] == COMMAND_CHAR_TRUE) { + ActiveConfiguration.ReadOnly = true; + return COMMAND_INFO_OK_ID; + } else if (InParam[0] == COMMAND_CHAR_FALSE) { + ActiveConfiguration.ReadOnly = false; + 245e: 10 92 06 29 sts 0x2906, r1 + return COMMAND_INFO_OK_ID; + 2462: 84 e6 ldi r24, 0x64 ; 100 + 2464: 08 95 ret + +CommandStatusIdType CommandSetReadOnly(const char* InParam) +{ + if (InParam[1] == '\0') { + if (InParam[0] == COMMAND_CHAR_TRUE) { + ActiveConfiguration.ReadOnly = true; + 2466: 81 e0 ldi r24, 0x01 ; 1 + 2468: 80 93 06 29 sts 0x2906, r24 + return COMMAND_INFO_OK_ID; + 246c: 84 e6 ldi r24, 0x64 ; 100 + 246e: 08 95 ret + +00002470 : + return COMMAND_ERR_INVALID_PARAM_ID; +} + +CommandStatusIdType CommandExecUpload(char* OutMessage) +{ + XModemReceive(MemoryUploadBlock); + 2470: 86 e5 ldi r24, 0x56 ; 86 + 2472: 99 e0 ldi r25, 0x09 ; 9 + 2474: a4 d1 rcall .+840 ; 0x27be + return COMMAND_INFO_XMODEM_WAIT_ID; +} + 2476: 8e e6 ldi r24, 0x6E ; 110 + 2478: 08 95 ret + +0000247a : + +CommandStatusIdType CommandExecDownload(char* OutMessage) +{ + XModemSend(MemoryDownloadBlock); + 247a: 8b e1 ldi r24, 0x1B ; 27 + 247c: 9b e0 ldi r25, 0x0B ; 11 + 247e: ba d1 rcall .+884 ; 0x27f4 + return COMMAND_INFO_XMODEM_WAIT_ID; +} + 2480: 8e e6 ldi r24, 0x6E ; 110 + 2482: 08 95 ret + +00002484 : + * 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; + 2484: e0 ec ldi r30, 0xC0 ; 192 + 2486: f4 e0 ldi r31, 0x04 ; 4 + 2488: 81 81 ldd r24, Z+1 ; 0x01 + 248a: 8e 7f andi r24, 0xFE ; 254 + 248c: 81 83 std Z+1, r24 ; 0x01 + +CommandStatusIdType CommandExecReset(char* OutMessage) +{ + USB_Detach(); + USB_Disable(); + 248e: 0e 94 69 2a call 0x54d2 ; 0x54d2 + + SystemReset(); + 2492: 0e 94 5c 05 call 0xab8 ; 0xab8 + + return COMMAND_INFO_OK_ID; +} + 2496: 84 e6 ldi r24, 0x64 ; 100 + 2498: 08 95 ret + +0000249a : + 249a: e0 ec ldi r30, 0xC0 ; 192 + 249c: f4 e0 ldi r31, 0x04 ; 4 + 249e: 81 81 ldd r24, Z+1 ; 0x01 + 24a0: 8e 7f andi r24, 0xFE ; 254 + 24a2: 81 83 std Z+1, r24 ; 0x01 + +#ifdef SUPPORT_FIRMWARE_UPGRADE +CommandStatusIdType CommandExecUpgrade(char* OutMessage) +{ + USB_Detach(); + USB_Disable(); + 24a4: 0e 94 69 2a call 0x54d2 ; 0x54d2 + + SystemEnterBootloader(); + 24a8: 0e 94 63 05 call 0xac6 ; 0xac6 + + return COMMAND_INFO_OK_ID; +} + 24ac: 84 e6 ldi r24, 0x64 ; 100 + 24ae: 08 95 ret + +000024b0 : +#endif + +CommandStatusIdType CommandGetMemSize(char* OutParam) +{ + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.MemorySize); + 24b0: e3 e0 ldi r30, 0x03 ; 3 + 24b2: f9 e2 ldi r31, 0x29 ; 41 + 24b4: 21 81 ldd r18, Z+1 ; 0x01 + 24b6: 2f 93 push r18 + 24b8: 20 81 ld r18, Z + 24ba: 2f 93 push r18 + 24bc: 2f e0 ldi r18, 0x0F ; 15 + 24be: 36 e0 ldi r19, 0x06 ; 6 + 24c0: 3f 93 push r19 + 24c2: 2f 93 push r18 + 24c4: 21 e0 ldi r18, 0x01 ; 1 + 24c6: 2f 93 push r18 + 24c8: 1f 92 push r1 + 24ca: 9f 93 push r25 + 24cc: 8f 93 push r24 + 24ce: 0e 94 06 2e call 0x5c0c ; 0x5c0c + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 24d2: 8d b7 in r24, 0x3d ; 61 + 24d4: 9e b7 in r25, 0x3e ; 62 + 24d6: 08 96 adiw r24, 0x08 ; 8 + 24d8: 8d bf out 0x3d, r24 ; 61 + 24da: 9e bf out 0x3e, r25 ; 62 +} + 24dc: 85 e6 ldi r24, 0x65 ; 101 + 24de: 08 95 ret + +000024e0 : + +CommandStatusIdType CommandGetUidSize(char* OutParam) +{ + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("%u"), ActiveConfiguration.UidSize); + 24e0: 20 91 05 29 lds r18, 0x2905 + 24e4: 1f 92 push r1 + 24e6: 2f 93 push r18 + 24e8: 22 e1 ldi r18, 0x12 ; 18 + 24ea: 36 e0 ldi r19, 0x06 ; 6 + 24ec: 3f 93 push r19 + 24ee: 2f 93 push r18 + 24f0: 21 e0 ldi r18, 0x01 ; 1 + 24f2: 2f 93 push r18 + 24f4: 1f 92 push r1 + 24f6: 9f 93 push r25 + 24f8: 8f 93 push r24 + 24fa: 0e 94 06 2e call 0x5c0c ; 0x5c0c + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 24fe: 8d b7 in r24, 0x3d ; 61 + 2500: 9e b7 in r25, 0x3e ; 62 + 2502: 08 96 adiw r24, 0x08 ; 8 + 2504: 8d bf out 0x3d, r24 ; 61 + 2506: 9e bf out 0x3e, r25 ; 62 +} + 2508: 85 e6 ldi r24, 0x65 ; 101 + 250a: 08 95 ret + +0000250c : + +CommandStatusIdType CommandExecButton(char* OutMessage) +{ + ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); + 250c: 60 e0 ldi r22, 0x00 ; 0 + 250e: 71 e0 ldi r23, 0x01 ; 1 + 2510: d0 d9 rcall .-3168 ; 0x18b2 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2512: 85 e6 ldi r24, 0x65 ; 101 + 2514: 08 95 ret + +00002516 : + +CommandStatusIdType CommandGetButton(char* OutParam) +{ + ButtonGetActionByName(BUTTON_PRESS_SHORT, OutParam, TERMINAL_BUFFER_SIZE); + 2516: 40 e0 ldi r20, 0x00 ; 0 + 2518: 51 e0 ldi r21, 0x01 ; 1 + 251a: bc 01 movw r22, r24 + 251c: 80 e0 ldi r24, 0x00 ; 0 + 251e: 22 da rcall .-3004 ; 0x1964 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2520: 85 e6 ldi r24, 0x65 ; 101 + 2522: 08 95 ret + +00002524 : + +CommandStatusIdType CommandSetButton(const char* InParam) +{ + if (ButtonSetActionByName(BUTTON_PRESS_SHORT, InParam)) { + 2524: bc 01 movw r22, r24 + 2526: 80 e0 ldi r24, 0x00 ; 0 + 2528: 39 da rcall .-2958 ; 0x199c + 252a: 81 11 cpse r24, r1 + 252c: 02 c0 rjmp .+4 ; 0x2532 + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 252e: 8a ec ldi r24, 0xCA ; 202 + } +} + 2530: 08 95 ret +} + +CommandStatusIdType CommandSetButton(const char* InParam) +{ + if (ButtonSetActionByName(BUTTON_PRESS_SHORT, InParam)) { + SettingsSave(); + 2532: a2 db rcall .-2236 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 2534: 84 e6 ldi r24, 0x64 ; 100 + 2536: 08 95 ret + +00002538 : + } +} + +CommandStatusIdType CommandExecButtonLong(char* OutMessage) +{ + ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); + 2538: 60 e0 ldi r22, 0x00 ; 0 + 253a: 71 e0 ldi r23, 0x01 ; 1 + 253c: ba d9 rcall .-3212 ; 0x18b2 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 253e: 85 e6 ldi r24, 0x65 ; 101 + 2540: 08 95 ret + +00002542 : + +CommandStatusIdType CommandGetButtonLong(char* OutParam) +{ + ButtonGetActionByName(BUTTON_PRESS_LONG, OutParam, TERMINAL_BUFFER_SIZE); + 2542: 40 e0 ldi r20, 0x00 ; 0 + 2544: 51 e0 ldi r21, 0x01 ; 1 + 2546: bc 01 movw r22, r24 + 2548: 81 e0 ldi r24, 0x01 ; 1 + 254a: 0c da rcall .-3048 ; 0x1964 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 254c: 85 e6 ldi r24, 0x65 ; 101 + 254e: 08 95 ret + +00002550 : + +CommandStatusIdType CommandSetButtonLong(const char* InParam) +{ + if (ButtonSetActionByName(BUTTON_PRESS_LONG, InParam)) { + 2550: bc 01 movw r22, r24 + 2552: 81 e0 ldi r24, 0x01 ; 1 + 2554: 23 da rcall .-3002 ; 0x199c + 2556: 81 11 cpse r24, r1 + 2558: 02 c0 rjmp .+4 ; 0x255e + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 255a: 8a ec ldi r24, 0xCA ; 202 + } +} + 255c: 08 95 ret +} + +CommandStatusIdType CommandSetButtonLong(const char* InParam) +{ + if (ButtonSetActionByName(BUTTON_PRESS_LONG, InParam)) { + SettingsSave(); + 255e: 8c db rcall .-2280 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 2560: 84 e6 ldi r24, 0x64 ; 100 + 2562: 08 95 ret + +00002564 : + } +} + +CommandStatusIdType CommandExecLedGreen(char* OutMessage) +{ + LEDGetFuncList(OutMessage, TERMINAL_BUFFER_SIZE); + 2564: 60 e0 ldi r22, 0x00 ; 0 + 2566: 71 e0 ldi r23, 0x01 ; 1 + 2568: 0a dd rcall .-1516 ; 0x1f7e + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 256a: 85 e6 ldi r24, 0x65 ; 101 + 256c: 08 95 ret + +0000256e : + +CommandStatusIdType CommandGetLedGreen(char* OutParam) +{ + LEDGetFuncByName(LED_GREEN, OutParam, TERMINAL_BUFFER_SIZE); + 256e: 40 e0 ldi r20, 0x00 ; 0 + 2570: 51 e0 ldi r21, 0x01 ; 1 + 2572: bc 01 movw r22, r24 + 2574: 80 e2 ldi r24, 0x20 ; 32 + 2576: 8b dd rcall .-1258 ; 0x208e + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2578: 85 e6 ldi r24, 0x65 ; 101 + 257a: 08 95 ret + +0000257c : + +CommandStatusIdType CommandSetLedGreen(const char* InParam) +{ + if (LEDSetFuncByName(LED_GREEN, InParam)) { + 257c: bc 01 movw r22, r24 + 257e: 80 e2 ldi r24, 0x20 ; 32 + 2580: a3 dd rcall .-1210 ; 0x20c8 + 2582: 81 11 cpse r24, r1 + 2584: 02 c0 rjmp .+4 ; 0x258a + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 2586: 8a ec ldi r24, 0xCA ; 202 + } +} + 2588: 08 95 ret +} + +CommandStatusIdType CommandSetLedGreen(const char* InParam) +{ + if (LEDSetFuncByName(LED_GREEN, InParam)) { + SettingsSave(); + 258a: 76 db rcall .-2324 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 258c: 84 e6 ldi r24, 0x64 ; 100 + 258e: 08 95 ret + +00002590 : + } +} + +CommandStatusIdType CommandExecLedRed(char* OutMessage) +{ + LEDGetFuncList(OutMessage, TERMINAL_BUFFER_SIZE); + 2590: 60 e0 ldi r22, 0x00 ; 0 + 2592: 71 e0 ldi r23, 0x01 ; 1 + 2594: f4 dc rcall .-1560 ; 0x1f7e + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 2596: 85 e6 ldi r24, 0x65 ; 101 + 2598: 08 95 ret + +0000259a : + +CommandStatusIdType CommandGetLedRed(char* OutParam) +{ + LEDGetFuncByName(LED_RED, OutParam, TERMINAL_BUFFER_SIZE); + 259a: 40 e0 ldi r20, 0x00 ; 0 + 259c: 51 e0 ldi r21, 0x01 ; 1 + 259e: bc 01 movw r22, r24 + 25a0: 80 e1 ldi r24, 0x10 ; 16 + 25a2: 75 dd rcall .-1302 ; 0x208e + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 25a4: 85 e6 ldi r24, 0x65 ; 101 + 25a6: 08 95 ret + +000025a8 : + +CommandStatusIdType CommandSetLedRed(const char* InParam) +{ + if (LEDSetFuncByName(LED_RED, InParam)) { + 25a8: bc 01 movw r22, r24 + 25aa: 80 e1 ldi r24, 0x10 ; 16 + 25ac: 8d dd rcall .-1254 ; 0x20c8 + 25ae: 81 11 cpse r24, r1 + 25b0: 02 c0 rjmp .+4 ; 0x25b6 + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 25b2: 8a ec ldi r24, 0xCA ; 202 + } +} + 25b4: 08 95 ret +} + +CommandStatusIdType CommandSetLedRed(const char* InParam) +{ + if (LEDSetFuncByName(LED_RED, InParam)) { + SettingsSave(); + 25b6: 60 db rcall .-2368 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 25b8: 84 e6 ldi r24, 0x64 ; 100 + 25ba: 08 95 ret + +000025bc : +} + +CommandStatusIdType CommandExecLogMode(char* OutMessage) +{ + /* Get list of log modes */ + LogGetModeList(OutMessage, TERMINAL_BUFFER_SIZE); + 25bc: 60 e0 ldi r22, 0x00 ; 0 + 25be: 71 e0 ldi r23, 0x01 ; 1 + 25c0: 2b db rcall .-2474 ; 0x1c18 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 25c2: 85 e6 ldi r24, 0x65 ; 101 + 25c4: 08 95 ret + +000025c6 : + +CommandStatusIdType CommandGetLogMode(char* OutParam) +{ + /* Get Logmode */ + LogGetModeByName(OutParam, TERMINAL_BUFFER_SIZE); + 25c6: 60 e0 ldi r22, 0x00 ; 0 + 25c8: 71 e0 ldi r23, 0x01 ; 1 + 25ca: 18 db rcall .-2512 ; 0x1bfc + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 25cc: 85 e6 ldi r24, 0x65 ; 101 + 25ce: 08 95 ret + +000025d0 : + +CommandStatusIdType CommandSetLogMode(const char* InParam) +{ + if (LogSetModeByName(InParam)) { + 25d0: f0 da rcall .-2592 ; 0x1bb2 + 25d2: 81 11 cpse r24, r1 + 25d4: 02 c0 rjmp .+4 ; 0x25da + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 25d6: 8a ec ldi r24, 0xCA ; 202 + } +} + 25d8: 08 95 ret +} + +CommandStatusIdType CommandSetLogMode(const char* InParam) +{ + if (LogSetModeByName(InParam)) { + SettingsSave(); + 25da: 4e db rcall .-2404 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 25dc: 84 e6 ldi r24, 0x64 ; 100 + 25de: 08 95 ret + +000025e0 : + } +} + +CommandStatusIdType CommandExecLogMem(char* OutMessage) +{ + snprintf_P(OutMessage, TERMINAL_BUFFER_SIZE, + 25e0: 23 e2 ldi r18, 0x23 ; 35 + 25e2: 36 e0 ldi r19, 0x06 ; 6 + 25e4: 3f 93 push r19 + 25e6: 2f 93 push r18 + 25e8: 2b e1 ldi r18, 0x1B ; 27 + 25ea: 36 e0 ldi r19, 0x06 ; 6 + 25ec: 3f 93 push r19 + 25ee: 2f 93 push r18 + 25f0: 25 e1 ldi r18, 0x15 ; 21 + 25f2: 36 e0 ldi r19, 0x06 ; 6 + 25f4: 3f 93 push r19 + 25f6: 2f 93 push r18 + 25f8: 21 e0 ldi r18, 0x01 ; 1 + 25fa: 2f 93 push r18 + 25fc: 1f 92 push r1 + 25fe: 9f 93 push r25 + 2600: 8f 93 push r24 + 2602: 0e 94 06 2e call 0x5c0c ; 0x5c0c + PSTR("%S,%S"), PSTR(COMMAND_LOGMEM_LOADBIN), PSTR(COMMAND_LOGMEM_CLEAR) ); + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 2606: 8d b7 in r24, 0x3d ; 61 + 2608: 9e b7 in r25, 0x3e ; 62 + 260a: 0a 96 adiw r24, 0x0a ; 10 + 260c: 8d bf out 0x3d, r24 ; 61 + 260e: 9e bf out 0x3e, r25 ; 62 +} + 2610: 85 e6 ldi r24, 0x65 ; 101 + 2612: 08 95 ret + +00002614 : + +CommandStatusIdType CommandGetLogMem(char* OutParam) +{ + 2614: cf 93 push r28 + 2616: df 93 push r29 + 2618: ec 01 movw r28, r24 + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, + 261a: 68 da rcall .-2864 ; 0x1aec + 261c: 9f 93 push r25 + 261e: 8f 93 push r24 + 2620: 29 e2 ldi r18, 0x29 ; 41 + 2622: 36 e0 ldi r19, 0x06 ; 6 + 2624: 3f 93 push r19 + 2626: 2f 93 push r18 + 2628: 81 e0 ldi r24, 0x01 ; 1 + 262a: 8f 93 push r24 + 262c: 1f 92 push r1 + 262e: df 93 push r29 + 2630: cf 93 push r28 + 2632: 0e 94 06 2e call 0x5c0c ; 0x5c0c + PSTR("%u"), LogMemFree()); + + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 2636: 8d b7 in r24, 0x3d ; 61 + 2638: 9e b7 in r25, 0x3e ; 62 + 263a: 08 96 adiw r24, 0x08 ; 8 + 263c: 8d bf out 0x3d, r24 ; 61 + 263e: 9e bf out 0x3e, r25 ; 62 +} + 2640: 85 e6 ldi r24, 0x65 ; 101 + 2642: df 91 pop r29 + 2644: cf 91 pop r28 + 2646: 08 95 ret + +00002648 : + +CommandStatusIdType CommandSetLogMem(const char* InParam) +{ + 2648: cf 93 push r28 + 264a: df 93 push r29 + 264c: ec 01 movw r28, r24 + if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_LOADBIN)) == 0) { + 264e: 6c e2 ldi r22, 0x2C ; 44 + 2650: 76 e0 ldi r23, 0x06 ; 6 + 2652: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2656: 89 2b or r24, r25 + 2658: 81 f0 breq .+32 ; 0x267a + XModemSend(LogMemLoadBlock); + return COMMAND_INFO_XMODEM_WAIT_ID; + } else if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_CLEAR)) == 0) { + 265a: 64 e3 ldi r22, 0x34 ; 52 + 265c: 76 e0 ldi r23, 0x06 ; 6 + 265e: ce 01 movw r24, r28 + 2660: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2664: 89 2b or r24, r25 + 2666: 21 f0 breq .+8 ; 0x2670 + LogMemClear(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 2668: 8a ec ldi r24, 0xCA ; 202 + } +} + 266a: df 91 pop r29 + 266c: cf 91 pop r28 + 266e: 08 95 ret +{ + if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_LOADBIN)) == 0) { + XModemSend(LogMemLoadBlock); + return COMMAND_INFO_XMODEM_WAIT_ID; + } else if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_CLEAR)) == 0) { + LogMemClear(); + 2670: 28 da rcall .-2992 ; 0x1ac2 + return COMMAND_INFO_OK_ID; + 2672: 84 e6 ldi r24, 0x64 ; 100 + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + 2674: df 91 pop r29 + 2676: cf 91 pop r28 + 2678: 08 95 ret +} + +CommandStatusIdType CommandSetLogMem(const char* InParam) +{ + if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_LOADBIN)) == 0) { + XModemSend(LogMemLoadBlock); + 267a: 89 e4 ldi r24, 0x49 ; 73 + 267c: 9d e0 ldi r25, 0x0D ; 13 + 267e: ba d0 rcall .+372 ; 0x27f4 + return COMMAND_INFO_XMODEM_WAIT_ID; + 2680: 8e e6 ldi r24, 0x6E ; 110 + LogMemClear(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + 2682: df 91 pop r29 + 2684: cf 91 pop r28 + 2686: 08 95 ret + +00002688 : + +CommandStatusIdType CommandGetSetting(char* OutParam) +{ + SettingsGetActiveByName(OutParam, TERMINAL_BUFFER_SIZE); + 2688: 60 e0 ldi r22, 0x00 ; 0 + 268a: 71 e0 ldi r23, 0x01 ; 1 + 268c: c3 db rcall .-2170 ; 0x1e14 + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 268e: 85 e6 ldi r24, 0x65 ; 101 + 2690: 08 95 ret + +00002692 : + +CommandStatusIdType CommandSetSetting(const char* InParam) +{ + if (SettingsSetActiveByName(InParam)) { + 2692: ca db rcall .-2156 ; 0x1e28 + 2694: 81 11 cpse r24, r1 + 2696: 02 c0 rjmp .+4 ; 0x269c + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + 2698: 8a ec ldi r24, 0xCA ; 202 + } +} + 269a: 08 95 ret +} + +CommandStatusIdType CommandSetSetting(const char* InParam) +{ + if (SettingsSetActiveByName(InParam)) { + SettingsSave(); + 269c: ed da rcall .-2598 ; 0x1c78 + return COMMAND_INFO_OK_ID; + 269e: 84 e6 ldi r24, 0x64 ; 100 + 26a0: 08 95 ret + +000026a2 : + } +} + +CommandStatusIdType CommandExecClear(char* OutParam) +{ + MemoryClear(); + 26a2: 0e 94 12 07 call 0xe24 ; 0xe24 + return COMMAND_INFO_OK_ID; +} + 26a6: 84 e6 ldi r24, 0x64 ; 100 + 26a8: 08 95 ret + +000026aa : + +CommandStatusIdType CommandExecHelp(char* OutMessage) +{ + 26aa: bf 92 push r11 + 26ac: cf 92 push r12 + 26ae: df 92 push r13 + 26b0: ef 92 push r14 + 26b2: ff 92 push r15 + 26b4: 0f 93 push r16 + 26b6: 1f 93 push r17 + 26b8: cf 93 push r28 + 26ba: df 93 push r29 + 26bc: 7c 01 movw r14, r24 + const CommandEntryType* EntryPtr = CommandTable; + uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ + 26be: cf ef ldi r28, 0xFF ; 255 + 26c0: d0 e0 ldi r29, 0x00 ; 0 + return COMMAND_INFO_OK_ID; +} + +CommandStatusIdType CommandExecHelp(char* OutMessage) +{ + const CommandEntryType* EntryPtr = CommandTable; + 26c2: 31 e4 ldi r19, 0x41 ; 65 + 26c4: c3 2e mov r12, r19 + 26c6: 36 e0 ldi r19, 0x06 ; 6 + 26c8: d3 2e mov r13, r19 + *OutMessage++ = c; + CommandName++; + ByteCount--; + } + + *OutMessage++ = ','; + 26ca: 4c e2 ldi r20, 0x2C ; 44 + 26cc: b4 2e mov r11, r20 +CommandStatusIdType CommandExecHelp(char* OutMessage) +{ + const CommandEntryType* EntryPtr = CommandTable; + uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ + + while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { + 26ce: 86 01 movw r16, r12 + 26d0: b6 01 movw r22, r12 + 26d2: 80 e9 ldi r24, 0x90 ; 144 + 26d4: 90 e2 ldi r25, 0x20 ; 32 + 26d6: 0e 94 d5 2d call 0x5baa ; 0x5baa + 26da: 89 2b or r24, r25 + 26dc: 21 f1 breq .+72 ; 0x2726 + const char* CommandName = EntryPtr->Command; + char c; + + while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { + 26de: f6 01 movw r30, r12 + 26e0: 84 91 lpm r24, Z + 26e2: 88 23 and r24, r24 + 26e4: 89 f0 breq .+34 ; 0x2708 + 26e6: c1 32 cpi r28, 0x21 ; 33 + 26e8: d1 05 cpc r29, r1 + 26ea: 70 f0 brcs .+28 ; 0x2708 + 26ec: d7 01 movw r26, r14 + 26ee: 03 c0 rjmp .+6 ; 0x26f6 + 26f0: c0 32 cpi r28, 0x20 ; 32 + 26f2: d1 05 cpc r29, r1 + 26f4: 49 f0 breq .+18 ; 0x2708 + *OutMessage++ = c; + 26f6: 8d 93 st X+, r24 + 26f8: 7d 01 movw r14, r26 + CommandName++; + 26fa: 0f 5f subi r16, 0xFF ; 255 + 26fc: 1f 4f sbci r17, 0xFF ; 255 + ByteCount--; + 26fe: 21 97 sbiw r28, 0x01 ; 1 + + while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { + const char* CommandName = EntryPtr->Command; + char c; + + while( (c = pgm_read_byte(CommandName)) != '\0' && ByteCount > 32) { + 2700: f8 01 movw r30, r16 + 2702: 84 91 lpm r24, Z + 2704: 81 11 cpse r24, r1 + 2706: f4 cf rjmp .-24 ; 0x26f0 + *OutMessage++ = c; + CommandName++; + ByteCount--; + } + + *OutMessage++ = ','; + 2708: f7 01 movw r30, r14 + 270a: b1 92 st Z+, r11 + 270c: 7f 01 movw r14, r30 + ByteCount--; + 270e: 21 97 sbiw r28, 0x01 ; 1 + + EntryPtr++; + 2710: f6 e1 ldi r31, 0x16 ; 22 + 2712: cf 0e add r12, r31 + 2714: d1 1c adc r13, r1 +CommandStatusIdType CommandExecHelp(char* OutMessage) +{ + const CommandEntryType* EntryPtr = CommandTable; + uint16_t ByteCount = TERMINAL_BUFFER_SIZE - 1; /* Account for '\0' */ + + while(strcmp_P(COMMAND_LIST_END, EntryPtr->Command) != 0) { + 2716: 86 01 movw r16, r12 + 2718: b6 01 movw r22, r12 + 271a: 80 e9 ldi r24, 0x90 ; 144 + 271c: 90 e2 ldi r25, 0x20 ; 32 + 271e: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2722: 89 2b or r24, r25 + 2724: e1 f6 brne .-72 ; 0x26de + ByteCount--; + + EntryPtr++; + } + + *--OutMessage = '\0'; + 2726: f7 01 movw r30, r14 + 2728: 31 97 sbiw r30, 0x01 ; 1 + 272a: 10 82 st Z, r1 + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + 272c: 85 e6 ldi r24, 0x65 ; 101 + 272e: df 91 pop r29 + 2730: cf 91 pop r28 + 2732: 1f 91 pop r17 + 2734: 0f 91 pop r16 + 2736: ff 90 pop r15 + 2738: ef 90 pop r14 + 273a: df 90 pop r13 + 273c: cf 90 pop r12 + 273e: bf 90 pop r11 + 2740: 08 95 ret + +00002742 : + +CommandStatusIdType CommandGetRssi(char* OutParam) +{ + 2742: fc 01 movw r30, r24 +} + +static inline +uint16_t AntennaLevelGet(void) +{ + ADCA.CH0.CTRL |= ADC_CH_START_bm; + 2744: 20 91 20 02 lds r18, 0x0220 + 2748: 20 68 ori r18, 0x80 ; 128 + 274a: 20 93 20 02 sts 0x0220, r18 + while( !(ADCA.CH0.INTFLAGS & ADC_CH_CHIF_bm) ); + 274e: 20 91 23 02 lds r18, 0x0223 + 2752: 20 ff sbrs r18, 0 + 2754: fc cf rjmp .-8 ; 0x274e + + ADCA.CH0.INTFLAGS = ADC_CH_CHIF_bm; + 2756: 81 e0 ldi r24, 0x01 ; 1 + 2758: 80 93 23 02 sts 0x0223, r24 + + int16_t Result = ADCA.CH0RES - ANTENNA_LEVEL_OFFSET; + 275c: a0 91 10 02 lds r26, 0x0210 + 2760: b0 91 11 02 lds r27, 0x0211 + if (Result < 0) Result = 0; + + return (uint16_t) (((uint32_t) Result * ANTENNA_LEVEL_NUMERATOR) / ANTENNA_LEVEL_DENOMINATOR); + 2764: ae 5b subi r26, 0xBE ; 190 + 2766: b1 09 sbc r27, r1 + 2768: b7 fd sbrc r27, 7 + 276a: 1c c0 rjmp .+56 ; 0x27a4 + 276c: 29 e6 ldi r18, 0x69 ; 105 + 276e: 37 e5 ldi r19, 0x57 ; 87 + 2770: 4b e0 ldi r20, 0x0B ; 11 + 2772: 50 e0 ldi r21, 0x00 ; 0 + 2774: 0e 94 56 2d call 0x5aac ; 0x5aac <__mulshisi3> + 2778: aa 27 eor r26, r26 + 277a: bb 27 eor r27, r27 + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, + 277c: 9f 93 push r25 + 277e: 8f 93 push r24 + 2780: 2a e3 ldi r18, 0x3A ; 58 + 2782: 36 e0 ldi r19, 0x06 ; 6 + 2784: 3f 93 push r19 + 2786: 2f 93 push r18 + 2788: 81 e0 ldi r24, 0x01 ; 1 + 278a: 8f 93 push r24 + 278c: 1f 92 push r1 + 278e: ff 93 push r31 + 2790: ef 93 push r30 + 2792: 0e 94 06 2e call 0x5c0c ; 0x5c0c + PSTR("%5u mV"), AntennaLevelGet()); + + + return COMMAND_INFO_OK_WITH_TEXT_ID; + 2796: 8d b7 in r24, 0x3d ; 61 + 2798: 9e b7 in r25, 0x3e ; 62 + 279a: 08 96 adiw r24, 0x08 ; 8 + 279c: 8d bf out 0x3d, r24 ; 61 + 279e: 9e bf out 0x3e, r25 ; 62 +} + 27a0: 85 e6 ldi r24, 0x65 ; 101 + 27a2: 08 95 ret + 27a4: a0 e0 ldi r26, 0x00 ; 0 + 27a6: b0 e0 ldi r27, 0x00 ; 0 + 27a8: e1 cf rjmp .-62 ; 0x276c + +000027aa : +static uint32_t BlockAddress; + +static XModemCallbackType CallbackFunc; + +static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { + uint8_t Checksum = CHECKSUM_INIT_VALUE; + 27aa: 80 e0 ldi r24, 0x00 ; 0 + uint8_t* DataPtr = (uint8_t*) Buffer; + 27ac: ec e3 ldi r30, 0x3C ; 60 + 27ae: f9 e2 ldi r31, 0x29 ; 41 + + while(ByteCount--) { + Checksum += *DataPtr++; + 27b0: 91 91 ld r25, Z+ + 27b2: 89 0f add r24, r25 + +static uint8_t CalcChecksum(const void* Buffer, uint16_t ByteCount) { + uint8_t Checksum = CHECKSUM_INIT_VALUE; + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 27b4: 99 e2 ldi r25, 0x29 ; 41 + 27b6: ec 3b cpi r30, 0xBC ; 188 + 27b8: f9 07 cpc r31, r25 + 27ba: d1 f7 brne .-12 ; 0x27b0 + Checksum += *DataPtr++; + } + + return Checksum; +} + 27bc: 08 95 ret + +000027be : + +void XModemReceive(XModemCallbackType TheCallbackFunc) +{ + State = STATE_RECEIVE_INIT; + 27be: 21 e0 ldi r18, 0x01 ; 1 + 27c0: 20 93 9b 28 sts 0x289B, r18 + CurrentFrameNumber = FIRST_FRAME_NUMBER; + 27c4: 20 93 9c 28 sts 0x289C, r18 + RetryCount = RECV_INIT_COUNT; + 27c8: 2c e3 ldi r18, 0x3C ; 60 + 27ca: 20 93 9d 28 sts 0x289D, r18 + RetryTimeout = RECV_INIT_TIMEOUT; + 27ce: 25 e0 ldi r18, 0x05 ; 5 + 27d0: 30 e0 ldi r19, 0x00 ; 0 + 27d2: 20 93 9e 28 sts 0x289E, r18 + 27d6: 30 93 9f 28 sts 0x289F, r19 + BlockAddress = 0; + 27da: 10 92 a0 28 sts 0x28A0, r1 + 27de: 10 92 a1 28 sts 0x28A1, r1 + 27e2: 10 92 a2 28 sts 0x28A2, r1 + 27e6: 10 92 a3 28 sts 0x28A3, r1 + + CallbackFunc = TheCallbackFunc; + 27ea: 80 93 a4 28 sts 0x28A4, r24 + 27ee: 90 93 a5 28 sts 0x28A5, r25 + 27f2: 08 95 ret + +000027f4 : +} + +void XModemSend(XModemCallbackType TheCallbackFunc) +{ + State = STATE_SEND_INIT; + 27f4: 27 e0 ldi r18, 0x07 ; 7 + 27f6: 20 93 9b 28 sts 0x289B, r18 + RetryTimeout = SEND_INIT_TIMEOUT; + 27fa: 2c e2 ldi r18, 0x2C ; 44 + 27fc: 31 e0 ldi r19, 0x01 ; 1 + 27fe: 20 93 9e 28 sts 0x289E, r18 + 2802: 30 93 9f 28 sts 0x289F, r19 + BlockAddress = 0; + 2806: 10 92 a0 28 sts 0x28A0, r1 + 280a: 10 92 a1 28 sts 0x28A1, r1 + 280e: 10 92 a2 28 sts 0x28A2, r1 + 2812: 10 92 a3 28 sts 0x28A3, r1 + + CallbackFunc = TheCallbackFunc; + 2816: 80 93 a4 28 sts 0x28A4, r24 + 281a: 90 93 a5 28 sts 0x28A5, r25 + 281e: 08 95 ret + +00002820 : +} + +bool XModemProcessByte(uint8_t Byte) +{ + 2820: cf 93 push r28 + 2822: c8 2f mov r28, r24 + switch(State) { + 2824: 90 91 9b 28 lds r25, 0x289B + 2828: 95 30 cpi r25, 0x05 ; 5 + 282a: 09 f4 brne .+2 ; 0x282e + 282c: 84 c0 rjmp .+264 ; 0x2936 + 282e: e0 f0 brcs .+56 ; 0x2868 + 2830: 97 30 cpi r25, 0x07 ; 7 + 2832: 09 f4 brne .+2 ; 0x2836 + 2834: 4c c0 rjmp .+152 ; 0x28ce + 2836: 60 f5 brcc .+88 ; 0x2890 + } + + break; + + case STATE_RECEIVE_PROCESS: + if (ReceivedFrameNumber == CurrentFrameNumber) { + 2838: 20 91 a9 28 lds r18, 0x28A9 + 283c: 80 91 9c 28 lds r24, 0x289C + 2840: 28 17 cp r18, r24 + 2842: 09 f4 brne .+2 ; 0x2846 + 2844: ec c0 rjmp .+472 ; 0x2a1e + } else { + /* Data seems to be damaged */ + TerminalSendByte(BYTE_NAK); + State = STATE_RECEIVE_WAIT; + } + } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { + 2846: 30 e0 ldi r19, 0x00 ; 0 + 2848: 90 e0 ldi r25, 0x00 ; 0 + 284a: 01 97 sbiw r24, 0x01 ; 1 + 284c: 28 17 cp r18, r24 + 284e: 39 07 cpc r19, r25 + 2850: 09 f4 brne .+2 ; 0x2854 + 2852: 14 c1 rjmp .+552 ; 0x2a7c +INLINE void TerminalSendByte(uint8_t Byte) { CDC_Device_SendByte(&TerminalHandle, Byte); } + 2854: 68 e1 ldi r22, 0x18 ; 24 + 2856: 80 e0 ldi r24, 0x00 ; 0 + 2858: 90 e2 ldi r25, 0x20 ; 32 + 285a: 0e 94 bf 2b call 0x577e ; 0x577e + TerminalSendByte(BYTE_ACK); + State = STATE_RECEIVE_WAIT; + } else { + /* This frame is completely out of order. Just cancel */ + TerminalSendByte(BYTE_CAN); + State = STATE_OFF; + 285e: 10 92 9b 28 sts 0x289B, r1 + default: + return false; + break; + } + + return true; + 2862: 81 e0 ldi r24, 0x01 ; 1 +} + 2864: cf 91 pop r28 + 2866: 08 95 ret + CallbackFunc = TheCallbackFunc; +} + +bool XModemProcessByte(uint8_t Byte) +{ + switch(State) { + 2868: 93 30 cpi r25, 0x03 ; 3 + 286a: 09 f4 brne .+2 ; 0x286e + 286c: 5c c0 rjmp .+184 ; 0x2926 + 286e: b8 f0 brcs .+46 ; 0x289e + ReceivedFrameNumber = Byte; + State = STATE_RECEIVE_FRAMENUM2; + break; + + case STATE_RECEIVE_FRAMENUM2: + if (Byte == (255 - ReceivedFrameNumber)) { + 2870: 90 e0 ldi r25, 0x00 ; 0 + 2872: 40 91 a9 28 lds r20, 0x28A9 + 2876: 2f ef ldi r18, 0xFF ; 255 + 2878: 30 e0 ldi r19, 0x00 ; 0 + 287a: 24 1b sub r18, r20 + 287c: 31 09 sbc r19, r1 + 287e: 82 17 cp r24, r18 + 2880: 93 07 cpc r25, r19 + 2882: 09 f0 breq .+2 ; 0x2886 + 2884: 6f c0 rjmp .+222 ; 0x2964 + /* frame-number check passed. */ + State = STATE_RECEIVE_DATA; + 2886: 85 e0 ldi r24, 0x05 ; 5 + 2888: 80 93 9b 28 sts 0x289B, r24 + default: + return false; + break; + } + + return true; + 288c: 81 e0 ldi r24, 0x01 ; 1 + 288e: ea cf rjmp .-44 ; 0x2864 + CallbackFunc = TheCallbackFunc; +} + +bool XModemProcessByte(uint8_t Byte) +{ + switch(State) { + 2890: 98 30 cpi r25, 0x08 ; 8 + 2892: 19 f1 breq .+70 ; 0x28da + 2894: 99 30 cpi r25, 0x09 ; 9 + 2896: b1 f0 breq .+44 ; 0x28c4 + /* Receive Ack */ + State = STATE_OFF; + break; + + default: + return false; + 2898: 80 e0 ldi r24, 0x00 ; 0 + break; + } + + return true; +} + 289a: cf 91 pop r28 + 289c: 08 95 ret + CallbackFunc = TheCallbackFunc; +} + +bool XModemProcessByte(uint8_t Byte) +{ + switch(State) { + 289e: 91 30 cpi r25, 0x01 ; 1 + 28a0: d8 f3 brcs .-10 ; 0x2898 + case STATE_RECEIVE_INIT: + case STATE_RECEIVE_WAIT: + if (Byte == BYTE_SOH) { + 28a2: 81 30 cpi r24, 0x01 ; 1 + 28a4: 09 f4 brne .+2 ; 0x28a8 + 28a6: ec c0 rjmp .+472 ; 0x2a80 + /* Next frame incoming */ + BufferIdx = 0; + Checksum = CHECKSUM_INIT_VALUE; + State = STATE_RECEIVE_FRAMENUM1; + } else if (Byte == BYTE_EOT) { + 28a8: 84 30 cpi r24, 0x04 ; 4 + 28aa: 39 f0 breq .+14 ; 0x28ba + /* Transmission finished */ + TerminalSendByte(BYTE_ACK); + State = STATE_OFF; + } else if ( (Byte == BYTE_CAN) || (Byte == BYTE_ESC) ) { + 28ac: 88 31 cpi r24, 0x18 ; 24 + 28ae: 51 f0 breq .+20 ; 0x28c4 + 28b0: 8b 31 cpi r24, 0x1B ; 27 + 28b2: 41 f0 breq .+16 ; 0x28c4 + default: + return false; + break; + } + + return true; + 28b4: 81 e0 ldi r24, 0x01 ; 1 +} + 28b6: cf 91 pop r28 + 28b8: 08 95 ret + 28ba: 66 e0 ldi r22, 0x06 ; 6 + 28bc: 80 e0 ldi r24, 0x00 ; 0 + 28be: 90 e2 ldi r25, 0x20 ; 32 + 28c0: 0e 94 bf 2b call 0x577e ; 0x577e + + case STATE_SEND_WAIT: + if (Byte == BYTE_CAN) { + /* Cancel */ + TerminalSendByte(BYTE_ACK); + State = STATE_OFF; + 28c4: 10 92 9b 28 sts 0x289B, r1 + default: + return false; + break; + } + + return true; + 28c8: 81 e0 ldi r24, 0x01 ; 1 +} + 28ca: cf 91 pop r28 + 28cc: 08 95 ret + + break; + + case STATE_SEND_INIT: + /* Start sending on NAK */ + if (Byte == BYTE_NAK) { + 28ce: 85 31 cpi r24, 0x15 ; 21 + 28d0: 09 f4 brne .+2 ; 0x28d4 + 28d2: 57 c0 rjmp .+174 ; 0x2982 + CurrentFrameNumber = FIRST_FRAME_NUMBER - 1; + Byte = BYTE_ACK; + } else if (Byte == BYTE_ESC) { + 28d4: 8b 31 cpi r24, 0x1B ; 27 + 28d6: 09 f4 brne .+2 ; 0x28da + 28d8: 50 c0 rjmp .+160 ; 0x297a + } + + /* Fallthrough */ + + case STATE_SEND_WAIT: + if (Byte == BYTE_CAN) { + 28da: c8 31 cpi r28, 0x18 ; 24 + 28dc: 71 f3 breq .-36 ; 0x28ba + /* Cancel */ + TerminalSendByte(BYTE_ACK); + State = STATE_OFF; + } else if (Byte == BYTE_ACK) { + 28de: c6 30 cpi r28, 0x06 ; 6 + 28e0: 09 f4 brne .+2 ; 0x28e4 + 28e2: 51 c0 rjmp .+162 ; 0x2986 + BlockAddress += XMODEM_BLOCK_SIZE; + } else { + TerminalSendByte(BYTE_EOT); + State = STATE_SEND_EOT; + } + } else if (Byte == BYTE_NAK){ + 28e4: c5 31 cpi r28, 0x15 ; 21 + 28e6: 31 f7 brne .-52 ; 0x28b4 + 28e8: 61 e0 ldi r22, 0x01 ; 1 + 28ea: 80 e0 ldi r24, 0x00 ; 0 + 28ec: 90 e2 ldi r25, 0x20 ; 32 + 28ee: 0e 94 bf 2b call 0x577e ; 0x577e + 28f2: 60 91 9c 28 lds r22, 0x289C + 28f6: 80 e0 ldi r24, 0x00 ; 0 + 28f8: 90 e2 ldi r25, 0x20 ; 32 + 28fa: 0e 94 bf 2b call 0x577e ; 0x577e + /* Resend frame */ + TerminalSendByte(BYTE_SOH); + TerminalSendByte(CurrentFrameNumber); + TerminalSendByte(255 - CurrentFrameNumber); + 28fe: 60 91 9c 28 lds r22, 0x289C + 2902: 60 95 com r22 + 2904: 80 e0 ldi r24, 0x00 ; 0 + 2906: 90 e2 ldi r25, 0x20 ; 32 + 2908: 0e 94 bf 2b call 0x577e ; 0x577e + TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); + 290c: 60 e8 ldi r22, 0x80 ; 128 + 290e: 70 e0 ldi r23, 0x00 ; 0 + 2910: 8c e3 ldi r24, 0x3C ; 60 + 2912: 99 e2 ldi r25, 0x29 ; 41 + 2914: 4a dc rcall .-1900 ; 0x21aa + TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); + 2916: 49 df rcall .-366 ; 0x27aa + 2918: 68 2f mov r22, r24 + 291a: 80 e0 ldi r24, 0x00 ; 0 + 291c: 90 e2 ldi r25, 0x20 ; 32 + 291e: 0e 94 bf 2b call 0x577e ; 0x577e + default: + return false; + break; + } + + return true; + 2922: 81 e0 ldi r24, 0x01 ; 1 + 2924: 9f cf rjmp .-194 ; 0x2864 + + break; + + case STATE_RECEIVE_FRAMENUM1: + /* Store frame number */ + ReceivedFrameNumber = Byte; + 2926: 80 93 a9 28 sts 0x28A9, r24 + State = STATE_RECEIVE_FRAMENUM2; + 292a: 84 e0 ldi r24, 0x04 ; 4 + 292c: 80 93 9b 28 sts 0x289B, r24 + default: + return false; + break; + } + + return true; + 2930: 81 e0 ldi r24, 0x01 ; 1 +} + 2932: cf 91 pop r28 + 2934: 08 95 ret + + break; + + case STATE_RECEIVE_DATA: + /* Process byte and update checksum */ + TerminalBuffer[BufferIdx++] = Byte; + 2936: 20 91 a6 28 lds r18, 0x28A6 + 293a: 30 91 a7 28 lds r19, 0x28A7 + 293e: f9 01 movw r30, r18 + 2940: e4 5c subi r30, 0xC4 ; 196 + 2942: f6 4d sbci r31, 0xD6 ; 214 + 2944: 80 83 st Z, r24 + 2946: c9 01 movw r24, r18 + 2948: 01 96 adiw r24, 0x01 ; 1 + 294a: 80 93 a6 28 sts 0x28A6, r24 + 294e: 90 93 a7 28 sts 0x28A7, r25 + + if (BufferIdx == XMODEM_BLOCK_SIZE) { + 2952: 80 38 cpi r24, 0x80 ; 128 + 2954: 91 05 cpc r25, r1 + 2956: 09 f0 breq .+2 ; 0x295a + 2958: ad cf rjmp .-166 ; 0x28b4 + /* Block full */ + State = STATE_RECEIVE_PROCESS; + 295a: 86 e0 ldi r24, 0x06 ; 6 + 295c: 80 93 9b 28 sts 0x289B, r24 + default: + return false; + break; + } + + return true; + 2960: 81 e0 ldi r24, 0x01 ; 1 + 2962: 80 cf rjmp .-256 ; 0x2864 + 2964: 65 e1 ldi r22, 0x15 ; 21 + 2966: 80 e0 ldi r24, 0x00 ; 0 + 2968: 90 e2 ldi r25, 0x20 ; 32 + 296a: 0e 94 bf 2b call 0x577e ; 0x577e + State = STATE_RECEIVE_WAIT; + } + } else if (ReceivedFrameNumber == (CurrentFrameNumber - 1)) { + /* This is a retransmission */ + TerminalSendByte(BYTE_ACK); + State = STATE_RECEIVE_WAIT; + 296e: 82 e0 ldi r24, 0x02 ; 2 + 2970: 80 93 9b 28 sts 0x289B, r24 + default: + return false; + break; + } + + return true; + 2974: 81 e0 ldi r24, 0x01 ; 1 +} + 2976: cf 91 pop r28 + 2978: 08 95 ret + /* Start sending on NAK */ + if (Byte == BYTE_NAK) { + CurrentFrameNumber = FIRST_FRAME_NUMBER - 1; + Byte = BYTE_ACK; + } else if (Byte == BYTE_ESC) { + State = STATE_OFF; + 297a: 10 92 9b 28 sts 0x289B, r1 + default: + return false; + break; + } + + return true; + 297e: 81 e0 ldi r24, 0x01 ; 1 + 2980: 9a cf rjmp .-204 ; 0x28b6 + break; + + case STATE_SEND_INIT: + /* Start sending on NAK */ + if (Byte == BYTE_NAK) { + CurrentFrameNumber = FIRST_FRAME_NUMBER - 1; + 2982: 10 92 9c 28 sts 0x289C, r1 + /* Cancel */ + TerminalSendByte(BYTE_ACK); + State = STATE_OFF; + } else if (Byte == BYTE_ACK) { + /* Acknowledge. Proceed to next frame, get data and calc checksum */ + CurrentFrameNumber++; + 2986: 80 91 9c 28 lds r24, 0x289C + 298a: 8f 5f subi r24, 0xFF ; 255 + 298c: 80 93 9c 28 sts 0x289C, r24 + + if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { + 2990: 40 91 a0 28 lds r20, 0x28A0 + 2994: 50 91 a1 28 lds r21, 0x28A1 + 2998: 60 91 a2 28 lds r22, 0x28A2 + 299c: 70 91 a3 28 lds r23, 0x28A3 + 29a0: e0 91 a4 28 lds r30, 0x28A4 + 29a4: f0 91 a5 28 lds r31, 0x28A5 + 29a8: 20 e8 ldi r18, 0x80 ; 128 + 29aa: 30 e0 ldi r19, 0x00 ; 0 + 29ac: 8c e3 ldi r24, 0x3C ; 60 + 29ae: 99 e2 ldi r25, 0x29 ; 41 + 29b0: 09 95 icall + 29b2: 88 23 and r24, r24 + 29b4: 09 f4 brne .+2 ; 0x29b8 + 29b6: 6f c0 rjmp .+222 ; 0x2a96 + 29b8: 61 e0 ldi r22, 0x01 ; 1 + 29ba: 80 e0 ldi r24, 0x00 ; 0 + 29bc: 90 e2 ldi r25, 0x20 ; 32 + 29be: 0e 94 bf 2b call 0x577e ; 0x577e + 29c2: 60 91 9c 28 lds r22, 0x289C + 29c6: 80 e0 ldi r24, 0x00 ; 0 + 29c8: 90 e2 ldi r25, 0x20 ; 32 + 29ca: 0e 94 bf 2b call 0x577e ; 0x577e + TerminalSendByte(BYTE_SOH); + TerminalSendByte(CurrentFrameNumber); + TerminalSendByte(255 - CurrentFrameNumber); + 29ce: 60 91 9c 28 lds r22, 0x289C + 29d2: 60 95 com r22 + 29d4: 80 e0 ldi r24, 0x00 ; 0 + 29d6: 90 e2 ldi r25, 0x20 ; 32 + 29d8: 0e 94 bf 2b call 0x577e ; 0x577e + TerminalSendBlock(TerminalBuffer, XMODEM_BLOCK_SIZE); + 29dc: 60 e8 ldi r22, 0x80 ; 128 + 29de: 70 e0 ldi r23, 0x00 ; 0 + 29e0: 8c e3 ldi r24, 0x3C ; 60 + 29e2: 99 e2 ldi r25, 0x29 ; 41 + 29e4: e2 db rcall .-2108 ; 0x21aa + TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); + 29e6: e1 de rcall .-574 ; 0x27aa + 29e8: 68 2f mov r22, r24 + 29ea: 80 e0 ldi r24, 0x00 ; 0 + 29ec: 90 e2 ldi r25, 0x20 ; 32 + 29ee: 0e 94 bf 2b call 0x577e ; 0x577e + + BlockAddress += XMODEM_BLOCK_SIZE; + 29f2: 80 91 a0 28 lds r24, 0x28A0 + 29f6: 90 91 a1 28 lds r25, 0x28A1 + 29fa: a0 91 a2 28 lds r26, 0x28A2 + 29fe: b0 91 a3 28 lds r27, 0x28A3 + 2a02: 80 58 subi r24, 0x80 ; 128 + 2a04: 9f 4f sbci r25, 0xFF ; 255 + 2a06: af 4f sbci r26, 0xFF ; 255 + 2a08: bf 4f sbci r27, 0xFF ; 255 + 2a0a: 80 93 a0 28 sts 0x28A0, r24 + 2a0e: 90 93 a1 28 sts 0x28A1, r25 + 2a12: a0 93 a2 28 sts 0x28A2, r26 + 2a16: b0 93 a3 28 sts 0x28A3, r27 + default: + return false; + break; + } + + return true; + 2a1a: 81 e0 ldi r24, 0x01 ; 1 + 2a1c: 4c cf rjmp .-360 ; 0x28b6 + + case STATE_RECEIVE_PROCESS: + if (ReceivedFrameNumber == CurrentFrameNumber) { + /* This is the expected frame. Calculate and verify checksum */ + + if (CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE) == Byte) { + 2a1e: c5 de rcall .-630 ; 0x27aa + 2a20: 8c 13 cpse r24, r28 + 2a22: a0 cf rjmp .-192 ; 0x2964 + /* Checksum is valid. Pass received data to callback function */ + if (CallbackFunc(TerminalBuffer, BlockAddress, XMODEM_BLOCK_SIZE)) { + 2a24: 40 91 a0 28 lds r20, 0x28A0 + 2a28: 50 91 a1 28 lds r21, 0x28A1 + 2a2c: 60 91 a2 28 lds r22, 0x28A2 + 2a30: 70 91 a3 28 lds r23, 0x28A3 + 2a34: e0 91 a4 28 lds r30, 0x28A4 + 2a38: f0 91 a5 28 lds r31, 0x28A5 + 2a3c: 20 e8 ldi r18, 0x80 ; 128 + 2a3e: 30 e0 ldi r19, 0x00 ; 0 + 2a40: 8c e3 ldi r24, 0x3C ; 60 + 2a42: 99 e2 ldi r25, 0x29 ; 41 + 2a44: 09 95 icall + 2a46: 88 23 and r24, r24 + 2a48: 81 f1 breq .+96 ; 0x2aaa + /* Proceed to next frame and send ACK */ + CurrentFrameNumber++; + 2a4a: 80 91 9c 28 lds r24, 0x289C + 2a4e: 8f 5f subi r24, 0xFF ; 255 + 2a50: 80 93 9c 28 sts 0x289C, r24 + BlockAddress += XMODEM_BLOCK_SIZE; + 2a54: 80 91 a0 28 lds r24, 0x28A0 + 2a58: 90 91 a1 28 lds r25, 0x28A1 + 2a5c: a0 91 a2 28 lds r26, 0x28A2 + 2a60: b0 91 a3 28 lds r27, 0x28A3 + 2a64: 80 58 subi r24, 0x80 ; 128 + 2a66: 9f 4f sbci r25, 0xFF ; 255 + 2a68: af 4f sbci r26, 0xFF ; 255 + 2a6a: bf 4f sbci r27, 0xFF ; 255 + 2a6c: 80 93 a0 28 sts 0x28A0, r24 + 2a70: 90 93 a1 28 sts 0x28A1, r25 + 2a74: a0 93 a2 28 sts 0x28A2, r26 + 2a78: b0 93 a3 28 sts 0x28A3, r27 + 2a7c: 66 e0 ldi r22, 0x06 ; 6 + 2a7e: 73 cf rjmp .-282 ; 0x2966 + switch(State) { + case STATE_RECEIVE_INIT: + case STATE_RECEIVE_WAIT: + if (Byte == BYTE_SOH) { + /* Next frame incoming */ + BufferIdx = 0; + 2a80: 10 92 a6 28 sts 0x28A6, r1 + 2a84: 10 92 a7 28 sts 0x28A7, r1 + Checksum = CHECKSUM_INIT_VALUE; + 2a88: 10 92 a8 28 sts 0x28A8, r1 + State = STATE_RECEIVE_FRAMENUM1; + 2a8c: 83 e0 ldi r24, 0x03 ; 3 + 2a8e: 80 93 9b 28 sts 0x289B, r24 + default: + return false; + break; + } + + return true; + 2a92: 81 e0 ldi r24, 0x01 ; 1 + 2a94: e7 ce rjmp .-562 ; 0x2864 + 2a96: 64 e0 ldi r22, 0x04 ; 4 + 2a98: 80 e0 ldi r24, 0x00 ; 0 + 2a9a: 90 e2 ldi r25, 0x20 ; 32 + 2a9c: 0e 94 bf 2b call 0x577e ; 0x577e + TerminalSendByte(CalcChecksum(TerminalBuffer, XMODEM_BLOCK_SIZE)); + + BlockAddress += XMODEM_BLOCK_SIZE; + } else { + TerminalSendByte(BYTE_EOT); + State = STATE_SEND_EOT; + 2aa0: 89 e0 ldi r24, 0x09 ; 9 + 2aa2: 80 93 9b 28 sts 0x289B, r24 + default: + return false; + break; + } + + return true; + 2aa6: 81 e0 ldi r24, 0x01 ; 1 + 2aa8: dd ce rjmp .-582 ; 0x2864 + 2aaa: 68 e1 ldi r22, 0x18 ; 24 + 2aac: 80 e0 ldi r24, 0x00 ; 0 + 2aae: 90 e2 ldi r25, 0x20 ; 32 + 2ab0: 0e 94 bf 2b call 0x577e ; 0x577e + 2ab4: cf ce rjmp .-610 ; 0x2854 + +00002ab6 : +} + +void XModemTick(void) +{ + /* Timeouts go here */ + switch(State) { + 2ab6: 80 91 9b 28 lds r24, 0x289B + 2aba: 81 30 cpi r24, 0x01 ; 1 + 2abc: 99 f0 breq .+38 ; 0x2ae4 + 2abe: 87 30 cpi r24, 0x07 ; 7 + 2ac0: 09 f0 breq .+2 ; 0x2ac4 + 2ac2: 08 95 ret + RetryTimeout = RECV_INIT_TIMEOUT; + } + break; + + case STATE_SEND_INIT: + if (RetryTimeout-- == 0) { + 2ac4: 80 91 9e 28 lds r24, 0x289E + 2ac8: 90 91 9f 28 lds r25, 0x289F + 2acc: 9c 01 movw r18, r24 + 2ace: 21 50 subi r18, 0x01 ; 1 + 2ad0: 31 09 sbc r19, r1 + 2ad2: 20 93 9e 28 sts 0x289E, r18 + 2ad6: 30 93 9f 28 sts 0x289F, r19 + 2ada: 89 2b or r24, r25 + 2adc: 91 f7 brne .-28 ; 0x2ac2 + /* Abort */ + State = STATE_OFF; + 2ade: 10 92 9b 28 sts 0x289B, r1 + 2ae2: 08 95 ret +void XModemTick(void) +{ + /* Timeouts go here */ + switch(State) { + case STATE_RECEIVE_INIT: + if (RetryTimeout-- == 0) { + 2ae4: 80 91 9e 28 lds r24, 0x289E + 2ae8: 90 91 9f 28 lds r25, 0x289F + 2aec: 9c 01 movw r18, r24 + 2aee: 21 50 subi r18, 0x01 ; 1 + 2af0: 31 09 sbc r19, r1 + 2af2: 20 93 9e 28 sts 0x289E, r18 + 2af6: 30 93 9f 28 sts 0x289F, r19 + 2afa: 89 2b or r24, r25 + 2afc: 11 f7 brne .-60 ; 0x2ac2 + if (RetryCount-- > 0) { + 2afe: 80 91 9d 28 lds r24, 0x289D + 2b02: 98 2f mov r25, r24 + 2b04: 91 50 subi r25, 0x01 ; 1 + 2b06: 90 93 9d 28 sts 0x289D, r25 + 2b0a: 81 11 cpse r24, r1 + 2b0c: 09 c0 rjmp .+18 ; 0x2b20 + /* Put out communication request */ + TerminalSendChar(BYTE_NAK); + } else { + /* Just shut off after some time. */ + State = STATE_OFF; + 2b0e: 10 92 9b 28 sts 0x289B, r1 + } + + RetryTimeout = RECV_INIT_TIMEOUT; + 2b12: 85 e0 ldi r24, 0x05 ; 5 + 2b14: 90 e0 ldi r25, 0x00 ; 0 + 2b16: 80 93 9e 28 sts 0x289E, r24 + 2b1a: 90 93 9f 28 sts 0x289F, r25 + 2b1e: 08 95 ret +void EVENT_USB_Device_Connect(void); +void EVENT_USB_Device_Disconnect(void); +void EVENT_USB_Device_ConfigurationChanged(void); +void EVENT_USB_Device_ControlRequest(void); + +INLINE void TerminalSendChar(char c) { CDC_Device_SendByte(&TerminalHandle, c); } + 2b20: 65 e1 ldi r22, 0x15 ; 21 + 2b22: 80 e0 ldi r24, 0x00 ; 0 + 2b24: 90 e2 ldi r25, 0x20 ; 32 + 2b26: 0e 94 bf 2b call 0x577e ; 0x577e + 2b2a: f3 cf rjmp .-26 ; 0x2b12 + +00002b2c : +void CommandLineInit(void) +{ + BufferIdx = 0; +} + +bool CommandLineProcessByte(uint8_t Byte) { + 2b2c: af 92 push r10 + 2b2e: bf 92 push r11 + 2b30: df 92 push r13 + 2b32: ef 92 push r14 + 2b34: ff 92 push r15 + 2b36: 0f 93 push r16 + 2b38: 1f 93 push r17 + 2b3a: cf 93 push r28 + 2b3c: df 93 push r29 + 2b3e: 1f 92 push r1 + 2b40: cd b7 in r28, 0x3d ; 61 + 2b42: de b7 in r29, 0x3e ; 62 + if (IS_CHARACTER(Byte)){ + 2b44: 98 2f mov r25, r24 + 2b46: 91 54 subi r25, 0x41 ; 65 + 2b48: 9a 31 cpi r25, 0x1A ; 26 + 2b4a: 20 f0 brcs .+8 ; 0x2b54 + 2b4c: 90 52 subi r25, 0x20 ; 32 + 2b4e: 9a 31 cpi r25, 0x1A ; 26 + 2b50: f0 f4 brcc .+60 ; 0x2b8e + /* Store uppercase character */ + if (IS_LOWERCASE(Byte)) { + Byte = TO_UPPERCASE(Byte); + 2b52: 80 52 subi r24, 0x20 ; 32 + } + + /* Prevent buffer overflow and account for '\0' */ + if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { + 2b54: 20 91 aa 28 lds r18, 0x28AA + 2b58: 30 91 ab 28 lds r19, 0x28AB + 2b5c: 2f 3f cpi r18, 0xFF ; 255 + 2b5e: 31 05 cpc r19, r1 + 2b60: 50 f4 brcc .+20 ; 0x2b76 + TerminalBuffer[BufferIdx++] = Byte; + 2b62: f9 01 movw r30, r18 + 2b64: e4 5c subi r30, 0xC4 ; 196 + 2b66: f6 4d sbci r31, 0xD6 ; 214 + 2b68: 80 83 st Z, r24 + 2b6a: 2f 5f subi r18, 0xFF ; 255 + 2b6c: 3f 4f sbci r19, 0xFF ; 255 + 2b6e: 20 93 aa 28 sts 0x28AA, r18 + 2b72: 30 93 ab 28 sts 0x28AB, r19 + } else { + /* Ignore other chars */ + } + + return true; +} + 2b76: 81 e0 ldi r24, 0x01 ; 1 + 2b78: 0f 90 pop r0 + 2b7a: df 91 pop r29 + 2b7c: cf 91 pop r28 + 2b7e: 1f 91 pop r17 + 2b80: 0f 91 pop r16 + 2b82: ff 90 pop r15 + 2b84: ef 90 pop r14 + 2b86: df 90 pop r13 + 2b88: bf 90 pop r11 + 2b8a: af 90 pop r10 + 2b8c: 08 95 ret +{ + BufferIdx = 0; +} + +bool CommandLineProcessByte(uint8_t Byte) { + if (IS_CHARACTER(Byte)){ + 2b8e: 9f 5c subi r25, 0xCF ; 207 + 2b90: 9a 30 cpi r25, 0x0A ; 10 + 2b92: 00 f3 brcs .-64 ; 0x2b54 + 2b94: 8f 35 cpi r24, 0x5F ; 95 + 2b96: f1 f2 breq .-68 ; 0x2b54 + 2b98: 8f 33 cpi r24, 0x3F ; 63 + 2b9a: e1 f2 breq .-72 ; 0x2b54 + 2b9c: 8d 33 cpi r24, 0x3D ; 61 + 2b9e: d1 f2 breq .-76 ; 0x2b54 + + /* Prevent buffer overflow and account for '\0' */ + if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { + TerminalBuffer[BufferIdx++] = Byte; + } + }else if (Byte == '\r') { + 2ba0: 8d 30 cpi r24, 0x0D ; 13 + 2ba2: a9 f0 breq .+42 ; 0x2bce + /* Process on \r. Terminate string and decode. */ + TerminalBuffer[BufferIdx] = '\0'; + BufferIdx = 0; + + DecodeCommand(); + }else if (Byte == '\b') { + 2ba4: 88 30 cpi r24, 0x08 ; 8 + 2ba6: 39 f0 breq .+14 ; 0x2bb6 + /* Backspace. Delete last character in buffer. */ + if (BufferIdx > 0) { + BufferIdx--; + } + } else if (Byte == 0x1B){ + 2ba8: 8b 31 cpi r24, 0x1B ; 27 + 2baa: 29 f7 brne .-54 ; 0x2b76 + /* Drop buffer on escape */ + BufferIdx = 0; + 2bac: 10 92 aa 28 sts 0x28AA, r1 + 2bb0: 10 92 ab 28 sts 0x28AB, r1 + 2bb4: e0 cf rjmp .-64 ; 0x2b76 + BufferIdx = 0; + + DecodeCommand(); + }else if (Byte == '\b') { + /* Backspace. Delete last character in buffer. */ + if (BufferIdx > 0) { + 2bb6: 80 91 aa 28 lds r24, 0x28AA + 2bba: 90 91 ab 28 lds r25, 0x28AB + 2bbe: 00 97 sbiw r24, 0x00 ; 0 + 2bc0: d1 f2 breq .-76 ; 0x2b76 + BufferIdx--; + 2bc2: 01 97 sbiw r24, 0x01 ; 1 + 2bc4: 80 93 aa 28 sts 0x28AA, r24 + 2bc8: 90 93 ab 28 sts 0x28AB, r25 + 2bcc: d4 cf rjmp .-88 ; 0x2b76 + if (BufferIdx < (sizeof(TerminalBuffer) / sizeof(*TerminalBuffer) - 1)) { + TerminalBuffer[BufferIdx++] = Byte; + } + }else if (Byte == '\r') { + /* Process on \r. Terminate string and decode. */ + TerminalBuffer[BufferIdx] = '\0'; + 2bce: e0 91 aa 28 lds r30, 0x28AA + 2bd2: f0 91 ab 28 lds r31, 0x28AB + 2bd6: e4 5c subi r30, 0xC4 ; 196 + 2bd8: f6 4d sbci r31, 0xD6 ; 214 + 2bda: 10 82 st Z, r1 + BufferIdx = 0; + 2bdc: 10 92 aa 28 sts 0x28AA, r1 + 2be0: 10 92 ab 28 sts 0x28AB, r1 + bool CommandFound = false; + CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; + char* pTerminalBuffer = (char*) TerminalBuffer; + + /* Do some sanity check first */ + if (!IS_COMMAND_DELIMITER(pTerminalBuffer[0])) { + 2be4: 80 91 3c 29 lds r24, 0x293C + 2be8: 88 23 and r24, r24 + 2bea: 69 f1 breq .+90 ; 0x2c46 + 2bec: 8f 33 cpi r24, 0x3F ; 63 + 2bee: 59 f1 breq .+86 ; 0x2c46 + 2bf0: 8d 33 cpi r24, 0x3D ; 61 + 2bf2: 49 f1 breq .+82 ; 0x2c46 + 2bf4: ed e3 ldi r30, 0x3D ; 61 + 2bf6: f9 e2 ldi r31, 0x29 ; 41 + 2bf8: 04 c0 rjmp .+8 ; 0x2c02 + char* pCommandDelimiter = pTerminalBuffer; + char CommandDelimiter = '\0'; + + /* Search for command delimiter, store it and replace with '\0' */ + while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) + 2bfa: 2f 33 cpi r18, 0x3F ; 63 + 2bfc: 31 f0 breq .+12 ; 0x2c0a + 2bfe: 2d 33 cpi r18, 0x3D ; 61 + 2c00: 21 f0 breq .+8 ; 0x2c0a + pCommandDelimiter++; + 2c02: 7f 01 movw r14, r30 + if (!IS_COMMAND_DELIMITER(pTerminalBuffer[0])) { + char* pCommandDelimiter = pTerminalBuffer; + char CommandDelimiter = '\0'; + + /* Search for command delimiter, store it and replace with '\0' */ + while(!(IS_COMMAND_DELIMITER(*pCommandDelimiter))) + 2c04: 21 91 ld r18, Z+ + 2c06: 21 11 cpse r18, r1 + 2c08: f8 cf rjmp .-16 ; 0x2bfa + pCommandDelimiter++; + + CommandDelimiter = *pCommandDelimiter; + *pCommandDelimiter = '\0'; + 2c0a: f7 01 movw r30, r14 + 2c0c: 10 82 st Z, r1 + 2c0e: 00 e0 ldi r16, 0x00 ; 0 + 2c10: 10 e0 ldi r17, 0x00 ; 0 + + /* Search in command table */ + for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { + if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { + 2c12: 86 e1 ldi r24, 0x16 ; 22 + 2c14: d8 2e mov r13, r24 + 2c16: d0 9e mul r13, r16 + 2c18: 50 01 movw r10, r0 + 2c1a: d1 9e mul r13, r17 + 2c1c: b0 0c add r11, r0 + 2c1e: 11 24 eor r1, r1 + 2c20: 81 e4 ldi r24, 0x41 ; 65 + 2c22: 96 e0 ldi r25, 0x06 ; 6 + 2c24: a8 0e add r10, r24 + 2c26: b9 1e adc r11, r25 + 2c28: b5 01 movw r22, r10 + 2c2a: 8c e3 ldi r24, 0x3C ; 60 + 2c2c: 99 e2 ldi r25, 0x29 ; 41 + 2c2e: 29 83 std Y+1, r18 ; 0x01 + 2c30: 0e 94 d5 2d call 0x5baa ; 0x5baa + 2c34: 29 81 ldd r18, Y+1 ; 0x01 + 2c36: 89 2b or r24, r25 + 2c38: 09 f4 brne .+2 ; 0x2c3c + 2c3a: 3f c0 rjmp .+126 ; 0x2cba + 2c3c: 0f 5f subi r16, 0xFF ; 255 + 2c3e: 1f 4f sbci r17, 0xFF ; 255 + + CommandDelimiter = *pCommandDelimiter; + *pCommandDelimiter = '\0'; + + /* Search in command table */ + for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { + 2c40: 05 31 cpi r16, 0x15 ; 21 + 2c42: 11 05 cpc r17, r1 + 2c44: 41 f7 brne .-48 ; 0x2c16 + +static void DecodeCommand(void) +{ + uint8_t i; + bool CommandFound = false; + CommandStatusIdType StatusId = COMMAND_ERR_UNKNOWN_CMD_ID; + 2c46: 88 ec ldi r24, 0xC8 ; 200 +} + +static void DecodeCommand(void) +{ + uint8_t i; + bool CommandFound = false; + 2c48: 10 e0 ldi r17, 0x00 ; 0 +static const char* GetStatusMessageP(CommandStatusIdType StatusId) +{ + uint8_t i; + + for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { + if (pgm_read_byte(&StatusTable[i].Id) == StatusId) + 2c4a: e5 e1 ldi r30, 0x15 ; 21 + 2c4c: f8 e0 ldi r31, 0x08 ; 8 + 2c4e: e4 91 lpm r30, Z + 2c50: 8e 17 cp r24, r30 + 2c52: 09 f4 brne .+2 ; 0x2c56 + 2c54: 63 c0 rjmp .+198 ; 0x2d1c + 2c56: e6 e3 ldi r30, 0x36 ; 54 + 2c58: f8 e0 ldi r31, 0x08 ; 8 + 2c5a: e4 91 lpm r30, Z + 2c5c: 8e 17 cp r24, r30 + 2c5e: 09 f4 brne .+2 ; 0x2c62 + 2c60: 5a c0 rjmp .+180 ; 0x2d16 + 2c62: e7 e5 ldi r30, 0x57 ; 87 + 2c64: f8 e0 ldi r31, 0x08 ; 8 + 2c66: e4 91 lpm r30, Z + 2c68: 8e 17 cp r24, r30 + 2c6a: 09 f4 brne .+2 ; 0x2c6e + 2c6c: 51 c0 rjmp .+162 ; 0x2d10 + 2c6e: e8 e7 ldi r30, 0x78 ; 120 + 2c70: f8 e0 ldi r31, 0x08 ; 8 + 2c72: e4 91 lpm r30, Z + 2c74: 8e 17 cp r24, r30 + 2c76: 09 f4 brne .+2 ; 0x2c7a + 2c78: 48 c0 rjmp .+144 ; 0x2d0a + 2c7a: e9 e9 ldi r30, 0x99 ; 153 + 2c7c: f8 e0 ldi r31, 0x08 ; 8 + 2c7e: e4 91 lpm r30, Z + 2c80: 8e 17 cp r24, r30 + 2c82: 09 f4 brne .+2 ; 0x2c86 + 2c84: 3f c0 rjmp .+126 ; 0x2d04 + 2c86: ea eb ldi r30, 0xBA ; 186 + 2c88: f8 e0 ldi r31, 0x08 ; 8 + 2c8a: e4 91 lpm r30, Z + 2c8c: 8e 17 cp r24, r30 + 2c8e: 79 f1 breq .+94 ; 0x2cee + return StatusTable[i].Message; + } + + return (void*) 0; + 2c90: 80 e0 ldi r24, 0x00 ; 0 + 2c92: 90 e0 ldi r25, 0x00 ; 0 + } + } + } + + /* Send command status message */ + TerminalSendStringP(GetStatusMessageP(StatusId)); + 2c94: 76 da rcall .-2836 ; 0x2182 + TerminalSendStringP(PSTR(STATUS_MESSAGE_TRAILER)); + 2c96: 8f e0 ldi r24, 0x0F ; 15 + 2c98: 98 e0 ldi r25, 0x08 ; 8 + 2c9a: 73 da rcall .-2842 ; 0x2182 + + if (CommandFound && (pTerminalBuffer[0] != '\0') ) { + 2c9c: 11 23 and r17, r17 + 2c9e: 09 f4 brne .+2 ; 0x2ca2 + 2ca0: 6a cf rjmp .-300 ; 0x2b76 + 2ca2: 80 91 3c 29 lds r24, 0x293C + 2ca6: 88 23 and r24, r24 + 2ca8: 09 f4 brne .+2 ; 0x2cac + 2caa: 65 cf rjmp .-310 ; 0x2b76 + /* Send optional answer */ + TerminalSendString(pTerminalBuffer); + 2cac: 8c e3 ldi r24, 0x3C ; 60 + 2cae: 99 e2 ldi r25, 0x29 ; 41 + 2cb0: 63 da rcall .-2874 ; 0x2178 + TerminalSendStringP(PSTR(OPTIONAL_ANSWER_TRAILER)); + 2cb2: 82 e1 ldi r24, 0x12 ; 18 + 2cb4: 98 e0 ldi r25, 0x08 ; 8 + 2cb6: 65 da rcall .-2870 ; 0x2182 + 2cb8: 5e cf rjmp .-324 ; 0x2b76 + for (i=0; i<(sizeof(CommandTable) / sizeof(*CommandTable)); i++) { + if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { + /* Command found. Clear buffer, and call appropriate function */ + char* pParam = ++pCommandDelimiter; + + pTerminalBuffer[0] = '\0'; + 2cba: 10 92 3c 29 sts 0x293C, r1 +static CommandStatusIdType CallCommandFunc( + const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { + char* pTerminalBuffer = (char*) TerminalBuffer; + + /* Call appropriate function depending on CommandDelimiter */ + if (CommandDelimiter == CHAR_GET_MODE) { + 2cbe: 2f 33 cpi r18, 0x3F ; 63 + 2cc0: 99 f0 breq .+38 ; 0x2ce8 + CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); + if (GetFunc != NO_FUNCTION) { + return GetFunc(pTerminalBuffer); + } + } else if (CommandDelimiter == CHAR_SET_MODE) { + 2cc2: 2d 33 cpi r18, 0x3D ; 61 + 2cc4: 71 f1 breq .+92 ; 0x2d22 + CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); + if (SetFunc != NO_FUNCTION) { + return SetFunc(pParam); + } + } else if (CommandDelimiter == CHAR_EXEC_MODE){ + 2cc6: 22 23 and r18, r18 + 2cc8: 19 f0 breq .+6 ; 0x2cd0 + } else { + /* This should not happen (TM) */ + } + + /* This delimiter has not been registered with this command */ + return COMMAND_ERR_INVALID_USAGE_ID; + 2cca: 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; + 2ccc: 11 e0 ldi r17, 0x01 ; 1 + 2cce: bd cf rjmp .-134 ; 0x2c4a + CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); + if (SetFunc != NO_FUNCTION) { + return SetFunc(pParam); + } + } else if (CommandDelimiter == CHAR_EXEC_MODE){ + CommandExecFuncType ExecFunc = pgm_read_ptr(&CommandEntry->ExecFunc); + 2cd0: f5 01 movw r30, r10 + 2cd2: 70 96 adiw r30, 0x10 ; 16 + 2cd4: 85 91 lpm r24, Z+ + 2cd6: 94 91 lpm r25, Z + 2cd8: fc 01 movw r30, r24 + if (ExecFunc != NO_FUNCTION) { + 2cda: 00 97 sbiw r24, 0x00 ; 0 + 2cdc: b1 f3 breq .-20 ; 0x2cca + return ExecFunc(pTerminalBuffer); + 2cde: 8c e3 ldi r24, 0x3C ; 60 + 2ce0: 99 e2 ldi r25, 0x29 ; 41 + 2ce2: 09 95 icall + if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { + /* Command found. Clear buffer, and call appropriate function */ + char* pParam = ++pCommandDelimiter; + + pTerminalBuffer[0] = '\0'; + CommandFound = true; + 2ce4: 11 e0 ldi r17, 0x01 ; 1 + 2ce6: b1 cf rjmp .-158 ; 0x2c4a + const CommandEntryType* CommandEntry, char CommandDelimiter, char* pParam) { + char* pTerminalBuffer = (char*) TerminalBuffer; + + /* Call appropriate function depending on CommandDelimiter */ + if (CommandDelimiter == CHAR_GET_MODE) { + CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); + 2ce8: f5 01 movw r30, r10 + 2cea: 74 96 adiw r30, 0x14 ; 20 + 2cec: f3 cf rjmp .-26 ; 0x2cd4 +static const char* GetStatusMessageP(CommandStatusIdType StatusId) +{ + uint8_t i; + + for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { + if (pgm_read_byte(&StatusTable[i].Id) == StatusId) + 2cee: 25 e0 ldi r18, 0x05 ; 5 + 2cf0: 30 e0 ldi r19, 0x00 ; 0 + return StatusTable[i].Message; + 2cf2: 41 e2 ldi r20, 0x21 ; 33 + 2cf4: 42 9f mul r20, r18 + 2cf6: c0 01 movw r24, r0 + 2cf8: 43 9f mul r20, r19 + 2cfa: 90 0d add r25, r0 + 2cfc: 11 24 eor r1, r1 + 2cfe: 8a 5e subi r24, 0xEA ; 234 + 2d00: 97 4f sbci r25, 0xF7 ; 247 + 2d02: c8 cf rjmp .-112 ; 0x2c94 +static const char* GetStatusMessageP(CommandStatusIdType StatusId) +{ + uint8_t i; + + for (i=0; i<(sizeof(StatusTable)/sizeof(*StatusTable)); i++) { + if (pgm_read_byte(&StatusTable[i].Id) == StatusId) + 2d04: 24 e0 ldi r18, 0x04 ; 4 + 2d06: 30 e0 ldi r19, 0x00 ; 0 + 2d08: f4 cf rjmp .-24 ; 0x2cf2 + 2d0a: 23 e0 ldi r18, 0x03 ; 3 + 2d0c: 30 e0 ldi r19, 0x00 ; 0 + 2d0e: f1 cf rjmp .-30 ; 0x2cf2 + 2d10: 22 e0 ldi r18, 0x02 ; 2 + 2d12: 30 e0 ldi r19, 0x00 ; 0 + 2d14: ee cf rjmp .-36 ; 0x2cf2 + 2d16: 21 e0 ldi r18, 0x01 ; 1 + 2d18: 30 e0 ldi r19, 0x00 ; 0 + 2d1a: eb cf rjmp .-42 ; 0x2cf2 + 2d1c: 20 e0 ldi r18, 0x00 ; 0 + 2d1e: 30 e0 ldi r19, 0x00 ; 0 + 2d20: e8 cf rjmp .-48 ; 0x2cf2 + CommandGetFuncType GetFunc = pgm_read_ptr(&CommandEntry->GetFunc); + if (GetFunc != NO_FUNCTION) { + return GetFunc(pTerminalBuffer); + } + } else if (CommandDelimiter == CHAR_SET_MODE) { + CommandSetFuncType SetFunc = pgm_read_ptr(&CommandEntry->SetFunc); + 2d22: f5 01 movw r30, r10 + 2d24: 72 96 adiw r30, 0x12 ; 18 + 2d26: 85 91 lpm r24, Z+ + 2d28: 94 91 lpm r25, Z + 2d2a: fc 01 movw r30, r24 + if (SetFunc != NO_FUNCTION) { + 2d2c: 00 97 sbiw r24, 0x00 ; 0 + 2d2e: 69 f2 breq .-102 ; 0x2cca + return SetFunc(pParam); + 2d30: c7 01 movw r24, r14 + 2d32: 01 96 adiw r24, 0x01 ; 1 + 2d34: 09 95 icall + if (strcmp_P(pTerminalBuffer, CommandTable[i].Command) == 0) { + /* Command found. Clear buffer, and call appropriate function */ + char* pParam = ++pCommandDelimiter; + + pTerminalBuffer[0] = '\0'; + CommandFound = true; + 2d36: 11 e0 ldi r17, 0x01 ; 1 + 2d38: 88 cf rjmp .-240 ; 0x2c4a + +00002d3a : + + return true; +} + +void CommandLineTick(void) +{ + 2d3a: 08 95 ret + +00002d3c : +INLINE void CodecTask(void) { + ActiveConfiguration.CodecTaskFunc(); +} + +INLINE void CodecSetDemodPower(bool bOnOff) { + CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; + 2d3c: a0 e2 ldi r26, 0x20 ; 32 + 2d3e: b6 e0 ldi r27, 0x06 ; 6 + 2d40: 82 e0 ldi r24, 0x02 ; 2 + 2d42: 11 96 adiw r26, 0x01 ; 1 + 2d44: 8c 93 st X, r24 + 2d46: 11 97 sbiw r26, 0x01 ; 1 + + if (bOnOff) { + CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; + 2d48: 15 96 adiw r26, 0x05 ; 5 + 2d4a: 8c 93 st X, r24 + 2d4c: 15 97 sbiw r26, 0x05 ; 5 + +static void StartDemod(void) { + /* Activate Power for demodulator */ + CodecSetDemodPower(true); + + CodecBufferPtr = CodecBuffer; + 2d4e: 8c e3 ldi r24, 0x3C ; 60 + 2d50: 9a e2 ldi r25, 0x2A ; 42 + 2d52: 80 93 b8 28 sts 0x28B8, r24 + 2d56: 90 93 b9 28 sts 0x28B9, r25 + ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; + 2d5a: 8c eb ldi r24, 0xBC ; 188 + 2d5c: 9a e2 ldi r25, 0x2A ; 42 + 2d5e: 80 93 ba 28 sts 0x28BA, r24 + 2d62: 90 93 bb 28 sts 0x28BB, r25 + DataRegister = 0; + 2d66: 10 92 b1 28 sts 0x28B1, r1 + SampleRegister = 0; + 2d6a: 10 92 b0 28 sts 0x28B0, r1 + SamplePosition = 0; + 2d6e: 10 92 ac 28 sts 0x28AC, r1 + BitCount = 0; + 2d72: 10 92 b4 28 sts 0x28B4, r1 + 2d76: 10 92 b5 28 sts 0x28B5, r1 + IsParityBit = false; + 2d7a: 10 92 af 28 sts 0x28AF, r1 + + /* Configure sampling-timer free running and sync to first modulation-pause. */ + CODEC_TIMER_SAMPLING.CNT = 0; + 2d7e: e0 e4 ldi r30, 0x40 ; 64 + 2d80: f8 e0 ldi r31, 0x08 ; 8 + 2d82: 10 a2 std Z+32, r1 ; 0x20 + 2d84: 11 a2 std Z+33, r1 ; 0x21 + CODEC_TIMER_SAMPLING.PER = SAMPLE_RATE_SYSTEM_CYCLES - 1; + 2d86: 8d e2 ldi r24, 0x2D ; 45 + 2d88: 91 e0 ldi r25, 0x01 ; 1 + 2d8a: 86 a3 std Z+38, r24 ; 0x26 + 2d8c: 97 a3 std Z+39, r25 ; 0x27 + CODEC_TIMER_SAMPLING.CCA = 0xFFFF; /* CCA Interrupt is not active! */ + 2d8e: 8f ef ldi r24, 0xFF ; 255 + 2d90: 9f ef ldi r25, 0xFF ; 255 + 2d92: 80 a7 std Z+40, r24 ; 0x28 + 2d94: 91 a7 std Z+41, r25 ; 0x29 + CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_DIV1_gc; + 2d96: 81 e0 ldi r24, 0x01 ; 1 + 2d98: 80 83 st Z, r24 + CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; + 2d9a: 88 e8 ldi r24, 0x88 ; 136 + 2d9c: 83 83 std Z+3, r24 ; 0x03 + CODEC_TIMER_SAMPLING.INTCTRLB = TC_CCAINTLVL_HI_gc; + 2d9e: 83 e0 ldi r24, 0x03 ; 3 + 2da0: 87 83 std Z+7, r24 ; 0x07 + + /* Start looking out for modulation pause via interrupt. */ + CODEC_DEMOD_IN_PORT.INT0MASK = CODEC_DEMOD_IN_MASK0; + 2da2: 84 e0 ldi r24, 0x04 ; 4 + 2da4: 1a 96 adiw r26, 0x0a ; 10 + 2da6: 8c 93 st X, r24 + SLEEP.CTRL &= ~SLEEP_SEN_bm; +} + +INLINE void SystemSleepSetMode(uint8_t SleepMode) +{ + SLEEP.CTRL = (SLEEP.CTRL & ~SLEEP_SMODE_gm) | SleepMode; + 2da8: e8 e4 ldi r30, 0x48 ; 72 + 2daa: f0 e0 ldi r31, 0x00 ; 0 + 2dac: 80 81 ld r24, Z + 2dae: 81 7f andi r24, 0xF1 ; 241 + 2db0: 86 60 ori r24, 0x06 ; 6 + 2db2: 80 83 st Z, r24 + 2db4: 08 95 ret + +00002db6 <__vector_34>: + SystemSleepSetMode(SYSTEM_SMODE_PSAVE); +} + +ISR(CODEC_DEMOD_IN_INT0_VECT) { + 2db6: 1f 92 push r1 + 2db8: 0f 92 push r0 + 2dba: 0f b6 in r0, 0x3f ; 63 + 2dbc: 0f 92 push r0 + 2dbe: 11 24 eor r1, r1 + 2dc0: 8f 93 push r24 + 2dc2: 9f 93 push r25 + 2dc4: ef 93 push r30 + 2dc6: ff 93 push r31 + 2dc8: e8 e4 ldi r30, 0x48 ; 72 + 2dca: f0 e0 ldi r31, 0x00 ; 0 + 2dcc: 80 81 ld r24, Z + 2dce: 81 7f andi r24, 0xF1 ; 241 + 2dd0: 80 83 st Z, r24 + * 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; + 2dd2: e0 e4 ldi r30, 0x40 ; 64 + 2dd4: f8 e0 ldi r31, 0x08 ; 8 + 2dd6: 13 82 std Z+3, r1 ; 0x03 + CODEC_TIMER_SAMPLING.PERBUF = SAMPLE_RATE_SYSTEM_CYCLES/2 - 1; /* Half bit width */ + 2dd8: 86 e9 ldi r24, 0x96 ; 150 + 2dda: 90 e0 ldi r25, 0x00 ; 0 + 2ddc: 86 ab std Z+54, r24 ; 0x36 + 2dde: 97 ab std Z+55, r25 ; 0x37 + CODEC_TIMER_SAMPLING.CCABUF = SAMPLE_RATE_SYSTEM_CYCLES/8 - 10 - 1; /* Compensate for DIGFILT and ISR prolog */ + 2de0: 8a e1 ldi r24, 0x1A ; 26 + 2de2: 90 e0 ldi r25, 0x00 ; 0 + 2de4: 80 af std Z+56, r24 ; 0x38 + 2de6: 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; + 2de8: e0 e4 ldi r30, 0x40 ; 64 + 2dea: f9 e0 ldi r31, 0x09 ; 9 + 2dec: 10 a2 std Z+32, r1 ; 0x20 + 2dee: 11 a2 std Z+33, r1 ; 0x21 + CODEC_TIMER_LOADMOD.PER = 0xFFFF; + 2df0: 8f ef ldi r24, 0xFF ; 255 + 2df2: 9f ef ldi r25, 0xFF ; 255 + 2df4: 86 a3 std Z+38, r24 ; 0x26 + 2df6: 97 a3 std Z+39, r25 ; 0x27 + CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH1_gc; + 2df8: 89 e8 ldi r24, 0x89 ; 137 + 2dfa: 83 83 std Z+3, r24 ; 0x03 + CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_EVCH6_gc; + 2dfc: 8e e0 ldi r24, 0x0E ; 14 + 2dfe: 80 83 st Z, r24 + + /* Disable this interrupt */ + CODEC_DEMOD_IN_PORT.INT0MASK = 0; + 2e00: e0 e2 ldi r30, 0x20 ; 32 + 2e02: f6 e0 ldi r31, 0x06 ; 6 + 2e04: 12 86 std Z+10, r1 ; 0x0a +} + 2e06: ff 91 pop r31 + 2e08: ef 91 pop r30 + 2e0a: 9f 91 pop r25 + 2e0c: 8f 91 pop r24 + 2e0e: 0f 90 pop r0 + 2e10: 0f be out 0x3f, r0 ; 63 + 2e12: 0f 90 pop r0 + 2e14: 1f 90 pop r1 + 2e16: 18 95 reti + +00002e18 <__vector_22>: + +ISR(CODEC_TIMER_SAMPLING_CCA_VECT) { + 2e18: 1f 92 push r1 + 2e1a: 0f 92 push r0 + 2e1c: 0f b6 in r0, 0x3f ; 63 + 2e1e: 0f 92 push r0 + 2e20: 11 24 eor r1, r1 + 2e22: 2f 93 push r18 + 2e24: 8f 93 push r24 + 2e26: 9f 93 push r25 + 2e28: ef 93 push r30 + 2e2a: 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; + 2e2c: 90 91 28 06 lds r25, 0x0628 + uint8_t NewSampleRegister; + + /* Shift sampled bit into sampling register and hold a local copy for fast access. */ + NewSampleRegister = SampleRegister << 1; + 2e30: 80 91 b0 28 lds r24, 0x28B0 + 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; + 2e34: 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); + 2e36: 21 e0 ldi r18, 0x01 ; 1 + 2e38: 09 f0 breq .+2 ; 0x2e3c <__vector_22+0x24> + 2e3a: 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; + 2e3c: 88 0f add r24, r24 + NewSampleRegister |= (!SamplePin ? 0x01 : 0x00); + 2e3e: 82 2b or r24, r18 + SampleRegister = NewSampleRegister; + 2e40: 80 93 b0 28 sts 0x28B0, r24 + + if (SamplePosition) { + 2e44: 90 91 ac 28 lds r25, 0x28AC + 2e48: 99 23 and r25, r25 + 2e4a: a1 f1 breq .+104 ; 0x2eb4 <__vector_22+0x9c> + /* Analyze the sampling register after 2 samples. */ + if ((NewSampleRegister & 0x07) == 0x07) { + 2e4c: 98 2f mov r25, r24 + 2e4e: 97 70 andi r25, 0x07 ; 7 + 2e50: 97 30 cpi r25, 0x07 ; 7 + 2e52: 09 f4 brne .+2 ; 0x2e56 <__vector_22+0x3e> + 2e54: 42 c0 rjmp .+132 ; 0x2eda <__vector_22+0xc2> + + /* Signal, that we have finished sampling */ + Flags.DemodFinished = 1; + } else { + /* Otherwise, we check the two sample bits from the bit before. */ + uint8_t BitSample = NewSampleRegister & 0xC; + 2e56: 98 2f mov r25, r24 + 2e58: 9c 70 andi r25, 0x0C ; 12 + uint8_t Bit = 0; + + if (BitSample != (0x0 << 2)) { + 2e5a: 61 f1 breq .+88 ; 0x2eb4 <__vector_22+0x9c> + /* We have a valid bit. decode and process it. */ + if (BitSample & (0x1 << 2)) { + 2e5c: 91 e0 ldi r25, 0x01 ; 1 + 2e5e: 82 fd sbrc r24, 2 + 2e60: 6b c0 rjmp .+214 ; 0x2f38 <__vector_22+0x120> + } else { + /* 10 sequence -> This is a one bit */ + Bit = 1; + } + + LastBit = Bit; + 2e62: 90 93 ae 28 sts 0x28AE, r25 + + if (!IsParityBit) { + 2e66: 80 91 af 28 lds r24, 0x28AF + 2e6a: 81 11 cpse r24, r1 + 2e6c: 6d c0 rjmp .+218 ; 0x2f48 <__vector_22+0x130> + /* This is a data bit, so shift it into the data register and + * hold a local copy of it. */ + uint8_t NewDataRegister = DataRegister >> 1; + 2e6e: 80 91 b1 28 lds r24, 0x28B1 + 2e72: 86 95 lsr r24 + NewDataRegister |= (Bit ? 0x80 : 0x00); + 2e74: 99 23 and r25, r25 + 2e76: 09 f4 brne .+2 ; 0x2e7a <__vector_22+0x62> + 2e78: 71 c0 rjmp .+226 ; 0x2f5c <__vector_22+0x144> + 2e7a: 20 e8 ldi r18, 0x80 ; 128 + 2e7c: 28 2b or r18, r24 + DataRegister = NewDataRegister; + 2e7e: 20 93 b1 28 sts 0x28B1, r18 + + /* Update bitcount */ + uint16_t NewBitCount = ++BitCount; + 2e82: 80 91 b4 28 lds r24, 0x28B4 + 2e86: 90 91 b5 28 lds r25, 0x28B5 + 2e8a: 01 96 adiw r24, 0x01 ; 1 + 2e8c: 80 93 b4 28 sts 0x28B4, r24 + 2e90: 90 93 b5 28 sts 0x28B5, r25 + if ((NewBitCount & 0x07) == 0) { + 2e94: 87 70 andi r24, 0x07 ; 7 + 2e96: 99 27 eor r25, r25 + 2e98: 89 2b or r24, r25 + 2e9a: 61 f4 brne .+24 ; 0x2eb4 <__vector_22+0x9c> + /* We have reached a byte boundary! Store the data register. */ + /* TODO: Prevent buffer overflow */ + *CodecBufferPtr++ = NewDataRegister; + 2e9c: e0 91 b8 28 lds r30, 0x28B8 + 2ea0: f0 91 b9 28 lds r31, 0x28B9 + 2ea4: 21 93 st Z+, r18 + 2ea6: e0 93 b8 28 sts 0x28B8, r30 + 2eaa: f0 93 b9 28 sts 0x28B9, r31 + + /* Store bit for determining FDT at EOC and enable parity + * handling on next bit. */ + IsParityBit = true; + 2eae: 81 e0 ldi r24, 0x01 ; 1 + 2eb0: 80 93 af 28 sts 0x28AF, r24 + } + } else { + /* On odd sample position just sample. */ + } + + SamplePosition = !SamplePosition; + 2eb4: 80 91 ac 28 lds r24, 0x28AC + 2eb8: 91 e0 ldi r25, 0x01 ; 1 + 2eba: 89 27 eor r24, r25 + 2ebc: 80 93 ac 28 sts 0x28AC, r24 + + /* Make sure the sampling timer gets automatically aligned to the + * modulation pauses by using the RESTART event. + * This can be understood as a "poor mans PLL" and makes sure that we are + * never too far out the bit-grid while sampling. */ + CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; + 2ec0: 88 e8 ldi r24, 0x88 ; 136 + 2ec2: 80 93 43 08 sts 0x0843, r24 +} + 2ec6: ff 91 pop r31 + 2ec8: ef 91 pop r30 + 2eca: 9f 91 pop r25 + 2ecc: 8f 91 pop r24 + 2ece: 2f 91 pop r18 + 2ed0: 0f 90 pop r0 + 2ed2: 0f be out 0x3f, r0 ; 63 + 2ed4: 0f 90 pop r0 + 2ed6: 1f 90 pop r1 + 2ed8: 18 95 reti + + if (SamplePosition) { + /* Analyze the sampling register after 2 samples. */ + if ((NewSampleRegister & 0x07) == 0x07) { + /* No carrier modulation for 3 sample points. EOC! */ + CODEC_TIMER_SAMPLING.CTRLA = TC_CLKSEL_OFF_gc; + 2eda: 10 92 40 08 sts 0x0840, r1 + CODEC_TIMER_SAMPLING.INTFLAGS = TC0_CCAIF_bm; + 2ede: 80 e1 ldi r24, 0x10 ; 16 + 2ee0: 80 93 4c 08 sts 0x084C, r24 + + /* By this time, the FDT timer is aligned to the last modulation + * edge of the reader. So we disable the auto-synchronization and + * let it count the frame delay time in the background, and generate + * an interrupt once it has reached the FDT. */ + CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_OFF_gc; + 2ee4: 10 92 43 09 sts 0x0943, r1 + + if (LastBit) { + 2ee8: 80 91 ae 28 lds r24, 0x28AE + 2eec: 88 23 and r24, r24 + 2eee: 79 f1 breq .+94 ; 0x2f4e <__vector_22+0x136> + CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; + 2ef0: 8c eb ldi r24, 0xBC ; 188 + 2ef2: 94 e0 ldi r25, 0x04 ; 4 + 2ef4: 80 93 66 09 sts 0x0966, r24 + 2ef8: 90 93 67 09 sts 0x0967, r25 + } else { + CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; + } + + LoadModState = LOADMOD_FDT; + 2efc: 10 92 ad 28 sts 0x28AD, r1 + + CODEC_TIMER_LOADMOD.INTFLAGS = TC1_OVFIF_bm; + 2f00: 81 e0 ldi r24, 0x01 ; 1 + 2f02: 80 93 4c 09 sts 0x094C, r24 + CODEC_TIMER_LOADMOD.INTCTRLA = TC_OVFINTLVL_HI_gc; + 2f06: 83 e0 ldi r24, 0x03 ; 3 + 2f08: 80 93 46 09 sts 0x0946, r24 + + /* Determine if we did not receive a multiple of 8 bits. + * If this is the case, right-align the remaining data and + * store it into the buffer. */ + uint8_t RemainingBits = BitCount % 8; + 2f0c: 80 91 b4 28 lds r24, 0x28B4 + 2f10: 90 91 b5 28 lds r25, 0x28B5 + 2f14: 87 70 andi r24, 0x07 ; 7 + if (RemainingBits != 0) { + 2f16: 61 f0 breq .+24 ; 0x2f30 <__vector_22+0x118> + uint8_t NewDataRegister = DataRegister; + 2f18: 90 91 b1 28 lds r25, 0x28B1 + + while (RemainingBits++ < 8) { + 2f1c: 8f 5f subi r24, 0xFF ; 255 + /* Pad with zeroes to right-align. */ + NewDataRegister >>= 1; + 2f1e: 96 95 lsr r25 + * store it into the buffer. */ + uint8_t RemainingBits = BitCount % 8; + if (RemainingBits != 0) { + uint8_t NewDataRegister = DataRegister; + + while (RemainingBits++ < 8) { + 2f20: 8f 5f subi r24, 0xFF ; 255 + 2f22: 89 30 cpi r24, 0x09 ; 9 + 2f24: e1 f7 brne .-8 ; 0x2f1e <__vector_22+0x106> + /* Pad with zeroes to right-align. */ + NewDataRegister >>= 1; + } + + /* TODO: Prevent buffer overflow */ + *CodecBufferPtr = NewDataRegister; + 2f26: e0 91 b8 28 lds r30, 0x28B8 + 2f2a: f0 91 b9 28 lds r31, 0x28B9 + 2f2e: 90 83 st Z, r25 + } + + /* Signal, that we have finished sampling */ + Flags.DemodFinished = 1; + 2f30: 81 e0 ldi r24, 0x01 ; 1 + 2f32: 80 93 b6 28 sts 0x28B6, r24 + 2f36: be cf rjmp .-132 ; 0x2eb4 <__vector_22+0x9c> + uint8_t BitSample = NewSampleRegister & 0xC; + uint8_t Bit = 0; + + if (BitSample != (0x0 << 2)) { + /* We have a valid bit. decode and process it. */ + if (BitSample & (0x1 << 2)) { + 2f38: 90 e0 ldi r25, 0x00 ; 0 + } else { + /* 10 sequence -> This is a one bit */ + Bit = 1; + } + + LastBit = Bit; + 2f3a: 90 93 ae 28 sts 0x28AE, r25 + + if (!IsParityBit) { + 2f3e: 80 91 af 28 lds r24, 0x28AF + 2f42: 88 23 and r24, r24 + 2f44: 09 f4 brne .+2 ; 0x2f48 <__vector_22+0x130> + 2f46: 93 cf rjmp .-218 ; 0x2e6e <__vector_22+0x56> + + } else { + /* This is a parity bit. Store it */ + /* TODO: Store parity and prevent overflow */ + //*ParityBufferPtr++ = Bit; + IsParityBit = false; + 2f48: 10 92 af 28 sts 0x28AF, r1 + 2f4c: b3 cf rjmp .-154 ; 0x2eb4 <__vector_22+0x9c> + CODEC_TIMER_LOADMOD.CTRLD = TC_EVACT_OFF_gc; + + if (LastBit) { + CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV1; + } else { + CODEC_TIMER_LOADMOD.PER = ISO14443A_FRAME_DELAY_PREV0; + 2f4e: 8c e7 ldi r24, 0x7C ; 124 + 2f50: 94 e0 ldi r25, 0x04 ; 4 + 2f52: 80 93 66 09 sts 0x0966, r24 + 2f56: 90 93 67 09 sts 0x0967, r25 + 2f5a: d0 cf rjmp .-96 ; 0x2efc <__vector_22+0xe4> + + if (!IsParityBit) { + /* This is a data bit, so shift it into the data register and + * hold a local copy of it. */ + uint8_t NewDataRegister = DataRegister >> 1; + NewDataRegister |= (Bit ? 0x80 : 0x00); + 2f5c: 20 e0 ldi r18, 0x00 ; 0 + 2f5e: 8e cf rjmp .-228 ; 0x2e7c <__vector_22+0x64> + +00002f60 <__vector_83>: + * This can be understood as a "poor mans PLL" and makes sure that we are + * never too far out the bit-grid while sampling. */ + CODEC_TIMER_SAMPLING.CTRLD = TC_EVACT_RESTART_gc | TC_EVSEL_CH0_gc; +} + +ISR(CODEC_TIMER_OVF_VECT) { + 2f60: 1f 92 push r1 + 2f62: 0f 92 push r0 + 2f64: 0f b6 in r0, 0x3f ; 63 + 2f66: 0f 92 push r0 + 2f68: 11 24 eor r1, r1 + 2f6a: 2f 93 push r18 + 2f6c: 3f 93 push r19 + 2f6e: 8f 93 push r24 + 2f70: 9f 93 push r25 + 2f72: ef 93 push r30 + 2f74: ff 93 push r31 + /* Bit rate timer. Output a half bit on the output. */ + uint8_t Temp8; + uint16_t Temp16; + + switch (LoadModState) { + 2f76: 80 91 ad 28 lds r24, 0x28AD + 2f7a: 85 30 cpi r24, 0x05 ; 5 + 2f7c: 09 f4 brne .+2 ; 0x2f80 <__vector_83+0x20> + 2f7e: 4d c0 rjmp .+154 ; 0x301a <__stack+0x1b> + 2f80: a8 f0 brcs .+42 ; 0x2fac <__vector_83+0x4c> + 2f82: 88 30 cpi r24, 0x08 ; 8 + 2f84: 09 f4 brne .+2 ; 0x2f88 <__vector_83+0x28> + 2f86: 7c c0 rjmp .+248 ; 0x3080 <__stack+0x81> + 2f88: 20 f5 brcc .+72 ; 0x2fd2 <__vector_83+0x72> + 2f8a: 86 30 cpi r24, 0x06 ; 6 + 2f8c: 09 f4 brne .+2 ; 0x2f90 <__vector_83+0x30> + 2f8e: b8 c0 rjmp .+368 ; 0x3100 <__stack+0x101> + 2f90: 87 30 cpi r24, 0x07 ; 7 + 2f92: 09 f4 brne .+2 ; 0x2f96 <__vector_83+0x36> + 2f94: 8a c0 rjmp .+276 ; 0x30aa <__stack+0xab> + break; + + default: + break; + } +} + 2f96: ff 91 pop r31 + 2f98: ef 91 pop r30 + 2f9a: 9f 91 pop r25 + 2f9c: 8f 91 pop r24 + 2f9e: 3f 91 pop r19 + 2fa0: 2f 91 pop r18 + 2fa2: 0f 90 pop r0 + 2fa4: 0f be out 0x3f, r0 ; 63 + 2fa6: 0f 90 pop r0 + 2fa8: 1f 90 pop r1 + 2faa: 18 95 reti +ISR(CODEC_TIMER_OVF_VECT) { + /* Bit rate timer. Output a half bit on the output. */ + uint8_t Temp8; + uint16_t Temp16; + + switch (LoadModState) { + 2fac: 82 30 cpi r24, 0x02 ; 2 + 2fae: 71 f1 breq .+92 ; 0x300c <__stack+0xd> + 2fb0: f8 f0 brcs .+62 ; 0x2ff0 <__vector_83+0x90> + 2fb2: 83 30 cpi r24, 0x03 ; 3 + 2fb4: 09 f4 brne .+2 ; 0x2fb8 <__vector_83+0x58> + 2fb6: 56 c0 rjmp .+172 ; 0x3064 <__stack+0x65> + 2fb8: 84 30 cpi r24, 0x04 ; 4 + 2fba: 69 f7 brne .-38 ; 0x2f96 <__vector_83+0x36> + /* Fetch first byte */ + DataRegister = *CodecBufferPtr; + break; + + case LOADMOD_DATA0: + if (DataRegister & 1) { + 2fbc: 80 91 b1 28 lds r24, 0x28B1 + 2fc0: 80 fd sbrc r24, 0 + 2fc2: b7 c0 rjmp .+366 ; 0x3132 <__stack+0x133> + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + } else { + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 2fc4: 80 e4 ldi r24, 0x40 ; 64 + 2fc6: 80 93 46 06 sts 0x0646, r24 + } + + LoadModState = LOADMOD_DATA1; + 2fca: 85 e0 ldi r24, 0x05 ; 5 + 2fcc: 80 93 ad 28 sts 0x28AD, r24 + break; + 2fd0: e2 cf rjmp .-60 ; 0x2f96 <__vector_83+0x36> +ISR(CODEC_TIMER_OVF_VECT) { + /* Bit rate timer. Output a half bit on the output. */ + uint8_t Temp8; + uint16_t Temp16; + + switch (LoadModState) { + 2fd2: 89 30 cpi r24, 0x09 ; 9 + 2fd4: 09 f4 brne .+2 ; 0x2fd8 <__vector_83+0x78> + 2fd6: 5b c0 rjmp .+182 ; 0x308e <__stack+0x8f> + 2fd8: 8a 30 cpi r24, 0x0A ; 10 + 2fda: e9 f6 brne .-70 ; 0x2f96 <__vector_83+0x36> + + case LOADMOD_FINISHED: + /* We have written all of our bits. Deactivate the loadmod + * timer. Also disable the bit-rate interrupt again. And + * stop the subcarrier divider. */ + CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_OFF_gc; + 2fdc: 10 92 40 09 sts 0x0940, r1 + CODEC_TIMER_LOADMOD.INTCTRLA = 0; + 2fe0: 10 92 46 09 sts 0x0946, r1 + CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_OFF_gc; + 2fe4: 10 92 00 08 sts 0x0800, r1 + + /* Signal application that we have finished loadmod */ + Flags.LoadmodFinished = 1; + 2fe8: 81 e0 ldi r24, 0x01 ; 1 + 2fea: 80 93 b7 28 sts 0x28B7, r24 + break; + 2fee: d3 cf rjmp .-90 ; 0x2f96 <__vector_83+0x36> +ISR(CODEC_TIMER_OVF_VECT) { + /* Bit rate timer. Output a half bit on the output. */ + uint8_t Temp8; + uint16_t Temp16; + + switch (LoadModState) { + 2ff0: 88 23 and r24, r24 + 2ff2: 09 f4 brne .+2 ; 0x2ff6 <__vector_83+0x96> + 2ff4: 53 c0 rjmp .+166 ; 0x309c <__stack+0x9d> + 2ff6: 81 30 cpi r24, 0x01 ; 1 + 2ff8: 71 f6 brne .-100 ; 0x2f96 <__vector_83+0x36> + break; + + case LOADMOD_START: + /* Application produced data. With this interrupt we are aligned to the bit-grid. + * Start subcarrier generation and align to bitrate. */ + CODEC_TIMER_LOADMOD.PER = ISO14443A_BIT_RATE_CYCLES / 2 - 1; + 2ffa: 8f e3 ldi r24, 0x3F ; 63 + 2ffc: 90 e0 ldi r25, 0x00 ; 0 + 2ffe: 80 93 66 09 sts 0x0966, r24 + 3002: 90 93 67 09 sts 0x0967, r25 + CODEC_SUBCARRIER_TIMER.CTRLA = TC_CLKSEL_EVCH6_gc; + 3006: 8e e0 ldi r24, 0x0E ; 14 + 3008: 80 93 00 08 sts 0x0800, r24 + + /* Fallthrough to first bit */ + + case LOADMOD_START_BIT0: + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + 300c: 80 e4 ldi r24, 0x40 ; 64 + 300e: 80 93 45 06 sts 0x0645, r24 + LoadModState = LOADMOD_START_BIT1; + 3012: 83 e0 ldi r24, 0x03 ; 3 + 3014: 80 93 ad 28 sts 0x28AD, r24 + break; + 3018: be cf rjmp .-132 ; 0x2f96 <__vector_83+0x36> + + LoadModState = LOADMOD_DATA1; + break; + + case LOADMOD_DATA1: + Temp8 = DataRegister; + 301a: 80 91 b1 28 lds r24, 0x28B1 + + if (Temp8 & 1) { + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 301e: 90 e4 ldi r25, 0x40 ; 64 + break; + + case LOADMOD_DATA1: + Temp8 = DataRegister; + + if (Temp8 & 1) { + 3020: 80 fd sbrc r24, 0 + 3022: 84 c0 rjmp .+264 ; 0x312c <__stack+0x12d> + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + } else { + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + 3024: 90 93 45 06 sts 0x0645, r25 + } + + DataRegister = Temp8 >> 1; + 3028: 86 95 lsr r24 + 302a: 80 93 b1 28 sts 0x28B1, r24 + + Temp16 = BitSent; + 302e: 80 91 b2 28 lds r24, 0x28B2 + 3032: 90 91 b3 28 lds r25, 0x28B3 + BitSent = ++Temp16; + 3036: 01 96 adiw r24, 0x01 ; 1 + 3038: 80 93 b2 28 sts 0x28B2, r24 + 303c: 90 93 b3 28 sts 0x28B3, r25 + + if ((Temp16 & 0x07) == 0) { + 3040: 9c 01 movw r18, r24 + 3042: 27 70 andi r18, 0x07 ; 7 + 3044: 33 27 eor r19, r19 + 3046: 23 2b or r18, r19 + 3048: 09 f4 brne .+2 ; 0x304c <__stack+0x4d> + 304a: 77 c0 rjmp .+238 ; 0x313a <__stack+0x13b> + /* Byte boundary. Load parity bit and output it later. */ + LoadModState = LOADMOD_PARITY0; + break; + } + + if (Temp16 == BitCount) { + 304c: 20 91 b4 28 lds r18, 0x28B4 + 3050: 30 91 b5 28 lds r19, 0x28B5 + 3054: 82 17 cp r24, r18 + 3056: 93 07 cpc r25, r19 + 3058: 09 f0 breq .+2 ; 0x305c <__stack+0x5d> + 305a: 4e c0 rjmp .+156 ; 0x30f8 <__stack+0xf9> + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + } + + if (BitSent == BitCount) { + /* No data left */ + LoadModState = LOADMOD_STOP_BIT0; + 305c: 88 e0 ldi r24, 0x08 ; 8 + 305e: 80 93 ad 28 sts 0x28AD, r24 + 3062: 99 cf rjmp .-206 ; 0x2f96 <__vector_83+0x36> + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + LoadModState = LOADMOD_START_BIT1; + break; + + case LOADMOD_START_BIT1: + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 3064: 80 e4 ldi r24, 0x40 ; 64 + 3066: 80 93 46 06 sts 0x0646, r24 + LoadModState = LOADMOD_DATA0; + 306a: 84 e0 ldi r24, 0x04 ; 4 + 306c: 80 93 ad 28 sts 0x28AD, r24 + + /* Fetch first byte */ + DataRegister = *CodecBufferPtr; + 3070: e0 91 b8 28 lds r30, 0x28B8 + 3074: f0 91 b9 28 lds r31, 0x28B9 + 3078: 80 81 ld r24, Z + 307a: 80 93 b1 28 sts 0x28B1, r24 + break; + 307e: 8b cf rjmp .-234 ; 0x2f96 <__vector_83+0x36> + } + + break; + + case LOADMOD_STOP_BIT0: + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 3080: 80 e4 ldi r24, 0x40 ; 64 + 3082: 80 93 46 06 sts 0x0646, r24 + LoadModState = LOADMOD_STOP_BIT1; + 3086: 89 e0 ldi r24, 0x09 ; 9 + 3088: 80 93 ad 28 sts 0x28AD, r24 + break; + 308c: 84 cf rjmp .-248 ; 0x2f96 <__vector_83+0x36> + + case LOADMOD_STOP_BIT1: + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 308e: 80 e4 ldi r24, 0x40 ; 64 + 3090: 80 93 46 06 sts 0x0646, r24 + LoadModState = LOADMOD_FINISHED; + 3094: 8a e0 ldi r24, 0x0A ; 10 + 3096: 80 93 ad 28 sts 0x28AD, r24 + break; + 309a: 7d cf rjmp .-262 ; 0x2f96 <__vector_83+0x36> + uint16_t Temp16; + + switch (LoadModState) { + case LOADMOD_FDT: + /* No data has been produced, but FDT has ended. Switch over to bit-grid aligning. */ + CODEC_TIMER_LOADMOD.PER = ISO14443A_BIT_GRID_CYCLES - 1; + 309c: 8f e7 ldi r24, 0x7F ; 127 + 309e: 90 e0 ldi r25, 0x00 ; 0 + 30a0: 80 93 66 09 sts 0x0966, r24 + 30a4: 90 93 67 09 sts 0x0967, r25 + break; + 30a8: 76 cf rjmp .-276 ; 0x2f96 <__vector_83+0x36> + + LoadModState = LOADMOD_PARITY1; + break; + + case LOADMOD_PARITY1: + if (*ParityBufferPtr) { + 30aa: e0 91 ba 28 lds r30, 0x28BA + 30ae: f0 91 bb 28 lds r31, 0x28BB + 30b2: 80 81 ld r24, Z + 30b4: 81 11 cpse r24, r1 + 30b6: 36 c0 rjmp .+108 ; 0x3124 <__stack+0x125> + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + } else { + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + 30b8: 80 e4 ldi r24, 0x40 ; 64 + 30ba: 80 93 45 06 sts 0x0645, r24 + } + + if (BitSent == BitCount) { + 30be: 20 91 b2 28 lds r18, 0x28B2 + 30c2: 30 91 b3 28 lds r19, 0x28B3 + 30c6: 80 91 b4 28 lds r24, 0x28B4 + 30ca: 90 91 b5 28 lds r25, 0x28B5 + 30ce: 28 17 cp r18, r24 + 30d0: 39 07 cpc r19, r25 + 30d2: 21 f2 breq .-120 ; 0x305c <__stack+0x5d> + /* No data left */ + LoadModState = LOADMOD_STOP_BIT0; + } else { + /* Fetch next data and continue sending bits. */ + ParityBufferPtr++; + 30d4: 31 96 adiw r30, 0x01 ; 1 + 30d6: e0 93 ba 28 sts 0x28BA, r30 + 30da: f0 93 bb 28 sts 0x28BB, r31 + DataRegister = *++CodecBufferPtr; + 30de: e0 91 b8 28 lds r30, 0x28B8 + 30e2: f0 91 b9 28 lds r31, 0x28B9 + 30e6: cf 01 movw r24, r30 + 30e8: 01 96 adiw r24, 0x01 ; 1 + 30ea: 80 93 b8 28 sts 0x28B8, r24 + 30ee: 90 93 b9 28 sts 0x28B9, r25 + 30f2: 81 81 ldd r24, Z+1 ; 0x01 + 30f4: 80 93 b1 28 sts 0x28B1, r24 + LoadModState = LOADMOD_DATA0; + 30f8: 84 e0 ldi r24, 0x04 ; 4 + 30fa: 80 93 ad 28 sts 0x28AD, r24 + 30fe: 4b cf rjmp .-362 ; 0x2f96 <__vector_83+0x36> + LoadModState = LOADMOD_DATA0; + + break; + + case LOADMOD_PARITY0: + if (*ParityBufferPtr) { + 3100: e0 91 ba 28 lds r30, 0x28BA + 3104: f0 91 bb 28 lds r31, 0x28BB + 3108: 80 81 ld r24, Z + 310a: 81 11 cpse r24, r1 + 310c: 07 c0 rjmp .+14 ; 0x311c <__stack+0x11d> + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + } else { + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 310e: 80 e4 ldi r24, 0x40 ; 64 + 3110: 80 93 46 06 sts 0x0646, r24 + } + + LoadModState = LOADMOD_PARITY1; + 3114: 87 e0 ldi r24, 0x07 ; 7 + 3116: 80 93 ad 28 sts 0x28AD, r24 + break; + 311a: 3d cf rjmp .-390 ; 0x2f96 <__vector_83+0x36> + + break; + + case LOADMOD_PARITY0: + if (*ParityBufferPtr) { + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + 311c: 80 e4 ldi r24, 0x40 ; 64 + 311e: 80 93 45 06 sts 0x0645, r24 + 3122: f8 cf rjmp .-16 ; 0x3114 <__stack+0x115> + LoadModState = LOADMOD_PARITY1; + break; + + case LOADMOD_PARITY1: + if (*ParityBufferPtr) { + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 3124: 80 e4 ldi r24, 0x40 ; 64 + 3126: 80 93 46 06 sts 0x0646, r24 + 312a: c9 cf rjmp .-110 ; 0x30be <__stack+0xbf> + + case LOADMOD_DATA1: + Temp8 = DataRegister; + + if (Temp8 & 1) { + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 312c: 90 93 46 06 sts 0x0646, r25 + 3130: 7b cf rjmp .-266 ; 0x3028 <__stack+0x29> + DataRegister = *CodecBufferPtr; + break; + + case LOADMOD_DATA0: + if (DataRegister & 1) { + CODEC_LOADMOD_PORT.OUTSET = CODEC_LOADMOD_MASK; + 3132: 80 e4 ldi r24, 0x40 ; 64 + 3134: 80 93 45 06 sts 0x0645, r24 + 3138: 48 cf rjmp .-368 ; 0x2fca <__vector_83+0x6a> + Temp16 = BitSent; + BitSent = ++Temp16; + + if ((Temp16 & 0x07) == 0) { + /* Byte boundary. Load parity bit and output it later. */ + LoadModState = LOADMOD_PARITY0; + 313a: 86 e0 ldi r24, 0x06 ; 6 + 313c: 80 93 ad 28 sts 0x28AD, r24 + break; + 3140: 2a cf rjmp .-428 ; 0x2f96 <__vector_83+0x36> + +00003142 : + default: + break; + } +} + +void ISO14443ACodecInit(void) { + 3142: cf 93 push r28 + 3144: 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; + 3146: e0 e4 ldi r30, 0x40 ; 64 + 3148: f6 e0 ldi r31, 0x06 ; 6 + 314a: 84 e0 ldi r24, 0x04 ; 4 + 314c: 82 83 std Z+2, r24 ; 0x02 + CODEC_CARRIER_IN_PORT.CODEC_CARRIER_IN_PINCTRL = PORT_ISC_BOTHEDGES_gc; + 314e: 12 8a std Z+18, r1 ; 0x12 + EVSYS.CH6MUX = CODEC_CARRIER_IN_EVMUX; + 3150: c0 e8 ldi r28, 0x80 ; 128 + 3152: d1 e0 ldi r29, 0x01 ; 1 + 3154: 82 e6 ldi r24, 0x62 ; 98 + 3156: 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; + 3158: a0 e2 ldi r26, 0x20 ; 32 + 315a: b6 e0 ldi r27, 0x06 ; 6 + 315c: 85 e0 ldi r24, 0x05 ; 5 + 315e: 12 96 adiw r26, 0x02 ; 2 + 3160: 8c 93 st X, r24 + 3162: 12 97 sbiw r26, 0x02 ; 2 + CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL0 = PORT_ISC_RISING_gc; + 3164: 81 e0 ldi r24, 0x01 ; 1 + 3166: 52 96 adiw r26, 0x12 ; 18 + 3168: 8c 93 st X, r24 + 316a: 52 97 sbiw r26, 0x12 ; 18 + CODEC_DEMOD_IN_PORT.CODEC_DEMOD_IN_PINCTRL1 = PORT_ISC_FALLING_gc; + 316c: 82 e0 ldi r24, 0x02 ; 2 + 316e: 50 96 adiw r26, 0x10 ; 16 + 3170: 8c 93 st X, r24 + 3172: 50 97 sbiw r26, 0x10 ; 16 + CODEC_DEMOD_IN_PORT.INT0MASK = 0; + 3174: 1a 96 adiw r26, 0x0a ; 10 + 3176: 1c 92 st X, r1 + 3178: 1a 97 sbiw r26, 0x0a ; 10 + CODEC_DEMOD_IN_PORT.INTCTRL = PORT_INT0LVL_HI_gc; + 317a: 83 e0 ldi r24, 0x03 ; 3 + 317c: 19 96 adiw r26, 0x09 ; 9 + 317e: 8c 93 st X, r24 + EVSYS.CH0MUX = CODEC_DEMOD_IN_EVMUX0; + 3180: 9a e5 ldi r25, 0x5A ; 90 + 3182: 98 83 st Y, r25 + EVSYS.CH1MUX = CODEC_DEMOD_IN_EVMUX1; + 3184: 98 e5 ldi r25, 0x58 ; 88 + 3186: 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; + 3188: 90 e4 ldi r25, 0x40 ; 64 + 318a: 91 83 std Z+1, r25 ; 0x01 + CODEC_LOADMOD_PORT.OUTCLR = CODEC_LOADMOD_MASK; + 318c: 96 83 std Z+6, r25 ; 0x06 + CODEC_SUBCARRIER_PORT.DIRSET = CODEC_SUBCARRIER_MASK; + 318e: 81 83 std Z+1, r24 ; 0x01 + CODEC_SUBCARRIER_PORT.OUTCLR = CODEC_SUBCARRIER_MASK; + 3190: 86 83 std Z+6, r24 ; 0x06 + + /* Configure subcarrier generation with 50% DC output using OOK */ + CODEC_SUBCARRIER_TIMER.PER = ISO14443A_SUBCARRIER_DIVIDER - 1; + 3192: e0 e0 ldi r30, 0x00 ; 0 + 3194: f8 e0 ldi r31, 0x08 ; 8 + 3196: 8f e0 ldi r24, 0x0F ; 15 + 3198: 90 e0 ldi r25, 0x00 ; 0 + 319a: 86 a3 std Z+38, r24 ; 0x26 + 319c: 97 a3 std Z+39, r25 ; 0x27 + CODEC_SUBCARRIER_TIMER.CODEC_SUBCARRIER_CC_OOK = ISO14443A_SUBCARRIER_DIVIDER/2; + 319e: 88 e0 ldi r24, 0x08 ; 8 + 31a0: 90 e0 ldi r25, 0x00 ; 0 + 31a2: 82 a7 std Z+42, r24 ; 0x2a + 31a4: 93 a7 std Z+43, r25 ; 0x2b + CODEC_SUBCARRIER_TIMER.CTRLB = CODEC_SUBCARRIER_CCEN_OOK | TC_WGMODE_SINGLESLOPE_gc; + 31a6: 83 e2 ldi r24, 0x23 ; 35 + 31a8: 81 83 std Z+1, r24 ; 0x01 +void ISO14443ACodecInit(void) { + /* Initialize common peripherals and start listening + * for incoming data. */ + Initialize(); + StartDemod(); +} + 31aa: df 91 pop r29 + 31ac: cf 91 pop r28 + +void ISO14443ACodecInit(void) { + /* Initialize common peripherals and start listening + * for incoming data. */ + Initialize(); + StartDemod(); + 31ae: c6 cd rjmp .-1140 ; 0x2d3c + +000031b0 : +} + +void ISO14443ACodecTask(void) { + 31b0: 0f 93 push r16 + 31b2: 1f 93 push r17 + 31b4: cf 93 push r28 + 31b6: df 93 push r29 + if (Flags.DemodFinished) { + 31b8: 80 91 b6 28 lds r24, 0x28B6 + 31bc: 88 23 and r24, r24 + 31be: c1 f0 breq .+48 ; 0x31f0 + Flags.DemodFinished = 0; + 31c0: 10 92 b6 28 sts 0x28B6, r1 +INLINE void CodecTask(void) { + ActiveConfiguration.CodecTaskFunc(); +} + +INLINE void CodecSetDemodPower(bool bOnOff) { + CODEC_DEMOD_POWER_PORT.DIRSET = CODEC_DEMOD_POWER_MASK; + 31c4: 82 e0 ldi r24, 0x02 ; 2 + 31c6: 80 93 21 06 sts 0x0621, r24 + + if (bOnOff) { + CODEC_DEMOD_POWER_PORT.OUTSET = CODEC_DEMOD_POWER_MASK; + } else { + CODEC_DEMOD_POWER_PORT.OUTCLR = CODEC_DEMOD_POWER_MASK; + 31ca: 80 93 26 06 sts 0x0626, r24 + /* Reception finished. Process the received bytes */ + CodecSetDemodPower(false); + + uint16_t DemodBitCount = BitCount; + 31ce: 00 91 b4 28 lds r16, 0x28B4 + 31d2: 10 91 b5 28 lds r17, 0x28B5 + uint16_t AnswerBitCount = ISO14443A_APP_NO_RESPONSE; + + if (DemodBitCount > 0) { + 31d6: 01 15 cp r16, r1 + 31d8: 11 05 cpc r17, r1 + 31da: 99 f4 brne .+38 ; 0x3202 +INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { + return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); +} + +INLINE void ApplicationReset(void) { + ActiveConfiguration.ApplicationResetFunc(); + 31dc: e0 91 f9 28 lds r30, 0x28F9 + 31e0: f0 91 fa 28 lds r31, 0x28FA + 31e4: 09 95 icall + CodecBufferPtr = CodecBuffer; + ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; + LoadModState = LOADMOD_START; + } else { + /* No data to be processed. Disable loadmodding and start listening again */ + CODEC_TIMER_LOADMOD.CTRLA = TC_CLKSEL_OFF_gc; + 31e6: 10 92 40 09 sts 0x0940, r1 + CODEC_TIMER_LOADMOD.INTCTRLA = 0; + 31ea: 10 92 46 09 sts 0x0946, r1 + + StartDemod(); + 31ee: a6 dd rcall .-1204 ; 0x2d3c + } + } + + if (Flags.LoadmodFinished) { + 31f0: 80 91 b7 28 lds r24, 0x28B7 + 31f4: 81 11 cpse r24, r1 + 31f6: 5a c0 rjmp .+180 ; 0x32ac + * for incoming data again. */ + StartDemod(); + } + + //SystemSleep(); +} + 31f8: df 91 pop r29 + 31fa: cf 91 pop r28 + 31fc: 1f 91 pop r17 + 31fe: 0f 91 pop r16 + 3200: 08 95 ret + + uint16_t DemodBitCount = BitCount; + uint16_t AnswerBitCount = ISO14443A_APP_NO_RESPONSE; + + if (DemodBitCount > 0) { + LogEntry(LOG_INFO_RX_DATA, CodecBuffer, (DemodBitCount+7)/8); + 3202: a8 01 movw r20, r16 + 3204: 49 5f subi r20, 0xF9 ; 249 + 3206: 5f 4f sbci r21, 0xFF ; 255 + 3208: 56 95 lsr r21 + 320a: 47 95 ror r20 + 320c: 56 95 lsr r21 + 320e: 47 95 ror r20 + 3210: 56 95 lsr r21 + 3212: 47 95 ror r20 +void LogSetModeById(LogModeEnum Mode); +bool LogSetModeByName(const char* Name); +void LogGetModeByName(char* Name, uint16_t BufferSize); +void LogGetModeList(char* List, uint16_t BufferSize); + +INLINE void LogEntry(LogEntryEnum Entry, void* Data, uint8_t Length) { LogFunc(Entry, Data, Length); } + 3214: e0 91 07 29 lds r30, 0x2907 + 3218: f0 91 08 29 lds r31, 0x2908 + 321c: 6c e3 ldi r22, 0x3C ; 60 + 321e: 7a e2 ldi r23, 0x2A ; 42 + 3220: 80 e2 ldi r24, 0x20 ; 32 + 3222: 09 95 icall + LEDTrigger(LED_CODEC_RX, LED_PULSE); + 3224: 63 e1 ldi r22, 0x13 ; 19 + 3226: 86 e0 ldi r24, 0x06 ; 6 + 3228: 0e 94 af 0f call 0x1f5e ; 0x1f5e +INLINE void ApplicationTask(void) { + ActiveConfiguration.ApplicationTaskFunc(); +} + +INLINE uint16_t ApplicationProcess(uint8_t* ByteBuffer, uint16_t ByteCount) { + return ActiveConfiguration.ApplicationProcessFunc(ByteBuffer, ByteCount); + 322c: e0 91 fd 28 lds r30, 0x28FD + 3230: f0 91 fe 28 lds r31, 0x28FE + 3234: b8 01 movw r22, r16 + 3236: 8c e3 ldi r24, 0x3C ; 60 + 3238: 9a e2 ldi r25, 0x2A ; 42 + 323a: 09 95 icall + 323c: 8c 01 movw r16, r24 + + /* Call application if we received data */ + AnswerBitCount = ApplicationProcess(CodecBuffer, DemodBitCount); + + if (AnswerBitCount & ISO14443A_APP_CUSTOM_PARITY) { + 323e: 94 ff sbrs r25, 4 + 3240: 3c c0 rjmp .+120 ; 0x32ba + /* Application has generated it's own parity bits. + * Clear this option bit. */ + AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; + 3242: 1f 7e andi r17, 0xEF ; 239 + } + } else { + ApplicationReset(); + } + + if (AnswerBitCount != ISO14443A_APP_NO_RESPONSE) { + 3244: 01 15 cp r16, r1 + 3246: 11 05 cpc r17, r1 + 3248: 71 f2 breq .-100 ; 0x31e6 + LogEntry(LOG_INFO_TX_DATA, CodecBuffer, (AnswerBitCount + 7) / 8); + 324a: a8 01 movw r20, r16 + 324c: 49 5f subi r20, 0xF9 ; 249 + 324e: 5f 4f sbci r21, 0xFF ; 255 + 3250: 56 95 lsr r21 + 3252: 47 95 ror r20 + 3254: 56 95 lsr r21 + 3256: 47 95 ror r20 + 3258: 56 95 lsr r21 + 325a: 47 95 ror r20 + 325c: e0 91 07 29 lds r30, 0x2907 + 3260: f0 91 08 29 lds r31, 0x2908 + 3264: 6c e3 ldi r22, 0x3C ; 60 + 3266: 7a e2 ldi r23, 0x2A ; 42 + 3268: 81 e2 ldi r24, 0x21 ; 33 + 326a: 09 95 icall + LEDTrigger(LED_CODEC_TX, LED_PULSE); + 326c: 63 e1 ldi r22, 0x13 ; 19 + 326e: 87 e0 ldi r24, 0x07 ; 7 + 3270: 0e 94 af 0f call 0x1f5e ; 0x1f5e + + BitCount = AnswerBitCount; + 3274: 00 93 b4 28 sts 0x28B4, r16 + 3278: 10 93 b5 28 sts 0x28B5, r17 + BitSent = 0; + 327c: 10 92 b2 28 sts 0x28B2, r1 + 3280: 10 92 b3 28 sts 0x28B3, r1 + CodecBufferPtr = CodecBuffer; + 3284: 8c e3 ldi r24, 0x3C ; 60 + 3286: 9a e2 ldi r25, 0x2A ; 42 + 3288: 80 93 b8 28 sts 0x28B8, r24 + 328c: 90 93 b9 28 sts 0x28B9, r25 + ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; + 3290: 8c eb ldi r24, 0xBC ; 188 + 3292: 9a e2 ldi r25, 0x2A ; 42 + 3294: 80 93 ba 28 sts 0x28BA, r24 + 3298: 90 93 bb 28 sts 0x28BB, r25 + LoadModState = LOADMOD_START; + 329c: 81 e0 ldi r24, 0x01 ; 1 + 329e: 80 93 ad 28 sts 0x28AD, r24 + + StartDemod(); + } + } + + if (Flags.LoadmodFinished) { + 32a2: 80 91 b7 28 lds r24, 0x28B7 + 32a6: 88 23 and r24, r24 + 32a8: 09 f4 brne .+2 ; 0x32ac + 32aa: a6 cf rjmp .-180 ; 0x31f8 + Flags.LoadmodFinished = 0; + 32ac: 10 92 b7 28 sts 0x28B7, r1 + * for incoming data again. */ + StartDemod(); + } + + //SystemSleep(); +} + 32b0: df 91 pop r29 + 32b2: cf 91 pop r28 + 32b4: 1f 91 pop r17 + 32b6: 0f 91 pop r16 + + if (Flags.LoadmodFinished) { + Flags.LoadmodFinished = 0; + /* Load modulation has been finished. Stop it and start to listen + * for incoming data again. */ + StartDemod(); + 32b8: 41 cd rjmp .-1406 ; 0x2d3c + /* 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++) { + 32ba: 96 95 lsr r25 + 32bc: 87 95 ror r24 + 32be: 96 95 lsr r25 + 32c0: 87 95 ror r24 + 32c2: 96 95 lsr r25 + 32c4: 87 95 ror r24 + 32c6: 00 97 sbiw r24, 0x00 ; 0 + 32c8: 09 f4 brne .+2 ; 0x32cc + 32ca: bc cf rjmp .-136 ; 0x3244 + 32cc: 40 e0 ldi r20, 0x00 ; 0 + 32ce: 20 e0 ldi r18, 0x00 ; 0 + 32d0: 30 e0 ldi r19, 0x00 ; 0 + /* For each whole byte, generate a parity bit. */ + CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = + ODD_PARITY(CodecBuffer[i]); + 32d2: f9 01 movw r30, r18 + 32d4: e4 5c subi r30, 0xC4 ; 196 + 32d6: f5 4d sbci r31, 0xD5 ; 213 + 32d8: 20 81 ld r18, Z + 32da: 02 2e mov r0, r18 + 32dc: 22 95 swap r18 + 32de: 20 25 eor r18, r0 + 32e0: 02 2e mov r0, r18 + 32e2: 26 95 lsr r18 + 32e4: 26 95 lsr r18 + 32e6: 20 25 eor r18, r0 + AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; + } else { + /* We have to generate the parity bits ourself */ + for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { + /* For each whole byte, generate a parity bit. */ + CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = + 32e8: e0 58 subi r30, 0x80 ; 128 + 32ea: ff 4f sbci r31, 0xFF ; 255 + ODD_PARITY(CodecBuffer[i]); + 32ec: 30 e0 ldi r19, 0x00 ; 0 + 32ee: 2f 5f subi r18, 0xFF ; 255 + 32f0: 3f 4f sbci r19, 0xFF ; 255 + 32f2: 21 fb bst r18, 1 + 32f4: 55 27 eor r21, r21 + 32f6: 50 f9 bld r21, 0 + 32f8: c5 2f mov r28, r21 + 32fa: 20 e0 ldi r18, 0x00 ; 0 + 32fc: d2 2f mov r29, r18 + 32fe: 51 e0 ldi r21, 0x01 ; 1 + 3300: c5 27 eor r28, r21 + 3302: c0 83 st Z, r28 + /* Application has generated it's own parity bits. + * Clear this option bit. */ + AnswerBitCount &= ~ISO14443A_APP_CUSTOM_PARITY; + } else { + /* We have to generate the parity bits ourself */ + for (uint8_t i = 0; i < (AnswerBitCount / 8); i++) { + 3304: 4f 5f subi r20, 0xFF ; 255 + 3306: 24 2f mov r18, r20 + 3308: 30 e0 ldi r19, 0x00 ; 0 + 330a: 28 17 cp r18, r24 + 330c: 39 07 cpc r19, r25 + 330e: 08 f3 brcs .-62 ; 0x32d2 + 3310: 99 cf rjmp .-206 ; 0x3244 + +00003312 : + +static uint8_t CompatWritePageAddress; + +void MifareUltralightAppInit(void) +{ + State = STATE_IDLE; + 3312: 81 e0 ldi r24, 0x01 ; 1 + 3314: 80 93 bc 28 sts 0x28BC, r24 + 3318: 08 95 ret + +0000331a : +} + +void MifareUltralightAppReset(void) +{ + State = STATE_IDLE; + 331a: 81 e0 ldi r24, 0x01 ; 1 + 331c: 80 93 bc 28 sts 0x28BC, r24 + 3320: 08 95 ret + +00003322 : +} + +void MifareUltralightAppTask(void) +{ + 3322: 08 95 ret + +00003324 : + +} + + +uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + 3324: ff 92 push r15 + 3326: 0f 93 push r16 + 3328: 1f 93 push r17 + 332a: cf 93 push r28 + 332c: df 93 push r29 + 332e: 00 d0 rcall .+0 ; 0x3330 + 3330: 00 d0 rcall .+0 ; 0x3332 + 3332: cd b7 in r28, 0x3d ; 61 + 3334: de b7 in r29, 0x3e ; 62 + 3336: 8c 01 movw r16, r24 + uint8_t Cmd = Buffer[0]; + 3338: fc 01 movw r30, r24 + 333a: 90 81 ld r25, Z + + switch(State) { + 333c: 80 91 bc 28 lds r24, 0x28BC + 3340: 82 30 cpi r24, 0x02 ; 2 + 3342: 09 f4 brne .+2 ; 0x3346 + 3344: 5b c0 rjmp .+182 ; 0x33fc + 3346: 80 f4 brcc .+32 ; 0x3368 +INLINE +bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) +{ + uint8_t* DataPtr = (uint8_t*) Buffer; + + if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ + 3348: 96 32 cpi r25, 0x26 ; 38 + 334a: a9 f1 breq .+106 ; 0x33b6 + 334c: 92 35 cpi r25, 0x52 ; 82 + 334e: 99 f1 breq .+102 ; 0x33b6 + + *BitCount = ISO14443A_SAK_FRAME_SIZE; + return true; + } else { + /* We have not been selected. Don't send anything. */ + *BitCount = 0; + 3350: 20 e0 ldi r18, 0x00 ; 0 + 3352: 30 e0 ldi r19, 0x00 ; 0 + break; + } + + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; +} + 3354: c9 01 movw r24, r18 + 3356: 24 96 adiw r28, 0x04 ; 4 + 3358: cd bf out 0x3d, r28 ; 61 + 335a: de bf out 0x3e, r29 ; 62 + 335c: df 91 pop r29 + 335e: cf 91 pop r28 + 3360: 1f 91 pop r17 + 3362: 0f 91 pop r16 + 3364: ff 90 pop r15 + 3366: 08 95 ret + +uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + uint8_t Cmd = Buffer[0]; + + switch(State) { + 3368: 84 30 cpi r24, 0x04 ; 4 + 336a: 79 f1 breq .+94 ; 0x33ca + 336c: 68 f4 brcc .+26 ; 0x3388 +INLINE +bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) +{ + uint8_t* DataPtr = (uint8_t*) Buffer; + + if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ + 336e: 96 32 cpi r25, 0x26 ; 38 + 3370: 11 f1 breq .+68 ; 0x33b6 + 3372: 92 35 cpi r25, 0x52 ; 82 + 3374: 01 f1 breq .+64 ; 0x33b6 + + case STATE_READY2: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + return BitCount; + } else if (Cmd == ISO14443A_CMD_SELECT_CL2) { + 3376: 95 39 cpi r25, 0x95 ; 149 + 3378: 09 f4 brne .+2 ; 0x337c + 337a: 90 c0 rjmp .+288 ; 0x349c + Buffer[0] = NAK_INVALID_ARG; + return NAK_FRAME_SIZE; + } + } else { + /* Unknown command. Enter halt state */ + State = STATE_IDLE; + 337c: 81 e0 ldi r24, 0x01 ; 1 + 337e: 80 93 bc 28 sts 0x28BC, r24 + /* Unknown state? Should never happen. */ + break; + } + + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; + 3382: 20 e0 ldi r18, 0x00 ; 0 + 3384: 30 e0 ldi r19, 0x00 ; 0 + } + } else { + /* Unknown command. Enter halt state */ + State = STATE_IDLE; + } + break; + 3386: e6 cf rjmp .-52 ; 0x3354 + +uint16_t MifareUltralightAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + uint8_t Cmd = Buffer[0]; + + switch(State) { + 3388: 85 30 cpi r24, 0x05 ; 5 + 338a: 11 f7 brne .-60 ; 0x3350 + } + break; + + case STATE_COMPAT_WRITE: + /* Compatibility write. Receiving 16 bytes of data of which 4 bytes are valid. */ + if (ISO14443ACheckCRCA(Buffer, BYTES_PER_COMPAT_WRITE)) { + 338c: 60 e1 ldi r22, 0x10 ; 16 + 338e: 70 e0 ldi r23, 0x00 ; 0 + 3390: c8 01 movw r24, r16 + 3392: e7 d7 rcall .+4046 ; 0x4362 + 3394: 88 23 and r24, r24 + 3396: 09 f4 brne .+2 ; 0x339a + 3398: 6b c0 rjmp .+214 ; 0x3470 + /* We don't perform any checks here. You will be able to program the + * whole memory. Also there is no OTP behaviour. */ + if (!ActiveConfiguration.ReadOnly) { + 339a: 80 91 06 29 lds r24, 0x2906 + 339e: 88 23 and r24, r24 + 33a0: 09 f4 brne .+2 ; 0x33a4 + 33a2: 6f c0 rjmp .+222 ; 0x3482 + } else { + /* If we are told to be read only, we silently ignore the write command + * and pretend to have written data. */ + } + + State = STATE_ACTIVE; + 33a4: 84 e0 ldi r24, 0x04 ; 4 + 33a6: 80 93 bc 28 sts 0x28BC, r24 + Buffer[0] = ACK_VALUE; + 33aa: 8a e0 ldi r24, 0x0A ; 10 + 33ac: f8 01 movw r30, r16 + 33ae: 80 83 st Z, r24 + return ACK_FRAME_SIZE; + 33b0: 24 e0 ldi r18, 0x04 ; 4 + 33b2: 30 e0 ldi r19, 0x00 ; 0 + 33b4: cf cf rjmp .-98 ; 0x3354 + DataPtr[0] = (ATQAValue >> 0) & 0x00FF; + 33b6: 84 e4 ldi r24, 0x44 ; 68 + 33b8: f8 01 movw r30, r16 + 33ba: 80 83 st Z, r24 + DataPtr[1] = (ATQAValue >> 8) & 0x00FF; + 33bc: 11 82 std Z+1, r1 ; 0x01 + } + break; + + case STATE_ACTIVE: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + 33be: 82 e0 ldi r24, 0x02 ; 2 + 33c0: 80 93 bc 28 sts 0x28BC, r24 + + *BitCount = ISO14443A_ATQA_FRAME_SIZE; + 33c4: 20 e1 ldi r18, 0x10 ; 16 + 33c6: 30 e0 ldi r19, 0x00 ; 0 + return BitCount; + 33c8: c5 cf rjmp .-118 ; 0x3354 +INLINE +bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) +{ + uint8_t* DataPtr = (uint8_t*) Buffer; + + if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ + 33ca: 96 32 cpi r25, 0x26 ; 38 + 33cc: a1 f3 breq .-24 ; 0x33b6 + 33ce: 92 35 cpi r25, 0x52 ; 82 + 33d0: 91 f3 breq .-28 ; 0x33b6 + } else if (Cmd == CMD_READ) { + 33d2: 90 33 cpi r25, 0x30 ; 48 + 33d4: 09 f4 brne .+2 ; 0x33d8 + 33d6: 8e c0 rjmp .+284 ; 0x34f4 + } + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else if (Cmd == CMD_WRITE) { + 33d8: 92 3a cpi r25, 0xA2 ; 162 + 33da: 09 f4 brne .+2 ; 0x33de + 33dc: ba c0 rjmp .+372 ; 0x3552 + } + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else if (Cmd == CMD_COMPAT_WRITE) { + 33de: 90 3a cpi r25, 0xA0 ; 160 + 33e0: 09 f4 brne .+2 ; 0x33e4 + 33e2: d4 c0 rjmp .+424 ; 0x358c + } + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else if (Cmd == CMD_HALT) { + 33e4: 90 35 cpi r25, 0x50 ; 80 + 33e6: 51 f6 brne .-108 ; 0x337c + /* Halts the tag. According to the ISO14443, the second + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + 33e8: f8 01 movw r30, r16 + 33ea: 81 81 ldd r24, Z+1 ; 0x01 + 33ec: 88 23 and r24, r24 + 33ee: 09 f4 brne .+2 ; 0x33f2 + 33f0: df c0 rjmp .+446 ; 0x35b0 + } else { + Buffer[0] = NAK_CRC_ERROR; + return NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_INVALID_ARG; + 33f2: f8 01 movw r30, r16 + 33f4: 10 82 st Z, r1 + return NAK_FRAME_SIZE; + 33f6: 24 e0 ldi r18, 0x04 ; 4 + 33f8: 30 e0 ldi r19, 0x00 ; 0 + 33fa: ac cf rjmp .-168 ; 0x3354 + 33fc: 96 32 cpi r25, 0x26 ; 38 + 33fe: d9 f2 breq .-74 ; 0x33b6 + 3400: 92 35 cpi r25, 0x52 ; 82 + 3402: c9 f2 breq .-78 ; 0x33b6 + + case STATE_READY1: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + return BitCount; + } else if (Cmd == ISO14443A_CMD_SELECT_CL1) { + 3404: 93 39 cpi r25, 0x93 ; 147 + 3406: 09 f0 breq .+2 ; 0x340a + 3408: b9 cf rjmp .-142 ; 0x337c + /* 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 }; + 340a: 19 82 std Y+1, r1 ; 0x01 + 340c: 1a 82 std Y+2, r1 ; 0x02 + 340e: 1b 82 std Y+3, r1 ; 0x03 + 3410: 1c 82 std Y+4, r1 ; 0x04 + 3412: 88 e8 ldi r24, 0x88 ; 136 + 3414: 89 83 std Y+1, r24 ; 0x01 + + MemoryReadBlock(&UidCL1[1], UID_CL1_ADDRESS, UID_CL1_SIZE); + 3416: 43 e0 ldi r20, 0x03 ; 3 + 3418: 50 e0 ldi r21, 0x00 ; 0 + 341a: 60 e0 ldi r22, 0x00 ; 0 + 341c: 70 e0 ldi r23, 0x00 ; 0 + 341e: ce 01 movw r24, r28 + 3420: 02 96 adiw r24, 0x02 ; 2 + 3422: 0e 94 de 06 call 0xdbc ; 0xdbc + 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) { + 3426: f8 01 movw r30, r16 + 3428: 81 81 ldd r24, Z+1 ; 0x01 + 342a: 80 32 cpi r24, 0x20 ; 32 + 342c: 09 f4 brne .+2 ; 0x3430 + 342e: 81 c0 rjmp .+258 ; 0x3532 + 3430: 80 37 cpi r24, 0x70 ; 112 + 3432: 09 f0 breq .+2 ; 0x3436 + 3434: 8d cf rjmp .-230 ; 0x3350 + return false; + + case ISO14443A_NVB_AC_END: + /* End of anticollision procedure. + * Send SAK CLn if we are selected. */ + if ( (DataPtr[2] == UidCL[0]) && + 3436: f8 01 movw r30, r16 + 3438: 92 81 ldd r25, Z+2 ; 0x02 + 343a: 89 81 ldd r24, Y+1 ; 0x01 + 343c: 98 13 cpse r25, r24 + 343e: 88 cf rjmp .-240 ; 0x3350 + 3440: 93 81 ldd r25, Z+3 ; 0x03 + 3442: 8a 81 ldd r24, Y+2 ; 0x02 + 3444: 98 13 cpse r25, r24 + 3446: 84 cf rjmp .-248 ; 0x3350 + (DataPtr[3] == UidCL[1]) && + 3448: 94 81 ldd r25, Z+4 ; 0x04 + 344a: 8b 81 ldd r24, Y+3 ; 0x03 + 344c: 98 13 cpse r25, r24 + 344e: 80 cf rjmp .-256 ; 0x3350 + (DataPtr[4] == UidCL[2]) && + 3450: 95 81 ldd r25, Z+5 ; 0x05 + 3452: 8c 81 ldd r24, Y+4 ; 0x04 + 3454: 98 13 cpse r25, r24 + 3456: 7c cf rjmp .-264 ; 0x3350 + (DataPtr[5] == UidCL[3]) ) { + + DataPtr[0] = SAKValue; + 3458: 84 e0 ldi r24, 0x04 ; 4 + 345a: 80 83 st Z, r24 + ISO14443AAppendCRCA(Buffer, 1); + 345c: 61 e0 ldi r22, 0x01 ; 1 + 345e: 70 e0 ldi r23, 0x00 ; 0 + 3460: c8 01 movw r24, r16 + 3462: 50 d7 rcall .+3744 ; 0x4304 + + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) { + /* CL1 stage has ended successfully */ + State = STATE_READY2; + 3464: 83 e0 ldi r24, 0x03 ; 3 + 3466: 80 93 bc 28 sts 0x28BC, r24 + + *BitCount = ISO14443A_SAK_FRAME_SIZE; + 346a: 28 e1 ldi r18, 0x18 ; 24 + 346c: 30 e0 ldi r19, 0x00 ; 0 + 346e: 72 cf rjmp .-284 ; 0x3354 + + State = STATE_ACTIVE; + Buffer[0] = ACK_VALUE; + return ACK_FRAME_SIZE; + } else { + State = STATE_ACTIVE; + 3470: 84 e0 ldi r24, 0x04 ; 4 + 3472: 80 93 bc 28 sts 0x28BC, r24 + Buffer[0] = NAK_CRC_ERROR; + 3476: 81 e0 ldi r24, 0x01 ; 1 + 3478: f8 01 movw r30, r16 + 347a: 80 83 st Z, r24 + return NAK_FRAME_SIZE; + 347c: 24 e0 ldi r18, 0x04 ; 4 + 347e: 30 e0 ldi r19, 0x00 ; 0 + 3480: 69 cf rjmp .-302 ; 0x3354 + /* Compatibility write. Receiving 16 bytes of data of which 4 bytes are valid. */ + if (ISO14443ACheckCRCA(Buffer, BYTES_PER_COMPAT_WRITE)) { + /* We don't perform any checks here. You will be able to program the + * whole memory. Also there is no OTP behaviour. */ + if (!ActiveConfiguration.ReadOnly) { + MemoryWriteBlock(Buffer, CompatWritePageAddress * BYTES_PER_PAGE, BYTES_PER_WRITE); + 3482: 60 91 bd 28 lds r22, 0x28BD + 3486: 70 e0 ldi r23, 0x00 ; 0 + 3488: 66 0f add r22, r22 + 348a: 77 1f adc r23, r23 + 348c: 66 0f add r22, r22 + 348e: 77 1f adc r23, r23 + 3490: 44 e0 ldi r20, 0x04 ; 4 + 3492: 50 e0 ldi r21, 0x00 ; 0 + 3494: c8 01 movw r24, r16 + 3496: 0e 94 f6 06 call 0xdec ; 0xdec + 349a: 84 cf rjmp .-248 ; 0x33a4 + return BitCount; + } else if (Cmd == ISO14443A_CMD_SELECT_CL2) { + /* Load UID CL2 and perform anticollision */ + uint8_t UidCL2[ISO14443A_CL_UID_SIZE]; + + MemoryReadBlock(UidCL2, UID_CL2_ADDRESS, UID_CL2_SIZE); + 349c: 44 e0 ldi r20, 0x04 ; 4 + 349e: 50 e0 ldi r21, 0x00 ; 0 + 34a0: 64 e0 ldi r22, 0x04 ; 4 + 34a2: 70 e0 ldi r23, 0x00 ; 0 + 34a4: ce 01 movw r24, r28 + 34a6: 01 96 adiw r24, 0x01 ; 1 + 34a8: 0e 94 de 06 call 0xdbc ; 0xdbc + 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) { + 34ac: f8 01 movw r30, r16 + 34ae: 81 81 ldd r24, Z+1 ; 0x01 + 34b0: 80 32 cpi r24, 0x20 ; 32 + 34b2: 09 f4 brne .+2 ; 0x34b6 + 34b4: 3e c0 rjmp .+124 ; 0x3532 + 34b6: 80 37 cpi r24, 0x70 ; 112 + 34b8: 09 f0 breq .+2 ; 0x34bc + 34ba: 4a cf rjmp .-364 ; 0x3350 + return false; + + case ISO14443A_NVB_AC_END: + /* End of anticollision procedure. + * Send SAK CLn if we are selected. */ + if ( (DataPtr[2] == UidCL[0]) && + 34bc: f8 01 movw r30, r16 + 34be: 92 81 ldd r25, Z+2 ; 0x02 + 34c0: 89 81 ldd r24, Y+1 ; 0x01 + 34c2: 98 13 cpse r25, r24 + 34c4: 45 cf rjmp .-374 ; 0x3350 + 34c6: 93 81 ldd r25, Z+3 ; 0x03 + 34c8: 8a 81 ldd r24, Y+2 ; 0x02 + 34ca: 98 13 cpse r25, r24 + 34cc: 41 cf rjmp .-382 ; 0x3350 + (DataPtr[3] == UidCL[1]) && + 34ce: 94 81 ldd r25, Z+4 ; 0x04 + 34d0: 8b 81 ldd r24, Y+3 ; 0x03 + 34d2: 98 13 cpse r25, r24 + 34d4: 3d cf rjmp .-390 ; 0x3350 + (DataPtr[4] == UidCL[2]) && + 34d6: 95 81 ldd r25, Z+5 ; 0x05 + 34d8: 8c 81 ldd r24, Y+4 ; 0x04 + 34da: 98 13 cpse r25, r24 + 34dc: 39 cf rjmp .-398 ; 0x3350 + (DataPtr[5] == UidCL[3]) ) { + + DataPtr[0] = SAKValue; + 34de: 10 82 st Z, r1 + ISO14443AAppendCRCA(Buffer, 1); + 34e0: 61 e0 ldi r22, 0x01 ; 1 + 34e2: 70 e0 ldi r23, 0x00 ; 0 + 34e4: c8 01 movw r24, r16 + 34e6: 0e d7 rcall .+3612 ; 0x4304 + + 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; + 34e8: 84 e0 ldi r24, 0x04 ; 4 + 34ea: 80 93 bc 28 sts 0x28BC, r24 + + *BitCount = ISO14443A_SAK_FRAME_SIZE; + 34ee: 28 e1 ldi r18, 0x18 ; 24 + 34f0: 30 e0 ldi r19, 0x00 ; 0 + 34f2: 30 cf rjmp .-416 ; 0x3354 + case STATE_ACTIVE: + if (ISO14443AWakeUp(Buffer, &BitCount, ATQA_VALUE)) { + State = STATE_READY1; + return BitCount; + } else if (Cmd == CMD_READ) { + uint8_t PageAddress = Buffer[1]; + 34f4: f8 01 movw r30, r16 + 34f6: f1 80 ldd r15, Z+1 ; 0x01 + + if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { + 34f8: 62 e0 ldi r22, 0x02 ; 2 + 34fa: 70 e0 ldi r23, 0x00 ; 0 + 34fc: c8 01 movw r24, r16 + 34fe: 31 d7 rcall .+3682 ; 0x4362 + 3500: 88 23 and r24, r24 + 3502: 09 f4 brne .+2 ; 0x3506 + 3504: b8 cf rjmp .-144 ; 0x3476 + if ( (PageAddress >= PAGE_READ_MIN) + 3506: ff e0 ldi r31, 0x0F ; 15 + 3508: ff 15 cp r31, r15 + 350a: 08 f4 brcc .+2 ; 0x350e + 350c: 72 cf rjmp .-284 ; 0x33f2 + && (PageAddress <= PAGE_READ_MAX) ) { + /* TODO: Missing address wrap around behaviour. + * Implement using a for-loop copying 4 bytes each iteration + * and mask pageaddress */ + MemoryReadBlock(Buffer, PageAddress * BYTES_PER_PAGE, BYTES_PER_READ); + 350e: 6f 2d mov r22, r15 + 3510: 70 e0 ldi r23, 0x00 ; 0 + 3512: 66 0f add r22, r22 + 3514: 77 1f adc r23, r23 + 3516: 66 0f add r22, r22 + 3518: 77 1f adc r23, r23 + 351a: 40 e1 ldi r20, 0x10 ; 16 + 351c: 50 e0 ldi r21, 0x00 ; 0 + 351e: c8 01 movw r24, r16 + 3520: 0e 94 de 06 call 0xdbc ; 0xdbc + ISO14443AAppendCRCA(Buffer, BYTES_PER_READ); + 3524: 60 e1 ldi r22, 0x10 ; 16 + 3526: 70 e0 ldi r23, 0x00 ; 0 + 3528: c8 01 movw r24, r16 + 352a: ec d6 rcall .+3544 ; 0x4304 + return (BYTES_PER_READ + ISO14443A_CRCA_SIZE) * 8; + 352c: 20 e9 ldi r18, 0x90 ; 144 + 352e: 30 e0 ldi r19, 0x00 ; 0 + 3530: 11 cf rjmp .-478 ; 0x3354 + + switch (NVB) { + case ISO14443A_NVB_AC_START: + /* Start of anticollision procedure. + * Send whole UID CLn + BCC */ + DataPtr[0] = UidCL[0]; + 3532: 89 81 ldd r24, Y+1 ; 0x01 + 3534: f8 01 movw r30, r16 + 3536: 80 83 st Z, r24 + DataPtr[1] = UidCL[1]; + 3538: 3a 81 ldd r19, Y+2 ; 0x02 + 353a: 31 83 std Z+1, r19 ; 0x01 + DataPtr[2] = UidCL[2]; + 353c: 2b 81 ldd r18, Y+3 ; 0x03 + 353e: 22 83 std Z+2, r18 ; 0x02 + DataPtr[3] = UidCL[3]; + 3540: 9c 81 ldd r25, Y+4 ; 0x04 + 3542: 93 83 std Z+3, r25 ; 0x03 + DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); + 3544: 83 27 eor r24, r19 + 3546: 82 27 eor r24, r18 + 3548: 89 27 eor r24, r25 + 354a: 84 83 std Z+4, r24 ; 0x04 + + *BitCount = ISO14443A_CL_FRAME_SIZE; + 354c: 28 e2 ldi r18, 0x28 ; 40 + 354e: 30 e0 ldi r19, 0x00 ; 0 + 3550: 01 cf rjmp .-510 ; 0x3354 + return NAK_FRAME_SIZE; + } + } else if (Cmd == 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]; + 3552: f8 01 movw r30, r16 + 3554: f1 80 ldd r15, Z+1 ; 0x01 + if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { + 3556: 66 e0 ldi r22, 0x06 ; 6 + 3558: 70 e0 ldi r23, 0x00 ; 0 + 355a: c8 01 movw r24, r16 + 355c: 02 d7 rcall .+3588 ; 0x4362 + 355e: 88 23 and r24, r24 + 3560: 09 f4 brne .+2 ; 0x3564 + 3562: 89 cf rjmp .-238 ; 0x3476 + /* CRC check passed */ + if ( (PageAddress >= PAGE_WRITE_MIN) + && (PageAddress <= PAGE_WRITE_MAX) ) { + 3564: 8f 2d mov r24, r15 + 3566: 82 50 subi r24, 0x02 ; 2 + /* This is a write command containing 4 bytes of data that + * should be written to the given page address. */ + uint8_t PageAddress = Buffer[1]; + if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { + /* CRC check passed */ + if ( (PageAddress >= PAGE_WRITE_MIN) + 3568: 8e 30 cpi r24, 0x0E ; 14 + 356a: 08 f0 brcs .+2 ; 0x356e + 356c: 42 cf rjmp .-380 ; 0x33f2 + && (PageAddress <= PAGE_WRITE_MAX) ) { + /* PageAddress is within bounds. */ + + if (!ActiveConfiguration.ReadOnly) { + 356e: 80 91 06 29 lds r24, 0x2906 + 3572: 81 11 cpse r24, r1 + 3574: 1a cf rjmp .-460 ; 0x33aa + MemoryWriteBlock(&Buffer[2], PageAddress * BYTES_PER_PAGE, BYTES_PER_WRITE); + 3576: f4 e0 ldi r31, 0x04 ; 4 + 3578: ff 9e mul r15, r31 + 357a: b0 01 movw r22, r0 + 357c: 11 24 eor r1, r1 + 357e: 44 e0 ldi r20, 0x04 ; 4 + 3580: 50 e0 ldi r21, 0x00 ; 0 + 3582: c8 01 movw r24, r16 + 3584: 02 96 adiw r24, 0x02 ; 2 + 3586: 0e 94 f6 06 call 0xdec ; 0xdec + 358a: 0f cf rjmp .-482 ; 0x33aa + } + } else if (Cmd == CMD_COMPAT_WRITE) { + /* The Mifare compatbility write command is a 2-frame command. + * The first frame contains the page-address and the second frame + * holds the data. */ + uint8_t PageAddress = Buffer[1]; + 358c: f8 01 movw r30, r16 + 358e: f1 80 ldd r15, Z+1 ; 0x01 + + if (ISO14443ACheckCRCA(Buffer, CMD_COMPAT_WRITE_FRAME_SIZE)) { + 3590: 62 e0 ldi r22, 0x02 ; 2 + 3592: 70 e0 ldi r23, 0x00 ; 0 + 3594: c8 01 movw r24, r16 + 3596: e5 d6 rcall .+3530 ; 0x4362 + 3598: 88 23 and r24, r24 + 359a: 09 f4 brne .+2 ; 0x359e + 359c: 6c cf rjmp .-296 ; 0x3476 + if ( (PageAddress >= PAGE_WRITE_MIN) + && (PageAddress <= PAGE_WRITE_MAX) ) { + 359e: 8f 2d mov r24, r15 + 35a0: 82 50 subi r24, 0x02 ; 2 + * The first frame contains the page-address and the second frame + * holds the data. */ + uint8_t PageAddress = Buffer[1]; + + if (ISO14443ACheckCRCA(Buffer, CMD_COMPAT_WRITE_FRAME_SIZE)) { + if ( (PageAddress >= PAGE_WRITE_MIN) + 35a2: 8e 30 cpi r24, 0x0E ; 14 + 35a4: 08 f0 brcs .+2 ; 0x35a8 + 35a6: 25 cf rjmp .-438 ; 0x33f2 + && (PageAddress <= PAGE_WRITE_MAX) ) { + /* CRC check passed and page-address is within bounds. + * Store address and proceed to receiving the data. */ + CompatWritePageAddress = PageAddress; + 35a8: f0 92 bd 28 sts 0x28BD, r15 + State = STATE_COMPAT_WRITE; + 35ac: 85 e0 ldi r24, 0x05 ; 5 + 35ae: fb ce rjmp .-522 ; 0x33a6 + } + } else if (Cmd == CMD_HALT) { + /* Halts the tag. According to the ISO14443, the second + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + if (ISO14443ACheckCRCA(Buffer, 2)) { + 35b0: 62 e0 ldi r22, 0x02 ; 2 + 35b2: 70 e0 ldi r23, 0x00 ; 0 + 35b4: c8 01 movw r24, r16 + 35b6: d5 d6 rcall .+3498 ; 0x4362 + 35b8: 88 23 and r24, r24 + 35ba: 09 f4 brne .+2 ; 0x35be + 35bc: 5c cf rjmp .-328 ; 0x3476 + /* According to ISO14443, we must not send anything + * in order to acknowledge the HALT command. */ + State = STATE_HALT; + 35be: 10 92 bc 28 sts 0x28BC, r1 + return ISO14443A_APP_NO_RESPONSE; + 35c2: 20 e0 ldi r18, 0x00 ; 0 + 35c4: 30 e0 ldi r19, 0x00 ; 0 + 35c6: c6 ce rjmp .-628 ; 0x3354 + +000035c8 : + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; +} + +void MifareUltralightGetUid(ConfigurationUidType Uid) +{ + 35c8: cf 93 push r28 + 35ca: df 93 push r29 + 35cc: ec 01 movw r28, r24 + /* Read UID from memory */ + MemoryReadBlock(&Uid[0], UID_CL1_ADDRESS, UID_CL1_SIZE); + 35ce: 43 e0 ldi r20, 0x03 ; 3 + 35d0: 50 e0 ldi r21, 0x00 ; 0 + 35d2: 60 e0 ldi r22, 0x00 ; 0 + 35d4: 70 e0 ldi r23, 0x00 ; 0 + 35d6: 0e 94 de 06 call 0xdbc ; 0xdbc + MemoryReadBlock(&Uid[UID_CL1_SIZE], UID_CL2_ADDRESS, UID_CL2_SIZE); + 35da: 44 e0 ldi r20, 0x04 ; 4 + 35dc: 50 e0 ldi r21, 0x00 ; 0 + 35de: 64 e0 ldi r22, 0x04 ; 4 + 35e0: 70 e0 ldi r23, 0x00 ; 0 + 35e2: ce 01 movw r24, r28 + 35e4: 03 96 adiw r24, 0x03 ; 3 +} + 35e6: df 91 pop r29 + 35e8: 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); + 35ea: 0c 94 de 06 jmp 0xdbc ; 0xdbc + +000035ee : +} + +void MifareUltralightSetUid(ConfigurationUidType Uid) +{ + 35ee: 0f 93 push r16 + 35f0: 1f 93 push r17 + 35f2: cf 93 push r28 + 35f4: df 93 push r29 + 35f6: 00 d0 rcall .+0 ; 0x35f8 + 35f8: cd b7 in r28, 0x3d ; 61 + 35fa: de b7 in r29, 0x3e ; 62 + 35fc: 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]; + 35fe: fc 01 movw r30, r24 + 3600: 80 81 ld r24, Z + 3602: 91 81 ldd r25, Z+1 ; 0x01 + 3604: 89 27 eor r24, r25 + 3606: 98 e8 ldi r25, 0x88 ; 136 + 3608: 89 27 eor r24, r25 + 360a: 92 81 ldd r25, Z+2 ; 0x02 + 360c: 89 27 eor r24, r25 + 360e: 8a 83 std Y+2, r24 ; 0x02 + uint8_t BCC2 = Uid[3] ^ Uid[4] ^ Uid[5] ^ Uid[6]; + 3610: 84 81 ldd r24, Z+4 ; 0x04 + 3612: 93 81 ldd r25, Z+3 ; 0x03 + 3614: 89 27 eor r24, r25 + 3616: 95 81 ldd r25, Z+5 ; 0x05 + 3618: 89 27 eor r24, r25 + 361a: 96 81 ldd r25, Z+6 ; 0x06 + 361c: 89 27 eor r24, r25 + 361e: 89 83 std Y+1, r24 ; 0x01 + + MemoryWriteBlock(&Uid[0], UID_CL1_ADDRESS, UID_CL1_SIZE); + 3620: 43 e0 ldi r20, 0x03 ; 3 + 3622: 50 e0 ldi r21, 0x00 ; 0 + 3624: 60 e0 ldi r22, 0x00 ; 0 + 3626: 70 e0 ldi r23, 0x00 ; 0 + 3628: c8 01 movw r24, r16 + 362a: 0e 94 f6 06 call 0xdec ; 0xdec + MemoryWriteBlock(&BCC1, UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); + 362e: 41 e0 ldi r20, 0x01 ; 1 + 3630: 50 e0 ldi r21, 0x00 ; 0 + 3632: 63 e0 ldi r22, 0x03 ; 3 + 3634: 70 e0 ldi r23, 0x00 ; 0 + 3636: ce 01 movw r24, r28 + 3638: 02 96 adiw r24, 0x02 ; 2 + 363a: 0e 94 f6 06 call 0xdec ; 0xdec + MemoryWriteBlock(&Uid[UID_CL1_SIZE], UID_CL2_ADDRESS, UID_CL2_SIZE); + 363e: 44 e0 ldi r20, 0x04 ; 4 + 3640: 50 e0 ldi r21, 0x00 ; 0 + 3642: 64 e0 ldi r22, 0x04 ; 4 + 3644: 70 e0 ldi r23, 0x00 ; 0 + 3646: c8 01 movw r24, r16 + 3648: 03 96 adiw r24, 0x03 ; 3 + 364a: 0e 94 f6 06 call 0xdec ; 0xdec + MemoryWriteBlock(&BCC2, UID_BCC2_ADDRESS, ISO14443A_CL_BCC_SIZE); + 364e: 41 e0 ldi r20, 0x01 ; 1 + 3650: 50 e0 ldi r21, 0x00 ; 0 + 3652: 68 e0 ldi r22, 0x08 ; 8 + 3654: 70 e0 ldi r23, 0x00 ; 0 + 3656: ce 01 movw r24, r28 + 3658: 01 96 adiw r24, 0x01 ; 1 + 365a: 0e 94 f6 06 call 0xdec ; 0xdec +} + 365e: 0f 90 pop r0 + 3660: 0f 90 pop r0 + 3662: df 91 pop r29 + 3664: cf 91 pop r28 + 3666: 1f 91 pop r17 + 3668: 0f 91 pop r16 + 366a: 08 95 ret + +0000366c : + Block[11] = Block[3]; +} + +void MifareClassicAppInit1K(void) +{ + State = STATE_IDLE; + 366c: 81 e0 ldi r24, 0x01 ; 1 + 366e: 80 93 be 28 sts 0x28BE, r24 + CardATQAValue = MFCLASSIC_1K_ATQA_VALUE; + 3672: 84 e0 ldi r24, 0x04 ; 4 + 3674: 90 e0 ldi r25, 0x00 ; 0 + 3676: 80 93 bf 28 sts 0x28BF, r24 + 367a: 90 93 c0 28 sts 0x28C0, r25 + CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; + 367e: 88 e0 ldi r24, 0x08 ; 8 + 3680: 80 93 c1 28 sts 0x28C1, r24 + _7BUID = 0x00; + 3684: 10 92 c2 28 sts 0x28C2, r1 + 3688: 08 95 ret + +0000368a : +} + +void MifarePlus1kAppInit_7B(void) +{ + State = STATE_IDLE; + 368a: 81 e0 ldi r24, 0x01 ; 1 + 368c: 80 93 be 28 sts 0x28BE, r24 + CardATQAValue = MFPlus_ATQA_VALUE; + 3690: 84 e4 ldi r24, 0x44 ; 68 + 3692: 90 e0 ldi r25, 0x00 ; 0 + 3694: 80 93 bf 28 sts 0x28BF, r24 + 3698: 90 93 c0 28 sts 0x28C0, r25 + CardSAKValue = MFCLASSIC_1K_SAK_CL1_VALUE; + 369c: 88 e0 ldi r24, 0x08 ; 8 + 369e: 80 93 c1 28 sts 0x28C1, r24 + uint8_t UidSize = ActiveConfiguration.UidSize; + _7BUID = (UidSize == 7); + 36a2: 81 e0 ldi r24, 0x01 ; 1 + 36a4: 90 91 05 29 lds r25, 0x2905 + 36a8: 97 30 cpi r25, 0x07 ; 7 + 36aa: 09 f0 breq .+2 ; 0x36ae + 36ac: 80 e0 ldi r24, 0x00 ; 0 + 36ae: 80 93 c2 28 sts 0x28C2, r24 + 36b2: 08 95 ret + +000036b4 : +} + +void MifareClassicAppInit4K(void) +{ + State = STATE_IDLE; + 36b4: 81 e0 ldi r24, 0x01 ; 1 + 36b6: 80 93 be 28 sts 0x28BE, r24 + CardATQAValue = MFCLASSIC_4K_ATQA_VALUE; + 36ba: 82 e0 ldi r24, 0x02 ; 2 + 36bc: 90 e0 ldi r25, 0x00 ; 0 + 36be: 80 93 bf 28 sts 0x28BF, r24 + 36c2: 90 93 c0 28 sts 0x28C0, r25 + CardSAKValue = MFCLASSIC_4K_SAK_CL1_VALUE; + 36c6: 88 e1 ldi r24, 0x18 ; 24 + 36c8: 80 93 c1 28 sts 0x28C1, r24 + _7BUID = 0x00; + 36cc: 10 92 c2 28 sts 0x28C2, r1 + 36d0: 08 95 ret + +000036d2 : +} + +void MifareClassicAppReset(void) +{ + State = STATE_IDLE; + 36d2: 81 e0 ldi r24, 0x01 ; 1 + 36d4: 80 93 be 28 sts 0x28BE, r24 + 36d8: 08 95 ret + +000036da : +} + +void MifareClassicAppTask(void) +{ + 36da: 08 95 ret + +000036dc : + +} + +uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + 36dc: 6f 92 push r6 + 36de: 7f 92 push r7 + 36e0: 8f 92 push r8 + 36e2: 9f 92 push r9 + 36e4: af 92 push r10 + 36e6: bf 92 push r11 + 36e8: cf 92 push r12 + 36ea: df 92 push r13 + 36ec: ef 92 push r14 + 36ee: ff 92 push r15 + 36f0: 0f 93 push r16 + 36f2: 1f 93 push r17 + 36f4: cf 93 push r28 + 36f6: df 93 push r29 + 36f8: cd b7 in r28, 0x3d ; 61 + 36fa: de b7 in r29, 0x3e ; 62 + 36fc: 2e 97 sbiw r28, 0x0e ; 14 + 36fe: cd bf out 0x3d, r28 ; 61 + 3700: de bf out 0x3e, r29 ; 62 + 3702: 8c 01 movw r16, r24 + switch(State) { + 3704: 80 91 be 28 lds r24, 0x28BE + 3708: 85 30 cpi r24, 0x05 ; 5 + 370a: 09 f4 brne .+2 ; 0x370e + 370c: d1 c0 rjmp .+418 ; 0x38b0 + 370e: f8 f0 brcs .+62 ; 0x374e + 3710: 88 30 cpi r24, 0x08 ; 8 + 3712: 09 f4 brne .+2 ; 0x3716 + 3714: 1b c1 rjmp .+566 ; 0x394c + 3716: b8 f5 brcc .+110 ; 0x3786 + 3718: 86 30 cpi r24, 0x06 ; 6 + 371a: 09 f4 brne .+2 ; 0x371e + 371c: f5 c1 rjmp .+1002 ; 0x3b08 + 371e: 87 30 cpi r24, 0x07 ; 7 + 3720: 09 f4 brne .+2 ; 0x3724 + 3722: c9 c1 rjmp .+914 ; 0x3ab6 + + *BitCount = ISO14443A_SAK_FRAME_SIZE; + return true; + } else { + /* We have not been selected. Don't send anything. */ + *BitCount = 0; + 3724: 20 e0 ldi r18, 0x00 ; 0 + 3726: 30 e0 ldi r19, 0x00 ; 0 + break; + } + + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; +} + 3728: c9 01 movw r24, r18 + 372a: 2e 96 adiw r28, 0x0e ; 14 + 372c: cd bf out 0x3d, r28 ; 61 + 372e: de bf out 0x3e, r29 ; 62 + 3730: df 91 pop r29 + 3732: cf 91 pop r28 + 3734: 1f 91 pop r17 + 3736: 0f 91 pop r16 + 3738: ff 90 pop r15 + 373a: ef 90 pop r14 + 373c: df 90 pop r13 + 373e: cf 90 pop r12 + 3740: bf 90 pop r11 + 3742: af 90 pop r10 + 3744: 9f 90 pop r9 + 3746: 8f 90 pop r8 + 3748: 7f 90 pop r7 + 374a: 6f 90 pop r6 + 374c: 08 95 ret + +} + +uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + switch(State) { + 374e: 82 30 cpi r24, 0x02 ; 2 + 3750: 09 f4 brne .+2 ; 0x3754 + 3752: e1 c0 rjmp .+450 ; 0x3916 + 3754: 08 f0 brcs .+2 ; 0x3758 + 3756: 5a c0 rjmp .+180 ; 0x380c + case STATE_IDLE: + case STATE_HALT: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + 3758: 20 91 bf 28 lds r18, 0x28BF + 375c: 90 91 c0 28 lds r25, 0x28C0 +INLINE +bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) +{ + uint8_t* DataPtr = (uint8_t*) Buffer; + + if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ + 3760: d8 01 movw r26, r16 + 3762: 8c 91 ld r24, X + 3764: 86 32 cpi r24, 0x26 ; 38 + 3766: 09 f4 brne .+2 ; 0x376a + 3768: ae c0 rjmp .+348 ; 0x38c6 + 376a: 82 35 cpi r24, 0x52 ; 82 + 376c: 09 f4 brne .+2 ; 0x3770 + 376e: ab c0 rjmp .+342 ; 0x38c6 + State = STATE_READY1; + return BitCount; + } +#ifdef SUPPORT_MF_CLASSIC_MAGIC_MODE + else if (Buffer[0] == CMD_CHINESE_UNLOCK) { + 3770: 80 34 cpi r24, 0x40 ; 64 + 3772: c1 f6 brne .-80 ; 0x3724 + State = STATE_CHINESE_IDLE; + 3774: 82 e0 ldi r24, 0x02 ; 2 + 3776: 80 93 be 28 sts 0x28BE, r24 + Buffer[0] = ACK_VALUE; + 377a: 8a e0 ldi r24, 0x0A ; 10 + 377c: d8 01 movw r26, r16 + 377e: 8c 93 st X, r24 + return ACK_NAK_FRAME_SIZE; + 3780: 24 e0 ldi r18, 0x04 ; 4 + 3782: 30 e0 ldi r19, 0x00 ; 0 + 3784: d1 cf rjmp .-94 ; 0x3728 + +} + +uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + switch(State) { + 3786: 89 30 cpi r24, 0x09 ; 9 + 3788: 09 f4 brne .+2 ; 0x378c + 378a: a6 c0 rjmp .+332 ; 0x38d8 + 378c: 8d 30 cpi r24, 0x0D ; 13 + 378e: 50 f6 brcc .-108 ; 0x3724 + * 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(); + 3790: d8 01 movw r26, r16 + 3792: fc 90 ld r15, X + 3794: 0e 94 33 24 call 0x4866 ; 0x4866 + 3798: 8f 25 eor r24, r15 + 379a: f8 01 movw r30, r16 + 379c: 80 83 st Z, r24 + 379e: f1 80 ldd r15, Z+1 ; 0x01 + 37a0: 0e 94 33 24 call 0x4866 ; 0x4866 + 37a4: 8f 25 eor r24, r15 + 37a6: d8 01 movw r26, r16 + 37a8: 11 96 adiw r26, 0x01 ; 1 + 37aa: 8c 93 st X, r24 + 37ac: 11 97 sbiw r26, 0x01 ; 1 + 37ae: 12 96 adiw r26, 0x02 ; 2 + 37b0: fc 90 ld r15, X + 37b2: 0e 94 33 24 call 0x4866 ; 0x4866 + 37b6: 8f 25 eor r24, r15 + 37b8: f8 01 movw r30, r16 + 37ba: 82 83 std Z+2, r24 ; 0x02 + 37bc: f3 80 ldd r15, Z+3 ; 0x03 + 37be: 0e 94 33 24 call 0x4866 ; 0x4866 + 37c2: 8f 25 eor r24, r15 + 37c4: d8 01 movw r26, r16 + 37c6: 13 96 adiw r26, 0x03 ; 3 + 37c8: 8c 93 st X, r24 + 37ca: 13 97 sbiw r26, 0x03 ; 3 + 37cc: 14 96 adiw r26, 0x04 ; 4 + 37ce: fc 90 ld r15, X + 37d0: 0e 94 33 24 call 0x4866 ; 0x4866 + 37d4: 8f 25 eor r24, r15 + 37d6: f8 01 movw r30, r16 + 37d8: 84 83 std Z+4, r24 ; 0x04 + 37da: f5 80 ldd r15, Z+5 ; 0x05 + 37dc: 0e 94 33 24 call 0x4866 ; 0x4866 + 37e0: 8f 25 eor r24, r15 + 37e2: d8 01 movw r26, r16 + 37e4: 15 96 adiw r26, 0x05 ; 5 + 37e6: 8c 93 st X, r24 + + if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { + 37e8: 64 e0 ldi r22, 0x04 ; 4 + 37ea: 70 e0 ldi r23, 0x00 ; 0 + 37ec: c8 01 movw r24, r16 + 37ee: b9 d5 rcall .+2930 ; 0x4362 + 37f0: 81 11 cpse r24, r1 + 37f2: 99 c2 rjmp .+1330 ; 0x3d26 + /* Not sure if this is the correct error code.. */ + Buffer[0] = NAK_OTHER_ERROR ^ Crypto1Nibble(); + } + } else { + /* CRC Error. */ + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + 37f4: 0e 94 74 24 call 0x48e8 ; 0x48e8 + 37f8: 91 e0 ldi r25, 0x01 ; 1 + 37fa: 98 27 eor r25, r24 + 37fc: f8 01 movw r30, r16 + 37fe: 90 83 st Z, r25 + } + + State = STATE_AUTHED_IDLE; + 3800: 88 e0 ldi r24, 0x08 ; 8 + 3802: 80 93 be 28 sts 0x28BE, r24 + return ACK_NAK_FRAME_SIZE; + 3806: 24 e0 ldi r18, 0x04 ; 4 + 3808: 30 e0 ldi r19, 0x00 ; 0 + 380a: 8e cf rjmp .-228 ; 0x3728 + +} + +uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + switch(State) { + 380c: 83 30 cpi r24, 0x03 ; 3 + 380e: 09 f4 brne .+2 ; 0x3812 + 3810: 42 c1 rjmp .+644 ; 0x3a96 + 3812: 84 30 cpi r24, 0x04 ; 4 + 3814: 09 f0 breq .+2 ; 0x3818 + 3816: 86 cf rjmp .-244 ; 0x3724 + + return ACK_NAK_FRAME_SIZE; +#endif + + case STATE_READY1: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + 3818: 20 91 bf 28 lds r18, 0x28BF + 381c: 90 91 c0 28 lds r25, 0x28C0 + 3820: d8 01 movw r26, r16 + 3822: 8c 91 ld r24, X + 3824: 86 32 cpi r24, 0x26 ; 38 + 3826: 09 f4 brne .+2 ; 0x382a + 3828: 4e c0 rjmp .+156 ; 0x38c6 + 382a: 82 35 cpi r24, 0x52 ; 82 + 382c: 09 f4 brne .+2 ; 0x3830 + 382e: 4b c0 rjmp .+150 ; 0x38c6 + State = STATE_READY1; + return BitCount; + } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL1) { + 3830: 83 39 cpi r24, 0x93 ; 147 + 3832: 09 f0 breq .+2 ; 0x3836 + 3834: 95 c1 rjmp .+810 ; 0x3b60 + /* Load UID CL1 and perform anticollision */ + uint8_t UidCL1[ISO14443A_CL_UID_SIZE]; + + if (_7BUID) { + 3836: 80 91 c2 28 lds r24, 0x28C2 + 383a: 88 23 and r24, r24 + 383c: 09 f4 brne .+2 ; 0x3840 + 383e: 34 c3 rjmp .+1640 ; 0x3ea8 + MemoryReadBlock(&UidCL1[1], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); + 3840: 43 e0 ldi r20, 0x03 ; 3 + 3842: 50 e0 ldi r21, 0x00 ; 0 + 3844: 60 e0 ldi r22, 0x00 ; 0 + 3846: 70 e0 ldi r23, 0x00 ; 0 + 3848: ce 01 movw r24, r28 + 384a: 02 96 adiw r24, 0x02 ; 2 + 384c: 0e 94 de 06 call 0xdbc ; 0xdbc + UidCL1[0] = ISO14443A_UID0_CT; + 3850: 88 e8 ldi r24, 0x88 ; 136 + 3852: 89 83 std Y+1, r24 ; 0x01 + 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) { + 3854: d8 01 movw r26, r16 + 3856: 11 96 adiw r26, 0x01 ; 1 + 3858: 9c 91 ld r25, X + 385a: 90 32 cpi r25, 0x20 ; 32 + 385c: 09 f4 brne .+2 ; 0x3860 + 385e: c2 c4 rjmp .+2436 ; 0x41e4 + 3860: 90 37 cpi r25, 0x70 ; 112 + 3862: 09 f0 breq .+2 ; 0x3866 + 3864: 5f cf rjmp .-322 ; 0x3724 + return false; + + case ISO14443A_NVB_AC_END: + /* End of anticollision procedure. + * Send SAK CLn if we are selected. */ + if ( (DataPtr[2] == UidCL[0]) && + 3866: d8 01 movw r26, r16 + 3868: 12 96 adiw r26, 0x02 ; 2 + 386a: 8c 91 ld r24, X + 386c: 12 97 sbiw r26, 0x02 ; 2 + 386e: 88 38 cpi r24, 0x88 ; 136 + 3870: 09 f0 breq .+2 ; 0x3874 + 3872: 58 cf rjmp .-336 ; 0x3724 + 3874: 13 96 adiw r26, 0x03 ; 3 + 3876: 9c 91 ld r25, X + 3878: 13 97 sbiw r26, 0x03 ; 3 + 387a: 8a 81 ldd r24, Y+2 ; 0x02 + 387c: 98 13 cpse r25, r24 + 387e: 52 cf rjmp .-348 ; 0x3724 + (DataPtr[3] == UidCL[1]) && + 3880: 14 96 adiw r26, 0x04 ; 4 + 3882: 9c 91 ld r25, X + 3884: 14 97 sbiw r26, 0x04 ; 4 + 3886: 8b 81 ldd r24, Y+3 ; 0x03 + 3888: 98 13 cpse r25, r24 + 388a: 4c cf rjmp .-360 ; 0x3724 + (DataPtr[4] == UidCL[2]) && + 388c: 15 96 adiw r26, 0x05 ; 5 + 388e: 9c 91 ld r25, X + 3890: 15 97 sbiw r26, 0x05 ; 5 + 3892: 8c 81 ldd r24, Y+4 ; 0x04 + 3894: 98 13 cpse r25, r24 + 3896: 46 cf rjmp .-372 ; 0x3724 + (DataPtr[5] == UidCL[3]) ) { + + DataPtr[0] = SAKValue; + 3898: 84 e0 ldi r24, 0x04 ; 4 + 389a: 8c 93 st X, r24 + ISO14443AAppendCRCA(Buffer, 1); + 389c: 61 e0 ldi r22, 0x01 ; 1 + 389e: 70 e0 ldi r23, 0x00 ; 0 + 38a0: c8 01 movw r24, r16 + 38a2: 30 d5 rcall .+2656 ; 0x4304 + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) + State = STATE_READY2; + 38a4: 85 e0 ldi r24, 0x05 ; 5 + 38a6: 80 93 be 28 sts 0x28BE, r24 + + *BitCount = ISO14443A_SAK_FRAME_SIZE; + 38aa: 28 e1 ldi r18, 0x18 ; 24 + 38ac: 30 e0 ldi r19, 0x00 ; 0 + 38ae: 3c cf rjmp .-392 ; 0x3728 + State = STATE_HALT; + } + break; + + case STATE_READY2: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + 38b0: 20 91 bf 28 lds r18, 0x28BF + 38b4: 90 91 c0 28 lds r25, 0x28C0 +INLINE +bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) +{ + uint8_t* DataPtr = (uint8_t*) Buffer; + + if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ + 38b8: d8 01 movw r26, r16 + 38ba: 8c 91 ld r24, X + 38bc: 86 32 cpi r24, 0x26 ; 38 + 38be: 19 f0 breq .+6 ; 0x38c6 + 38c0: 82 35 cpi r24, 0x52 ; 82 + 38c2: 09 f0 breq .+2 ; 0x38c6 + 38c4: 4a c1 rjmp .+660 ; 0x3b5a + DataPtr[0] = (ATQAValue >> 0) & 0x00FF; + 38c6: f8 01 movw r30, r16 + 38c8: 20 83 st Z, r18 + DataPtr[1] = (ATQAValue >> 8) & 0x00FF; + 38ca: 91 83 std Z+1, r25 ; 0x01 + State = STATE_READY1; + 38cc: 84 e0 ldi r24, 0x04 ; 4 + 38ce: 80 93 be 28 sts 0x28BE, r24 + + *BitCount = ISO14443A_ATQA_FRAME_SIZE; + 38d2: 20 e1 ldi r18, 0x10 ; 16 + 38d4: 30 e0 ldi r19, 0x00 ; 0 + return BitCount; + 38d6: 28 cf rjmp .-432 ; 0x3728 + 38d8: 78 01 movw r14, r16 + +} + +uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) +{ + switch(State) { + 38da: d1 2c mov 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(); + 38dc: d7 01 movw r26, r14 + 38de: cc 90 ld r12, X + 38e0: c2 d7 rcall .+3972 ; 0x4866 + 38e2: 8c 25 eor r24, r12 + 38e4: f7 01 movw r30, r14 + 38e6: 81 93 st Z+, r24 + 38e8: 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++) + 38ea: d3 94 inc r13 + 38ec: f2 e1 ldi r31, 0x12 ; 18 + 38ee: df 12 cpse r13, r31 + 38f0: f5 cf rjmp .-22 ; 0x38dc + Buffer[i] ^= Crypto1Byte(); + + if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { + 38f2: 60 e1 ldi r22, 0x10 ; 16 + 38f4: 70 e0 ldi r23, 0x00 ; 0 + 38f6: c8 01 movw r24, r16 + 38f8: 34 d5 rcall .+2664 ; 0x4362 + 38fa: 88 23 and r24, r24 + 38fc: 09 f4 brne .+2 ; 0x3900 + 38fe: 7a cf rjmp .-268 ; 0x37f4 + if (!ActiveConfiguration.ReadOnly) { + 3900: 80 91 06 29 lds r24, 0x2906 + 3904: 88 23 and r24, r24 + 3906: 09 f4 brne .+2 ; 0x390a + 3908: 3e c1 rjmp .+636 ; 0x3b86 + MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + } else { + /* Silently ignore in ReadOnly mode */ + } + + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + 390a: ee d7 rcall .+4060 ; 0x48e8 + 390c: 9a e0 ldi r25, 0x0A ; 10 + 390e: 98 27 eor r25, r24 + 3910: d8 01 movw r26, r16 + 3912: 9c 93 st X, r25 + 3914: 75 cf rjmp .-278 ; 0x3800 + break; + +#ifdef SUPPORT_MF_CLASSIC_MAGIC_MODE + case STATE_CHINESE_IDLE: + /* Support special china commands that dont require authentication. */ + if (Buffer[0] == CMD_CHINESE_UNLOCK_RW) { + 3916: f8 01 movw r30, r16 + 3918: 80 81 ld r24, Z + 391a: 83 34 cpi r24, 0x43 ; 67 + 391c: 09 f4 brne .+2 ; 0x3920 + 391e: 6d c1 rjmp .+730 ; 0x3bfa + /* Unlock read and write commands */ + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_CHINESE_WIPE) { + 3920: 81 34 cpi r24, 0x41 ; 65 + 3922: 09 f4 brne .+2 ; 0x3926 + 3924: 2b c1 rjmp .+598 ; 0x3b7c + /* Wipe memory */ + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_READ) { + 3926: 80 33 cpi r24, 0x30 ; 48 + 3928: 09 f4 brne .+2 ; 0x392c + 392a: 34 c4 rjmp .+2152 ; 0x4194 + * BITS_PER_BYTE; + } else { + Buffer[0] = NAK_CRC_ERROR; + return ACK_NAK_FRAME_SIZE; + } + } else if (Buffer[0] == CMD_WRITE) { + 392c: 80 3a cpi r24, 0xA0 ; 160 + 392e: 09 f4 brne .+2 ; 0x3932 + 3930: 56 c1 rjmp .+684 ; 0x3bde + return ACK_NAK_FRAME_SIZE; + } else { + Buffer[0] = NAK_CRC_ERROR; + return ACK_NAK_FRAME_SIZE; + } + } else if (Buffer[0] == CMD_HALT) { + 3932: 80 35 cpi r24, 0x50 ; 80 + 3934: 09 f0 breq .+2 ; 0x3938 + 3936: f6 ce rjmp .-532 ; 0x3724 + State = STATE_READY1; + return BitCount; + } else if (Buffer[0] == CMD_HALT) { + /* Halts the tag. According to the ISO14443, the second + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + 3938: f8 01 movw r30, r16 + 393a: 81 81 ldd r24, Z+1 ; 0x01 + 393c: 88 23 and r24, r24 + 393e: 09 f4 brne .+2 ; 0x3942 + 3940: 1d c4 rjmp .+2106 ; 0x417c + } else { + Buffer[0] = NAK_CRC_ERROR; + return ACK_NAK_FRAME_SIZE; + } + } else { + Buffer[0] = NAK_INVALID_ARG; + 3942: f8 01 movw r30, r16 + 3944: 10 82 st Z, r1 + return ACK_NAK_FRAME_SIZE; + 3946: 24 e0 ldi r18, 0x04 ; 4 + 3948: 30 e0 ldi r19, 0x00 ; 0 + 394a: ee ce rjmp .-548 ; 0x3728 + + 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(); + 394c: d8 01 movw r26, r16 + 394e: dc 90 ld r13, X + 3950: 8a d7 rcall .+3860 ; 0x4866 + 3952: 8d 25 eor r24, r13 + 3954: f8 01 movw r30, r16 + 3956: 80 83 st Z, r24 + 3958: d1 80 ldd r13, Z+1 ; 0x01 + 395a: 85 d7 rcall .+3850 ; 0x4866 + 395c: 8d 25 eor r24, r13 + 395e: d8 01 movw r26, r16 + 3960: 11 96 adiw r26, 0x01 ; 1 + 3962: 8c 93 st X, r24 + 3964: 11 97 sbiw r26, 0x01 ; 1 + 3966: 12 96 adiw r26, 0x02 ; 2 + 3968: dc 90 ld r13, X + 396a: 7d d7 rcall .+3834 ; 0x4866 + 396c: 8d 25 eor r24, r13 + 396e: f8 01 movw r30, r16 + 3970: 82 83 std Z+2, r24 ; 0x02 + 3972: d3 80 ldd r13, Z+3 ; 0x03 + 3974: 78 d7 rcall .+3824 ; 0x4866 + 3976: 8d 25 eor r24, r13 + 3978: d8 01 movw r26, r16 + 397a: 13 96 adiw r26, 0x03 ; 3 + 397c: 8c 93 st X, r24 + 397e: 13 97 sbiw r26, 0x03 ; 3 + + if (Buffer[0] == CMD_READ) { + 3980: 8c 91 ld r24, X + 3982: 80 33 cpi r24, 0x30 ; 48 + 3984: 09 f4 brne .+2 ; 0x3988 + 3986: fd c1 rjmp .+1018 ; 0x3d82 + * 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) { + 3988: 80 3a cpi r24, 0xA0 ; 160 + 398a: 09 f4 brne .+2 ; 0x398e + 398c: 6f c2 rjmp .+1246 ; 0x3e6c + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_DECREMENT) { + 398e: 80 3c cpi r24, 0xC0 ; 192 + 3990: 09 f4 brne .+2 ; 0x3994 + 3992: af c2 rjmp .+1374 ; 0x3ef2 + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_INCREMENT) { + 3994: 81 3c cpi r24, 0xC1 ; 193 + 3996: 09 f4 brne .+2 ; 0x399a + 3998: 46 c3 rjmp .+1676 ; 0x4026 + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_RESTORE) { + 399a: 82 3c cpi r24, 0xC2 ; 194 + 399c: 09 f4 brne .+2 ; 0x39a0 + 399e: 09 c1 rjmp .+530 ; 0x3bb2 + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + }else if (Buffer[0] == CMD_TRANSFER) { + 39a0: 80 3b cpi r24, 0xB0 ; 176 + 39a2: 09 f4 brne .+2 ; 0x39a6 + 39a4: 57 c3 rjmp .+1710 ; 0x4054 + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + + return ACK_NAK_FRAME_SIZE; + } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { + 39a6: 80 56 subi r24, 0x60 ; 96 + 39a8: 82 30 cpi r24, 0x02 ; 2 + 39aa: 08 f0 brcs .+2 ; 0x39ae + 39ac: a7 c0 rjmp .+334 ; 0x3afc + if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { + 39ae: 62 e0 ldi r22, 0x02 ; 2 + 39b0: 70 e0 ldi r23, 0x00 ; 0 + 39b2: c8 01 movw r24, r16 + 39b4: d6 d4 rcall .+2476 ; 0x4362 + 39b6: 88 23 and r24, r24 + 39b8: 09 f4 brne .+2 ; 0x39bc + 39ba: cf c1 rjmp .+926 ; 0x3d5a + /* Nested authentication. */ + uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; + 39bc: f8 01 movw r30, r16 + 39be: 81 81 ldd r24, Z+1 ; 0x01 + 39c0: 8c 73 andi r24, 0x3C ; 60 + uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); + 39c2: 90 81 ld r25, Z + 39c4: 90 36 cpi r25, 0x60 ; 96 + 39c6: 09 f4 brne .+2 ; 0x39ca + 39c8: 47 c4 rjmp .+2190 ; 0x4258 + 39ca: 6a e3 ldi r22, 0x3A ; 58 + 39cc: 70 e0 ldi r23, 0x00 ; 0 + uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; + 39ce: 5b 01 movw r10, r22 + 39d0: f0 e1 ldi r31, 0x10 ; 16 + 39d2: 8f 9f mul r24, r31 + 39d4: a0 0c add r10, r0 + 39d6: b1 1c adc r11, r1 + 39d8: 11 24 eor r1, r1 + uint8_t Key[6]; + uint8_t Uid[4]; + uint8_t CardNonce[4]; + + /* Generate a random nonce and read UID and key from memory */ + RandomGetBuffer(CardNonce, sizeof(CardNonce)); + 39da: 6e 01 movw r12, r28 + 39dc: 37 e0 ldi r19, 0x07 ; 7 + 39de: c3 0e add r12, r19 + 39e0: d1 1c adc r13, r1 + 39e2: 64 e0 ldi r22, 0x04 ; 4 + 39e4: c6 01 movw r24, r12 + 39e6: 0e 94 3f 06 call 0xc7e ; 0xc7e + if (_7BUID) + 39ea: 80 91 c2 28 lds r24, 0x28C2 + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + 39ee: 7e 01 movw r14, r28 + uint8_t Uid[4]; + uint8_t CardNonce[4]; + + /* Generate a random nonce and read UID and key from memory */ + RandomGetBuffer(CardNonce, sizeof(CardNonce)); + if (_7BUID) + 39f0: 88 23 and r24, r24 + 39f2: 09 f4 brne .+2 ; 0x39f6 + 39f4: 15 c4 rjmp .+2090 ; 0x4220 + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + 39f6: 8b e0 ldi r24, 0x0B ; 11 + 39f8: e8 0e add r14, r24 + 39fa: f1 1c adc r15, r1 + 39fc: 44 e0 ldi r20, 0x04 ; 4 + 39fe: 50 e0 ldi r21, 0x00 ; 0 + 3a00: 63 e0 ldi r22, 0x03 ; 3 + 3a02: 70 e0 ldi r23, 0x00 ; 0 + 3a04: c7 01 movw r24, r14 + 3a06: 0e 94 de 06 call 0xdbc ; 0xdbc + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); + 3a0a: 46 e0 ldi r20, 0x06 ; 6 + 3a0c: 50 e0 ldi r21, 0x00 ; 0 + 3a0e: b5 01 movw r22, r10 + 3a10: ce 01 movw r24, r28 + 3a12: 01 96 adiw r24, 0x01 ; 1 + 3a14: 0e 94 de 06 call 0xdbc ; 0xdbc + + /* Precalculate the reader response from card-nonce */ + for (uint8_t i=0; i + + /* Precalculate our response from the reader response */ + for (uint8_t i=0; i + + /* Setup crypto1 cipher. */ + Crypto1Setup(Key, Uid, CardNonce); + 3a64: a6 01 movw r20, r12 + 3a66: b7 01 movw r22, r14 + 3a68: ce 01 movw r24, r28 + 3a6a: 01 96 adiw r24, 0x01 ; 1 + 3a6c: 33 d5 rcall .+2662 ; 0x44d4 + + for (uint8_t i=0; i + } + } + break; + + case STATE_CHINESE_WRITE: + if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { + 3a96: 60 e1 ldi r22, 0x10 ; 16 + 3a98: 70 e0 ldi r23, 0x00 ; 0 + 3a9a: c8 01 movw r24, r16 + 3a9c: 62 d4 rcall .+2244 ; 0x4362 + 3a9e: 88 23 and r24, r24 + 3aa0: 09 f4 brne .+2 ; 0x3aa4 + 3aa2: 63 c0 rjmp .+198 ; 0x3b6a + /* CRC check passed. Write data into memory and send ACK. */ + if (!ActiveConfiguration.ReadOnly) { + 3aa4: 80 91 06 29 lds r24, 0x2906 + 3aa8: 88 23 and r24, r24 + 3aaa: 09 f4 brne .+2 ; 0x3aae + 3aac: 5e c1 rjmp .+700 ; 0x3d6a + MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + } + + Buffer[0] = ACK_VALUE; + 3aae: 8a e0 ldi r24, 0x0A ; 10 + 3ab0: d8 01 movw r26, r16 + 3ab2: 8c 93 st X, r24 + 3ab4: 5d c0 rjmp .+186 ; 0x3b70 + + 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]); + 3ab6: c8 01 movw r24, r16 + 3ab8: ad d6 rcall .+3418 ; 0x4814 + + for (uint8_t i=0; i<4; i++) + Buffer[i+4] ^= Crypto1Byte(); + 3aba: f8 01 movw r30, r16 + 3abc: f4 80 ldd r15, Z+4 ; 0x04 + 3abe: d3 d6 rcall .+3494 ; 0x4866 + 3ac0: 8f 25 eor r24, r15 + 3ac2: d8 01 movw r26, r16 + 3ac4: 14 96 adiw r26, 0x04 ; 4 + 3ac6: 8c 93 st X, r24 + 3ac8: 14 97 sbiw r26, 0x04 ; 4 + 3aca: 15 96 adiw r26, 0x05 ; 5 + 3acc: fc 90 ld r15, X + 3ace: cb d6 rcall .+3478 ; 0x4866 + 3ad0: 8f 25 eor r24, r15 + 3ad2: f8 01 movw r30, r16 + 3ad4: 85 83 std Z+5, r24 ; 0x05 + 3ad6: f6 80 ldd r15, Z+6 ; 0x06 + 3ad8: c6 d6 rcall .+3468 ; 0x4866 + 3ada: 8f 25 eor r24, r15 + 3adc: d8 01 movw r26, r16 + 3ade: 16 96 adiw r26, 0x06 ; 6 + 3ae0: 8c 93 st X, r24 + 3ae2: 16 97 sbiw r26, 0x06 ; 6 + 3ae4: 17 96 adiw r26, 0x07 ; 7 + 3ae6: fc 90 ld r15, X + 3ae8: be d6 rcall .+3452 ; 0x4866 + 3aea: 8f 25 eor r24, r15 + 3aec: f8 01 movw r30, r16 + 3aee: 87 83 std Z+7, r24 ; 0x07 + + if ((Buffer[4] == ReaderResponse[0]) && + 3af0: 24 81 ldd r18, Z+4 ; 0x04 + 3af2: 90 91 c4 28 lds r25, 0x28C4 + 3af6: 29 17 cp r18, r25 + 3af8: 09 f4 brne .+2 ; 0x3afc + 3afa: 84 c0 rjmp .+264 ; 0x3c04 + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + return ACK_NAK_FRAME_SIZE; + } + } else { + /* Unknown command. Enter HALT state */ + State = STATE_IDLE; + 3afc: 81 e0 ldi r24, 0x01 ; 1 + 3afe: 80 93 be 28 sts 0x28BE, r24 + /* Unknown state? Should never happen. */ + break; + } + + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; + 3b02: 20 e0 ldi r18, 0x00 ; 0 + 3b04: 30 e0 ldi r19, 0x00 ; 0 + } else { + /* Unknown command. Enter HALT state */ + State = STATE_IDLE; + } + + break; + 3b06: 10 ce rjmp .-992 ; 0x3728 + State = STATE_HALT; + } + break; + + case STATE_ACTIVE: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + 3b08: 20 91 bf 28 lds r18, 0x28BF + 3b0c: 90 91 c0 28 lds r25, 0x28C0 +INLINE +bool ISO14443AWakeUp(void* Buffer, uint16_t* BitCount, uint16_t ATQAValue) +{ + uint8_t* DataPtr = (uint8_t*) Buffer; + + if ( (DataPtr[0] == ISO14443A_CMD_REQA) || (DataPtr[0] == ISO14443A_CMD_WUPA) ){ + 3b10: f8 01 movw r30, r16 + 3b12: 80 81 ld r24, Z + 3b14: 86 32 cpi r24, 0x26 ; 38 + 3b16: 09 f4 brne .+2 ; 0x3b1a + 3b18: 42 c0 rjmp .+132 ; 0x3b9e + 3b1a: 82 35 cpi r24, 0x52 ; 82 + 3b1c: 09 f4 brne .+2 ; 0x3b20 + 3b1e: 3f c0 rjmp .+126 ; 0x3b9e + State = STATE_READY1; + return BitCount; + } else if (Buffer[0] == CMD_HALT) { + 3b20: 80 35 cpi r24, 0x50 ; 80 + 3b22: 09 f4 brne .+2 ; 0x3b26 + 3b24: 09 cf rjmp .-494 ; 0x3938 + } + } else { + Buffer[0] = NAK_INVALID_ARG; + return ACK_NAK_FRAME_SIZE; + } + } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { + 3b26: 98 2f mov r25, r24 + 3b28: 90 56 subi r25, 0x60 ; 96 + 3b2a: 92 30 cpi r25, 0x02 ; 2 + 3b2c: 08 f4 brcc .+2 ; 0x3b30 + 3b2e: ab c2 rjmp .+1366 ; 0x4086 + 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) + 3b30: 80 33 cpi r24, 0x30 ; 48 + 3b32: 51 f0 breq .+20 ; 0x3b48 + 3b34: 80 3a cpi r24, 0xA0 ; 160 + 3b36: 41 f0 breq .+16 ; 0x3b48 + 3b38: 80 3c cpi r24, 0xC0 ; 192 + 3b3a: 31 f0 breq .+12 ; 0x3b48 + || (Buffer[0] == CMD_INCREMENT) || (Buffer[0] == CMD_RESTORE) || (Buffer[0] == CMD_TRANSFER) ) { + 3b3c: 81 3c cpi r24, 0xC1 ; 193 + 3b3e: 21 f0 breq .+8 ; 0x3b48 + 3b40: 82 3c cpi r24, 0xC2 ; 194 + 3b42: 11 f0 breq .+4 ; 0x3b48 + 3b44: 80 3b cpi r24, 0xB0 ; 176 + 3b46: d1 f6 brne .-76 ; 0x3afc + State = STATE_IDLE; + 3b48: 81 e0 ldi r24, 0x01 ; 1 + 3b4a: 80 93 be 28 sts 0x28BE, r24 + Buffer[0] = NAK_NOT_AUTHED; + 3b4e: 84 e0 ldi r24, 0x04 ; 4 + 3b50: d8 01 movw r26, r16 + 3b52: 8c 93 st X, r24 + return ACK_NAK_FRAME_SIZE; + 3b54: 24 e0 ldi r18, 0x04 ; 4 + 3b56: 30 e0 ldi r19, 0x00 ; 0 + 3b58: e7 cd rjmp .-1074 ; 0x3728 + + case STATE_READY2: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + State = STATE_READY1; + return BitCount; + } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL2) { + 3b5a: 85 39 cpi r24, 0x95 ; 149 + 3b5c: 09 f4 brne .+2 ; 0x3b60 + 3b5e: 4f c1 rjmp .+670 ; 0x3dfe + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { + /* According to ISO14443, we must not send anything + * in order to acknowledge the HALT command. */ + State = STATE_HALT; + 3b60: 10 92 be 28 sts 0x28BE, r1 + return ISO14443A_APP_NO_RESPONSE; + 3b64: 20 e0 ldi r18, 0x00 ; 0 + 3b66: 30 e0 ldi r19, 0x00 ; 0 + 3b68: df cd rjmp .-1090 ; 0x3728 + } + + Buffer[0] = ACK_VALUE; + } else { + /* CRC Error. */ + Buffer[0] = NAK_CRC_ERROR; + 3b6a: 81 e0 ldi r24, 0x01 ; 1 + 3b6c: f8 01 movw r30, r16 + 3b6e: 80 83 st Z, r24 + } + + State = STATE_CHINESE_IDLE; + 3b70: 82 e0 ldi r24, 0x02 ; 2 + 3b72: 80 93 be 28 sts 0x28BE, r24 + + return ACK_NAK_FRAME_SIZE; + 3b76: 24 e0 ldi r18, 0x04 ; 4 + 3b78: 30 e0 ldi r19, 0x00 ; 0 + 3b7a: d6 cd rjmp .-1108 ; 0x3728 + /* Unlock read and write commands */ + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_CHINESE_WIPE) { + /* Wipe memory */ + Buffer[0] = ACK_VALUE; + 3b7c: 8a e0 ldi r24, 0x0A ; 10 + 3b7e: 80 83 st Z, r24 + return ACK_NAK_FRAME_SIZE; + 3b80: 24 e0 ldi r18, 0x04 ; 4 + 3b82: 30 e0 ldi r19, 0x00 ; 0 + 3b84: d1 cd rjmp .-1118 ; 0x3728 + for (uint8_t i=0; i<(MEM_BYTES_PER_BLOCK + ISO14443A_CRCA_SIZE); i++) + Buffer[i] ^= Crypto1Byte(); + + if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { + if (!ActiveConfiguration.ReadOnly) { + MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + 3b86: 60 91 c3 28 lds r22, 0x28C3 + 3b8a: 30 e1 ldi r19, 0x10 ; 16 + 3b8c: 63 9f mul r22, r19 + 3b8e: b0 01 movw r22, r0 + 3b90: 11 24 eor r1, r1 + 3b92: 40 e1 ldi r20, 0x10 ; 16 + 3b94: 50 e0 ldi r21, 0x00 ; 0 + 3b96: c8 01 movw r24, r16 + 3b98: 0e 94 f6 06 call 0xdec ; 0xdec + 3b9c: b6 ce rjmp .-660 ; 0x390a + DataPtr[0] = (ATQAValue >> 0) & 0x00FF; + 3b9e: d8 01 movw r26, r16 + 3ba0: 2c 93 st X, r18 + DataPtr[1] = (ATQAValue >> 8) & 0x00FF; + 3ba2: 11 96 adiw r26, 0x01 ; 1 + 3ba4: 9c 93 st X, r25 + } + break; + + case STATE_ACTIVE: + if (ISO14443AWakeUp(Buffer, &BitCount, CardATQAValue)) { + State = STATE_READY1; + 3ba6: 84 e0 ldi r24, 0x04 ; 4 + 3ba8: 80 93 be 28 sts 0x28BE, r24 + + *BitCount = ISO14443A_ATQA_FRAME_SIZE; + 3bac: 20 e1 ldi r18, 0x10 ; 16 + 3bae: 30 e0 ldi r19, 0x00 ; 0 + return BitCount; + 3bb0: bb cd rjmp .-1162 ; 0x3728 + } 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)) { + 3bb2: 62 e0 ldi r22, 0x02 ; 2 + 3bb4: 70 e0 ldi r23, 0x00 ; 0 + 3bb6: c8 01 movw r24, r16 + 3bb8: d4 d3 rcall .+1960 ; 0x4362 + 3bba: 88 23 and r24, r24 + 3bbc: 09 f4 brne .+2 ; 0x3bc0 + 3bbe: cd c0 rjmp .+410 ; 0x3d5a + CurrentAddress = Buffer[1]; + 3bc0: f8 01 movw r30, r16 + 3bc2: 81 81 ldd r24, Z+1 ; 0x01 + 3bc4: 80 93 c3 28 sts 0x28C3, r24 + State = STATE_RESTORE; + 3bc8: 8c e0 ldi r24, 0x0C ; 12 + 3bca: 80 93 be 28 sts 0x28BE, r24 + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + 3bce: 8c d6 rcall .+3352 ; 0x48e8 + 3bd0: 9a e0 ldi r25, 0x0A ; 10 + 3bd2: 98 27 eor r25, r24 + 3bd4: d8 01 movw r26, r16 + 3bd6: 9c 93 st X, r25 + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + 3bd8: 24 e0 ldi r18, 0x04 ; 4 + 3bda: 30 e0 ldi r19, 0x00 ; 0 + 3bdc: a5 cd rjmp .-1206 ; 0x3728 + } else { + Buffer[0] = NAK_CRC_ERROR; + return ACK_NAK_FRAME_SIZE; + } + } else if (Buffer[0] == CMD_WRITE) { + if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { + 3bde: 62 e0 ldi r22, 0x02 ; 2 + 3be0: 70 e0 ldi r23, 0x00 ; 0 + 3be2: c8 01 movw r24, r16 + 3be4: be d3 rcall .+1916 ; 0x4362 + 3be6: 88 23 and r24, r24 + 3be8: 09 f4 brne .+2 ; 0x3bec + 3bea: ce c2 rjmp .+1436 ; 0x4188 + /* Write command. Store the address and prepare for the upcoming data. + * Respond with ACK. */ + CurrentAddress = Buffer[1]; + 3bec: f8 01 movw r30, r16 + 3bee: 81 81 ldd r24, Z+1 ; 0x01 + 3bf0: 80 93 c3 28 sts 0x28C3, r24 + State = STATE_CHINESE_WRITE; + 3bf4: 83 e0 ldi r24, 0x03 ; 3 + 3bf6: 80 93 be 28 sts 0x28BE, r24 + + Buffer[0] = ACK_VALUE; + 3bfa: 8a e0 ldi r24, 0x0A ; 10 + 3bfc: 80 83 st Z, r24 + return ACK_NAK_FRAME_SIZE; + 3bfe: 24 e0 ldi r18, 0x04 ; 4 + 3c00: 30 e0 ldi r19, 0x00 ; 0 + 3c02: 92 cd rjmp .-1244 ; 0x3728 + Crypto1Auth(&Buffer[0]); + + for (uint8_t i=0; i<4; i++) + Buffer[i+4] ^= Crypto1Byte(); + + if ((Buffer[4] == ReaderResponse[0]) && + 3c04: 25 81 ldd r18, Z+5 ; 0x05 + 3c06: 90 91 c5 28 lds r25, 0x28C5 + 3c0a: 29 13 cpse r18, r25 + 3c0c: 77 cf rjmp .-274 ; 0x3afc + (Buffer[5] == ReaderResponse[1]) && + 3c0e: 26 81 ldd r18, Z+6 ; 0x06 + 3c10: 90 91 c6 28 lds r25, 0x28C6 + 3c14: 29 13 cpse r18, r25 + 3c16: 72 cf rjmp .-284 ; 0x3afc + (Buffer[6] == ReaderResponse[2]) && + 3c18: 90 91 c7 28 lds r25, 0x28C7 + 3c1c: 89 13 cpse r24, r25 + 3c1e: 6e cf rjmp .-292 ; 0x3afc + (Buffer[7] == ReaderResponse[3])) { + /* Reader is authenticated. Encrypt the precalculated card response + * and generate the parity bits. */ + for (uint8_t i=0; i + 3c26: 8f 25 eor r24, r15 + 3c28: d8 01 movw r26, r16 + 3c2a: 8c 93 st X, r24 + Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); + 3c2c: f0 90 c8 28 lds r15, 0x28C8 + 3c30: 0f 2c mov r0, r15 + 3c32: f2 94 swap r15 + 3c34: f0 24 eor r15, r0 + 3c36: 0f 2c mov r0, r15 + 3c38: f6 94 lsr r15 + 3c3a: f6 94 lsr r15 + 3c3c: f0 24 eor r15, r0 + 3c3e: 16 d4 rcall .+2092 ; 0x446c + 3c40: f8 01 movw r30, r16 + 3c42: e0 58 subi r30, 0x80 ; 128 + 3c44: ff 4f sbci r31, 0xFF ; 255 + 3c46: 2f 2d mov r18, r15 + 3c48: 30 e0 ldi r19, 0x00 ; 0 + 3c4a: 2f 5f subi r18, 0xFF ; 255 + 3c4c: 3f 4f sbci r19, 0xFF ; 255 + 3c4e: 21 fb bst r18, 1 + 3c50: 88 24 eor r8, r8 + 3c52: 80 f8 bld r8, 0 + 3c54: 91 2c mov r9, r1 + 3c56: b1 e0 ldi r27, 0x01 ; 1 + 3c58: 8b 26 eor r8, r27 + 3c5a: 88 25 eor r24, r8 + 3c5c: 80 83 st Z, r24 + (Buffer[6] == ReaderResponse[2]) && + (Buffer[7] == ReaderResponse[3])) { + /* Reader is authenticated. Encrypt the precalculated card response + * and generate the parity bits. */ + for (uint8_t i=0; i + 3c64: 8f 25 eor r24, r15 + 3c66: f8 01 movw r30, r16 + 3c68: 81 83 std Z+1, r24 ; 0x01 + Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); + 3c6a: f0 90 c9 28 lds r15, 0x28C9 + 3c6e: 0f 2c mov r0, r15 + 3c70: f2 94 swap r15 + 3c72: f0 24 eor r15, r0 + 3c74: 0f 2c mov r0, r15 + 3c76: f6 94 lsr r15 + 3c78: f6 94 lsr r15 + 3c7a: f0 24 eor r15, r0 + 3c7c: f7 d3 rcall .+2030 ; 0x446c + 3c7e: f8 01 movw r30, r16 + 3c80: ef 57 subi r30, 0x7F ; 127 + 3c82: ff 4f sbci r31, 0xFF ; 255 + 3c84: 2f 2d mov r18, r15 + 3c86: 30 e0 ldi r19, 0x00 ; 0 + 3c88: 2f 5f subi r18, 0xFF ; 255 + 3c8a: 3f 4f sbci r19, 0xFF ; 255 + 3c8c: 21 fb bst r18, 1 + 3c8e: aa 24 eor r10, r10 + 3c90: a0 f8 bld r10, 0 + 3c92: b1 2c mov r11, r1 + 3c94: 31 e0 ldi r19, 0x01 ; 1 + 3c96: a3 26 eor r10, r19 + 3c98: 8a 25 eor r24, r10 + 3c9a: 80 83 st Z, r24 + (Buffer[6] == ReaderResponse[2]) && + (Buffer[7] == ReaderResponse[3])) { + /* Reader is authenticated. Encrypt the precalculated card response + * and generate the parity bits. */ + for (uint8_t i=0; i + 3ca2: 8f 25 eor r24, r15 + 3ca4: d8 01 movw r26, r16 + 3ca6: 12 96 adiw r26, 0x02 ; 2 + 3ca8: 8c 93 st X, r24 + Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); + 3caa: f0 90 ca 28 lds r15, 0x28CA + 3cae: 0f 2c mov r0, r15 + 3cb0: f2 94 swap r15 + 3cb2: f0 24 eor r15, r0 + 3cb4: 0f 2c mov r0, r15 + 3cb6: f6 94 lsr r15 + 3cb8: f6 94 lsr r15 + 3cba: f0 24 eor r15, r0 + 3cbc: d7 d3 rcall .+1966 ; 0x446c + 3cbe: f8 01 movw r30, r16 + 3cc0: ee 57 subi r30, 0x7E ; 126 + 3cc2: ff 4f sbci r31, 0xFF ; 255 + 3cc4: 2f 2d mov r18, r15 + 3cc6: 30 e0 ldi r19, 0x00 ; 0 + 3cc8: 2f 5f subi r18, 0xFF ; 255 + 3cca: 3f 4f sbci r19, 0xFF ; 255 + 3ccc: 21 fb bst r18, 1 + 3cce: cc 24 eor r12, r12 + 3cd0: c0 f8 bld r12, 0 + 3cd2: d1 2c mov r13, r1 + 3cd4: b1 e0 ldi r27, 0x01 ; 1 + 3cd6: cb 26 eor r12, r27 + 3cd8: 8c 25 eor r24, r12 + 3cda: 80 83 st Z, r24 + (Buffer[6] == ReaderResponse[2]) && + (Buffer[7] == ReaderResponse[3])) { + /* Reader is authenticated. Encrypt the precalculated card response + * and generate the parity bits. */ + for (uint8_t i=0; i + 3ce2: 8f 25 eor r24, r15 + 3ce4: f8 01 movw r30, r16 + 3ce6: 83 83 std Z+3, r24 ; 0x03 + Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(CardResponse[i]) ^ Crypto1FilterOutput(); + 3ce8: f0 90 cb 28 lds r15, 0x28CB + 3cec: 0f 2c mov r0, r15 + 3cee: f2 94 swap r15 + 3cf0: f0 24 eor r15, r0 + 3cf2: 0f 2c mov r0, r15 + 3cf4: f6 94 lsr r15 + 3cf6: f6 94 lsr r15 + 3cf8: f0 24 eor r15, r0 + 3cfa: b8 d3 rcall .+1904 ; 0x446c + 3cfc: f8 01 movw r30, r16 + 3cfe: ed 57 subi r30, 0x7D ; 125 + 3d00: ff 4f sbci r31, 0xFF ; 255 + 3d02: 2f 2d mov r18, r15 + 3d04: 30 e0 ldi r19, 0x00 ; 0 + 3d06: 2f 5f subi r18, 0xFF ; 255 + 3d08: 3f 4f sbci r19, 0xFF ; 255 + 3d0a: 21 fb bst r18, 1 + 3d0c: 66 24 eor r6, r6 + 3d0e: 60 f8 bld r6, 0 + 3d10: 71 2c mov r7, r1 + 3d12: 31 e0 ldi r19, 0x01 ; 1 + 3d14: 63 26 eor r6, r19 + 3d16: 86 25 eor r24, r6 + 3d18: 80 83 st Z, r24 + } + + State = STATE_AUTHED_IDLE; + 3d1a: 88 e0 ldi r24, 0x08 ; 8 + 3d1c: 80 93 be 28 sts 0x28BE, r24 + + return (CMD_AUTH_BA_FRAME_SIZE * BITS_PER_BYTE) | ISO14443A_APP_CUSTOM_PARITY; + 3d20: 20 e2 ldi r18, 0x20 ; 32 + 3d22: 30 e1 ldi r19, 0x10 ; 16 + 3d24: 01 cd rjmp .-1534 ; 0x3728 + * the block back into the global block buffer. */ + for (uint8_t i=0; i<(MEM_VALUE_SIZE + ISO14443A_CRCA_SIZE); i++) + Buffer[i] ^= Crypto1Byte(); + + if (ISO14443ACheckCRCA(Buffer, MEM_VALUE_SIZE )) { + MemoryReadBlock(BlockBuffer, (uint16_t) CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + 3d26: 60 91 c3 28 lds r22, 0x28C3 + 3d2a: b0 e1 ldi r27, 0x10 ; 16 + 3d2c: 6b 9f mul r22, r27 + 3d2e: b0 01 movw r22, r0 + 3d30: 11 24 eor r1, r1 + 3d32: 40 e1 ldi r20, 0x10 ; 16 + 3d34: 50 e0 ldi r21, 0x00 ; 0 + 3d36: 8c ec ldi r24, 0xCC ; 204 + 3d38: 98 e2 ldi r25, 0x28 ; 40 + 3d3a: 0e 94 de 06 call 0xdbc ; 0xdbc + +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]) + 3d3e: 20 91 cc 28 lds r18, 0x28CC + 3d42: 80 91 d0 28 lds r24, 0x28D0 + 3d46: 80 95 com r24 + 3d48: 28 17 cp r18, r24 + 3d4a: 09 f4 brne .+2 ; 0x3d4e + 3d4c: df c0 rjmp .+446 ; 0x3f0c + 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(); + 3d4e: cc d5 rcall .+2968 ; 0x48e8 + 3d50: 96 e0 ldi r25, 0x06 ; 6 + 3d52: 98 27 eor r25, r24 + 3d54: d8 01 movw r26, r16 + 3d56: 9c 93 st X, r25 + 3d58: 53 cd rjmp .-1370 ; 0x3800 + * form the reader in the next frame. */ + State = STATE_AUTHING; + + return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + 3d5a: c6 d5 rcall .+2956 ; 0x48e8 + 3d5c: 91 e0 ldi r25, 0x01 ; 1 + 3d5e: 98 27 eor r25, r24 + 3d60: f8 01 movw r30, r16 + 3d62: 90 83 st Z, r25 + return ACK_NAK_FRAME_SIZE; + 3d64: 24 e0 ldi r18, 0x04 ; 4 + 3d66: 30 e0 ldi r19, 0x00 ; 0 + 3d68: df cc rjmp .-1602 ; 0x3728 + + case STATE_CHINESE_WRITE: + if (ISO14443ACheckCRCA(Buffer, MEM_BYTES_PER_BLOCK)) { + /* CRC check passed. Write data into memory and send ACK. */ + if (!ActiveConfiguration.ReadOnly) { + MemoryWriteBlock(Buffer, CurrentAddress * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + 3d6a: 60 91 c3 28 lds r22, 0x28C3 + 3d6e: f0 e1 ldi r31, 0x10 ; 16 + 3d70: 6f 9f mul r22, r31 + 3d72: b0 01 movw r22, r0 + 3d74: 11 24 eor r1, r1 + 3d76: 40 e1 ldi r20, 0x10 ; 16 + 3d78: 50 e0 ldi r21, 0x00 ; 0 + 3d7a: c8 01 movw r24, r16 + 3d7c: 0e 94 f6 06 call 0xdec ; 0xdec + 3d80: 96 ce rjmp .-724 ; 0x3aae + * the incoming data. */ + for (uint8_t i=0; i<4; i++) + Buffer[i] ^= Crypto1Byte(); + + if (Buffer[0] == CMD_READ) { + if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { + 3d82: 62 e0 ldi r22, 0x02 ; 2 + 3d84: 70 e0 ldi r23, 0x00 ; 0 + 3d86: c8 01 movw r24, r16 + 3d88: ec d2 rcall .+1496 ; 0x4362 + 3d8a: 88 23 and r24, r24 + 3d8c: 31 f3 breq .-52 ; 0x3d5a + /* Read command. Read data from memory and append CRCA. */ + MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + 3d8e: f8 01 movw r30, r16 + 3d90: 61 81 ldd r22, Z+1 ; 0x01 + 3d92: f0 e1 ldi r31, 0x10 ; 16 + 3d94: 6f 9f mul r22, r31 + 3d96: b0 01 movw r22, r0 + 3d98: 11 24 eor r1, r1 + 3d9a: 40 e1 ldi r20, 0x10 ; 16 + 3d9c: 50 e0 ldi r21, 0x00 ; 0 + 3d9e: c8 01 movw r24, r16 + 3da0: 0e 94 de 06 call 0xdbc ; 0xdbc + ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); + 3da4: 60 e1 ldi r22, 0x10 ; 16 + 3da6: 70 e0 ldi r23, 0x00 ; 0 + 3da8: c8 01 movw r24, r16 + 3daa: ac d2 rcall .+1368 ; 0x4304 +void MifareClassicAppTask(void) +{ + +} + +uint16_t MifareClassicAppProcess(uint8_t* Buffer, uint16_t BitCount) + 3dac: 68 01 movw r12, r16 + 3dae: 30 e8 ldi r19, 0x80 ; 128 + 3db0: c3 0e add r12, r19 + 3db2: d1 1c adc r13, r1 + /* Read command. Read data from memory and append CRCA. */ + MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); + + /* Encrypt and calculate parity bits. */ + for (uint8_t i=0; i<(ISO14443A_CRCA_SIZE + MEM_BYTES_PER_BLOCK); i++) { + 3db4: a1 2c mov r10, r1 + uint8_t Plain = Buffer[i]; + 3db6: d8 01 movw r26, r16 + 3db8: bc 90 ld r11, X + Buffer[i] = Plain ^ Crypto1Byte(); + 3dba: 55 d5 rcall .+2730 ; 0x4866 + 3dbc: 8b 25 eor r24, r11 + 3dbe: f8 01 movw r30, r16 + 3dc0: 81 93 st Z+, r24 + 3dc2: 8f 01 movw r16, r30 + Buffer[ISO14443A_BUFFER_PARITY_OFFSET + i] = ODD_PARITY(Plain) ^ Crypto1FilterOutput(); + 3dc4: 0b 2c mov r0, r11 + 3dc6: b2 94 swap r11 + 3dc8: b0 24 eor r11, r0 + 3dca: 0b 2c mov r0, r11 + 3dcc: b6 94 lsr r11 + 3dce: b6 94 lsr r11 + 3dd0: b0 24 eor r11, r0 + 3dd2: 4c d3 rcall .+1688 ; 0x446c + 3dd4: 2b 2d mov r18, r11 + 3dd6: 30 e0 ldi r19, 0x00 ; 0 + 3dd8: 2f 5f subi r18, 0xFF ; 255 + 3dda: 3f 4f sbci r19, 0xFF ; 255 + 3ddc: 21 fb bst r18, 1 + 3dde: ee 24 eor r14, r14 + 3de0: e0 f8 bld r14, 0 + 3de2: f1 2c mov r15, r1 + 3de4: f1 e0 ldi r31, 0x01 ; 1 + 3de6: ef 26 eor r14, r31 + 3de8: 8e 25 eor r24, r14 + 3dea: d6 01 movw r26, r12 + 3dec: 8d 93 st X+, r24 + 3dee: 6d 01 movw r12, r26 + /* Read command. Read data from memory and append CRCA. */ + MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); + + /* Encrypt and calculate parity bits. */ + for (uint8_t i=0; i<(ISO14443A_CRCA_SIZE + MEM_BYTES_PER_BLOCK); i++) { + 3df0: a3 94 inc r10 + 3df2: b2 e1 ldi r27, 0x12 ; 18 + 3df4: ab 12 cpse r10, r27 + 3df6: df cf rjmp .-66 ; 0x3db6 + 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 ) + 3df8: 20 e9 ldi r18, 0x90 ; 144 + 3dfa: 30 e1 ldi r19, 0x10 ; 16 + 3dfc: 95 cc rjmp .-1750 ; 0x3728 + State = STATE_READY1; + return BitCount; + } else if (Buffer[0] == ISO14443A_CMD_SELECT_CL2) { + /* Load UID CL2 and perform anticollision */ + uint8_t UidCL2[ISO14443A_CL_UID_SIZE]; + MemoryReadBlock(UidCL2, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + 3dfe: 44 e0 ldi r20, 0x04 ; 4 + 3e00: 50 e0 ldi r21, 0x00 ; 0 + 3e02: 63 e0 ldi r22, 0x03 ; 3 + 3e04: 70 e0 ldi r23, 0x00 ; 0 + 3e06: ce 01 movw r24, r28 + 3e08: 01 96 adiw r24, 0x01 ; 1 + 3e0a: 0e 94 de 06 call 0xdbc ; 0xdbc + + if (ISO14443ASelect(Buffer, &BitCount, UidCL2, CardSAKValue)) { + 3e0e: 90 91 c1 28 lds r25, 0x28C1 + 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) { + 3e12: d8 01 movw r26, r16 + 3e14: 11 96 adiw r26, 0x01 ; 1 + 3e16: 8c 91 ld r24, X + 3e18: 80 32 cpi r24, 0x20 ; 32 + 3e1a: 09 f4 brne .+2 ; 0x3e1e + 3e1c: d3 c1 rjmp .+934 ; 0x41c4 + 3e1e: 80 37 cpi r24, 0x70 ; 112 + 3e20: 09 f0 breq .+2 ; 0x3e24 + 3e22: 80 cc rjmp .-1792 ; 0x3724 + return false; + + case ISO14443A_NVB_AC_END: + /* End of anticollision procedure. + * Send SAK CLn if we are selected. */ + if ( (DataPtr[2] == UidCL[0]) && + 3e24: d8 01 movw r26, r16 + 3e26: 12 96 adiw r26, 0x02 ; 2 + 3e28: 2c 91 ld r18, X + 3e2a: 12 97 sbiw r26, 0x02 ; 2 + 3e2c: 89 81 ldd r24, Y+1 ; 0x01 + 3e2e: 28 13 cpse r18, r24 + 3e30: 79 cc rjmp .-1806 ; 0x3724 + 3e32: 13 96 adiw r26, 0x03 ; 3 + 3e34: 2c 91 ld r18, X + 3e36: 13 97 sbiw r26, 0x03 ; 3 + 3e38: 8a 81 ldd r24, Y+2 ; 0x02 + 3e3a: 28 13 cpse r18, r24 + 3e3c: 73 cc rjmp .-1818 ; 0x3724 + (DataPtr[3] == UidCL[1]) && + 3e3e: 14 96 adiw r26, 0x04 ; 4 + 3e40: 2c 91 ld r18, X + 3e42: 14 97 sbiw r26, 0x04 ; 4 + 3e44: 8b 81 ldd r24, Y+3 ; 0x03 + 3e46: 28 13 cpse r18, r24 + 3e48: 6d cc rjmp .-1830 ; 0x3724 + (DataPtr[4] == UidCL[2]) && + 3e4a: 15 96 adiw r26, 0x05 ; 5 + 3e4c: 2c 91 ld r18, X + 3e4e: 15 97 sbiw r26, 0x05 ; 5 + 3e50: 8c 81 ldd r24, Y+4 ; 0x04 + 3e52: 28 13 cpse r18, r24 + 3e54: 67 cc rjmp .-1842 ; 0x3724 + (DataPtr[5] == UidCL[3]) ) { + + DataPtr[0] = SAKValue; + 3e56: 9c 93 st X, r25 + ISO14443AAppendCRCA(Buffer, 1); + 3e58: 61 e0 ldi r22, 0x01 ; 1 + 3e5a: 70 e0 ldi r23, 0x00 ; 0 + 3e5c: c8 01 movw r24, r16 + 3e5e: 52 d2 rcall .+1188 ; 0x4304 + State = STATE_ACTIVE; + 3e60: 86 e0 ldi r24, 0x06 ; 6 + 3e62: 80 93 be 28 sts 0x28BE, r24 + + *BitCount = ISO14443A_SAK_FRAME_SIZE; + 3e66: 28 e1 ldi r18, 0x18 ; 24 + 3e68: 30 e0 ldi r19, 0x00 ; 0 + 3e6a: 5e cc rjmp .-1860 ; 0x3728 + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + return ACK_NAK_FRAME_SIZE; + } + } else if (Buffer[0] == CMD_WRITE) { + if (ISO14443ACheckCRCA(Buffer, CMD_WRITE_FRAME_SIZE)) { + 3e6c: 62 e0 ldi r22, 0x02 ; 2 + 3e6e: 70 e0 ldi r23, 0x00 ; 0 + 3e70: c8 01 movw r24, r16 + 3e72: 77 d2 rcall .+1262 ; 0x4362 + 3e74: 88 23 and r24, r24 + 3e76: 81 f0 breq .+32 ; 0x3e98 + /* Write command. Store the address and prepare for the upcoming data. + * Respond with ACK. */ + CurrentAddress = Buffer[1]; + 3e78: d8 01 movw r26, r16 + 3e7a: 11 96 adiw r26, 0x01 ; 1 + 3e7c: 8c 91 ld r24, X + 3e7e: 80 93 c3 28 sts 0x28C3, r24 + State = STATE_WRITE; + 3e82: 89 e0 ldi r24, 0x09 ; 9 + 3e84: 80 93 be 28 sts 0x28BE, r24 + MemoryWriteBlock(BlockBuffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK ); + } else { + /* In read only mode, silently ignore the write */ + } + + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + 3e88: 2f d5 rcall .+2654 ; 0x48e8 + 3e8a: 9a e0 ldi r25, 0x0A ; 10 + 3e8c: 98 27 eor r25, r24 + 3e8e: f8 01 movw r30, r16 + 3e90: 90 83 st Z, r25 + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + + return ACK_NAK_FRAME_SIZE; + 3e92: 24 e0 ldi r18, 0x04 ; 4 + 3e94: 30 e0 ldi r19, 0x00 ; 0 + 3e96: 48 cc rjmp .-1904 ; 0x3728 + /* In read only mode, silently ignore the write */ + } + + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + 3e98: 27 d5 rcall .+2638 ; 0x48e8 + 3e9a: 91 e0 ldi r25, 0x01 ; 1 + 3e9c: 98 27 eor r25, r24 + 3e9e: d8 01 movw r26, r16 + 3ea0: 9c 93 st X, r25 + } + + return ACK_NAK_FRAME_SIZE; + 3ea2: 24 e0 ldi r18, 0x04 ; 4 + 3ea4: 30 e0 ldi r19, 0x00 ; 0 + 3ea6: 40 cc rjmp .-1920 ; 0x3728 + MemoryReadBlock(&UidCL1[1], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); + UidCL1[0] = ISO14443A_UID0_CT; + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, SAK_CL1_VALUE)) + State = STATE_READY2; + } else { + MemoryReadBlock(UidCL1, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + 3ea8: 44 e0 ldi r20, 0x04 ; 4 + 3eaa: 50 e0 ldi r21, 0x00 ; 0 + 3eac: 60 e0 ldi r22, 0x00 ; 0 + 3eae: 70 e0 ldi r23, 0x00 ; 0 + 3eb0: ce 01 movw r24, r28 + 3eb2: 01 96 adiw r24, 0x01 ; 1 + 3eb4: 0e 94 de 06 call 0xdbc ; 0xdbc + if (ISO14443ASelect(Buffer, &BitCount, UidCL1, CardSAKValue)) + 3eb8: 90 91 c1 28 lds r25, 0x28C1 + 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) { + 3ebc: f8 01 movw r30, r16 + 3ebe: 81 81 ldd r24, Z+1 ; 0x01 + 3ec0: 80 32 cpi r24, 0x20 ; 32 + 3ec2: 09 f4 brne .+2 ; 0x3ec6 + 3ec4: 9e c1 rjmp .+828 ; 0x4202 + 3ec6: 80 37 cpi r24, 0x70 ; 112 + 3ec8: 09 f0 breq .+2 ; 0x3ecc + 3eca: 2c cc rjmp .-1960 ; 0x3724 + return false; + + case ISO14443A_NVB_AC_END: + /* End of anticollision procedure. + * Send SAK CLn if we are selected. */ + if ( (DataPtr[2] == UidCL[0]) && + 3ecc: f8 01 movw r30, r16 + 3ece: 22 81 ldd r18, Z+2 ; 0x02 + 3ed0: 89 81 ldd r24, Y+1 ; 0x01 + 3ed2: 28 13 cpse r18, r24 + 3ed4: 27 cc rjmp .-1970 ; 0x3724 + 3ed6: 23 81 ldd r18, Z+3 ; 0x03 + 3ed8: 8a 81 ldd r24, Y+2 ; 0x02 + 3eda: 28 13 cpse r18, r24 + 3edc: 23 cc rjmp .-1978 ; 0x3724 + (DataPtr[3] == UidCL[1]) && + 3ede: 24 81 ldd r18, Z+4 ; 0x04 + 3ee0: 8b 81 ldd r24, Y+3 ; 0x03 + 3ee2: 28 13 cpse r18, r24 + 3ee4: 1f cc rjmp .-1986 ; 0x3724 + (DataPtr[4] == UidCL[2]) && + 3ee6: 25 81 ldd r18, Z+5 ; 0x05 + 3ee8: 8c 81 ldd r24, Y+4 ; 0x04 + 3eea: 28 13 cpse r18, r24 + 3eec: 1b cc rjmp .-1994 ; 0x3724 + (DataPtr[5] == UidCL[3]) ) { + + DataPtr[0] = SAKValue; + 3eee: 90 83 st Z, r25 + 3ef0: b3 cf rjmp .-154 ; 0x3e58 + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_DECREMENT) { + if (ISO14443ACheckCRCA(Buffer, CMD_DECREMENT_FRAME_SIZE)) { + 3ef2: 62 e0 ldi r22, 0x02 ; 2 + 3ef4: 70 e0 ldi r23, 0x00 ; 0 + 3ef6: c8 01 movw r24, r16 + 3ef8: 34 d2 rcall .+1128 ; 0x4362 + 3efa: 88 23 and r24, r24 + 3efc: 09 f4 brne .+2 ; 0x3f00 + 3efe: 2d cf rjmp .-422 ; 0x3d5a + CurrentAddress = Buffer[1]; + 3f00: f8 01 movw r30, r16 + 3f02: 81 81 ldd r24, Z+1 ; 0x01 + 3f04: 80 93 c3 28 sts 0x28C3, r24 + State = STATE_DECREMENT; + 3f08: 8b e0 ldi r24, 0x0B ; 11 + 3f0a: 5f ce rjmp .-834 ; 0x3bca + +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]) + 3f0c: 80 91 d4 28 lds r24, 0x28D4 + 3f10: 28 13 cpse r18, r24 + 3f12: 1d cf rjmp .-454 ; 0x3d4e + && (Block[1] == (uint8_t) ~Block[5]) && (Block[1] == Block[9]) + 3f14: e0 91 cd 28 lds r30, 0x28CD + 3f18: 80 91 d1 28 lds r24, 0x28D1 + 3f1c: 80 95 com r24 + 3f1e: e8 13 cpse r30, r24 + 3f20: 16 cf rjmp .-468 ; 0x3d4e + 3f22: 80 91 d5 28 lds r24, 0x28D5 + 3f26: e8 13 cpse r30, r24 + 3f28: 12 cf rjmp .-476 ; 0x3d4e + && (Block[2] == (uint8_t) ~Block[6]) && (Block[2] == Block[10]) + 3f2a: 80 91 ce 28 lds r24, 0x28CE + 3f2e: 90 91 d2 28 lds r25, 0x28D2 + 3f32: 90 95 com r25 + 3f34: 89 13 cpse r24, r25 + 3f36: 0b cf rjmp .-490 ; 0x3d4e + 3f38: 90 91 d6 28 lds r25, 0x28D6 + 3f3c: 89 13 cpse r24, r25 + 3f3e: 07 cf rjmp .-498 ; 0x3d4e + && (Block[3] == (uint8_t) ~Block[7]) && (Block[3] == Block[11]) + 3f40: 30 91 cf 28 lds r19, 0x28CF + 3f44: 90 91 d3 28 lds r25, 0x28D3 + 3f48: 90 95 com r25 + 3f4a: 39 13 cpse r19, r25 + 3f4c: 00 cf rjmp .-512 ; 0x3d4e + 3f4e: 90 91 d7 28 lds r25, 0x28D7 + 3f52: 39 13 cpse r19, r25 + 3f54: fc ce rjmp .-520 ; 0x3d4e + && (Block[12] == (uint8_t) ~Block[13]) + 3f56: 40 91 d8 28 lds r20, 0x28D8 + 3f5a: 90 91 d9 28 lds r25, 0x28D9 + 3f5e: 90 95 com r25 + 3f60: 49 13 cpse r20, r25 + 3f62: f5 ce rjmp .-534 ; 0x3d4e + && (Block[12] == Block[14]) + 3f64: 90 91 da 28 lds r25, 0x28DA + 3f68: 49 13 cpse r20, r25 + 3f6a: f1 ce rjmp .-542 ; 0x3d4e + && (Block[14] == (uint8_t) ~Block[15])) { + 3f6c: 90 91 db 28 lds r25, 0x28DB + 3f70: 90 95 com r25 + 3f72: 49 13 cpse r20, r25 + 3f74: ec ce rjmp .-552 ; 0x3d4e +} + +INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) +{ + *Value = 0; + *Value |= ((uint32_t) Block[0] << 0); + 3f76: d8 01 movw r26, r16 + 3f78: 9c 91 ld r25, X + *Value |= ((uint32_t) Block[1] << 8); + 3f7a: 11 96 adiw r26, 0x01 ; 1 + 3f7c: fc 91 ld r31, X + 3f7e: 11 97 sbiw r26, 0x01 ; 1 + *Value |= ((uint32_t) Block[2] << 16); + 3f80: 12 96 adiw r26, 0x02 ; 2 + 3f82: 4c 91 ld r20, X + 3f84: 12 97 sbiw r26, 0x02 ; 2 + 3f86: 50 e0 ldi r21, 0x00 ; 0 + 3f88: 60 e0 ldi r22, 0x00 ; 0 + 3f8a: 70 e0 ldi r23, 0x00 ; 0 + 3f8c: ba 01 movw r22, r20 + 3f8e: 55 27 eor r21, r21 + 3f90: 44 27 eor r20, r20 + +INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) +{ + *Value = 0; + *Value |= ((uint32_t) Block[0] << 0); + *Value |= ((uint32_t) Block[1] << 8); + 3f92: 5f 2b or r21, r31 + *Value |= ((uint32_t) Block[2] << 16); + 3f94: 49 2b or r20, r25 + *Value |= ((uint32_t) Block[3] << 24); + 3f96: 13 96 adiw r26, 0x03 ; 3 + 3f98: 9c 91 ld r25, X + 3f9a: 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); + 3f9c: 90 e0 ldi r25, 0x00 ; 0 + 3f9e: a0 e0 ldi r26, 0x00 ; 0 + 3fa0: b0 e0 ldi r27, 0x00 ; 0 + 3fa2: dc 01 movw r26, r24 + 3fa4: 99 27 eor r25, r25 + 3fa6: 88 27 eor r24, r24 + +INLINE void ValueFromBlock(uint32_t* Value, uint8_t* Block) +{ + *Value = 0; + *Value |= ((uint32_t) Block[0] << 0); + *Value |= ((uint32_t) Block[1] << 8); + 3fa8: 9e 2b or r25, r30 + *Value |= ((uint32_t) Block[2] << 16); + 3faa: 82 2b or r24, r18 + *Value |= ((uint32_t) Block[3] << 24); + 3fac: b3 2b or r27, r19 + uint32_t BlockValue; + + ValueFromBlock(&ParamValue, Buffer); + ValueFromBlock(&BlockValue, BlockBuffer); + + if (State == STATE_DECREMENT) { + 3fae: 20 91 be 28 lds r18, 0x28BE + 3fb2: 2b 30 cpi r18, 0x0B ; 11 + 3fb4: 09 f4 brne .+2 ; 0x3fb8 + 3fb6: dd c0 rjmp .+442 ; 0x4172 + BlockValue -= ParamValue; + } else if (State == STATE_INCREMENT) { + 3fb8: 2a 30 cpi r18, 0x0A ; 10 + 3fba: 21 f4 brne .+8 ; 0x3fc4 + BlockValue += ParamValue; + 3fbc: 84 0f add r24, r20 + 3fbe: 95 1f adc r25, r21 + 3fc0: a6 1f adc r26, r22 + 3fc2: b7 1f adc r27, r23 + *Value |= ((uint32_t) Block[3] << 24); +} + +INLINE void ValueToBlock(uint8_t* Block, uint32_t Value) +{ + Block[0] = (uint8_t) (Value >> 0); + 3fc4: 80 93 cc 28 sts 0x28CC, r24 + Block[1] = (uint8_t) (Value >> 8); + 3fc8: c9 2e mov r12, r25 + 3fca: da 2e mov r13, r26 + 3fcc: eb 2e mov r14, r27 + 3fce: ff 24 eor r15, r15 + 3fd0: c0 92 cd 28 sts 0x28CD, r12 + Block[2] = (uint8_t) (Value >> 16); + 3fd4: 8d 01 movw r16, r26 + 3fd6: 22 27 eor r18, r18 + 3fd8: 33 27 eor r19, r19 + 3fda: 00 93 ce 28 sts 0x28CE, r16 + Block[3] = (uint8_t) (Value >> 24); + 3fde: 4b 2f mov r20, r27 + 3fe0: 55 27 eor r21, r21 + 3fe2: 66 27 eor r22, r22 + 3fe4: 77 27 eor r23, r23 + 3fe6: 40 93 cf 28 sts 0x28CF, r20 + Block[4] = ~Block[0]; + 3fea: e8 2f mov r30, r24 + 3fec: e0 95 com r30 + 3fee: e0 93 d0 28 sts 0x28D0, r30 + Block[5] = ~Block[1]; + 3ff2: ec 2d mov r30, r12 + 3ff4: e0 95 com r30 + 3ff6: e0 93 d1 28 sts 0x28D1, r30 + Block[6] = ~Block[2]; + 3ffa: e0 2f mov r30, r16 + 3ffc: e0 95 com r30 + 3ffe: e0 93 d2 28 sts 0x28D2, r30 + Block[7] = ~Block[3]; + 4002: e4 2f mov r30, r20 + 4004: e0 95 com r30 + 4006: e0 93 d3 28 sts 0x28D3, r30 + Block[8] = Block[0]; + 400a: 80 93 d4 28 sts 0x28D4, r24 + Block[9] = Block[1]; + 400e: c0 92 d5 28 sts 0x28D5, r12 + Block[10] = Block[2]; + 4012: 00 93 d6 28 sts 0x28D6, r16 + Block[11] = Block[3]; + 4016: 40 93 d7 28 sts 0x28D7, r20 + /* Do nothing */ + } + + ValueToBlock(BlockBuffer, BlockValue); + + State = STATE_AUTHED_IDLE; + 401a: 88 e0 ldi r24, 0x08 ; 8 + 401c: 80 93 be 28 sts 0x28BE, r24 + /* No ACK response on value commands part 2 */ + return ISO14443A_APP_NO_RESPONSE; + 4020: 20 e0 ldi r18, 0x00 ; 0 + 4022: 30 e0 ldi r19, 0x00 ; 0 + 4024: 81 cb rjmp .-2302 ; 0x3728 + } 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)) { + 4026: 62 e0 ldi r22, 0x02 ; 2 + 4028: 70 e0 ldi r23, 0x00 ; 0 + 402a: c8 01 movw r24, r16 + 402c: 9a d1 rcall .+820 ; 0x4362 + 402e: 88 23 and r24, r24 + 4030: 09 f4 brne .+2 ; 0x4034 + 4032: 32 cf rjmp .-412 ; 0x3e98 + CurrentAddress = Buffer[1]; + 4034: d8 01 movw r26, r16 + 4036: 11 96 adiw r26, 0x01 ; 1 + 4038: 8c 91 ld r24, X + 403a: 80 93 c3 28 sts 0x28C3, r24 + State = STATE_INCREMENT; + 403e: 5a e0 ldi r21, 0x0A ; 10 + 4040: f5 2e mov r15, r21 + 4042: f0 92 be 28 sts 0x28BE, r15 + Buffer[0] = ACK_VALUE ^ Crypto1Nibble(); + 4046: 50 d4 rcall .+2208 ; 0x48e8 + 4048: 8f 25 eor r24, r15 + 404a: f8 01 movw r30, r16 + 404c: 80 83 st Z, r24 + } else { + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + 404e: 24 e0 ldi r18, 0x04 ; 4 + 4050: 30 e0 ldi r19, 0x00 ; 0 + 4052: 6a cb rjmp .-2348 ; 0x3728 + Buffer[0] = NAK_CRC_ERROR ^ Crypto1Nibble(); + } + return ACK_NAK_FRAME_SIZE; + }else if (Buffer[0] == CMD_TRANSFER) { + /* Write back the global block buffer to the desired block address */ + if (ISO14443ACheckCRCA(Buffer, CMD_TRANSFER_FRAME_SIZE)) { + 4054: 62 e0 ldi r22, 0x02 ; 2 + 4056: 70 e0 ldi r23, 0x00 ; 0 + 4058: c8 01 movw r24, r16 + 405a: 83 d1 rcall .+774 ; 0x4362 + 405c: 88 23 and r24, r24 + 405e: 09 f4 brne .+2 ; 0x4062 + 4060: 1b cf rjmp .-458 ; 0x3e98 + if (!ActiveConfiguration.ReadOnly) { + 4062: 80 91 06 29 lds r24, 0x2906 + 4066: 81 11 cpse r24, r1 + 4068: 0f cf rjmp .-482 ; 0x3e88 + MemoryWriteBlock(BlockBuffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK ); + 406a: d8 01 movw r26, r16 + 406c: 11 96 adiw r26, 0x01 ; 1 + 406e: 6c 91 ld r22, X + 4070: b0 e1 ldi r27, 0x10 ; 16 + 4072: 6b 9f mul r22, r27 + 4074: b0 01 movw r22, r0 + 4076: 11 24 eor r1, r1 + 4078: 40 e1 ldi r20, 0x10 ; 16 + 407a: 50 e0 ldi r21, 0x00 ; 0 + 407c: 8c ec ldi r24, 0xCC ; 204 + 407e: 98 e2 ldi r25, 0x28 ; 40 + 4080: 0e 94 f6 06 call 0xdec ; 0xdec + 4084: 01 cf rjmp .-510 ; 0x3e88 + } else { + Buffer[0] = NAK_INVALID_ARG; + return ACK_NAK_FRAME_SIZE; + } + } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { + if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { + 4086: 62 e0 ldi r22, 0x02 ; 2 + 4088: 70 e0 ldi r23, 0x00 ; 0 + 408a: c8 01 movw r24, r16 + 408c: 6a d1 rcall .+724 ; 0x4362 + 408e: 88 23 and r24, r24 + 4090: 09 f4 brne .+2 ; 0x4094 + 4092: d1 c0 rjmp .+418 ; 0x4236 + uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; + 4094: d8 01 movw r26, r16 + 4096: 11 96 adiw r26, 0x01 ; 1 + 4098: 2c 91 ld r18, X + 409a: 11 97 sbiw r26, 0x01 ; 1 + 409c: 2c 73 andi r18, 0x3C ; 60 + uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); + 409e: 8c 91 ld r24, X + 40a0: 80 36 cpi r24, 0x60 ; 96 + 40a2: 09 f4 brne .+2 ; 0x40a6 + 40a4: dc c0 rjmp .+440 ; 0x425e + 40a6: 8a e3 ldi r24, 0x3A ; 58 + 40a8: 90 e0 ldi r25, 0x00 ; 0 + uint16_t KeyAddress = (uint16_t) SectorAddress * MEM_BYTES_PER_BLOCK + KeyOffset; + 40aa: 5c 01 movw r10, r24 + 40ac: b0 e1 ldi r27, 0x10 ; 16 + 40ae: 2b 9f mul r18, r27 + 40b0: a0 0c add r10, r0 + 40b2: b1 1c adc r11, r1 + 40b4: 11 24 eor r1, r1 + uint8_t Key[6]; + uint8_t Uid[4]; + uint8_t CardNonce[4]; + + /* Generate a random nonce and read UID and key from memory */ + RandomGetBuffer(CardNonce, sizeof(CardNonce)); + 40b6: 6e 01 movw r12, r28 + 40b8: e7 e0 ldi r30, 0x07 ; 7 + 40ba: ce 0e add r12, r30 + 40bc: d1 1c adc r13, r1 + 40be: 64 e0 ldi r22, 0x04 ; 4 + 40c0: c6 01 movw r24, r12 + 40c2: 0e 94 3f 06 call 0xc7e ; 0xc7e + if (_7BUID) + 40c6: 80 91 c2 28 lds r24, 0x28C2 + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + 40ca: 7e 01 movw r14, r28 + uint8_t Uid[4]; + uint8_t CardNonce[4]; + + /* Generate a random nonce and read UID and key from memory */ + RandomGetBuffer(CardNonce, sizeof(CardNonce)); + if (_7BUID) + 40cc: 88 23 and r24, r24 + 40ce: 09 f4 brne .+2 ; 0x40d2 + 40d0: b8 c0 rjmp .+368 ; 0x4242 + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + 40d2: fb e0 ldi r31, 0x0B ; 11 + 40d4: ef 0e add r14, r31 + 40d6: f1 1c adc r15, r1 + 40d8: 44 e0 ldi r20, 0x04 ; 4 + 40da: 50 e0 ldi r21, 0x00 ; 0 + 40dc: 63 e0 ldi r22, 0x03 ; 3 + 40de: 70 e0 ldi r23, 0x00 ; 0 + 40e0: c7 01 movw r24, r14 + 40e2: 0e 94 de 06 call 0xdbc ; 0xdbc + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + MemoryReadBlock(Key, KeyAddress, MEM_KEY_SIZE); + 40e6: 46 e0 ldi r20, 0x06 ; 6 + 40e8: 50 e0 ldi r21, 0x00 ; 0 + 40ea: b5 01 movw r22, r10 + 40ec: ce 01 movw r24, r28 + 40ee: 01 96 adiw r24, 0x01 ; 1 + 40f0: 0e 94 de 06 call 0xdbc ; 0xdbc + + /* Precalculate the reader response from card-nonce */ + for (uint8_t i=0; i + + /* Precalculate our response from the reader response */ + for (uint8_t i=0; i + + /* Respond with the random card nonce and expect further authentication + * form the reader in the next frame. */ + State = STATE_AUTHING; + 4140: 87 e0 ldi r24, 0x07 ; 7 + 4142: 80 93 be 28 sts 0x28BE, r24 + + for (uint8_t i=0; i + + return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; + 416c: 20 e2 ldi r18, 0x20 ; 32 + 416e: 30 e0 ldi r19, 0x00 ; 0 + 4170: db ca rjmp .-2634 ; 0x3728 + + ValueFromBlock(&ParamValue, Buffer); + ValueFromBlock(&BlockValue, BlockBuffer); + + if (State == STATE_DECREMENT) { + BlockValue -= ParamValue; + 4172: 84 1b sub r24, r20 + 4174: 95 0b sbc r25, r21 + 4176: a6 0b sbc r26, r22 + 4178: b7 0b sbc r27, r23 + 417a: 24 cf rjmp .-440 ; 0x3fc4 + return BitCount; + } else if (Buffer[0] == CMD_HALT) { + /* Halts the tag. According to the ISO14443, the second + * byte is supposed to be 0. */ + if (Buffer[1] == 0) { + if (ISO14443ACheckCRCA(Buffer, CMD_HALT_FRAME_SIZE)) { + 417c: 62 e0 ldi r22, 0x02 ; 2 + 417e: 70 e0 ldi r23, 0x00 ; 0 + 4180: c8 01 movw r24, r16 + 4182: ef d0 rcall .+478 ; 0x4362 + 4184: 81 11 cpse r24, r1 + 4186: ec cc rjmp .-1576 ; 0x3b60 + /* 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; + 4188: 81 e0 ldi r24, 0x01 ; 1 + 418a: d8 01 movw r26, r16 + 418c: 8c 93 st X, r24 + return ACK_NAK_FRAME_SIZE; + 418e: 24 e0 ldi r18, 0x04 ; 4 + 4190: 30 e0 ldi r19, 0x00 ; 0 + 4192: ca ca rjmp .-2668 ; 0x3728 + } else if (Buffer[0] == CMD_CHINESE_WIPE) { + /* Wipe memory */ + Buffer[0] = ACK_VALUE; + return ACK_NAK_FRAME_SIZE; + } else if (Buffer[0] == CMD_READ) { + if (ISO14443ACheckCRCA(Buffer, CMD_READ_FRAME_SIZE)) { + 4194: 62 e0 ldi r22, 0x02 ; 2 + 4196: 70 e0 ldi r23, 0x00 ; 0 + 4198: c8 01 movw r24, r16 + 419a: e3 d0 rcall .+454 ; 0x4362 + 419c: 88 23 and r24, r24 + 419e: a1 f3 breq .-24 ; 0x4188 + /* Read command. Read data from memory and append CRCA. */ + MemoryReadBlock(Buffer, (uint16_t) Buffer[1] * MEM_BYTES_PER_BLOCK, MEM_BYTES_PER_BLOCK); + 41a0: f8 01 movw r30, r16 + 41a2: 61 81 ldd r22, Z+1 ; 0x01 + 41a4: f0 e1 ldi r31, 0x10 ; 16 + 41a6: 6f 9f mul r22, r31 + 41a8: b0 01 movw r22, r0 + 41aa: 11 24 eor r1, r1 + 41ac: 40 e1 ldi r20, 0x10 ; 16 + 41ae: 50 e0 ldi r21, 0x00 ; 0 + 41b0: c8 01 movw r24, r16 + 41b2: 0e 94 de 06 call 0xdbc ; 0xdbc + ISO14443AAppendCRCA(Buffer, MEM_BYTES_PER_BLOCK); + 41b6: 60 e1 ldi r22, 0x10 ; 16 + 41b8: 70 e0 ldi r23, 0x00 ; 0 + 41ba: c8 01 movw r24, r16 + 41bc: a3 d0 rcall .+326 ; 0x4304 + + return (CMD_READ_RESPONSE_FRAME_SIZE + ISO14443A_CRCA_SIZE ) + 41be: 20 e9 ldi r18, 0x90 ; 144 + 41c0: 30 e0 ldi r19, 0x00 ; 0 + 41c2: b2 ca rjmp .-2716 ; 0x3728 + + switch (NVB) { + case ISO14443A_NVB_AC_START: + /* Start of anticollision procedure. + * Send whole UID CLn + BCC */ + DataPtr[0] = UidCL[0]; + 41c4: 89 81 ldd r24, Y+1 ; 0x01 + 41c6: f8 01 movw r30, r16 + 41c8: 80 83 st Z, r24 + DataPtr[1] = UidCL[1]; + 41ca: 3a 81 ldd r19, Y+2 ; 0x02 + 41cc: 31 83 std Z+1, r19 ; 0x01 + DataPtr[2] = UidCL[2]; + 41ce: 2b 81 ldd r18, Y+3 ; 0x03 + 41d0: 22 83 std Z+2, r18 ; 0x02 + DataPtr[3] = UidCL[3]; + 41d2: 9c 81 ldd r25, Y+4 ; 0x04 + 41d4: 93 83 std Z+3, r25 ; 0x03 + DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); + 41d6: 83 27 eor r24, r19 + 41d8: 82 27 eor r24, r18 + 41da: 89 27 eor r24, r25 + 41dc: 84 83 std Z+4, r24 ; 0x04 + + *BitCount = ISO14443A_CL_FRAME_SIZE; + 41de: 28 e2 ldi r18, 0x28 ; 40 + 41e0: 30 e0 ldi r19, 0x00 ; 0 + 41e2: a2 ca rjmp .-2748 ; 0x3728 + + switch (NVB) { + case ISO14443A_NVB_AC_START: + /* Start of anticollision procedure. + * Send whole UID CLn + BCC */ + DataPtr[0] = UidCL[0]; + 41e4: f8 01 movw r30, r16 + 41e6: 80 83 st Z, r24 + DataPtr[1] = UidCL[1]; + 41e8: 3a 81 ldd r19, Y+2 ; 0x02 + 41ea: 31 83 std Z+1, r19 ; 0x01 + DataPtr[2] = UidCL[2]; + 41ec: 9b 81 ldd r25, Y+3 ; 0x03 + 41ee: 92 83 std Z+2, r25 ; 0x02 + DataPtr[3] = UidCL[3]; + 41f0: 2c 81 ldd r18, Y+4 ; 0x04 + 41f2: 23 83 std Z+3, r18 ; 0x03 + DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); + 41f4: 93 27 eor r25, r19 + 41f6: 98 27 eor r25, r24 + 41f8: 92 27 eor r25, r18 + 41fa: 94 83 std Z+4, r25 ; 0x04 + + *BitCount = ISO14443A_CL_FRAME_SIZE; + 41fc: 28 e2 ldi r18, 0x28 ; 40 + 41fe: 30 e0 ldi r19, 0x00 ; 0 + 4200: 93 ca rjmp .-2778 ; 0x3728 + + switch (NVB) { + case ISO14443A_NVB_AC_START: + /* Start of anticollision procedure. + * Send whole UID CLn + BCC */ + DataPtr[0] = UidCL[0]; + 4202: 89 81 ldd r24, Y+1 ; 0x01 + 4204: 80 83 st Z, r24 + DataPtr[1] = UidCL[1]; + 4206: 3a 81 ldd r19, Y+2 ; 0x02 + 4208: 31 83 std Z+1, r19 ; 0x01 + DataPtr[2] = UidCL[2]; + 420a: 2b 81 ldd r18, Y+3 ; 0x03 + 420c: 22 83 std Z+2, r18 ; 0x02 + DataPtr[3] = UidCL[3]; + 420e: 9c 81 ldd r25, Y+4 ; 0x04 + 4210: 93 83 std Z+3, r25 ; 0x03 + DataPtr[4] = ISO14443A_CALC_BCC(DataPtr); + 4212: 83 27 eor r24, r19 + 4214: 82 27 eor r24, r18 + 4216: 89 27 eor r24, r25 + 4218: 84 83 std Z+4, r24 ; 0x04 + + *BitCount = ISO14443A_CL_FRAME_SIZE; + 421a: 28 e2 ldi r18, 0x28 ; 40 + 421c: 30 e0 ldi r19, 0x00 ; 0 + 421e: 84 ca rjmp .-2808 ; 0x3728 + /* Generate a random nonce and read UID and key from memory */ + RandomGetBuffer(CardNonce, sizeof(CardNonce)); + if (_7BUID) + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + 4220: 9b e0 ldi r25, 0x0B ; 11 + 4222: e9 0e add r14, r25 + 4224: f1 1c adc r15, r1 + 4226: 44 e0 ldi r20, 0x04 ; 4 + 4228: 50 e0 ldi r21, 0x00 ; 0 + 422a: 60 e0 ldi r22, 0x00 ; 0 + 422c: 70 e0 ldi r23, 0x00 ; 0 + 422e: c7 01 movw r24, r14 + 4230: 0e 94 de 06 call 0xdbc ; 0xdbc + 4234: ea cb rjmp .-2092 ; 0x3a0a + /* Setup crypto1 cipher. Discard in-place encrypted CardNonce. */ + Crypto1Setup(Key, Uid, CardNonce); + + return CMD_AUTH_RB_FRAME_SIZE * BITS_PER_BYTE; + } else { + Buffer[0] = NAK_CRC_ERROR; + 4236: 81 e0 ldi r24, 0x01 ; 1 + 4238: f8 01 movw r30, r16 + 423a: 80 83 st Z, r24 + return ACK_NAK_FRAME_SIZE; + 423c: 24 e0 ldi r18, 0x04 ; 4 + 423e: 30 e0 ldi r19, 0x00 ; 0 + 4240: 73 ca rjmp .-2842 ; 0x3728 + /* Generate a random nonce and read UID and key from memory */ + RandomGetBuffer(CardNonce, sizeof(CardNonce)); + if (_7BUID) + MemoryReadBlock(Uid, MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + 4242: 3b e0 ldi r19, 0x0B ; 11 + 4244: e3 0e add r14, r19 + 4246: f1 1c adc r15, r1 + 4248: 44 e0 ldi r20, 0x04 ; 4 + 424a: 50 e0 ldi r21, 0x00 ; 0 + 424c: 60 e0 ldi r22, 0x00 ; 0 + 424e: 70 e0 ldi r23, 0x00 ; 0 + 4250: c7 01 movw r24, r14 + 4252: 0e 94 de 06 call 0xdbc ; 0xdbc + 4256: 47 cf rjmp .-370 ; 0x40e6 + return ACK_NAK_FRAME_SIZE; + } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B) ) { + if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { + /* Nested authentication. */ + uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; + uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); + 4258: 60 e3 ldi r22, 0x30 ; 48 + 425a: 70 e0 ldi r23, 0x00 ; 0 + 425c: b8 cb rjmp .-2192 ; 0x39ce + return ACK_NAK_FRAME_SIZE; + } + } else if ( (Buffer[0] == CMD_AUTH_A) || (Buffer[0] == CMD_AUTH_B)) { + if (ISO14443ACheckCRCA(Buffer, CMD_AUTH_FRAME_SIZE)) { + uint8_t SectorAddress = Buffer[1] & MEM_SECTOR_ADDR_MASK; + uint8_t KeyOffset = (Buffer[0] == CMD_AUTH_A ? MEM_KEY_A_OFFSET : MEM_KEY_B_OFFSET); + 425e: 80 e3 ldi r24, 0x30 ; 48 + 4260: 90 e0 ldi r25, 0x00 ; 0 + 4262: 23 cf rjmp .-442 ; 0x40aa + +00004264 : + /* No response has been sent, when we reach here */ + return ISO14443A_APP_NO_RESPONSE; +} + +void MifareClassicGetUid(ConfigurationUidType Uid) +{ + 4264: cf 93 push r28 + 4266: df 93 push r29 + 4268: ec 01 movw r28, r24 + if (_7BUID) { + 426a: 80 91 c2 28 lds r24, 0x28C2 + 426e: 81 11 cpse r24, r1 + 4270: 09 c0 rjmp .+18 ; 0x4284 + //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); + 4272: 44 e0 ldi r20, 0x04 ; 4 + 4274: 50 e0 ldi r21, 0x00 ; 0 + 4276: 60 e0 ldi r22, 0x00 ; 0 + 4278: 70 e0 ldi r23, 0x00 ; 0 + 427a: ce 01 movw r24, r28 +} + 427c: df 91 pop r29 + 427e: 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); + 4280: 0c 94 de 06 jmp 0xdbc ; 0xdbc + +void MifareClassicGetUid(ConfigurationUidType Uid) +{ + if (_7BUID) { + //Uid[0]=0x88; + MemoryReadBlock(&Uid[0], MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE-1); + 4284: 43 e0 ldi r20, 0x03 ; 3 + 4286: 50 e0 ldi r21, 0x00 ; 0 + 4288: 60 e0 ldi r22, 0x00 ; 0 + 428a: 70 e0 ldi r23, 0x00 ; 0 + 428c: ce 01 movw r24, r28 + 428e: 0e 94 de 06 call 0xdbc ; 0xdbc + MemoryReadBlock(&Uid[3], MEM_UID_CL2_ADDRESS, MEM_UID_CL2_SIZE); + 4292: 44 e0 ldi r20, 0x04 ; 4 + 4294: 50 e0 ldi r21, 0x00 ; 0 + 4296: 63 e0 ldi r22, 0x03 ; 3 + 4298: 70 e0 ldi r23, 0x00 ; 0 + 429a: ce 01 movw r24, r28 + 429c: 03 96 adiw r24, 0x03 ; 3 + } + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); +} + 429e: df 91 pop r29 + 42a0: cf 91 pop r28 +void MifareClassicGetUid(ConfigurationUidType Uid) +{ + if (_7BUID) { + //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); + 42a2: 0c 94 de 06 jmp 0xdbc ; 0xdbc + +000042a6 : + else + MemoryReadBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); +} + +void MifareClassicSetUid(ConfigurationUidType Uid) +{ + 42a6: cf 93 push r28 + 42a8: df 93 push r29 + 42aa: 1f 92 push r1 + 42ac: cd b7 in r28, 0x3d ; 61 + 42ae: de b7 in r29, 0x3e ; 62 + if (_7BUID) { + 42b0: 20 91 c2 28 lds r18, 0x28C2 + 42b4: 21 11 cpse r18, r1 + 42b6: 1b c0 rjmp .+54 ; 0x42ee + //Uid[0]=0x88; + MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, ActiveConfiguration.UidSize); + } + else { + uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; + 42b8: fc 01 movw r30, r24 + 42ba: 21 81 ldd r18, Z+1 ; 0x01 + 42bc: 30 81 ld r19, Z + 42be: 23 27 eor r18, r19 + 42c0: 32 81 ldd r19, Z+2 ; 0x02 + 42c2: 23 27 eor r18, r19 + 42c4: 33 81 ldd r19, Z+3 ; 0x03 + 42c6: 23 27 eor r18, r19 + 42c8: 29 83 std Y+1, r18 ; 0x01 + + MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + 42ca: 44 e0 ldi r20, 0x04 ; 4 + 42cc: 50 e0 ldi r21, 0x00 ; 0 + 42ce: 60 e0 ldi r22, 0x00 ; 0 + 42d0: 70 e0 ldi r23, 0x00 ; 0 + 42d2: 0e 94 f6 06 call 0xdec ; 0xdec + MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); + 42d6: 41 e0 ldi r20, 0x01 ; 1 + 42d8: 50 e0 ldi r21, 0x00 ; 0 + 42da: 64 e0 ldi r22, 0x04 ; 4 + 42dc: 70 e0 ldi r23, 0x00 ; 0 + 42de: ce 01 movw r24, r28 + 42e0: 01 96 adiw r24, 0x01 ; 1 + 42e2: 0e 94 f6 06 call 0xdec ; 0xdec + } +} + 42e6: 0f 90 pop r0 + 42e8: df 91 pop r29 + 42ea: cf 91 pop r28 + 42ec: 08 95 ret + +void MifareClassicSetUid(ConfigurationUidType Uid) +{ + if (_7BUID) { + //Uid[0]=0x88; + MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, ActiveConfiguration.UidSize); + 42ee: 40 91 05 29 lds r20, 0x2905 + 42f2: 50 e0 ldi r21, 0x00 ; 0 + 42f4: 60 e0 ldi r22, 0x00 ; 0 + 42f6: 70 e0 ldi r23, 0x00 ; 0 + 42f8: 0e 94 f6 06 call 0xdec ; 0xdec + uint8_t BCC = Uid[0] ^ Uid[1] ^ Uid[2] ^ Uid[3]; + + MemoryWriteBlock(Uid, MEM_UID_CL1_ADDRESS, MEM_UID_CL1_SIZE); + MemoryWriteBlock(&BCC, MEM_UID_BCC1_ADDRESS, ISO14443A_CL_BCC_SIZE); + } +} + 42fc: 0f 90 pop r0 + 42fe: df 91 pop r29 + 4300: cf 91 pop r28 + 4302: 08 95 ret + +00004304 : + +void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 4304: 61 15 cp r22, r1 + 4306: 71 05 cpc r23, r1 + 4308: 41 f1 breq .+80 ; 0x435a + * Author: skuser + */ + +#include "ISO14443-3A.h" + +void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { + 430a: 68 0f add r22, r24 + 430c: 79 1f adc r23, r25 + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + 430e: fc 01 movw r30, r24 + */ + +#include "ISO14443-3A.h" + +void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { + uint16_t Checksum = 0x6363; + 4310: 23 e6 ldi r18, 0x63 ; 99 + 4312: 33 e6 ldi r19, 0x63 ; 99 + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + uint8_t Byte = *DataPtr++; + 4314: 41 91 ld r20, Z+ + + Byte ^= (uint8_t) (Checksum & 0x00FF); + 4316: 42 27 eor r20, r18 + Byte ^= Byte << 4; + 4318: 50 e1 ldi r21, 0x10 ; 16 + 431a: 45 9f mul r20, r21 + 431c: c0 01 movw r24, r0 + 431e: 11 24 eor r1, r1 + 4320: a4 2f mov r26, r20 + 4322: a8 27 eor r26, r24 + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + 4324: 8a 2f mov r24, r26 + 4326: 90 e0 ldi r25, 0x00 ; 0 + 4328: 58 2f mov r21, r24 + 432a: 44 27 eor r20, r20 + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + 432c: 88 0f add r24, r24 + 432e: 99 1f adc r25, r25 + 4330: 88 0f add r24, r24 + 4332: 99 1f adc r25, r25 + 4334: 88 0f add r24, r24 + 4336: 99 1f adc r25, r25 + uint8_t Byte = *DataPtr++; + + Byte ^= (uint8_t) (Checksum & 0x00FF); + Byte ^= Byte << 4; + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + 4338: 48 27 eor r20, r24 + 433a: 59 27 eor r21, r25 + 433c: 23 2f mov r18, r19 + 433e: 33 27 eor r19, r19 + 4340: 24 27 eor r18, r20 + 4342: 35 27 eor r19, r21 + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + 4344: a2 95 swap r26 + 4346: af 70 andi r26, 0x0F ; 15 + uint8_t Byte = *DataPtr++; + + Byte ^= (uint8_t) (Checksum & 0x00FF); + Byte ^= Byte << 4; + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + 4348: 2a 27 eor r18, r26 + +void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 434a: e6 17 cp r30, r22 + 434c: f7 07 cpc r31, r23 + 434e: 11 f7 brne .-60 ; 0x4314 + 4350: 92 2f mov r25, r18 + 4352: 83 2f mov r24, r19 + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + } + + *DataPtr++ = (Checksum >> 0) & 0x00FF; + 4354: 90 83 st Z, r25 + *DataPtr = (Checksum >> 8) & 0x00FF; + 4356: 81 83 std Z+1, r24 ; 0x01 + 4358: 08 95 ret + +#include "ISO14443-3A.h" + +void ISO14443AAppendCRCA(void* Buffer, uint16_t ByteCount) { + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + 435a: fc 01 movw r30, r24 + + while(ByteCount--) { + 435c: 83 e6 ldi r24, 0x63 ; 99 + 435e: 93 e6 ldi r25, 0x63 ; 99 + 4360: f9 cf rjmp .-14 ; 0x4354 + +00004362 : +bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) +{ + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 4362: 61 15 cp r22, r1 + 4364: 71 05 cpc r23, r1 + 4366: b1 f1 breq .+108 ; 0x43d4 + + *DataPtr++ = (Checksum >> 0) & 0x00FF; + *DataPtr = (Checksum >> 8) & 0x00FF; +} + +bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) + 4368: 68 0f add r22, r24 + 436a: 79 1f adc r23, r25 +{ + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + 436c: fc 01 movw r30, r24 + *DataPtr = (Checksum >> 8) & 0x00FF; +} + +bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) +{ + uint16_t Checksum = 0x6363; + 436e: 23 e6 ldi r18, 0x63 ; 99 + 4370: 33 e6 ldi r19, 0x63 ; 99 + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + uint8_t Byte = *DataPtr++; + 4372: 41 91 ld r20, Z+ + + Byte ^= (uint8_t) (Checksum & 0x00FF); + 4374: 42 27 eor r20, r18 + Byte ^= Byte << 4; + 4376: 50 e1 ldi r21, 0x10 ; 16 + 4378: 45 9f mul r20, r21 + 437a: c0 01 movw r24, r0 + 437c: 11 24 eor r1, r1 + 437e: a4 2f mov r26, r20 + 4380: a8 27 eor r26, r24 + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + 4382: 8a 2f mov r24, r26 + 4384: 90 e0 ldi r25, 0x00 ; 0 + 4386: 58 2f mov r21, r24 + 4388: 44 27 eor r20, r20 + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + 438a: 88 0f add r24, r24 + 438c: 99 1f adc r25, r25 + 438e: 88 0f add r24, r24 + 4390: 99 1f adc r25, r25 + 4392: 88 0f add r24, r24 + 4394: 99 1f adc r25, r25 + uint8_t Byte = *DataPtr++; + + Byte ^= (uint8_t) (Checksum & 0x00FF); + Byte ^= Byte << 4; + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + 4396: 48 27 eor r20, r24 + 4398: 59 27 eor r21, r25 + 439a: 23 2f mov r18, r19 + 439c: 33 27 eor r19, r19 + 439e: 24 27 eor r18, r20 + 43a0: 35 27 eor r19, r21 + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + 43a2: a2 95 swap r26 + 43a4: af 70 andi r26, 0x0F ; 15 + uint8_t Byte = *DataPtr++; + + Byte ^= (uint8_t) (Checksum & 0x00FF); + Byte ^= Byte << 4; + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + 43a6: 2a 27 eor r18, r26 +bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) +{ + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + + while(ByteCount--) { + 43a8: e6 17 cp r30, r22 + 43aa: f7 07 cpc r31, r23 + 43ac: 11 f7 brne .-60 ; 0x4372 + 43ae: a9 01 movw r20, r18 + 43b0: 55 27 eor r21, r21 + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + } + + return (DataPtr[0] == ((Checksum >> 0) & 0xFF)) && (DataPtr[1] == ((Checksum >> 8) & 0xFF)); + 43b2: 80 81 ld r24, Z + 43b4: 90 e0 ldi r25, 0x00 ; 0 + 43b6: 84 17 cp r24, r20 + 43b8: 95 07 cpc r25, r21 + 43ba: 11 f0 breq .+4 ; 0x43c0 + 43bc: 80 e0 ldi r24, 0x00 ; 0 +} + 43be: 08 95 ret + + Checksum = (Checksum >> 8) ^ ( (uint16_t) Byte << 8 ) ^ + ( (uint16_t) Byte << 3 ) ^ ( (uint16_t) Byte >> 4 ); + } + + return (DataPtr[0] == ((Checksum >> 0) & 0xFF)) && (DataPtr[1] == ((Checksum >> 8) & 0xFF)); + 43c0: 41 81 ldd r20, Z+1 ; 0x01 + 43c2: 50 e0 ldi r21, 0x00 ; 0 + 43c4: 23 2f mov r18, r19 + 43c6: 33 27 eor r19, r19 + 43c8: 81 e0 ldi r24, 0x01 ; 1 + 43ca: 42 17 cp r20, r18 + 43cc: 53 07 cpc r21, r19 + 43ce: b9 f3 breq .-18 ; 0x43be + 43d0: 80 e0 ldi r24, 0x00 ; 0 + 43d2: f5 cf rjmp .-22 ; 0x43be +} + +bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) +{ + uint16_t Checksum = 0x6363; + uint8_t* DataPtr = (uint8_t*) Buffer; + 43d4: fc 01 movw r30, r24 + + while(ByteCount--) { + 43d6: 43 e6 ldi r20, 0x63 ; 99 + 43d8: 50 e0 ldi r21, 0x00 ; 0 + *DataPtr = (Checksum >> 8) & 0x00FF; +} + +bool ISO14443ACheckCRCA(void* Buffer, uint16_t ByteCount) +{ + uint16_t Checksum = 0x6363; + 43da: 23 e6 ldi r18, 0x63 ; 99 + 43dc: 33 e6 ldi r19, 0x63 ; 99 + 43de: e9 cf rjmp .-46 ; 0x43b2 + +000043e0 : +/* Split Crypto1 state into even and odd bits to speed up the output filter network */ +static uint8_t StateEven[LFSR_SIZE/2] = {0}; +static uint8_t StateOdd[LFSR_SIZE/2] = {0}; + +/* Proceed LFSR by one clock cycle */ +static void Crypto1LFSR(uint8_t In) { + 43e0: cf 93 push r28 + uint8_t Feedback = 0; + + /* Calculate feedback according to LFSR taps. XOR all 6 state bytes + * into a single bit. */ + Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); + 43e2: b0 91 df 28 lds r27, 0x28DF + Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); + 43e6: c0 91 e0 28 lds r28, 0x28E0 + Feedback ^= StateEven[2] & (uint8_t) (LFSR_MASK_EVEN >> 16); + 43ea: 40 91 e1 28 lds r20, 0x28E1 + + Feedback ^= StateOdd[0] & (uint8_t) (LFSR_MASK_ODD >> 0); + 43ee: a0 91 dc 28 lds r26, 0x28DC + Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); + 43f2: f0 91 dd 28 lds r31, 0x28DD + Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); + 43f6: e0 91 de 28 lds r30, 0x28DE + uint8_t Feedback = 0; + + /* Calculate feedback according to LFSR taps. XOR all 6 state bytes + * into a single bit. */ + Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); + Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); + 43fa: 9c 2f mov r25, r28 + 43fc: 90 71 andi r25, 0x10 ; 16 +static void Crypto1LFSR(uint8_t In) { + uint8_t Feedback = 0; + + /* Calculate feedback according to LFSR taps. XOR all 6 state bytes + * into a single bit. */ + Feedback ^= StateEven[0] & (uint8_t) (LFSR_MASK_EVEN >> 0); + 43fe: 2b 2f mov r18, r27 + 4400: 21 7e andi r18, 0xE1 ; 225 + Feedback ^= StateEven[1] & (uint8_t) (LFSR_MASK_EVEN >> 8); + 4402: 92 27 eor r25, r18 + Feedback ^= StateEven[2] & (uint8_t) (LFSR_MASK_EVEN >> 16); + 4404: 24 2f mov r18, r20 + 4406: 20 72 andi r18, 0x20 ; 32 + 4408: 92 27 eor r25, r18 + + Feedback ^= StateOdd[0] & (uint8_t) (LFSR_MASK_ODD >> 0); + 440a: 2a 2f mov r18, r26 + 440c: 24 79 andi r18, 0x94 ; 148 + 440e: 92 27 eor r25, r18 + Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); + 4410: 2f 2f mov r18, r31 + 4412: 23 77 andi r18, 0x73 ; 115 + 4414: 92 27 eor r25, r18 + Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); + 4416: 2e 2f mov r18, r30 + 4418: 2a 73 andi r18, 0x3A ; 58 + 441a: 92 27 eor r25, r18 + + Feedback ^= Feedback >> 4; + 441c: 39 2f mov r19, r25 + 441e: 32 95 swap r19 + 4420: 3f 70 andi r19, 0x0F ; 15 + 4422: 39 27 eor r19, r25 + Feedback ^= Feedback >> 2; + 4424: 23 2f mov r18, r19 + 4426: 26 95 lsr r18 + 4428: 26 95 lsr r18 + 442a: 23 27 eor r18, r19 + Feedback ^= Feedback >> 1; + 442c: 92 2f mov r25, r18 + 442e: 96 95 lsr r25 + * - the new odd state becomes the old even state right-shifted by 1. + * For shifting the even state, we convert it into a 32 bit int first */ + uint32_t Temp = 0; + Temp |= ((uint32_t) StateEven[0] << 0); + Temp |= ((uint32_t) StateEven[1] << 8); + Temp |= ((uint32_t) StateEven[2] << 16); + 4430: 50 e0 ldi r21, 0x00 ; 0 + 4432: 60 e0 ldi r22, 0x00 ; 0 + 4434: 70 e0 ldi r23, 0x00 ; 0 + 4436: ba 01 movw r22, r20 + 4438: 55 27 eor r21, r21 + 443a: 44 27 eor r20, r20 + * - the new even state becomes the old odd state + * - the new odd state becomes the old even state right-shifted by 1. + * For shifting the even state, we convert it into a 32 bit int first */ + uint32_t Temp = 0; + Temp |= ((uint32_t) StateEven[0] << 0); + Temp |= ((uint32_t) StateEven[1] << 8); + 443c: 5c 2b or r21, r28 + Temp |= ((uint32_t) StateEven[2] << 16); + 443e: 4b 2b or r20, r27 + + /* Proceed LFSR. Try to force compiler not to shift the unneded upper bits. */ + Temp = (Temp >> 1) & 0x00FFFFFF; + 4440: 76 95 lsr r23 + 4442: 67 95 ror r22 + 4444: 57 95 ror r21 + 4446: 47 95 ror r20 + Feedback ^= StateOdd[1] & (uint8_t) (LFSR_MASK_ODD >> 8); + Feedback ^= StateOdd[2] & (uint8_t) (LFSR_MASK_ODD >> 16); + + Feedback ^= Feedback >> 4; + Feedback ^= Feedback >> 2; + Feedback ^= Feedback >> 1; + 4448: 92 27 eor r25, r18 + + /* Proceed LFSR. Try to force compiler not to shift the unneded upper bits. */ + Temp = (Temp >> 1) & 0x00FFFFFF; + + /* Calculate MSBit of even state as input bit to LFSR */ + if ( (Feedback & 0x01) ^ In ) { + 444a: 91 70 andi r25, 0x01 ; 1 + 444c: 98 13 cpse r25, r24 + Temp |= (uint32_t) 1 << (8 * LFSR_SIZE/2 - 1); + 444e: 60 68 ori r22, 0x80 ; 128 + } + + /* Convert even state back into byte array and swap odd/even state + * as explained above. */ + StateEven[0] = StateOdd[0]; + 4450: a0 93 df 28 sts 0x28DF, r26 + StateEven[1] = StateOdd[1]; + 4454: f0 93 e0 28 sts 0x28E0, r31 + StateEven[2] = StateOdd[2]; + 4458: e0 93 e1 28 sts 0x28E1, r30 + + StateOdd[0] = (uint8_t) (Temp >> 0); + 445c: 40 93 dc 28 sts 0x28DC, r20 + StateOdd[1] = (uint8_t) (Temp >> 8); + 4460: 50 93 dd 28 sts 0x28DD, r21 + StateOdd[2] = (uint8_t) (Temp >> 16); + 4464: 60 93 de 28 sts 0x28DE, r22 +} + 4468: cf 91 pop r28 + 446a: 08 95 ret + +0000446c : + +uint8_t Crypto1FilterOutput(void) { + 446c: cf 93 push r28 + 446e: df 93 push r29 + * 5 bits that are used to lookup the output bit. + */ + uint8_t Sum = 0; + + Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; + Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; + 4470: c0 91 dd 28 lds r28, 0x28DD + Sum |= TableAB[2][(StateOdd[1] >> 4) & 0x0F]; + Sum |= TableAB[3][(StateOdd[2] >> 0) & 0x0F]; + 4474: 90 91 de 28 lds r25, 0x28DE + 4478: a9 2f mov r26, r25 + 447a: af 70 andi r26, 0x0F ; 15 + 447c: b0 e0 ldi r27, 0x00 ; 0 + 447e: a0 5e subi r26, 0xE0 ; 224 + 4480: bf 4d sbci r27, 0xDF ; 223 + * 5 bits that are used to lookup the output bit. + */ + uint8_t Sum = 0; + + Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; + Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; + 4482: ec 2f mov r30, r28 + 4484: ef 70 andi r30, 0x0F ; 15 + 4486: f0 e0 ldi r31, 0x00 ; 0 + 4488: e0 5e subi r30, 0xE0 ; 224 + 448a: ff 4d sbci r31, 0xDF ; 223 + 448c: d0 96 adiw r26, 0x30 ; 48 + 448e: 8c 91 ld r24, X + 4490: 20 89 ldd r18, Z+16 ; 0x10 + 4492: 82 2b or r24, r18 + * can simply be ORed together to produce the resulting + * 5 bits that are used to lookup the output bit. + */ + uint8_t Sum = 0; + + Sum |= TableAB[0][(StateOdd[0] >> 4) & 0x0F]; + 4494: e0 91 dc 28 lds r30, 0x28DC + 4498: e2 95 swap r30 + 449a: ef 70 andi r30, 0x0F ; 15 + 449c: f0 e0 ldi r31, 0x00 ; 0 + 449e: e0 5e subi r30, 0xE0 ; 224 + 44a0: ff 4d sbci r31, 0xDF ; 223 + Sum |= TableAB[1][(StateOdd[1] >> 0) & 0x0F]; + Sum |= TableAB[2][(StateOdd[1] >> 4) & 0x0F]; + 44a2: 20 81 ld r18, Z + 44a4: 82 2b or r24, r18 + 44a6: c2 95 swap r28 + 44a8: cf 70 andi r28, 0x0F ; 15 + 44aa: d0 e0 ldi r29, 0x00 ; 0 + 44ac: c0 5e subi r28, 0xE0 ; 224 + 44ae: df 4d sbci r29, 0xDF ; 223 + Sum |= TableAB[3][(StateOdd[2] >> 0) & 0x0F]; + 44b0: 28 a1 ldd r18, Y+32 ; 0x20 + 44b2: 82 2b or r24, r18 + Sum |= TableAB[4][(StateOdd[2] >> 4) & 0x0F]; + 44b4: 92 95 swap r25 + 44b6: 9f 70 andi r25, 0x0F ; 15 + 44b8: a9 2f mov r26, r25 + 44ba: b0 e0 ldi r27, 0x00 ; 0 + 44bc: a0 5a subi r26, 0xA0 ; 160 + 44be: bf 4d sbci r27, 0xDF ; 223 + 44c0: 9c 91 ld r25, X + 44c2: 89 2b or r24, r25 + + return TableC[Sum]; + 44c4: e8 2f mov r30, r24 + 44c6: f0 e0 ldi r31, 0x00 ; 0 + 44c8: e0 59 subi r30, 0x90 ; 144 + 44ca: ff 4d sbci r31, 0xDF ; 223 +} + 44cc: 80 81 ld r24, Z + 44ce: df 91 pop r29 + 44d0: cf 91 pop r28 + 44d2: 08 95 ret + +000044d4 : + +void Crypto1Setup(uint8_t Key[6], uint8_t Uid[4], uint8_t CardNonce[4]) +{ + 44d4: cf 92 push r12 + 44d6: df 92 push r13 + 44d8: ef 92 push r14 + 44da: ff 92 push r15 + 44dc: 0f 93 push r16 + 44de: 1f 93 push r17 + 44e0: cf 93 push r28 + 44e2: df 93 push r29 + 44e4: fc 01 movw r30, r24 + 44e6: db 01 movw r26, r22 + 44e8: ea 01 movw r28, r20 + * The inner loop generates 8 even and 8 odd bits from 16 key bits and + * the outer loop stores them. */ + for (i=0; i<(LFSR_SIZE/2); i++) { + uint8_t EvenByte = 0; + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + 44ea: 91 81 ldd r25, Z+1 ; 0x01 + 44ec: 80 e0 ldi r24, 0x00 ; 0 + 44ee: 20 81 ld r18, Z + 44f0: 82 2b or r24, r18 + 44f2: 80 fd sbrc r24, 0 + 44f4: 8d c1 rjmp .+794 ; 0x4810 + 44f6: 30 e0 ldi r19, 0x00 ; 0 + 44f8: 81 fd sbrc r24, 1 + 44fa: 88 c1 rjmp .+784 ; 0x480c + 44fc: 20 e0 ldi r18, 0x00 ; 0 + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + } + + KeyWord >>= 2; + 44fe: 96 95 lsr r25 + 4500: 87 95 ror r24 + 4502: 96 95 lsr r25 + 4504: 87 95 ror r24 + for (j=0; j<8; j++) { + EvenByte >>= 1; + OddByte >>= 1; + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4506: 43 2f mov r20, r19 + 4508: 40 68 ori r20, 0x80 ; 128 + 450a: 80 fd sbrc r24, 0 + 450c: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 450e: 42 2f mov r20, r18 + 4510: 40 68 ori r20, 0x80 ; 128 + 4512: 81 fd sbrc r24, 1 + 4514: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4516: 96 95 lsr r25 + 4518: 87 95 ror r24 + 451a: 96 95 lsr r25 + 451c: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 451e: 36 95 lsr r19 + OddByte >>= 1; + 4520: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4522: 43 2f mov r20, r19 + 4524: 40 68 ori r20, 0x80 ; 128 + 4526: 80 fd sbrc r24, 0 + 4528: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 452a: 42 2f mov r20, r18 + 452c: 40 68 ori r20, 0x80 ; 128 + 452e: 81 fd sbrc r24, 1 + 4530: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4532: 96 95 lsr r25 + 4534: 87 95 ror r24 + 4536: 96 95 lsr r25 + 4538: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 453a: 36 95 lsr r19 + OddByte >>= 1; + 453c: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 453e: 43 2f mov r20, r19 + 4540: 40 68 ori r20, 0x80 ; 128 + 4542: 80 fd sbrc r24, 0 + 4544: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4546: 42 2f mov r20, r18 + 4548: 40 68 ori r20, 0x80 ; 128 + 454a: 81 fd sbrc r24, 1 + 454c: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 454e: 96 95 lsr r25 + 4550: 87 95 ror r24 + 4552: 96 95 lsr r25 + 4554: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4556: 36 95 lsr r19 + OddByte >>= 1; + 4558: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 455a: 43 2f mov r20, r19 + 455c: 40 68 ori r20, 0x80 ; 128 + 455e: 80 fd sbrc r24, 0 + 4560: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4562: 42 2f mov r20, r18 + 4564: 40 68 ori r20, 0x80 ; 128 + 4566: 81 fd sbrc r24, 1 + 4568: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 456a: 96 95 lsr r25 + 456c: 87 95 ror r24 + 456e: 96 95 lsr r25 + 4570: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4572: 36 95 lsr r19 + OddByte >>= 1; + 4574: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4576: 43 2f mov r20, r19 + 4578: 40 68 ori r20, 0x80 ; 128 + 457a: 80 fd sbrc r24, 0 + 457c: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 457e: 42 2f mov r20, r18 + 4580: 40 68 ori r20, 0x80 ; 128 + 4582: 81 fd sbrc r24, 1 + 4584: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4586: 96 95 lsr r25 + 4588: 87 95 ror r24 + 458a: 96 95 lsr r25 + 458c: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 458e: 36 95 lsr r19 + OddByte >>= 1; + 4590: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4592: 43 2f mov r20, r19 + 4594: 40 68 ori r20, 0x80 ; 128 + 4596: 80 fd sbrc r24, 0 + 4598: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 459a: 42 2f mov r20, r18 + 459c: 40 68 ori r20, 0x80 ; 128 + 459e: 81 fd sbrc r24, 1 + 45a0: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 45a2: 96 95 lsr r25 + 45a4: 87 95 ror r24 + 45a6: 96 95 lsr r25 + 45a8: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 45aa: 36 95 lsr r19 + OddByte >>= 1; + 45ac: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 45ae: 53 2f mov r21, r19 + 45b0: 50 68 ori r21, 0x80 ; 128 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 45b2: 42 2f mov r20, r18 + 45b4: 40 68 ori r20, 0x80 ; 128 + } + + KeyWord >>= 2; + } + + StateEven[i] = EvenByte; + 45b6: 80 fd sbrc r24, 0 + 45b8: 35 2f mov r19, r21 + 45ba: 30 93 df 28 sts 0x28DF, r19 + StateOdd[i] = OddByte; + 45be: 81 fd sbrc r24, 1 + 45c0: 24 2f mov r18, r20 + 45c2: 20 93 dc 28 sts 0x28DC, r18 + * The inner loop generates 8 even and 8 odd bits from 16 key bits and + * the outer loop stores them. */ + for (i=0; i<(LFSR_SIZE/2); i++) { + uint8_t EvenByte = 0; + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + 45c6: 93 81 ldd r25, Z+3 ; 0x03 + 45c8: 80 e0 ldi r24, 0x00 ; 0 + 45ca: 22 81 ldd r18, Z+2 ; 0x02 + 45cc: 82 2b or r24, r18 + 45ce: 80 fd sbrc r24, 0 + 45d0: 1b c1 rjmp .+566 ; 0x4808 + 45d2: 30 e0 ldi r19, 0x00 ; 0 + 45d4: 81 fd sbrc r24, 1 + 45d6: 16 c1 rjmp .+556 ; 0x4804 + 45d8: 20 e0 ldi r18, 0x00 ; 0 + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + } + + KeyWord >>= 2; + 45da: 96 95 lsr r25 + 45dc: 87 95 ror r24 + 45de: 96 95 lsr r25 + 45e0: 87 95 ror r24 + for (j=0; j<8; j++) { + EvenByte >>= 1; + OddByte >>= 1; + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 45e2: 43 2f mov r20, r19 + 45e4: 40 68 ori r20, 0x80 ; 128 + 45e6: 80 fd sbrc r24, 0 + 45e8: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 45ea: 42 2f mov r20, r18 + 45ec: 40 68 ori r20, 0x80 ; 128 + 45ee: 81 fd sbrc r24, 1 + 45f0: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 45f2: 96 95 lsr r25 + 45f4: 87 95 ror r24 + 45f6: 96 95 lsr r25 + 45f8: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 45fa: 36 95 lsr r19 + OddByte >>= 1; + 45fc: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 45fe: 43 2f mov r20, r19 + 4600: 40 68 ori r20, 0x80 ; 128 + 4602: 80 fd sbrc r24, 0 + 4604: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4606: 42 2f mov r20, r18 + 4608: 40 68 ori r20, 0x80 ; 128 + 460a: 81 fd sbrc r24, 1 + 460c: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 460e: 96 95 lsr r25 + 4610: 87 95 ror r24 + 4612: 96 95 lsr r25 + 4614: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4616: 36 95 lsr r19 + OddByte >>= 1; + 4618: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 461a: 43 2f mov r20, r19 + 461c: 40 68 ori r20, 0x80 ; 128 + 461e: 80 fd sbrc r24, 0 + 4620: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4622: 42 2f mov r20, r18 + 4624: 40 68 ori r20, 0x80 ; 128 + 4626: 81 fd sbrc r24, 1 + 4628: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 462a: 96 95 lsr r25 + 462c: 87 95 ror r24 + 462e: 96 95 lsr r25 + 4630: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4632: 36 95 lsr r19 + OddByte >>= 1; + 4634: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4636: 43 2f mov r20, r19 + 4638: 40 68 ori r20, 0x80 ; 128 + 463a: 80 fd sbrc r24, 0 + 463c: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 463e: 42 2f mov r20, r18 + 4640: 40 68 ori r20, 0x80 ; 128 + 4642: 81 fd sbrc r24, 1 + 4644: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4646: 96 95 lsr r25 + 4648: 87 95 ror r24 + 464a: 96 95 lsr r25 + 464c: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 464e: 36 95 lsr r19 + OddByte >>= 1; + 4650: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4652: 43 2f mov r20, r19 + 4654: 40 68 ori r20, 0x80 ; 128 + 4656: 80 fd sbrc r24, 0 + 4658: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 465a: 42 2f mov r20, r18 + 465c: 40 68 ori r20, 0x80 ; 128 + 465e: 81 fd sbrc r24, 1 + 4660: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4662: 96 95 lsr r25 + 4664: 87 95 ror r24 + 4666: 96 95 lsr r25 + 4668: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 466a: 36 95 lsr r19 + OddByte >>= 1; + 466c: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 466e: 43 2f mov r20, r19 + 4670: 40 68 ori r20, 0x80 ; 128 + 4672: 80 fd sbrc r24, 0 + 4674: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4676: 42 2f mov r20, r18 + 4678: 40 68 ori r20, 0x80 ; 128 + 467a: 81 fd sbrc r24, 1 + 467c: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 467e: 96 95 lsr r25 + 4680: 87 95 ror r24 + 4682: 96 95 lsr r25 + 4684: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4686: 36 95 lsr r19 + OddByte >>= 1; + 4688: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 468a: 53 2f mov r21, r19 + 468c: 50 68 ori r21, 0x80 ; 128 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 468e: 42 2f mov r20, r18 + 4690: 40 68 ori r20, 0x80 ; 128 + } + + KeyWord >>= 2; + } + + StateEven[i] = EvenByte; + 4692: 80 fd sbrc r24, 0 + 4694: 35 2f mov r19, r21 + 4696: 30 93 e0 28 sts 0x28E0, r19 + StateOdd[i] = OddByte; + 469a: 81 fd sbrc r24, 1 + 469c: 24 2f mov r18, r20 + 469e: 20 93 dd 28 sts 0x28DD, r18 + * The inner loop generates 8 even and 8 odd bits from 16 key bits and + * the outer loop stores them. */ + for (i=0; i<(LFSR_SIZE/2); i++) { + uint8_t EvenByte = 0; + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + 46a2: 95 81 ldd r25, Z+5 ; 0x05 + 46a4: 80 e0 ldi r24, 0x00 ; 0 + 46a6: 24 81 ldd r18, Z+4 ; 0x04 + 46a8: 82 2b or r24, r18 + 46aa: 80 fd sbrc r24, 0 + 46ac: a9 c0 rjmp .+338 ; 0x4800 + 46ae: 30 e0 ldi r19, 0x00 ; 0 + 46b0: 81 fd sbrc r24, 1 + 46b2: a4 c0 rjmp .+328 ; 0x47fc + 46b4: 20 e0 ldi r18, 0x00 ; 0 + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + } + + KeyWord >>= 2; + 46b6: 96 95 lsr r25 + 46b8: 87 95 ror r24 + 46ba: 96 95 lsr r25 + 46bc: 87 95 ror r24 + for (j=0; j<8; j++) { + EvenByte >>= 1; + OddByte >>= 1; + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 46be: 43 2f mov r20, r19 + 46c0: 40 68 ori r20, 0x80 ; 128 + 46c2: 80 fd sbrc r24, 0 + 46c4: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 46c6: 42 2f mov r20, r18 + 46c8: 40 68 ori r20, 0x80 ; 128 + 46ca: 81 fd sbrc r24, 1 + 46cc: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 46ce: 96 95 lsr r25 + 46d0: 87 95 ror r24 + 46d2: 96 95 lsr r25 + 46d4: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 46d6: 36 95 lsr r19 + OddByte >>= 1; + 46d8: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 46da: 43 2f mov r20, r19 + 46dc: 40 68 ori r20, 0x80 ; 128 + 46de: 80 fd sbrc r24, 0 + 46e0: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 46e2: 42 2f mov r20, r18 + 46e4: 40 68 ori r20, 0x80 ; 128 + 46e6: 81 fd sbrc r24, 1 + 46e8: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 46ea: 96 95 lsr r25 + 46ec: 87 95 ror r24 + 46ee: 96 95 lsr r25 + 46f0: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 46f2: 36 95 lsr r19 + OddByte >>= 1; + 46f4: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 46f6: 43 2f mov r20, r19 + 46f8: 40 68 ori r20, 0x80 ; 128 + 46fa: 80 fd sbrc r24, 0 + 46fc: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 46fe: 42 2f mov r20, r18 + 4700: 40 68 ori r20, 0x80 ; 128 + 4702: 81 fd sbrc r24, 1 + 4704: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4706: 96 95 lsr r25 + 4708: 87 95 ror r24 + 470a: 96 95 lsr r25 + 470c: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 470e: 36 95 lsr r19 + OddByte >>= 1; + 4710: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4712: 43 2f mov r20, r19 + 4714: 40 68 ori r20, 0x80 ; 128 + 4716: 80 fd sbrc r24, 0 + 4718: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 471a: 42 2f mov r20, r18 + 471c: 40 68 ori r20, 0x80 ; 128 + 471e: 81 fd sbrc r24, 1 + 4720: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 4722: 96 95 lsr r25 + 4724: 87 95 ror r24 + 4726: 96 95 lsr r25 + 4728: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 472a: 36 95 lsr r19 + OddByte >>= 1; + 472c: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 472e: 43 2f mov r20, r19 + 4730: 40 68 ori r20, 0x80 ; 128 + 4732: 80 fd sbrc r24, 0 + 4734: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4736: 42 2f mov r20, r18 + 4738: 40 68 ori r20, 0x80 ; 128 + 473a: 81 fd sbrc r24, 1 + 473c: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 473e: 96 95 lsr r25 + 4740: 87 95 ror r24 + 4742: 96 95 lsr r25 + 4744: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4746: 36 95 lsr r19 + OddByte >>= 1; + 4748: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 474a: 43 2f mov r20, r19 + 474c: 40 68 ori r20, 0x80 ; 128 + 474e: 80 fd sbrc r24, 0 + 4750: 34 2f mov r19, r20 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 4752: 42 2f mov r20, r18 + 4754: 40 68 ori r20, 0x80 ; 128 + 4756: 81 fd sbrc r24, 1 + 4758: 24 2f mov r18, r20 + } + + KeyWord >>= 2; + 475a: 96 95 lsr r25 + 475c: 87 95 ror r24 + 475e: 96 95 lsr r25 + 4760: 87 95 ror r24 + uint8_t OddByte = 0; + uint16_t KeyWord = ((uint16_t) Key[2*i+1] << 8) | Key[2*i+0]; + uint8_t j; + + for (j=0; j<8; j++) { + EvenByte >>= 1; + 4762: 36 95 lsr r19 + OddByte >>= 1; + 4764: 26 95 lsr r18 + + if (KeyWord & (1<<0)) { + EvenByte |= 0x80; + 4766: 53 2f mov r21, r19 + 4768: 50 68 ori r21, 0x80 ; 128 + } + + if (KeyWord & (1<<1)) { + OddByte |= 0x80; + 476a: 42 2f mov r20, r18 + 476c: 40 68 ori r20, 0x80 ; 128 + } + + KeyWord >>= 2; + } + + StateEven[i] = EvenByte; + 476e: 80 fd sbrc r24, 0 + 4770: 35 2f mov r19, r21 + 4772: 30 93 e1 28 sts 0x28E1, r19 + StateOdd[i] = OddByte; + 4776: 81 fd sbrc r24, 1 + 4778: 24 2f mov r18, r20 + 477a: 20 93 de 28 sts 0x28DE, r18 + /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the + * Crypto1 LFSR.*/ + uint32_t Temp = 0; + + Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; + Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; + 477e: 89 81 ldd r24, Y+1 ; 0x01 + 4780: 11 96 adiw r26, 0x01 ; 1 + 4782: 9c 91 ld r25, X + 4784: 11 97 sbiw r26, 0x01 ; 1 + 4786: 89 27 eor r24, r25 + Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; + 4788: ca 80 ldd r12, Y+2 ; 0x02 + 478a: 12 96 adiw r26, 0x02 ; 2 + 478c: 9c 91 ld r25, X + 478e: 12 97 sbiw r26, 0x02 ; 2 + 4790: c9 26 eor r12, r25 + 4792: d1 2c mov r13, r1 + 4794: e1 2c mov r14, r1 + 4796: f1 2c mov r15, r1 + 4798: 76 01 movw r14, r12 + 479a: dd 24 eor r13, r13 + 479c: cc 24 eor r12, r12 + /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the + * Crypto1 LFSR.*/ + uint32_t Temp = 0; + + Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; + Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; + 479e: d8 2a or r13, r24 + + /* Use Uid XOR CardNonce as feed-in and do 32 clocks on the + * Crypto1 LFSR.*/ + uint32_t Temp = 0; + + Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; + 47a0: 88 81 ld r24, Y + 47a2: 9c 91 ld r25, X + 47a4: 89 27 eor r24, r25 + Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; + Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; + 47a6: c8 2a or r12, r24 + Temp |= (uint32_t) (Uid[3] ^ CardNonce[3]) << 24; + 47a8: 8b 81 ldd r24, Y+3 ; 0x03 + 47aa: 13 96 adiw r26, 0x03 ; 3 + 47ac: 9c 91 ld r25, X + 47ae: 89 27 eor r24, r25 + 47b0: f8 2a or r15, r24 + 47b2: 10 e2 ldi r17, 0x20 ; 32 + + for (i=0; i<32; i++) { + uint8_t Out = Crypto1FilterOutput(); + 47b4: 5b de rcall .-842 ; 0x446c + 47b6: 08 2f mov r16, r24 + + Crypto1LFSR(Temp & 0x01); + 47b8: 8c 2d mov r24, r12 + 47ba: 81 70 andi r24, 0x01 ; 1 + 47bc: 11 de rcall .-990 ; 0x43e0 + Temp >>= 1; + 47be: f6 94 lsr r15 + 47c0: e7 94 ror r14 + 47c2: d7 94 ror r13 + 47c4: c7 94 ror r12 + + /* Store the keystream for later use */ + if (Out) { + 47c6: 00 23 and r16, r16 + 47c8: 11 f0 breq .+4 ; 0x47ce + Temp |= (uint32_t) 1 << 31; + 47ca: 68 94 set + 47cc: f7 f8 bld r15, 7 + 47ce: 11 50 subi r17, 0x01 ; 1 + Temp |= (uint32_t) (Uid[0] ^ CardNonce[0]) << 0; + Temp |= (uint32_t) (Uid[1] ^ CardNonce[1]) << 8; + Temp |= (uint32_t) (Uid[2] ^ CardNonce[2]) << 16; + Temp |= (uint32_t) (Uid[3] ^ CardNonce[3]) << 24; + + for (i=0; i<32; i++) { + 47d0: 89 f7 brne .-30 ; 0x47b4 + } + + /* Crypto1 state register is now set up to be used for authentication. + * In case of nested authentication, we need to use the produced keystream + * to encrypt the CardNonce. For this case we do the encryption in-place. */ + CardNonce[0] ^= (uint8_t) (Temp >> 0); + 47d2: 88 81 ld r24, Y + 47d4: 8c 25 eor r24, r12 + 47d6: 88 83 st Y, r24 + CardNonce[1] ^= (uint8_t) (Temp >> 8); + 47d8: 89 81 ldd r24, Y+1 ; 0x01 + 47da: 8d 25 eor r24, r13 + 47dc: 89 83 std Y+1, r24 ; 0x01 + CardNonce[2] ^= (uint8_t) (Temp >> 16); + 47de: 8a 81 ldd r24, Y+2 ; 0x02 + 47e0: 8e 25 eor r24, r14 + 47e2: 8a 83 std Y+2, r24 ; 0x02 + CardNonce[3] ^= (uint8_t) (Temp >> 24); + 47e4: 8b 81 ldd r24, Y+3 ; 0x03 + 47e6: 8f 25 eor r24, r15 + 47e8: 8b 83 std Y+3, r24 ; 0x03 +} + 47ea: df 91 pop r29 + 47ec: cf 91 pop r28 + 47ee: 1f 91 pop r17 + 47f0: 0f 91 pop r16 + 47f2: ff 90 pop r15 + 47f4: ef 90 pop r14 + 47f6: df 90 pop r13 + 47f8: cf 90 pop r12 + 47fa: 08 95 ret + 47fc: 20 e4 ldi r18, 0x40 ; 64 + 47fe: 5b cf rjmp .-330 ; 0x46b6 + 4800: 30 e4 ldi r19, 0x40 ; 64 + 4802: 56 cf rjmp .-340 ; 0x46b0 + 4804: 20 e4 ldi r18, 0x40 ; 64 + 4806: e9 ce rjmp .-558 ; 0x45da + 4808: 30 e4 ldi r19, 0x40 ; 64 + 480a: e4 ce rjmp .-568 ; 0x45d4 + 480c: 20 e4 ldi r18, 0x40 ; 64 + 480e: 77 ce rjmp .-786 ; 0x44fe + 4810: 30 e4 ldi r19, 0x40 ; 64 + 4812: 72 ce rjmp .-796 ; 0x44f8 + +00004814 : + +void Crypto1Auth(uint8_t EncryptedReaderNonce[4]) +{ + 4814: cf 92 push r12 + 4816: df 92 push r13 + 4818: ef 92 push r14 + 481a: ff 92 push r15 + 481c: cf 93 push r28 + 481e: fc 01 movw r30, r24 + uint32_t Temp = 0; + + /* For ease of processing, we convert the encrypted reader nonce + * into a 32 bit integer */ + Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; + Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; + 4820: 81 81 ldd r24, Z+1 ; 0x01 + Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; + 4822: c2 80 ldd r12, Z+2 ; 0x02 + 4824: d1 2c mov r13, r1 + 4826: e1 2c mov r14, r1 + 4828: f1 2c mov r15, r1 + 482a: 76 01 movw r14, r12 + 482c: dd 24 eor r13, r13 + 482e: cc 24 eor r12, r12 + uint32_t Temp = 0; + + /* For ease of processing, we convert the encrypted reader nonce + * into a 32 bit integer */ + Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; + Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; + 4830: d8 2a or r13, r24 +{ + uint32_t Temp = 0; + + /* For ease of processing, we convert the encrypted reader nonce + * into a 32 bit integer */ + Temp |= (uint32_t) EncryptedReaderNonce[0] << 0; + 4832: 80 81 ld r24, Z + Temp |= (uint32_t) EncryptedReaderNonce[1] << 8; + Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; + 4834: c8 2a or r12, r24 + Temp |= (uint32_t) EncryptedReaderNonce[3] << 24; + 4836: 83 81 ldd r24, Z+3 ; 0x03 + 4838: f8 2a or r15, r24 + 483a: c0 e2 ldi r28, 0x20 ; 32 + uint8_t i; + + for (i=0; i<32; i++) { + /* Decrypt one output bit of the given encrypted nonce using the + * filter output as keystream. */ + uint8_t Out = Crypto1FilterOutput(); + 483c: 17 de rcall .-978 ; 0x446c + uint8_t Bit = Out ^ (Temp & 0x01); + 483e: b7 01 movw r22, r14 + 4840: a6 01 movw r20, r12 + 4842: 41 70 andi r20, 0x01 ; 1 + 4844: 55 27 eor r21, r21 + 4846: 66 27 eor r22, r22 + 4848: 77 27 eor r23, r23 + + /* Feed back the bit to load the LFSR with the (decrypted) nonce */ + Crypto1LFSR(Bit); + 484a: 84 27 eor r24, r20 + 484c: c9 dd rcall .-1134 ; 0x43e0 + Temp >>= 1; + 484e: f6 94 lsr r15 + 4850: e7 94 ror r14 + 4852: d7 94 ror r13 + 4854: c7 94 ror r12 + 4856: c1 50 subi r28, 0x01 ; 1 + Temp |= (uint32_t) EncryptedReaderNonce[2] << 16; + Temp |= (uint32_t) EncryptedReaderNonce[3] << 24; + + uint8_t i; + + for (i=0; i<32; i++) { + 4858: 89 f7 brne .-30 ; 0x483c + + /* Feed back the bit to load the LFSR with the (decrypted) nonce */ + Crypto1LFSR(Bit); + Temp >>= 1; + } +} + 485a: cf 91 pop r28 + 485c: ff 90 pop r15 + 485e: ef 90 pop r14 + 4860: df 90 pop r13 + 4862: cf 90 pop r12 + 4864: 08 95 ret + +00004866 : + +uint8_t Crypto1Byte(void) +{ + 4866: cf 93 push r28 + 4868: df 93 push r29 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 486a: 00 de rcall .-1024 ; 0x446c + 486c: c8 2f mov r28, r24 + Crypto1LFSR(0); + 486e: 80 e0 ldi r24, 0x00 ; 0 + 4870: b7 dd rcall .-1170 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + + if (Out) { + 4872: cc 23 and r28, r28 + 4874: 09 f4 brne .+2 ; 0x4878 + 4876: 36 c0 rjmp .+108 ; 0x48e4 + KeyStream |= (1<<7); + 4878: c0 e8 ldi r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 487a: f8 dd rcall .-1040 ; 0x446c + 487c: d8 2f mov r29, r24 + Crypto1LFSR(0); + 487e: 80 e0 ldi r24, 0x00 ; 0 + 4880: af dd rcall .-1186 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 4882: c6 95 lsr r28 + + if (Out) { + 4884: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 4886: c0 68 ori r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 4888: f1 dd rcall .-1054 ; 0x446c + 488a: d8 2f mov r29, r24 + Crypto1LFSR(0); + 488c: 80 e0 ldi r24, 0x00 ; 0 + 488e: a8 dd rcall .-1200 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 4890: c6 95 lsr r28 + + if (Out) { + 4892: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 4894: c0 68 ori r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 4896: ea dd rcall .-1068 ; 0x446c + 4898: d8 2f mov r29, r24 + Crypto1LFSR(0); + 489a: 80 e0 ldi r24, 0x00 ; 0 + 489c: a1 dd rcall .-1214 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 489e: c6 95 lsr r28 + + if (Out) { + 48a0: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 48a2: c0 68 ori r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 48a4: e3 dd rcall .-1082 ; 0x446c + 48a6: d8 2f mov r29, r24 + Crypto1LFSR(0); + 48a8: 80 e0 ldi r24, 0x00 ; 0 + 48aa: 9a dd rcall .-1228 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 48ac: c6 95 lsr r28 + + if (Out) { + 48ae: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 48b0: c0 68 ori r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 48b2: dc dd rcall .-1096 ; 0x446c + 48b4: d8 2f mov r29, r24 + Crypto1LFSR(0); + 48b6: 80 e0 ldi r24, 0x00 ; 0 + 48b8: 93 dd rcall .-1242 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 48ba: c6 95 lsr r28 + + if (Out) { + 48bc: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 48be: c0 68 ori r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 48c0: d5 dd rcall .-1110 ; 0x446c + 48c2: d8 2f mov r29, r24 + Crypto1LFSR(0); + 48c4: 80 e0 ldi r24, 0x00 ; 0 + 48c6: 8c dd rcall .-1256 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 48c8: c6 95 lsr r28 + + if (Out) { + 48ca: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 48cc: c0 68 ori r28, 0x80 ; 128 + /* Generate 8 keystream-bits */ + for (i=0; i<8; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 48ce: ce dd rcall .-1124 ; 0x446c + 48d0: d8 2f mov r29, r24 + Crypto1LFSR(0); + 48d2: 80 e0 ldi r24, 0x00 ; 0 + 48d4: 85 dd rcall .-1270 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 48d6: 8c 2f mov r24, r28 + 48d8: 86 95 lsr r24 + + if (Out) { + 48da: d1 11 cpse r29, r1 + KeyStream |= (1<<7); + 48dc: 80 68 ori r24, 0x80 ; 128 + } + } + + return KeyStream; +} + 48de: df 91 pop r29 + 48e0: cf 91 pop r28 + 48e2: 08 95 ret + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + Crypto1LFSR(0); + + /* Store keystream bit */ + KeyStream >>= 1; + 48e4: c0 e0 ldi r28, 0x00 ; 0 + 48e6: c9 cf rjmp .-110 ; 0x487a + +000048e8 : + + return KeyStream; +} + +uint8_t Crypto1Nibble(void) +{ + 48e8: cf 93 push r28 + 48ea: df 93 push r29 + /* Generate 4 keystream-bits */ + for (i=0; i<4; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 48ec: bf dd rcall .-1154 ; 0x446c + 48ee: c8 2f mov r28, r24 + Crypto1LFSR(0); + 48f0: 80 e0 ldi r24, 0x00 ; 0 + 48f2: 76 dd rcall .-1300 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + + if (Out) { + 48f4: cc 23 and r28, r28 + 48f6: d1 f0 breq .+52 ; 0x492c + KeyStream |= (1<<3); + 48f8: c8 e0 ldi r28, 0x08 ; 8 + /* Generate 4 keystream-bits */ + for (i=0; i<4; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 48fa: b8 dd rcall .-1168 ; 0x446c + 48fc: d8 2f mov r29, r24 + Crypto1LFSR(0); + 48fe: 80 e0 ldi r24, 0x00 ; 0 + 4900: 6f dd rcall .-1314 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 4902: c6 95 lsr r28 + + if (Out) { + 4904: d1 11 cpse r29, r1 + KeyStream |= (1<<3); + 4906: c8 60 ori r28, 0x08 ; 8 + /* Generate 4 keystream-bits */ + for (i=0; i<4; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 4908: b1 dd rcall .-1182 ; 0x446c + 490a: d8 2f mov r29, r24 + Crypto1LFSR(0); + 490c: 80 e0 ldi r24, 0x00 ; 0 + 490e: 68 dd rcall .-1328 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 4910: c6 95 lsr r28 + + if (Out) { + 4912: d1 11 cpse r29, r1 + KeyStream |= (1<<3); + 4914: c8 60 ori r28, 0x08 ; 8 + /* Generate 4 keystream-bits */ + for (i=0; i<4; i++) { + + /* Calculate output of function-network and cycle LFSR with no + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + 4916: aa dd rcall .-1196 ; 0x446c + 4918: d8 2f mov r29, r24 + Crypto1LFSR(0); + 491a: 80 e0 ldi r24, 0x00 ; 0 + 491c: 61 dd rcall .-1342 ; 0x43e0 + + /* Store keystream bit */ + KeyStream >>= 1; + 491e: 8c 2f mov r24, r28 + 4920: 86 95 lsr r24 + + if (Out) { + 4922: d1 11 cpse r29, r1 + KeyStream |= (1<<3); + 4924: 88 60 ori r24, 0x08 ; 8 + } + } + + return KeyStream; +} + 4926: df 91 pop r29 + 4928: cf 91 pop r28 + 492a: 08 95 ret + * additional input, thus linearly! */ + uint8_t Out = Crypto1FilterOutput(); + Crypto1LFSR(0); + + /* Store keystream bit */ + KeyStream >>= 1; + 492c: c0 e0 ldi r28, 0x00 ; 0 + 492e: e5 cf rjmp .-54 ; 0x48fa + +00004930 : + + return KeyStream; +} + +void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) +{ + 4930: 6f 92 push r6 + 4932: 7f 92 push r7 + 4934: 8f 92 push r8 + 4936: 9f 92 push r9 + 4938: af 92 push r10 + 493a: bf 92 push r11 + 493c: cf 92 push r12 + 493e: df 92 push r13 + 4940: ef 92 push r14 + 4942: ff 92 push r15 + 4944: 0f 93 push r16 + 4946: 1f 93 push r17 + 4948: cf 93 push r28 + 494a: df 93 push r29 + 494c: 3c 01 movw r6, r24 + while(ClockCount--) { + 494e: cb 01 movw r24, r22 + 4950: 01 97 sbiw r24, 0x01 ; 1 + 4952: 67 2b or r22, r23 + 4954: c9 f1 breq .+114 ; 0x49c8 + 4956: f3 01 movw r30, r6 + 4958: a2 81 ldd r26, Z+2 ; 0x02 + 495a: c0 81 ld r28, Z + 495c: b1 81 ldd r27, Z+1 ; 0x01 + 495e: d3 81 ldd r29, Z+3 ; 0x03 + * XOR all tapped bits to a single feedback bit. */ + uint8_t Feedback = 0; + + Feedback ^= State[0] & (uint8_t) (PRNG_MASK >> 0); + Feedback ^= State[1] & (uint8_t) (PRNG_MASK >> 8); + Feedback ^= State[2] & (uint8_t) (PRNG_MASK >> 16); + 4960: 2a 2f mov r18, r26 + 4962: 2d 72 andi r18, 0x2D ; 45 + Feedback ^= State[3] & (uint8_t) (PRNG_MASK >> 24); + + Feedback ^= Feedback >> 4; + 4964: 32 2f mov r19, r18 + 4966: 32 95 swap r19 + 4968: 3f 70 andi r19, 0x0F ; 15 + 496a: 32 27 eor r19, r18 + Feedback ^= Feedback >> 2; + 496c: 23 2f mov r18, r19 + 496e: 26 95 lsr r18 + 4970: 26 95 lsr r18 + 4972: 23 27 eor r18, r19 + Feedback ^= Feedback >> 1; + 4974: 32 2f mov r19, r18 + 4976: 36 95 lsr r19 + uint32_t Temp = 0; + + Temp |= (uint32_t) State[0] << 0; + Temp |= (uint32_t) State[1] << 8; + Temp |= (uint32_t) State[2] << 16; + Temp |= (uint32_t) State[3] << 24; + 4978: 4d 2f mov r20, r29 + 497a: 50 e0 ldi r21, 0x00 ; 0 + 497c: 60 e0 ldi r22, 0x00 ; 0 + 497e: 70 e0 ldi r23, 0x00 ; 0 + 4980: 74 2f mov r23, r20 + 4982: 66 27 eor r22, r22 + 4984: 55 27 eor r21, r21 + 4986: 44 27 eor r20, r20 + + /* For ease of processing convert the state into a 32 bit integer first */ + uint32_t Temp = 0; + + Temp |= (uint32_t) State[0] << 0; + Temp |= (uint32_t) State[1] << 8; + 4988: 5b 2b or r21, r27 + Temp |= (uint32_t) State[2] << 16; + 498a: 4c 2b or r20, r28 + Temp |= (uint32_t) State[3] << 24; + 498c: 6a 2b or r22, r26 + + /* Cycle LFSR and feed back. */ + Temp >>= 1; + 498e: 76 95 lsr r23 + 4990: 67 95 ror r22 + 4992: 57 95 ror r21 + 4994: 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; + 4996: 32 27 eor r19, r18 + Temp |= (uint32_t) State[3] << 24; + + /* Cycle LFSR and feed back. */ + Temp >>= 1; + + if (Feedback & 0x01) { + 4998: 30 fd sbrc r19, 0 + Temp |= (uint32_t) 1 << (8 * PRNG_SIZE - 1); + 499a: 70 68 ori r23, 0x80 ; 128 + } + + /* Store back state */ + State[0] = (uint8_t) (Temp >> 0); + 499c: c4 2f mov r28, r20 + State[1] = (uint8_t) (Temp >> 8); + 499e: 85 2e mov r8, r21 + 49a0: 96 2e mov r9, r22 + 49a2: a7 2e mov r10, r23 + 49a4: bb 24 eor r11, r11 + 49a6: b8 2d mov r27, r8 + State[2] = (uint8_t) (Temp >> 16); + 49a8: 6b 01 movw r12, r22 + 49aa: ee 24 eor r14, r14 + 49ac: ff 24 eor r15, r15 + 49ae: ac 2d mov r26, r12 + State[3] = (uint8_t) (Temp >> 24); + 49b0: 07 2f mov r16, r23 + 49b2: 11 27 eor r17, r17 + 49b4: 22 27 eor r18, r18 + 49b6: 33 27 eor r19, r19 + 49b8: d0 2f mov r29, r16 + return KeyStream; +} + +void Crypto1PRNG(uint8_t State[4], uint16_t ClockCount) +{ + while(ClockCount--) { + 49ba: 01 97 sbiw r24, 0x01 ; 1 + 49bc: 88 f6 brcc .-94 ; 0x4960 + 49be: f3 01 movw r30, r6 + 49c0: 40 83 st Z, r20 + 49c2: 81 82 std Z+1, r8 ; 0x01 + 49c4: c2 82 std Z+2, r12 ; 0x02 + 49c6: 03 83 std Z+3, r16 ; 0x03 + State[2] = (uint8_t) (Temp >> 16); + State[3] = (uint8_t) (Temp >> 24); + } + + +} + 49c8: df 91 pop r29 + 49ca: cf 91 pop r28 + 49cc: 1f 91 pop r17 + 49ce: 0f 91 pop r16 + 49d0: ff 90 pop r15 + 49d2: ef 90 pop r14 + 49d4: df 90 pop r13 + 49d6: cf 90 pop r12 + 49d8: bf 90 pop r11 + 49da: af 90 pop r10 + 49dc: 9f 90 pop r9 + 49de: 8f 90 pop r8 + 49e0: 7f 90 pop r7 + 49e2: 6f 90 pop r6 + 49e4: 08 95 ret + +000049e6 : +#if !defined(NO_DEVICE_REMOTE_WAKEUP) +bool USB_Device_RemoteWakeupEnabled; +#endif + +void USB_Device_ProcessControlRequest(void) +{ + 49e6: 0f 93 push r16 + 49e8: 1f 93 push r17 + 49ea: cf 93 push r28 + 49ec: df 93 push r29 + 49ee: cd b7 in r28, 0x3d ; 61 + 49f0: de b7 in r29, 0x3e ; 62 + 49f2: ec 97 sbiw r28, 0x3c ; 60 + 49f4: cd bf out 0x3d, r28 ; 61 + 49f6: de bf out 0x3e, r29 ; 62 + USB_ControlRequest.wLength = Endpoint_Read_16_LE(); + #else + uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest; + + for (uint8_t RequestHeaderByte = 0; RequestHeaderByte < sizeof(USB_Request_Header_t); RequestHeaderByte++) + *(RequestHeader++) = Endpoint_Read_8(); + 49f8: 2b d3 rcall .+1622 ; 0x5050 + 49fa: 80 93 41 2b sts 0x2B41, r24 + 49fe: 28 d3 rcall .+1616 ; 0x5050 + 4a00: 80 93 42 2b sts 0x2B42, r24 + 4a04: 25 d3 rcall .+1610 ; 0x5050 + 4a06: 80 93 43 2b sts 0x2B43, r24 + 4a0a: 22 d3 rcall .+1604 ; 0x5050 + 4a0c: 80 93 44 2b sts 0x2B44, r24 + 4a10: 1f d3 rcall .+1598 ; 0x5050 + 4a12: 80 93 45 2b sts 0x2B45, r24 + 4a16: 1c d3 rcall .+1592 ; 0x5050 + 4a18: 80 93 46 2b sts 0x2B46, r24 + 4a1c: 19 d3 rcall .+1586 ; 0x5050 + 4a1e: 80 93 47 2b sts 0x2B47, r24 + 4a22: 16 d3 rcall .+1580 ; 0x5050 + 4a24: 80 93 48 2b sts 0x2B48, r24 + #endif + + EVENT_USB_Device_ControlRequest(); + 4a28: 0e 94 4b 11 call 0x2296 ; 0x2296 + + if (Endpoint_IsSETUPReceived()) + 4a2c: b0 d3 rcall .+1888 ; 0x518e + 4a2e: 88 23 and r24, r24 + 4a30: 89 f0 breq .+34 ; 0x4a54 + { + uint8_t bmRequestType = USB_ControlRequest.bmRequestType; + 4a32: 90 91 41 2b lds r25, 0x2B41 + + switch (USB_ControlRequest.bRequest) + 4a36: 80 91 42 2b lds r24, 0x2B42 + 4a3a: 85 30 cpi r24, 0x05 ; 5 + 4a3c: 09 f4 brne .+2 ; 0x4a40 + 4a3e: 52 c0 rjmp .+164 ; 0x4ae4 + 4a40: b0 f0 brcs .+44 ; 0x4a6e + 4a42: 88 30 cpi r24, 0x08 ; 8 + 4a44: 09 f4 brne .+2 ; 0x4a48 + 4a46: b3 c0 rjmp .+358 ; 0x4bae + 4a48: 89 30 cpi r24, 0x09 ; 9 + 4a4a: 09 f4 brne .+2 ; 0x4a4e + 4a4c: 98 c0 rjmp .+304 ; 0x4b7e + 4a4e: 86 30 cpi r24, 0x06 ; 6 + 4a50: 09 f4 brne .+2 ; 0x4a54 + 4a52: 5a c0 rjmp .+180 ; 0x4b08 + default: + break; + } + } + + if (Endpoint_IsSETUPReceived()) + 4a54: 9c d3 rcall .+1848 ; 0x518e + 4a56: 88 23 and r24, r24 + 4a58: 11 f0 breq .+4 ; 0x4a5e + { + Endpoint_ClearSETUP(); + 4a5a: 6d d3 rcall .+1754 ; 0x5136 + Endpoint_StallTransaction(); + 4a5c: 50 d3 rcall .+1696 ; 0x50fe + } +} + 4a5e: ec 96 adiw r28, 0x3c ; 60 + 4a60: cd bf out 0x3d, r28 ; 61 + 4a62: de bf out 0x3e, r29 ; 62 + 4a64: df 91 pop r29 + 4a66: cf 91 pop r28 + 4a68: 1f 91 pop r17 + 4a6a: 0f 91 pop r16 + 4a6c: 08 95 ret + + if (Endpoint_IsSETUPReceived()) + { + uint8_t bmRequestType = USB_ControlRequest.bmRequestType; + + switch (USB_ControlRequest.bRequest) + 4a6e: 81 30 cpi r24, 0x01 ; 1 + 4a70: 21 f0 breq .+8 ; 0x4a7a + 4a72: 08 f4 brcc .+2 ; 0x4a76 + 4a74: 68 c0 rjmp .+208 ; 0x4b46 + 4a76: 83 30 cpi r24, 0x03 ; 3 + 4a78: 69 f7 brne .-38 ; 0x4a54 + } + + break; + case REQ_ClearFeature: + case REQ_SetFeature: + if ((bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) || + 4a7a: 99 23 and r25, r25 + 4a7c: 09 f4 brne .+2 ; 0x4a80 + 4a7e: a1 c0 rjmp .+322 ; 0x4bc2 + 4a80: 92 30 cpi r25, 0x02 ; 2 + 4a82: 41 f7 brne .-48 ; 0x4a54 + + break; + #endif + #if !defined(CONTROL_ONLY_DEVICE) + case REQREC_ENDPOINT: + if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_EndpointHalt) + 4a84: 80 91 43 2b lds r24, 0x2B43 + 4a88: 81 11 cpse r24, r1 + 4a8a: 27 c0 rjmp .+78 ; 0x4ada + { + uint8_t EndpointIndex = ((uint8_t)USB_ControlRequest.wIndex & ENDPOINT_EPNUM_MASK); + 4a8c: 00 91 45 2b lds r16, 0x2B45 + 4a90: 10 91 46 2b lds r17, 0x2B46 + 4a94: 0f 70 andi r16, 0x0F ; 15 + 4a96: 11 27 eor r17, r17 + + if (EndpointIndex == ENDPOINT_CONTROLEP) + 4a98: 01 15 cp r16, r1 + 4a9a: 11 05 cpc r17, r1 + 4a9c: d9 f2 breq .-74 ; 0x4a54 + return; + + Endpoint_SelectEndpoint(EndpointIndex); + 4a9e: 80 2f mov r24, r16 + 4aa0: f5 d2 rcall .+1514 ; 0x508c + + if (Endpoint_IsEnabled()) + { + if (USB_ControlRequest.bRequest == REQ_SetFeature) + 4aa2: 80 91 42 2b lds r24, 0x2B42 + 4aa6: 83 30 cpi r24, 0x03 ; 3 + 4aa8: 09 f4 brne .+2 ; 0x4aac + 4aaa: e6 c0 rjmp .+460 ; 0x4c78 + * \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; + 4aac: e0 91 4b 2b lds r30, 0x2B4B + 4ab0: f0 91 4c 2b lds r31, 0x2B4C + 4ab4: 81 81 ldd r24, Z+1 ; 0x01 + 4ab6: 8b 7f andi r24, 0xFB ; 251 + 4ab8: 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; + 4aba: 84 e8 ldi r24, 0x84 ; 132 + 4abc: 80 9f mul r24, r16 + 4abe: f0 01 movw r30, r0 + 4ac0: 81 9f mul r24, r17 + 4ac2: f0 0d add r31, r0 + 4ac4: 11 24 eor r1, r1 + 4ac6: e1 57 subi r30, 0x71 ; 113 + 4ac8: f4 4d sbci r31, 0xD4 ; 212 + 4aca: 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; + 4acc: e0 91 4b 2b lds r30, 0x2B4B + 4ad0: f0 91 4c 2b lds r31, 0x2B4C + 4ad4: 80 81 ld r24, Z + 4ad6: 8e 7f andi r24, 0xFE ; 254 + 4ad8: 80 83 st Z, r24 + #endif + default: + return; + } + + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + 4ada: 80 e0 ldi r24, 0x00 ; 0 + 4adc: d7 d2 rcall .+1454 ; 0x508c + + Endpoint_ClearSETUP(); + 4ade: 2b d3 rcall .+1622 ; 0x5136 + + Endpoint_ClearStatusStage(); + 4ae0: 8f d4 rcall .+2334 ; 0x5400 + 4ae2: b8 cf rjmp .-144 ; 0x4a54 + USB_Device_ClearSetFeature(); + } + + break; + case REQ_SetAddress: + if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) + 4ae4: 91 11 cpse r25, r1 + 4ae6: b6 cf rjmp .-148 ; 0x4a54 + } +} + +static void USB_Device_SetAddress(void) +{ + uint8_t DeviceAddress = (USB_ControlRequest.wValue & 0x7F); + 4ae8: 10 91 43 2b lds r17, 0x2B43 + 4aec: 1f 77 andi r17, 0x7F ; 127 + + USB_Device_SetDeviceAddress(DeviceAddress); + + Endpoint_ClearSETUP(); + 4aee: 23 d3 rcall .+1606 ; 0x5136 + + Endpoint_ClearStatusStage(); + 4af0: 87 d4 rcall .+2318 ; 0x5400 + + while (!(Endpoint_IsINReady())); + 4af2: 7f d3 rcall .+1790 ; 0x51f2 + 4af4: 88 23 and r24, r24 + 4af6: e9 f3 breq .-6 ; 0x4af2 + } + + 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; + 4af8: 10 93 c3 04 sts 0x04C3, r17 + + USB_Device_EnableDeviceAddress(DeviceAddress); + + USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; + 4afc: 11 11 cpse r17, r1 + 4afe: 76 c0 rjmp .+236 ; 0x4bec + 4b00: 82 e0 ldi r24, 0x02 ; 2 + 4b02: 80 93 40 2b sts 0x2B40, r24 + 4b06: a6 cf rjmp .-180 ; 0x4a54 + if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) + USB_Device_SetAddress(); + + break; + case REQ_GetDescriptor: + if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || + 4b08: 90 58 subi r25, 0x80 ; 128 + 4b0a: 92 30 cpi r25, 0x02 ; 2 + 4b0c: 08 f0 brcs .+2 ; 0x4b10 + 4b0e: a2 cf rjmp .-188 ; 0x4a54 + !(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)) + 4b10: 80 91 43 2b lds r24, 0x2B43 + 4b14: 90 91 44 2b lds r25, 0x2B44 + 4b18: 8c 3d cpi r24, 0xDC ; 220 + 4b1a: 23 e0 ldi r18, 0x03 ; 3 + 4b1c: 92 07 cpc r25, r18 + 4b1e: 09 f4 brne .+2 ; 0x4b22 + 4b20: 67 c0 rjmp .+206 ; 0x4bf0 + USB_Device_GetInternalSerialDescriptor(); + return; + } + #endif + + if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, + 4b22: ae 01 movw r20, r28 + 4b24: 45 5c subi r20, 0xC5 ; 197 + 4b26: 5f 4f sbci r21, 0xFF ; 255 + 4b28: 60 91 45 2b lds r22, 0x2B45 + 4b2c: 0e 94 d1 04 call 0x9a2 ; 0x9a2 + 4b30: 8c 01 movw r16, r24 + 4b32: 00 97 sbiw r24, 0x00 ; 0 + 4b34: 09 f4 brne .+2 ; 0x4b38 + 4b36: 8e cf rjmp .-228 ; 0x4a54 + )) == NO_DESCRIPTOR) + { + return; + } + + Endpoint_ClearSETUP(); + 4b38: fe d2 rcall .+1532 ; 0x5136 + #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); + 4b3a: b8 01 movw r22, r16 + 4b3c: 8b ad ldd r24, Y+59 ; 0x3b + 4b3e: 9c ad ldd r25, Y+60 ; 0x3c + 4b40: c0 d1 rcall .+896 ; 0x4ec2 + Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize); + else + Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize); + #endif + + Endpoint_ClearOUT(); + 4b42: 77 d2 rcall .+1262 ; 0x5032 + 4b44: 87 cf rjmp .-242 ; 0x4a54 + uint8_t bmRequestType = USB_ControlRequest.bmRequestType; + + switch (USB_ControlRequest.bRequest) + { + case REQ_GetStatus: + if ((bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) || + 4b46: 90 38 cpi r25, 0x80 ; 128 + 4b48: 09 f4 brne .+2 ; 0x4b4c + 4b4a: 47 c0 rjmp .+142 ; 0x4bda + 4b4c: 92 38 cpi r25, 0x82 ; 130 + 4b4e: 09 f0 breq .+2 ; 0x4b52 + 4b50: 81 cf rjmp .-254 ; 0x4a54 + 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); + 4b52: 80 91 45 2b lds r24, 0x2B45 + 4b56: 8f 70 andi r24, 0x0F ; 15 + 4b58: 99 d2 rcall .+1330 ; 0x508c + * \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); + 4b5a: e0 91 4b 2b lds r30, 0x2B4B + 4b5e: f0 91 4c 2b lds r31, 0x2B4C + 4b62: 11 81 ldd r17, Z+1 ; 0x01 + 4b64: 12 fb bst r17, 2 + 4b66: 11 27 eor r17, r17 + 4b68: 10 f9 bld r17, 0 + + CurrentStatus = Endpoint_IsStalled(); + + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + 4b6a: 80 e0 ldi r24, 0x00 ; 0 + 4b6c: 8f d2 rcall .+1310 ; 0x508c + break; + default: + return; + } + + Endpoint_ClearSETUP(); + 4b6e: e3 d2 rcall .+1478 ; 0x5136 + * \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); + 4b70: 81 2f mov r24, r17 + 4b72: 7d d2 rcall .+1274 ; 0x506e + Endpoint_Write_8(Data >> 8); + 4b74: 80 e0 ldi r24, 0x00 ; 0 + 4b76: 7b d2 rcall .+1270 ; 0x506e + + Endpoint_Write_16_LE(CurrentStatus); + Endpoint_ClearIN(); + 4b78: 43 d2 rcall .+1158 ; 0x5000 + + Endpoint_ClearStatusStage(); + 4b7a: 42 d4 rcall .+2180 ; 0x5400 + 4b7c: 6b cf rjmp .-298 ; 0x4a54 + if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) + USB_Device_GetConfiguration(); + + break; + case REQ_SetConfiguration: + if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_DEVICE)) + 4b7e: 91 11 cpse r25, r1 + 4b80: 69 cf rjmp .-302 ; 0x4a54 +} + +static void USB_Device_SetConfiguration(void) +{ + #if defined(FIXED_NUM_CONFIGURATIONS) + if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS) + 4b82: 80 91 43 2b lds r24, 0x2B43 + 4b86: 82 30 cpi r24, 0x02 ; 2 + 4b88: 08 f0 brcs .+2 ; 0x4b8c + 4b8a: 64 cf rjmp .-312 ; 0x4a54 + if ((uint8_t)USB_ControlRequest.wValue > DevDescriptorPtr->NumberOfConfigurations) + return; + #endif + #endif + + Endpoint_ClearSETUP(); + 4b8c: d4 d2 rcall .+1448 ; 0x5136 + + USB_Device_ConfigurationNumber = (uint8_t)USB_ControlRequest.wValue; + 4b8e: 80 91 43 2b lds r24, 0x2B43 + 4b92: 80 93 3c 2b sts 0x2B3C, r24 + + Endpoint_ClearStatusStage(); + 4b96: 34 d4 rcall .+2152 ; 0x5400 + + if (USB_Device_ConfigurationNumber) + 4b98: 80 91 3c 2b lds r24, 0x2B3C + 4b9c: 88 23 and r24, r24 + 4b9e: 09 f4 brne .+2 ; 0x4ba2 + 4ba0: 61 c0 rjmp .+194 ; 0x4c64 + USB_DeviceState = DEVICE_STATE_Configured; + 4ba2: 84 e0 ldi r24, 0x04 ; 4 + 4ba4: 80 93 40 2b sts 0x2B40, r24 + else + USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; + + EVENT_USB_Device_ConfigurationChanged(); + 4ba8: 0e 94 47 11 call 0x228e ; 0x228e + 4bac: 53 cf rjmp .-346 ; 0x4a54 + USB_Device_GetDescriptor(); + } + + break; + case REQ_GetConfiguration: + if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE)) + 4bae: 90 38 cpi r25, 0x80 ; 128 + 4bb0: 09 f0 breq .+2 ; 0x4bb4 + 4bb2: 50 cf rjmp .-352 ; 0x4a54 + EVENT_USB_Device_ConfigurationChanged(); +} + +static void USB_Device_GetConfiguration(void) +{ + Endpoint_ClearSETUP(); + 4bb4: c0 d2 rcall .+1408 ; 0x5136 + + Endpoint_Write_8(USB_Device_ConfigurationNumber); + 4bb6: 80 91 3c 2b lds r24, 0x2B3C + 4bba: 59 d2 rcall .+1202 ; 0x506e + Endpoint_ClearIN(); + 4bbc: 21 d2 rcall .+1090 ; 0x5000 + + Endpoint_ClearStatusStage(); + 4bbe: 20 d4 rcall .+2112 ; 0x5400 + 4bc0: 49 cf rjmp .-366 ; 0x4a54 +{ + switch (USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) + { + #if !defined(NO_DEVICE_REMOTE_WAKEUP) + case REQREC_DEVICE: + if ((uint8_t)USB_ControlRequest.wValue == FEATURE_SEL_DeviceRemoteWakeup) + 4bc2: 90 91 43 2b lds r25, 0x2B43 + 4bc6: 91 30 cpi r25, 0x01 ; 1 + 4bc8: 09 f0 breq .+2 ; 0x4bcc + 4bca: 44 cf rjmp .-376 ; 0x4a54 + USB_Device_RemoteWakeupEnabled = (USB_ControlRequest.bRequest == REQ_SetFeature); + 4bcc: 91 e0 ldi r25, 0x01 ; 1 + 4bce: 83 30 cpi r24, 0x03 ; 3 + 4bd0: 09 f0 breq .+2 ; 0x4bd4 + 4bd2: 90 e0 ldi r25, 0x00 ; 0 + 4bd4: 90 93 3e 2b sts 0x2B3E, r25 + 4bd8: 80 cf rjmp .-256 ; 0x4ada + Endpoint_ClearOUT(); +} + +static void USB_Device_GetStatus(void) +{ + uint8_t CurrentStatus = 0; + 4bda: 10 91 3d 2b lds r17, 0x2B3D + if (USB_Device_CurrentlySelfPowered) + CurrentStatus |= FEATURE_SELFPOWERED_ENABLED; + #endif + + #if !defined(NO_DEVICE_REMOTE_WAKEUP) + if (USB_Device_RemoteWakeupEnabled) + 4bde: 80 91 3e 2b lds r24, 0x2B3E + 4be2: 88 23 and r24, r24 + 4be4: 09 f4 brne .+2 ; 0x4be8 + 4be6: c3 cf rjmp .-122 ; 0x4b6e + CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED; + 4be8: 12 60 ori r17, 0x02 ; 2 + 4bea: c1 cf rjmp .-126 ; 0x4b6e + + while (!(Endpoint_IsINReady())); + + USB_Device_EnableDeviceAddress(DeviceAddress); + + USB_DeviceState = (DeviceAddress) ? DEVICE_STATE_Addressed : DEVICE_STATE_Default; + 4bec: 83 e0 ldi r24, 0x03 ; 3 + 4bee: 89 cf rjmp .-238 ; 0x4b02 + { + USB_Descriptor_Header_t Header; + uint16_t UnicodeString[INTERNAL_SERIAL_LENGTH_BITS / 4]; + } SignatureDescriptor; + + SignatureDescriptor.Header.Type = DTYPE_String; + 4bf0: 83 e0 ldi r24, 0x03 ; 3 + 4bf2: 8a 83 std Y+2, r24 ; 0x02 + SignatureDescriptor.Header.Size = USB_STRING_LEN(INTERNAL_SERIAL_LENGTH_BITS / 4); + 4bf4: 8a e3 ldi r24, 0x3A ; 58 + 4bf6: 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; + 4bf8: 5f b7 in r21, 0x3f ; 63 + #if (ARCH == ARCH_AVR8) + cli(); + #elif (ARCH == ARCH_UC3) + __builtin_ssrf(AVR32_SR_GM_OFFSET); + #elif (ARCH == ARCH_XMEGA) + cli(); + 4bfa: f8 94 cli + + for (uint8_t SerialCharNum = 0; SerialCharNum < (INTERNAL_SERIAL_LENGTH_BITS / 4); SerialCharNum++) + { + uint8_t SerialByte; + + NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; + 4bfc: 82 e0 ldi r24, 0x02 ; 2 + 4bfe: 80 93 ca 01 sts 0x01CA, r24 + SerialByte = pgm_read_byte(SigReadAddress); + 4c02: e8 e0 ldi r30, 0x08 ; 8 + 4c04: f0 e0 ldi r31, 0x00 ; 0 + 4c06: e4 91 lpm r30, Z + NVM.CMD = 0; + 4c08: 10 92 ca 01 sts 0x01CA, r1 + + USB_Device_GetSerialString(SignatureDescriptor.UnicodeString); + 4c0c: de 01 movw r26, r28 + 4c0e: 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++) + 4c10: 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; + 4c12: 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; + 4c14: 42 e0 ldi r20, 0x02 ; 2 + { + SerialByte >>= 4; + SigReadAddress++; + } + + SerialByte &= 0x0F; + 4c16: ef 70 andi r30, 0x0F ; 15 + + UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? + 4c18: 8e 2f mov r24, r30 + 4c1a: 90 e0 ldi r25, 0x00 ; 0 + 4c1c: ea 30 cpi r30, 0x0A ; 10 + 4c1e: b8 f0 brcs .+46 ; 0x4c4e + 4c20: c7 96 adiw r24, 0x37 ; 55 + 4c22: 8d 93 st X+, r24 + 4c24: 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++) + 4c26: 2f 5f subi r18, 0xFF ; 255 + 4c28: 2c 31 cpi r18, 0x1C ; 28 + 4c2a: 99 f0 breq .+38 ; 0x4c52 + { + uint8_t SerialByte; + + NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; + 4c2c: 40 93 ca 01 sts 0x01CA, r20 + SerialByte = pgm_read_byte(SigReadAddress); + 4c30: e3 2f mov r30, r19 + 4c32: f0 e0 ldi r31, 0x00 ; 0 + 4c34: e4 91 lpm r30, Z + NVM.CMD = 0; + 4c36: 10 92 ca 01 sts 0x01CA, r1 + + if (SerialCharNum & 0x01) + 4c3a: 20 ff sbrs r18, 0 + 4c3c: ec cf rjmp .-40 ; 0x4c16 + { + SerialByte >>= 4; + 4c3e: e2 95 swap r30 + 4c40: ef 70 andi r30, 0x0F ; 15 + SigReadAddress++; + 4c42: 3f 5f subi r19, 0xFF ; 255 + } + + SerialByte &= 0x0F; + 4c44: ef 70 andi r30, 0x0F ; 15 + + UnicodeString[SerialCharNum] = cpu_to_le16((SerialByte >= 10) ? + 4c46: 8e 2f mov r24, r30 + 4c48: 90 e0 ldi r25, 0x00 ; 0 + 4c4a: ea 30 cpi r30, 0x0A ; 10 + 4c4c: 48 f7 brcc .-46 ; 0x4c20 + 4c4e: c0 96 adiw r24, 0x30 ; 48 + 4c50: e8 cf rjmp .-48 ; 0x4c22 + if (GlobalIntState & AVR32_SR_GM) + __builtin_ssrf(AVR32_SR_GM_OFFSET); + else + __builtin_csrf(AVR32_SR_GM_OFFSET); + #elif (ARCH == ARCH_XMEGA) + SREG = GlobalIntState; + 4c52: 5f bf out 0x3f, r21 ; 63 + + Endpoint_ClearSETUP(); + 4c54: 70 d2 rcall .+1248 ; 0x5136 + + Endpoint_Write_Control_Stream_LE(&SignatureDescriptor, sizeof(SignatureDescriptor)); + 4c56: 6a e3 ldi r22, 0x3A ; 58 + 4c58: 70 e0 ldi r23, 0x00 ; 0 + 4c5a: ce 01 movw r24, r28 + 4c5c: 01 96 adiw r24, 0x01 ; 1 + 4c5e: 90 d0 rcall .+288 ; 0x4d80 + Endpoint_ClearOUT(); + 4c60: e8 d1 rcall .+976 ; 0x5032 + 4c62: f8 ce rjmp .-528 ; 0x4a54 + } + + 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); + 4c64: 80 91 c3 04 lds r24, 0x04C3 + Endpoint_ClearStatusStage(); + + if (USB_Device_ConfigurationNumber) + USB_DeviceState = DEVICE_STATE_Configured; + else + USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered; + 4c68: 88 23 and r24, r24 + 4c6a: 21 f0 breq .+8 ; 0x4c74 + 4c6c: 84 e0 ldi r24, 0x04 ; 4 + 4c6e: 80 93 40 2b sts 0x2B40, r24 + 4c72: 9a cf rjmp .-204 ; 0x4ba8 + 4c74: 81 e0 ldi r24, 0x01 ; 1 + 4c76: fb cf rjmp .-10 ; 0x4c6e + + if (Endpoint_IsEnabled()) + { + if (USB_ControlRequest.bRequest == REQ_SetFeature) + { + Endpoint_StallTransaction(); + 4c78: 42 d2 rcall .+1156 ; 0x50fe + 4c7a: 2f cf rjmp .-418 ; 0x4ada + +00004c7c : +#define __INCLUDE_FROM_EVENTS_C +#define __INCLUDE_FROM_USB_DRIVER +#include "Events.h" + +void USB_Event_Stub(void) +{ + 4c7c: 08 95 ret + +00004c7e : +#if defined(USB_CAN_BE_DEVICE) && !defined(DEVICE_STATE_AS_GPIOR) +volatile uint8_t USB_DeviceState; +#endif + +void USB_USBTask(void) +{ + 4c7e: cf 93 push r28 +} + +#if defined(USB_CAN_BE_DEVICE) +static void USB_DeviceTask(void) +{ + if (USB_DeviceState == DEVICE_STATE_Unattached) + 4c80: 80 91 40 2b lds r24, 0x2B40 + 4c84: 81 11 cpse r24, r1 + 4c86: 02 c0 rjmp .+4 ; 0x4c8c + #elif defined(USB_CAN_BE_HOST) + USB_HostTask(); + #elif defined(USB_CAN_BE_DEVICE) + USB_DeviceTask(); + #endif +} + 4c88: cf 91 pop r28 + 4c8a: 08 95 ret + * \return Index of the currently selected endpoint. + */ + static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline uint8_t Endpoint_GetCurrentEndpoint(void) + { + return USB_Endpoint_SelectedEndpoint; + 4c8c: c0 91 4d 2b lds r28, 0x2B4D + if (USB_DeviceState == DEVICE_STATE_Unattached) + return; + + uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); + + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + 4c90: 80 e0 ldi r24, 0x00 ; 0 + 4c92: fc d1 rcall .+1016 ; 0x508c + + if (Endpoint_IsSETUPReceived()) + 4c94: 7c d2 rcall .+1272 ; 0x518e + 4c96: 81 11 cpse r24, r1 + 4c98: 03 c0 rjmp .+6 ; 0x4ca0 + USB_Device_ProcessControlRequest(); + + Endpoint_SelectEndpoint(PrevEndpoint); + 4c9a: 8c 2f mov r24, r28 + #elif defined(USB_CAN_BE_HOST) + USB_HostTask(); + #elif defined(USB_CAN_BE_DEVICE) + USB_DeviceTask(); + #endif +} + 4c9c: cf 91 pop r28 + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + + if (Endpoint_IsSETUPReceived()) + USB_Device_ProcessControlRequest(); + + Endpoint_SelectEndpoint(PrevEndpoint); + 4c9e: f6 c1 rjmp .+1004 ; 0x508c + uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); + + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + + if (Endpoint_IsSETUPReceived()) + USB_Device_ProcessControlRequest(); + 4ca0: a2 de rcall .-700 ; 0x49e6 + + Endpoint_SelectEndpoint(PrevEndpoint); + 4ca2: 8c 2f mov r24, r28 + #elif defined(USB_CAN_BE_HOST) + USB_HostTask(); + #elif defined(USB_CAN_BE_DEVICE) + USB_DeviceTask(); + #endif +} + 4ca4: cf 91 pop r28 + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); + + if (Endpoint_IsSETUPReceived()) + USB_Device_ProcessControlRequest(); + + Endpoint_SelectEndpoint(PrevEndpoint); + 4ca6: f2 c1 rjmp .+996 ; 0x508c + +00004ca8 : + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_RWCSTREAM_BusSuspended; + } + + return ENDPOINT_RWCSTREAM_NoError; + 4ca8: af 92 push r10 + 4caa: bf 92 push r11 + 4cac: df 92 push r13 + 4cae: ef 92 push r14 + 4cb0: ff 92 push r15 + 4cb2: 0f 93 push r16 + 4cb4: 1f 93 push r17 + 4cb6: cf 93 push r28 + 4cb8: df 93 push r29 + 4cba: 8c 01 movw r16, r24 + 4cbc: eb 01 movw r28, r22 + 4cbe: 7a 01 movw r14, r20 + 4cc0: b5 d3 rcall .+1898 ; 0x542c + 4cc2: d8 2e mov r13, r24 + 4cc4: 81 11 cpse r24, r1 + 4cc6: 27 c0 rjmp .+78 ; 0x4d16 + 4cc8: e1 14 cp r14, r1 + 4cca: f1 04 cpc r15, r1 + 4ccc: a1 f1 breq .+104 ; 0x4d36 + 4cce: f7 01 movw r30, r14 + 4cd0: 20 81 ld r18, Z + 4cd2: 31 81 ldd r19, Z+1 ; 0x01 + 4cd4: c2 1b sub r28, r18 + 4cd6: d3 0b sbc r29, r19 + 4cd8: 02 0f add r16, r18 + 4cda: 13 1f adc r17, r19 + 4cdc: 20 97 sbiw r28, 0x00 ; 0 + 4cde: d9 f0 breq .+54 ; 0x4d16 + 4ce0: a1 2c mov r10, r1 + 4ce2: b1 2c mov r11, r1 + 4ce4: 80 91 49 2b lds r24, 0x2B49 + 4ce8: 90 91 4a 2b lds r25, 0x2B4A + 4cec: fc 01 movw r30, r24 + 4cee: ef 5b subi r30, 0xBF ; 191 + 4cf0: ff 4f sbci r31, 0xFF ; 255 + 4cf2: 20 81 ld r18, Z + 4cf4: fc 01 movw r30, r24 + 4cf6: e0 5c subi r30, 0xC0 ; 192 + 4cf8: ff 4f sbci r31, 0xFF ; 255 + 4cfa: 80 81 ld r24, Z + 4cfc: 28 17 cp r18, r24 + 4cfe: 90 f1 brcs .+100 ; 0x4d64 + 4d00: 7f d1 rcall .+766 ; 0x5000 + 4d02: bd df rcall .-134 ; 0x4c7e + 4d04: f7 01 movw r30, r14 + 4d06: 80 81 ld r24, Z + 4d08: 91 81 ldd r25, Z+1 ; 0x01 + 4d0a: 8a 0d add r24, r10 + 4d0c: 9b 1d adc r25, r11 + 4d0e: 80 83 st Z, r24 + 4d10: 91 83 std Z+1, r25 ; 0x01 + 4d12: 25 e0 ldi r18, 0x05 ; 5 + 4d14: d2 2e mov r13, r18 + 4d16: 8d 2d mov r24, r13 + 4d18: df 91 pop r29 + 4d1a: cf 91 pop r28 + 4d1c: 1f 91 pop r17 + 4d1e: 0f 91 pop r16 + 4d20: ff 90 pop r15 + 4d22: ef 90 pop r14 + 4d24: df 90 pop r13 + 4d26: bf 90 pop r11 + 4d28: af 90 pop r10 + 4d2a: 08 95 ret + 4d2c: 69 d1 rcall .+722 ; 0x5000 + 4d2e: a7 df rcall .-178 ; 0x4c7e + 4d30: 7d d3 rcall .+1786 ; 0x542c + 4d32: 81 11 cpse r24, r1 + 4d34: 23 c0 rjmp .+70 ; 0x4d7c + 4d36: 20 97 sbiw r28, 0x00 ; 0 + 4d38: 71 f3 breq .-36 ; 0x4d16 + 4d3a: 20 91 49 2b lds r18, 0x2B49 + 4d3e: 30 91 4a 2b lds r19, 0x2B4A + 4d42: f9 01 movw r30, r18 + 4d44: ef 5b subi r30, 0xBF ; 191 + 4d46: ff 4f sbci r31, 0xFF ; 255 + 4d48: 90 81 ld r25, Z + 4d4a: f9 01 movw r30, r18 + 4d4c: e0 5c subi r30, 0xC0 ; 192 + 4d4e: ff 4f sbci r31, 0xFF ; 255 + 4d50: 80 81 ld r24, Z + 4d52: 98 17 cp r25, r24 + 4d54: 58 f7 brcc .-42 ; 0x4d2c + 4d56: f8 01 movw r30, r16 + 4d58: 81 91 ld r24, Z+ + 4d5a: 8f 01 movw r16, r30 + 4d5c: 88 d1 rcall .+784 ; 0x506e + 4d5e: 21 97 sbiw r28, 0x01 ; 1 + 4d60: 61 f7 brne .-40 ; 0x4d3a + 4d62: d9 cf rjmp .-78 ; 0x4d16 + 4d64: f8 01 movw r30, r16 + 4d66: 81 91 ld r24, Z+ + 4d68: 8f 01 movw r16, r30 + 4d6a: 81 d1 rcall .+770 ; 0x506e + 4d6c: ff ef ldi r31, 0xFF ; 255 + 4d6e: af 1a sub r10, r31 + 4d70: bf 0a sbc r11, r31 + 4d72: ca 15 cp r28, r10 + 4d74: db 05 cpc r29, r11 + 4d76: 09 f0 breq .+2 ; 0x4d7a + 4d78: b5 cf rjmp .-150 ; 0x4ce4 + 4d7a: cd cf rjmp .-102 ; 0x4d16 + 4d7c: d8 2e mov r13, r24 + 4d7e: cb cf rjmp .-106 ; 0x4d16 + +00004d80 : + 4d80: cf 92 push r12 + 4d82: df 92 push r13 + 4d84: ef 92 push r14 + 4d86: ff 92 push r15 + 4d88: 0f 93 push r16 + 4d8a: 1f 93 push r17 + 4d8c: cf 93 push r28 + 4d8e: df 93 push r29 + 4d90: 6c 01 movw r12, r24 + 4d92: eb 01 movw r28, r22 + 4d94: 80 91 4d 2b lds r24, 0x2B4D + 4d98: 80 68 ori r24, 0x80 ; 128 + 4d9a: 78 d1 rcall .+752 ; 0x508c + 4d9c: 00 91 47 2b lds r16, 0x2B47 + 4da0: 10 91 48 2b lds r17, 0x2B48 + 4da4: 0c 17 cp r16, r28 + 4da6: 1d 07 cpc r17, r29 + 4da8: 20 f0 brcs .+8 ; 0x4db2 + 4daa: 20 97 sbiw r28, 0x00 ; 0 + 4dac: 09 f4 brne .+2 ; 0x4db0 + 4dae: 83 c0 rjmp .+262 ; 0x4eb6 + 4db0: 8e 01 movw r16, r28 + 4db2: c0 e0 ldi r28, 0x00 ; 0 + 4db4: 01 15 cp r16, r1 + 4db6: 11 05 cpc r17, r1 + 4db8: 09 f0 breq .+2 ; 0x4dbc + 4dba: 4a c0 rjmp .+148 ; 0x4e50 + 4dbc: cc 23 and r28, r28 + 4dbe: 09 f4 brne .+2 ; 0x4dc2 + 4dc0: 5c c0 rjmp .+184 ; 0x4e7a + 4dc2: 80 91 40 2b lds r24, 0x2B40 + 4dc6: 88 23 and r24, r24 + 4dc8: 09 f4 brne .+2 ; 0x4dcc + 4dca: 55 c0 rjmp .+170 ; 0x4e76 + 4dcc: 85 30 cpi r24, 0x05 ; 5 + 4dce: 09 f4 brne .+2 ; 0x4dd2 + 4dd0: 5d c0 rjmp .+186 ; 0x4e8c + 4dd2: dd d1 rcall .+954 ; 0x518e + 4dd4: 81 11 cpse r24, r1 + 4dd6: 6d c0 rjmp .+218 ; 0x4eb2 + 4dd8: f3 d1 rcall .+998 ; 0x51c0 + 4dda: 81 11 cpse r24, r1 + 4ddc: 4e c0 rjmp .+156 ; 0x4e7a + 4dde: 09 d2 rcall .+1042 ; 0x51f2 + 4de0: 88 23 and r24, r24 + 4de2: 79 f3 breq .-34 ; 0x4dc2 + 4de4: 80 91 4d 2b lds r24, 0x2B4D + 4de8: 87 fd sbrc r24, 7 + 4dea: 5a c0 rjmp .+180 ; 0x4ea0 + 4dec: 20 91 49 2b lds r18, 0x2B49 + 4df0: 30 91 4a 2b lds r19, 0x2B4A + 4df4: f9 01 movw r30, r18 + 4df6: e0 5c subi r30, 0xC0 ; 192 + 4df8: ff 4f sbci r31, 0xFF ; 255 + 4dfa: e0 80 ld r14, Z + 4dfc: f9 01 movw r30, r18 + 4dfe: ef 5b subi r30, 0xBF ; 191 + 4e00: ff 4f sbci r31, 0xFF ; 255 + 4e02: 80 81 ld r24, Z + 4e04: f1 2c mov r15, r1 + 4e06: e8 1a sub r14, r24 + 4e08: f1 08 sbc r15, r1 + 4e0a: 01 15 cp r16, r1 + 4e0c: 11 05 cpc r17, r1 + 4e0e: a9 f0 breq .+42 ; 0x4e3a + 4e10: 88 e0 ldi r24, 0x08 ; 8 + 4e12: e8 16 cp r14, r24 + 4e14: f1 04 cpc r15, r1 + 4e16: 88 f4 brcc .+34 ; 0x4e3a + 4e18: e6 01 movw r28, r12 + 4e1a: 04 c0 rjmp .+8 ; 0x4e24 + 4e1c: 88 e0 ldi r24, 0x08 ; 8 + 4e1e: e8 16 cp r14, r24 + 4e20: f1 04 cpc r15, r1 + 4e22: 59 f0 breq .+22 ; 0x4e3a + 4e24: 89 91 ld r24, Y+ + 4e26: 23 d1 rcall .+582 ; 0x506e + 4e28: 6e 01 movw r12, r28 + 4e2a: 01 50 subi r16, 0x01 ; 1 + 4e2c: 11 09 sbc r17, r1 + 4e2e: 8f ef ldi r24, 0xFF ; 255 + 4e30: e8 1a sub r14, r24 + 4e32: f8 0a sbc r15, r24 + 4e34: 01 15 cp r16, r1 + 4e36: 11 05 cpc r17, r1 + 4e38: 89 f7 brne .-30 ; 0x4e1c + 4e3a: c1 e0 ldi r28, 0x01 ; 1 + 4e3c: 88 e0 ldi r24, 0x08 ; 8 + 4e3e: e8 16 cp r14, r24 + 4e40: f1 04 cpc r15, r1 + 4e42: 09 f0 breq .+2 ; 0x4e46 + 4e44: c0 e0 ldi r28, 0x00 ; 0 + 4e46: dc d0 rcall .+440 ; 0x5000 + 4e48: 01 15 cp r16, r1 + 4e4a: 11 05 cpc r17, r1 + 4e4c: 09 f4 brne .+2 ; 0x4e50 + 4e4e: b6 cf rjmp .-148 ; 0x4dbc + 4e50: 80 91 40 2b lds r24, 0x2B40 + 4e54: 88 23 and r24, r24 + 4e56: 79 f0 breq .+30 ; 0x4e76 + 4e58: 85 30 cpi r24, 0x05 ; 5 + 4e5a: c1 f0 breq .+48 ; 0x4e8c + 4e5c: 98 d1 rcall .+816 ; 0x518e + 4e5e: 81 11 cpse r24, r1 + 4e60: 28 c0 rjmp .+80 ; 0x4eb2 + 4e62: ae d1 rcall .+860 ; 0x51c0 + 4e64: 81 11 cpse r24, r1 + 4e66: 09 c0 rjmp .+18 ; 0x4e7a + 4e68: c4 d1 rcall .+904 ; 0x51f2 + 4e6a: 81 11 cpse r24, r1 + 4e6c: bb cf rjmp .-138 ; 0x4de4 + 4e6e: 80 91 40 2b lds r24, 0x2B40 + 4e72: 81 11 cpse r24, r1 + 4e74: f1 cf rjmp .-30 ; 0x4e58 + 4e76: 82 e0 ldi r24, 0x02 ; 2 + 4e78: 0a c0 rjmp .+20 ; 0x4e8e + 4e7a: a2 d1 rcall .+836 ; 0x51c0 + 4e7c: 81 11 cpse r24, r1 + 4e7e: 1f c0 rjmp .+62 ; 0x4ebe + 4e80: 80 91 40 2b lds r24, 0x2B40 + 4e84: 88 23 and r24, r24 + 4e86: b9 f3 breq .-18 ; 0x4e76 + 4e88: 85 30 cpi r24, 0x05 ; 5 + 4e8a: b9 f7 brne .-18 ; 0x4e7a + 4e8c: 83 e0 ldi r24, 0x03 ; 3 + 4e8e: df 91 pop r29 + 4e90: cf 91 pop r28 + 4e92: 1f 91 pop r17 + 4e94: 0f 91 pop r16 + 4e96: ff 90 pop r15 + 4e98: ef 90 pop r14 + 4e9a: df 90 pop r13 + 4e9c: cf 90 pop r12 + 4e9e: 08 95 ret + 4ea0: e0 91 49 2b lds r30, 0x2B49 + 4ea4: f0 91 4a 2b lds r31, 0x2B4A + 4ea8: ef 5b subi r30, 0xBF ; 191 + 4eaa: ff 4f sbci r31, 0xFF ; 255 + 4eac: e0 80 ld r14, Z + 4eae: f1 2c mov r15, r1 + 4eb0: ac cf rjmp .-168 ; 0x4e0a + 4eb2: 81 e0 ldi r24, 0x01 ; 1 + 4eb4: ec cf rjmp .-40 ; 0x4e8e + 4eb6: a4 d0 rcall .+328 ; 0x5000 + 4eb8: 00 e0 ldi r16, 0x00 ; 0 + 4eba: 10 e0 ldi r17, 0x00 ; 0 + 4ebc: 7a cf rjmp .-268 ; 0x4db2 + 4ebe: 80 e0 ldi r24, 0x00 ; 0 + 4ec0: e6 cf rjmp .-52 ; 0x4e8e + +00004ec2 : + +#if defined(TEMPLATE_FUNC_NAME) + +uint8_t TEMPLATE_FUNC_NAME (const void* const Buffer, + uint16_t Length) +{ + 4ec2: cf 92 push r12 + 4ec4: df 92 push r13 + 4ec6: ef 92 push r14 + 4ec8: ff 92 push r15 + 4eca: 0f 93 push r16 + 4ecc: 1f 93 push r17 + 4ece: cf 93 push r28 + 4ed0: df 93 push r29 + 4ed2: d8 2e mov r13, r24 + 4ed4: c9 2e mov r12, r25 + 4ed6: 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); + 4ed8: 80 91 4d 2b lds r24, 0x2B4D + 4edc: 80 68 ori r24, 0x80 ; 128 + 4ede: d6 d0 rcall .+428 ; 0x508c + + if (Length > USB_ControlRequest.wLength) + 4ee0: c0 91 47 2b lds r28, 0x2B47 + 4ee4: d0 91 48 2b lds r29, 0x2B48 + 4ee8: c0 17 cp r28, r16 + 4eea: d1 07 cpc r29, r17 + 4eec: 28 f0 brcs .+10 ; 0x4ef8 + Length = USB_ControlRequest.wLength; + else if (!(Length)) + 4eee: 01 15 cp r16, r1 + 4ef0: 11 05 cpc r17, r1 + 4ef2: 09 f4 brne .+2 ; 0x4ef6 + 4ef4: 7f c0 rjmp .+254 ; 0x4ff4 + 4ef6: e8 01 movw r28, r16 + 4ef8: ed 2c mov r14, r13 + 4efa: fc 2c mov r15, r12 + 4efc: d1 2c mov r13, r1 + 4efe: 20 97 sbiw r28, 0x00 ; 0 + 4f00: 09 f0 breq .+2 ; 0x4f04 + 4f02: 45 c0 rjmp .+138 ; 0x4f8e + 4f04: dd 20 and r13, r13 + 4f06: 09 f4 brne .+2 ; 0x4f0a + 4f08: 57 c0 rjmp .+174 ; 0x4fb8 + Endpoint_ClearIN(); + + while (Length || LastPacketFull) + { + uint8_t USB_DeviceState_LCL = USB_DeviceState; + 4f0a: 80 91 40 2b lds r24, 0x2B40 + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + 4f0e: 88 23 and r24, r24 + 4f10: 09 f4 brne .+2 ; 0x4f14 + 4f12: 50 c0 rjmp .+160 ; 0x4fb4 + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + 4f14: 85 30 cpi r24, 0x05 ; 5 + 4f16: 09 f4 brne .+2 ; 0x4f1a + 4f18: 58 c0 rjmp .+176 ; 0x4fca + return ENDPOINT_RWCSTREAM_BusSuspended; + else if (Endpoint_IsSETUPReceived()) + 4f1a: 39 d1 rcall .+626 ; 0x518e + 4f1c: 81 11 cpse r24, r1 + 4f1e: 68 c0 rjmp .+208 ; 0x4ff0 + return ENDPOINT_RWCSTREAM_HostAborted; + else if (Endpoint_IsOUTReceived()) + 4f20: 4f d1 rcall .+670 ; 0x51c0 + 4f22: 81 11 cpse r24, r1 + 4f24: 49 c0 rjmp .+146 ; 0x4fb8 + break; + + if (Endpoint_IsINReady()) + 4f26: 65 d1 rcall .+714 ; 0x51f2 + 4f28: 88 23 and r24, r24 + 4f2a: 79 f3 breq .-34 ; 0x4f0a + * \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) + 4f2c: 80 91 4d 2b lds r24, 0x2B4D + 4f30: 87 fd sbrc r24, 7 + 4f32: 55 c0 rjmp .+170 ; 0x4fde + return USB_Endpoint_SelectedFIFO->Position; + else + return (USB_Endpoint_SelectedFIFO->Length - USB_Endpoint_SelectedFIFO->Position); + 4f34: 80 91 49 2b lds r24, 0x2B49 + 4f38: 90 91 4a 2b lds r25, 0x2B4A + 4f3c: fc 01 movw r30, r24 + 4f3e: e0 5c subi r30, 0xC0 ; 192 + 4f40: ff 4f sbci r31, 0xFF ; 255 + 4f42: 00 81 ld r16, Z + 4f44: fc 01 movw r30, r24 + 4f46: ef 5b subi r30, 0xBF ; 191 + 4f48: ff 4f sbci r31, 0xFF ; 255 + 4f4a: 80 81 ld r24, Z + 4f4c: 10 e0 ldi r17, 0x00 ; 0 + 4f4e: 08 1b sub r16, r24 + 4f50: 11 09 sbc r17, r1 + { + uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); + + while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) + 4f52: 20 97 sbiw r28, 0x00 ; 0 + 4f54: 91 f0 breq .+36 ; 0x4f7a + 4f56: 08 30 cpi r16, 0x08 ; 8 + 4f58: 11 05 cpc r17, r1 + 4f5a: 20 f0 brcs .+8 ; 0x4f64 + 4f5c: 0e c0 rjmp .+28 ; 0x4f7a + 4f5e: 08 30 cpi r16, 0x08 ; 8 + 4f60: 11 05 cpc r17, r1 + 4f62: 59 f0 breq .+22 ; 0x4f7a + { + TEMPLATE_TRANSFER_BYTE(DataStream); + 4f64: f7 01 movw r30, r14 + 4f66: 84 91 lpm r24, Z + 4f68: 82 d0 rcall .+260 ; 0x506e + TEMPLATE_BUFFER_MOVE(DataStream, 1); + 4f6a: ff ef ldi r31, 0xFF ; 255 + 4f6c: ef 1a sub r14, r31 + 4f6e: ff 0a sbc r15, r31 + Length--; + 4f70: 21 97 sbiw r28, 0x01 ; 1 + BytesInEndpoint++; + 4f72: 0f 5f subi r16, 0xFF ; 255 + 4f74: 1f 4f sbci r17, 0xFF ; 255 + + if (Endpoint_IsINReady()) + { + uint16_t BytesInEndpoint = Endpoint_BytesInEndpoint(); + + while (Length && (BytesInEndpoint < USB_Device_ControlEndpointSize)) + 4f76: 20 97 sbiw r28, 0x00 ; 0 + 4f78: 91 f7 brne .-28 ; 0x4f5e + TEMPLATE_BUFFER_MOVE(DataStream, 1); + Length--; + BytesInEndpoint++; + } + + LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); + 4f7a: dd 24 eor r13, r13 + 4f7c: d3 94 inc r13 + 4f7e: 08 30 cpi r16, 0x08 ; 8 + 4f80: 11 05 cpc r17, r1 + 4f82: 09 f0 breq .+2 ; 0x4f86 + 4f84: d1 2c mov r13, r1 + Endpoint_ClearIN(); + 4f86: 3c d0 rcall .+120 ; 0x5000 + 4f88: 20 97 sbiw r28, 0x00 ; 0 + 4f8a: 09 f4 brne .+2 ; 0x4f8e + 4f8c: bb cf rjmp .-138 ; 0x4f04 + else if (!(Length)) + Endpoint_ClearIN(); + + while (Length || LastPacketFull) + { + uint8_t USB_DeviceState_LCL = USB_DeviceState; + 4f8e: 80 91 40 2b lds r24, 0x2B40 + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + 4f92: 88 23 and r24, r24 + 4f94: 79 f0 breq .+30 ; 0x4fb4 + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + 4f96: 85 30 cpi r24, 0x05 ; 5 + 4f98: c1 f0 breq .+48 ; 0x4fca + return ENDPOINT_RWCSTREAM_BusSuspended; + else if (Endpoint_IsSETUPReceived()) + 4f9a: f9 d0 rcall .+498 ; 0x518e + 4f9c: 81 11 cpse r24, r1 + 4f9e: 28 c0 rjmp .+80 ; 0x4ff0 + return ENDPOINT_RWCSTREAM_HostAborted; + else if (Endpoint_IsOUTReceived()) + 4fa0: 0f d1 rcall .+542 ; 0x51c0 + 4fa2: 81 11 cpse r24, r1 + 4fa4: 09 c0 rjmp .+18 ; 0x4fb8 + break; + + if (Endpoint_IsINReady()) + 4fa6: 25 d1 rcall .+586 ; 0x51f2 + 4fa8: 81 11 cpse r24, r1 + 4faa: c0 cf rjmp .-128 ; 0x4f2c + else if (!(Length)) + Endpoint_ClearIN(); + + while (Length || LastPacketFull) + { + uint8_t USB_DeviceState_LCL = USB_DeviceState; + 4fac: 80 91 40 2b lds r24, 0x2B40 + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + 4fb0: 81 11 cpse r24, r1 + 4fb2: f1 cf rjmp .-30 ; 0x4f96 + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + 4fb4: 82 e0 ldi r24, 0x02 ; 2 + 4fb6: 0a c0 rjmp .+20 ; 0x4fcc + LastPacketFull = (BytesInEndpoint == USB_Device_ControlEndpointSize); + Endpoint_ClearIN(); + } + } + + while (!(Endpoint_IsOUTReceived())) + 4fb8: 03 d1 rcall .+518 ; 0x51c0 + 4fba: 81 11 cpse r24, r1 + 4fbc: 1f c0 rjmp .+62 ; 0x4ffc + { + uint8_t USB_DeviceState_LCL = USB_DeviceState; + 4fbe: 80 91 40 2b lds r24, 0x2B40 + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + 4fc2: 88 23 and r24, r24 + 4fc4: b9 f3 breq .-18 ; 0x4fb4 + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + 4fc6: 85 30 cpi r24, 0x05 ; 5 + 4fc8: b9 f7 brne .-18 ; 0x4fb8 + uint8_t USB_DeviceState_LCL = USB_DeviceState; + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_RWCSTREAM_BusSuspended; + 4fca: 83 e0 ldi r24, 0x03 ; 3 + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_RWCSTREAM_BusSuspended; + } + + return ENDPOINT_RWCSTREAM_NoError; +} + 4fcc: df 91 pop r29 + 4fce: cf 91 pop r28 + 4fd0: 1f 91 pop r17 + 4fd2: 0f 91 pop r16 + 4fd4: ff 90 pop r15 + 4fd6: ef 90 pop r14 + 4fd8: df 90 pop r13 + 4fda: cf 90 pop r12 + 4fdc: 08 95 ret + */ + static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline uint16_t Endpoint_BytesInEndpoint(void) + { + if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN) + return USB_Endpoint_SelectedFIFO->Position; + 4fde: e0 91 49 2b lds r30, 0x2B49 + 4fe2: f0 91 4a 2b lds r31, 0x2B4A + 4fe6: ef 5b subi r30, 0xBF ; 191 + 4fe8: ff 4f sbci r31, 0xFF ; 255 + 4fea: 00 81 ld r16, Z + 4fec: 10 e0 ldi r17, 0x00 ; 0 + 4fee: b1 cf rjmp .-158 ; 0x4f52 + 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; + 4ff0: 81 e0 ldi r24, 0x01 ; 1 + 4ff2: ec cf rjmp .-40 ; 0x4fcc + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); + + if (Length > USB_ControlRequest.wLength) + Length = USB_ControlRequest.wLength; + else if (!(Length)) + Endpoint_ClearIN(); + 4ff4: 05 d0 rcall .+10 ; 0x5000 + 4ff6: c0 e0 ldi r28, 0x00 ; 0 + 4ff8: d0 e0 ldi r29, 0x00 ; 0 + 4ffa: 7e cf rjmp .-260 ; 0x4ef8 + return ENDPOINT_RWCSTREAM_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_RWCSTREAM_BusSuspended; + } + + return ENDPOINT_RWCSTREAM_NoError; + 4ffc: 80 e0 ldi r24, 0x00 ; 0 + 4ffe: e6 cf rjmp .-52 ; 0x4fcc + +00005000 : + USB_Endpoint_SelectedFIFO->Position = 0; +} + +void Endpoint_ClearIN(void) +{ + USB_Endpoint_SelectedHandle->CNT = USB_Endpoint_SelectedFIFO->Position; + 5000: e0 91 4b 2b lds r30, 0x2B4B + 5004: f0 91 4c 2b lds r31, 0x2B4C + 5008: a0 91 49 2b lds r26, 0x2B49 + 500c: b0 91 4a 2b lds r27, 0x2B4A + 5010: af 5b subi r26, 0xBF ; 191 + 5012: bf 4f sbci r27, 0xFF ; 255 + 5014: 8c 91 ld r24, X + 5016: 90 e0 ldi r25, 0x00 ; 0 + 5018: 82 83 std Z+2, r24 ; 0x02 + 501a: 93 83 std Z+3, r25 ; 0x03 + USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); + 501c: 80 81 ld r24, Z + 501e: 8d 79 andi r24, 0x9D ; 157 + 5020: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 5022: e0 91 49 2b lds r30, 0x2B49 + 5026: f0 91 4a 2b lds r31, 0x2B4A + 502a: ef 5b subi r30, 0xBF ; 191 + 502c: ff 4f sbci r31, 0xFF ; 255 + 502e: 10 82 st Z, r1 + 5030: 08 95 ret + +00005032 : +} + +void Endpoint_ClearOUT(void) +{ + USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); + 5032: e0 91 4b 2b lds r30, 0x2B4B + 5036: f0 91 4c 2b lds r31, 0x2B4C + 503a: 80 81 ld r24, Z + 503c: 8d 79 andi r24, 0x9D ; 157 + 503e: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 5040: e0 91 49 2b lds r30, 0x2B49 + 5044: f0 91 4a 2b lds r31, 0x2B4A + 5048: ef 5b subi r30, 0xBF ; 191 + 504a: ff 4f sbci r31, 0xFF ; 255 + 504c: 10 82 st Z, r1 + 504e: 08 95 ret + +00005050 : + } +} + +uint8_t Endpoint_Read_8(void) +{ + return USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++]; + 5050: 80 91 49 2b lds r24, 0x2B49 + 5054: 90 91 4a 2b lds r25, 0x2B4A + 5058: fc 01 movw r30, r24 + 505a: ef 5b subi r30, 0xBF ; 191 + 505c: ff 4f sbci r31, 0xFF ; 255 + 505e: 20 81 ld r18, Z + 5060: dc 01 movw r26, r24 + 5062: a2 0f add r26, r18 + 5064: b1 1d adc r27, r1 + 5066: 8c 91 ld r24, X + 5068: 2f 5f subi r18, 0xFF ; 255 + 506a: 20 83 st Z, r18 +} + 506c: 08 95 ret + +0000506e : + +void Endpoint_Write_8(const uint8_t Data) +{ + USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; + 506e: 20 91 49 2b lds r18, 0x2B49 + 5072: 30 91 4a 2b lds r19, 0x2B4A + 5076: f9 01 movw r30, r18 + 5078: ef 5b subi r30, 0xBF ; 191 + 507a: ff 4f sbci r31, 0xFF ; 255 + 507c: 90 81 ld r25, Z + 507e: d9 01 movw r26, r18 + 5080: a9 0f add r26, r25 + 5082: b1 1d adc r27, r1 + 5084: 8c 93 st X, r24 + 5086: 9f 5f subi r25, 0xFF ; 255 + 5088: 90 83 st Z, r25 + 508a: 08 95 ret + +0000508c : + +void Endpoint_SelectEndpoint(const uint8_t Address) +{ + uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); + + USB_Endpoint_SelectedEndpoint = Address; + 508c: 80 93 4d 2b sts 0x2B4D, r24 + USB_Endpoint_SelectedFIFO->Data[USB_Endpoint_SelectedFIFO->Position++] = Data; +} + +void Endpoint_SelectEndpoint(const uint8_t Address) +{ + uint8_t EndpointNumber = (Address & ENDPOINT_EPNUM_MASK); + 5090: 28 2f mov r18, r24 + 5092: 2f 70 andi r18, 0x0F ; 15 + + USB_Endpoint_SelectedEndpoint = Address; + + Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; + 5094: 62 2f mov r22, r18 + 5096: 70 e0 ldi r23, 0x00 ; 0 + 5098: 94 e8 ldi r25, 0x84 ; 132 + 509a: 29 9f mul r18, r25 + 509c: 90 01 movw r18, r0 + 509e: 11 24 eor r1, r1 + 50a0: 22 5b subi r18, 0xB2 ; 178 + 50a2: 34 4d sbci r19, 0xD4 ; 212 + USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; + 50a4: 40 91 c6 04 lds r20, 0x04C6 + 50a8: 50 91 c7 04 lds r21, 0x04C7 + + if (Address & ENDPOINT_DIR_IN) + 50ac: 87 fd sbrc r24, 7 + 50ae: 12 c0 rjmp .+36 ; 0x50d4 + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; + } + else + { + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; + 50b0: 20 93 49 2b sts 0x2B49, r18 + 50b4: 30 93 4a 2b sts 0x2B4A, r19 + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; + 50b8: cb 01 movw r24, r22 + 50ba: 82 95 swap r24 + 50bc: 92 95 swap r25 + 50be: 90 7f andi r25, 0xF0 ; 240 + 50c0: 98 27 eor r25, r24 + 50c2: 80 7f andi r24, 0xF0 ; 240 + 50c4: 98 27 eor r25, r24 + 50c6: 84 0f add r24, r20 + 50c8: 95 1f adc r25, r21 + 50ca: 80 93 4b 2b sts 0x2B4B, r24 + 50ce: 90 93 4c 2b sts 0x2B4C, r25 + 50d2: 08 95 ret + Endpoint_FIFOPair_t* EndpointFIFOPair = &USB_Endpoint_FIFOs[EndpointNumber]; + USB_EndpointTable_t* EndpointTable = (USB_EndpointTable_t*)USB.EPPTR; + + if (Address & ENDPOINT_DIR_IN) + { + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->IN; + 50d4: 2e 5b subi r18, 0xBE ; 190 + 50d6: 3f 4f sbci r19, 0xFF ; 255 + 50d8: 20 93 49 2b sts 0x2B49, r18 + 50dc: 30 93 4a 2b sts 0x2B4A, r19 + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].IN; + 50e0: 62 95 swap r22 + 50e2: 72 95 swap r23 + 50e4: 70 7f andi r23, 0xF0 ; 240 + 50e6: 76 27 eor r23, r22 + 50e8: 60 7f andi r22, 0xF0 ; 240 + 50ea: 76 27 eor r23, r22 + 50ec: 68 5f subi r22, 0xF8 ; 248 + 50ee: 7f 4f sbci r23, 0xFF ; 255 + 50f0: 64 0f add r22, r20 + 50f2: 75 1f adc r23, r21 + 50f4: 60 93 4b 2b sts 0x2B4B, r22 + 50f8: 70 93 4c 2b sts 0x2B4C, r23 + 50fc: 08 95 ret + +000050fe : + USB_Endpoint_SelectedFIFO->Position = 0; +} + +void Endpoint_StallTransaction(void) +{ + USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; + 50fe: e0 91 4b 2b lds r30, 0x2B4B + 5102: f0 91 4c 2b lds r31, 0x2B4C + 5106: 81 81 ldd r24, Z+1 ; 0x01 + 5108: 84 60 ori r24, 0x04 ; 4 + 510a: 81 83 std Z+1, r24 ; 0x01 + + if ((USB_Endpoint_SelectedHandle->CTRL & USB_EP_TYPE_gm) == USB_EP_TYPE_CONTROL_gc) + 510c: e0 91 4b 2b lds r30, 0x2B4B + 5110: f0 91 4c 2b lds r31, 0x2B4C + 5114: 81 81 ldd r24, Z+1 ; 0x01 + 5116: 80 7c andi r24, 0xC0 ; 192 + 5118: 80 34 cpi r24, 0x40 ; 64 + 511a: 09 f0 breq .+2 ; 0x511e + 511c: 08 95 ret + { + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint ^ ENDPOINT_DIR_IN); + 511e: 80 91 4d 2b lds r24, 0x2B4D + 5122: 80 58 subi r24, 0x80 ; 128 + 5124: b3 df rcall .-154 ; 0x508c + USB_Endpoint_SelectedHandle->CTRL |= USB_EP_STALL_bm; + 5126: e0 91 4b 2b lds r30, 0x2B4B + 512a: f0 91 4c 2b lds r31, 0x2B4C + 512e: 81 81 ldd r24, Z+1 ; 0x01 + 5130: 84 60 ori r24, 0x04 ; 4 + 5132: 81 83 std Z+1, r24 ; 0x01 + 5134: 08 95 ret + +00005136 : + return false; +} + +void Endpoint_ClearSETUP(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); + 5136: 80 91 4d 2b lds r24, 0x2B4D + 513a: 8f 77 andi r24, 0x7F ; 127 + 513c: a7 df rcall .-178 ; 0x508c + USB_Endpoint_SelectedHandle->STATUS &= ~(USB_EP_SETUP_bm | USB_EP_TRNCOMPL0_bm | USB_EP_BUSNACK0_bm | USB_EP_OVF_bm); + 513e: e0 91 4b 2b lds r30, 0x2B4B + 5142: f0 91 4c 2b lds r31, 0x2B4C + 5146: 80 81 ld r24, Z + 5148: 8d 78 andi r24, 0x8D ; 141 + 514a: 80 83 st Z, r24 + USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; + 514c: e0 91 4b 2b lds r30, 0x2B4B + 5150: f0 91 4c 2b lds r31, 0x2B4C + 5154: 80 81 ld r24, Z + 5156: 81 60 ori r24, 0x01 ; 1 + 5158: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 515a: e0 91 49 2b lds r30, 0x2B49 + 515e: f0 91 4a 2b lds r31, 0x2B4A + 5162: ef 5b subi r30, 0xBF ; 191 + 5164: ff 4f sbci r31, 0xFF ; 255 + 5166: 10 82 st Z, r1 + + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint | ENDPOINT_DIR_IN); + 5168: 80 91 4d 2b lds r24, 0x2B4D + 516c: 80 68 ori r24, 0x80 ; 128 + 516e: 8e df rcall .-228 ; 0x508c + USB_Endpoint_SelectedHandle->STATUS |= USB_EP_TOGGLE_bm; + 5170: e0 91 4b 2b lds r30, 0x2B4B + 5174: f0 91 4c 2b lds r31, 0x2B4C + 5178: 80 81 ld r24, Z + 517a: 81 60 ori r24, 0x01 ; 1 + 517c: 80 83 st Z, r24 + USB_Endpoint_SelectedFIFO->Position = 0; + 517e: e0 91 49 2b lds r30, 0x2B49 + 5182: f0 91 4a 2b lds r31, 0x2B4A + 5186: ef 5b subi r30, 0xBF ; 191 + 5188: ff 4f sbci r31, 0xFF ; 255 + 518a: 10 82 st Z, r1 + 518c: 08 95 ret + +0000518e : + return false; +} + +bool Endpoint_IsSETUPReceived(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); + 518e: 80 91 4d 2b lds r24, 0x2B4D + 5192: 8f 77 andi r24, 0x7F ; 127 + 5194: 7b df rcall .-266 ; 0x508c + + if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_SETUP_bm) + 5196: e0 91 4b 2b lds r30, 0x2B4B + 519a: f0 91 4c 2b lds r31, 0x2B4C + 519e: 80 81 ld r24, Z + 51a0: 84 ff sbrs r24, 4 + 51a2: 0c c0 rjmp .+24 ; 0x51bc + { + USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; + 51a4: 20 91 49 2b lds r18, 0x2B49 + 51a8: 30 91 4a 2b lds r19, 0x2B4A + 51ac: 82 81 ldd r24, Z+2 ; 0x02 + 51ae: 93 81 ldd r25, Z+3 ; 0x03 + 51b0: f9 01 movw r30, r18 + 51b2: e0 5c subi r30, 0xC0 ; 192 + 51b4: ff 4f sbci r31, 0xFF ; 255 + 51b6: 80 83 st Z, r24 + return true; + 51b8: 81 e0 ldi r24, 0x01 ; 1 + 51ba: 08 95 ret + } + + return false; + 51bc: 80 e0 ldi r24, 0x00 ; 0 +} + 51be: 08 95 ret + +000051c0 : + return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); +} + +bool Endpoint_IsOUTReceived(void) +{ + Endpoint_SelectEndpoint(USB_Endpoint_SelectedEndpoint & ~ENDPOINT_DIR_IN); + 51c0: 80 91 4d 2b lds r24, 0x2B4D + 51c4: 8f 77 andi r24, 0x7F ; 127 + 51c6: 62 df rcall .-316 ; 0x508c + + if (USB_Endpoint_SelectedHandle->STATUS & USB_EP_TRNCOMPL0_bm) + 51c8: e0 91 4b 2b lds r30, 0x2B4B + 51cc: f0 91 4c 2b lds r31, 0x2B4C + 51d0: 80 81 ld r24, Z + 51d2: 85 ff sbrs r24, 5 + 51d4: 0c c0 rjmp .+24 ; 0x51ee + { + USB_Endpoint_SelectedFIFO->Length = USB_Endpoint_SelectedHandle->CNT; + 51d6: 20 91 49 2b lds r18, 0x2B49 + 51da: 30 91 4a 2b lds r19, 0x2B4A + 51de: 82 81 ldd r24, Z+2 ; 0x02 + 51e0: 93 81 ldd r25, Z+3 ; 0x03 + 51e2: f9 01 movw r30, r18 + 51e4: e0 5c subi r30, 0xC0 ; 192 + 51e6: ff 4f sbci r31, 0xFF ; 255 + 51e8: 80 83 st Z, r24 + return true; + 51ea: 81 e0 ldi r24, 0x01 ; 1 + 51ec: 08 95 ret + } + + return false; + 51ee: 80 e0 ldi r24, 0x00 ; 0 +} + 51f0: 08 95 ret + +000051f2 : +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); + 51f2: 80 91 4d 2b lds r24, 0x2B4D + 51f6: 80 68 ori r24, 0x80 ; 128 + 51f8: 49 df rcall .-366 ; 0x508c + + return ((USB_Endpoint_SelectedHandle->STATUS & USB_EP_BUSNACK0_bm) ? true : false); + 51fa: e0 91 4b 2b lds r30, 0x2B4B + 51fe: f0 91 4c 2b lds r31, 0x2B4C + 5202: 80 81 ld r24, Z +} + 5204: 86 95 lsr r24 + 5206: 81 70 andi r24, 0x01 ; 1 + 5208: 08 95 ret + +0000520a : +} + +bool Endpoint_ConfigureEndpoint_PRV(const uint8_t Address, + const uint8_t Config, + const uint8_t Size) +{ + 520a: 1f 93 push r17 + 520c: cf 93 push r28 + 520e: df 93 push r29 + 5210: 00 d0 rcall .+0 ; 0x5212 + 5212: cd b7 in r28, 0x3d ; 61 + 5214: de b7 in r29, 0x3e ; 62 + 5216: 18 2f mov r17, r24 + Endpoint_SelectEndpoint(Address); + 5218: 4a 83 std Y+2, r20 ; 0x02 + 521a: 69 83 std Y+1, r22 ; 0x01 + 521c: 37 df rcall .-402 ; 0x508c + + USB_Endpoint_SelectedHandle->CTRL = 0; + 521e: e0 91 4b 2b lds r30, 0x2B4B + 5222: f0 91 4c 2b lds r31, 0x2B4C + 5226: 11 82 std Z+1, r1 ; 0x01 + USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; + 5228: e0 91 4b 2b lds r30, 0x2B4B + 522c: f0 91 4c 2b lds r31, 0x2B4C + 5230: 4a 81 ldd r20, Y+2 ; 0x02 + 5232: 69 81 ldd r22, Y+1 ; 0x01 + 5234: 17 fd sbrc r17, 7 + 5236: 22 c0 rjmp .+68 ; 0x527c + 5238: 10 82 st Z, r1 + USB_Endpoint_SelectedHandle->CTRL = Config; + 523a: e0 91 4b 2b lds r30, 0x2B4B + 523e: f0 91 4c 2b lds r31, 0x2B4C + 5242: 61 83 std Z+1, r22 ; 0x01 + USB_Endpoint_SelectedHandle->CNT = 0; + 5244: e0 91 4b 2b lds r30, 0x2B4B + 5248: f0 91 4c 2b lds r31, 0x2B4C + 524c: 12 82 std Z+2, r1 ; 0x02 + 524e: 13 82 std Z+3, r1 ; 0x03 + USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; + 5250: 80 91 49 2b lds r24, 0x2B49 + 5254: 90 91 4a 2b lds r25, 0x2B4A + 5258: 84 83 std Z+4, r24 ; 0x04 + 525a: 95 83 std Z+5, r25 ; 0x05 + + USB_Endpoint_SelectedFIFO->Length = (Address & ENDPOINT_DIR_IN) ? Size : 0; + 525c: 40 e0 ldi r20, 0x00 ; 0 + 525e: fc 01 movw r30, r24 + 5260: e0 5c subi r30, 0xC0 ; 192 + 5262: ff 4f sbci r31, 0xFF ; 255 + 5264: 40 83 st Z, r20 + USB_Endpoint_SelectedFIFO->Position = 0; + 5266: fc 01 movw r30, r24 + 5268: ef 5b subi r30, 0xBF ; 191 + 526a: ff 4f sbci r31, 0xFF ; 255 + 526c: 10 82 st Z, r1 + + return true; +} + 526e: 81 e0 ldi r24, 0x01 ; 1 + 5270: 0f 90 pop r0 + 5272: 0f 90 pop r0 + 5274: df 91 pop r29 + 5276: cf 91 pop r28 + 5278: 1f 91 pop r17 + 527a: 08 95 ret + const uint8_t Size) +{ + Endpoint_SelectEndpoint(Address); + + USB_Endpoint_SelectedHandle->CTRL = 0; + USB_Endpoint_SelectedHandle->STATUS = (Address & ENDPOINT_DIR_IN) ? USB_EP_BUSNACK0_bm : 0; + 527c: 82 e0 ldi r24, 0x02 ; 2 + 527e: 80 83 st Z, r24 + USB_Endpoint_SelectedHandle->CTRL = Config; + 5280: e0 91 4b 2b lds r30, 0x2B4B + 5284: f0 91 4c 2b lds r31, 0x2B4C + 5288: 61 83 std Z+1, r22 ; 0x01 + USB_Endpoint_SelectedHandle->CNT = 0; + 528a: e0 91 4b 2b lds r30, 0x2B4B + 528e: f0 91 4c 2b lds r31, 0x2B4C + 5292: 12 82 std Z+2, r1 ; 0x02 + 5294: 13 82 std Z+3, r1 ; 0x03 + USB_Endpoint_SelectedHandle->DATAPTR = (intptr_t)USB_Endpoint_SelectedFIFO->Data; + 5296: 80 91 49 2b lds r24, 0x2B49 + 529a: 90 91 4a 2b lds r25, 0x2B4A + 529e: 84 83 std Z+4, r24 ; 0x04 + 52a0: 95 83 std Z+5, r25 ; 0x05 + 52a2: dd cf rjmp .-70 ; 0x525e + +000052a4 : + } +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + const uint8_t Entries) +{ + 52a4: af 92 push r10 + 52a6: bf 92 push r11 + 52a8: df 92 push r13 + 52aa: ef 92 push r14 + 52ac: ff 92 push r15 + 52ae: 0f 93 push r16 + 52b0: 1f 93 push r17 + 52b2: cf 93 push r28 + 52b4: df 93 push r29 + 52b6: 00 d0 rcall .+0 ; 0x52b8 + 52b8: cd b7 in r28, 0x3d ; 61 + 52ba: de b7 in r29, 0x3e ; 62 + 52bc: e6 2e mov r14, r22 + for (uint8_t i = 0; i < Entries; i++) + 52be: 66 23 and r22, r22 + 52c0: 09 f4 brne .+2 ; 0x52c4 + 52c2: 4a c0 rjmp .+148 ; 0x5358 + 52c4: 5c 01 movw r10, r24 + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; + } +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + 52c6: 8c 01 movw r16, r24 + 52c8: 0c 5f subi r16, 0xFC ; 252 + 52ca: 1f 4f sbci r17, 0xFF ; 255 + const uint8_t Entries) +{ + for (uint8_t i = 0; i < Entries; i++) + 52cc: f1 2c mov r15, r1 + { + if (!(Table[i].Address)) + 52ce: d5 01 movw r26, r10 + 52d0: 5c 91 ld r21, X + 52d2: 55 23 and r21, r21 + 52d4: c9 f1 breq .+114 ; 0x5348 + continue; + + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) + 52d6: d5 01 movw r26, r10 + 52d8: 11 96 adiw r26, 0x01 ; 1 + 52da: ed 91 ld r30, X+ + 52dc: fc 91 ld r31, X + 52de: 12 97 sbiw r26, 0x02 ; 2 + USB_Endpoint_SelectedFIFO = &EndpointFIFOPair->OUT; + USB_Endpoint_SelectedHandle = &EndpointTable->Endpoints[EndpointNumber].OUT; + } +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + 52e0: d8 01 movw r26, r16 + 52e2: 11 97 sbiw r26, 0x01 ; 1 + for (uint8_t i = 0; i < Entries; i++) + { + if (!(Table[i].Address)) + continue; + + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) + 52e4: 4c 91 ld r20, X + static inline bool Endpoint_ConfigureEndpoint(const uint8_t Address, + const uint8_t Type, + const uint16_t Size, + const uint8_t Banks) + { + uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); + 52e6: d8 01 movw r26, r16 + 52e8: 8c 91 ld r24, X + 52ea: 82 30 cpi r24, 0x02 ; 2 + 52ec: 08 f4 brcc .+2 ; 0x52f0 + 52ee: 43 c0 rjmp .+134 ; 0x5376 + 52f0: 98 e1 ldi r25, 0x18 ; 24 + 52f2: 88 e1 ldi r24, 0x18 ; 24 + static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) + { + uint8_t MaskVal = 0; + uint16_t CheckBytes = 8; + + while (CheckBytes < Bytes) + 52f4: e9 30 cpi r30, 0x09 ; 9 + 52f6: f1 05 cpc r31, r1 + 52f8: 50 f0 brcs .+20 ; 0x530e + 52fa: 28 e0 ldi r18, 0x08 ; 8 + 52fc: 30 e0 ldi r19, 0x00 ; 0 + 52fe: 90 e0 ldi r25, 0x00 ; 0 + { + MaskVal++; + 5300: 9f 5f subi r25, 0xFF ; 255 + CheckBytes <<= 1; + 5302: 22 0f add r18, r18 + 5304: 33 1f adc r19, r19 + static inline uint8_t Endpoint_BytesToEPSizeMask(const uint16_t Bytes) + { + uint8_t MaskVal = 0; + uint16_t CheckBytes = 8; + + while (CheckBytes < Bytes) + 5306: 2e 17 cp r18, r30 + 5308: 3f 07 cpc r19, r31 + 530a: d0 f3 brcs .-12 ; 0x5300 + 530c: 98 2b or r25, r24 + const uint16_t Size, + const uint8_t Banks) + { + uint8_t EPConfigMask = (USB_EP_INTDSBL_bm | ((Banks > 1) ? USB_EP_PINGPONG_bm : 0) | Endpoint_BytesToEPSizeMask(Size)); + + if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) + 530e: 25 2f mov r18, r21 + 5310: 2f 70 andi r18, 0x0F ; 15 + 5312: 30 e0 ldi r19, 0x00 ; 0 + 5314: 26 30 cpi r18, 0x06 ; 6 + 5316: 31 05 cpc r19, r1 + 5318: 64 f5 brge .+88 ; 0x5372 + return false; + + // TODO - Fix once limitations are lifted + EPConfigMask &= ~USB_EP_PINGPONG_bm; + if (Size > 64) + 531a: e1 34 cpi r30, 0x41 ; 65 + 531c: f1 05 cpc r31, r1 + 531e: 48 f5 brcc .+82 ; 0x5372 + + if ((Address & ENDPOINT_EPNUM_MASK) >= ENDPOINT_TOTAL_ENDPOINTS) + return false; + + // TODO - Fix once limitations are lifted + EPConfigMask &= ~USB_EP_PINGPONG_bm; + 5320: 9f 7e andi r25, 0xEF ; 239 + if (Size > 64) + return false; + + switch (Type) + 5322: 41 11 cpse r20, r1 + 5324: 2b c0 rjmp .+86 ; 0x537c + { + case EP_TYPE_CONTROL: + EPConfigMask |= USB_EP_TYPE_CONTROL_gc; + 5326: 90 64 ori r25, 0x40 ; 64 + EPConfigMask |= USB_EP_TYPE_BULK_gc; + break; + } + + if (Type == EP_TYPE_CONTROL) + Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); + 5328: de 2e mov r13, r30 + 532a: 4e 2f mov r20, r30 + 532c: 69 2f mov r22, r25 + 532e: 85 2f mov r24, r21 + 5330: 80 58 subi r24, 0x80 ; 128 + 5332: 59 83 std Y+1, r21 ; 0x01 + 5334: 9a 83 std Y+2, r25 ; 0x02 + 5336: 69 df rcall .-302 ; 0x520a + 5338: 9a 81 ldd r25, Y+2 ; 0x02 + 533a: 59 81 ldd r21, Y+1 ; 0x01 + + return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); + 533c: 4d 2d mov r20, r13 + 533e: 69 2f mov r22, r25 + 5340: 85 2f mov r24, r21 + 5342: 63 df rcall .-314 ; 0x520a + 5344: 88 23 and r24, r24 + 5346: a9 f0 breq .+42 ; 0x5372 +} + +bool Endpoint_ConfigureEndpointTable(const USB_Endpoint_Table_t* const Table, + const uint8_t Entries) +{ + for (uint8_t i = 0; i < Entries; i++) + 5348: f3 94 inc r15 + 534a: b5 e0 ldi r27, 0x05 ; 5 + 534c: ab 0e add r10, r27 + 534e: b1 1c adc r11, r1 + 5350: 0b 5f subi r16, 0xFB ; 251 + 5352: 1f 4f sbci r17, 0xFF ; 255 + 5354: fe 10 cpse r15, r14 + 5356: bb cf rjmp .-138 ; 0x52ce + { + return false; + } + } + + return true; + 5358: 81 e0 ldi r24, 0x01 ; 1 +} + 535a: 0f 90 pop r0 + 535c: 0f 90 pop r0 + 535e: df 91 pop r29 + 5360: cf 91 pop r28 + 5362: 1f 91 pop r17 + 5364: 0f 91 pop r16 + 5366: ff 90 pop r15 + 5368: ef 90 pop r14 + 536a: df 90 pop r13 + 536c: bf 90 pop r11 + 536e: af 90 pop r10 + 5370: 08 95 ret + if (!(Table[i].Address)) + continue; + + if (!(Endpoint_ConfigureEndpoint(Table[i].Address, Table[i].Type, Table[i].Size, Table[i].Banks))) + { + return false; + 5372: 80 e0 ldi r24, 0x00 ; 0 + 5374: f2 cf rjmp .-28 ; 0x535a + 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)); + 5376: 98 e0 ldi r25, 0x08 ; 8 + 5378: 88 e0 ldi r24, 0x08 ; 8 + 537a: bc cf rjmp .-136 ; 0x52f4 + // TODO - Fix once limitations are lifted + EPConfigMask &= ~USB_EP_PINGPONG_bm; + if (Size > 64) + return false; + + switch (Type) + 537c: 41 30 cpi r20, 0x01 ; 1 + 537e: 29 f0 breq .+10 ; 0x538a + break; + case EP_TYPE_ISOCHRONOUS: + EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; + break; + default: + EPConfigMask |= USB_EP_TYPE_BULK_gc; + 5380: 90 68 ori r25, 0x80 ; 128 + break; + } + + if (Type == EP_TYPE_CONTROL) + 5382: 44 23 and r20, r20 + 5384: 89 f2 breq .-94 ; 0x5328 + 5386: de 2e mov r13, r30 + 5388: d9 cf rjmp .-78 ; 0x533c + { + case EP_TYPE_CONTROL: + EPConfigMask |= USB_EP_TYPE_CONTROL_gc; + break; + case EP_TYPE_ISOCHRONOUS: + EPConfigMask |= USB_EP_TYPE_ISOCHRONOUS_gc; + 538a: 90 6c ori r25, 0xC0 ; 192 + 538c: de 2e mov r13, r30 + 538e: d6 cf rjmp .-84 ; 0x533c + +00005390 : + +void Endpoint_ClearEndpoints(void) +{ + for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) + { + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; + 5390: e0 ec ldi r30, 0xC0 ; 192 + 5392: f4 e0 ldi r31, 0x04 ; 4 + 5394: a6 81 ldd r26, Z+6 ; 0x06 + 5396: b7 81 ldd r27, Z+7 ; 0x07 + 5398: 19 96 adiw r26, 0x09 ; 9 + 539a: 1c 92 st X, r1 + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; + 539c: a6 81 ldd r26, Z+6 ; 0x06 + 539e: b7 81 ldd r27, Z+7 ; 0x07 + 53a0: 11 96 adiw r26, 0x01 ; 1 + 53a2: 1c 92 st X, r1 + +void Endpoint_ClearEndpoints(void) +{ + for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) + { + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; + 53a4: a6 81 ldd r26, Z+6 ; 0x06 + 53a6: b7 81 ldd r27, Z+7 ; 0x07 + 53a8: 59 96 adiw r26, 0x19 ; 25 + 53aa: 1c 92 st X, r1 + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; + 53ac: a6 81 ldd r26, Z+6 ; 0x06 + 53ae: b7 81 ldd r27, Z+7 ; 0x07 + 53b0: 51 96 adiw r26, 0x11 ; 17 + 53b2: 1c 92 st X, r1 + +void Endpoint_ClearEndpoints(void) +{ + for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) + { + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; + 53b4: a6 81 ldd r26, Z+6 ; 0x06 + 53b6: b7 81 ldd r27, Z+7 ; 0x07 + 53b8: 99 96 adiw r26, 0x29 ; 41 + 53ba: 1c 92 st X, r1 + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; + 53bc: a6 81 ldd r26, Z+6 ; 0x06 + 53be: b7 81 ldd r27, Z+7 ; 0x07 + 53c0: 91 96 adiw r26, 0x21 ; 33 + 53c2: 1c 92 st X, r1 + +void Endpoint_ClearEndpoints(void) +{ + for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) + { + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; + 53c4: a6 81 ldd r26, Z+6 ; 0x06 + 53c6: b7 81 ldd r27, Z+7 ; 0x07 + 53c8: d9 96 adiw r26, 0x39 ; 57 + 53ca: 1c 92 st X, r1 + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; + 53cc: a6 81 ldd r26, Z+6 ; 0x06 + 53ce: b7 81 ldd r27, Z+7 ; 0x07 + 53d0: d1 96 adiw r26, 0x31 ; 49 + 53d2: 1c 92 st X, r1 + +void Endpoint_ClearEndpoints(void) +{ + for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) + { + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; + 53d4: a6 81 ldd r26, Z+6 ; 0x06 + 53d6: b7 81 ldd r27, Z+7 ; 0x07 + 53d8: a7 5b subi r26, 0xB7 ; 183 + 53da: bf 4f sbci r27, 0xFF ; 255 + 53dc: 1c 92 st X, r1 + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; + 53de: a6 81 ldd r26, Z+6 ; 0x06 + 53e0: b7 81 ldd r27, Z+7 ; 0x07 + 53e2: af 5b subi r26, 0xBF ; 191 + 53e4: bf 4f sbci r27, 0xFF ; 255 + 53e6: 1c 92 st X, r1 + +void Endpoint_ClearEndpoints(void) +{ + for (uint8_t EPNum = 0; EPNum < ENDPOINT_TOTAL_ENDPOINTS; EPNum++) + { + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].IN.CTRL = 0; + 53e8: a6 81 ldd r26, Z+6 ; 0x06 + 53ea: b7 81 ldd r27, Z+7 ; 0x07 + 53ec: a7 5a subi r26, 0xA7 ; 167 + 53ee: bf 4f sbci r27, 0xFF ; 255 + 53f0: 1c 92 st X, r1 + ((USB_EndpointTable_t*)USB.EPPTR)->Endpoints[EPNum].OUT.CTRL = 0; + 53f2: 06 80 ldd r0, Z+6 ; 0x06 + 53f4: f7 81 ldd r31, Z+7 ; 0x07 + 53f6: e0 2d mov r30, r0 + 53f8: ef 5a subi r30, 0xAF ; 175 + 53fa: ff 4f sbci r31, 0xFF ; 255 + 53fc: 10 82 st Z, r1 + 53fe: 08 95 ret + +00005400 : + } +} + +void Endpoint_ClearStatusStage(void) +{ + if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) + 5400: 80 91 41 2b lds r24, 0x2B41 + 5404: 87 fd sbrc r24, 7 + 5406: 08 c0 rjmp .+16 ; 0x5418 + + Endpoint_ClearOUT(); + } + else + { + while (!(Endpoint_IsINReady())) + 5408: f4 de rcall .-536 ; 0x51f2 + 540a: 81 11 cpse r24, r1 + 540c: 0d c0 rjmp .+26 ; 0x5428 + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + 540e: 80 91 40 2b lds r24, 0x2B40 + 5412: 81 11 cpse r24, r1 + 5414: f9 cf rjmp .-14 ; 0x5408 + 5416: 08 95 ret + +void Endpoint_ClearStatusStage(void) +{ + if (USB_ControlRequest.bmRequestType & REQDIR_DEVICETOHOST) + { + while (!(Endpoint_IsOUTReceived())) + 5418: d3 de rcall .-602 ; 0x51c0 + 541a: 81 11 cpse r24, r1 + 541c: 06 c0 rjmp .+12 ; 0x542a + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + 541e: 80 91 40 2b lds r24, 0x2B40 + 5422: 81 11 cpse r24, r1 + 5424: f9 cf rjmp .-14 ; 0x5418 + 5426: 08 95 ret + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + return; + } + + Endpoint_ClearIN(); + 5428: eb cd rjmp .-1066 ; 0x5000 + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + return; + } + + Endpoint_ClearOUT(); + 542a: 03 ce rjmp .-1018 ; 0x5032 + +0000542c : + } +} + +#if !defined(CONTROL_ONLY_DEVICE) +uint8_t Endpoint_WaitUntilReady(void) +{ + 542c: 1f 93 push r17 + 542e: cf 93 push r28 + 5430: df 93 push r29 + * \return Current USB frame number from the USB controller. + */ + static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; + static inline uint16_t USB_Device_GetFrameNumber(void) + { + return ((USB_EndpointTable_t*)USB.EPPTR)->FrameNum; + 5432: e0 91 c6 04 lds r30, 0x04C6 + 5436: f0 91 c7 04 lds r31, 0x04C7 + 543a: e0 5a subi r30, 0xA0 ; 160 + 543c: ff 4f sbci r31, 0xFF ; 255 + 543e: c0 81 ld r28, Z + 5440: d1 81 ldd r29, Z+1 ; 0x01 + #if (USB_STREAM_TIMEOUT_MS < 0xFF) + uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS; + 5442: 14 e6 ldi r17, 0x64 ; 100 + * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask. + */ + static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline uint8_t Endpoint_GetEndpointDirection(void) + { + return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN); + 5444: 80 91 4d 2b lds r24, 0x2B4D + 5448: 80 78 andi r24, 0x80 ; 128 + + uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); + + for (;;) + { + if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) + 544a: 80 38 cpi r24, 0x80 ; 128 + 544c: 31 f1 breq .+76 ; 0x549a + if (Endpoint_IsINReady()) + return ENDPOINT_READYWAIT_NoError; + } + else + { + if (Endpoint_IsOUTReceived()) + 544e: b8 de rcall .-656 ; 0x51c0 + 5450: 81 11 cpse r24, r1 + 5452: 26 c0 rjmp .+76 ; 0x54a0 + return ENDPOINT_READYWAIT_NoError; + } + + uint8_t USB_DeviceState_LCL = USB_DeviceState; + 5454: 80 91 40 2b lds r24, 0x2B40 + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + 5458: 88 23 and r24, r24 + 545a: 39 f1 breq .+78 ; 0x54aa + return ENDPOINT_READYWAIT_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + 545c: 85 30 cpi r24, 0x05 ; 5 + 545e: 51 f1 breq .+84 ; 0x54b4 + * \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); + 5460: e0 91 4b 2b lds r30, 0x2B4B + 5464: f0 91 4c 2b lds r31, 0x2B4C + 5468: 81 81 ldd r24, Z+1 ; 0x01 + return ENDPOINT_READYWAIT_BusSuspended; + else if (Endpoint_IsStalled()) + 546a: 82 fd sbrc r24, 2 + 546c: 28 c0 rjmp .+80 ; 0x54be + 546e: e0 91 c6 04 lds r30, 0x04C6 + 5472: f0 91 c7 04 lds r31, 0x04C7 + 5476: e0 5a subi r30, 0xA0 ; 160 + 5478: ff 4f sbci r31, 0xFF ; 255 + 547a: 80 81 ld r24, Z + 547c: 91 81 ldd r25, Z+1 ; 0x01 + return ENDPOINT_READYWAIT_EndpointStalled; + + uint16_t CurrentFrameNumber = USB_Device_GetFrameNumber(); + + if (CurrentFrameNumber != PreviousFrameNumber) + 547e: c8 17 cp r28, r24 + 5480: d9 07 cpc r29, r25 + 5482: 01 f3 breq .-64 ; 0x5444 + { + PreviousFrameNumber = CurrentFrameNumber; + + if (!(TimeoutMSRem--)) + 5484: 21 2f mov r18, r17 + 5486: 21 50 subi r18, 0x01 ; 1 + 5488: 11 23 and r17, r17 + 548a: f1 f0 breq .+60 ; 0x54c8 + 548c: ec 01 movw r28, r24 + 548e: 12 2f mov r17, r18 + * \return The currently selected endpoint's direction, as a \c ENDPOINT_DIR_* mask. + */ + static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; + static inline uint8_t Endpoint_GetEndpointDirection(void) + { + return (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN); + 5490: 80 91 4d 2b lds r24, 0x2B4D + 5494: 80 78 andi r24, 0x80 ; 128 + + uint16_t PreviousFrameNumber = USB_Device_GetFrameNumber(); + + for (;;) + { + if (Endpoint_GetEndpointDirection() == ENDPOINT_DIR_IN) + 5496: 80 38 cpi r24, 0x80 ; 128 + 5498: d1 f6 brne .-76 ; 0x544e + { + if (Endpoint_IsINReady()) + 549a: ab de rcall .-682 ; 0x51f2 + 549c: 88 23 and r24, r24 + 549e: d1 f2 breq .-76 ; 0x5454 + return ENDPOINT_READYWAIT_NoError; + 54a0: 80 e0 ldi r24, 0x00 ; 0 + + if (!(TimeoutMSRem--)) + return ENDPOINT_READYWAIT_Timeout; + } + } +} + 54a2: df 91 pop r29 + 54a4: cf 91 pop r28 + 54a6: 1f 91 pop r17 + 54a8: 08 95 ret + } + + uint8_t USB_DeviceState_LCL = USB_DeviceState; + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + return ENDPOINT_READYWAIT_DeviceDisconnected; + 54aa: 82 e0 ldi r24, 0x02 ; 2 + + if (!(TimeoutMSRem--)) + return ENDPOINT_READYWAIT_Timeout; + } + } +} + 54ac: df 91 pop r29 + 54ae: cf 91 pop r28 + 54b0: 1f 91 pop r17 + 54b2: 08 95 ret + uint8_t USB_DeviceState_LCL = USB_DeviceState; + + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + return ENDPOINT_READYWAIT_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_READYWAIT_BusSuspended; + 54b4: 83 e0 ldi r24, 0x03 ; 3 + + if (!(TimeoutMSRem--)) + return ENDPOINT_READYWAIT_Timeout; + } + } +} + 54b6: df 91 pop r29 + 54b8: cf 91 pop r28 + 54ba: 1f 91 pop r17 + 54bc: 08 95 ret + if (USB_DeviceState_LCL == DEVICE_STATE_Unattached) + return ENDPOINT_READYWAIT_DeviceDisconnected; + else if (USB_DeviceState_LCL == DEVICE_STATE_Suspended) + return ENDPOINT_READYWAIT_BusSuspended; + else if (Endpoint_IsStalled()) + return ENDPOINT_READYWAIT_EndpointStalled; + 54be: 81 e0 ldi r24, 0x01 ; 1 + + if (!(TimeoutMSRem--)) + return ENDPOINT_READYWAIT_Timeout; + } + } +} + 54c0: df 91 pop r29 + 54c2: cf 91 pop r28 + 54c4: 1f 91 pop r17 + 54c6: 08 95 ret + if (CurrentFrameNumber != PreviousFrameNumber) + { + PreviousFrameNumber = CurrentFrameNumber; + + if (!(TimeoutMSRem--)) + return ENDPOINT_READYWAIT_Timeout; + 54c8: 84 e0 ldi r24, 0x04 ; 4 + } + } +} + 54ca: df 91 pop r29 + 54cc: cf 91 pop r28 + 54ce: 1f 91 pop r17 + 54d0: 08 95 ret + +000054d2 : + USB_ResetInterface(); +} + +void USB_Disable(void) +{ + USB_INT_DisableAllInterrupts(); + 54d2: 63 d0 rcall .+198 ; 0x559a + USB_INT_ClearAllInterrupts(); + 54d4: 69 d0 rcall .+210 ; 0x55a8 + * 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; + 54d6: e0 ec ldi r30, 0xC0 ; 192 + 54d8: f4 e0 ldi r31, 0x04 ; 4 + 54da: 81 81 ldd r24, Z+1 ; 0x01 + 54dc: 8e 7f andi r24, 0xFE ; 254 + 54de: 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; + 54e0: 80 81 ld r24, Z + 54e2: 8f 77 andi r24, 0x7F ; 127 + 54e4: 80 83 st Z, r24 + + USB_Detach(); + USB_Controller_Disable(); + + USB_IsInitialized = false; + 54e6: 10 92 3f 2b sts 0x2B3F, r1 + 54ea: 08 95 ret + +000054ec : +} + +void USB_ResetInterface(void) +{ + 54ec: cf 93 push r28 + 54ee: 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); + 54f0: e0 e4 ldi r30, 0x40 ; 64 + 54f2: f0 e0 ldi r31, 0x00 ; 0 + 54f4: 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); + 54f6: 84 81 ldd r24, Z+4 ; 0x04 + 54f8: 81 60 ori r24, 0x01 ; 1 + 54fa: 84 83 std Z+4, r24 ; 0x04 + else + CLK.USBCTRL |= (CLK_USBSRC_RC32M_gc | CLK_USBSEN_bm); + + USB_Device_SetDeviceAddress(0); + + USB_INT_DisableAllInterrupts(); + 54fc: 4e d0 rcall .+156 ; 0x559a + USB_INT_ClearAllInterrupts(); + 54fe: 54 d0 rcall .+168 ; 0x55a8 + } + + static inline void USB_Controller_Reset(void) ATTR_ALWAYS_INLINE; + static inline void USB_Controller_Reset(void) + { + USB.CTRLA &= ~USB_ENABLE_bm; + 5500: c0 ec ldi r28, 0xC0 ; 192 + 5502: d4 e0 ldi r29, 0x04 ; 4 + 5504: 88 81 ld r24, Y + 5506: 8f 77 andi r24, 0x7F ; 127 + 5508: 88 83 st Y, r24 + USB.CTRLA |= USB_ENABLE_bm; + 550a: 88 81 ld r24, Y + 550c: 80 68 ori r24, 0x80 ; 128 + 550e: 88 83 st Y, r24 +} + +#if defined(USB_CAN_BE_DEVICE) +static void USB_Init_Device(void) +{ + USB_DeviceState = DEVICE_STATE_Unattached; + 5510: 10 92 40 2b sts 0x2B40, r1 + USB_Device_ConfigurationNumber = 0; + 5514: 10 92 3c 2b sts 0x2B3C, r1 + + #if !defined(NO_DEVICE_REMOTE_WAKEUP) + USB_Device_RemoteWakeupEnabled = false; + 5518: 10 92 3e 2b sts 0x2B3E, r1 + #endif + + #if !defined(NO_DEVICE_SELF_POWER) + USB_Device_CurrentlySelfPowered = false; + 551c: 10 92 3d 2b sts 0x2B3D, r1 + } + + static inline void USB_Device_SetFullSpeed(void) ATTR_ALWAYS_INLINE; + static inline void USB_Device_SetFullSpeed(void) + { + USB.CTRLA |= USB_SPEED_bm; + 5520: 88 81 ld r24, Y + 5522: 80 64 ori r24, 0x40 ; 64 + 5524: 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); + 5526: 48 e0 ldi r20, 0x08 ; 8 + 5528: 68 e4 ldi r22, 0x48 ; 72 + 552a: 80 e8 ldi r24, 0x80 ; 128 + 552c: 6e de rcall .-804 ; 0x520a + + return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); + 552e: 48 e0 ldi r20, 0x08 ; 8 + 5530: 68 e4 ldi r22, 0x48 ; 72 + 5532: 80 e0 ldi r24, 0x00 ; 0 + 5534: 6a de rcall .-812 ; 0x520a + static inline void USB_INT_Enable(const uint8_t Interrupt) + { + switch (Interrupt) + { + case USB_INT_BUSEVENTI: + USB.INTCTRLA |= USB_BUSEVIE_bm; + 5536: 88 85 ldd r24, Y+8 ; 0x08 + 5538: 80 64 ori r24, 0x40 ; 64 + 553a: 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; + 553c: 89 81 ldd r24, Y+1 ; 0x01 + 553e: 81 60 ori r24, 0x01 ; 1 + 5540: 89 83 std Y+1, r24 ; 0x01 + USB_INT_DisableAllInterrupts(); + USB_INT_ClearAllInterrupts(); + + USB_Controller_Reset(); + USB_Init_Device(); +} + 5542: df 91 pop r29 + 5544: cf 91 pop r28 + 5546: 08 95 ret + +00005548 : + + #if !defined(USE_STATIC_OPTIONS) + const uint8_t Options + #endif + ) +{ + 5548: cf 93 push r28 + 554a: 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; + 554c: 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(); + 554e: f8 94 cli + #endif + + uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask(); + GlobalInterruptDisable(); + + NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc; + 5550: c0 ec ldi r28, 0xC0 ; 192 + 5552: d1 e0 ldi r29, 0x01 ; 1 + 5554: 22 e0 ldi r18, 0x02 ; 2 + 5556: 2a 87 std Y+10, r18 ; 0x0a + USB.CAL0 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL0)); + 5558: ea e1 ldi r30, 0x1A ; 26 + 555a: f0 e0 ldi r31, 0x00 ; 0 + 555c: e4 91 lpm r30, Z + 555e: a0 ec ldi r26, 0xC0 ; 192 + 5560: b4 e0 ldi r27, 0x04 ; 4 + 5562: da 96 adiw r26, 0x3a ; 58 + 5564: ec 93 st X, r30 + 5566: da 97 sbiw r26, 0x3a ; 58 + USB.CAL1 = pgm_read_byte(offsetof(NVM_PROD_SIGNATURES_t, USBCAL1)); + 5568: eb e1 ldi r30, 0x1B ; 27 + 556a: f0 e0 ldi r31, 0x00 ; 0 + 556c: e4 91 lpm r30, Z + 556e: db 96 adiw r26, 0x3b ; 59 + 5570: ec 93 st X, r30 + 5572: db 97 sbiw r26, 0x3b ; 59 + NVM.CMD = NVM_CMD_NO_OPERATION_gc; + 5574: 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)); + 5576: 87 e6 ldi r24, 0x67 ; 103 + 5578: 9e e2 ldi r25, 0x2E ; 46 + 557a: 8e 7f andi r24, 0xFE ; 254 + 557c: 16 96 adiw r26, 0x06 ; 6 + 557e: 8d 93 st X+, r24 + 5580: 9c 93 st X, r25 + 5582: 17 97 sbiw r26, 0x07 ; 7 + USB.CTRLA = (USB_STFRNUM_bm | ((ENDPOINT_TOTAL_ENDPOINTS - 1) << USB_MAXEP_gp)); + 5584: 85 e1 ldi r24, 0x15 ; 21 + 5586: 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); + 5588: 18 96 adiw r26, 0x08 ; 8 + 558a: 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; + 558c: 3f bf out 0x3f, r19 ; 63 + + #if defined(USB_CAN_BE_BOTH) + USB_CurrentMode = Mode; + #endif + + USB_IsInitialized = true; + 558e: 81 e0 ldi r24, 0x01 ; 1 + 5590: 80 93 3f 2b sts 0x2B3F, r24 + + USB_ResetInterface(); +} + 5594: df 91 pop r29 + 5596: cf 91 pop r28 + USB_CurrentMode = Mode; + #endif + + USB_IsInitialized = true; + + USB_ResetInterface(); + 5598: a9 cf rjmp .-174 ; 0x54ec + +0000559a : +#define __INCLUDE_FROM_USB_DRIVER +#include "../USBInterrupt.h" + +void USB_INT_DisableAllInterrupts(void) +{ + USB.INTCTRLA &= USB_INTLVL_gm; + 559a: e0 ec ldi r30, 0xC0 ; 192 + 559c: f4 e0 ldi r31, 0x04 ; 4 + 559e: 80 85 ldd r24, Z+8 ; 0x08 + 55a0: 83 70 andi r24, 0x03 ; 3 + 55a2: 80 87 std Z+8, r24 ; 0x08 + USB.INTCTRLB = 0; + 55a4: 11 86 std Z+9, r1 ; 0x09 + 55a6: 08 95 ret + +000055a8 : +} + +void USB_INT_ClearAllInterrupts(void) +{ + USB.INTFLAGSACLR = 0xFF; + 55a8: e0 ec ldi r30, 0xC0 ; 192 + 55aa: f4 e0 ldi r31, 0x04 ; 4 + 55ac: 8f ef ldi r24, 0xFF ; 255 + 55ae: 82 87 std Z+10, r24 ; 0x0a + USB.INTFLAGSBCLR = 0xFF; + 55b0: 84 87 std Z+12, r24 ; 0x0c + 55b2: 08 95 ret + +000055b4 <__vector_125>: +} + +ISR(USB_BUSEVENT_vect) +{ + 55b4: 1f 92 push r1 + 55b6: 0f 92 push r0 + 55b8: 0f b6 in r0, 0x3f ; 63 + 55ba: 0f 92 push r0 + 55bc: 11 24 eor r1, r1 + 55be: 2f 93 push r18 + 55c0: 3f 93 push r19 + 55c2: 4f 93 push r20 + 55c4: 5f 93 push r21 + 55c6: 6f 93 push r22 + 55c8: 7f 93 push r23 + 55ca: 8f 93 push r24 + 55cc: 9f 93 push r25 + 55ce: af 93 push r26 + 55d0: bf 93 push r27 + 55d2: ef 93 push r30 + 55d4: 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); + 55d6: 80 91 ca 04 lds r24, 0x04CA + #if !defined(NO_SOF_EVENTS) + if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) + 55da: 87 fd sbrc r24, 7 + 55dc: 4d c0 rjmp .+154 ; 0x5678 <__vector_125+0xc4> + static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) + { + switch (Interrupt) + { + case USB_INT_BUSEVENTI_Suspend: + return ((USB.INTFLAGSACLR & USB_SUSPENDIF_bm) ? true : false); + 55de: 80 91 ca 04 lds r24, 0x04CA + + EVENT_USB_Device_StartOfFrame(); + } + #endif + + if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) + 55e2: 86 fd sbrc r24, 6 + 55e4: 41 c0 rjmp .+130 ; 0x5668 <__vector_125+0xb4> + case USB_INT_BUSEVENTI_Resume: + return ((USB.INTFLAGSACLR & USB_RESUMEIF_bm) ? true : false); + 55e6: 80 91 ca 04 lds r24, 0x04CA + USB_DeviceState = DEVICE_STATE_Suspended; + EVENT_USB_Device_Suspend(); + #endif + } + + if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Resume)) + 55ea: 85 ff sbrs r24, 5 + 55ec: 0c c0 rjmp .+24 ; 0x5606 <__vector_125+0x52> + { + case USB_INT_BUSEVENTI_Suspend: + USB.INTFLAGSACLR = USB_SUSPENDIF_bm; + break; + case USB_INT_BUSEVENTI_Resume: + USB.INTFLAGSACLR = USB_RESUMEIF_bm; + 55ee: 80 e2 ldi r24, 0x20 ; 32 + 55f0: 80 93 ca 04 sts 0x04CA, r24 + { + USB_INT_Clear(USB_INT_BUSEVENTI_Resume); + + if (USB_Device_ConfigurationNumber) + 55f4: 80 91 3c 2b lds r24, 0x2B3C + 55f8: 88 23 and r24, r24 + 55fa: 71 f1 breq .+92 ; 0x5658 <__vector_125+0xa4> + USB_DeviceState = DEVICE_STATE_Configured; + 55fc: 84 e0 ldi r24, 0x04 ; 4 + 55fe: 80 93 40 2b sts 0x2B40, r24 + else + USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; + + #if !defined(NO_LIMITED_CONTROLLER_CONNECT) + EVENT_USB_Device_Connect(); + 5602: 0e 94 41 11 call 0x2282 ; 0x2282 + 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); + 5606: 80 91 ca 04 lds r24, 0x04CA + #else + EVENT_USB_Device_WakeUp(); + #endif + } + + if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Reset)) + 560a: 84 ff sbrs r24, 4 + 560c: 14 c0 rjmp .+40 ; 0x5636 <__vector_125+0x82> + break; + case USB_INT_BUSEVENTI_Resume: + USB.INTFLAGSACLR = USB_RESUMEIF_bm; + break; + case USB_INT_BUSEVENTI_Reset: + USB.INTFLAGSACLR = USB_RSTIF_bm; + 560e: 80 e1 ldi r24, 0x10 ; 16 + 5610: 80 93 ca 04 sts 0x04CA, r24 + { + USB_INT_Clear(USB_INT_BUSEVENTI_Reset); + + USB_DeviceState = DEVICE_STATE_Default; + 5614: 82 e0 ldi r24, 0x02 ; 2 + 5616: 80 93 40 2b sts 0x2B40, r24 + USB_Device_ConfigurationNumber = 0; + 561a: 10 92 3c 2b sts 0x2B3C, r1 + } + + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE; + static inline void USB_Device_EnableDeviceAddress(const uint8_t Address) + { + USB.ADDR = Address; + 561e: 10 92 c3 04 sts 0x04C3, r1 + + USB_Device_EnableDeviceAddress(0); + + Endpoint_ClearEndpoints(); + 5622: b6 de rcall .-660 ; 0x5390 + EPConfigMask |= USB_EP_TYPE_BULK_gc; + break; + } + + if (Type == EP_TYPE_CONTROL) + Endpoint_ConfigureEndpoint_PRV(Address ^ ENDPOINT_DIR_IN, EPConfigMask, Size); + 5624: 48 e0 ldi r20, 0x08 ; 8 + 5626: 68 e4 ldi r22, 0x48 ; 72 + 5628: 80 e8 ldi r24, 0x80 ; 128 + 562a: ef dd rcall .-1058 ; 0x520a + + return Endpoint_ConfigureEndpoint_PRV(Address, EPConfigMask, Size); + 562c: 48 e0 ldi r20, 0x08 ; 8 + 562e: 68 e4 ldi r22, 0x48 ; 72 + 5630: 80 e0 ldi r24, 0x00 ; 0 + 5632: eb dd rcall .-1066 ; 0x520a + Endpoint_ConfigureEndpoint(ENDPOINT_CONTROLEP, EP_TYPE_CONTROL, + USB_Device_ControlEndpointSize, 1); + + EVENT_USB_Device_Reset(); + 5634: 23 db rcall .-2490 ; 0x4c7c + } +} + 5636: ff 91 pop r31 + 5638: ef 91 pop r30 + 563a: bf 91 pop r27 + 563c: af 91 pop r26 + 563e: 9f 91 pop r25 + 5640: 8f 91 pop r24 + 5642: 7f 91 pop r23 + 5644: 6f 91 pop r22 + 5646: 5f 91 pop r21 + 5648: 4f 91 pop r20 + 564a: 3f 91 pop r19 + 564c: 2f 91 pop r18 + 564e: 0f 90 pop r0 + 5650: 0f be out 0x3f, r0 ; 63 + 5652: 0f 90 pop r0 + 5654: 1f 90 pop r1 + 5656: 18 95 reti + } + + static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT; + static inline bool USB_Device_IsAddressSet(void) + { + return ((USB.ADDR != 0) ? true : false); + 5658: 80 91 c3 04 lds r24, 0x04C3 + USB_INT_Clear(USB_INT_BUSEVENTI_Resume); + + if (USB_Device_ConfigurationNumber) + USB_DeviceState = DEVICE_STATE_Configured; + else + USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; + 565c: 81 11 cpse r24, r1 + 565e: 15 c0 rjmp .+42 ; 0x568a <__vector_125+0xd6> + 5660: 81 e0 ldi r24, 0x01 ; 1 + 5662: 80 93 40 2b sts 0x2B40, r24 + 5666: cd cf rjmp .-102 ; 0x5602 <__vector_125+0x4e> + static inline void USB_INT_Clear(const uint8_t Interrupt) + { + switch (Interrupt) + { + case USB_INT_BUSEVENTI_Suspend: + USB.INTFLAGSACLR = USB_SUSPENDIF_bm; + 5668: 80 e4 ldi r24, 0x40 ; 64 + 566a: 80 93 ca 04 sts 0x04CA, r24 + if (USB_INT_HasOccurred(USB_INT_BUSEVENTI_Suspend)) + { + USB_INT_Clear(USB_INT_BUSEVENTI_Suspend); + + #if !defined(NO_LIMITED_CONTROLLER_CONNECT) + USB_DeviceState = DEVICE_STATE_Unattached; + 566e: 10 92 40 2b sts 0x2B40, r1 + EVENT_USB_Device_Disconnect(); + 5672: 0e 94 44 11 call 0x2288 ; 0x2288 + 5676: b7 cf rjmp .-146 ; 0x55e6 <__vector_125+0x32> + switch (Interrupt) + { + case USB_INT_BUSEVENTI: + return ((USB.INTCTRLA & USB_BUSEVIE_bm) ? true : false); + case USB_INT_SOFI: + return ((USB.INTCTRLA & USB_SOFIE_bm) ? true : false); + 5678: 80 91 c8 04 lds r24, 0x04C8 +} + +ISR(USB_BUSEVENT_vect) +{ + #if !defined(NO_SOF_EVENTS) + if (USB_INT_HasOccurred(USB_INT_SOFI) && USB_INT_IsEnabled(USB_INT_SOFI)) + 567c: 87 ff sbrs r24, 7 + 567e: af cf rjmp .-162 ; 0x55de <__vector_125+0x2a> + break; + case USB_INT_BUSEVENTI_Reset: + USB.INTFLAGSACLR = USB_RSTIF_bm; + break; + case USB_INT_SOFI: + USB.INTFLAGSACLR = USB_SOFIF_bm; + 5680: 80 e8 ldi r24, 0x80 ; 128 + 5682: 80 93 ca 04 sts 0x04CA, r24 + { + USB_INT_Clear(USB_INT_SOFI); + + EVENT_USB_Device_StartOfFrame(); + 5686: fa da rcall .-2572 ; 0x4c7c + 5688: aa cf rjmp .-172 ; 0x55de <__vector_125+0x2a> + USB_INT_Clear(USB_INT_BUSEVENTI_Resume); + + if (USB_Device_ConfigurationNumber) + USB_DeviceState = DEVICE_STATE_Configured; + else + USB_DeviceState = (USB_Device_IsAddressSet()) ? DEVICE_STATE_Addressed : DEVICE_STATE_Powered; + 568a: 83 e0 ldi r24, 0x03 ; 3 + 568c: ea cf rjmp .-44 ; 0x5662 <__vector_125+0xae> + +0000568e : + +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); + 568e: cf 93 push r28 + 5690: df 93 push r29 + 5692: ec 01 movw r28, r24 + 5694: 40 96 adiw r24, 0x10 ; 16 + 5696: fc 01 movw r30, r24 + 5698: 8b e0 ldi r24, 0x0B ; 11 + 569a: df 01 movw r26, r30 + 569c: 1d 92 st X+, r1 + 569e: 8a 95 dec r24 + 56a0: e9 f7 brne .-6 ; 0x569c + 56a2: 82 e0 ldi r24, 0x02 ; 2 + 56a4: 8c 83 std Y+4, r24 ; 0x04 + 56a6: 89 87 std Y+9, r24 ; 0x09 + 56a8: 83 e0 ldi r24, 0x03 ; 3 + 56aa: 8e 87 std Y+14, r24 ; 0x0e + 56ac: 61 e0 ldi r22, 0x01 ; 1 + 56ae: ce 01 movw r24, r28 + 56b0: 01 96 adiw r24, 0x01 ; 1 + 56b2: f8 dd rcall .-1040 ; 0x52a4 + 56b4: 81 11 cpse r24, r1 + 56b6: 04 c0 rjmp .+8 ; 0x56c0 + 56b8: 80 e0 ldi r24, 0x00 ; 0 + 56ba: df 91 pop r29 + 56bc: cf 91 pop r28 + 56be: 08 95 ret + 56c0: 61 e0 ldi r22, 0x01 ; 1 + 56c2: ce 01 movw r24, r28 + 56c4: 06 96 adiw r24, 0x06 ; 6 + 56c6: ee dd rcall .-1060 ; 0x52a4 + 56c8: 88 23 and r24, r24 + 56ca: b1 f3 breq .-20 ; 0x56b8 + 56cc: 61 e0 ldi r22, 0x01 ; 1 + 56ce: ce 01 movw r24, r28 + 56d0: 0b 96 adiw r24, 0x0b ; 11 + 56d2: df 91 pop r29 + 56d4: cf 91 pop r28 + 56d6: e6 cd rjmp .-1076 ; 0x52a4 + +000056d8 : + 56d8: cf 93 push r28 + 56da: df 93 push r29 + 56dc: d6 2f mov r29, r22 + 56de: c7 2f mov r28, r23 + 56e0: 20 91 40 2b lds r18, 0x2B40 + 56e4: 24 30 cpi r18, 0x04 ; 4 + 56e6: 21 f0 breq .+8 ; 0x56f0 + 56e8: 82 e0 ldi r24, 0x02 ; 2 + 56ea: df 91 pop r29 + 56ec: cf 91 pop r28 + 56ee: 08 95 ret + 56f0: fc 01 movw r30, r24 + 56f2: 44 89 ldd r20, Z+20 ; 0x14 + 56f4: 55 89 ldd r21, Z+21 ; 0x15 + 56f6: 66 89 ldd r22, Z+22 ; 0x16 + 56f8: 77 89 ldd r23, Z+23 ; 0x17 + 56fa: 45 2b or r20, r21 + 56fc: 46 2b or r20, r22 + 56fe: 47 2b or r20, r23 + 5700: 99 f3 breq .-26 ; 0x56e8 + 5702: 81 81 ldd r24, Z+1 ; 0x01 + 5704: c3 dc rcall .-1658 ; 0x508c + 5706: ad 2f mov r26, r29 + 5708: bc 2f mov r27, r28 + 570a: fd 01 movw r30, r26 + 570c: 01 90 ld r0, Z+ + 570e: 00 20 and r0, r0 + 5710: e9 f7 brne .-6 ; 0x570c + 5712: bf 01 movw r22, r30 + 5714: 61 50 subi r22, 0x01 ; 1 + 5716: 71 09 sbc r23, r1 + 5718: 6a 1b sub r22, r26 + 571a: 7b 0b sbc r23, r27 + 571c: 40 e0 ldi r20, 0x00 ; 0 + 571e: 50 e0 ldi r21, 0x00 ; 0 + 5720: 8d 2f mov r24, r29 + 5722: 9c 2f mov r25, r28 + 5724: df 91 pop r29 + 5726: cf 91 pop r28 + 5728: bf ca rjmp .-2690 ; 0x4ca8 + +0000572a : + 572a: ef 92 push r14 + 572c: ff 92 push r15 + 572e: 0f 93 push r16 + 5730: 1f 93 push r17 + 5732: cf 93 push r28 + 5734: df 93 push r29 + 5736: eb 01 movw r28, r22 + 5738: 7a 01 movw r14, r20 + 573a: 20 91 40 2b lds r18, 0x2B40 + 573e: 24 30 cpi r18, 0x04 ; 4 + 5740: 41 f0 breq .+16 ; 0x5752 + 5742: 82 e0 ldi r24, 0x02 ; 2 + 5744: df 91 pop r29 + 5746: cf 91 pop r28 + 5748: 1f 91 pop r17 + 574a: 0f 91 pop r16 + 574c: ff 90 pop r15 + 574e: ef 90 pop r14 + 5750: 08 95 ret + 5752: fc 01 movw r30, r24 + 5754: 04 89 ldd r16, Z+20 ; 0x14 + 5756: 15 89 ldd r17, Z+21 ; 0x15 + 5758: 26 89 ldd r18, Z+22 ; 0x16 + 575a: 37 89 ldd r19, Z+23 ; 0x17 + 575c: 01 2b or r16, r17 + 575e: 02 2b or r16, r18 + 5760: 03 2b or r16, r19 + 5762: 79 f3 breq .-34 ; 0x5742 + 5764: 81 81 ldd r24, Z+1 ; 0x01 + 5766: 92 dc rcall .-1756 ; 0x508c + 5768: 40 e0 ldi r20, 0x00 ; 0 + 576a: 50 e0 ldi r21, 0x00 ; 0 + 576c: b7 01 movw r22, r14 + 576e: ce 01 movw r24, r28 + 5770: df 91 pop r29 + 5772: cf 91 pop r28 + 5774: 1f 91 pop r17 + 5776: 0f 91 pop r16 + 5778: ff 90 pop r15 + 577a: ef 90 pop r14 + 577c: 95 ca rjmp .-2774 ; 0x4ca8 + +0000577e : + 577e: 0f 93 push r16 + 5780: 1f 93 push r17 + 5782: cf 93 push r28 + 5784: df 93 push r29 + 5786: 1f 92 push r1 + 5788: cd b7 in r28, 0x3d ; 61 + 578a: de b7 in r29, 0x3e ; 62 + 578c: 20 91 40 2b lds r18, 0x2B40 + 5790: 24 30 cpi r18, 0x04 ; 4 + 5792: 39 f0 breq .+14 ; 0x57a2 + 5794: 82 e0 ldi r24, 0x02 ; 2 + 5796: 0f 90 pop r0 + 5798: df 91 pop r29 + 579a: cf 91 pop r28 + 579c: 1f 91 pop r17 + 579e: 0f 91 pop r16 + 57a0: 08 95 ret + 57a2: fc 01 movw r30, r24 + 57a4: 04 89 ldd r16, Z+20 ; 0x14 + 57a6: 15 89 ldd r17, Z+21 ; 0x15 + 57a8: 26 89 ldd r18, Z+22 ; 0x16 + 57aa: 37 89 ldd r19, Z+23 ; 0x17 + 57ac: 01 2b or r16, r17 + 57ae: 02 2b or r16, r18 + 57b0: 03 2b or r16, r19 + 57b2: 81 f3 breq .-32 ; 0x5794 + 57b4: 81 81 ldd r24, Z+1 ; 0x01 + 57b6: 69 83 std Y+1, r22 ; 0x01 + 57b8: 69 dc rcall .-1838 ; 0x508c + 57ba: 20 91 49 2b lds r18, 0x2B49 + 57be: 30 91 4a 2b lds r19, 0x2B4A + 57c2: f9 01 movw r30, r18 + 57c4: ef 5b subi r30, 0xBF ; 191 + 57c6: ff 4f sbci r31, 0xFF ; 255 + 57c8: 90 81 ld r25, Z + 57ca: f9 01 movw r30, r18 + 57cc: e0 5c subi r30, 0xC0 ; 192 + 57ce: ff 4f sbci r31, 0xFF ; 255 + 57d0: 80 81 ld r24, Z + 57d2: 69 81 ldd r22, Y+1 ; 0x01 + 57d4: 98 17 cp r25, r24 + 57d6: 30 f0 brcs .+12 ; 0x57e4 + 57d8: 69 83 std Y+1, r22 ; 0x01 + 57da: 12 dc rcall .-2012 ; 0x5000 + 57dc: 27 de rcall .-946 ; 0x542c + 57de: 69 81 ldd r22, Y+1 ; 0x01 + 57e0: 81 11 cpse r24, r1 + 57e2: d9 cf rjmp .-78 ; 0x5796 + 57e4: 86 2f mov r24, r22 + 57e6: 43 dc rcall .-1914 ; 0x506e + 57e8: 80 e0 ldi r24, 0x00 ; 0 + 57ea: d5 cf rjmp .-86 ; 0x5796 + +000057ec : + 57ec: 0f 93 push r16 + 57ee: 1f 93 push r17 + 57f0: cf 93 push r28 + 57f2: df 93 push r29 + 57f4: 1f 92 push r1 + 57f6: cd b7 in r28, 0x3d ; 61 + 57f8: de b7 in r29, 0x3e ; 62 + 57fa: 20 91 40 2b lds r18, 0x2B40 + 57fe: 24 30 cpi r18, 0x04 ; 4 + 5800: 39 f0 breq .+14 ; 0x5810 + 5802: 82 e0 ldi r24, 0x02 ; 2 + 5804: 0f 90 pop r0 + 5806: df 91 pop r29 + 5808: cf 91 pop r28 + 580a: 1f 91 pop r17 + 580c: 0f 91 pop r16 + 580e: 08 95 ret + 5810: fc 01 movw r30, r24 + 5812: 44 89 ldd r20, Z+20 ; 0x14 + 5814: 55 89 ldd r21, Z+21 ; 0x15 + 5816: 66 89 ldd r22, Z+22 ; 0x16 + 5818: 77 89 ldd r23, Z+23 ; 0x17 + 581a: 45 2b or r20, r21 + 581c: 46 2b or r20, r22 + 581e: 47 2b or r20, r23 + 5820: 81 f3 breq .-32 ; 0x5802 + 5822: 81 81 ldd r24, Z+1 ; 0x01 + 5824: 33 dc rcall .-1946 ; 0x508c + 5826: 80 91 4d 2b lds r24, 0x2B4D + 582a: 20 91 49 2b lds r18, 0x2B49 + 582e: 30 91 4a 2b lds r19, 0x2B4A + 5832: f9 01 movw r30, r18 + 5834: 87 fd sbrc r24, 7 + 5836: 1d c0 rjmp .+58 ; 0x5872 + 5838: e0 5c subi r30, 0xC0 ; 192 + 583a: ff 4f sbci r31, 0xFF ; 255 + 583c: 80 81 ld r24, Z + 583e: f9 01 movw r30, r18 + 5840: ef 5b subi r30, 0xBF ; 191 + 5842: ff 4f sbci r31, 0xFF ; 255 + 5844: 40 81 ld r20, Z + 5846: 90 e0 ldi r25, 0x00 ; 0 + 5848: 84 1b sub r24, r20 + 584a: 91 09 sbc r25, r1 + 584c: 89 2b or r24, r25 + 584e: 11 f4 brne .+4 ; 0x5854 + 5850: 80 e0 ldi r24, 0x00 ; 0 + 5852: d8 cf rjmp .-80 ; 0x5804 + 5854: 00 81 ld r16, Z + 5856: f9 01 movw r30, r18 + 5858: e0 5c subi r30, 0xC0 ; 192 + 585a: ff 4f sbci r31, 0xFF ; 255 + 585c: 10 81 ld r17, Z + 585e: d0 db rcall .-2144 ; 0x5000 + 5860: 01 17 cp r16, r17 + 5862: b0 f3 brcs .-20 ; 0x5850 + 5864: e3 dd rcall .-1082 ; 0x542c + 5866: 81 11 cpse r24, r1 + 5868: cd cf rjmp .-102 ; 0x5804 + 586a: 89 83 std Y+1, r24 ; 0x01 + 586c: c9 db rcall .-2158 ; 0x5000 + 586e: 89 81 ldd r24, Y+1 ; 0x01 + 5870: c9 cf rjmp .-110 ; 0x5804 + 5872: ef 5b subi r30, 0xBF ; 191 + 5874: ff 4f sbci r31, 0xFF ; 255 + 5876: 80 81 ld r24, Z + 5878: 90 e0 ldi r25, 0x00 ; 0 + 587a: e8 cf rjmp .-48 ; 0x584c + +0000587c : + 587c: cf 93 push r28 + 587e: df 93 push r29 + 5880: ec 01 movw r28, r24 + 5882: 80 91 40 2b lds r24, 0x2B40 + 5886: 84 30 cpi r24, 0x04 ; 4 + 5888: 19 f0 breq .+6 ; 0x5890 + 588a: df 91 pop r29 + 588c: cf 91 pop r28 + 588e: 08 95 ret + 5890: 4c 89 ldd r20, Y+20 ; 0x14 + 5892: 5d 89 ldd r21, Y+21 ; 0x15 + 5894: 6e 89 ldd r22, Y+22 ; 0x16 + 5896: 7f 89 ldd r23, Y+23 ; 0x17 + 5898: 45 2b or r20, r21 + 589a: 46 2b or r20, r22 + 589c: 47 2b or r20, r23 + 589e: a9 f3 breq .-22 ; 0x588a + 58a0: 89 81 ldd r24, Y+1 ; 0x01 + 58a2: f4 db rcall .-2072 ; 0x508c + 58a4: a6 dc rcall .-1716 ; 0x51f2 + 58a6: 88 23 and r24, r24 + 58a8: 81 f3 breq .-32 ; 0x588a + 58aa: ce 01 movw r24, r28 + 58ac: df 91 pop r29 + 58ae: cf 91 pop r28 + 58b0: 9d cf rjmp .-198 ; 0x57ec + +000058b2 : + 58b2: cf 93 push r28 + 58b4: df 93 push r29 + 58b6: 20 91 40 2b lds r18, 0x2B40 + 58ba: 24 30 cpi r18, 0x04 ; 4 + 58bc: c1 f5 brne .+112 ; 0x592e + 58be: fc 01 movw r30, r24 + 58c0: 44 89 ldd r20, Z+20 ; 0x14 + 58c2: 55 89 ldd r21, Z+21 ; 0x15 + 58c4: 66 89 ldd r22, Z+22 ; 0x16 + 58c6: 77 89 ldd r23, Z+23 ; 0x17 + 58c8: 45 2b or r20, r21 + 58ca: 46 2b or r20, r22 + 58cc: 47 2b or r20, r23 + 58ce: 79 f1 breq .+94 ; 0x592e + 58d0: 86 81 ldd r24, Z+6 ; 0x06 + 58d2: dc db rcall .-2120 ; 0x508c + 58d4: 75 dc rcall .-1814 ; 0x51c0 + 58d6: 88 23 and r24, r24 + 58d8: 51 f1 breq .+84 ; 0x592e + 58da: 80 91 4d 2b lds r24, 0x2B4D + 58de: 87 fd sbrc r24, 7 + 58e0: 3d c0 rjmp .+122 ; 0x595c + 58e2: 80 91 49 2b lds r24, 0x2B49 + 58e6: 90 91 4a 2b lds r25, 0x2B4A + 58ea: fc 01 movw r30, r24 + 58ec: e0 5c subi r30, 0xC0 ; 192 + 58ee: ff 4f sbci r31, 0xFF ; 255 + 58f0: 20 81 ld r18, Z + 58f2: fc 01 movw r30, r24 + 58f4: ef 5b subi r30, 0xBF ; 191 + 58f6: ff 4f sbci r31, 0xFF ; 255 + 58f8: 40 81 ld r20, Z + 58fa: 30 e0 ldi r19, 0x00 ; 0 + 58fc: 24 1b sub r18, r20 + 58fe: 31 09 sbc r19, r1 + 5900: 23 2b or r18, r19 + 5902: d9 f4 brne .+54 ; 0x593a + 5904: cf ef ldi r28, 0xFF ; 255 + 5906: df ef ldi r29, 0xFF ; 255 + 5908: 20 91 4d 2b lds r18, 0x2B4D + 590c: 27 fd sbrc r18, 7 + 590e: 23 c0 rjmp .+70 ; 0x5956 + 5910: dc 01 movw r26, r24 + 5912: a0 5c subi r26, 0xC0 ; 192 + 5914: bf 4f sbci r27, 0xFF ; 255 + 5916: 8c 91 ld r24, X + 5918: 20 81 ld r18, Z + 591a: 90 e0 ldi r25, 0x00 ; 0 + 591c: 82 1b sub r24, r18 + 591e: 91 09 sbc r25, r1 + 5920: 89 2b or r24, r25 + 5922: 39 f4 brne .+14 ; 0x5932 + 5924: 86 db rcall .-2292 ; 0x5032 + 5926: ce 01 movw r24, r28 + 5928: df 91 pop r29 + 592a: cf 91 pop r28 + 592c: 08 95 ret + 592e: cf ef ldi r28, 0xFF ; 255 + 5930: df ef ldi r29, 0xFF ; 255 + 5932: ce 01 movw r24, r28 + 5934: df 91 pop r29 + 5936: cf 91 pop r28 + 5938: 08 95 ret + 593a: 8a db rcall .-2284 ; 0x5050 + 593c: c8 2f mov r28, r24 + 593e: d0 e0 ldi r29, 0x00 ; 0 + 5940: 80 91 49 2b lds r24, 0x2B49 + 5944: 90 91 4a 2b lds r25, 0x2B4A + 5948: fc 01 movw r30, r24 + 594a: ef 5b subi r30, 0xBF ; 191 + 594c: ff 4f sbci r31, 0xFF ; 255 + 594e: 20 91 4d 2b lds r18, 0x2B4D + 5952: 27 ff sbrs r18, 7 + 5954: dd cf rjmp .-70 ; 0x5910 + 5956: 80 81 ld r24, Z + 5958: 90 e0 ldi r25, 0x00 ; 0 + 595a: e2 cf rjmp .-60 ; 0x5920 + 595c: 80 91 49 2b lds r24, 0x2B49 + 5960: 90 91 4a 2b lds r25, 0x2B4A + 5964: fc 01 movw r30, r24 + 5966: ef 5b subi r30, 0xBF ; 191 + 5968: ff 4f sbci r31, 0xFF ; 255 + 596a: 20 81 ld r18, Z + 596c: 30 e0 ldi r19, 0x00 ; 0 + 596e: c8 cf rjmp .-112 ; 0x5900 + +00005970 : + return ReceivedByte; +} +#endif + +void CDC_Device_Event_Stub(void) +{ + 5970: 08 95 ret + +00005972 : +#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) +{ + 5972: ff 92 push r15 + 5974: 0f 93 push r16 + 5976: 1f 93 push r17 + 5978: cf 93 push r28 + 597a: df 93 push r29 + 597c: ec 01 movw r28, r24 + if (!(Endpoint_IsSETUPReceived())) + 597e: 07 dc rcall .-2034 ; 0x518e + 5980: 88 23 and r24, r24 + 5982: 49 f0 breq .+18 ; 0x5996 + return; + + if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) + 5984: 88 81 ld r24, Y + 5986: 90 e0 ldi r25, 0x00 ; 0 + 5988: 20 91 45 2b lds r18, 0x2B45 + 598c: 30 91 46 2b lds r19, 0x2B46 + 5990: 28 17 cp r18, r24 + 5992: 39 07 cpc r19, r25 + 5994: 31 f0 breq .+12 ; 0x59a2 + EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); + } + + break; + } +} + 5996: df 91 pop r29 + 5998: cf 91 pop r28 + 599a: 1f 91 pop r17 + 599c: 0f 91 pop r16 + 599e: ff 90 pop r15 + 59a0: 08 95 ret + return; + + if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) + return; + + switch (USB_ControlRequest.bRequest) + 59a2: 80 91 42 2b lds r24, 0x2B42 + 59a6: 81 32 cpi r24, 0x21 ; 33 + 59a8: 09 f4 brne .+2 ; 0x59ac + 59aa: 4b c0 rjmp .+150 ; 0x5a42 + 59ac: 08 f0 brcs .+2 ; 0x59b0 + 59ae: 33 c0 rjmp .+102 ; 0x5a16 + 59b0: 80 32 cpi r24, 0x20 ; 32 + 59b2: 89 f7 brne .-30 ; 0x5996 + Endpoint_ClearStatusStage(); + } + + break; + case CDC_REQ_SetLineEncoding: + if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) + 59b4: 80 91 41 2b lds r24, 0x2B41 + 59b8: 81 32 cpi r24, 0x21 ; 33 + 59ba: 69 f7 brne .-38 ; 0x5996 + { + Endpoint_ClearSETUP(); + 59bc: bc db rcall .-2184 ; 0x5136 + + while (!(Endpoint_IsOUTReceived())) + 59be: 04 c0 rjmp .+8 ; 0x59c8 + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + 59c0: 80 91 40 2b lds r24, 0x2B40 + 59c4: 88 23 and r24, r24 + 59c6: 39 f3 breq .-50 ; 0x5996 + case CDC_REQ_SetLineEncoding: + if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) + { + Endpoint_ClearSETUP(); + + while (!(Endpoint_IsOUTReceived())) + 59c8: fb db rcall .-2058 ; 0x51c0 + 59ca: 88 23 and r24, r24 + 59cc: c9 f3 breq .-14 ; 0x59c0 + * \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(); + 59ce: 40 db rcall .-2432 ; 0x5050 + 59d0: 08 2f mov r16, r24 + uint32_t Byte1 = Endpoint_Read_8(); + 59d2: 3e db rcall .-2436 ; 0x5050 + 59d4: 18 2f mov r17, r24 + uint32_t Byte2 = Endpoint_Read_8(); + 59d6: 3c db rcall .-2440 ; 0x5050 + 59d8: f8 2e mov r15, r24 + uint32_t Byte3 = Endpoint_Read_8(); + 59da: 3a db rcall .-2444 ; 0x5050 + 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(); + 59dc: 4f 2d mov r20, r15 + 59de: 50 e0 ldi r21, 0x00 ; 0 + 59e0: 60 e0 ldi r22, 0x00 ; 0 + 59e2: 70 e0 ldi r23, 0x00 ; 0 + uint32_t Byte3 = Endpoint_Read_8(); + + return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0); + 59e4: ba 01 movw r22, r20 + 59e6: 55 27 eor r21, r21 + 59e8: 44 27 eor r20, r20 + 59ea: 78 2b or r23, r24 + 59ec: 40 2b or r20, r16 + 59ee: 51 2b or r21, r17 + { + if (USB_DeviceState == DEVICE_STATE_Unattached) + return; + } + + CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE(); + 59f0: 4c 8b std Y+20, r20 ; 0x14 + 59f2: 5d 8b std Y+21, r21 ; 0x15 + 59f4: 6e 8b std Y+22, r22 ; 0x16 + 59f6: 7f 8b std Y+23, r23 ; 0x17 + CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8(); + 59f8: 2b db rcall .-2474 ; 0x5050 + 59fa: 88 8f std Y+24, r24 ; 0x18 + CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8(); + 59fc: 29 db rcall .-2478 ; 0x5050 + 59fe: 89 8f std Y+25, r24 ; 0x19 + CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); + 5a00: 27 db rcall .-2482 ; 0x5050 + 5a02: 8a 8f std Y+26, r24 ; 0x1a + + Endpoint_ClearOUT(); + 5a04: 16 db rcall .-2516 ; 0x5032 + Endpoint_ClearStatusStage(); + 5a06: fc dc rcall .-1544 ; 0x5400 + + EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); + 5a08: ce 01 movw r24, r28 + EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); + } + + break; + } +} + 5a0a: df 91 pop r29 + 5a0c: cf 91 pop r28 + 5a0e: 1f 91 pop r17 + 5a10: 0f 91 pop r16 + 5a12: ff 90 pop r15 + CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); + + Endpoint_ClearOUT(); + Endpoint_ClearStatusStage(); + + EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); + 5a14: ad cf rjmp .-166 ; 0x5970 + return; + + if (USB_ControlRequest.wIndex != CDCInterfaceInfo->Config.ControlInterfaceNumber) + return; + + switch (USB_ControlRequest.bRequest) + 5a16: 82 32 cpi r24, 0x22 ; 34 + 5a18: 09 f4 brne .+2 ; 0x5a1c + 5a1a: 34 c0 rjmp .+104 ; 0x5a84 + 5a1c: 83 32 cpi r24, 0x23 ; 35 + 5a1e: 09 f0 breq .+2 ; 0x5a22 + 5a20: ba cf rjmp .-140 ; 0x5996 + EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); + } + + break; + case CDC_REQ_SendBreak: + if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) + 5a22: 80 91 41 2b lds r24, 0x2B41 + 5a26: 81 32 cpi r24, 0x21 ; 33 + 5a28: 09 f0 breq .+2 ; 0x5a2c + 5a2a: b5 cf rjmp .-150 ; 0x5996 + { + Endpoint_ClearSETUP(); + 5a2c: 84 db rcall .-2296 ; 0x5136 + Endpoint_ClearStatusStage(); + 5a2e: e8 dc rcall .-1584 ; 0x5400 + + EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); + 5a30: 60 91 43 2b lds r22, 0x2B43 + 5a34: ce 01 movw r24, r28 + } + + break; + } +} + 5a36: df 91 pop r29 + 5a38: cf 91 pop r28 + 5a3a: 1f 91 pop r17 + 5a3c: 0f 91 pop r16 + 5a3e: 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); + 5a40: 97 cf rjmp .-210 ; 0x5970 + return; + + switch (USB_ControlRequest.bRequest) + { + case CDC_REQ_GetLineEncoding: + if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) + 5a42: 80 91 41 2b lds r24, 0x2B41 + 5a46: 81 3a cpi r24, 0xA1 ; 161 + 5a48: 09 f0 breq .+2 ; 0x5a4c + 5a4a: a5 cf rjmp .-182 ; 0x5996 + { + Endpoint_ClearSETUP(); + 5a4c: 74 db rcall .-2328 ; 0x5136 + + while (!(Endpoint_IsINReady())); + 5a4e: d1 db rcall .-2142 ; 0x51f2 + 5a50: 88 23 and r24, r24 + 5a52: e9 f3 breq .-6 ; 0x5a4e + + Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS); + 5a54: 8c 89 ldd r24, Y+20 ; 0x14 + 5a56: fd 88 ldd r15, Y+21 ; 0x15 + 5a58: 0e 89 ldd r16, Y+22 ; 0x16 + 5a5a: 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); + 5a5c: 08 db rcall .-2544 ; 0x506e + Endpoint_Write_8(Data >> 8); + 5a5e: 8f 2d mov r24, r15 + 5a60: 06 db rcall .-2548 ; 0x506e + Endpoint_Write_8(Data >> 16); + 5a62: 80 2f mov r24, r16 + 5a64: 04 db rcall .-2552 ; 0x506e + Endpoint_Write_8(Data >> 24); + 5a66: 81 2f mov r24, r17 + 5a68: 02 db rcall .-2556 ; 0x506e + Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat); + 5a6a: 88 8d ldd r24, Y+24 ; 0x18 + 5a6c: 00 db rcall .-2560 ; 0x506e + Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType); + 5a6e: 89 8d ldd r24, Y+25 ; 0x19 + 5a70: fe da rcall .-2564 ; 0x506e + Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits); + 5a72: 8a 8d ldd r24, Y+26 ; 0x1a + 5a74: fc da rcall .-2568 ; 0x506e + + Endpoint_ClearIN(); + 5a76: c4 da rcall .-2680 ; 0x5000 + EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); + } + + break; + } +} + 5a78: df 91 pop r29 + 5a7a: cf 91 pop r28 + 5a7c: 1f 91 pop r17 + 5a7e: 0f 91 pop r16 + 5a80: 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(); + 5a82: be cc rjmp .-1668 ; 0x5400 + EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); + } + + break; + case CDC_REQ_SetControlLineState: + if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) + 5a84: 80 91 41 2b lds r24, 0x2B41 + 5a88: 81 32 cpi r24, 0x21 ; 33 + 5a8a: 09 f0 breq .+2 ; 0x5a8e + 5a8c: 84 cf rjmp .-248 ; 0x5996 + { + Endpoint_ClearSETUP(); + 5a8e: 53 db rcall .-2394 ; 0x5136 + Endpoint_ClearStatusStage(); + 5a90: b7 dc rcall .-1682 ; 0x5400 + + CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; + 5a92: 80 91 43 2b lds r24, 0x2B43 + 5a96: 90 91 44 2b lds r25, 0x2B44 + 5a9a: 88 8b std Y+16, r24 ; 0x10 + 5a9c: 99 8b std Y+17, r25 ; 0x11 + + EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); + 5a9e: ce 01 movw r24, r28 + EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); + } + + break; + } +} + 5aa0: df 91 pop r29 + 5aa2: cf 91 pop r28 + 5aa4: 1f 91 pop r17 + 5aa6: 0f 91 pop r16 + 5aa8: ff 90 pop r15 + Endpoint_ClearSETUP(); + Endpoint_ClearStatusStage(); + + CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; + + EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo); + 5aaa: 62 cf rjmp .-316 ; 0x5970 + +00005aac <__mulshisi3>: + 5aac: b7 ff sbrs r27, 7 + 5aae: 04 c0 rjmp .+8 ; 0x5ab8 <__muluhisi3> + +00005ab0 <__mulohisi3>: + 5ab0: 03 d0 rcall .+6 ; 0x5ab8 <__muluhisi3> + 5ab2: 82 1b sub r24, r18 + 5ab4: 93 0b sbc r25, r19 + 5ab6: 08 95 ret + +00005ab8 <__muluhisi3>: + 5ab8: 09 d0 rcall .+18 ; 0x5acc <__umulhisi3> + 5aba: a5 9f mul r26, r21 + 5abc: 90 0d add r25, r0 + 5abe: b4 9f mul r27, r20 + 5ac0: 90 0d add r25, r0 + 5ac2: a4 9f mul r26, r20 + 5ac4: 80 0d add r24, r0 + 5ac6: 91 1d adc r25, r1 + 5ac8: 11 24 eor r1, r1 + 5aca: 08 95 ret + +00005acc <__umulhisi3>: + 5acc: a2 9f mul r26, r18 + 5ace: b0 01 movw r22, r0 + 5ad0: b3 9f mul r27, r19 + 5ad2: c0 01 movw r24, r0 + 5ad4: a3 9f mul r26, r19 + 5ad6: 01 d0 rcall .+2 ; 0x5ada <__umulhisi3+0xe> + 5ad8: b2 9f mul r27, r18 + 5ada: 70 0d add r23, r0 + 5adc: 81 1d adc r24, r1 + 5ade: 11 24 eor r1, r1 + 5ae0: 91 1d adc r25, r1 + 5ae2: 08 95 ret + +00005ae4 : + 5ae4: 8f 92 push r8 + 5ae6: 9f 92 push r9 + 5ae8: af 92 push r10 + 5aea: bf 92 push r11 + 5aec: cf 92 push r12 + 5aee: df 92 push r13 + 5af0: ef 92 push r14 + 5af2: ff 92 push r15 + 5af4: cf 93 push r28 + 5af6: df 93 push r29 + 5af8: ec 01 movw r28, r24 + 5afa: 68 81 ld r22, Y + 5afc: 79 81 ldd r23, Y+1 ; 0x01 + 5afe: 8a 81 ldd r24, Y+2 ; 0x02 + 5b00: 9b 81 ldd r25, Y+3 ; 0x03 + 5b02: 61 15 cp r22, r1 + 5b04: 71 05 cpc r23, r1 + 5b06: 81 05 cpc r24, r1 + 5b08: 91 05 cpc r25, r1 + 5b0a: 21 f4 brne .+8 ; 0x5b14 + 5b0c: 64 e2 ldi r22, 0x24 ; 36 + 5b0e: 79 ed ldi r23, 0xD9 ; 217 + 5b10: 8b e5 ldi r24, 0x5B ; 91 + 5b12: 97 e0 ldi r25, 0x07 ; 7 + 5b14: 2d e1 ldi r18, 0x1D ; 29 + 5b16: 33 ef ldi r19, 0xF3 ; 243 + 5b18: 41 e0 ldi r20, 0x01 ; 1 + 5b1a: 50 e0 ldi r21, 0x00 ; 0 + 5b1c: 48 d3 rcall .+1680 ; 0x61ae <__divmodsi4> + 5b1e: 49 01 movw r8, r18 + 5b20: 5a 01 movw r10, r20 + 5b22: 9b 01 movw r18, r22 + 5b24: ac 01 movw r20, r24 + 5b26: a7 ea ldi r26, 0xA7 ; 167 + 5b28: b1 e4 ldi r27, 0x41 ; 65 + 5b2a: c6 df rcall .-116 ; 0x5ab8 <__muluhisi3> + 5b2c: 6b 01 movw r12, r22 + 5b2e: 7c 01 movw r14, r24 + 5b30: ac ee ldi r26, 0xEC ; 236 + 5b32: b4 ef ldi r27, 0xF4 ; 244 + 5b34: a5 01 movw r20, r10 + 5b36: 94 01 movw r18, r8 + 5b38: bb df rcall .-138 ; 0x5ab0 <__mulohisi3> + 5b3a: c6 0e add r12, r22 + 5b3c: d7 1e adc r13, r23 + 5b3e: e8 1e adc r14, r24 + 5b40: f9 1e adc r15, r25 + 5b42: f7 fe sbrs r15, 7 + 5b44: 06 c0 rjmp .+12 ; 0x5b52 + 5b46: 81 e0 ldi r24, 0x01 ; 1 + 5b48: c8 1a sub r12, r24 + 5b4a: d1 08 sbc r13, r1 + 5b4c: e1 08 sbc r14, r1 + 5b4e: 80 e8 ldi r24, 0x80 ; 128 + 5b50: f8 0a sbc r15, r24 + 5b52: c8 82 st Y, r12 + 5b54: d9 82 std Y+1, r13 ; 0x01 + 5b56: ea 82 std Y+2, r14 ; 0x02 + 5b58: fb 82 std Y+3, r15 ; 0x03 + 5b5a: e8 94 clt + 5b5c: d7 f8 bld r13, 7 + 5b5e: ee 24 eor r14, r14 + 5b60: ff 24 eor r15, r15 + 5b62: c6 01 movw r24, r12 + 5b64: df 91 pop r29 + 5b66: cf 91 pop r28 + 5b68: ff 90 pop r15 + 5b6a: ef 90 pop r14 + 5b6c: df 90 pop r13 + 5b6e: cf 90 pop r12 + 5b70: bf 90 pop r11 + 5b72: af 90 pop r10 + 5b74: 9f 90 pop r9 + 5b76: 8f 90 pop r8 + 5b78: 08 95 ret + +00005b7a : + 5b7a: b4 cf rjmp .-152 ; 0x5ae4 + +00005b7c : + 5b7c: 8c e1 ldi r24, 0x1C ; 28 + 5b7e: 90 e2 ldi r25, 0x20 ; 32 + 5b80: b1 cf rjmp .-158 ; 0x5ae4 + +00005b82 : + 5b82: a0 e0 ldi r26, 0x00 ; 0 + 5b84: b0 e0 ldi r27, 0x00 ; 0 + 5b86: 80 93 1c 20 sts 0x201C, r24 + 5b8a: 90 93 1d 20 sts 0x201D, r25 + 5b8e: a0 93 1e 20 sts 0x201E, r26 + 5b92: b0 93 1f 20 sts 0x201F, r27 + 5b96: 08 95 ret + +00005b98 : + 5b98: fb 01 movw r30, r22 + 5b9a: dc 01 movw r26, r24 + 5b9c: 02 c0 rjmp .+4 ; 0x5ba2 + 5b9e: 05 90 lpm r0, Z+ + 5ba0: 0d 92 st X+, r0 + 5ba2: 41 50 subi r20, 0x01 ; 1 + 5ba4: 50 40 sbci r21, 0x00 ; 0 + 5ba6: d8 f7 brcc .-10 ; 0x5b9e + 5ba8: 08 95 ret + +00005baa : + 5baa: fb 01 movw r30, r22 + 5bac: dc 01 movw r26, r24 + 5bae: 8d 91 ld r24, X+ + 5bb0: 05 90 lpm r0, Z+ + 5bb2: 80 19 sub r24, r0 + 5bb4: 01 10 cpse r0, r1 + 5bb6: d9 f3 breq .-10 ; 0x5bae + 5bb8: 99 0b sbc r25, r25 + 5bba: 08 95 ret + +00005bbc : + 5bbc: fb 01 movw r30, r22 + 5bbe: dc 01 movw r26, r24 + 5bc0: 0d 90 ld r0, X+ + 5bc2: 00 20 and r0, r0 + 5bc4: e9 f7 brne .-6 ; 0x5bc0 + 5bc6: 11 97 sbiw r26, 0x01 ; 1 + 5bc8: 41 50 subi r20, 0x01 ; 1 + 5bca: 50 40 sbci r21, 0x00 ; 0 + 5bcc: 28 f0 brcs .+10 ; 0x5bd8 + 5bce: 05 90 lpm r0, Z+ + 5bd0: 00 20 and r0, r0 + 5bd2: 0d 92 st X+, r0 + 5bd4: c9 f7 brne .-14 ; 0x5bc8 + 5bd6: 08 95 ret + 5bd8: 1c 92 st X, r1 + 5bda: 08 95 ret + +00005bdc : + 5bdc: fb 01 movw r30, r22 + 5bde: dc 01 movw r26, r24 + 5be0: 41 50 subi r20, 0x01 ; 1 + 5be2: 50 40 sbci r21, 0x00 ; 0 + 5be4: 48 f0 brcs .+18 ; 0x5bf8 + 5be6: 05 90 lpm r0, Z+ + 5be8: 0d 92 st X+, r0 + 5bea: 00 20 and r0, r0 + 5bec: c9 f7 brne .-14 ; 0x5be0 + 5bee: 01 c0 rjmp .+2 ; 0x5bf2 + 5bf0: 1d 92 st X+, r1 + 5bf2: 41 50 subi r20, 0x01 ; 1 + 5bf4: 50 40 sbci r21, 0x00 ; 0 + 5bf6: e0 f7 brcc .-8 ; 0x5bf0 + 5bf8: 08 95 ret + +00005bfa : + 5bfa: fb 01 movw r30, r22 + 5bfc: dc 01 movw r26, r24 + 5bfe: 02 c0 rjmp .+4 ; 0x5c04 + 5c00: 01 90 ld r0, Z+ + 5c02: 0d 92 st X+, r0 + 5c04: 41 50 subi r20, 0x01 ; 1 + 5c06: 50 40 sbci r21, 0x00 ; 0 + 5c08: d8 f7 brcc .-10 ; 0x5c00 + 5c0a: 08 95 ret + +00005c0c : + 5c0c: ae e0 ldi r26, 0x0E ; 14 + 5c0e: b0 e0 ldi r27, 0x00 ; 0 + 5c10: eb e0 ldi r30, 0x0B ; 11 + 5c12: fe e2 ldi r31, 0x2E ; 46 + 5c14: f5 c2 rjmp .+1514 ; 0x6200 <__prologue_saves__+0x1c> + 5c16: 0d 89 ldd r16, Y+21 ; 0x15 + 5c18: 1e 89 ldd r17, Y+22 ; 0x16 + 5c1a: 8f 89 ldd r24, Y+23 ; 0x17 + 5c1c: 98 8d ldd r25, Y+24 ; 0x18 + 5c1e: 2e e0 ldi r18, 0x0E ; 14 + 5c20: 2c 83 std Y+4, r18 ; 0x04 + 5c22: 09 83 std Y+1, r16 ; 0x01 + 5c24: 1a 83 std Y+2, r17 ; 0x02 + 5c26: 97 ff sbrs r25, 7 + 5c28: 02 c0 rjmp .+4 ; 0x5c2e + 5c2a: 80 e0 ldi r24, 0x00 ; 0 + 5c2c: 90 e8 ldi r25, 0x80 ; 128 + 5c2e: 01 97 sbiw r24, 0x01 ; 1 + 5c30: 8d 83 std Y+5, r24 ; 0x05 + 5c32: 9e 83 std Y+6, r25 ; 0x06 + 5c34: ce 01 movw r24, r28 + 5c36: 4b 96 adiw r24, 0x1b ; 27 + 5c38: ac 01 movw r20, r24 + 5c3a: 69 8d ldd r22, Y+25 ; 0x19 + 5c3c: 7a 8d ldd r23, Y+26 ; 0x1a + 5c3e: ce 01 movw r24, r28 + 5c40: 01 96 adiw r24, 0x01 ; 1 + 5c42: 11 d0 rcall .+34 ; 0x5c66 + 5c44: 4d 81 ldd r20, Y+5 ; 0x05 + 5c46: 5e 81 ldd r21, Y+6 ; 0x06 + 5c48: 57 fd sbrc r21, 7 + 5c4a: 0a c0 rjmp .+20 ; 0x5c60 + 5c4c: 2f 81 ldd r18, Y+7 ; 0x07 + 5c4e: 38 85 ldd r19, Y+8 ; 0x08 + 5c50: 42 17 cp r20, r18 + 5c52: 53 07 cpc r21, r19 + 5c54: 0c f4 brge .+2 ; 0x5c58 + 5c56: 9a 01 movw r18, r20 + 5c58: f8 01 movw r30, r16 + 5c5a: e2 0f add r30, r18 + 5c5c: f3 1f adc r31, r19 + 5c5e: 10 82 st Z, r1 + 5c60: 2e 96 adiw r28, 0x0e ; 14 + 5c62: e4 e0 ldi r30, 0x04 ; 4 + 5c64: e6 c2 rjmp .+1484 ; 0x6232 <__epilogue_restores__+0x1c> + +00005c66 : + 5c66: ac e0 ldi r26, 0x0C ; 12 + 5c68: b0 e0 ldi r27, 0x00 ; 0 + 5c6a: e8 e3 ldi r30, 0x38 ; 56 + 5c6c: fe e2 ldi r31, 0x2E ; 46 + 5c6e: ba c2 rjmp .+1396 ; 0x61e4 <__prologue_saves__> + 5c70: 7c 01 movw r14, r24 + 5c72: 6b 01 movw r12, r22 + 5c74: 8a 01 movw r16, r20 + 5c76: fc 01 movw r30, r24 + 5c78: 16 82 std Z+6, r1 ; 0x06 + 5c7a: 17 82 std Z+7, r1 ; 0x07 + 5c7c: 83 81 ldd r24, Z+3 ; 0x03 + 5c7e: 81 ff sbrs r24, 1 + 5c80: b9 c1 rjmp .+882 ; 0x5ff4 + 5c82: 88 24 eor r8, r8 + 5c84: 83 94 inc r8 + 5c86: 91 2c mov r9, r1 + 5c88: 8c 0e add r8, r28 + 5c8a: 9d 1e adc r9, r29 + 5c8c: f7 01 movw r30, r14 + 5c8e: 93 81 ldd r25, Z+3 ; 0x03 + 5c90: f6 01 movw r30, r12 + 5c92: 93 fd sbrc r25, 3 + 5c94: 85 91 lpm r24, Z+ + 5c96: 93 ff sbrs r25, 3 + 5c98: 81 91 ld r24, Z+ + 5c9a: 6f 01 movw r12, r30 + 5c9c: 88 23 and r24, r24 + 5c9e: 09 f4 brne .+2 ; 0x5ca2 + 5ca0: a5 c1 rjmp .+842 ; 0x5fec + 5ca2: 85 32 cpi r24, 0x25 ; 37 + 5ca4: 39 f4 brne .+14 ; 0x5cb4 + 5ca6: 93 fd sbrc r25, 3 + 5ca8: 85 91 lpm r24, Z+ + 5caa: 93 ff sbrs r25, 3 + 5cac: 81 91 ld r24, Z+ + 5cae: 6f 01 movw r12, r30 + 5cb0: 85 32 cpi r24, 0x25 ; 37 + 5cb2: 21 f4 brne .+8 ; 0x5cbc + 5cb4: b7 01 movw r22, r14 + 5cb6: 90 e0 ldi r25, 0x00 ; 0 + 5cb8: f0 d1 rcall .+992 ; 0x609a + 5cba: e8 cf rjmp .-48 ; 0x5c8c + 5cbc: 51 2c mov r5, r1 + 5cbe: 31 2c mov r3, r1 + 5cc0: 20 e0 ldi r18, 0x00 ; 0 + 5cc2: 20 32 cpi r18, 0x20 ; 32 + 5cc4: a8 f4 brcc .+42 ; 0x5cf0 + 5cc6: 8b 32 cpi r24, 0x2B ; 43 + 5cc8: 61 f0 breq .+24 ; 0x5ce2 + 5cca: 28 f4 brcc .+10 ; 0x5cd6 + 5ccc: 80 32 cpi r24, 0x20 ; 32 + 5cce: 51 f0 breq .+20 ; 0x5ce4 + 5cd0: 83 32 cpi r24, 0x23 ; 35 + 5cd2: 71 f4 brne .+28 ; 0x5cf0 + 5cd4: 0b c0 rjmp .+22 ; 0x5cec + 5cd6: 8d 32 cpi r24, 0x2D ; 45 + 5cd8: 39 f0 breq .+14 ; 0x5ce8 + 5cda: 80 33 cpi r24, 0x30 ; 48 + 5cdc: 49 f4 brne .+18 ; 0x5cf0 + 5cde: 21 60 ori r18, 0x01 ; 1 + 5ce0: 28 c0 rjmp .+80 ; 0x5d32 + 5ce2: 22 60 ori r18, 0x02 ; 2 + 5ce4: 24 60 ori r18, 0x04 ; 4 + 5ce6: 25 c0 rjmp .+74 ; 0x5d32 + 5ce8: 28 60 ori r18, 0x08 ; 8 + 5cea: 23 c0 rjmp .+70 ; 0x5d32 + 5cec: 20 61 ori r18, 0x10 ; 16 + 5cee: 21 c0 rjmp .+66 ; 0x5d32 + 5cf0: 27 fd sbrc r18, 7 + 5cf2: 27 c0 rjmp .+78 ; 0x5d42 + 5cf4: 38 2f mov r19, r24 + 5cf6: 30 53 subi r19, 0x30 ; 48 + 5cf8: 3a 30 cpi r19, 0x0A ; 10 + 5cfa: 78 f4 brcc .+30 ; 0x5d1a + 5cfc: 26 ff sbrs r18, 6 + 5cfe: 06 c0 rjmp .+12 ; 0x5d0c + 5d00: fa e0 ldi r31, 0x0A ; 10 + 5d02: 5f 9e mul r5, r31 + 5d04: 30 0d add r19, r0 + 5d06: 11 24 eor r1, r1 + 5d08: 53 2e mov r5, r19 + 5d0a: 13 c0 rjmp .+38 ; 0x5d32 + 5d0c: 8a e0 ldi r24, 0x0A ; 10 + 5d0e: 38 9e mul r3, r24 + 5d10: 30 0d add r19, r0 + 5d12: 11 24 eor r1, r1 + 5d14: 33 2e mov r3, r19 + 5d16: 20 62 ori r18, 0x20 ; 32 + 5d18: 0c c0 rjmp .+24 ; 0x5d32 + 5d1a: 8e 32 cpi r24, 0x2E ; 46 + 5d1c: 21 f4 brne .+8 ; 0x5d26 + 5d1e: 26 fd sbrc r18, 6 + 5d20: 65 c1 rjmp .+714 ; 0x5fec + 5d22: 20 64 ori r18, 0x40 ; 64 + 5d24: 06 c0 rjmp .+12 ; 0x5d32 + 5d26: 8c 36 cpi r24, 0x6C ; 108 + 5d28: 11 f4 brne .+4 ; 0x5d2e + 5d2a: 20 68 ori r18, 0x80 ; 128 + 5d2c: 02 c0 rjmp .+4 ; 0x5d32 + 5d2e: 88 36 cpi r24, 0x68 ; 104 + 5d30: 41 f4 brne .+16 ; 0x5d42 + 5d32: f6 01 movw r30, r12 + 5d34: 93 fd sbrc r25, 3 + 5d36: 85 91 lpm r24, Z+ + 5d38: 93 ff sbrs r25, 3 + 5d3a: 81 91 ld r24, Z+ + 5d3c: 6f 01 movw r12, r30 + 5d3e: 81 11 cpse r24, r1 + 5d40: c0 cf rjmp .-128 ; 0x5cc2 + 5d42: 98 2f mov r25, r24 + 5d44: 95 54 subi r25, 0x45 ; 69 + 5d46: 93 30 cpi r25, 0x03 ; 3 + 5d48: 18 f0 brcs .+6 ; 0x5d50 + 5d4a: 90 52 subi r25, 0x20 ; 32 + 5d4c: 93 30 cpi r25, 0x03 ; 3 + 5d4e: 28 f4 brcc .+10 ; 0x5d5a + 5d50: 0c 5f subi r16, 0xFC ; 252 + 5d52: 1f 4f sbci r17, 0xFF ; 255 + 5d54: ff e3 ldi r31, 0x3F ; 63 + 5d56: f9 83 std Y+1, r31 ; 0x01 + 5d58: 0d c0 rjmp .+26 ; 0x5d74 + 5d5a: 83 36 cpi r24, 0x63 ; 99 + 5d5c: 31 f0 breq .+12 ; 0x5d6a + 5d5e: 83 37 cpi r24, 0x73 ; 115 + 5d60: 71 f0 breq .+28 ; 0x5d7e + 5d62: 83 35 cpi r24, 0x53 ; 83 + 5d64: 09 f0 breq .+2 ; 0x5d68 + 5d66: 5a c0 rjmp .+180 ; 0x5e1c + 5d68: 22 c0 rjmp .+68 ; 0x5dae + 5d6a: f8 01 movw r30, r16 + 5d6c: 80 81 ld r24, Z + 5d6e: 89 83 std Y+1, r24 ; 0x01 + 5d70: 0e 5f subi r16, 0xFE ; 254 + 5d72: 1f 4f sbci r17, 0xFF ; 255 + 5d74: 44 24 eor r4, r4 + 5d76: 43 94 inc r4 + 5d78: 51 2c mov r5, r1 + 5d7a: 54 01 movw r10, r8 + 5d7c: 14 c0 rjmp .+40 ; 0x5da6 + 5d7e: 38 01 movw r6, r16 + 5d80: f2 e0 ldi r31, 0x02 ; 2 + 5d82: 6f 0e add r6, r31 + 5d84: 71 1c adc r7, r1 + 5d86: f8 01 movw r30, r16 + 5d88: a0 80 ld r10, Z + 5d8a: b1 80 ldd r11, Z+1 ; 0x01 + 5d8c: 26 ff sbrs r18, 6 + 5d8e: 03 c0 rjmp .+6 ; 0x5d96 + 5d90: 65 2d mov r22, r5 + 5d92: 70 e0 ldi r23, 0x00 ; 0 + 5d94: 02 c0 rjmp .+4 ; 0x5d9a + 5d96: 6f ef ldi r22, 0xFF ; 255 + 5d98: 7f ef ldi r23, 0xFF ; 255 + 5d9a: c5 01 movw r24, r10 + 5d9c: 2c 87 std Y+12, r18 ; 0x0c + 5d9e: 72 d1 rcall .+740 ; 0x6084 + 5da0: 2c 01 movw r4, r24 + 5da2: 83 01 movw r16, r6 + 5da4: 2c 85 ldd r18, Y+12 ; 0x0c + 5da6: 6f e7 ldi r22, 0x7F ; 127 + 5da8: 26 2e mov r2, r22 + 5daa: 22 22 and r2, r18 + 5dac: 17 c0 rjmp .+46 ; 0x5ddc + 5dae: 38 01 movw r6, r16 + 5db0: f2 e0 ldi r31, 0x02 ; 2 + 5db2: 6f 0e add r6, r31 + 5db4: 71 1c adc r7, r1 + 5db6: f8 01 movw r30, r16 + 5db8: a0 80 ld r10, Z + 5dba: b1 80 ldd r11, Z+1 ; 0x01 + 5dbc: 26 ff sbrs r18, 6 + 5dbe: 03 c0 rjmp .+6 ; 0x5dc6 + 5dc0: 65 2d mov r22, r5 + 5dc2: 70 e0 ldi r23, 0x00 ; 0 + 5dc4: 02 c0 rjmp .+4 ; 0x5dca + 5dc6: 6f ef ldi r22, 0xFF ; 255 + 5dc8: 7f ef ldi r23, 0xFF ; 255 + 5dca: c5 01 movw r24, r10 + 5dcc: 2c 87 std Y+12, r18 ; 0x0c + 5dce: 4f d1 rcall .+670 ; 0x606e + 5dd0: 2c 01 movw r4, r24 + 5dd2: 2c 85 ldd r18, Y+12 ; 0x0c + 5dd4: 50 e8 ldi r21, 0x80 ; 128 + 5dd6: 25 2e mov r2, r21 + 5dd8: 22 2a or r2, r18 + 5dda: 83 01 movw r16, r6 + 5ddc: 23 fc sbrc r2, 3 + 5dde: 1a c0 rjmp .+52 ; 0x5e14 + 5de0: 05 c0 rjmp .+10 ; 0x5dec + 5de2: b7 01 movw r22, r14 + 5de4: 80 e2 ldi r24, 0x20 ; 32 + 5de6: 90 e0 ldi r25, 0x00 ; 0 + 5de8: 58 d1 rcall .+688 ; 0x609a + 5dea: 3a 94 dec r3 + 5dec: 83 2d mov r24, r3 + 5dee: 90 e0 ldi r25, 0x00 ; 0 + 5df0: 48 16 cp r4, r24 + 5df2: 59 06 cpc r5, r25 + 5df4: b0 f3 brcs .-20 ; 0x5de2 + 5df6: 0e c0 rjmp .+28 ; 0x5e14 + 5df8: f5 01 movw r30, r10 + 5dfa: 27 fc sbrc r2, 7 + 5dfc: 85 91 lpm r24, Z+ + 5dfe: 27 fe sbrs r2, 7 + 5e00: 81 91 ld r24, Z+ + 5e02: 5f 01 movw r10, r30 + 5e04: b7 01 movw r22, r14 + 5e06: 90 e0 ldi r25, 0x00 ; 0 + 5e08: 48 d1 rcall .+656 ; 0x609a + 5e0a: 31 10 cpse r3, r1 + 5e0c: 3a 94 dec r3 + 5e0e: f1 e0 ldi r31, 0x01 ; 1 + 5e10: 4f 1a sub r4, r31 + 5e12: 51 08 sbc r5, r1 + 5e14: 41 14 cp r4, r1 + 5e16: 51 04 cpc r5, r1 + 5e18: 79 f7 brne .-34 ; 0x5df8 + 5e1a: e5 c0 rjmp .+458 ; 0x5fe6 + 5e1c: 84 36 cpi r24, 0x64 ; 100 + 5e1e: 11 f0 breq .+4 ; 0x5e24 + 5e20: 89 36 cpi r24, 0x69 ; 105 + 5e22: 39 f5 brne .+78 ; 0x5e72 + 5e24: f8 01 movw r30, r16 + 5e26: 27 ff sbrs r18, 7 + 5e28: 07 c0 rjmp .+14 ; 0x5e38 + 5e2a: 60 81 ld r22, Z + 5e2c: 71 81 ldd r23, Z+1 ; 0x01 + 5e2e: 82 81 ldd r24, Z+2 ; 0x02 + 5e30: 93 81 ldd r25, Z+3 ; 0x03 + 5e32: 0c 5f subi r16, 0xFC ; 252 + 5e34: 1f 4f sbci r17, 0xFF ; 255 + 5e36: 08 c0 rjmp .+16 ; 0x5e48 + 5e38: 60 81 ld r22, Z + 5e3a: 71 81 ldd r23, Z+1 ; 0x01 + 5e3c: 88 27 eor r24, r24 + 5e3e: 77 fd sbrc r23, 7 + 5e40: 80 95 com r24 + 5e42: 98 2f mov r25, r24 + 5e44: 0e 5f subi r16, 0xFE ; 254 + 5e46: 1f 4f sbci r17, 0xFF ; 255 + 5e48: 4f e6 ldi r20, 0x6F ; 111 + 5e4a: b4 2e mov r11, r20 + 5e4c: b2 22 and r11, r18 + 5e4e: 97 ff sbrs r25, 7 + 5e50: 09 c0 rjmp .+18 ; 0x5e64 + 5e52: 90 95 com r25 + 5e54: 80 95 com r24 + 5e56: 70 95 com r23 + 5e58: 61 95 neg r22 + 5e5a: 7f 4f sbci r23, 0xFF ; 255 + 5e5c: 8f 4f sbci r24, 0xFF ; 255 + 5e5e: 9f 4f sbci r25, 0xFF ; 255 + 5e60: f0 e8 ldi r31, 0x80 ; 128 + 5e62: bf 2a or r11, r31 + 5e64: 2a e0 ldi r18, 0x0A ; 10 + 5e66: 30 e0 ldi r19, 0x00 ; 0 + 5e68: a4 01 movw r20, r8 + 5e6a: 43 d1 rcall .+646 ; 0x60f2 <__ultoa_invert> + 5e6c: a8 2e mov r10, r24 + 5e6e: a8 18 sub r10, r8 + 5e70: 42 c0 rjmp .+132 ; 0x5ef6 + 5e72: 85 37 cpi r24, 0x75 ; 117 + 5e74: 31 f4 brne .+12 ; 0x5e82 + 5e76: 3f ee ldi r19, 0xEF ; 239 + 5e78: b3 2e mov r11, r19 + 5e7a: b2 22 and r11, r18 + 5e7c: 2a e0 ldi r18, 0x0A ; 10 + 5e7e: 30 e0 ldi r19, 0x00 ; 0 + 5e80: 24 c0 rjmp .+72 ; 0x5eca + 5e82: 99 ef ldi r25, 0xF9 ; 249 + 5e84: b9 2e mov r11, r25 + 5e86: b2 22 and r11, r18 + 5e88: 8f 36 cpi r24, 0x6F ; 111 + 5e8a: b9 f0 breq .+46 ; 0x5eba + 5e8c: 20 f4 brcc .+8 ; 0x5e96 + 5e8e: 88 35 cpi r24, 0x58 ; 88 + 5e90: 09 f0 breq .+2 ; 0x5e94 + 5e92: ac c0 rjmp .+344 ; 0x5fec + 5e94: 0d c0 rjmp .+26 ; 0x5eb0 + 5e96: 80 37 cpi r24, 0x70 ; 112 + 5e98: 21 f0 breq .+8 ; 0x5ea2 + 5e9a: 88 37 cpi r24, 0x78 ; 120 + 5e9c: 09 f0 breq .+2 ; 0x5ea0 + 5e9e: a6 c0 rjmp .+332 ; 0x5fec + 5ea0: 02 c0 rjmp .+4 ; 0x5ea6 + 5ea2: 20 e1 ldi r18, 0x10 ; 16 + 5ea4: b2 2a or r11, r18 + 5ea6: b4 fe sbrs r11, 4 + 5ea8: 0b c0 rjmp .+22 ; 0x5ec0 + 5eaa: 84 e0 ldi r24, 0x04 ; 4 + 5eac: b8 2a or r11, r24 + 5eae: 08 c0 rjmp .+16 ; 0x5ec0 + 5eb0: 24 ff sbrs r18, 4 + 5eb2: 09 c0 rjmp .+18 ; 0x5ec6 + 5eb4: e6 e0 ldi r30, 0x06 ; 6 + 5eb6: be 2a or r11, r30 + 5eb8: 06 c0 rjmp .+12 ; 0x5ec6 + 5eba: 28 e0 ldi r18, 0x08 ; 8 + 5ebc: 30 e0 ldi r19, 0x00 ; 0 + 5ebe: 05 c0 rjmp .+10 ; 0x5eca + 5ec0: 20 e1 ldi r18, 0x10 ; 16 + 5ec2: 30 e0 ldi r19, 0x00 ; 0 + 5ec4: 02 c0 rjmp .+4 ; 0x5eca + 5ec6: 20 e1 ldi r18, 0x10 ; 16 + 5ec8: 32 e0 ldi r19, 0x02 ; 2 + 5eca: f8 01 movw r30, r16 + 5ecc: b7 fe sbrs r11, 7 + 5ece: 07 c0 rjmp .+14 ; 0x5ede + 5ed0: 60 81 ld r22, Z + 5ed2: 71 81 ldd r23, Z+1 ; 0x01 + 5ed4: 82 81 ldd r24, Z+2 ; 0x02 + 5ed6: 93 81 ldd r25, Z+3 ; 0x03 + 5ed8: 0c 5f subi r16, 0xFC ; 252 + 5eda: 1f 4f sbci r17, 0xFF ; 255 + 5edc: 06 c0 rjmp .+12 ; 0x5eea + 5ede: 60 81 ld r22, Z + 5ee0: 71 81 ldd r23, Z+1 ; 0x01 + 5ee2: 80 e0 ldi r24, 0x00 ; 0 + 5ee4: 90 e0 ldi r25, 0x00 ; 0 + 5ee6: 0e 5f subi r16, 0xFE ; 254 + 5ee8: 1f 4f sbci r17, 0xFF ; 255 + 5eea: a4 01 movw r20, r8 + 5eec: 02 d1 rcall .+516 ; 0x60f2 <__ultoa_invert> + 5eee: a8 2e mov r10, r24 + 5ef0: a8 18 sub r10, r8 + 5ef2: ff e7 ldi r31, 0x7F ; 127 + 5ef4: bf 22 and r11, r31 + 5ef6: b6 fe sbrs r11, 6 + 5ef8: 0b c0 rjmp .+22 ; 0x5f10 + 5efa: 2b 2d mov r18, r11 + 5efc: 2e 7f andi r18, 0xFE ; 254 + 5efe: a5 14 cp r10, r5 + 5f00: 50 f4 brcc .+20 ; 0x5f16 + 5f02: b4 fe sbrs r11, 4 + 5f04: 0a c0 rjmp .+20 ; 0x5f1a + 5f06: b2 fc sbrc r11, 2 + 5f08: 08 c0 rjmp .+16 ; 0x5f1a + 5f0a: 2b 2d mov r18, r11 + 5f0c: 2e 7e andi r18, 0xEE ; 238 + 5f0e: 05 c0 rjmp .+10 ; 0x5f1a + 5f10: 7a 2c mov r7, r10 + 5f12: 2b 2d mov r18, r11 + 5f14: 03 c0 rjmp .+6 ; 0x5f1c + 5f16: 7a 2c mov r7, r10 + 5f18: 01 c0 rjmp .+2 ; 0x5f1c + 5f1a: 75 2c mov r7, r5 + 5f1c: 24 ff sbrs r18, 4 + 5f1e: 0d c0 rjmp .+26 ; 0x5f3a + 5f20: fe 01 movw r30, r28 + 5f22: ea 0d add r30, r10 + 5f24: f1 1d adc r31, r1 + 5f26: 80 81 ld r24, Z + 5f28: 80 33 cpi r24, 0x30 ; 48 + 5f2a: 11 f4 brne .+4 ; 0x5f30 + 5f2c: 29 7e andi r18, 0xE9 ; 233 + 5f2e: 09 c0 rjmp .+18 ; 0x5f42 + 5f30: 22 ff sbrs r18, 2 + 5f32: 06 c0 rjmp .+12 ; 0x5f40 + 5f34: 73 94 inc r7 + 5f36: 73 94 inc r7 + 5f38: 04 c0 rjmp .+8 ; 0x5f42 + 5f3a: 82 2f mov r24, r18 + 5f3c: 86 78 andi r24, 0x86 ; 134 + 5f3e: 09 f0 breq .+2 ; 0x5f42 + 5f40: 73 94 inc r7 + 5f42: 23 fd sbrc r18, 3 + 5f44: 13 c0 rjmp .+38 ; 0x5f6c + 5f46: 20 ff sbrs r18, 0 + 5f48: 0e c0 rjmp .+28 ; 0x5f66 + 5f4a: 5a 2c mov r5, r10 + 5f4c: 73 14 cp r7, r3 + 5f4e: 58 f4 brcc .+22 ; 0x5f66 + 5f50: 53 0c add r5, r3 + 5f52: 57 18 sub r5, r7 + 5f54: 73 2c mov r7, r3 + 5f56: 07 c0 rjmp .+14 ; 0x5f66 + 5f58: b7 01 movw r22, r14 + 5f5a: 80 e2 ldi r24, 0x20 ; 32 + 5f5c: 90 e0 ldi r25, 0x00 ; 0 + 5f5e: 2c 87 std Y+12, r18 ; 0x0c + 5f60: 9c d0 rcall .+312 ; 0x609a + 5f62: 73 94 inc r7 + 5f64: 2c 85 ldd r18, Y+12 ; 0x0c + 5f66: 73 14 cp r7, r3 + 5f68: b8 f3 brcs .-18 ; 0x5f58 + 5f6a: 04 c0 rjmp .+8 ; 0x5f74 + 5f6c: 73 14 cp r7, r3 + 5f6e: 10 f4 brcc .+4 ; 0x5f74 + 5f70: 37 18 sub r3, r7 + 5f72: 01 c0 rjmp .+2 ; 0x5f76 + 5f74: 31 2c mov r3, r1 + 5f76: 24 ff sbrs r18, 4 + 5f78: 11 c0 rjmp .+34 ; 0x5f9c + 5f7a: b7 01 movw r22, r14 + 5f7c: 80 e3 ldi r24, 0x30 ; 48 + 5f7e: 90 e0 ldi r25, 0x00 ; 0 + 5f80: 2c 87 std Y+12, r18 ; 0x0c + 5f82: 8b d0 rcall .+278 ; 0x609a + 5f84: 2c 85 ldd r18, Y+12 ; 0x0c + 5f86: 22 ff sbrs r18, 2 + 5f88: 1c c0 rjmp .+56 ; 0x5fc2 + 5f8a: 21 ff sbrs r18, 1 + 5f8c: 03 c0 rjmp .+6 ; 0x5f94 + 5f8e: 88 e5 ldi r24, 0x58 ; 88 + 5f90: 90 e0 ldi r25, 0x00 ; 0 + 5f92: 02 c0 rjmp .+4 ; 0x5f98 + 5f94: 88 e7 ldi r24, 0x78 ; 120 + 5f96: 90 e0 ldi r25, 0x00 ; 0 + 5f98: b7 01 movw r22, r14 + 5f9a: 0c c0 rjmp .+24 ; 0x5fb4 + 5f9c: 82 2f mov r24, r18 + 5f9e: 86 78 andi r24, 0x86 ; 134 + 5fa0: 81 f0 breq .+32 ; 0x5fc2 + 5fa2: 21 fd sbrc r18, 1 + 5fa4: 02 c0 rjmp .+4 ; 0x5faa + 5fa6: 80 e2 ldi r24, 0x20 ; 32 + 5fa8: 01 c0 rjmp .+2 ; 0x5fac + 5faa: 8b e2 ldi r24, 0x2B ; 43 + 5fac: 27 fd sbrc r18, 7 + 5fae: 8d e2 ldi r24, 0x2D ; 45 + 5fb0: b7 01 movw r22, r14 + 5fb2: 90 e0 ldi r25, 0x00 ; 0 + 5fb4: 72 d0 rcall .+228 ; 0x609a + 5fb6: 05 c0 rjmp .+10 ; 0x5fc2 + 5fb8: b7 01 movw r22, r14 + 5fba: 80 e3 ldi r24, 0x30 ; 48 + 5fbc: 90 e0 ldi r25, 0x00 ; 0 + 5fbe: 6d d0 rcall .+218 ; 0x609a + 5fc0: 5a 94 dec r5 + 5fc2: a5 14 cp r10, r5 + 5fc4: c8 f3 brcs .-14 ; 0x5fb8 + 5fc6: aa 94 dec r10 + 5fc8: f4 01 movw r30, r8 + 5fca: ea 0d add r30, r10 + 5fcc: f1 1d adc r31, r1 + 5fce: b7 01 movw r22, r14 + 5fd0: 80 81 ld r24, Z + 5fd2: 90 e0 ldi r25, 0x00 ; 0 + 5fd4: 62 d0 rcall .+196 ; 0x609a + 5fd6: a1 10 cpse r10, r1 + 5fd8: f6 cf rjmp .-20 ; 0x5fc6 + 5fda: 05 c0 rjmp .+10 ; 0x5fe6 + 5fdc: b7 01 movw r22, r14 + 5fde: 80 e2 ldi r24, 0x20 ; 32 + 5fe0: 90 e0 ldi r25, 0x00 ; 0 + 5fe2: 5b d0 rcall .+182 ; 0x609a + 5fe4: 3a 94 dec r3 + 5fe6: 31 10 cpse r3, r1 + 5fe8: f9 cf rjmp .-14 ; 0x5fdc + 5fea: 50 ce rjmp .-864 ; 0x5c8c + 5fec: f7 01 movw r30, r14 + 5fee: 26 81 ldd r18, Z+6 ; 0x06 + 5ff0: 37 81 ldd r19, Z+7 ; 0x07 + 5ff2: 02 c0 rjmp .+4 ; 0x5ff8 + 5ff4: 2f ef ldi r18, 0xFF ; 255 + 5ff6: 3f ef ldi r19, 0xFF ; 255 + 5ff8: c9 01 movw r24, r18 + 5ffa: 2c 96 adiw r28, 0x0c ; 12 + 5ffc: e2 e1 ldi r30, 0x12 ; 18 + 5ffe: 0b c1 rjmp .+534 ; 0x6216 <__epilogue_restores__> + +00006000 <__eerd_block_x32a4u>: + 6000: e0 ec ldi r30, 0xC0 ; 192 + 6002: f1 e0 ldi r31, 0x01 ; 1 + 6004: a7 85 ldd r26, Z+15 ; 0x0f + 6006: a7 fd sbrc r26, 7 + 6008: fd cf rjmp .-6 ; 0x6004 <__eerd_block_x32a4u+0x4> + 600a: a4 85 ldd r26, Z+12 ; 0x0c + 600c: a8 60 ori r26, 0x08 ; 8 + 600e: a4 87 std Z+12, r26 ; 0x0c + 6010: 60 50 subi r22, 0x00 ; 0 + 6012: 70 4f sbci r23, 0xF0 ; 240 + 6014: f2 cd rjmp .-1052 ; 0x5bfa + +00006016 <__eewr_block_x32a4u>: + 6016: dc 01 movw r26, r24 + 6018: cb 01 movw r24, r22 + 601a: 02 c0 rjmp .+4 ; 0x6020 <__eewr_block_x32a4u+0xa> + 601c: 2d 91 ld r18, X+ + 601e: 05 d0 rcall .+10 ; 0x602a <__eewr_r18_x32a4u> + 6020: 41 50 subi r20, 0x01 ; 1 + 6022: 50 40 sbci r21, 0x00 ; 0 + 6024: d8 f7 brcc .-10 ; 0x601c <__eewr_block_x32a4u+0x6> + 6026: 08 95 ret + +00006028 <__eewr_byte_x32a4u>: + 6028: 26 2f mov r18, r22 + +0000602a <__eewr_r18_x32a4u>: + 602a: e0 ec ldi r30, 0xC0 ; 192 + 602c: f1 e0 ldi r31, 0x01 ; 1 + 602e: 37 85 ldd r19, Z+15 ; 0x0f + 6030: 37 fd sbrc r19, 7 + 6032: fd cf rjmp .-6 ; 0x602e <__eewr_r18_x32a4u+0x4> + 6034: 34 85 ldd r19, Z+12 ; 0x0c + 6036: 37 7f andi r19, 0xF7 ; 247 + 6038: 34 87 std Z+12, r19 ; 0x0c + 603a: 37 85 ldd r19, Z+15 ; 0x0f + 603c: 31 ff sbrs r19, 1 + 603e: 09 c0 rjmp .+18 ; 0x6052 <__eewr_r18_x32a4u+0x28> + 6040: 36 e3 ldi r19, 0x36 ; 54 + 6042: 32 87 std Z+10, r19 ; 0x0a + 6044: 38 ed ldi r19, 0xD8 ; 216 + 6046: 34 bf out 0x34, r19 ; 52 + 6048: 31 e0 ldi r19, 0x01 ; 1 + 604a: 33 87 std Z+11, r19 ; 0x0b + 604c: 37 85 ldd r19, Z+15 ; 0x0f + 604e: 37 fd sbrc r19, 7 + 6050: fd cf rjmp .-6 ; 0x604c <__eewr_r18_x32a4u+0x22> + 6052: 33 e3 ldi r19, 0x33 ; 51 + 6054: 32 87 std Z+10, r19 ; 0x0a + 6056: 80 83 st Z, r24 + 6058: 91 83 std Z+1, r25 ; 0x01 + 605a: 12 82 std Z+2, r1 ; 0x02 + 605c: 24 83 std Z+4, r18 ; 0x04 + 605e: 25 e3 ldi r18, 0x35 ; 53 + 6060: 22 87 std Z+10, r18 ; 0x0a + 6062: 28 ed ldi r18, 0xD8 ; 216 + 6064: 31 e0 ldi r19, 0x01 ; 1 + 6066: 24 bf out 0x34, r18 ; 52 + 6068: 33 87 std Z+11, r19 ; 0x0b + 606a: 01 96 adiw r24, 0x01 ; 1 + 606c: 08 95 ret + +0000606e : + 606e: fc 01 movw r30, r24 + 6070: 05 90 lpm r0, Z+ + 6072: 61 50 subi r22, 0x01 ; 1 + 6074: 70 40 sbci r23, 0x00 ; 0 + 6076: 01 10 cpse r0, r1 + 6078: d8 f7 brcc .-10 ; 0x6070 + 607a: 80 95 com r24 + 607c: 90 95 com r25 + 607e: 8e 0f add r24, r30 + 6080: 9f 1f adc r25, r31 + 6082: 08 95 ret + +00006084 : + 6084: fc 01 movw r30, r24 + 6086: 61 50 subi r22, 0x01 ; 1 + 6088: 70 40 sbci r23, 0x00 ; 0 + 608a: 01 90 ld r0, Z+ + 608c: 01 10 cpse r0, r1 + 608e: d8 f7 brcc .-10 ; 0x6086 + 6090: 80 95 com r24 + 6092: 90 95 com r25 + 6094: 8e 0f add r24, r30 + 6096: 9f 1f adc r25, r31 + 6098: 08 95 ret + +0000609a : + 609a: 0f 93 push r16 + 609c: 1f 93 push r17 + 609e: cf 93 push r28 + 60a0: df 93 push r29 + 60a2: 8c 01 movw r16, r24 + 60a4: eb 01 movw r28, r22 + 60a6: 8b 81 ldd r24, Y+3 ; 0x03 + 60a8: 81 fd sbrc r24, 1 + 60aa: 03 c0 rjmp .+6 ; 0x60b2 + 60ac: 0f ef ldi r16, 0xFF ; 255 + 60ae: 1f ef ldi r17, 0xFF ; 255 + 60b0: 1a c0 rjmp .+52 ; 0x60e6 + 60b2: 82 ff sbrs r24, 2 + 60b4: 0d c0 rjmp .+26 ; 0x60d0 + 60b6: 2e 81 ldd r18, Y+6 ; 0x06 + 60b8: 3f 81 ldd r19, Y+7 ; 0x07 + 60ba: 8c 81 ldd r24, Y+4 ; 0x04 + 60bc: 9d 81 ldd r25, Y+5 ; 0x05 + 60be: 28 17 cp r18, r24 + 60c0: 39 07 cpc r19, r25 + 60c2: 64 f4 brge .+24 ; 0x60dc + 60c4: e8 81 ld r30, Y + 60c6: f9 81 ldd r31, Y+1 ; 0x01 + 60c8: 01 93 st Z+, r16 + 60ca: e8 83 st Y, r30 + 60cc: f9 83 std Y+1, r31 ; 0x01 + 60ce: 06 c0 rjmp .+12 ; 0x60dc + 60d0: e8 85 ldd r30, Y+8 ; 0x08 + 60d2: f9 85 ldd r31, Y+9 ; 0x09 + 60d4: 80 2f mov r24, r16 + 60d6: 09 95 icall + 60d8: 89 2b or r24, r25 + 60da: 41 f7 brne .-48 ; 0x60ac + 60dc: 8e 81 ldd r24, Y+6 ; 0x06 + 60de: 9f 81 ldd r25, Y+7 ; 0x07 + 60e0: 01 96 adiw r24, 0x01 ; 1 + 60e2: 8e 83 std Y+6, r24 ; 0x06 + 60e4: 9f 83 std Y+7, r25 ; 0x07 + 60e6: c8 01 movw r24, r16 + 60e8: df 91 pop r29 + 60ea: cf 91 pop r28 + 60ec: 1f 91 pop r17 + 60ee: 0f 91 pop r16 + 60f0: 08 95 ret + +000060f2 <__ultoa_invert>: + 60f2: fa 01 movw r30, r20 + 60f4: aa 27 eor r26, r26 + 60f6: 28 30 cpi r18, 0x08 ; 8 + 60f8: 51 f1 breq .+84 ; 0x614e <__ultoa_invert+0x5c> + 60fa: 20 31 cpi r18, 0x10 ; 16 + 60fc: 81 f1 breq .+96 ; 0x615e <__ultoa_invert+0x6c> + 60fe: e8 94 clt + 6100: 6f 93 push r22 + 6102: 6e 7f andi r22, 0xFE ; 254 + 6104: 6e 5f subi r22, 0xFE ; 254 + 6106: 7f 4f sbci r23, 0xFF ; 255 + 6108: 8f 4f sbci r24, 0xFF ; 255 + 610a: 9f 4f sbci r25, 0xFF ; 255 + 610c: af 4f sbci r26, 0xFF ; 255 + 610e: b1 e0 ldi r27, 0x01 ; 1 + 6110: 3e d0 rcall .+124 ; 0x618e <__ultoa_invert+0x9c> + 6112: b4 e0 ldi r27, 0x04 ; 4 + 6114: 3c d0 rcall .+120 ; 0x618e <__ultoa_invert+0x9c> + 6116: 67 0f add r22, r23 + 6118: 78 1f adc r23, r24 + 611a: 89 1f adc r24, r25 + 611c: 9a 1f adc r25, r26 + 611e: a1 1d adc r26, r1 + 6120: 68 0f add r22, r24 + 6122: 79 1f adc r23, r25 + 6124: 8a 1f adc r24, r26 + 6126: 91 1d adc r25, r1 + 6128: a1 1d adc r26, r1 + 612a: 6a 0f add r22, r26 + 612c: 71 1d adc r23, r1 + 612e: 81 1d adc r24, r1 + 6130: 91 1d adc r25, r1 + 6132: a1 1d adc r26, r1 + 6134: 20 d0 rcall .+64 ; 0x6176 <__ultoa_invert+0x84> + 6136: 09 f4 brne .+2 ; 0x613a <__ultoa_invert+0x48> + 6138: 68 94 set + 613a: 3f 91 pop r19 + 613c: 2a e0 ldi r18, 0x0A ; 10 + 613e: 26 9f mul r18, r22 + 6140: 11 24 eor r1, r1 + 6142: 30 19 sub r19, r0 + 6144: 30 5d subi r19, 0xD0 ; 208 + 6146: 31 93 st Z+, r19 + 6148: de f6 brtc .-74 ; 0x6100 <__ultoa_invert+0xe> + 614a: cf 01 movw r24, r30 + 614c: 08 95 ret + 614e: 46 2f mov r20, r22 + 6150: 47 70 andi r20, 0x07 ; 7 + 6152: 40 5d subi r20, 0xD0 ; 208 + 6154: 41 93 st Z+, r20 + 6156: b3 e0 ldi r27, 0x03 ; 3 + 6158: 0f d0 rcall .+30 ; 0x6178 <__ultoa_invert+0x86> + 615a: c9 f7 brne .-14 ; 0x614e <__ultoa_invert+0x5c> + 615c: f6 cf rjmp .-20 ; 0x614a <__ultoa_invert+0x58> + 615e: 46 2f mov r20, r22 + 6160: 4f 70 andi r20, 0x0F ; 15 + 6162: 40 5d subi r20, 0xD0 ; 208 + 6164: 4a 33 cpi r20, 0x3A ; 58 + 6166: 18 f0 brcs .+6 ; 0x616e <__ultoa_invert+0x7c> + 6168: 49 5d subi r20, 0xD9 ; 217 + 616a: 31 fd sbrc r19, 1 + 616c: 40 52 subi r20, 0x20 ; 32 + 616e: 41 93 st Z+, r20 + 6170: 02 d0 rcall .+4 ; 0x6176 <__ultoa_invert+0x84> + 6172: a9 f7 brne .-22 ; 0x615e <__ultoa_invert+0x6c> + 6174: ea cf rjmp .-44 ; 0x614a <__ultoa_invert+0x58> + 6176: b4 e0 ldi r27, 0x04 ; 4 + 6178: a6 95 lsr r26 + 617a: 97 95 ror r25 + 617c: 87 95 ror r24 + 617e: 77 95 ror r23 + 6180: 67 95 ror r22 + 6182: ba 95 dec r27 + 6184: c9 f7 brne .-14 ; 0x6178 <__ultoa_invert+0x86> + 6186: 00 97 sbiw r24, 0x00 ; 0 + 6188: 61 05 cpc r22, r1 + 618a: 71 05 cpc r23, r1 + 618c: 08 95 ret + 618e: 9b 01 movw r18, r22 + 6190: ac 01 movw r20, r24 + 6192: 0a 2e mov r0, r26 + 6194: 06 94 lsr r0 + 6196: 57 95 ror r21 + 6198: 47 95 ror r20 + 619a: 37 95 ror r19 + 619c: 27 95 ror r18 + 619e: ba 95 dec r27 + 61a0: c9 f7 brne .-14 ; 0x6194 <__ultoa_invert+0xa2> + 61a2: 62 0f add r22, r18 + 61a4: 73 1f adc r23, r19 + 61a6: 84 1f adc r24, r20 + 61a8: 95 1f adc r25, r21 + 61aa: a0 1d adc r26, r0 + 61ac: 08 95 ret + +000061ae <__divmodsi4>: + 61ae: 05 2e mov r0, r21 + 61b0: 97 fb bst r25, 7 + 61b2: 16 f4 brtc .+4 ; 0x61b8 <__divmodsi4+0xa> + 61b4: 00 94 com r0 + 61b6: 06 d0 rcall .+12 ; 0x61c4 <__divmodsi4_neg1> + 61b8: 57 fd sbrc r21, 7 + 61ba: 0c d0 rcall .+24 ; 0x61d4 <__divmodsi4_neg2> + 61bc: 44 d0 rcall .+136 ; 0x6246 <__udivmodsi4> + 61be: 07 fc sbrc r0, 7 + 61c0: 09 d0 rcall .+18 ; 0x61d4 <__divmodsi4_neg2> + 61c2: 7e f4 brtc .+30 ; 0x61e2 <__divmodsi4_exit> + +000061c4 <__divmodsi4_neg1>: + 61c4: 90 95 com r25 + 61c6: 80 95 com r24 + 61c8: 70 95 com r23 + 61ca: 61 95 neg r22 + 61cc: 7f 4f sbci r23, 0xFF ; 255 + 61ce: 8f 4f sbci r24, 0xFF ; 255 + 61d0: 9f 4f sbci r25, 0xFF ; 255 + 61d2: 08 95 ret + +000061d4 <__divmodsi4_neg2>: + 61d4: 50 95 com r21 + 61d6: 40 95 com r20 + 61d8: 30 95 com r19 + 61da: 21 95 neg r18 + 61dc: 3f 4f sbci r19, 0xFF ; 255 + 61de: 4f 4f sbci r20, 0xFF ; 255 + 61e0: 5f 4f sbci r21, 0xFF ; 255 + +000061e2 <__divmodsi4_exit>: + 61e2: 08 95 ret + +000061e4 <__prologue_saves__>: + 61e4: 2f 92 push r2 + 61e6: 3f 92 push r3 + 61e8: 4f 92 push r4 + 61ea: 5f 92 push r5 + 61ec: 6f 92 push r6 + 61ee: 7f 92 push r7 + 61f0: 8f 92 push r8 + 61f2: 9f 92 push r9 + 61f4: af 92 push r10 + 61f6: bf 92 push r11 + 61f8: cf 92 push r12 + 61fa: df 92 push r13 + 61fc: ef 92 push r14 + 61fe: ff 92 push r15 + 6200: 0f 93 push r16 + 6202: 1f 93 push r17 + 6204: cf 93 push r28 + 6206: df 93 push r29 + 6208: cd b7 in r28, 0x3d ; 61 + 620a: de b7 in r29, 0x3e ; 62 + 620c: ca 1b sub r28, r26 + 620e: db 0b sbc r29, r27 + 6210: cd bf out 0x3d, r28 ; 61 + 6212: de bf out 0x3e, r29 ; 62 + 6214: 09 94 ijmp + +00006216 <__epilogue_restores__>: + 6216: 2a 88 ldd r2, Y+18 ; 0x12 + 6218: 39 88 ldd r3, Y+17 ; 0x11 + 621a: 48 88 ldd r4, Y+16 ; 0x10 + 621c: 5f 84 ldd r5, Y+15 ; 0x0f + 621e: 6e 84 ldd r6, Y+14 ; 0x0e + 6220: 7d 84 ldd r7, Y+13 ; 0x0d + 6222: 8c 84 ldd r8, Y+12 ; 0x0c + 6224: 9b 84 ldd r9, Y+11 ; 0x0b + 6226: aa 84 ldd r10, Y+10 ; 0x0a + 6228: b9 84 ldd r11, Y+9 ; 0x09 + 622a: c8 84 ldd r12, Y+8 ; 0x08 + 622c: df 80 ldd r13, Y+7 ; 0x07 + 622e: ee 80 ldd r14, Y+6 ; 0x06 + 6230: fd 80 ldd r15, Y+5 ; 0x05 + 6232: 0c 81 ldd r16, Y+4 ; 0x04 + 6234: 1b 81 ldd r17, Y+3 ; 0x03 + 6236: aa 81 ldd r26, Y+2 ; 0x02 + 6238: b9 81 ldd r27, Y+1 ; 0x01 + 623a: ce 0f add r28, r30 + 623c: d1 1d adc r29, r1 + 623e: cd bf out 0x3d, r28 ; 61 + 6240: de bf out 0x3e, r29 ; 62 + 6242: ed 01 movw r28, r26 + 6244: 08 95 ret + +00006246 <__udivmodsi4>: + 6246: a1 e2 ldi r26, 0x21 ; 33 + 6248: 1a 2e mov r1, r26 + 624a: aa 1b sub r26, r26 + 624c: bb 1b sub r27, r27 + 624e: fd 01 movw r30, r26 + 6250: 0d c0 rjmp .+26 ; 0x626c <__udivmodsi4_ep> + +00006252 <__udivmodsi4_loop>: + 6252: aa 1f adc r26, r26 + 6254: bb 1f adc r27, r27 + 6256: ee 1f adc r30, r30 + 6258: ff 1f adc r31, r31 + 625a: a2 17 cp r26, r18 + 625c: b3 07 cpc r27, r19 + 625e: e4 07 cpc r30, r20 + 6260: f5 07 cpc r31, r21 + 6262: 20 f0 brcs .+8 ; 0x626c <__udivmodsi4_ep> + 6264: a2 1b sub r26, r18 + 6266: b3 0b sbc r27, r19 + 6268: e4 0b sbc r30, r20 + 626a: f5 0b sbc r31, r21 + +0000626c <__udivmodsi4_ep>: + 626c: 66 1f adc r22, r22 + 626e: 77 1f adc r23, r23 + 6270: 88 1f adc r24, r24 + 6272: 99 1f adc r25, r25 + 6274: 1a 94 dec r1 + 6276: 69 f7 brne .-38 ; 0x6252 <__udivmodsi4_loop> + 6278: 60 95 com r22 + 627a: 70 95 com r23 + 627c: 80 95 com r24 + 627e: 90 95 com r25 + 6280: 9b 01 movw r18, r22 + 6282: ac 01 movw r20, r24 + 6284: bd 01 movw r22, r26 + 6286: cf 01 movw r24, r30 + 6288: 08 95 ret + +0000628a <_exit>: + 628a: f8 94 cli + +0000628c <__stop_program>: + 628c: ff cf rjmp .-2 ; 0x628c <__stop_program> diff --git a/Firmware/Chameleon-Mini/Chameleon-Mini.map b/Firmware/Chameleon-Mini/Chameleon-Mini.map index 729541b..b6d89ab 100644 --- a/Firmware/Chameleon-Mini/Chameleon-Mini.map +++ b/Firmware/Chameleon-Mini/Chameleon-Mini.map @@ -1,2936 +1,3206 @@ -Archive member included because of file (symbol) - -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o (exit) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - Bin/XModem.o (__tablejump2__) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - Bin/Terminal.o (__do_copy_data) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - Bin/Configuration.o (__do_clear_bss) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - Bin/Commands.o (__mulshisi3) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) (__muluhisi3) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) (__umulhisi3) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - Bin/Random.o (rand) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy_P.o) - Bin/Configuration.o (memcpy_P) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strcmp_P.o) - Bin/Button.o (strcmp_P) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strncpy_P.o) - Bin/Button.o (strncpy_P) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcmp.o) - Bin/HIDClassDevice.o (memcmp) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy.o) - Bin/HIDClassDevice.o (memcpy) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memset.o) - Bin/HIDClassDevice.o (memset) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - Bin/Commands.o (snprintf_P) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) (vfprintf) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - Bin/Settings.o (__eerd_block_x32a4u) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - Bin/EndpointStream_XMEGA.o (__eerd_byte_x32a4u) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) - Bin/EndpointStream_XMEGA.o (__eeupd_byte_x32a4u) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - Bin/Settings.o (__eewr_block_x32a4u) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) (__eewr_r18_x32a4u) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen_P.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) (strnlen_P) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) (strnlen) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) (fputc) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(ultoa_invert.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) (__ultoa_invert) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) (__divmodsi4) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) (__negsi2) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) (__prologue_saves__) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) (__epilogue_restores__) -/home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) (__udivmodsi4) - -Allocating common symbols -Common symbol size file - -USB_IsInitialized 0x1 Bin/USBTask.o -USB_EndpointTable 0x63 Bin/USBController_XMEGA.o -TerminalBuffer 0x100 Bin/Terminal.o -USB_Endpoint_SelectedFIFO - 0x2 Bin/Endpoint_XMEGA.o -ActiveConfiguration - 0x25 Bin/Configuration.o -USB_DeviceState 0x1 Bin/USBTask.o -USB_Device_ConfigurationNumber - 0x1 Bin/DeviceStandardReq.o -USB_Endpoint_SelectedHandle - 0x2 Bin/Endpoint_XMEGA.o -USB_Device_CurrentlySelfPowered - 0x1 Bin/DeviceStandardReq.o -CodecBuffer 0x100 Bin/Codec.o -GlobalSettings 0x13 Bin/Settings.o -USB_Endpoint_SelectedEndpoint - 0x1 Bin/Endpoint_XMEGA.o -USB_ControlRequest 0x8 Bin/USBTask.o -USB_Endpoint_FIFOs 0x318 Bin/Endpoint_XMEGA.o -USB_Device_RemoteWakeupEnabled - 0x1 Bin/DeviceStandardReq.o - -Discarded input sections - - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - .text 0x00000000 0x0 Bin/Chameleon-Mini.o - .bss 0x00000000 0x0 Bin/Chameleon-Mini.o - .text 0x00000000 0x0 Bin/LUFADescriptors.o - .bss 0x00000000 0x0 Bin/LUFADescriptors.o - .text 0x00000000 0x0 Bin/System.o - .bss 0x00000000 0x0 Bin/System.o - .text 0x00000000 0x0 Bin/Configuration.o - .bss 0x00000000 0x0 Bin/Configuration.o - .text 0x00000000 0x0 Bin/Random.o - .bss 0x00000000 0x0 Bin/Random.o - .text 0x00000000 0x0 Bin/Common.o - .bss 0x00000000 0x0 Bin/Common.o - .text 0x00000000 0x0 Bin/Memory.o - .text 0x00000000 0x0 Bin/Button.o - .text.ButtonSetActionById - 0x00000000 0xc Bin/Button.o - .text 0x00000000 0x0 Bin/Settings.o - .bss 0x00000000 0x0 Bin/Settings.o - .text.SettingsGetActiveById - 0x00000000 0x6 Bin/Settings.o - .text 0x00000000 0x0 Bin/LED.o - .text 0x00000000 0x0 Bin/Terminal.o - .text 0x00000000 0x0 Bin/Commands.o - .bss 0x00000000 0x0 Bin/Commands.o - .text 0x00000000 0x0 Bin/XModem.o - .text 0x00000000 0x0 Bin/CommandLine.o - .text.CommandLineInit - 0x00000000 0xa Bin/CommandLine.o - .text 0x00000000 0x0 Bin/Codec.o - .bss 0x00000000 0x0 Bin/Codec.o - .text 0x00000000 0x0 Bin/ISO14443-2A.o - .text 0x00000000 0x0 Bin/MifareClassic.o - .text 0x00000000 0x0 Bin/ISO14443-3A.o - .bss 0x00000000 0x0 Bin/ISO14443-3A.o - .text 0x00000000 0x0 Bin/Crypto1.o - .text 0x00000000 0x0 Bin/HIDParser.o - .bss 0x00000000 0x0 Bin/HIDParser.o - .text.USB_ProcessHIDReport - 0x00000000 0x99a Bin/HIDParser.o - .progmem.gcc_sw_table.USB_ProcessHIDReport - 0x00000000 0x17a Bin/HIDParser.o - .text.USB_GetHIDReportItemInfo - 0x00000000 0xc6 Bin/HIDParser.o - .text.USB_SetHIDReportItemInfo - 0x00000000 0x110 Bin/HIDParser.o - .text.USB_GetHIDReportSize - 0x00000000 0x11c Bin/HIDParser.o - .text 0x00000000 0x0 Bin/ConfigDescriptors.o - .bss 0x00000000 0x0 Bin/ConfigDescriptors.o - .text.USB_GetNextDescriptorOfType - 0x00000000 0x52 Bin/ConfigDescriptors.o - .text.USB_GetNextDescriptorOfTypeBefore - 0x00000000 0x7c Bin/ConfigDescriptors.o - .text.USB_GetNextDescriptorOfTypeAfter - 0x00000000 0x3e Bin/ConfigDescriptors.o - .text.USB_GetNextDescriptorComp - 0x00000000 0x8e Bin/ConfigDescriptors.o - .text 0x00000000 0x0 Bin/DeviceStandardReq.o - .bss 0x00000000 0x0 Bin/DeviceStandardReq.o - .text 0x00000000 0x0 Bin/Events.o - .bss 0x00000000 0x0 Bin/Events.o - .text 0x00000000 0x0 Bin/HostStandardReq.o - .bss 0x00000000 0x0 Bin/HostStandardReq.o - .text 0x00000000 0x0 Bin/USBTask.o - .bss 0x00000000 0x0 Bin/USBTask.o - .text 0x00000000 0x0 Bin/Device_XMEGA.o - .bss 0x00000000 0x0 Bin/Device_XMEGA.o - .text.USB_Device_SendRemoteWakeup - 0x00000000 0xc Bin/Device_XMEGA.o - .text 0x00000000 0x0 Bin/EndpointStream_XMEGA.o - .bss 0x00000000 0x0 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Discard_Stream - 0x00000000 0xc8 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Null_Stream - 0x00000000 0xc2 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_Stream_BE - 0x00000000 0xe8 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_Stream_LE - 0x00000000 0xd8 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_Stream_BE - 0x00000000 0xe8 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_PStream_LE - 0x00000000 0xe0 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_PStream_BE - 0x00000000 0xea Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_EStream_LE - 0x00000000 0xe0 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_EStream_BE - 0x00000000 0xea Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_EStream_LE - 0x00000000 0xee Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_EStream_BE - 0x00000000 0xf8 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_Control_Stream_BE - 0x00000000 0x170 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_Control_Stream_LE - 0x00000000 0xe2 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_Control_Stream_BE - 0x00000000 0xd4 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_Control_PStream_BE - 0x00000000 0x170 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_Control_EStream_LE - 0x00000000 0x170 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Write_Control_EStream_BE - 0x00000000 0x172 Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_Control_EStream_LE - 0x00000000 0xec Bin/EndpointStream_XMEGA.o - .text.Endpoint_Read_Control_EStream_BE - 0x00000000 0xd8 Bin/EndpointStream_XMEGA.o - .text 0x00000000 0x0 Bin/Endpoint_XMEGA.o - .bss 0x00000000 0x0 Bin/Endpoint_XMEGA.o - .text 0x00000000 0x0 Bin/Host_XMEGA.o - .bss 0x00000000 0x0 Bin/Host_XMEGA.o - .text 0x00000000 0x0 Bin/PipeStream_XMEGA.o - .bss 0x00000000 0x0 Bin/PipeStream_XMEGA.o - .text 0x00000000 0x0 Bin/Pipe_XMEGA.o - .bss 0x00000000 0x0 Bin/Pipe_XMEGA.o - .text 0x00000000 0x0 Bin/USBController_XMEGA.o - .bss 0x00000000 0x0 Bin/USBController_XMEGA.o - .text 0x00000000 0x0 Bin/USBInterrupt_XMEGA.o - .bss 0x00000000 0x0 Bin/USBInterrupt_XMEGA.o - .text 0x00000000 0x0 Bin/AudioClassDevice.o - .bss 0x00000000 0x0 Bin/AudioClassDevice.o - .text.Audio_Device_ConfigureEndpoints - 0x00000000 0x32 Bin/AudioClassDevice.o - .text.Audio_Device_Event_Stub - 0x00000000 0x2 Bin/AudioClassDevice.o - .text.Audio_Device_ProcessControlRequest - 0x00000000 0x29e Bin/AudioClassDevice.o - .text 0x00000000 0x0 Bin/CDCClassDevice.o - .bss 0x00000000 0x0 Bin/CDCClassDevice.o - .text.CDC_Device_putchar - 0x00000000 0x22 Bin/CDCClassDevice.o - .text.CDC_Device_BytesReceived - 0x00000000 0xa4 Bin/CDCClassDevice.o - .text.CDC_Device_getchar - 0x00000000 0x14 Bin/CDCClassDevice.o - .text.CDC_Device_getchar_Blocking - 0x00000000 0x38 Bin/CDCClassDevice.o - .rodata 0x00000000 0x8 Bin/CDCClassDevice.o - .text.CDC_Device_SendControlLineStateChange - 0x00000000 0x7c Bin/CDCClassDevice.o - .text.CDC_Device_CreateStream - 0x00000000 0x26 Bin/CDCClassDevice.o - .text.CDC_Device_CreateBlockingStream - 0x00000000 0x26 Bin/CDCClassDevice.o - .text 0x00000000 0x0 Bin/HIDClassDevice.o - .bss 0x00000000 0x0 Bin/HIDClassDevice.o - .text.HID_Device_ProcessControlRequest - 0x00000000 0x240 Bin/HIDClassDevice.o - .text.HID_Device_ConfigureEndpoints - 0x00000000 0x28 Bin/HIDClassDevice.o - .text.HID_Device_USBTask - 0x00000000 0x1a8 Bin/HIDClassDevice.o - .text 0x00000000 0x0 Bin/MassStorageClassDevice.o - .bss 0x00000000 0x0 Bin/MassStorageClassDevice.o - .text.MS_Device_ProcessControlRequest - 0x00000000 0x70 Bin/MassStorageClassDevice.o - .text.MS_Device_ConfigureEndpoints - 0x00000000 0x3e Bin/MassStorageClassDevice.o - .text.MS_Device_USBTask - 0x00000000 0x2c2 Bin/MassStorageClassDevice.o - .text 0x00000000 0x0 Bin/MIDIClassDevice.o - .bss 0x00000000 0x0 Bin/MIDIClassDevice.o - .text.MIDI_Device_ConfigureEndpoints - 0x00000000 0x32 Bin/MIDIClassDevice.o - .text.MIDI_Device_SendEventPacket - 0x00000000 0x54 Bin/MIDIClassDevice.o - .text.MIDI_Device_Flush - 0x00000000 0x58 Bin/MIDIClassDevice.o - .text.MIDI_Device_USBTask - 0x00000000 0x2c Bin/MIDIClassDevice.o - .text.MIDI_Device_ReceiveEventPacket - 0x00000000 0x68 Bin/MIDIClassDevice.o - .text 0x00000000 0x0 Bin/PrinterClassDevice.o - .bss 0x00000000 0x0 Bin/PrinterClassDevice.o - .text.PRNT_Device_ConfigureEndpoints - 0x00000000 0x38 Bin/PrinterClassDevice.o - .text.PRNT_Device_SendString - 0x00000000 0x3e Bin/PrinterClassDevice.o - .text.PRNT_Device_SendData - 0x00000000 0x3c Bin/PrinterClassDevice.o - .text.PRNT_Device_SendByte - 0x00000000 0x5a Bin/PrinterClassDevice.o - .text.PRNT_Device_putchar - 0x00000000 0x22 Bin/PrinterClassDevice.o - .text.PRNT_Device_Flush - 0x00000000 0x74 Bin/PrinterClassDevice.o - .text.PRNT_Device_USBTask - 0x00000000 0xcc Bin/PrinterClassDevice.o - .text.PRNT_Device_BytesReceived - 0x00000000 0x94 Bin/PrinterClassDevice.o - .text.PRNT_Device_ReceiveByte - 0x00000000 0xb0 Bin/PrinterClassDevice.o - .text.PRNT_Device_getchar - 0x00000000 0x14 Bin/PrinterClassDevice.o - .text.PRNT_Device_getchar_Blocking - 0x00000000 0x38 Bin/PrinterClassDevice.o - .text.PRNT_Device_CreateStream - 0x00000000 0x26 Bin/PrinterClassDevice.o - .text.PRNT_Device_CreateBlockingStream - 0x00000000 0x26 Bin/PrinterClassDevice.o - .text.PRNT_Device_Event_Stub - 0x00000000 0x2 Bin/PrinterClassDevice.o - .text.PRNT_Device_ProcessControlRequest - 0x00000000 0xda Bin/PrinterClassDevice.o - .text 0x00000000 0x0 Bin/RNDISClassDevice.o - .bss 0x00000000 0x0 Bin/RNDISClassDevice.o - .text.RNDIS_Device_ProcessControlRequest - 0x00000000 0x52e Bin/RNDISClassDevice.o - .text.RNDIS_Device_ConfigureEndpoints - 0x00000000 0x50 Bin/RNDISClassDevice.o - .rodata 0x00000000 0x8 Bin/RNDISClassDevice.o - .text.RNDIS_Device_USBTask - 0x00000000 0x74 Bin/RNDISClassDevice.o - .text.RNDIS_Device_IsPacketReceived - 0x00000000 0x24 Bin/RNDISClassDevice.o - .text.RNDIS_Device_ReadPacket - 0x00000000 0xa2 Bin/RNDISClassDevice.o - .text.RNDIS_Device_SendPacket - 0x00000000 0xca Bin/RNDISClassDevice.o - .progmem.data 0x00000000 0x6c Bin/RNDISClassDevice.o - .text 0x00000000 0x0 Bin/AndroidAccessoryClassHost.o - .bss 0x00000000 0x0 Bin/AndroidAccessoryClassHost.o - .text 0x00000000 0x0 Bin/AudioClassHost.o - .bss 0x00000000 0x0 Bin/AudioClassHost.o - .text 0x00000000 0x0 Bin/CDCClassHost.o - .bss 0x00000000 0x0 Bin/CDCClassHost.o - .text 0x00000000 0x0 Bin/HIDClassHost.o - .bss 0x00000000 0x0 Bin/HIDClassHost.o - .text 0x00000000 0x0 Bin/MassStorageClassHost.o - .bss 0x00000000 0x0 Bin/MassStorageClassHost.o - .text 0x00000000 0x0 Bin/MIDIClassHost.o - .bss 0x00000000 0x0 Bin/MIDIClassHost.o - .text 0x00000000 0x0 Bin/PrinterClassHost.o - .bss 0x00000000 0x0 Bin/PrinterClassHost.o - .text 0x00000000 0x0 Bin/RNDISClassHost.o - .bss 0x00000000 0x0 Bin/RNDISClassHost.o - .text 0x00000000 0x0 Bin/StillImageClassHost.o - .bss 0x00000000 0x0 Bin/StillImageClassHost.o - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy_P.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy_P.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strcmp_P.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strcmp_P.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strncpy_P.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strncpy_P.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcmp.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcmp.o) - .text.avr-libc - 0x00000000 0x1a /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcmp.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memset.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memset.o) - .text.avr-libc - 0x00000000 0xe /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memset.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - .text.avr-libc - 0x00000000 0x20 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) - .text.avr-libc - 0x00000000 0x16 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen_P.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen_P.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(ultoa_invert.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(ultoa_invert.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text.libgcc.div - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .text 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .bss 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .text.libgcc.mul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .text.libgcc 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .text.libgcc.prologue - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .text.libgcc.builtins - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .text.libgcc.fmul - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - .text.libgcc.fixed - 0x00000000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - -Memory Configuration - -Name Origin Length Attributes -text 0x00000000 0x00100000 xr -data 0x00802000 0x0000ffa0 rw !x -eeprom 0x00810000 0x00010000 rw !x -fuse 0x00820000 0x00000400 rw !x -lock 0x00830000 0x00000400 rw !x -signature 0x00840000 0x00000400 rw !x -user_signatures 0x00850000 0x00000400 rw !x -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -LOAD Bin/Chameleon-Mini.o -LOAD Bin/LUFADescriptors.o -LOAD Bin/System.o -LOAD Bin/Configuration.o -LOAD Bin/Random.o -LOAD Bin/Common.o -LOAD Bin/Memory.o -LOAD Bin/Button.o -LOAD Bin/Settings.o -LOAD Bin/LED.o -LOAD Bin/Terminal.o -LOAD Bin/Commands.o -LOAD Bin/XModem.o -LOAD Bin/CommandLine.o -LOAD Bin/Codec.o -LOAD Bin/ISO14443-2A.o -LOAD Bin/MifareClassic.o -LOAD Bin/ISO14443-3A.o -LOAD Bin/Crypto1.o -LOAD Bin/HIDParser.o -LOAD Bin/ConfigDescriptors.o -LOAD Bin/DeviceStandardReq.o -LOAD Bin/Events.o -LOAD Bin/HostStandardReq.o -LOAD Bin/USBTask.o -LOAD Bin/Device_XMEGA.o -LOAD Bin/EndpointStream_XMEGA.o -LOAD Bin/Endpoint_XMEGA.o -LOAD Bin/Host_XMEGA.o -LOAD Bin/PipeStream_XMEGA.o -LOAD Bin/Pipe_XMEGA.o -LOAD Bin/USBController_XMEGA.o -LOAD Bin/USBInterrupt_XMEGA.o -LOAD Bin/AudioClassDevice.o -LOAD Bin/CDCClassDevice.o -LOAD Bin/HIDClassDevice.o -LOAD Bin/MassStorageClassDevice.o -LOAD Bin/MIDIClassDevice.o -LOAD Bin/PrinterClassDevice.o -LOAD Bin/RNDISClassDevice.o -LOAD Bin/AndroidAccessoryClassHost.o -LOAD Bin/AudioClassHost.o -LOAD Bin/CDCClassHost.o -LOAD Bin/HIDClassHost.o -LOAD Bin/MassStorageClassHost.o -LOAD Bin/MIDIClassHost.o -LOAD Bin/PrinterClassHost.o -LOAD Bin/RNDISClassHost.o -LOAD Bin/StillImageClassHost.o -LOAD /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libm.a -START GROUP -LOAD /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a -LOAD /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libm.a -LOAD /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a -END GROUP - -.hash - *(.hash) - -.dynsym - *(.dynsym) - -.dynstr - *(.dynstr) - -.gnu.version - *(.gnu.version) - -.gnu.version_d - *(.gnu.version_d) - -.gnu.version_r - *(.gnu.version_r) - -.rel.init - *(.rel.init) - -.rela.init - *(.rela.init) - -.rel.text - *(.rel.text) - *(.rel.text.*) - *(.rel.gnu.linkonce.t*) - -.rela.text - *(.rela.text) - *(.rela.text.*) - *(.rela.gnu.linkonce.t*) - -.rel.fini - *(.rel.fini) - -.rela.fini - *(.rela.fini) - -.rel.rodata - *(.rel.rodata) - *(.rel.rodata.*) - *(.rel.gnu.linkonce.r*) - -.rela.rodata - *(.rela.rodata) - *(.rela.rodata.*) - *(.rela.gnu.linkonce.r*) - -.rel.data - *(.rel.data) - *(.rel.data.*) - *(.rel.gnu.linkonce.d*) - -.rela.data - *(.rela.data) - *(.rela.data.*) - *(.rela.gnu.linkonce.d*) - -.rel.ctors - *(.rel.ctors) - -.rela.ctors - *(.rela.ctors) - -.rel.dtors - *(.rel.dtors) - -.rela.dtors - *(.rela.dtors) - -.rel.got - *(.rel.got) - -.rela.got - *(.rela.got) - -.rel.bss - *(.rel.bss) - -.rela.bss - *(.rela.bss) - -.rel.plt - *(.rel.plt) - -.rela.plt - *(.rela.plt) - -.text 0x00000000 0x4e9a - *(.vectors) - .vectors 0x00000000 0x1fc /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - 0x00000000 __vectors - *(.vectors) - *(.progmem.gcc*) - .progmem.gcc_sw_table.XModemProcessByte - 0x000001fc 0x12 Bin/XModem.o - .progmem.gcc_sw_table.__vector_83 - 0x0000020e 0x16 Bin/ISO14443-2A.o - .progmem.gcc_sw_table.MifareClassicAppProcess - 0x00000224 0x14 Bin/MifareClassic.o - .progmem.gcc_sw_table.USB_Device_ProcessControlRequest - 0x00000238 0x14 Bin/DeviceStandardReq.o - 0x0000024c . = ALIGN (0x2) - 0x0000024c __trampolines_start = . - *(.trampolines) - .trampolines 0x0000024c 0x0 linker stubs - *(.trampolines*) - 0x0000024c __trampolines_end = . - *(.progmem*) - .progmem.data 0x0000024c 0x8c Bin/LUFADescriptors.o - 0x0000024c ProductString - 0x0000026a ManufacturerString - 0x00000284 LanguageString - 0x00000288 ConfigurationDescriptor - 0x000002c6 DeviceDescriptor - .progmem.data 0x000002d8 0x6f Bin/Configuration.o - .progmem.data 0x00000347 0x120 Bin/Button.o - .progmem.data 0x00000467 0x64 Bin/Commands.o - .progmem.data 0x000004cb 0x22c Bin/CommandLine.o - 0x00000597 CommandTable - 0x000006f8 . = ALIGN (0x2) - *fill* 0x000006f7 0x1 - *(.jumptables) - *(.jumptables*) - *(.lowtext) - *(.lowtext*) - 0x000006f8 __ctors_start = . - *(.ctors) - 0x000006f8 __ctors_end = . - 0x000006f8 __dtors_start = . - *(.dtors) - 0x000006f8 __dtors_end = . - SORT(*)(.ctors) - SORT(*)(.dtors) - *(.init0) - .init0 0x000006f8 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - 0x000006f8 __init - *(.init0) - *(.init1) - *(.init1) - *(.init2) - .init2 0x000006f8 0xc /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - *(.init2) - *(.init3) - *(.init3) - *(.init4) - .init4 0x00000704 0x16 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - 0x00000704 __do_copy_data - .init4 0x0000071a 0x10 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - 0x0000071a __do_clear_bss - *(.init4) - *(.init5) - *(.init5) - *(.init6) - *(.init6) - *(.init7) - *(.init7) - *(.init8) - *(.init8) - *(.init9) - .init9 0x0000072a 0x6 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - *(.init9) - *(.text) - .text 0x00000730 0x2 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - 0x00000730 __vector_38 - 0x00000730 __vector_104 - 0x00000730 __vector_63 - 0x00000730 __vector_28 - 0x00000730 __vector_67 - 0x00000730 __vector_1 - 0x00000730 __vector_119 - 0x00000730 __vector_32 - 0x00000730 __vector_75 - 0x00000730 __vector_71 - 0x00000730 __vector_91 - 0x00000730 __vector_62 - 0x00000730 __vector_77 - 0x00000730 __vector_102 - 0x00000730 __vector_24 - 0x00000730 __vector_12 - 0x00000730 __vector_55 - 0x00000730 __vector_69 - 0x00000730 __vector_81 - 0x00000730 __vector_90 - 0x00000730 __vector_46 - 0x00000730 __bad_interrupt - 0x00000730 __vector_122 - 0x00000730 __vector_72 - 0x00000730 __vector_114 - 0x00000730 __vector_6 - 0x00000730 __vector_110 - 0x00000730 __vector_31 - 0x00000730 __vector_92 - 0x00000730 __vector_35 - 0x00000730 __vector_78 - 0x00000730 __vector_74 - 0x00000730 __vector_117 - 0x00000730 __vector_39 - 0x00000730 __vector_107 - 0x00000730 __vector_3 - 0x00000730 __vector_105 - 0x00000730 __vector_98 - 0x00000730 __vector_23 - 0x00000730 __vector_68 - 0x00000730 __vector_30 - 0x00000730 __vector_73 - 0x00000730 __vector_45 - 0x00000730 __vector_25 - 0x00000730 __vector_93 - 0x00000730 __vector_61 - 0x00000730 __vector_11 - 0x00000730 __vector_54 - 0x00000730 __vector_99 - 0x00000730 __vector_13 - 0x00000730 __vector_17 - 0x00000730 __vector_19 - 0x00000730 __vector_56 - 0x00000730 __vector_7 - 0x00000730 __vector_49 - 0x00000730 __vector_123 - 0x00000730 __vector_41 - 0x00000730 __vector_86 - 0x00000730 __vector_100 - 0x00000730 __vector_101 - 0x00000730 __vector_64 - 0x00000730 __vector_88 - 0x00000730 __vector_109 - 0x00000730 __vector_43 - 0x00000730 __vector_27 - 0x00000730 __vector_5 - 0x00000730 __vector_113 - 0x00000730 __vector_33 - 0x00000730 __vector_76 - 0x00000730 __vector_115 - 0x00000730 __vector_47 - 0x00000730 __vector_52 - 0x00000730 __vector_37 - 0x00000730 __vector_95 - 0x00000730 __vector_103 - 0x00000730 __vector_96 - 0x00000730 __vector_89 - 0x00000730 __vector_108 - 0x00000730 __vector_4 - 0x00000730 __vector_44 - 0x00000730 __vector_82 - 0x00000730 __vector_106 - 0x00000730 __vector_118 - 0x00000730 __vector_51 - 0x00000730 __vector_9 - 0x00000730 __vector_2 - 0x00000730 __vector_21 - 0x00000730 __vector_15 - 0x00000730 __vector_66 - 0x00000730 __vector_36 - 0x00000730 __vector_79 - 0x00000730 __vector_58 - 0x00000730 __vector_70 - 0x00000730 __vector_29 - 0x00000730 __vector_60 - 0x00000730 __vector_121 - 0x00000730 __vector_40 - 0x00000730 __vector_85 - 0x00000730 __vector_94 - 0x00000730 __vector_126 - 0x00000730 __vector_8 - 0x00000730 __vector_26 - 0x00000730 __vector_48 - 0x00000730 __vector_124 - 0x00000730 __vector_116 - 0x00000730 __vector_112 - 0x00000730 __vector_111 - 0x00000730 __vector_80 - 0x00000730 __vector_14 - 0x00000730 __vector_84 - 0x00000730 __vector_57 - 0x00000730 __vector_53 - 0x00000730 __vector_10 - 0x00000730 __vector_50 - 0x00000730 __vector_16 - 0x00000730 __vector_59 - 0x00000730 __vector_18 - 0x00000730 __vector_97 - 0x00000730 __vector_20 - 0x00000730 __vector_42 - 0x00000730 __vector_87 - 0x00000730 __vector_65 - 0x00000730 __vector_120 - 0x00000732 . = ALIGN (0x2) - *(.text.*) - .text.startup.main - 0x00000732 0x76 Bin/Chameleon-Mini.o - 0x00000732 main - .text.CALLBACK_USB_GetDescriptor - 0x000007a8 0x7c Bin/LUFADescriptors.o - 0x000007a8 CALLBACK_USB_GetDescriptor - .text.__vector_default - 0x00000824 0xc Bin/System.o - 0x00000824 __vector_default - .text.SystemInit - 0x00000830 0x6e Bin/System.o - 0x00000830 SystemInit - .text.SystemReset - 0x0000089e 0xe Bin/System.o - 0x0000089e SystemReset - .text.SystemEnterBootloader - 0x000008ac 0xc Bin/System.o - 0x000008ac SystemEnterBootloader - .text.SystemStartUSBClock - 0x000008b8 0x32 Bin/System.o - 0x000008b8 SystemStartUSBClock - .text.SystemStopUSBClock - 0x000008ea 0x1c Bin/System.o - 0x000008ea SystemStopUSBClock - .text.SystemInterruptInit - 0x00000906 0xc Bin/System.o - 0x00000906 SystemInterruptInit - .text.CodecInitDummy - 0x00000912 0x2 Bin/Configuration.o - .text.CodecTaskDummy - 0x00000914 0x2 Bin/Configuration.o - .text.ApplicationInitDummy - 0x00000916 0x2 Bin/Configuration.o - .text.ApplicationResetDummy - 0x00000918 0x2 Bin/Configuration.o - .text.ApplicationTaskDummy - 0x0000091a 0x2 Bin/Configuration.o - .text.ApplicationProcessDummy - 0x0000091c 0x6 Bin/Configuration.o - .text.ApplicationGetUidDummy - 0x00000922 0x2 Bin/Configuration.o - .text.ApplicationSetUidDummy - 0x00000924 0x2 Bin/Configuration.o - .text.ConfigurationSetById - 0x00000926 0x36 Bin/Configuration.o - 0x00000926 ConfigurationSetById - .text.ConfigurationInit - 0x0000095c 0xc Bin/Configuration.o - 0x0000095c ConfigurationInit - .text.ConfigurationSetByName - 0x00000968 0x7a Bin/Configuration.o - 0x00000968 ConfigurationSetByName - .text.ConfigurationGetList - 0x000009e2 0x74 Bin/Configuration.o - 0x000009e2 ConfigurationGetList - .text.RandomInit - 0x00000a56 0x2 Bin/Random.o - 0x00000a56 RandomInit - .text.RandomGetByte - 0x00000a58 0x6 Bin/Random.o - 0x00000a58 RandomGetByte - .text.RandomGetBuffer - 0x00000a5e 0x20 Bin/Random.o - 0x00000a5e RandomGetBuffer - .text.RandomTick - 0x00000a7e 0x10 Bin/Random.o - 0x00000a7e RandomTick - .text.BufferToHexString - 0x00000a8e 0x86 Bin/Common.o - 0x00000a8e BufferToHexString - .text.HexStringToBuffer - 0x00000b14 0x94 Bin/Common.o - 0x00000b14 HexStringToBuffer - .text.MemoryReadBlock - 0x00000ba8 0x30 Bin/Memory.o - 0x00000ba8 MemoryReadBlock - .text.MemoryWriteBlock - 0x00000bd8 0x2e Bin/Memory.o - 0x00000bd8 MemoryWriteBlock - .text.MemoryClear - 0x00000c06 0x16 Bin/Memory.o - 0x00000c06 MemoryClear - .text.MemoryRecall - 0x00000c1c 0xec Bin/Memory.o - 0x00000c1c MemoryRecall - .text.MemoryInit - 0x00000d08 0xfc Bin/Memory.o - 0x00000d08 MemoryInit - .text.MemoryStore - 0x00000e04 0x27a Bin/Memory.o - 0x00000e04 MemoryStore - .text.MemoryUploadBlock - 0x0000107e 0x392 Bin/Memory.o - 0x0000107e MemoryUploadBlock - .text.MemoryDownloadBlock - 0x00001410 0x7a Bin/Memory.o - 0x00001410 MemoryDownloadBlock - .text.ButtonInit - 0x0000148a 0xe Bin/Button.o - 0x0000148a ButtonInit - .text.ButtonTick - 0x00001498 0x1ba Bin/Button.o - 0x00001498 ButtonTick - .text.ButtonGetActionList - 0x00001652 0x72 Bin/Button.o - 0x00001652 ButtonGetActionList - .text.ButtonGetActionByName - 0x000016c4 0x1c Bin/Button.o - 0x000016c4 ButtonGetActionByName - .text.ButtonSetActionByName - 0x000016e0 0xc0 Bin/Button.o - 0x000016e0 ButtonSetActionByName - .text.SettingsLoad - 0x000017a0 0x10 Bin/Settings.o - 0x000017a0 SettingsLoad - .text.SettingsSave - 0x000017b0 0x10 Bin/Settings.o - 0x000017b0 SettingsSave - .text.SettingsSetActiveById - 0x000017c0 0x3c Bin/Settings.o - 0x000017c0 SettingsSetActiveById - .text.SettingsCycle - 0x000017fc 0xda Bin/Settings.o - 0x000017fc SettingsCycle - .text.SettingsGetActiveByName - 0x000018d6 0xe Bin/Settings.o - 0x000018d6 SettingsGetActiveByName - .text.SettingsSetActiveByName - 0x000018e4 0x1a Bin/Settings.o - 0x000018e4 SettingsSetActiveByName - .text.TerminalSendString - 0x000018fe 0xa Bin/Terminal.o - 0x000018fe TerminalSendString - .text.TerminalSendStringP - 0x00001908 0x28 Bin/Terminal.o - 0x00001908 TerminalSendStringP - .text.TerminalSendBlock - 0x00001930 0xc Bin/Terminal.o - 0x00001930 TerminalSendBlock - .text.TerminalInit - 0x0000193c 0xa Bin/Terminal.o - 0x0000193c TerminalInit - .text.TerminalTask - 0x00001946 0x3e Bin/Terminal.o - 0x00001946 TerminalTask - .text.TerminalTick - 0x00001984 0x80 Bin/Terminal.o - 0x00001984 TerminalTick - .text.EVENT_USB_Device_Connect - 0x00001a04 0xa Bin/Terminal.o - 0x00001a04 EVENT_USB_Device_Connect - .text.EVENT_USB_Device_Disconnect - 0x00001a0e 0xa Bin/Terminal.o - 0x00001a0e EVENT_USB_Device_Disconnect - .text.EVENT_USB_Device_ConfigurationChanged - 0x00001a18 0x8 Bin/Terminal.o - 0x00001a18 EVENT_USB_Device_ConfigurationChanged - .text.EVENT_USB_Device_ControlRequest - 0x00001a20 0x8 Bin/Terminal.o - 0x00001a20 EVENT_USB_Device_ControlRequest - .text.CommandGetVersion - 0x00001a28 0x3c Bin/Commands.o - 0x00001a28 CommandGetVersion - .text.CommandGetConfig - 0x00001a64 0x2c Bin/Commands.o - 0x00001a64 CommandGetConfig - .text.CommandSetConfig - 0x00001a90 0x12 Bin/Commands.o - 0x00001a90 CommandSetConfig - .text.CommandExecConfig - 0x00001aa2 0xc Bin/Commands.o - 0x00001aa2 CommandExecConfig - .text.CommandGetUid - 0x00001aae 0x54 Bin/Commands.o - 0x00001aae CommandGetUid - .text.CommandSetUid - 0x00001b02 0xa4 Bin/Commands.o - 0x00001b02 CommandSetUid - .text.CommandGetReadOnly - 0x00001ba6 0x24 Bin/Commands.o - 0x00001ba6 CommandGetReadOnly - .text.CommandSetReadOnly - 0x00001bca 0x28 Bin/Commands.o - 0x00001bca CommandSetReadOnly - .text.CommandExecUpload - 0x00001bf2 0xa Bin/Commands.o - 0x00001bf2 CommandExecUpload - .text.CommandExecDownload - 0x00001bfc 0xa Bin/Commands.o - 0x00001bfc CommandExecDownload - .text.CommandExecReset - 0x00001c06 0x16 Bin/Commands.o - 0x00001c06 CommandExecReset - .text.CommandExecUpgrade - 0x00001c1c 0x16 Bin/Commands.o - 0x00001c1c CommandExecUpgrade - .text.CommandGetMemSize - 0x00001c32 0x30 Bin/Commands.o - 0x00001c32 CommandGetMemSize - .text.CommandGetUidSize - 0x00001c62 0x2c Bin/Commands.o - 0x00001c62 CommandGetUidSize - .text.CommandExecButton - 0x00001c8e 0xa Bin/Commands.o - 0x00001c8e CommandExecButton - .text.CommandGetButton - 0x00001c98 0xa Bin/Commands.o - 0x00001c98 CommandGetButton - .text.CommandSetButton - 0x00001ca2 0x10 Bin/Commands.o - 0x00001ca2 CommandSetButton - .text.CommandGetSetting - 0x00001cb2 0xa Bin/Commands.o - 0x00001cb2 CommandGetSetting - .text.CommandSetSetting - 0x00001cbc 0x10 Bin/Commands.o - 0x00001cbc CommandSetSetting - .text.CommandExecClear - 0x00001ccc 0x8 Bin/Commands.o - 0x00001ccc CommandExecClear - .text.CommandExecHelp - 0x00001cd4 0x94 Bin/Commands.o - 0x00001cd4 CommandExecHelp - .text.CommandGetRssi - 0x00001d68 0x68 Bin/Commands.o - 0x00001d68 CommandGetRssi - .text.XModemReceive - 0x00001dd0 0x30 Bin/XModem.o - 0x00001dd0 XModemReceive - .text.XModemSend - 0x00001e00 0x26 Bin/XModem.o - 0x00001e00 XModemSend - .text.XModemProcessByte - 0x00001e26 0x2c2 Bin/XModem.o - 0x00001e26 XModemProcessByte - .text.XModemTick - 0x000020e8 0x5c Bin/XModem.o - 0x000020e8 XModemTick - .text.CommandLineProcessByte - 0x00002144 0x34c Bin/CommandLine.o - 0x00002144 CommandLineProcessByte - .text.CommandLineTick - 0x00002490 0x2 Bin/CommandLine.o - 0x00002490 CommandLineTick - .text.StartDemod - 0x00002492 0x3c Bin/ISO14443-2A.o - .text.__vector_34 - 0x000024ce 0x88 Bin/ISO14443-2A.o - 0x000024ce __vector_34 - .text.__vector_22 - 0x00002556 0x174 Bin/ISO14443-2A.o - 0x00002556 __vector_22 - .text.__vector_83 - 0x000026ca 0x1bc Bin/ISO14443-2A.o - 0x000026ca __vector_83 - .text.ISO14443ACodecInit - 0x00002886 0x6e Bin/ISO14443-2A.o - 0x00002886 ISO14443ACodecInit - .text.ISO14443ACodecTask - 0x000028f4 0xf6 Bin/ISO14443-2A.o - 0x000028f4 ISO14443ACodecTask - .text.MifareClassicAppInit1K - 0x000029ea 0x1a Bin/MifareClassic.o - 0x000029ea MifareClassicAppInit1K - .text.MifareClassicAppInit4K - 0x00002a04 0x1a Bin/MifareClassic.o - 0x00002a04 MifareClassicAppInit4K - .text.MifareClassicAppReset - 0x00002a1e 0x8 Bin/MifareClassic.o - 0x00002a1e MifareClassicAppReset - .text.MifareClassicAppTask - 0x00002a26 0x2 Bin/MifareClassic.o - 0x00002a26 MifareClassicAppTask - .text.MifareClassicAppProcess - 0x00002a28 0x7a6 Bin/MifareClassic.o - 0x00002a28 MifareClassicAppProcess - .text.MifareClassicGetUid - 0x000031ce 0xc Bin/MifareClassic.o - 0x000031ce MifareClassicGetUid - .text.MifareClassicSetUid - 0x000031da 0x40 Bin/MifareClassic.o - 0x000031da MifareClassicSetUid - .text.ISO14443AAppendCRCA - 0x0000321a 0x5c Bin/ISO14443-3A.o - 0x0000321a ISO14443AAppendCRCA - .text.ISO14443ACheckCRCA - 0x00003276 0x7c Bin/ISO14443-3A.o - 0x00003276 ISO14443ACheckCRCA - .text.Crypto1LFSR - 0x000032f2 0x8c Bin/Crypto1.o - .text.Crypto1FilterOutput - 0x0000337e 0x64 Bin/Crypto1.o - 0x0000337e Crypto1FilterOutput - .text.Crypto1Setup - 0x000033e2 0x19a Bin/Crypto1.o - 0x000033e2 Crypto1Setup - .text.Crypto1Auth - 0x0000357c 0x4a Bin/Crypto1.o - 0x0000357c Crypto1Auth - .text.Crypto1Byte - 0x000035c6 0x26 Bin/Crypto1.o - 0x000035c6 Crypto1Byte - .text.Crypto1Nibble - 0x000035ec 0x26 Bin/Crypto1.o - 0x000035ec Crypto1Nibble - .text.Crypto1PRNG - 0x00003612 0xa0 Bin/Crypto1.o - 0x00003612 Crypto1PRNG - .text.USB_Device_ProcessControlRequest - 0x000036b2 0x240 Bin/DeviceStandardReq.o - 0x000036b2 USB_Device_ProcessControlRequest - .text.USB_Event_Stub - 0x000038f2 0x2 Bin/Events.o - 0x000038f2 EVENT_USB_Device_WakeUp - 0x000038f2 USB_Event_Stub - 0x000038f2 EVENT_USB_Device_Suspend - 0x000038f2 EVENT_USB_Device_StartOfFrame - 0x000038f2 EVENT_USB_Device_Reset - .text.USB_USBTask - 0x000038f4 0x2a Bin/USBTask.o - 0x000038f4 USB_USBTask - .text.Endpoint_Write_Stream_LE - 0x0000391e 0xc8 Bin/EndpointStream_XMEGA.o - 0x0000391e Endpoint_Write_Stream_LE - .text.Endpoint_Write_Control_Stream_LE - 0x000039e6 0x12a Bin/EndpointStream_XMEGA.o - 0x000039e6 Endpoint_Write_Control_Stream_LE - .text.Endpoint_Write_Control_PStream_LE - 0x00003b10 0x158 Bin/EndpointStream_XMEGA.o - 0x00003b10 Endpoint_Write_Control_PStream_LE - .text.Endpoint_ClearIN - 0x00003c68 0x32 Bin/Endpoint_XMEGA.o - 0x00003c68 Endpoint_ClearIN - .text.Endpoint_ClearOUT - 0x00003c9a 0x1e Bin/Endpoint_XMEGA.o - 0x00003c9a Endpoint_ClearOUT - .text.Endpoint_Read_8 - 0x00003cb8 0x20 Bin/Endpoint_XMEGA.o - 0x00003cb8 Endpoint_Read_8 - .text.Endpoint_Write_8 - 0x00003cd8 0x20 Bin/Endpoint_XMEGA.o - 0x00003cd8 Endpoint_Write_8 - .text.Endpoint_SelectEndpoint - 0x00003cf8 0x72 Bin/Endpoint_XMEGA.o - 0x00003cf8 Endpoint_SelectEndpoint - .text.Endpoint_IsINReady - 0x00003d6a 0x18 Bin/Endpoint_XMEGA.o - 0x00003d6a Endpoint_IsINReady - .text.Endpoint_IsOUTReceived - 0x00003d82 0x32 Bin/Endpoint_XMEGA.o - 0x00003d82 Endpoint_IsOUTReceived - .text.Endpoint_IsSETUPReceived - 0x00003db4 0x32 Bin/Endpoint_XMEGA.o - 0x00003db4 Endpoint_IsSETUPReceived - .text.Endpoint_ClearSETUP - 0x00003de6 0x58 Bin/Endpoint_XMEGA.o - 0x00003de6 Endpoint_ClearSETUP - .text.Endpoint_StallTransaction - 0x00003e3e 0x38 Bin/Endpoint_XMEGA.o - 0x00003e3e Endpoint_StallTransaction - .text.Endpoint_ConfigureEndpoint_PRV - 0x00003e76 0x96 Bin/Endpoint_XMEGA.o - 0x00003e76 Endpoint_ConfigureEndpoint_PRV - .text.Endpoint_ConfigureEndpointTable - 0x00003f0c 0xd8 Bin/Endpoint_XMEGA.o - 0x00003f0c Endpoint_ConfigureEndpointTable - .text.Endpoint_ClearEndpoints - 0x00003fe4 0x70 Bin/Endpoint_XMEGA.o - 0x00003fe4 Endpoint_ClearEndpoints - .text.Endpoint_ClearStatusStage - 0x00004054 0x2c Bin/Endpoint_XMEGA.o - 0x00004054 Endpoint_ClearStatusStage - .text.Endpoint_WaitUntilReady - 0x00004080 0xa6 Bin/Endpoint_XMEGA.o - 0x00004080 Endpoint_WaitUntilReady - .text.USB_Disable - 0x00004126 0x1a Bin/USBController_XMEGA.o - 0x00004126 USB_Disable - .text.USB_ResetInterface - 0x00004140 0x5c Bin/USBController_XMEGA.o - 0x00004140 USB_ResetInterface - .text.USB_Init - 0x0000419c 0x50 Bin/USBController_XMEGA.o - 0x0000419c USB_Init - .text.USB_INT_DisableAllInterrupts - 0x000041ec 0xe Bin/USBInterrupt_XMEGA.o - 0x000041ec USB_INT_DisableAllInterrupts - .text.USB_INT_ClearAllInterrupts - 0x000041fa 0xc Bin/USBInterrupt_XMEGA.o - 0x000041fa USB_INT_ClearAllInterrupts - .text.__vector_125 - 0x00004206 0xda Bin/USBInterrupt_XMEGA.o - 0x00004206 __vector_125 - .text.CDC_Device_ConfigureEndpoints - 0x000042e0 0x4a Bin/CDCClassDevice.o - 0x000042e0 CDC_Device_ConfigureEndpoints - .text.CDC_Device_SendString - 0x0000432a 0x4a Bin/CDCClassDevice.o - 0x0000432a CDC_Device_SendString - .text.CDC_Device_SendData - 0x00004374 0x54 Bin/CDCClassDevice.o - 0x00004374 CDC_Device_SendData - .text.CDC_Device_SendByte - 0x000043c8 0x6a Bin/CDCClassDevice.o - 0x000043c8 CDC_Device_SendByte - .text.CDC_Device_Flush - 0x00004432 0x7c Bin/CDCClassDevice.o - 0x00004432 CDC_Device_Flush - .text.CDC_Device_USBTask - 0x000044ae 0x36 Bin/CDCClassDevice.o - 0x000044ae CDC_Device_USBTask - .text.CDC_Device_ReceiveByte - 0x000044e4 0xb8 Bin/CDCClassDevice.o - 0x000044e4 CDC_Device_ReceiveByte - .text.CDC_Device_Event_Stub - 0x0000459c 0x2 Bin/CDCClassDevice.o - 0x0000459c EVENT_CDC_Device_LineEncodingChanged - 0x0000459c EVENT_CDC_Device_ControLineStateChanged - 0x0000459c EVENT_CDC_Device_BreakSent - 0x0000459c CDC_Device_Event_Stub - .text.CDC_Device_ProcessControlRequest - 0x0000459e 0x134 Bin/CDCClassDevice.o - 0x0000459e CDC_Device_ProcessControlRequest - .text.libgcc 0x000046d2 0xc /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - 0x000046d2 __tablejump2__ - 0x000046d6 __tablejump__ - .text.libgcc.mul - 0x000046de 0xc /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - 0x000046de __mulshisi3 - 0x000046e2 __mulohisi3 - .text.libgcc.mul - 0x000046ea 0x14 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - 0x000046ea __muluhisi3 - .text.libgcc.mul - 0x000046fe 0x1e /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - 0x000046fe __umulhisi3 - .text.avr-libc - 0x0000471c 0xae /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - 0x000047ac rand_r - 0x000047ae rand - 0x000047b4 srand - .text.avr-libc - 0x000047ca 0x12 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy_P.o) - 0x000047ca memcpy_P - .text.avr-libc - 0x000047dc 0x12 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strcmp_P.o) - 0x000047dc strcmp_P - .text.avr-libc - 0x000047ee 0x1e /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strncpy_P.o) - 0x000047ee strncpy_P - .text.avr-libc - 0x0000480c 0x12 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy.o) - 0x0000480c memcpy - .text.avr-libc - 0x0000481e 0x5a /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - 0x0000481e snprintf_P - .text.avr-libc - 0x00004878 0x386 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - 0x00004878 vfprintf - .text.avr-libc - 0x00004bfe 0x16 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - 0x00004bfe __eerd_block_x32a4u - .text.avr-libc - 0x00004c14 0x12 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - 0x00004c14 __eewr_block_x32a4u - .text.avr-libc - 0x00004c26 0x46 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) - 0x00004c26 __eewr_byte_x32a4u - 0x00004c28 __eewr_r18_x32a4u - .text.avr-libc - 0x00004c6c 0x16 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen_P.o) - 0x00004c6c strnlen_P - .text.avr-libc - 0x00004c82 0x16 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen.o) - 0x00004c82 strnlen - .text.avr-libc - 0x00004c98 0x64 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - 0x00004c98 fputc - .text.avr-libc - 0x00004cfc 0xbc /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(ultoa_invert.o) - 0x00004cfc __ultoa_invert - .text.libgcc.div - 0x00004db8 0x28 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - 0x00004db8 __divmodsi4 - .text.libgcc.div - 0x00004de0 0x10 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - 0x00004de0 __negsi2 - .text.libgcc.prologue - 0x00004df0 0x32 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - 0x00004df0 __prologue_saves__ - .text.libgcc.prologue - 0x00004e22 0x30 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - 0x00004e22 __epilogue_restores__ - .text.libgcc.div - 0x00004e52 0x44 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - 0x00004e52 __udivmodsi4 - 0x00004e96 . = ALIGN (0x2) - *(.fini9) - .fini9 0x00004e96 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - 0x00004e96 exit - 0x00004e96 _exit - *(.fini9) - *(.fini8) - *(.fini8) - *(.fini7) - *(.fini7) - *(.fini6) - *(.fini6) - *(.fini5) - *(.fini5) - *(.fini4) - *(.fini4) - *(.fini3) - *(.fini3) - *(.fini2) - *(.fini2) - *(.fini1) - *(.fini1) - *(.fini0) - .fini0 0x00004e96 0x4 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - *(.fini0) - 0x00004e9a _etext = . - -.data 0x00802000 0x92 load address 0x00004e9a - 0x00802000 PROVIDE (__data_start, .) - *(.data) - .data 0x00802000 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o - .data 0x00802000 0x0 Bin/Chameleon-Mini.o - .data 0x00802000 0x0 Bin/LUFADescriptors.o - .data 0x00802000 0x0 Bin/System.o - .data 0x00802000 0x0 Bin/Configuration.o - .data 0x00802000 0x0 Bin/Random.o - .data 0x00802000 0x0 Bin/Common.o - .data 0x00802000 0x0 Bin/Memory.o - .data 0x00802000 0x0 Bin/Button.o - .data 0x00802000 0x0 Bin/Settings.o - .data 0x00802000 0x0 Bin/LED.o - .data 0x00802000 0x1c Bin/Terminal.o - 0x00802001 TerminalHandle - .data 0x0080201c 0x0 Bin/Commands.o - .data 0x0080201c 0x0 Bin/XModem.o - .data 0x0080201c 0x0 Bin/CommandLine.o - .data 0x0080201c 0x0 Bin/Codec.o - .data 0x0080201c 0x0 Bin/ISO14443-2A.o - .data 0x0080201c 0x0 Bin/MifareClassic.o - .data 0x0080201c 0x0 Bin/ISO14443-3A.o - .data 0x0080201c 0x0 Bin/Crypto1.o - .data 0x0080201c 0x0 Bin/HIDParser.o - .data 0x0080201c 0x0 Bin/ConfigDescriptors.o - .data 0x0080201c 0x0 Bin/DeviceStandardReq.o - .data 0x0080201c 0x0 Bin/Events.o - .data 0x0080201c 0x0 Bin/HostStandardReq.o - .data 0x0080201c 0x0 Bin/USBTask.o - .data 0x0080201c 0x0 Bin/Device_XMEGA.o - .data 0x0080201c 0x0 Bin/EndpointStream_XMEGA.o - .data 0x0080201c 0x0 Bin/Endpoint_XMEGA.o - .data 0x0080201c 0x0 Bin/Host_XMEGA.o - .data 0x0080201c 0x0 Bin/PipeStream_XMEGA.o - .data 0x0080201c 0x0 Bin/Pipe_XMEGA.o - .data 0x0080201c 0x0 Bin/USBController_XMEGA.o - .data 0x0080201c 0x0 Bin/USBInterrupt_XMEGA.o - .data 0x0080201c 0x0 Bin/AudioClassDevice.o - .data 0x0080201c 0x0 Bin/CDCClassDevice.o - .data 0x0080201c 0x0 Bin/HIDClassDevice.o - .data 0x0080201c 0x0 Bin/MassStorageClassDevice.o - .data 0x0080201c 0x0 Bin/MIDIClassDevice.o - .data 0x0080201c 0x0 Bin/PrinterClassDevice.o - .data 0x0080201c 0x0 Bin/RNDISClassDevice.o - .data 0x0080201c 0x0 Bin/AndroidAccessoryClassHost.o - .data 0x0080201c 0x0 Bin/AudioClassHost.o - .data 0x0080201c 0x0 Bin/CDCClassHost.o - .data 0x0080201c 0x0 Bin/HIDClassHost.o - .data 0x0080201c 0x0 Bin/MassStorageClassHost.o - .data 0x0080201c 0x0 Bin/MIDIClassHost.o - .data 0x0080201c 0x0 Bin/PrinterClassHost.o - .data 0x0080201c 0x0 Bin/RNDISClassHost.o - .data 0x0080201c 0x0 Bin/StillImageClassHost.o - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - .data 0x0080201c 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - .data 0x0080201c 0x4 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy_P.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strcmp_P.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strncpy_P.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcmp.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memset.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen_P.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(ultoa_invert.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - .data 0x00802020 0x0 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - *(.data*) - *(.rodata) - .rodata 0x00802020 0x70 Bin/Crypto1.o - *(.rodata*) - .rodata.str1.1 - 0x00802090 0x1 Bin/Commands.o - *(.gnu.linkonce.d*) - 0x00802092 . = ALIGN (0x2) - *fill* 0x00802091 0x1 - 0x00802092 _edata = . - 0x00802092 PROVIDE (__data_end, .) - -.bss 0x00802092 0xa0b - 0x00802092 PROVIDE (__bss_start, .) - *(.bss) - .bss 0x00802092 0x400 Bin/Memory.o - .bss 0x00802492 0x1 Bin/Button.o - .bss 0x00802493 0x1 Bin/LED.o - 0x00802493 LEDPulseMask - .bss 0x00802494 0x1 Bin/Terminal.o - 0x00802494 TerminalState - .bss 0x00802495 0xe Bin/XModem.o - .bss 0x008024a3 0x2 Bin/CommandLine.o - .bss 0x008024a5 0x10 Bin/ISO14443-2A.o - .bss 0x008024b5 0x1d Bin/MifareClassic.o - .bss 0x008024d2 0x6 Bin/Crypto1.o - *(.bss*) - *(COMMON) - COMMON 0x008024d8 0x25 Bin/Configuration.o - 0x008024d8 ActiveConfiguration - COMMON 0x008024fd 0x13 Bin/Settings.o - 0x008024fd GlobalSettings - COMMON 0x00802510 0x100 Bin/Terminal.o - 0x00802510 TerminalBuffer - COMMON 0x00802610 0x100 Bin/Codec.o - 0x00802610 CodecBuffer - COMMON 0x00802710 0x3 Bin/DeviceStandardReq.o - 0x00802710 USB_Device_ConfigurationNumber - 0x00802711 USB_Device_CurrentlySelfPowered - 0x00802712 USB_Device_RemoteWakeupEnabled - COMMON 0x00802713 0xa Bin/USBTask.o - 0x00802713 USB_IsInitialized - 0x00802714 USB_DeviceState - 0x00802715 USB_ControlRequest - COMMON 0x0080271d 0x31d Bin/Endpoint_XMEGA.o - 0x0080271d USB_Endpoint_SelectedFIFO - 0x0080271f USB_Endpoint_SelectedHandle - 0x00802721 USB_Endpoint_SelectedEndpoint - 0x00802722 USB_Endpoint_FIFOs - COMMON 0x00802a3a 0x63 Bin/USBController_XMEGA.o - 0x00802a3a USB_EndpointTable - 0x00802a9d PROVIDE (__bss_end, .) - 0x00004e9a __data_load_start = LOADADDR (.data) - 0x00004f2c __data_load_end = (__data_load_start + SIZEOF (.data)) - -.noinit 0x00802a9d 0x0 - 0x00802a9d PROVIDE (__noinit_start, .) - *(.noinit*) - 0x00802a9d PROVIDE (__noinit_end, .) - 0x00802a9d _end = . - 0x00802a9d PROVIDE (__heap_start, .) - -.eeprom 0x00810000 0x13 - *(.eeprom*) - .eeprom 0x00810000 0x13 Bin/Settings.o - 0x00810000 StoredSettings - 0x00810013 __eeprom_end = . - -.fuse - *(.fuse) - *(.lfuse) - *(.hfuse) - *(.efuse) - -.lock - *(.lock*) - -.signature - *(.signature*) - -.user_signatures - *(.user_signatures*) - -.stab - *(.stab) - -.stabstr - *(.stabstr) - -.stab.excl - *(.stab.excl) - -.stab.exclstr - *(.stab.exclstr) - -.stab.index - *(.stab.index) - -.stab.indexstr - *(.stab.indexstr) - -.comment 0x00000000 0x5c - *(.comment) - .comment 0x00000000 0x30 Bin/Chameleon-Mini.o - 0x31 (size before relaxing) - .comment 0x00000000 0x31 Bin/LUFADescriptors.o - .comment 0x00000000 0x31 Bin/System.o - .comment 0x00000000 0x31 Bin/Configuration.o - .comment 0x00000000 0x31 Bin/Random.o - .comment 0x00000000 0x31 Bin/Common.o - .comment 0x00000000 0x31 Bin/Memory.o - .comment 0x00000000 0x31 Bin/Button.o - .comment 0x00000000 0x31 Bin/Settings.o - .comment 0x00000000 0x31 Bin/LED.o - .comment 0x00000000 0x31 Bin/Terminal.o - .comment 0x00000000 0x31 Bin/Commands.o - .comment 0x00000000 0x31 Bin/XModem.o - .comment 0x00000000 0x31 Bin/CommandLine.o - .comment 0x00000000 0x31 Bin/Codec.o - .comment 0x00000000 0x31 Bin/ISO14443-2A.o - .comment 0x00000000 0x31 Bin/MifareClassic.o - .comment 0x00000000 0x31 Bin/ISO14443-3A.o - .comment 0x00000000 0x31 Bin/Crypto1.o - .comment 0x00000000 0x31 Bin/HIDParser.o - .comment 0x00000000 0x31 Bin/ConfigDescriptors.o - .comment 0x00000000 0x31 Bin/DeviceStandardReq.o - .comment 0x00000000 0x31 Bin/Events.o - .comment 0x00000000 0x31 Bin/HostStandardReq.o - .comment 0x00000000 0x31 Bin/USBTask.o - .comment 0x00000000 0x31 Bin/Device_XMEGA.o - .comment 0x00000000 0x31 Bin/EndpointStream_XMEGA.o - .comment 0x00000000 0x31 Bin/Endpoint_XMEGA.o - .comment 0x00000000 0x31 Bin/Host_XMEGA.o - .comment 0x00000000 0x31 Bin/PipeStream_XMEGA.o - .comment 0x00000000 0x31 Bin/Pipe_XMEGA.o - .comment 0x00000000 0x31 Bin/USBController_XMEGA.o - .comment 0x00000000 0x31 Bin/USBInterrupt_XMEGA.o - .comment 0x00000000 0x31 Bin/AudioClassDevice.o - .comment 0x00000000 0x31 Bin/CDCClassDevice.o - .comment 0x00000000 0x31 Bin/HIDClassDevice.o - .comment 0x00000000 0x31 Bin/MassStorageClassDevice.o - .comment 0x00000000 0x31 Bin/MIDIClassDevice.o - .comment 0x00000000 0x31 Bin/PrinterClassDevice.o - .comment 0x00000000 0x31 Bin/RNDISClassDevice.o - .comment 0x00000000 0x31 Bin/AndroidAccessoryClassHost.o - .comment 0x00000000 0x31 Bin/AudioClassHost.o - .comment 0x00000000 0x31 Bin/CDCClassHost.o - .comment 0x00000000 0x31 Bin/HIDClassHost.o - .comment 0x00000000 0x31 Bin/MassStorageClassHost.o - .comment 0x00000000 0x31 Bin/MIDIClassHost.o - .comment 0x00000000 0x31 Bin/PrinterClassHost.o - .comment 0x00000000 0x31 Bin/RNDISClassHost.o - .comment 0x00000000 0x31 Bin/StillImageClassHost.o - .comment 0x00000000 0x31 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - .comment 0x00000000 0x31 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - .comment 0x00000030 0x2c /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - 0x2d (size before relaxing) - .comment 0x00000000 0x31 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - -.note.gnu.build-id - *(.note.gnu.build-id) - -.debug - *(.debug) - -.line - *(.line) - -.debug_srcinfo - *(.debug_srcinfo) - -.debug_sfnames - *(.debug_sfnames) - -.debug_aranges 0x00000000 0xb50 - *(.debug_aranges) - .debug_aranges - 0x00000000 0x20 Bin/Chameleon-Mini.o - .debug_aranges - 0x00000020 0x20 Bin/LUFADescriptors.o - .debug_aranges - 0x00000040 0x50 Bin/System.o - .debug_aranges - 0x00000090 0x78 Bin/Configuration.o - .debug_aranges - 0x00000108 0x38 Bin/Random.o - .debug_aranges - 0x00000140 0x28 Bin/Common.o - .debug_aranges - 0x00000168 0x58 Bin/Memory.o - .debug_aranges - 0x000001c0 0x48 Bin/Button.o - .debug_aranges - 0x00000208 0x50 Bin/Settings.o - .debug_aranges - 0x00000258 0x18 Bin/LED.o - .debug_aranges - 0x00000270 0x68 Bin/Terminal.o - .debug_aranges - 0x000002d8 0xc8 Bin/Commands.o - .debug_aranges - 0x000003a0 0x38 Bin/XModem.o - .debug_aranges - 0x000003d8 0x30 Bin/CommandLine.o - .debug_aranges - 0x00000408 0x18 Bin/Codec.o - .debug_aranges - 0x00000420 0x48 Bin/ISO14443-2A.o - .debug_aranges - 0x00000468 0x50 Bin/MifareClassic.o - .debug_aranges - 0x000004b8 0x28 Bin/ISO14443-3A.o - .debug_aranges - 0x000004e0 0x50 Bin/Crypto1.o - .debug_aranges - 0x00000530 0x38 Bin/HIDParser.o - .debug_aranges - 0x00000568 0x38 Bin/ConfigDescriptors.o - .debug_aranges - 0x000005a0 0x20 Bin/DeviceStandardReq.o - .debug_aranges - 0x000005c0 0x20 Bin/Events.o - .debug_aranges - 0x000005e0 0x18 Bin/HostStandardReq.o - .debug_aranges - 0x000005f8 0x20 Bin/USBTask.o - .debug_aranges - 0x00000618 0x20 Bin/Device_XMEGA.o - .debug_aranges - 0x00000638 0xc8 Bin/EndpointStream_XMEGA.o - .debug_aranges - 0x00000700 0x90 Bin/Endpoint_XMEGA.o - .debug_aranges - 0x00000790 0x18 Bin/Host_XMEGA.o - .debug_aranges - 0x000007a8 0x18 Bin/PipeStream_XMEGA.o - .debug_aranges - 0x000007c0 0x18 Bin/Pipe_XMEGA.o - .debug_aranges - 0x000007d8 0x30 Bin/USBController_XMEGA.o - .debug_aranges - 0x00000808 0x30 Bin/USBInterrupt_XMEGA.o - .debug_aranges - 0x00000838 0x30 Bin/AudioClassDevice.o - .debug_aranges - 0x00000868 0x98 Bin/CDCClassDevice.o - .debug_aranges - 0x00000900 0x30 Bin/HIDClassDevice.o - .debug_aranges - 0x00000930 0x30 Bin/MassStorageClassDevice.o - .debug_aranges - 0x00000960 0x40 Bin/MIDIClassDevice.o - .debug_aranges - 0x000009a0 0x90 Bin/PrinterClassDevice.o - .debug_aranges - 0x00000a30 0x48 Bin/RNDISClassDevice.o - .debug_aranges - 0x00000a78 0x18 Bin/AndroidAccessoryClassHost.o - .debug_aranges - 0x00000a90 0x18 Bin/AudioClassHost.o - .debug_aranges - 0x00000aa8 0x18 Bin/CDCClassHost.o - .debug_aranges - 0x00000ac0 0x18 Bin/HIDClassHost.o - .debug_aranges - 0x00000ad8 0x18 Bin/MassStorageClassHost.o - .debug_aranges - 0x00000af0 0x18 Bin/MIDIClassHost.o - .debug_aranges - 0x00000b08 0x18 Bin/PrinterClassHost.o - .debug_aranges - 0x00000b20 0x18 Bin/RNDISClassHost.o - .debug_aranges - 0x00000b38 0x18 Bin/StillImageClassHost.o - -.debug_pubnames - *(.debug_pubnames) - -.debug_info 0x00000000 0x189de - *(.debug_info .gnu.linkonce.wi.*) - .debug_info 0x00000000 0x1381 Bin/Chameleon-Mini.o - .debug_info 0x00001381 0x962 Bin/LUFADescriptors.o - .debug_info 0x00001ce3 0xea8 Bin/System.o - .debug_info 0x00002b8b 0x657 Bin/Configuration.o - .debug_info 0x000031e2 0x177 Bin/Random.o - .debug_info 0x00003359 0x1b3 Bin/Common.o - .debug_info 0x0000350c 0x1264 Bin/Memory.o - .debug_info 0x00004770 0xa98 Bin/Button.o - .debug_info 0x00005208 0x514 Bin/Settings.o - .debug_info 0x0000571c 0x7a Bin/LED.o - .debug_info 0x00005796 0xb73 Bin/Terminal.o - .debug_info 0x00006309 0x1806 Bin/Commands.o - .debug_info 0x00007b0f 0xa2b Bin/XModem.o - .debug_info 0x0000853a 0xb77 Bin/CommandLine.o - .debug_info 0x000090b1 0x1f1 Bin/Codec.o - .debug_info 0x000092a2 0x187e Bin/ISO14443-2A.o - .debug_info 0x0000ab20 0xee1 Bin/MifareClassic.o - .debug_info 0x0000ba01 0x179 Bin/ISO14443-3A.o - .debug_info 0x0000bb7a 0x42a Bin/Crypto1.o - .debug_info 0x0000bfa4 0x73c Bin/HIDParser.o - .debug_info 0x0000c6e0 0x5ed Bin/ConfigDescriptors.o - .debug_info 0x0000cccd 0x119b Bin/DeviceStandardReq.o - .debug_info 0x0000de68 0x7f Bin/Events.o - .debug_info 0x0000dee7 0x5d Bin/HostStandardReq.o - .debug_info 0x0000df44 0x433 Bin/USBTask.o - .debug_info 0x0000e377 0x670 Bin/Device_XMEGA.o - .debug_info 0x0000e9e7 0x198f Bin/EndpointStream_XMEGA.o - .debug_info 0x00010376 0xd09 Bin/Endpoint_XMEGA.o - .debug_info 0x0001107f 0x5d Bin/Host_XMEGA.o - .debug_info 0x000110dc 0x5d Bin/PipeStream_XMEGA.o - .debug_info 0x00011139 0x5d Bin/Pipe_XMEGA.o - .debug_info 0x00011196 0xd3e Bin/USBController_XMEGA.o - .debug_info 0x00011ed4 0xa7b Bin/USBInterrupt_XMEGA.o - .debug_info 0x0001294f 0xab1 Bin/AudioClassDevice.o - .debug_info 0x00013400 0xf9f Bin/CDCClassDevice.o - .debug_info 0x0001439f 0xf94 Bin/HIDClassDevice.o - .debug_info 0x00015333 0xa9e Bin/MassStorageClassDevice.o - .debug_info 0x00015dd1 0x7c4 Bin/MIDIClassDevice.o - .debug_info 0x00016595 0xded Bin/PrinterClassDevice.o - .debug_info 0x00017382 0x1317 Bin/RNDISClassDevice.o - .debug_info 0x00018699 0x5d Bin/AndroidAccessoryClassHost.o - .debug_info 0x000186f6 0x5d Bin/AudioClassHost.o - .debug_info 0x00018753 0x5d Bin/CDCClassHost.o - .debug_info 0x000187b0 0x5d Bin/HIDClassHost.o - .debug_info 0x0001880d 0x5d Bin/MassStorageClassHost.o - .debug_info 0x0001886a 0x5d Bin/MIDIClassHost.o - .debug_info 0x000188c7 0x5d Bin/PrinterClassHost.o - .debug_info 0x00018924 0x5d Bin/RNDISClassHost.o - .debug_info 0x00018981 0x5d Bin/StillImageClassHost.o - -.debug_abbrev 0x00000000 0x553d - *(.debug_abbrev) - .debug_abbrev 0x00000000 0x1d2 Bin/Chameleon-Mini.o - .debug_abbrev 0x000001d2 0x1bb Bin/LUFADescriptors.o - .debug_abbrev 0x0000038d 0x144 Bin/System.o - .debug_abbrev 0x000004d1 0x250 Bin/Configuration.o - .debug_abbrev 0x00000721 0x113 Bin/Random.o - .debug_abbrev 0x00000834 0xb2 Bin/Common.o - .debug_abbrev 0x000008e6 0x331 Bin/Memory.o - .debug_abbrev 0x00000c17 0x2ea Bin/Button.o - .debug_abbrev 0x00000f01 0x1e1 Bin/Settings.o - .debug_abbrev 0x000010e2 0x44 Bin/LED.o - .debug_abbrev 0x00001126 0x33a Bin/Terminal.o - .debug_abbrev 0x00001460 0x397 Bin/Commands.o - .debug_abbrev 0x000017f7 0x2ce Bin/XModem.o - .debug_abbrev 0x00001ac5 0x2d2 Bin/CommandLine.o - .debug_abbrev 0x00001d97 0xc4 Bin/Codec.o - .debug_abbrev 0x00001e5b 0x2db Bin/ISO14443-2A.o - .debug_abbrev 0x00002136 0x314 Bin/MifareClassic.o - .debug_abbrev 0x0000244a 0xa6 Bin/ISO14443-3A.o - .debug_abbrev 0x000024f0 0x1a9 Bin/Crypto1.o - .debug_abbrev 0x00002699 0x22d Bin/HIDParser.o - .debug_abbrev 0x000028c6 0x248 Bin/ConfigDescriptors.o - .debug_abbrev 0x00002b0e 0x38d Bin/DeviceStandardReq.o - .debug_abbrev 0x00002e9b 0x44 Bin/Events.o - .debug_abbrev 0x00002edf 0x26 Bin/HostStandardReq.o - .debug_abbrev 0x00002f05 0x21b Bin/USBTask.o - .debug_abbrev 0x00003120 0x11e Bin/Device_XMEGA.o - .debug_abbrev 0x0000323e 0x252 Bin/EndpointStream_XMEGA.o - .debug_abbrev 0x00003490 0x300 Bin/Endpoint_XMEGA.o - .debug_abbrev 0x00003790 0x26 Bin/Host_XMEGA.o - .debug_abbrev 0x000037b6 0x26 Bin/PipeStream_XMEGA.o - .debug_abbrev 0x000037dc 0x26 Bin/Pipe_XMEGA.o - .debug_abbrev 0x00003802 0x2f7 Bin/USBController_XMEGA.o - .debug_abbrev 0x00003af9 0x266 Bin/USBInterrupt_XMEGA.o - .debug_abbrev 0x00003d5f 0x280 Bin/AudioClassDevice.o - .debug_abbrev 0x00003fdf 0x41d Bin/CDCClassDevice.o - .debug_abbrev 0x000043fc 0x2d1 Bin/HIDClassDevice.o - .debug_abbrev 0x000046cd 0x338 Bin/MassStorageClassDevice.o - .debug_abbrev 0x00004a05 0x285 Bin/MIDIClassDevice.o - .debug_abbrev 0x00004c8a 0x3c7 Bin/PrinterClassDevice.o - .debug_abbrev 0x00005051 0x396 Bin/RNDISClassDevice.o - .debug_abbrev 0x000053e7 0x26 Bin/AndroidAccessoryClassHost.o - .debug_abbrev 0x0000540d 0x26 Bin/AudioClassHost.o - .debug_abbrev 0x00005433 0x26 Bin/CDCClassHost.o - .debug_abbrev 0x00005459 0x26 Bin/HIDClassHost.o - .debug_abbrev 0x0000547f 0x26 Bin/MassStorageClassHost.o - .debug_abbrev 0x000054a5 0x26 Bin/MIDIClassHost.o - .debug_abbrev 0x000054cb 0x26 Bin/PrinterClassHost.o - .debug_abbrev 0x000054f1 0x26 Bin/RNDISClassHost.o - .debug_abbrev 0x00005517 0x26 Bin/StillImageClassHost.o - -.debug_line 0x00000000 0xa17f - *(.debug_line .debug_line.* .debug_line_end) - .debug_line 0x00000000 0x33c Bin/Chameleon-Mini.o - .debug_line 0x0000033c 0x2aa Bin/LUFADescriptors.o - .debug_line 0x000005e6 0x1fd Bin/System.o - .debug_line 0x000007e3 0x338 Bin/Configuration.o - .debug_line 0x00000b1b 0xef Bin/Random.o - .debug_line 0x00000c0a 0x1fb Bin/Common.o - .debug_line 0x00000e05 0x932 Bin/Memory.o - .debug_line 0x00001737 0x3f4 Bin/Button.o - .debug_line 0x00001b2b 0x2a5 Bin/Settings.o - .debug_line 0x00001dd0 0x61 Bin/LED.o - .debug_line 0x00001e31 0x403 Bin/Terminal.o - .debug_line 0x00002234 0x787 Bin/Commands.o - .debug_line 0x000029bb 0x4a8 Bin/XModem.o - .debug_line 0x00002e63 0x36d Bin/CommandLine.o - .debug_line 0x000031d0 0x85 Bin/Codec.o - .debug_line 0x00003255 0x5f6 Bin/ISO14443-2A.o - .debug_line 0x0000384b 0x6d0 Bin/MifareClassic.o - .debug_line 0x00003f1b 0x152 Bin/ISO14443-3A.o - .debug_line 0x0000406d 0x444 Bin/Crypto1.o - .debug_line 0x000044b1 0x6d1 Bin/HIDParser.o - .debug_line 0x00004b82 0x289 Bin/ConfigDescriptors.o - .debug_line 0x00004e0b 0x469 Bin/DeviceStandardReq.o - .debug_line 0x00005274 0x4f Bin/Events.o - .debug_line 0x000052c3 0x1a Bin/HostStandardReq.o - .debug_line 0x000052dd 0x1b5 Bin/USBTask.o - .debug_line 0x00005492 0x131 Bin/Device_XMEGA.o - .debug_line 0x000055c3 0x153a Bin/EndpointStream_XMEGA.o - .debug_line 0x00006afd 0x69a Bin/Endpoint_XMEGA.o - .debug_line 0x00007197 0x1a Bin/Host_XMEGA.o - .debug_line 0x000071b1 0x1a Bin/PipeStream_XMEGA.o - .debug_line 0x000071cb 0x1a Bin/Pipe_XMEGA.o - .debug_line 0x000071e5 0x357 Bin/USBController_XMEGA.o - .debug_line 0x0000753c 0x35c Bin/USBInterrupt_XMEGA.o - .debug_line 0x00007898 0x401 Bin/AudioClassDevice.o - .debug_line 0x00007c99 0x826 Bin/CDCClassDevice.o - .debug_line 0x000084bf 0x538 Bin/HIDClassDevice.o - .debug_line 0x000089f7 0x4b5 Bin/MassStorageClassDevice.o - .debug_line 0x00008eac 0x3ba Bin/MIDIClassDevice.o - .debug_line 0x00009266 0x763 Bin/PrinterClassDevice.o - .debug_line 0x000099c9 0x6cc Bin/RNDISClassDevice.o - .debug_line 0x0000a095 0x1a Bin/AndroidAccessoryClassHost.o - .debug_line 0x0000a0af 0x1a Bin/AudioClassHost.o - .debug_line 0x0000a0c9 0x1a Bin/CDCClassHost.o - .debug_line 0x0000a0e3 0x1a Bin/HIDClassHost.o - .debug_line 0x0000a0fd 0x1a Bin/MassStorageClassHost.o - .debug_line 0x0000a117 0x1a Bin/MIDIClassHost.o - .debug_line 0x0000a131 0x1a Bin/PrinterClassHost.o - .debug_line 0x0000a14b 0x1a Bin/RNDISClassHost.o - .debug_line 0x0000a165 0x1a Bin/StillImageClassHost.o - -.debug_frame 0x00000000 0x1d28 - *(.debug_frame) - .debug_frame 0x00000000 0x24 Bin/Chameleon-Mini.o - .debug_frame 0x00000024 0x24 Bin/LUFADescriptors.o - .debug_frame 0x00000048 0x90 Bin/System.o - .debug_frame 0x000000d8 0xfc Bin/Configuration.o - .debug_frame 0x000001d4 0x64 Bin/Random.o - .debug_frame 0x00000238 0x40 Bin/Common.o - .debug_frame 0x00000278 0x170 Bin/Memory.o - .debug_frame 0x000003e8 0xb4 Bin/Button.o - .debug_frame 0x0000049c 0x94 Bin/Settings.o - .debug_frame 0x00000530 0xcc Bin/Terminal.o - .debug_frame 0x000005fc 0x288 Bin/Commands.o - .debug_frame 0x00000884 0x5c Bin/XModem.o - .debug_frame 0x000008e0 0x54 Bin/CommandLine.o - .debug_frame 0x00000934 0x110 Bin/ISO14443-2A.o - .debug_frame 0x00000a44 0xdc Bin/MifareClassic.o - .debug_frame 0x00000b20 0x34 Bin/ISO14443-3A.o - .debug_frame 0x00000b54 0x13c Bin/Crypto1.o - .debug_frame 0x00000c90 0x11c Bin/HIDParser.o - .debug_frame 0x00000dac 0xd0 Bin/ConfigDescriptors.o - .debug_frame 0x00000e7c 0x40 Bin/DeviceStandardReq.o - .debug_frame 0x00000ebc 0x24 Bin/Events.o - .debug_frame 0x00000ee0 0x2c Bin/USBTask.o - .debug_frame 0x00000f0c 0x24 Bin/Device_XMEGA.o - .debug_frame 0x00000f30 0x4a0 Bin/EndpointStream_XMEGA.o - .debug_frame 0x000013d0 0x15c Bin/Endpoint_XMEGA.o - .debug_frame 0x0000152c 0x50 Bin/USBController_XMEGA.o - .debug_frame 0x0000157c 0x8c Bin/USBInterrupt_XMEGA.o - .debug_frame 0x00001608 0xa4 Bin/AudioClassDevice.o - .debug_frame 0x000016ac 0x1e0 Bin/CDCClassDevice.o - .debug_frame 0x0000188c 0xf0 Bin/HIDClassDevice.o - .debug_frame 0x0000197c 0x80 Bin/MassStorageClassDevice.o - .debug_frame 0x000019fc 0x94 Bin/MIDIClassDevice.o - .debug_frame 0x00001a90 0x194 Bin/PrinterClassDevice.o - .debug_frame 0x00001c24 0x104 Bin/RNDISClassDevice.o - -.debug_str 0x00000000 0x76e1 - *(.debug_str) - .debug_str 0x00000000 0xd8c Bin/Chameleon-Mini.o - 0xe51 (size before relaxing) - .debug_str 0x00000d8c 0x8cc Bin/LUFADescriptors.o - 0xbd9 (size before relaxing) - .debug_str 0x00001658 0x764 Bin/System.o - 0xc54 (size before relaxing) - .debug_str 0x00001dbc 0x2ff Bin/Configuration.o - 0x629 (size before relaxing) - .debug_str 0x000020bb 0x2c Bin/Random.o - 0x1d3 (size before relaxing) - .debug_str 0x000020e7 0x56 Bin/Common.o - 0x1f6 (size before relaxing) - .debug_str 0x0000213d 0x22d Bin/Memory.o - 0x7de (size before relaxing) - .debug_str 0x0000236a 0x1d2 Bin/Button.o - 0x788 (size before relaxing) - .debug_str 0x0000253c 0xc0 Bin/Settings.o - 0x590 (size before relaxing) - .debug_str 0x000025fc 0x6 Bin/LED.o - 0x184 (size before relaxing) - .debug_str 0x00002602 0x295 Bin/Terminal.o - 0x7e8 (size before relaxing) - .debug_str 0x00002897 0x3f0 Bin/Commands.o - 0xd8e (size before relaxing) - .debug_str 0x00002c87 0x149 Bin/XModem.o - 0x5ef (size before relaxing) - .debug_str 0x00002dd0 0xc1 Bin/CommandLine.o - 0x5cc (size before relaxing) - .debug_str 0x00002e91 0x1a Bin/Codec.o - 0x2f4 (size before relaxing) - .debug_str 0x00002eab 0x12b9 Bin/ISO14443-2A.o - 0x1adc (size before relaxing) - .debug_str 0x00004164 0x2b0 Bin/MifareClassic.o - 0x601 (size before relaxing) - .debug_str 0x00004414 0x1a Bin/ISO14443-3A.o - 0x1ed (size before relaxing) - .debug_str 0x0000442e 0x95 Bin/Crypto1.o - 0x27b (size before relaxing) - .debug_str 0x000044c3 0x492 Bin/HIDParser.o - 0x6af (size before relaxing) - .debug_str 0x00004955 0x22e Bin/ConfigDescriptors.o - 0x4ed (size before relaxing) - .debug_str 0x00004b83 0xa04 Bin/DeviceStandardReq.o - 0x11eb (size before relaxing) - .debug_str 0x00005587 0x31 Bin/Events.o - 0x19a (size before relaxing) - .debug_str 0x000055b8 0x2b Bin/HostStandardReq.o - 0x194 (size before relaxing) - .debug_str 0x000055e3 0x6d Bin/USBTask.o - 0x466 (size before relaxing) - .debug_str 0x00005650 0x4a Bin/Device_XMEGA.o - 0x5da (size before relaxing) - .debug_str 0x0000569a 0x4d9 Bin/EndpointStream_XMEGA.o - 0x97e (size before relaxing) - .debug_str 0x00005b73 0x2aa Bin/Endpoint_XMEGA.o - 0xaec (size before relaxing) - .debug_str 0x00005e1d 0x2c Bin/Host_XMEGA.o - 0x195 (size before relaxing) - .debug_str 0x00005e49 0x32 Bin/PipeStream_XMEGA.o - 0x19b (size before relaxing) - .debug_str 0x00005e7b 0x2c Bin/Pipe_XMEGA.o - 0x195 (size before relaxing) - .debug_str 0x00005ea7 0x1bb Bin/USBController_XMEGA.o - 0xe7c (size before relaxing) - .debug_str 0x00006062 0xaa Bin/USBInterrupt_XMEGA.o - 0x94d (size before relaxing) - .debug_str 0x0000610c 0x280 Bin/AudioClassDevice.o - 0x7c1 (size before relaxing) - .debug_str 0x0000638c 0x286 Bin/CDCClassDevice.o - 0xb16 (size before relaxing) - .debug_str 0x00006612 0x248 Bin/HIDClassDevice.o - 0xb31 (size before relaxing) - .debug_str 0x0000685a 0x261 Bin/MassStorageClassDevice.o - 0x914 (size before relaxing) - .debug_str 0x00006abb 0x115 Bin/MIDIClassDevice.o - 0x76b (size before relaxing) - .debug_str 0x00006bd0 0x269 Bin/PrinterClassDevice.o - 0xa3f (size before relaxing) - .debug_str 0x00006e39 0x6e5 Bin/RNDISClassDevice.o - 0xe74 (size before relaxing) - .debug_str 0x0000751e 0x3b Bin/AndroidAccessoryClassHost.o - 0x1a4 (size before relaxing) - .debug_str 0x00007559 0x30 Bin/AudioClassHost.o - 0x199 (size before relaxing) - .debug_str 0x00007589 0x2e Bin/CDCClassHost.o - 0x197 (size before relaxing) - .debug_str 0x000075b7 0x2e Bin/HIDClassHost.o - 0x197 (size before relaxing) - .debug_str 0x000075e5 0x36 Bin/MassStorageClassHost.o - 0x19f (size before relaxing) - .debug_str 0x0000761b 0x2f Bin/MIDIClassHost.o - 0x198 (size before relaxing) - .debug_str 0x0000764a 0x32 Bin/PrinterClassHost.o - 0x19b (size before relaxing) - .debug_str 0x0000767c 0x30 Bin/RNDISClassHost.o - 0x199 (size before relaxing) - .debug_str 0x000076ac 0x35 Bin/StillImageClassHost.o - 0x19e (size before relaxing) - -.debug_loc 0x00000000 0xc84e - *(.debug_loc) - .debug_loc 0x00000000 0x253 Bin/LUFADescriptors.o - .debug_loc 0x00000253 0x2f Bin/System.o - .debug_loc 0x00000282 0x4e7 Bin/Configuration.o - .debug_loc 0x00000769 0xde Bin/Random.o - .debug_loc 0x00000847 0x34b Bin/Common.o - .debug_loc 0x00000b92 0xcbd Bin/Memory.o - .debug_loc 0x0000184f 0x810 Bin/Button.o - .debug_loc 0x0000205f 0x1a6 Bin/Settings.o - .debug_loc 0x00002205 0x214 Bin/Terminal.o - .debug_loc 0x00002419 0xa5a Bin/Commands.o - .debug_loc 0x00002e73 0x390 Bin/XModem.o - .debug_loc 0x00003203 0x670 Bin/CommandLine.o - .debug_loc 0x00003873 0x4a4 Bin/ISO14443-2A.o - .debug_loc 0x00003d17 0x972 Bin/MifareClassic.o - .debug_loc 0x00004689 0x317 Bin/ISO14443-3A.o - .debug_loc 0x000049a0 0x7ad Bin/Crypto1.o - .debug_loc 0x0000514d 0xf2d Bin/HIDParser.o - .debug_loc 0x0000607a 0x592 Bin/ConfigDescriptors.o - .debug_loc 0x0000660c 0x2d8 Bin/DeviceStandardReq.o - .debug_loc 0x000068e4 0x22 Bin/USBTask.o - .debug_loc 0x00006906 0x2acb Bin/EndpointStream_XMEGA.o - .debug_loc 0x000093d1 0x58b Bin/Endpoint_XMEGA.o - .debug_loc 0x0000995c 0x80 Bin/USBController_XMEGA.o - .debug_loc 0x000099dc 0x200 Bin/USBInterrupt_XMEGA.o - .debug_loc 0x00009bdc 0x37f Bin/AudioClassDevice.o - .debug_loc 0x00009f5b 0xa0b Bin/CDCClassDevice.o - .debug_loc 0x0000a966 0x3e7 Bin/HIDClassDevice.o - .debug_loc 0x0000ad4d 0x29f Bin/MassStorageClassDevice.o - .debug_loc 0x0000afec 0x33c Bin/MIDIClassDevice.o - .debug_loc 0x0000b328 0x8cd Bin/PrinterClassDevice.o - .debug_loc 0x0000bbf5 0xc59 Bin/RNDISClassDevice.o - -.debug_macinfo - *(.debug_macinfo) - -.debug_weaknames - *(.debug_weaknames) - -.debug_funcnames - *(.debug_funcnames) - -.debug_typenames - *(.debug_typenames) - -.debug_varnames - *(.debug_varnames) - -.debug_pubtypes - *(.debug_pubtypes) - -.debug_ranges 0x00000000 0x16c8 - *(.debug_ranges) - .debug_ranges 0x00000000 0x28 Bin/Chameleon-Mini.o - .debug_ranges 0x00000028 0x10 Bin/LUFADescriptors.o - .debug_ranges 0x00000038 0x40 Bin/System.o - .debug_ranges 0x00000078 0xb8 Bin/Configuration.o - .debug_ranges 0x00000130 0x28 Bin/Random.o - .debug_ranges 0x00000158 0x48 Bin/Common.o - .debug_ranges 0x000001a0 0x298 Bin/Memory.o - .debug_ranges 0x00000438 0xa0 Bin/Button.o - .debug_ranges 0x000004d8 0x40 Bin/Settings.o - .debug_ranges 0x00000518 0xb8 Bin/Terminal.o - .debug_ranges 0x000005d0 0xf0 Bin/Commands.o - .debug_ranges 0x000006c0 0x40 Bin/XModem.o - .debug_ranges 0x00000700 0xc0 Bin/CommandLine.o - .debug_ranges 0x000007c0 0xc0 Bin/ISO14443-2A.o - .debug_ranges 0x00000880 0x158 Bin/MifareClassic.o - .debug_ranges 0x000009d8 0x18 Bin/ISO14443-3A.o - .debug_ranges 0x000009f0 0x40 Bin/Crypto1.o - .debug_ranges 0x00000a30 0x108 Bin/HIDParser.o - .debug_ranges 0x00000b38 0x40 Bin/ConfigDescriptors.o - .debug_ranges 0x00000b78 0xf0 Bin/DeviceStandardReq.o - .debug_ranges 0x00000c68 0x10 Bin/Events.o - .debug_ranges 0x00000c78 0x38 Bin/USBTask.o - .debug_ranges 0x00000cb0 0x10 Bin/Device_XMEGA.o - .debug_ranges 0x00000cc0 0x4f0 Bin/EndpointStream_XMEGA.o - .debug_ranges 0x000011b0 0xf8 Bin/Endpoint_XMEGA.o - .debug_ranges 0x000012a8 0x20 Bin/USBController_XMEGA.o - .debug_ranges 0x000012c8 0x20 Bin/USBInterrupt_XMEGA.o - .debug_ranges 0x000012e8 0x38 Bin/AudioClassDevice.o - .debug_ranges 0x00001320 0x100 Bin/CDCClassDevice.o - .debug_ranges 0x00001420 0x20 Bin/HIDClassDevice.o - .debug_ranges 0x00001440 0x80 Bin/MassStorageClassDevice.o - .debug_ranges 0x000014c0 0x48 Bin/MIDIClassDevice.o - .debug_ranges 0x00001508 0x128 Bin/PrinterClassDevice.o - .debug_ranges 0x00001630 0x98 Bin/RNDISClassDevice.o - -.debug_macro - *(.debug_macro) -OUTPUT(Chameleon-Mini.elf elf32-avr) -LOAD linker stubs - -Cross Reference Table - -Symbol File -ActiveConfiguration Bin/Configuration.o - Bin/MifareClassic.o - Bin/ISO14443-2A.o - Bin/Commands.o - Bin/Button.o - Bin/Chameleon-Mini.o -Audio_Device_ConfigureEndpoints Bin/AudioClassDevice.o -Audio_Device_Event_Stub Bin/AudioClassDevice.o -Audio_Device_ProcessControlRequest Bin/AudioClassDevice.o -BufferToHexString Bin/Common.o - Bin/Commands.o -ButtonGetActionByName Bin/Button.o - Bin/Commands.o -ButtonGetActionList Bin/Button.o - Bin/Commands.o -ButtonInit Bin/Button.o - Bin/Chameleon-Mini.o -ButtonSetActionById Bin/Button.o -ButtonSetActionByName Bin/Button.o - Bin/Commands.o -ButtonTick Bin/Button.o - Bin/Chameleon-Mini.o -CALLBACK_Audio_Device_GetSetEndpointProperty Bin/AudioClassDevice.o -CALLBACK_Audio_Device_GetSetInterfaceProperty Bin/AudioClassDevice.o -CALLBACK_HIDParser_FilterHIDReportItem Bin/HIDParser.o -CALLBACK_HID_Device_CreateHIDReport Bin/HIDClassDevice.o -CALLBACK_HID_Device_ProcessHIDReport Bin/HIDClassDevice.o -CALLBACK_MS_Device_SCSICommandReceived Bin/MassStorageClassDevice.o -CALLBACK_USB_GetDescriptor Bin/LUFADescriptors.o - Bin/DeviceStandardReq.o -CDC_Device_BytesReceived Bin/CDCClassDevice.o -CDC_Device_ConfigureEndpoints Bin/CDCClassDevice.o - Bin/Terminal.o -CDC_Device_CreateBlockingStream Bin/CDCClassDevice.o -CDC_Device_CreateStream Bin/CDCClassDevice.o -CDC_Device_Event_Stub Bin/CDCClassDevice.o -CDC_Device_Flush Bin/CDCClassDevice.o -CDC_Device_ProcessControlRequest Bin/CDCClassDevice.o - Bin/Terminal.o -CDC_Device_ReceiveByte Bin/CDCClassDevice.o - Bin/Terminal.o -CDC_Device_SendByte Bin/CDCClassDevice.o - Bin/XModem.o - Bin/Terminal.o -CDC_Device_SendControlLineStateChange Bin/CDCClassDevice.o -CDC_Device_SendData Bin/CDCClassDevice.o - Bin/Terminal.o -CDC_Device_SendString Bin/CDCClassDevice.o - Bin/Terminal.o -CDC_Device_USBTask Bin/CDCClassDevice.o - Bin/Terminal.o -CodecBuffer Bin/Codec.o - Bin/ISO14443-2A.o -CommandExecButton Bin/Commands.o - Bin/CommandLine.o -CommandExecClear Bin/Commands.o - Bin/CommandLine.o -CommandExecConfig Bin/Commands.o - Bin/CommandLine.o -CommandExecDownload Bin/Commands.o - Bin/CommandLine.o -CommandExecHelp Bin/Commands.o - Bin/CommandLine.o -CommandExecReset Bin/Commands.o - Bin/CommandLine.o -CommandExecUpgrade Bin/Commands.o - Bin/CommandLine.o -CommandExecUpload Bin/Commands.o - Bin/CommandLine.o -CommandGetButton Bin/Commands.o - Bin/CommandLine.o -CommandGetConfig Bin/Commands.o - Bin/CommandLine.o -CommandGetMemSize Bin/Commands.o - Bin/CommandLine.o -CommandGetReadOnly Bin/Commands.o - Bin/CommandLine.o -CommandGetRssi Bin/Commands.o - Bin/CommandLine.o -CommandGetSetting Bin/Commands.o - Bin/CommandLine.o -CommandGetUid Bin/Commands.o - Bin/CommandLine.o -CommandGetUidSize Bin/Commands.o - Bin/CommandLine.o -CommandGetVersion Bin/Commands.o - Bin/CommandLine.o -CommandLineInit Bin/CommandLine.o -CommandLineProcessByte Bin/CommandLine.o - Bin/Terminal.o -CommandLineTick Bin/CommandLine.o - Bin/Terminal.o -CommandSetButton Bin/Commands.o - Bin/CommandLine.o -CommandSetConfig Bin/Commands.o - Bin/CommandLine.o -CommandSetReadOnly Bin/Commands.o - Bin/CommandLine.o -CommandSetSetting Bin/Commands.o - Bin/CommandLine.o -CommandSetUid Bin/Commands.o - Bin/CommandLine.o -CommandTable Bin/CommandLine.o - Bin/Commands.o -ConfigurationDescriptor Bin/LUFADescriptors.o -ConfigurationGetList Bin/Configuration.o - Bin/Commands.o -ConfigurationInit Bin/Configuration.o - Bin/Settings.o - Bin/Chameleon-Mini.o -ConfigurationSetById Bin/Configuration.o -ConfigurationSetByName Bin/Configuration.o - Bin/Commands.o -Crypto1Auth Bin/Crypto1.o - Bin/MifareClassic.o -Crypto1Byte Bin/Crypto1.o - Bin/MifareClassic.o -Crypto1FilterOutput Bin/Crypto1.o - Bin/MifareClassic.o -Crypto1Nibble Bin/Crypto1.o - Bin/MifareClassic.o -Crypto1PRNG Bin/Crypto1.o - Bin/MifareClassic.o -Crypto1Setup Bin/Crypto1.o - Bin/MifareClassic.o -DeviceDescriptor Bin/LUFADescriptors.o -EVENT_Audio_Device_StreamStartStop Bin/AudioClassDevice.o -EVENT_CDC_Device_BreakSent Bin/CDCClassDevice.o -EVENT_CDC_Device_ControLineStateChanged Bin/CDCClassDevice.o -EVENT_CDC_Device_LineEncodingChanged Bin/CDCClassDevice.o -EVENT_PRNT_Device_SoftReset Bin/PrinterClassDevice.o -EVENT_USB_Device_ConfigurationChanged Bin/Terminal.o - Bin/DeviceStandardReq.o -EVENT_USB_Device_Connect Bin/Terminal.o - Bin/USBInterrupt_XMEGA.o -EVENT_USB_Device_ControlRequest Bin/Terminal.o - Bin/DeviceStandardReq.o -EVENT_USB_Device_Disconnect Bin/Terminal.o - Bin/USBInterrupt_XMEGA.o -EVENT_USB_Device_Reset Bin/Events.o - Bin/USBInterrupt_XMEGA.o -EVENT_USB_Device_StartOfFrame Bin/Events.o - Bin/USBInterrupt_XMEGA.o -EVENT_USB_Device_Suspend Bin/Events.o -EVENT_USB_Device_WakeUp Bin/Events.o -Endpoint_ClearEndpoints Bin/Endpoint_XMEGA.o - Bin/USBInterrupt_XMEGA.o -Endpoint_ClearIN Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -Endpoint_ClearOUT Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -Endpoint_ClearSETUP Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o - Bin/DeviceStandardReq.o -Endpoint_ClearStatusStage Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o - Bin/DeviceStandardReq.o -Endpoint_ConfigureEndpointTable Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o -Endpoint_ConfigureEndpoint_PRV Bin/Endpoint_XMEGA.o - Bin/USBInterrupt_XMEGA.o - Bin/USBController_XMEGA.o -Endpoint_Discard_Stream Bin/EndpointStream_XMEGA.o -Endpoint_IsINReady Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -Endpoint_IsOUTReceived Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o -Endpoint_IsSETUPReceived Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/USBTask.o - Bin/DeviceStandardReq.o -Endpoint_Null_Stream Bin/EndpointStream_XMEGA.o -Endpoint_Read_8 Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -Endpoint_Read_Control_EStream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Read_Control_EStream_LE Bin/EndpointStream_XMEGA.o -Endpoint_Read_Control_Stream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Read_Control_Stream_LE Bin/EndpointStream_XMEGA.o - Bin/RNDISClassDevice.o - Bin/HIDClassDevice.o - Bin/AudioClassDevice.o -Endpoint_Read_EStream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Read_EStream_LE Bin/EndpointStream_XMEGA.o -Endpoint_Read_Stream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Read_Stream_LE Bin/EndpointStream_XMEGA.o - Bin/RNDISClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o -Endpoint_SelectEndpoint Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/USBTask.o - Bin/DeviceStandardReq.o -Endpoint_StallTransaction Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/MassStorageClassDevice.o - Bin/DeviceStandardReq.o -Endpoint_WaitUntilReady Bin/Endpoint_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o -Endpoint_Write_8 Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -Endpoint_Write_Control_EStream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Write_Control_EStream_LE Bin/EndpointStream_XMEGA.o -Endpoint_Write_Control_PStream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Write_Control_PStream_LE Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -Endpoint_Write_Control_Stream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Write_Control_Stream_LE Bin/EndpointStream_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/HIDClassDevice.o - Bin/AudioClassDevice.o - Bin/DeviceStandardReq.o -Endpoint_Write_EStream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Write_EStream_LE Bin/EndpointStream_XMEGA.o -Endpoint_Write_PStream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Write_PStream_LE Bin/EndpointStream_XMEGA.o -Endpoint_Write_Stream_BE Bin/EndpointStream_XMEGA.o -Endpoint_Write_Stream_LE Bin/EndpointStream_XMEGA.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o -GlobalSettings Bin/Settings.o - Bin/Button.o - Bin/Memory.o - Bin/Configuration.o -HID_Device_ConfigureEndpoints Bin/HIDClassDevice.o -HID_Device_ProcessControlRequest Bin/HIDClassDevice.o -HID_Device_USBTask Bin/HIDClassDevice.o -HexStringToBuffer Bin/Common.o - Bin/Commands.o -ISO14443AAppendCRCA Bin/ISO14443-3A.o - Bin/MifareClassic.o -ISO14443ACheckCRCA Bin/ISO14443-3A.o - Bin/MifareClassic.o -ISO14443ACodecInit Bin/ISO14443-2A.o - Bin/Configuration.o -ISO14443ACodecTask Bin/ISO14443-2A.o - Bin/Configuration.o -LEDPulseMask Bin/LED.o - Bin/Terminal.o - Bin/Chameleon-Mini.o -LanguageString Bin/LUFADescriptors.o -MIDI_Device_ConfigureEndpoints Bin/MIDIClassDevice.o -MIDI_Device_Flush Bin/MIDIClassDevice.o -MIDI_Device_ReceiveEventPacket Bin/MIDIClassDevice.o -MIDI_Device_SendEventPacket Bin/MIDIClassDevice.o -MIDI_Device_USBTask Bin/MIDIClassDevice.o -MS_Device_ConfigureEndpoints Bin/MassStorageClassDevice.o -MS_Device_ProcessControlRequest Bin/MassStorageClassDevice.o -MS_Device_USBTask Bin/MassStorageClassDevice.o -ManufacturerString Bin/LUFADescriptors.o -MemoryClear Bin/Memory.o - Bin/Commands.o -MemoryDownloadBlock Bin/Memory.o - Bin/Commands.o -MemoryInit Bin/Memory.o - Bin/Chameleon-Mini.o -MemoryReadBlock Bin/Memory.o - Bin/MifareClassic.o -MemoryRecall Bin/Memory.o - Bin/Settings.o - Bin/Button.o -MemoryStore Bin/Memory.o - Bin/Settings.o - Bin/Button.o -MemoryUploadBlock Bin/Memory.o - Bin/Commands.o -MemoryWriteBlock Bin/Memory.o - Bin/MifareClassic.o -MifareClassicAppInit1K Bin/MifareClassic.o - Bin/Configuration.o -MifareClassicAppInit4K Bin/MifareClassic.o - Bin/Configuration.o -MifareClassicAppProcess Bin/MifareClassic.o - Bin/Configuration.o -MifareClassicAppReset Bin/MifareClassic.o - Bin/Configuration.o -MifareClassicAppTask Bin/MifareClassic.o - Bin/Configuration.o -MifareClassicGetUid Bin/MifareClassic.o - Bin/Configuration.o -MifareClassicSetUid Bin/MifareClassic.o - Bin/Configuration.o -PRNT_Device_BytesReceived Bin/PrinterClassDevice.o -PRNT_Device_ConfigureEndpoints Bin/PrinterClassDevice.o -PRNT_Device_CreateBlockingStream Bin/PrinterClassDevice.o -PRNT_Device_CreateStream Bin/PrinterClassDevice.o -PRNT_Device_Event_Stub Bin/PrinterClassDevice.o -PRNT_Device_Flush Bin/PrinterClassDevice.o -PRNT_Device_ProcessControlRequest Bin/PrinterClassDevice.o -PRNT_Device_ReceiveByte Bin/PrinterClassDevice.o -PRNT_Device_SendByte Bin/PrinterClassDevice.o -PRNT_Device_SendData Bin/PrinterClassDevice.o -PRNT_Device_SendString Bin/PrinterClassDevice.o -PRNT_Device_USBTask Bin/PrinterClassDevice.o -ProductString Bin/LUFADescriptors.o -RNDIS_Device_ConfigureEndpoints Bin/RNDISClassDevice.o -RNDIS_Device_IsPacketReceived Bin/RNDISClassDevice.o -RNDIS_Device_ProcessControlRequest Bin/RNDISClassDevice.o -RNDIS_Device_ReadPacket Bin/RNDISClassDevice.o -RNDIS_Device_SendPacket Bin/RNDISClassDevice.o -RNDIS_Device_USBTask Bin/RNDISClassDevice.o -RandomGetBuffer Bin/Random.o - Bin/MifareClassic.o -RandomGetByte Bin/Random.o - Bin/Commands.o - Bin/Button.o -RandomInit Bin/Random.o - Bin/Chameleon-Mini.o -RandomTick Bin/Random.o - Bin/Chameleon-Mini.o -SettingsCycle Bin/Settings.o - Bin/Button.o -SettingsGetActiveById Bin/Settings.o -SettingsGetActiveByName Bin/Settings.o - Bin/Commands.o -SettingsLoad Bin/Settings.o - Bin/Chameleon-Mini.o -SettingsSave Bin/Settings.o - Bin/Commands.o -SettingsSetActiveById Bin/Settings.o -SettingsSetActiveByName Bin/Settings.o - Bin/Commands.o -StoredSettings Bin/Settings.o -SystemEnterBootloader Bin/System.o - Bin/Commands.o -SystemInit Bin/System.o - Bin/Chameleon-Mini.o -SystemInterruptInit Bin/System.o - Bin/Chameleon-Mini.o -SystemReset Bin/System.o - Bin/Commands.o -SystemStartUSBClock Bin/System.o - Bin/Terminal.o -SystemStopUSBClock Bin/System.o - Bin/Terminal.o -TerminalBuffer Bin/Terminal.o - Bin/CommandLine.o - Bin/XModem.o -TerminalHandle Bin/Terminal.o - Bin/XModem.o -TerminalInit Bin/Terminal.o - Bin/Chameleon-Mini.o -TerminalSendBlock Bin/Terminal.o - Bin/XModem.o -TerminalSendString Bin/Terminal.o - Bin/CommandLine.o -TerminalSendStringP Bin/Terminal.o - Bin/CommandLine.o -TerminalState Bin/Terminal.o -TerminalTask Bin/Terminal.o - Bin/Chameleon-Mini.o -TerminalTick Bin/Terminal.o - Bin/Chameleon-Mini.o -USB_ControlRequest Bin/USBTask.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/AudioClassDevice.o - Bin/Endpoint_XMEGA.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -USB_DeviceState Bin/USBTask.o - Bin/RNDISClassDevice.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/MassStorageClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/USBInterrupt_XMEGA.o - Bin/USBController_XMEGA.o - Bin/Endpoint_XMEGA.o - Bin/EndpointStream_XMEGA.o - Bin/DeviceStandardReq.o -USB_Device_ConfigurationNumber Bin/DeviceStandardReq.o - Bin/USBInterrupt_XMEGA.o - Bin/USBController_XMEGA.o -USB_Device_CurrentlySelfPowered Bin/DeviceStandardReq.o - Bin/USBController_XMEGA.o -USB_Device_ProcessControlRequest Bin/DeviceStandardReq.o - Bin/USBTask.o -USB_Device_RemoteWakeupEnabled Bin/DeviceStandardReq.o - Bin/USBController_XMEGA.o -USB_Device_SendRemoteWakeup Bin/Device_XMEGA.o -USB_Disable Bin/USBController_XMEGA.o - Bin/Commands.o - Bin/Terminal.o -USB_EndpointTable Bin/USBController_XMEGA.o -USB_Endpoint_FIFOs Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/DeviceStandardReq.o -USB_Endpoint_SelectedEndpoint Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/USBTask.o -USB_Endpoint_SelectedFIFO Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/MIDIClassDevice.o - Bin/HIDClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o -USB_Endpoint_SelectedHandle Bin/Endpoint_XMEGA.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/DeviceStandardReq.o -USB_Event_Stub Bin/Events.o -USB_GetHIDReportItemInfo Bin/HIDParser.o -USB_GetHIDReportSize Bin/HIDParser.o -USB_GetNextDescriptorComp Bin/ConfigDescriptors.o -USB_GetNextDescriptorOfType Bin/ConfigDescriptors.o -USB_GetNextDescriptorOfTypeAfter Bin/ConfigDescriptors.o -USB_GetNextDescriptorOfTypeBefore Bin/ConfigDescriptors.o -USB_INT_ClearAllInterrupts Bin/USBInterrupt_XMEGA.o - Bin/USBController_XMEGA.o -USB_INT_DisableAllInterrupts Bin/USBInterrupt_XMEGA.o - Bin/USBController_XMEGA.o -USB_Init Bin/USBController_XMEGA.o - Bin/Terminal.o -USB_IsInitialized Bin/USBTask.o - Bin/USBController_XMEGA.o -USB_ProcessHIDReport Bin/HIDParser.o -USB_ResetInterface Bin/USBController_XMEGA.o -USB_SetHIDReportItemInfo Bin/HIDParser.o -USB_USBTask Bin/USBTask.o - Bin/PrinterClassDevice.o - Bin/MassStorageClassDevice.o - Bin/CDCClassDevice.o - Bin/EndpointStream_XMEGA.o - Bin/Terminal.o -XModemProcessByte Bin/XModem.o - Bin/Terminal.o -XModemReceive Bin/XModem.o - Bin/Commands.o -XModemSend Bin/XModem.o - Bin/Commands.o -XModemTick Bin/XModem.o - Bin/Terminal.o -__bad_interrupt /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__bss_end /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) -__bss_start /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) -__data_end /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) -__data_load_start /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) -__data_start /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) -__divmodsi4 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) -__do_clear_bss /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_clear_bss.o) - Bin/USBController_XMEGA.o - Bin/Endpoint_XMEGA.o - Bin/USBTask.o - Bin/DeviceStandardReq.o - Bin/Crypto1.o - Bin/MifareClassic.o - Bin/ISO14443-2A.o - Bin/Codec.o - Bin/CommandLine.o - Bin/XModem.o - Bin/Terminal.o - Bin/LED.o - Bin/Settings.o - Bin/Button.o - Bin/Memory.o - Bin/Configuration.o -__do_copy_data /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_copy_data.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - Bin/RNDISClassDevice.o - Bin/CDCClassDevice.o - Bin/Crypto1.o - Bin/Commands.o - Bin/Terminal.o -__eerd_block_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - Bin/Settings.o -__eerd_byte_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - Bin/EndpointStream_XMEGA.o -__eeupd_byte_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) - Bin/EndpointStream_XMEGA.o -__eeupd_r18_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) -__eewr_block_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - Bin/Settings.o -__eewr_byte_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) -__eewr_r18_x32a4u /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_byte_atxmega32a4u.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eewr_block_atxmega32a4u.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) -__epilogue_restores__ /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_epilogue.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) -__heap_end /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__init /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__mulohisi3 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) -__mulshisi3 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) - Bin/Commands.o -__muluhisi3 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_mulshisi3.o) -__negsi2 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_negsi2.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) -__prologue_saves__ /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_prologue.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) -__stack /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__tablejump2__ /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) - Bin/DeviceStandardReq.o - Bin/HIDParser.o - Bin/MifareClassic.o - Bin/ISO14443-2A.o - Bin/XModem.o -__tablejump__ /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_tablejump.o) -__udivmodsi4 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_udivmodsi4.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_divmodsi4.o) -__ultoa_invert /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(ultoa_invert.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) -__umulhisi3 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_umulhisi3.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_muluhisi3.o) -__vector_1 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_10 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_100 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_101 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_102 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_103 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_104 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_105 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_106 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_107 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_108 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_109 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_11 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_110 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_111 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_112 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_113 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_114 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_115 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_116 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_117 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_118 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_119 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_12 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_120 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_121 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_122 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_123 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_124 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_125 Bin/USBInterrupt_XMEGA.o - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_126 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_13 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_14 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_15 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_16 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_17 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_18 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_19 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_2 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_20 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_21 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_22 Bin/ISO14443-2A.o - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_23 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_24 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_25 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_26 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_27 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_28 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_29 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_3 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_30 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_31 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_32 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_33 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_34 Bin/ISO14443-2A.o - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_35 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_36 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_37 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_38 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_39 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_4 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_40 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_41 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_42 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_43 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_44 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_45 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_46 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_47 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_48 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_49 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_5 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_50 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_51 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_52 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_53 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_54 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_55 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_56 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_57 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_58 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_59 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_6 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_60 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_61 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_62 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_63 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_64 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_65 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_66 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_67 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_68 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_69 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_7 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_70 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_71 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_72 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_73 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_74 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_75 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_76 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_77 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_78 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_79 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_8 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_80 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_81 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_82 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_83 Bin/ISO14443-2A.o - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_84 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_85 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_86 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_87 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_88 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_89 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_9 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_90 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_91 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_92 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_93 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_94 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_95 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_96 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_97 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_98 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_99 /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vector_default Bin/System.o - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -__vectors /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -_exit /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) -eeprom_mapen /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_byte_atxmega32a4u.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eeupd_byte_atxmega32a4u.o) -exit /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/avrxmega2/libgcc.a(_exit.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -fputc /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(fputc.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) -main Bin/Chameleon-Mini.o - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/crtx32a4u.o -memcmp /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcmp.o) - Bin/HIDClassDevice.o -memcpy /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(eerd_block_atxmega32a4u.o) - Bin/RNDISClassDevice.o - Bin/HIDClassDevice.o -memcpy_P /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memcpy_P.o) - Bin/RNDISClassDevice.o - Bin/Configuration.o -memset /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(memset.o) - Bin/HIDClassDevice.o -rand /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) - Bin/Random.o -rand_r /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) -snprintf_P /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) - Bin/Commands.o -srand /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(rand.o) -strcmp_P /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strcmp_P.o) - Bin/CommandLine.o - Bin/Commands.o - Bin/Button.o -strncpy_P /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strncpy_P.o) - Bin/Button.o -strnlen /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) -strnlen_P /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(strnlen_P.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) -vfprintf /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(vfprintf_std.o) - /home/sk/avr8-gnu-toolchain-linux_x86/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avrxmega2/libc.a(snprintf_p.o) +Archive member included because of file (symbol) + +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o (exit) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + Bin/HIDParser.o (__tablejump2__) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + Bin/Terminal.o (__do_copy_data) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + Bin/Configuration.o (__do_clear_bss) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + Bin/Commands.o (__mulshisi3) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) (__muluhisi3) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) (__umulhisi3) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + Bin/Random.o (rand) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + Bin/Configuration.o (memcpy_P) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + Bin/Button.o (strcmp_P) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + Bin/Log.o (strncat_P) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + Bin/Button.o (strncpy_P) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + Bin/HIDClassDevice.o (memcmp) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + Bin/HIDClassDevice.o (memcpy) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + Bin/HIDClassDevice.o (memset) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + Bin/Commands.o (snprintf_P) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) (vfprintf) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + Bin/Settings.o (__eerd_block_x32a4u) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + Bin/EndpointStream_XMEGA.o (__eerd_byte_x32a4u) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + Bin/EndpointStream_XMEGA.o (__eeupd_byte_x32a4u) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + Bin/Settings.o (__eewr_block_x32a4u) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) (__eewr_r18_x32a4u) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) (strnlen_P) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) (strnlen) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) (fputc) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) (__ultoa_invert) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) (__divmodsi4) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) (__prologue_saves__) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) (__epilogue_restores__) +c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) (__udivmodsi4) + +Allocating common symbols +Common symbol size file + +USB_IsInitialized 0x1 Bin/USBTask.o +USB_EndpointTable 0x63 Bin/USBController_XMEGA.o +TerminalBuffer 0x100 Bin/Terminal.o +USB_Endpoint_SelectedFIFO + 0x2 Bin/Endpoint_XMEGA.o +ActiveConfiguration + 0x25 Bin/Configuration.o +USB_DeviceState 0x1 Bin/USBTask.o +USB_Device_ConfigurationNumber + 0x1 Bin/DeviceStandardReq.o +USB_Endpoint_SelectedHandle + 0x2 Bin/Endpoint_XMEGA.o +USB_Device_CurrentlySelfPowered + 0x1 Bin/DeviceStandardReq.o +CodecBuffer 0x100 Bin/Codec.o +GlobalSettings 0x33 Bin/Settings.o +USB_Endpoint_SelectedEndpoint + 0x1 Bin/Endpoint_XMEGA.o +USB_ControlRequest 0x8 Bin/USBTask.o +USB_Endpoint_FIFOs 0x318 Bin/Endpoint_XMEGA.o +LogFunc 0x2 Bin/Log.o +USB_Device_RemoteWakeupEnabled + 0x1 Bin/DeviceStandardReq.o + +Discarded input sections + + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + .text 0x00000000 0x0 Bin/Chameleon-Mini.o + .bss 0x00000000 0x0 Bin/Chameleon-Mini.o + .text 0x00000000 0x0 Bin/LUFADescriptors.o + .bss 0x00000000 0x0 Bin/LUFADescriptors.o + .text 0x00000000 0x0 Bin/System.o + .bss 0x00000000 0x0 Bin/System.o + .text 0x00000000 0x0 Bin/Configuration.o + .bss 0x00000000 0x0 Bin/Configuration.o + .text 0x00000000 0x0 Bin/Random.o + .bss 0x00000000 0x0 Bin/Random.o + .text 0x00000000 0x0 Bin/Common.o + .bss 0x00000000 0x0 Bin/Common.o + .text 0x00000000 0x0 Bin/Memory.o + .text 0x00000000 0x0 Bin/Button.o + .text 0x00000000 0x0 Bin/Log.o + .text 0x00000000 0x0 Bin/Settings.o + .bss 0x00000000 0x0 Bin/Settings.o + .text 0x00000000 0x0 Bin/LED.o + .text 0x00000000 0x0 Bin/Terminal.o + .text 0x00000000 0x0 Bin/Commands.o + .bss 0x00000000 0x0 Bin/Commands.o + .text 0x00000000 0x0 Bin/XModem.o + .text 0x00000000 0x0 Bin/CommandLine.o + .text.CommandLineInit + 0x00000000 0xa Bin/CommandLine.o + .text 0x00000000 0x0 Bin/Codec.o + .bss 0x00000000 0x0 Bin/Codec.o + .text 0x00000000 0x0 Bin/ISO14443-2A.o + .text 0x00000000 0x0 Bin/MifareUltralight.o + .text 0x00000000 0x0 Bin/MifareClassic.o + .text 0x00000000 0x0 Bin/ISO14443-3A.o + .bss 0x00000000 0x0 Bin/ISO14443-3A.o + .text 0x00000000 0x0 Bin/Crypto1.o + .text 0x00000000 0x0 Bin/HIDParser.o + .bss 0x00000000 0x0 Bin/HIDParser.o + .text.USB_ProcessHIDReport + 0x00000000 0x850 Bin/HIDParser.o + .progmem.gcc_sw_table.USB_ProcessHIDReport + 0x00000000 0x17a Bin/HIDParser.o + .text.USB_GetHIDReportItemInfo + 0x00000000 0xc6 Bin/HIDParser.o + .text.USB_SetHIDReportItemInfo + 0x00000000 0xee Bin/HIDParser.o + .text.USB_GetHIDReportSize + 0x00000000 0x158 Bin/HIDParser.o + .text 0x00000000 0x0 Bin/ConfigDescriptors.o + .bss 0x00000000 0x0 Bin/ConfigDescriptors.o + .text.USB_GetNextDescriptorOfType + 0x00000000 0x50 Bin/ConfigDescriptors.o + .text.USB_GetNextDescriptorOfTypeBefore + 0x00000000 0x6c Bin/ConfigDescriptors.o + .text.USB_GetNextDescriptorOfTypeAfter + 0x00000000 0x3e Bin/ConfigDescriptors.o + .text.USB_GetNextDescriptorComp + 0x00000000 0x8e Bin/ConfigDescriptors.o + .text 0x00000000 0x0 Bin/DeviceStandardReq.o + .bss 0x00000000 0x0 Bin/DeviceStandardReq.o + .text 0x00000000 0x0 Bin/Events.o + .bss 0x00000000 0x0 Bin/Events.o + .text 0x00000000 0x0 Bin/HostStandardReq.o + .bss 0x00000000 0x0 Bin/HostStandardReq.o + .text 0x00000000 0x0 Bin/USBTask.o + .bss 0x00000000 0x0 Bin/USBTask.o + .text 0x00000000 0x0 Bin/Device_XMEGA.o + .bss 0x00000000 0x0 Bin/Device_XMEGA.o + .text.USB_Device_SendRemoteWakeup + 0x00000000 0xc Bin/Device_XMEGA.o + .text 0x00000000 0x0 Bin/EndpointStream_XMEGA.o + .bss 0x00000000 0x0 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Discard_Stream + 0x00000000 0xc4 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Null_Stream + 0x00000000 0xc8 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_Stream_BE + 0x00000000 0xf8 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_Stream_LE + 0x00000000 0xe8 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_Stream_BE + 0x00000000 0xf8 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_PStream_LE + 0x00000000 0xec Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_PStream_BE + 0x00000000 0xf6 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_EStream_LE + 0x00000000 0xf0 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_EStream_BE + 0x00000000 0xfa Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_EStream_LE + 0x00000000 0xfe Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_EStream_BE + 0x00000000 0x108 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_Control_Stream_BE + 0x00000000 0x170 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_Control_Stream_LE + 0x00000000 0xf0 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_Control_Stream_BE + 0x00000000 0xde Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_Control_PStream_BE + 0x00000000 0x170 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_Control_EStream_LE + 0x00000000 0x156 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Write_Control_EStream_BE + 0x00000000 0x172 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_Control_EStream_LE + 0x00000000 0xf6 Bin/EndpointStream_XMEGA.o + .text.Endpoint_Read_Control_EStream_BE + 0x00000000 0xe2 Bin/EndpointStream_XMEGA.o + .text 0x00000000 0x0 Bin/Endpoint_XMEGA.o + .bss 0x00000000 0x0 Bin/Endpoint_XMEGA.o + .text 0x00000000 0x0 Bin/Host_XMEGA.o + .bss 0x00000000 0x0 Bin/Host_XMEGA.o + .text 0x00000000 0x0 Bin/PipeStream_XMEGA.o + .bss 0x00000000 0x0 Bin/PipeStream_XMEGA.o + .text 0x00000000 0x0 Bin/Pipe_XMEGA.o + .bss 0x00000000 0x0 Bin/Pipe_XMEGA.o + .text 0x00000000 0x0 Bin/USBController_XMEGA.o + .bss 0x00000000 0x0 Bin/USBController_XMEGA.o + .text 0x00000000 0x0 Bin/USBInterrupt_XMEGA.o + .bss 0x00000000 0x0 Bin/USBInterrupt_XMEGA.o + .text 0x00000000 0x0 Bin/AudioClassDevice.o + .bss 0x00000000 0x0 Bin/AudioClassDevice.o + .text.Audio_Device_ConfigureEndpoints + 0x00000000 0x32 Bin/AudioClassDevice.o + .text.Audio_Device_Event_Stub + 0x00000000 0x2 Bin/AudioClassDevice.o + .text.Audio_Device_ProcessControlRequest + 0x00000000 0x29e Bin/AudioClassDevice.o + .text 0x00000000 0x0 Bin/CDCClassDevice.o + .bss 0x00000000 0x0 Bin/CDCClassDevice.o + .text.CDC_Device_putchar + 0x00000000 0x1e Bin/CDCClassDevice.o + .text.CDC_Device_BytesReceived + 0x00000000 0x8a Bin/CDCClassDevice.o + .text.CDC_Device_getchar_Blocking + 0x00000000 0x3e Bin/CDCClassDevice.o + .text.CDC_Device_getchar + 0x00000000 0x1a Bin/CDCClassDevice.o + .rodata 0x00000000 0x8 Bin/CDCClassDevice.o + .text.CDC_Device_SendControlLineStateChange + 0x00000000 0x7c Bin/CDCClassDevice.o + .text.CDC_Device_CreateStream + 0x00000000 0x26 Bin/CDCClassDevice.o + .text.CDC_Device_CreateBlockingStream + 0x00000000 0x26 Bin/CDCClassDevice.o + .text 0x00000000 0x0 Bin/HIDClassDevice.o + .bss 0x00000000 0x0 Bin/HIDClassDevice.o + .text.HID_Device_ProcessControlRequest + 0x00000000 0x254 Bin/HIDClassDevice.o + .text.HID_Device_ConfigureEndpoints + 0x00000000 0x2c Bin/HIDClassDevice.o + .text.HID_Device_USBTask + 0x00000000 0x1b2 Bin/HIDClassDevice.o + .text 0x00000000 0x0 Bin/MassStorageClassDevice.o + .bss 0x00000000 0x0 Bin/MassStorageClassDevice.o + .text.MS_Device_ProcessControlRequest + 0x00000000 0x70 Bin/MassStorageClassDevice.o + .text.MS_Device_ConfigureEndpoints + 0x00000000 0x3e Bin/MassStorageClassDevice.o + .text.MS_Device_USBTask + 0x00000000 0x2ca Bin/MassStorageClassDevice.o + .text 0x00000000 0x0 Bin/MIDIClassDevice.o + .bss 0x00000000 0x0 Bin/MIDIClassDevice.o + .text.MIDI_Device_ConfigureEndpoints + 0x00000000 0x32 Bin/MIDIClassDevice.o + .text.MIDI_Device_SendEventPacket + 0x00000000 0x66 Bin/MIDIClassDevice.o + .text.MIDI_Device_Flush + 0x00000000 0x5c Bin/MIDIClassDevice.o + .text.MIDI_Device_USBTask + 0x00000000 0x2c Bin/MIDIClassDevice.o + .text.MIDI_Device_ReceiveEventPacket + 0x00000000 0x70 Bin/MIDIClassDevice.o + .text 0x00000000 0x0 Bin/PrinterClassDevice.o + .bss 0x00000000 0x0 Bin/PrinterClassDevice.o + .text.PRNT_Device_ConfigureEndpoints + 0x00000000 0x38 Bin/PrinterClassDevice.o + .text.PRNT_Device_SendString + 0x00000000 0x46 Bin/PrinterClassDevice.o + .text.PRNT_Device_SendData + 0x00000000 0x3c Bin/PrinterClassDevice.o + .text.PRNT_Device_SendByte + 0x00000000 0x5e Bin/PrinterClassDevice.o + .text.PRNT_Device_putchar + 0x00000000 0x1e Bin/PrinterClassDevice.o + .text.PRNT_Device_Flush + 0x00000000 0x88 Bin/PrinterClassDevice.o + .text.PRNT_Device_USBTask + 0x00000000 0xcc Bin/PrinterClassDevice.o + .text.PRNT_Device_BytesReceived + 0x00000000 0x7a Bin/PrinterClassDevice.o + .text.PRNT_Device_ReceiveByte + 0x00000000 0xb6 Bin/PrinterClassDevice.o + .text.PRNT_Device_getchar_Blocking + 0x00000000 0x3e Bin/PrinterClassDevice.o + .text.PRNT_Device_getchar + 0x00000000 0x1a Bin/PrinterClassDevice.o + .text.PRNT_Device_CreateStream + 0x00000000 0x26 Bin/PrinterClassDevice.o + .text.PRNT_Device_CreateBlockingStream + 0x00000000 0x26 Bin/PrinterClassDevice.o + .text.PRNT_Device_Event_Stub + 0x00000000 0x2 Bin/PrinterClassDevice.o + .text.PRNT_Device_ProcessControlRequest + 0x00000000 0xe2 Bin/PrinterClassDevice.o + .text 0x00000000 0x0 Bin/RNDISClassDevice.o + .bss 0x00000000 0x0 Bin/RNDISClassDevice.o + .text.RNDIS_Device_ProcessControlRequest + 0x00000000 0x53c Bin/RNDISClassDevice.o + .text.RNDIS_Device_ConfigureEndpoints + 0x00000000 0x50 Bin/RNDISClassDevice.o + .rodata 0x00000000 0x8 Bin/RNDISClassDevice.o + .text.RNDIS_Device_USBTask + 0x00000000 0x74 Bin/RNDISClassDevice.o + .text.RNDIS_Device_IsPacketReceived + 0x00000000 0x24 Bin/RNDISClassDevice.o + .text.RNDIS_Device_ReadPacket + 0x00000000 0xa2 Bin/RNDISClassDevice.o + .text.RNDIS_Device_SendPacket + 0x00000000 0xca Bin/RNDISClassDevice.o + .progmem.data 0x00000000 0x6c Bin/RNDISClassDevice.o + .text 0x00000000 0x0 Bin/AndroidAccessoryClassHost.o + .bss 0x00000000 0x0 Bin/AndroidAccessoryClassHost.o + .text 0x00000000 0x0 Bin/AudioClassHost.o + .bss 0x00000000 0x0 Bin/AudioClassHost.o + .text 0x00000000 0x0 Bin/CDCClassHost.o + .bss 0x00000000 0x0 Bin/CDCClassHost.o + .text 0x00000000 0x0 Bin/HIDClassHost.o + .bss 0x00000000 0x0 Bin/HIDClassHost.o + .text 0x00000000 0x0 Bin/MassStorageClassHost.o + .bss 0x00000000 0x0 Bin/MassStorageClassHost.o + .text 0x00000000 0x0 Bin/MIDIClassHost.o + .bss 0x00000000 0x0 Bin/MIDIClassHost.o + .text 0x00000000 0x0 Bin/PrinterClassHost.o + .bss 0x00000000 0x0 Bin/PrinterClassHost.o + .text 0x00000000 0x0 Bin/RNDISClassHost.o + .bss 0x00000000 0x0 Bin/RNDISClassHost.o + .text 0x00000000 0x0 Bin/StillImageClassHost.o + .bss 0x00000000 0x0 Bin/StillImageClassHost.o + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text.libgcc 0x00000000 0xc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + .text.avr-libc + 0x00000000 0x1a c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + .text.avr-libc + 0x00000000 0xe c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + .text.avr-libc + 0x00000000 0x20 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + .text.avr-libc + 0x00000000 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + +Memory Configuration + +Name Origin Length Attributes +text 0x00000000 0x00100000 xr +data 0x00802000 0x0000ffa0 rw !x +eeprom 0x00810000 0x00010000 rw !x +fuse 0x00820000 0x00000400 rw !x +lock 0x00830000 0x00000400 rw !x +signature 0x00840000 0x00000400 rw !x +user_signatures 0x00850000 0x00000400 rw !x +*default* 0x00000000 0xffffffff + +Linker script and memory map + +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +LOAD Bin/Chameleon-Mini.o +LOAD Bin/LUFADescriptors.o +LOAD Bin/System.o +LOAD Bin/Configuration.o +LOAD Bin/Random.o +LOAD Bin/Common.o +LOAD Bin/Memory.o +LOAD Bin/Button.o +LOAD Bin/Log.o +LOAD Bin/Settings.o +LOAD Bin/LED.o +LOAD Bin/Terminal.o +LOAD Bin/Commands.o +LOAD Bin/XModem.o +LOAD Bin/CommandLine.o +LOAD Bin/Codec.o +LOAD Bin/ISO14443-2A.o +LOAD Bin/MifareUltralight.o +LOAD Bin/MifareClassic.o +LOAD Bin/ISO14443-3A.o +LOAD Bin/Crypto1.o +LOAD Bin/HIDParser.o +LOAD Bin/ConfigDescriptors.o +LOAD Bin/DeviceStandardReq.o +LOAD Bin/Events.o +LOAD Bin/HostStandardReq.o +LOAD Bin/USBTask.o +LOAD Bin/Device_XMEGA.o +LOAD Bin/EndpointStream_XMEGA.o +LOAD Bin/Endpoint_XMEGA.o +LOAD Bin/Host_XMEGA.o +LOAD Bin/PipeStream_XMEGA.o +LOAD Bin/Pipe_XMEGA.o +LOAD Bin/USBController_XMEGA.o +LOAD Bin/USBInterrupt_XMEGA.o +LOAD Bin/AudioClassDevice.o +LOAD Bin/CDCClassDevice.o +LOAD Bin/HIDClassDevice.o +LOAD Bin/MassStorageClassDevice.o +LOAD Bin/MIDIClassDevice.o +LOAD Bin/PrinterClassDevice.o +LOAD Bin/RNDISClassDevice.o +LOAD Bin/AndroidAccessoryClassHost.o +LOAD Bin/AudioClassHost.o +LOAD Bin/CDCClassHost.o +LOAD Bin/HIDClassHost.o +LOAD Bin/MassStorageClassHost.o +LOAD Bin/MIDIClassHost.o +LOAD Bin/PrinterClassHost.o +LOAD Bin/RNDISClassHost.o +LOAD Bin/StillImageClassHost.o +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libm.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a +LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x00000000 0x628e + *(.vectors) + .vectors 0x00000000 0x1fc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + 0x00000000 __vectors + *(.vectors) + *(.progmem.gcc*) + *(.progmem*) + .progmem.data 0x000001fc 0x8c Bin/LUFADescriptors.o + 0x000001fc ProductString + 0x0000021a ManufacturerString + 0x00000234 LanguageString + 0x00000238 ConfigurationDescriptor + 0x00000276 DeviceDescriptor + .progmem.data 0x00000288 0xde Bin/Configuration.o + .progmem.data 0x00000366 0x120 Bin/Button.o + .progmem.data 0x00000486 0x32 Bin/Log.o + .progmem.data 0x000004b8 0x100 Bin/LED.o + .progmem.data 0x000005b8 0x89 Bin/Commands.o + .progmem.data 0x00000641 0x29a Bin/CommandLine.o + 0x00000641 CommandTable + 0x000008dc . = ALIGN (0x2) + *fill* 0x000008db 0x1 + 0x000008dc __trampolines_start = . + *(.trampolines) + .trampolines 0x000008dc 0x0 linker stubs + *(.trampolines*) + 0x000008dc __trampolines_end = . + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x000008dc __ctors_start = . + *(.ctors) + 0x000008dc __ctors_end = . + 0x000008dc __dtors_start = . + *(.dtors) + 0x000008dc __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x000008dc 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + 0x000008dc __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x000008dc 0xc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + .init4 0x000008e8 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + 0x000008e8 __do_copy_data + .init4 0x000008fe 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + 0x000008fe __do_clear_bss + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x0000090e 0x6 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + *(.init9) + *(.text) + .text 0x00000914 0x2 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + 0x00000914 __vector_38 + 0x00000914 __vector_104 + 0x00000914 __vector_63 + 0x00000914 __vector_28 + 0x00000914 __vector_67 + 0x00000914 __vector_1 + 0x00000914 __vector_119 + 0x00000914 __vector_32 + 0x00000914 __vector_75 + 0x00000914 __vector_71 + 0x00000914 __vector_91 + 0x00000914 __vector_62 + 0x00000914 __vector_77 + 0x00000914 __vector_102 + 0x00000914 __vector_24 + 0x00000914 __vector_12 + 0x00000914 __vector_55 + 0x00000914 __vector_69 + 0x00000914 __vector_81 + 0x00000914 __vector_90 + 0x00000914 __vector_46 + 0x00000914 __bad_interrupt + 0x00000914 __vector_122 + 0x00000914 __vector_72 + 0x00000914 __vector_114 + 0x00000914 __vector_6 + 0x00000914 __vector_110 + 0x00000914 __vector_31 + 0x00000914 __vector_92 + 0x00000914 __vector_35 + 0x00000914 __vector_78 + 0x00000914 __vector_74 + 0x00000914 __vector_117 + 0x00000914 __vector_39 + 0x00000914 __vector_107 + 0x00000914 __vector_3 + 0x00000914 __vector_105 + 0x00000914 __vector_98 + 0x00000914 __vector_23 + 0x00000914 __vector_68 + 0x00000914 __vector_30 + 0x00000914 __vector_73 + 0x00000914 __vector_45 + 0x00000914 __vector_25 + 0x00000914 __vector_93 + 0x00000914 __vector_61 + 0x00000914 __vector_11 + 0x00000914 __vector_54 + 0x00000914 __vector_99 + 0x00000914 __vector_13 + 0x00000914 __vector_17 + 0x00000914 __vector_19 + 0x00000914 __vector_56 + 0x00000914 __vector_7 + 0x00000914 __vector_49 + 0x00000914 __vector_123 + 0x00000914 __vector_41 + 0x00000914 __vector_86 + 0x00000914 __vector_100 + 0x00000914 __vector_101 + 0x00000914 __vector_64 + 0x00000914 __vector_88 + 0x00000914 __vector_109 + 0x00000914 __vector_43 + 0x00000914 __vector_27 + 0x00000914 __vector_5 + 0x00000914 __vector_113 + 0x00000914 __vector_33 + 0x00000914 __vector_76 + 0x00000914 __vector_115 + 0x00000914 __vector_47 + 0x00000914 __vector_52 + 0x00000914 __vector_37 + 0x00000914 __vector_95 + 0x00000914 __vector_103 + 0x00000914 __vector_96 + 0x00000914 __vector_89 + 0x00000914 __vector_108 + 0x00000914 __vector_4 + 0x00000914 __vector_44 + 0x00000914 __vector_82 + 0x00000914 __vector_106 + 0x00000914 __vector_118 + 0x00000914 __vector_51 + 0x00000914 __vector_9 + 0x00000914 __vector_2 + 0x00000914 __vector_21 + 0x00000914 __vector_15 + 0x00000914 __vector_66 + 0x00000914 __vector_36 + 0x00000914 __vector_79 + 0x00000914 __vector_58 + 0x00000914 __vector_70 + 0x00000914 __vector_29 + 0x00000914 __vector_60 + 0x00000914 __vector_121 + 0x00000914 __vector_40 + 0x00000914 __vector_85 + 0x00000914 __vector_94 + 0x00000914 __vector_126 + 0x00000914 __vector_8 + 0x00000914 __vector_26 + 0x00000914 __vector_48 + 0x00000914 __vector_124 + 0x00000914 __vector_116 + 0x00000914 __vector_112 + 0x00000914 __vector_111 + 0x00000914 __vector_80 + 0x00000914 __vector_14 + 0x00000914 __vector_84 + 0x00000914 __vector_57 + 0x00000914 __vector_53 + 0x00000914 __vector_50 + 0x00000914 __vector_16 + 0x00000914 __vector_59 + 0x00000914 __vector_18 + 0x00000914 __vector_97 + 0x00000914 __vector_20 + 0x00000914 __vector_42 + 0x00000914 __vector_87 + 0x00000914 __vector_65 + 0x00000914 __vector_120 + 0x00000916 . = ALIGN (0x2) + *(.text.*) + .text.startup.main + 0x00000916 0x8c Bin/Chameleon-Mini.o + 0x00000916 main + .text.CALLBACK_USB_GetDescriptor + 0x000009a2 0x82 Bin/LUFADescriptors.o + 0x000009a2 CALLBACK_USB_GetDescriptor + .text.__vector_default + 0x00000a24 0xc Bin/System.o + 0x00000a24 __vector_default + .text.__vector_10 + 0x00000a30 0x2 Bin/System.o + 0x00000a30 __vector_10 + .text.SystemInit + 0x00000a32 0x86 Bin/System.o + 0x00000a32 SystemInit + .text.SystemReset + 0x00000ab8 0xe Bin/System.o + 0x00000ab8 SystemReset + .text.SystemEnterBootloader + 0x00000ac6 0xc Bin/System.o + 0x00000ac6 SystemEnterBootloader + .text.SystemStartUSBClock + 0x00000ad2 0x3c Bin/System.o + 0x00000ad2 SystemStartUSBClock + .text.SystemStopUSBClock + 0x00000b0e 0x26 Bin/System.o + 0x00000b0e SystemStopUSBClock + .text.SystemInterruptInit + 0x00000b34 0xc Bin/System.o + 0x00000b34 SystemInterruptInit + .text.CodecInitDummy + 0x00000b40 0x2 Bin/Configuration.o + .text.CodecTaskDummy + 0x00000b42 0x2 Bin/Configuration.o + .text.ApplicationInitDummy + 0x00000b44 0x2 Bin/Configuration.o + .text.ApplicationResetDummy + 0x00000b46 0x2 Bin/Configuration.o + .text.ApplicationTaskDummy + 0x00000b48 0x2 Bin/Configuration.o + .text.ApplicationProcessDummy + 0x00000b4a 0x6 Bin/Configuration.o + .text.ApplicationGetUidDummy + 0x00000b50 0x2 Bin/Configuration.o + .text.ApplicationSetUidDummy + 0x00000b52 0x2 Bin/Configuration.o + .text.ConfigurationSetById + 0x00000b54 0x36 Bin/Configuration.o + 0x00000b54 ConfigurationSetById + .text.ConfigurationInit + 0x00000b8a 0xc Bin/Configuration.o + 0x00000b8a ConfigurationInit + .text.ConfigurationSetByName + 0x00000b96 0x82 Bin/Configuration.o + 0x00000b96 ConfigurationSetByName + .text.ConfigurationGetList + 0x00000c18 0x5e Bin/Configuration.o + 0x00000c18 ConfigurationGetList + .text.RandomInit + 0x00000c76 0x2 Bin/Random.o + 0x00000c76 RandomInit + .text.RandomGetByte + 0x00000c78 0x6 Bin/Random.o + 0x00000c78 RandomGetByte + .text.RandomGetBuffer + 0x00000c7e 0x1e Bin/Random.o + 0x00000c7e RandomGetBuffer + .text.RandomTick + 0x00000c9c 0x10 Bin/Random.o + 0x00000c9c RandomTick + .text.BufferToHexString + 0x00000cac 0x84 Bin/Common.o + 0x00000cac BufferToHexString + .text.HexStringToBuffer + 0x00000d30 0x8c Bin/Common.o + 0x00000d30 HexStringToBuffer + .text.MemoryReadBlock + 0x00000dbc 0x30 Bin/Memory.o + 0x00000dbc MemoryReadBlock + .text.MemoryWriteBlock + 0x00000dec 0x38 Bin/Memory.o + 0x00000dec MemoryWriteBlock + .text.MemoryClear + 0x00000e24 0x10 Bin/Memory.o + 0x00000e24 MemoryClear + .text.MemoryRecall + 0x00000e34 0xec Bin/Memory.o + 0x00000e34 MemoryRecall + .text.MemoryInit + 0x00000f20 0xfe Bin/Memory.o + 0x00000f20 MemoryInit + .text.MemoryStore + 0x0000101e 0x28e Bin/Memory.o + 0x0000101e MemoryStore + .text.MemoryUploadBlock + 0x000012ac 0x38a Bin/Memory.o + 0x000012ac MemoryUploadBlock + .text.MemoryDownloadBlock + 0x00001636 0x7a Bin/Memory.o + 0x00001636 MemoryDownloadBlock + .text.ExecuteButtonAction + 0x000016b0 0x1aa Bin/Button.o + .text.ButtonInit + 0x0000185a 0xe Bin/Button.o + 0x0000185a ButtonInit + .text.ButtonTick + 0x00001868 0x4a Bin/Button.o + 0x00001868 ButtonTick + .text.ButtonGetActionList + 0x000018b2 0x64 Bin/Button.o + 0x000018b2 ButtonGetActionList + .text.ButtonSetActionById + 0x00001916 0x4e Bin/Button.o + 0x00001916 ButtonSetActionById + .text.ButtonGetActionByName + 0x00001964 0x38 Bin/Button.o + 0x00001964 ButtonGetActionByName + .text.ButtonSetActionByName + 0x0000199c 0xc4 Bin/Button.o + 0x0000199c ButtonSetActionByName + .text.LogFuncOff + 0x00001a60 0x2 Bin/Log.o + .text.LogFuncTerminal + 0x00001a62 0x2c Bin/Log.o + .text.LogTick 0x00001a8e 0x2 Bin/Log.o + 0x00001a8e LogTick + .text.LogTask 0x00001a90 0x2 Bin/Log.o + 0x00001a90 LogTask + .text.LogMemLoadBlock + 0x00001a92 0x30 Bin/Log.o + 0x00001a92 LogMemLoadBlock + .text.LogMemClear + 0x00001ac2 0x2a Bin/Log.o + 0x00001ac2 LogMemClear + .text.LogMemFree + 0x00001aec 0xa Bin/Log.o + 0x00001aec LogMemFree + .text.LogSetModeById + 0x00001af6 0x40 Bin/Log.o + 0x00001af6 LogSetModeById + .text.LogFuncMemory + 0x00001b36 0x6e Bin/Log.o + .text.LogInit 0x00001ba4 0xe Bin/Log.o + 0x00001ba4 LogInit + .text.LogSetModeByName + 0x00001bb2 0x4a Bin/Log.o + 0x00001bb2 LogSetModeByName + .text.LogGetModeByName + 0x00001bfc 0x1c Bin/Log.o + 0x00001bfc LogGetModeByName + .text.LogGetModeList + 0x00001c18 0x50 Bin/Log.o + 0x00001c18 LogGetModeList + .text.SettingsLoad + 0x00001c68 0x10 Bin/Settings.o + 0x00001c68 SettingsLoad + .text.SettingsSave + 0x00001c78 0x10 Bin/Settings.o + 0x00001c78 SettingsSave + .text.SettingsSetActiveById + 0x00001c88 0x64 Bin/Settings.o + 0x00001c88 SettingsSetActiveById + .text.SettingsCycle + 0x00001cec 0x120 Bin/Settings.o + 0x00001cec SettingsCycle + .text.SettingsGetActiveById + 0x00001e0c 0x8 Bin/Settings.o + 0x00001e0c SettingsGetActiveById + .text.SettingsGetActiveByName + 0x00001e14 0x14 Bin/Settings.o + 0x00001e14 SettingsGetActiveByName + .text.SettingsSetActiveByName + 0x00001e28 0x12 Bin/Settings.o + 0x00001e28 SettingsSetActiveByName + .text.LEDInit 0x00001e3a 0xa Bin/LED.o + 0x00001e3a LEDInit + .text.LEDTick 0x00001e44 0x11a Bin/LED.o + 0x00001e44 LEDTick + .text.LEDTrigger + 0x00001f5e 0x20 Bin/LED.o + 0x00001f5e LEDTrigger + .text.LEDGetFuncList + 0x00001f7e 0x64 Bin/LED.o + 0x00001f7e LEDGetFuncList + .text.LEDSetFuncById + 0x00001fe2 0xac Bin/LED.o + 0x00001fe2 LEDSetFuncById + .text.LEDGetFuncByName + 0x0000208e 0x3a Bin/LED.o + 0x0000208e LEDGetFuncByName + .text.LEDSetFuncByName + 0x000020c8 0xb0 Bin/LED.o + 0x000020c8 LEDSetFuncByName + .text.TerminalSendString + 0x00002178 0xa Bin/Terminal.o + 0x00002178 TerminalSendString + .text.TerminalSendStringP + 0x00002182 0x28 Bin/Terminal.o + 0x00002182 TerminalSendStringP + .text.TerminalSendBlock + 0x000021aa 0xc Bin/Terminal.o + 0x000021aa TerminalSendBlock + .text.TerminalInit + 0x000021b6 0xa Bin/Terminal.o + 0x000021b6 TerminalInit + .text.TerminalTask + 0x000021c0 0x42 Bin/Terminal.o + 0x000021c0 TerminalTask + .text.TerminalTick + 0x00002202 0x80 Bin/Terminal.o + 0x00002202 TerminalTick + .text.EVENT_USB_Device_Connect + 0x00002282 0x6 Bin/Terminal.o + 0x00002282 EVENT_USB_Device_Connect + .text.EVENT_USB_Device_Disconnect + 0x00002288 0x6 Bin/Terminal.o + 0x00002288 EVENT_USB_Device_Disconnect + .text.EVENT_USB_Device_ConfigurationChanged + 0x0000228e 0x8 Bin/Terminal.o + 0x0000228e EVENT_USB_Device_ConfigurationChanged + .text.EVENT_USB_Device_ControlRequest + 0x00002296 0x8 Bin/Terminal.o + 0x00002296 EVENT_USB_Device_ControlRequest + .text.CommandGetVersion + 0x0000229e 0x3c Bin/Commands.o + 0x0000229e CommandGetVersion + .text.CommandGetConfig + 0x000022da 0x2c Bin/Commands.o + 0x000022da CommandGetConfig + .text.CommandSetConfig + 0x00002306 0x12 Bin/Commands.o + 0x00002306 CommandSetConfig + .text.CommandExecConfig + 0x00002318 0xc Bin/Commands.o + 0x00002318 CommandExecConfig + .text.CommandGetUid + 0x00002324 0x4e Bin/Commands.o + 0x00002324 CommandGetUid + .text.CommandSetUid + 0x00002372 0xb2 Bin/Commands.o + 0x00002372 CommandSetUid + .text.CommandGetReadOnly + 0x00002424 0x24 Bin/Commands.o + 0x00002424 CommandGetReadOnly + .text.CommandSetReadOnly + 0x00002448 0x28 Bin/Commands.o + 0x00002448 CommandSetReadOnly + .text.CommandExecUpload + 0x00002470 0xa Bin/Commands.o + 0x00002470 CommandExecUpload + .text.CommandExecDownload + 0x0000247a 0xa Bin/Commands.o + 0x0000247a CommandExecDownload + .text.CommandExecReset + 0x00002484 0x16 Bin/Commands.o + 0x00002484 CommandExecReset + .text.CommandExecUpgrade + 0x0000249a 0x16 Bin/Commands.o + 0x0000249a CommandExecUpgrade + .text.CommandGetMemSize + 0x000024b0 0x30 Bin/Commands.o + 0x000024b0 CommandGetMemSize + .text.CommandGetUidSize + 0x000024e0 0x2c Bin/Commands.o + 0x000024e0 CommandGetUidSize + .text.CommandExecButton + 0x0000250c 0xa Bin/Commands.o + 0x0000250c CommandExecButton + .text.CommandGetButton + 0x00002516 0xe Bin/Commands.o + 0x00002516 CommandGetButton + .text.CommandSetButton + 0x00002524 0x14 Bin/Commands.o + 0x00002524 CommandSetButton + .text.CommandExecButtonLong + 0x00002538 0xa Bin/Commands.o + 0x00002538 CommandExecButtonLong + .text.CommandGetButtonLong + 0x00002542 0xe Bin/Commands.o + 0x00002542 CommandGetButtonLong + .text.CommandSetButtonLong + 0x00002550 0x14 Bin/Commands.o + 0x00002550 CommandSetButtonLong + .text.CommandExecLedGreen + 0x00002564 0xa Bin/Commands.o + 0x00002564 CommandExecLedGreen + .text.CommandGetLedGreen + 0x0000256e 0xe Bin/Commands.o + 0x0000256e CommandGetLedGreen + .text.CommandSetLedGreen + 0x0000257c 0x14 Bin/Commands.o + 0x0000257c CommandSetLedGreen + .text.CommandExecLedRed + 0x00002590 0xa Bin/Commands.o + 0x00002590 CommandExecLedRed + .text.CommandGetLedRed + 0x0000259a 0xe Bin/Commands.o + 0x0000259a CommandGetLedRed + .text.CommandSetLedRed + 0x000025a8 0x14 Bin/Commands.o + 0x000025a8 CommandSetLedRed + .text.CommandExecLogMode + 0x000025bc 0xa Bin/Commands.o + 0x000025bc CommandExecLogMode + .text.CommandGetLogMode + 0x000025c6 0xa Bin/Commands.o + 0x000025c6 CommandGetLogMode + .text.CommandSetLogMode + 0x000025d0 0x10 Bin/Commands.o + 0x000025d0 CommandSetLogMode + .text.CommandExecLogMem + 0x000025e0 0x34 Bin/Commands.o + 0x000025e0 CommandExecLogMem + .text.CommandGetLogMem + 0x00002614 0x34 Bin/Commands.o + 0x00002614 CommandGetLogMem + .text.CommandSetLogMem + 0x00002648 0x40 Bin/Commands.o + 0x00002648 CommandSetLogMem + .text.CommandGetSetting + 0x00002688 0xa Bin/Commands.o + 0x00002688 CommandGetSetting + .text.CommandSetSetting + 0x00002692 0x10 Bin/Commands.o + 0x00002692 CommandSetSetting + .text.CommandExecClear + 0x000026a2 0x8 Bin/Commands.o + 0x000026a2 CommandExecClear + .text.CommandExecHelp + 0x000026aa 0x98 Bin/Commands.o + 0x000026aa CommandExecHelp + .text.CommandGetRssi + 0x00002742 0x68 Bin/Commands.o + 0x00002742 CommandGetRssi + .text.CalcChecksum.constprop.0 + 0x000027aa 0x14 Bin/XModem.o + .text.XModemReceive + 0x000027be 0x36 Bin/XModem.o + 0x000027be XModemReceive + .text.XModemSend + 0x000027f4 0x2c Bin/XModem.o + 0x000027f4 XModemSend + .text.XModemProcessByte + 0x00002820 0x296 Bin/XModem.o + 0x00002820 XModemProcessByte + .text.XModemTick + 0x00002ab6 0x76 Bin/XModem.o + 0x00002ab6 XModemTick + .text.CommandLineProcessByte + 0x00002b2c 0x20e Bin/CommandLine.o + 0x00002b2c CommandLineProcessByte + .text.CommandLineTick + 0x00002d3a 0x2 Bin/CommandLine.o + 0x00002d3a CommandLineTick + .text.StartDemod + 0x00002d3c 0x7a Bin/ISO14443-2A.o + .text.__vector_34 + 0x00002db6 0x62 Bin/ISO14443-2A.o + 0x00002db6 __vector_34 + .text.__vector_22 + 0x00002e18 0x148 Bin/ISO14443-2A.o + 0x00002e18 __vector_22 + .text.__vector_83 + 0x00002f60 0x1e2 Bin/ISO14443-2A.o + 0x00002f60 __vector_83 + .text.ISO14443ACodecInit + 0x00003142 0x6e Bin/ISO14443-2A.o + 0x00003142 ISO14443ACodecInit + .text.ISO14443ACodecTask + 0x000031b0 0x162 Bin/ISO14443-2A.o + 0x000031b0 ISO14443ACodecTask + .text.MifareUltralightAppInit + 0x00003312 0x8 Bin/MifareUltralight.o + 0x00003312 MifareUltralightAppInit + .text.MifareUltralightAppReset + 0x0000331a 0x8 Bin/MifareUltralight.o + 0x0000331a MifareUltralightAppReset + .text.MifareUltralightAppTask + 0x00003322 0x2 Bin/MifareUltralight.o + 0x00003322 MifareUltralightAppTask + .text.MifareUltralightAppProcess + 0x00003324 0x2a4 Bin/MifareUltralight.o + 0x00003324 MifareUltralightAppProcess + .text.MifareUltralightGetUid + 0x000035c8 0x26 Bin/MifareUltralight.o + 0x000035c8 MifareUltralightGetUid + .text.MifareUltralightSetUid + 0x000035ee 0x7e Bin/MifareUltralight.o + 0x000035ee MifareUltralightSetUid + .text.MifareClassicAppInit1K + 0x0000366c 0x1e Bin/MifareClassic.o + 0x0000366c MifareClassicAppInit1K + .text.MifarePlus1kAppInit_7B + 0x0000368a 0x2a Bin/MifareClassic.o + 0x0000368a MifarePlus1kAppInit_7B + .text.MifareClassicAppInit4K + 0x000036b4 0x1e Bin/MifareClassic.o + 0x000036b4 MifareClassicAppInit4K + .text.MifareClassicAppReset + 0x000036d2 0x8 Bin/MifareClassic.o + 0x000036d2 MifareClassicAppReset + .text.MifareClassicAppTask + 0x000036da 0x2 Bin/MifareClassic.o + 0x000036da MifareClassicAppTask + .text.MifareClassicAppProcess + 0x000036dc 0xb88 Bin/MifareClassic.o + 0x000036dc MifareClassicAppProcess + .text.MifareClassicGetUid + 0x00004264 0x42 Bin/MifareClassic.o + 0x00004264 MifareClassicGetUid + .text.MifareClassicSetUid + 0x000042a6 0x5e Bin/MifareClassic.o + 0x000042a6 MifareClassicSetUid + .text.ISO14443AAppendCRCA + 0x00004304 0x5e Bin/ISO14443-3A.o + 0x00004304 ISO14443AAppendCRCA + .text.ISO14443ACheckCRCA + 0x00004362 0x7e Bin/ISO14443-3A.o + 0x00004362 ISO14443ACheckCRCA + .text.Crypto1LFSR + 0x000043e0 0x8c Bin/Crypto1.o + .text.Crypto1FilterOutput + 0x0000446c 0x68 Bin/Crypto1.o + 0x0000446c Crypto1FilterOutput + .text.Crypto1Setup + 0x000044d4 0x340 Bin/Crypto1.o + 0x000044d4 Crypto1Setup + .text.Crypto1Auth + 0x00004814 0x52 Bin/Crypto1.o + 0x00004814 Crypto1Auth + .text.Crypto1Byte + 0x00004866 0x82 Bin/Crypto1.o + 0x00004866 Crypto1Byte + .text.Crypto1Nibble + 0x000048e8 0x48 Bin/Crypto1.o + 0x000048e8 Crypto1Nibble + .text.Crypto1PRNG + 0x00004930 0xb6 Bin/Crypto1.o + 0x00004930 Crypto1PRNG + .text.USB_Device_ProcessControlRequest + 0x000049e6 0x296 Bin/DeviceStandardReq.o + 0x000049e6 USB_Device_ProcessControlRequest + .text.USB_Event_Stub + 0x00004c7c 0x2 Bin/Events.o + 0x00004c7c USB_Event_Stub + 0x00004c7c EVENT_USB_Device_Suspend + 0x00004c7c EVENT_USB_Device_StartOfFrame + 0x00004c7c EVENT_USB_Device_Reset + 0x00004c7c EVENT_USB_Device_WakeUp + .text.USB_USBTask + 0x00004c7e 0x2a Bin/USBTask.o + 0x00004c7e USB_USBTask + .text.Endpoint_Write_Stream_LE + 0x00004ca8 0xd8 Bin/EndpointStream_XMEGA.o + 0x00004ca8 Endpoint_Write_Stream_LE + .text.Endpoint_Write_Control_Stream_LE + 0x00004d80 0x142 Bin/EndpointStream_XMEGA.o + 0x00004d80 Endpoint_Write_Control_Stream_LE + .text.Endpoint_Write_Control_PStream_LE + 0x00004ec2 0x13e Bin/EndpointStream_XMEGA.o + 0x00004ec2 Endpoint_Write_Control_PStream_LE + .text.Endpoint_ClearIN + 0x00005000 0x32 Bin/Endpoint_XMEGA.o + 0x00005000 Endpoint_ClearIN + .text.Endpoint_ClearOUT + 0x00005032 0x1e Bin/Endpoint_XMEGA.o + 0x00005032 Endpoint_ClearOUT + .text.Endpoint_Read_8 + 0x00005050 0x1e Bin/Endpoint_XMEGA.o + 0x00005050 Endpoint_Read_8 + .text.Endpoint_Write_8 + 0x0000506e 0x1e Bin/Endpoint_XMEGA.o + 0x0000506e Endpoint_Write_8 + .text.Endpoint_SelectEndpoint + 0x0000508c 0x72 Bin/Endpoint_XMEGA.o + 0x0000508c Endpoint_SelectEndpoint + .text.Endpoint_StallTransaction + 0x000050fe 0x38 Bin/Endpoint_XMEGA.o + 0x000050fe Endpoint_StallTransaction + .text.Endpoint_ClearSETUP + 0x00005136 0x58 Bin/Endpoint_XMEGA.o + 0x00005136 Endpoint_ClearSETUP + .text.Endpoint_IsSETUPReceived + 0x0000518e 0x32 Bin/Endpoint_XMEGA.o + 0x0000518e Endpoint_IsSETUPReceived + .text.Endpoint_IsOUTReceived + 0x000051c0 0x32 Bin/Endpoint_XMEGA.o + 0x000051c0 Endpoint_IsOUTReceived + .text.Endpoint_IsINReady + 0x000051f2 0x18 Bin/Endpoint_XMEGA.o + 0x000051f2 Endpoint_IsINReady + .text.Endpoint_ConfigureEndpoint_PRV + 0x0000520a 0x9a Bin/Endpoint_XMEGA.o + 0x0000520a Endpoint_ConfigureEndpoint_PRV + .text.Endpoint_ConfigureEndpointTable + 0x000052a4 0xec Bin/Endpoint_XMEGA.o + 0x000052a4 Endpoint_ConfigureEndpointTable + .text.Endpoint_ClearEndpoints + 0x00005390 0x70 Bin/Endpoint_XMEGA.o + 0x00005390 Endpoint_ClearEndpoints + .text.Endpoint_ClearStatusStage + 0x00005400 0x2c Bin/Endpoint_XMEGA.o + 0x00005400 Endpoint_ClearStatusStage + .text.Endpoint_WaitUntilReady + 0x0000542c 0xa6 Bin/Endpoint_XMEGA.o + 0x0000542c Endpoint_WaitUntilReady + .text.USB_Disable + 0x000054d2 0x1a Bin/USBController_XMEGA.o + 0x000054d2 USB_Disable + .text.USB_ResetInterface + 0x000054ec 0x5c Bin/USBController_XMEGA.o + 0x000054ec USB_ResetInterface + .text.USB_Init + 0x00005548 0x52 Bin/USBController_XMEGA.o + 0x00005548 USB_Init + .text.USB_INT_DisableAllInterrupts + 0x0000559a 0xe Bin/USBInterrupt_XMEGA.o + 0x0000559a USB_INT_DisableAllInterrupts + .text.USB_INT_ClearAllInterrupts + 0x000055a8 0xc Bin/USBInterrupt_XMEGA.o + 0x000055a8 USB_INT_ClearAllInterrupts + .text.__vector_125 + 0x000055b4 0xda Bin/USBInterrupt_XMEGA.o + 0x000055b4 __vector_125 + .text.CDC_Device_ConfigureEndpoints + 0x0000568e 0x4a Bin/CDCClassDevice.o + 0x0000568e CDC_Device_ConfigureEndpoints + .text.CDC_Device_SendString + 0x000056d8 0x52 Bin/CDCClassDevice.o + 0x000056d8 CDC_Device_SendString + .text.CDC_Device_SendData + 0x0000572a 0x54 Bin/CDCClassDevice.o + 0x0000572a CDC_Device_SendData + .text.CDC_Device_SendByte + 0x0000577e 0x6e Bin/CDCClassDevice.o + 0x0000577e CDC_Device_SendByte + .text.CDC_Device_Flush + 0x000057ec 0x90 Bin/CDCClassDevice.o + 0x000057ec CDC_Device_Flush + .text.CDC_Device_USBTask + 0x0000587c 0x36 Bin/CDCClassDevice.o + 0x0000587c CDC_Device_USBTask + .text.CDC_Device_ReceiveByte + 0x000058b2 0xbe Bin/CDCClassDevice.o + 0x000058b2 CDC_Device_ReceiveByte + .text.CDC_Device_Event_Stub + 0x00005970 0x2 Bin/CDCClassDevice.o + 0x00005970 EVENT_CDC_Device_ControLineStateChanged + 0x00005970 EVENT_CDC_Device_BreakSent + 0x00005970 CDC_Device_Event_Stub + 0x00005970 EVENT_CDC_Device_LineEncodingChanged + .text.CDC_Device_ProcessControlRequest + 0x00005972 0x13a Bin/CDCClassDevice.o + 0x00005972 CDC_Device_ProcessControlRequest + .text.libgcc.mul + 0x00005aac 0xc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + 0x00005aac __mulshisi3 + 0x00005ab0 __mulohisi3 + .text.libgcc.mul + 0x00005ab8 0x14 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + 0x00005ab8 __muluhisi3 + .text.libgcc.mul + 0x00005acc 0x18 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + 0x00005acc __umulhisi3 + .text.avr-libc + 0x00005ae4 0xb4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + 0x00005b7a rand_r + 0x00005b7c rand + 0x00005b82 srand + .text.avr-libc + 0x00005b98 0x12 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + 0x00005b98 memcpy_P + .text.avr-libc + 0x00005baa 0x12 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + 0x00005baa strcmp_P + .text.avr-libc + 0x00005bbc 0x20 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + 0x00005bbc strncat_P + .text.avr-libc + 0x00005bdc 0x1e c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + 0x00005bdc strncpy_P + .text.avr-libc + 0x00005bfa 0x12 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + 0x00005bfa memcpy + .text.avr-libc + 0x00005c0c 0x5a c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + 0x00005c0c snprintf_P + .text.avr-libc + 0x00005c66 0x39a c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + 0x00005c66 vfprintf + .text.avr-libc + 0x00006000 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + 0x00006000 __eerd_block_x32a4u + .text.avr-libc + 0x00006016 0x12 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + 0x00006016 __eewr_block_x32a4u + .text.avr-libc + 0x00006028 0x46 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + 0x00006028 __eewr_byte_x32a4u + 0x0000602a __eewr_r18_x32a4u + .text.avr-libc + 0x0000606e 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + 0x0000606e strnlen_P + .text.avr-libc + 0x00006084 0x16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + 0x00006084 strnlen + .text.avr-libc + 0x0000609a 0x58 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + 0x0000609a fputc + .text.avr-libc + 0x000060f2 0xbc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + 0x000060f2 __ultoa_invert + .text.libgcc.div + 0x000061ae 0x36 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + 0x000061ae __divmodsi4 + .text.libgcc.prologue + 0x000061e4 0x32 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + 0x000061e4 __prologue_saves__ + .text.libgcc.prologue + 0x00006216 0x30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + 0x00006216 __epilogue_restores__ + .text.libgcc.div + 0x00006246 0x44 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + 0x00006246 __udivmodsi4 + 0x0000628a . = ALIGN (0x2) + *(.fini9) + .fini9 0x0000628a 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + 0x0000628a _exit + 0x0000628a exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x0000628a 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + *(.fini0) + 0x0000628e _etext = . + +.data 0x00802000 0x92 load address 0x0000628e + 0x00802000 PROVIDE (__data_start, .) + *(.data) + .data 0x00802000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + .data 0x00802000 0x0 Bin/Chameleon-Mini.o + .data 0x00802000 0x0 Bin/LUFADescriptors.o + .data 0x00802000 0x0 Bin/System.o + .data 0x00802000 0x0 Bin/Configuration.o + .data 0x00802000 0x0 Bin/Random.o + .data 0x00802000 0x0 Bin/Common.o + .data 0x00802000 0x0 Bin/Memory.o + .data 0x00802000 0x0 Bin/Button.o + .data 0x00802000 0x0 Bin/Log.o + .data 0x00802000 0x0 Bin/Settings.o + .data 0x00802000 0x0 Bin/LED.o + .data 0x00802000 0x1c Bin/Terminal.o + 0x00802000 TerminalHandle + .data 0x0080201c 0x0 Bin/Commands.o + .data 0x0080201c 0x0 Bin/XModem.o + .data 0x0080201c 0x0 Bin/CommandLine.o + .data 0x0080201c 0x0 Bin/Codec.o + .data 0x0080201c 0x0 Bin/ISO14443-2A.o + .data 0x0080201c 0x0 Bin/MifareUltralight.o + .data 0x0080201c 0x0 Bin/MifareClassic.o + .data 0x0080201c 0x0 Bin/ISO14443-3A.o + .data 0x0080201c 0x0 Bin/Crypto1.o + .data 0x0080201c 0x0 Bin/HIDParser.o + .data 0x0080201c 0x0 Bin/ConfigDescriptors.o + .data 0x0080201c 0x0 Bin/DeviceStandardReq.o + .data 0x0080201c 0x0 Bin/Events.o + .data 0x0080201c 0x0 Bin/HostStandardReq.o + .data 0x0080201c 0x0 Bin/USBTask.o + .data 0x0080201c 0x0 Bin/Device_XMEGA.o + .data 0x0080201c 0x0 Bin/EndpointStream_XMEGA.o + .data 0x0080201c 0x0 Bin/Endpoint_XMEGA.o + .data 0x0080201c 0x0 Bin/Host_XMEGA.o + .data 0x0080201c 0x0 Bin/PipeStream_XMEGA.o + .data 0x0080201c 0x0 Bin/Pipe_XMEGA.o + .data 0x0080201c 0x0 Bin/USBController_XMEGA.o + .data 0x0080201c 0x0 Bin/USBInterrupt_XMEGA.o + .data 0x0080201c 0x0 Bin/AudioClassDevice.o + .data 0x0080201c 0x0 Bin/CDCClassDevice.o + .data 0x0080201c 0x0 Bin/HIDClassDevice.o + .data 0x0080201c 0x0 Bin/MassStorageClassDevice.o + .data 0x0080201c 0x0 Bin/MIDIClassDevice.o + .data 0x0080201c 0x0 Bin/PrinterClassDevice.o + .data 0x0080201c 0x0 Bin/RNDISClassDevice.o + .data 0x0080201c 0x0 Bin/AndroidAccessoryClassHost.o + .data 0x0080201c 0x0 Bin/AudioClassHost.o + .data 0x0080201c 0x0 Bin/CDCClassHost.o + .data 0x0080201c 0x0 Bin/HIDClassHost.o + .data 0x0080201c 0x0 Bin/MassStorageClassHost.o + .data 0x0080201c 0x0 Bin/MIDIClassHost.o + .data 0x0080201c 0x0 Bin/PrinterClassHost.o + .data 0x0080201c 0x0 Bin/RNDISClassHost.o + .data 0x0080201c 0x0 Bin/StillImageClassHost.o + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + .data 0x0080201c 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + .data 0x0080201c 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + .data 0x00802020 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + *(.data*) + *(.rodata) + .rodata 0x00802020 0x70 Bin/Crypto1.o + *(.rodata*) + .rodata.str1.1 + 0x00802090 0x1 Bin/Commands.o + *(.gnu.linkonce.d*) + 0x00802092 . = ALIGN (0x2) + *fill* 0x00802091 0x1 + 0x00802092 _edata = . + 0x00802092 PROVIDE (__data_end, .) + +.bss 0x00802092 0xe37 + 0x00802092 PROVIDE (__bss_start, .) + *(.bss) + .bss 0x00802092 0x400 Bin/Memory.o + .bss 0x00802492 0x1 Bin/Button.o + .bss 0x00802493 0x404 Bin/Log.o + .bss 0x00802897 0x3 Bin/LED.o + 0x00802897 LEDRedAction + 0x00802898 LEDGreenAction + .bss 0x0080289a 0x1 Bin/Terminal.o + 0x0080289a TerminalState + .bss 0x0080289b 0xf Bin/XModem.o + .bss 0x008028aa 0x2 Bin/CommandLine.o + .bss 0x008028ac 0x10 Bin/ISO14443-2A.o + .bss 0x008028bc 0x2 Bin/MifareUltralight.o + .bss 0x008028be 0x1e Bin/MifareClassic.o + .bss 0x008028dc 0x6 Bin/Crypto1.o + *(.bss*) + *(COMMON) + COMMON 0x008028e2 0x25 Bin/Configuration.o + 0x008028e2 ActiveConfiguration + COMMON 0x00802907 0x2 Bin/Log.o + 0x00802907 LogFunc + COMMON 0x00802909 0x33 Bin/Settings.o + 0x00802909 GlobalSettings + COMMON 0x0080293c 0x100 Bin/Terminal.o + 0x0080293c TerminalBuffer + COMMON 0x00802a3c 0x100 Bin/Codec.o + 0x00802a3c CodecBuffer + COMMON 0x00802b3c 0x3 Bin/DeviceStandardReq.o + 0x00802b3c USB_Device_ConfigurationNumber + 0x00802b3d USB_Device_CurrentlySelfPowered + 0x00802b3e USB_Device_RemoteWakeupEnabled + COMMON 0x00802b3f 0xa Bin/USBTask.o + 0x00802b3f USB_IsInitialized + 0x00802b40 USB_DeviceState + 0x00802b41 USB_ControlRequest + COMMON 0x00802b49 0x31d Bin/Endpoint_XMEGA.o + 0x00802b49 USB_Endpoint_SelectedFIFO + 0x00802b4b USB_Endpoint_SelectedHandle + 0x00802b4d USB_Endpoint_SelectedEndpoint + 0x00802b4e USB_Endpoint_FIFOs + COMMON 0x00802e66 0x63 Bin/USBController_XMEGA.o + 0x00802e66 USB_EndpointTable + 0x00802ec9 PROVIDE (__bss_end, .) + 0x0000628e __data_load_start = LOADADDR (.data) + 0x00006320 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x00802ec9 0x0 + 0x00802ec9 PROVIDE (__noinit_start, .) + *(.noinit*) + 0x00802ec9 PROVIDE (__noinit_end, .) + 0x00802ec9 _end = . + 0x00802ec9 PROVIDE (__heap_start, .) + +.eeprom 0x00810000 0x33 + *(.eeprom*) + .eeprom 0x00810000 0x33 Bin/Settings.o + 0x00810000 StoredSettings + 0x00810033 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab 0x00000000 0x15a8 + *(.stab) + .stab 0x00000000 0x6cc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + .stab 0x000006cc 0x84 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + 0x90 (size before relaxing) + .stab 0x00000750 0x84 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + 0x90 (size before relaxing) + .stab 0x000007d4 0xd8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + 0xe4 (size before relaxing) + .stab 0x000008ac 0xcc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + 0xd8 (size before relaxing) + .stab 0x00000978 0xb4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + 0xc0 (size before relaxing) + .stab 0x00000a2c 0x84 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + 0x90 (size before relaxing) + .stab 0x00000ab0 0x6c c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + 0x78 (size before relaxing) + .stab 0x00000b1c 0xb4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + 0xc0 (size before relaxing) + .stab 0x00000bd0 0xfc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + 0x108 (size before relaxing) + .stab 0x00000ccc 0xa8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + 0xb4 (size before relaxing) + .stab 0x00000d74 0x9c c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + 0xa8 (size before relaxing) + .stab 0x00000e10 0x1e0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + 0x1ec (size before relaxing) + .stab 0x00000ff0 0x9c c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + 0xa8 (size before relaxing) + .stab 0x0000108c 0x9c c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + 0xa8 (size before relaxing) + .stab 0x00001128 0x480 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + 0x48c (size before relaxing) + +.stabstr 0x00000000 0x788 + *(.stabstr) + .stabstr 0x00000000 0x788 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x00000000 0x2f + *(.comment) + .comment 0x00000000 0x2f Bin/Chameleon-Mini.o + 0x30 (size before relaxing) + .comment 0x00000000 0x30 Bin/LUFADescriptors.o + .comment 0x00000000 0x30 Bin/System.o + .comment 0x00000000 0x30 Bin/Configuration.o + .comment 0x00000000 0x30 Bin/Random.o + .comment 0x00000000 0x30 Bin/Common.o + .comment 0x00000000 0x30 Bin/Memory.o + .comment 0x00000000 0x30 Bin/Button.o + .comment 0x00000000 0x30 Bin/Log.o + .comment 0x00000000 0x30 Bin/Settings.o + .comment 0x00000000 0x30 Bin/LED.o + .comment 0x00000000 0x30 Bin/Terminal.o + .comment 0x00000000 0x30 Bin/Commands.o + .comment 0x00000000 0x30 Bin/XModem.o + .comment 0x00000000 0x30 Bin/CommandLine.o + .comment 0x00000000 0x30 Bin/Codec.o + .comment 0x00000000 0x30 Bin/ISO14443-2A.o + .comment 0x00000000 0x30 Bin/MifareUltralight.o + .comment 0x00000000 0x30 Bin/MifareClassic.o + .comment 0x00000000 0x30 Bin/ISO14443-3A.o + .comment 0x00000000 0x30 Bin/Crypto1.o + .comment 0x00000000 0x30 Bin/HIDParser.o + .comment 0x00000000 0x30 Bin/ConfigDescriptors.o + .comment 0x00000000 0x30 Bin/DeviceStandardReq.o + .comment 0x00000000 0x30 Bin/Events.o + .comment 0x00000000 0x30 Bin/HostStandardReq.o + .comment 0x00000000 0x30 Bin/USBTask.o + .comment 0x00000000 0x30 Bin/Device_XMEGA.o + .comment 0x00000000 0x30 Bin/EndpointStream_XMEGA.o + .comment 0x00000000 0x30 Bin/Endpoint_XMEGA.o + .comment 0x00000000 0x30 Bin/Host_XMEGA.o + .comment 0x00000000 0x30 Bin/PipeStream_XMEGA.o + .comment 0x00000000 0x30 Bin/Pipe_XMEGA.o + .comment 0x00000000 0x30 Bin/USBController_XMEGA.o + .comment 0x00000000 0x30 Bin/USBInterrupt_XMEGA.o + .comment 0x00000000 0x30 Bin/AudioClassDevice.o + .comment 0x00000000 0x30 Bin/CDCClassDevice.o + .comment 0x00000000 0x30 Bin/HIDClassDevice.o + .comment 0x00000000 0x30 Bin/MassStorageClassDevice.o + .comment 0x00000000 0x30 Bin/MIDIClassDevice.o + .comment 0x00000000 0x30 Bin/PrinterClassDevice.o + .comment 0x00000000 0x30 Bin/RNDISClassDevice.o + .comment 0x00000000 0x30 Bin/AndroidAccessoryClassHost.o + .comment 0x00000000 0x30 Bin/AudioClassHost.o + .comment 0x00000000 0x30 Bin/CDCClassHost.o + .comment 0x00000000 0x30 Bin/HIDClassHost.o + .comment 0x00000000 0x30 Bin/MassStorageClassHost.o + .comment 0x00000000 0x30 Bin/MIDIClassHost.o + .comment 0x00000000 0x30 Bin/PrinterClassHost.o + .comment 0x00000000 0x30 Bin/RNDISClassHost.o + .comment 0x00000000 0x30 Bin/StillImageClassHost.o + .comment 0x00000000 0x30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .comment 0x00000000 0x30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .comment 0x00000000 0x30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .comment 0x00000000 0x30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x00000000 0xd80 + *(.debug_aranges) + .debug_aranges + 0x00000000 0x20 Bin/Chameleon-Mini.o + .debug_aranges + 0x00000020 0x20 Bin/LUFADescriptors.o + .debug_aranges + 0x00000040 0x58 Bin/System.o + .debug_aranges + 0x00000098 0x78 Bin/Configuration.o + .debug_aranges + 0x00000110 0x38 Bin/Random.o + .debug_aranges + 0x00000148 0x28 Bin/Common.o + .debug_aranges + 0x00000170 0x58 Bin/Memory.o + .debug_aranges + 0x000001c8 0x50 Bin/Button.o + .debug_aranges + 0x00000218 0x80 Bin/Log.o + .debug_aranges + 0x00000298 0x50 Bin/Settings.o + .debug_aranges + 0x000002e8 0x50 Bin/LED.o + .debug_aranges + 0x00000338 0x68 Bin/Terminal.o + .debug_aranges + 0x000003a0 0x140 Bin/Commands.o + .debug_aranges + 0x000004e0 0x40 Bin/XModem.o + .debug_aranges + 0x00000520 0x30 Bin/CommandLine.o + .debug_aranges + 0x00000550 0x18 Bin/Codec.o + .debug_aranges + 0x00000568 0x48 Bin/ISO14443-2A.o + .debug_aranges + 0x000005b0 0x48 Bin/MifareUltralight.o + .debug_aranges + 0x000005f8 0x58 Bin/MifareClassic.o + .debug_aranges + 0x00000650 0x28 Bin/ISO14443-3A.o + .debug_aranges + 0x00000678 0x50 Bin/Crypto1.o + .debug_aranges + 0x000006c8 0x38 Bin/HIDParser.o + .debug_aranges + 0x00000700 0x38 Bin/ConfigDescriptors.o + .debug_aranges + 0x00000738 0x20 Bin/DeviceStandardReq.o + .debug_aranges + 0x00000758 0x20 Bin/Events.o + .debug_aranges + 0x00000778 0x18 Bin/HostStandardReq.o + .debug_aranges + 0x00000790 0x20 Bin/USBTask.o + .debug_aranges + 0x000007b0 0x20 Bin/Device_XMEGA.o + .debug_aranges + 0x000007d0 0xc8 Bin/EndpointStream_XMEGA.o + .debug_aranges + 0x00000898 0x90 Bin/Endpoint_XMEGA.o + .debug_aranges + 0x00000928 0x18 Bin/Host_XMEGA.o + .debug_aranges + 0x00000940 0x18 Bin/PipeStream_XMEGA.o + .debug_aranges + 0x00000958 0x18 Bin/Pipe_XMEGA.o + .debug_aranges + 0x00000970 0x30 Bin/USBController_XMEGA.o + .debug_aranges + 0x000009a0 0x30 Bin/USBInterrupt_XMEGA.o + .debug_aranges + 0x000009d0 0x30 Bin/AudioClassDevice.o + .debug_aranges + 0x00000a00 0x98 Bin/CDCClassDevice.o + .debug_aranges + 0x00000a98 0x30 Bin/HIDClassDevice.o + .debug_aranges + 0x00000ac8 0x30 Bin/MassStorageClassDevice.o + .debug_aranges + 0x00000af8 0x40 Bin/MIDIClassDevice.o + .debug_aranges + 0x00000b38 0x90 Bin/PrinterClassDevice.o + .debug_aranges + 0x00000bc8 0x48 Bin/RNDISClassDevice.o + .debug_aranges + 0x00000c10 0x18 Bin/AndroidAccessoryClassHost.o + .debug_aranges + 0x00000c28 0x18 Bin/AudioClassHost.o + .debug_aranges + 0x00000c40 0x18 Bin/CDCClassHost.o + .debug_aranges + 0x00000c58 0x18 Bin/HIDClassHost.o + .debug_aranges + 0x00000c70 0x18 Bin/MassStorageClassHost.o + .debug_aranges + 0x00000c88 0x18 Bin/MIDIClassHost.o + .debug_aranges + 0x00000ca0 0x18 Bin/PrinterClassHost.o + .debug_aranges + 0x00000cb8 0x18 Bin/RNDISClassHost.o + .debug_aranges + 0x00000cd0 0x18 Bin/StillImageClassHost.o + .debug_aranges + 0x00000ce8 0x38 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_aranges + 0x00000d20 0x20 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_aranges + 0x00000d40 0x20 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_aranges + 0x00000d60 0x20 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x00000000 0x1c598 + *(.debug_info) + .debug_info 0x00000000 0xe9a Bin/Chameleon-Mini.o + .debug_info 0x00000e9a 0x962 Bin/LUFADescriptors.o + .debug_info 0x000017fc 0xf3a Bin/System.o + .debug_info 0x00002736 0x78d Bin/Configuration.o + .debug_info 0x00002ec3 0x161 Bin/Random.o + .debug_info 0x00003024 0x1b3 Bin/Common.o + .debug_info 0x000031d7 0x144f Bin/Memory.o + .debug_info 0x00004626 0xc37 Bin/Button.o + .debug_info 0x0000525d 0xdd0 Bin/Log.o + .debug_info 0x0000602d 0x70e Bin/Settings.o + .debug_info 0x0000673b 0xa62 Bin/LED.o + .debug_info 0x0000719d 0xbc1 Bin/Terminal.o + .debug_info 0x00007d5e 0x1e54 Bin/Commands.o + .debug_info 0x00009bb2 0x99e Bin/XModem.o + .debug_info 0x0000a550 0x9bc Bin/CommandLine.o + .debug_info 0x0000af0c 0x203 Bin/Codec.o + .debug_info 0x0000b10f 0x1b56 Bin/ISO14443-2A.o + .debug_info 0x0000cc65 0x9dc Bin/MifareUltralight.o + .debug_info 0x0000d641 0x1423 Bin/MifareClassic.o + .debug_info 0x0000ea64 0x179 Bin/ISO14443-3A.o + .debug_info 0x0000ebdd 0x530 Bin/Crypto1.o + .debug_info 0x0000f10d 0x72e Bin/HIDParser.o + .debug_info 0x0000f83b 0x5ed Bin/ConfigDescriptors.o + .debug_info 0x0000fe28 0x11d6 Bin/DeviceStandardReq.o + .debug_info 0x00010ffe 0x7f Bin/Events.o + .debug_info 0x0001107d 0x5d Bin/HostStandardReq.o + .debug_info 0x000110da 0x435 Bin/USBTask.o + .debug_info 0x0001150f 0x670 Bin/Device_XMEGA.o + .debug_info 0x00011b7f 0x19be Bin/EndpointStream_XMEGA.o + .debug_info 0x0001353d 0xcff Bin/Endpoint_XMEGA.o + .debug_info 0x0001423c 0x5d Bin/Host_XMEGA.o + .debug_info 0x00014299 0x5d Bin/PipeStream_XMEGA.o + .debug_info 0x000142f6 0x5d Bin/Pipe_XMEGA.o + .debug_info 0x00014353 0xd40 Bin/USBController_XMEGA.o + .debug_info 0x00015093 0xa7b Bin/USBInterrupt_XMEGA.o + .debug_info 0x00015b0e 0xa9d Bin/AudioClassDevice.o + .debug_info 0x000165ab 0xf93 Bin/CDCClassDevice.o + .debug_info 0x0001753e 0xf91 Bin/HIDClassDevice.o + .debug_info 0x000184cf 0xaa0 Bin/MassStorageClassDevice.o + .debug_info 0x00018f6f 0x7c6 Bin/MIDIClassDevice.o + .debug_info 0x00019735 0xddd Bin/PrinterClassDevice.o + .debug_info 0x0001a512 0x1311 Bin/RNDISClassDevice.o + .debug_info 0x0001b823 0x5d Bin/AndroidAccessoryClassHost.o + .debug_info 0x0001b880 0x5d Bin/AudioClassHost.o + .debug_info 0x0001b8dd 0x5d Bin/CDCClassHost.o + .debug_info 0x0001b93a 0x5d Bin/HIDClassHost.o + .debug_info 0x0001b997 0x5d Bin/MassStorageClassHost.o + .debug_info 0x0001b9f4 0x5d Bin/MIDIClassHost.o + .debug_info 0x0001ba51 0x5d Bin/PrinterClassHost.o + .debug_info 0x0001baae 0x5d Bin/RNDISClassHost.o + .debug_info 0x0001bb0b 0x5d Bin/StillImageClassHost.o + .debug_info 0x0001bb68 0x157 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_info 0x0001bcbf 0x21c c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_info 0x0001bedb 0x549 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_info 0x0001c424 0x174 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + *(.gnu.linkonce.wi.*) + +.debug_abbrev 0x00000000 0x6309 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x1d9 Bin/Chameleon-Mini.o + .debug_abbrev 0x000001d9 0x1bb Bin/LUFADescriptors.o + .debug_abbrev 0x00000394 0x16b Bin/System.o + .debug_abbrev 0x000004ff 0x26e Bin/Configuration.o + .debug_abbrev 0x0000076d 0xfb Bin/Random.o + .debug_abbrev 0x00000868 0xb2 Bin/Common.o + .debug_abbrev 0x0000091a 0x348 Bin/Memory.o + .debug_abbrev 0x00000c62 0x2f9 Bin/Button.o + .debug_abbrev 0x00000f5b 0x373 Bin/Log.o + .debug_abbrev 0x000012ce 0x21b Bin/Settings.o + .debug_abbrev 0x000014e9 0x2c1 Bin/LED.o + .debug_abbrev 0x000017aa 0x322 Bin/Terminal.o + .debug_abbrev 0x00001acc 0x38e Bin/Commands.o + .debug_abbrev 0x00001e5a 0x2bd Bin/XModem.o + .debug_abbrev 0x00002117 0x2ce Bin/CommandLine.o + .debug_abbrev 0x000023e5 0xc4 Bin/Codec.o + .debug_abbrev 0x000024a9 0x328 Bin/ISO14443-2A.o + .debug_abbrev 0x000027d1 0x260 Bin/MifareUltralight.o + .debug_abbrev 0x00002a31 0x2f5 Bin/MifareClassic.o + .debug_abbrev 0x00002d26 0xa6 Bin/ISO14443-3A.o + .debug_abbrev 0x00002dcc 0x1bd Bin/Crypto1.o + .debug_abbrev 0x00002f89 0x20a Bin/HIDParser.o + .debug_abbrev 0x00003193 0x248 Bin/ConfigDescriptors.o + .debug_abbrev 0x000033db 0x37e Bin/DeviceStandardReq.o + .debug_abbrev 0x00003759 0x44 Bin/Events.o + .debug_abbrev 0x0000379d 0x26 Bin/HostStandardReq.o + .debug_abbrev 0x000037c3 0x21d Bin/USBTask.o + .debug_abbrev 0x000039e0 0x11e Bin/Device_XMEGA.o + .debug_abbrev 0x00003afe 0x252 Bin/EndpointStream_XMEGA.o + .debug_abbrev 0x00003d50 0x300 Bin/Endpoint_XMEGA.o + .debug_abbrev 0x00004050 0x26 Bin/Host_XMEGA.o + .debug_abbrev 0x00004076 0x26 Bin/PipeStream_XMEGA.o + .debug_abbrev 0x0000409c 0x26 Bin/Pipe_XMEGA.o + .debug_abbrev 0x000040c2 0x306 Bin/USBController_XMEGA.o + .debug_abbrev 0x000043c8 0x266 Bin/USBInterrupt_XMEGA.o + .debug_abbrev 0x0000462e 0x28b Bin/AudioClassDevice.o + .debug_abbrev 0x000048b9 0x439 Bin/CDCClassDevice.o + .debug_abbrev 0x00004cf2 0x2de Bin/HIDClassDevice.o + .debug_abbrev 0x00004fd0 0x338 Bin/MassStorageClassDevice.o + .debug_abbrev 0x00005308 0x287 Bin/MIDIClassDevice.o + .debug_abbrev 0x0000558f 0x3e1 Bin/PrinterClassDevice.o + .debug_abbrev 0x00005970 0x36d Bin/RNDISClassDevice.o + .debug_abbrev 0x00005cdd 0x26 Bin/AndroidAccessoryClassHost.o + .debug_abbrev 0x00005d03 0x26 Bin/AudioClassHost.o + .debug_abbrev 0x00005d29 0x26 Bin/CDCClassHost.o + .debug_abbrev 0x00005d4f 0x26 Bin/HIDClassHost.o + .debug_abbrev 0x00005d75 0x26 Bin/MassStorageClassHost.o + .debug_abbrev 0x00005d9b 0x26 Bin/MIDIClassHost.o + .debug_abbrev 0x00005dc1 0x26 Bin/PrinterClassHost.o + .debug_abbrev 0x00005de7 0x26 Bin/RNDISClassHost.o + .debug_abbrev 0x00005e0d 0x26 Bin/StillImageClassHost.o + .debug_abbrev 0x00005e33 0xd6 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_abbrev 0x00005f09 0x139 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_abbrev 0x00006042 0x1d6 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_abbrev 0x00006218 0xf1 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug_line 0x00000000 0xd67b + *(.debug_line) + .debug_line 0x00000000 0x41a Bin/Chameleon-Mini.o + .debug_line 0x0000041a 0x39a Bin/LUFADescriptors.o + .debug_line 0x000007b4 0x2ee Bin/System.o + .debug_line 0x00000aa2 0x448 Bin/Configuration.o + .debug_line 0x00000eea 0x144 Bin/Random.o + .debug_line 0x0000102e 0x246 Bin/Common.o + .debug_line 0x00001274 0xaa3 Bin/Memory.o + .debug_line 0x00001d17 0x535 Bin/Button.o + .debug_line 0x0000224c 0x5a5 Bin/Log.o + .debug_line 0x000027f1 0x3a7 Bin/Settings.o + .debug_line 0x00002b98 0x4e9 Bin/LED.o + .debug_line 0x00003081 0x498 Bin/Terminal.o + .debug_line 0x00003519 0xab5 Bin/Commands.o + .debug_line 0x00003fce 0x588 Bin/XModem.o + .debug_line 0x00004556 0x42e Bin/CommandLine.o + .debug_line 0x00004984 0xdf Bin/Codec.o + .debug_line 0x00004a63 0x70e Bin/ISO14443-2A.o + .debug_line 0x00005171 0x3fa Bin/MifareUltralight.o + .debug_line 0x0000556b 0x98b Bin/MifareClassic.o + .debug_line 0x00005ef6 0x1d7 Bin/ISO14443-3A.o + .debug_line 0x000060cd 0x75c Bin/Crypto1.o + .debug_line 0x00006829 0x668 Bin/HIDParser.o + .debug_line 0x00006e91 0x325 Bin/ConfigDescriptors.o + .debug_line 0x000071b6 0x532 Bin/DeviceStandardReq.o + .debug_line 0x000076e8 0x4f Bin/Events.o + .debug_line 0x00007737 0x1a Bin/HostStandardReq.o + .debug_line 0x00007751 0x269 Bin/USBTask.o + .debug_line 0x000079ba 0x1e5 Bin/Device_XMEGA.o + .debug_line 0x00007b9f 0x16b5 Bin/EndpointStream_XMEGA.o + .debug_line 0x00009254 0x75d Bin/Endpoint_XMEGA.o + .debug_line 0x000099b1 0x1a Bin/Host_XMEGA.o + .debug_line 0x000099cb 0x1a Bin/PipeStream_XMEGA.o + .debug_line 0x000099e5 0x1a Bin/Pipe_XMEGA.o + .debug_line 0x000099ff 0x411 Bin/USBController_XMEGA.o + .debug_line 0x00009e10 0x410 Bin/USBInterrupt_XMEGA.o + .debug_line 0x0000a220 0x4b3 Bin/AudioClassDevice.o + .debug_line 0x0000a6d3 0x892 Bin/CDCClassDevice.o + .debug_line 0x0000af65 0x628 Bin/HIDClassDevice.o + .debug_line 0x0000b58d 0x56f Bin/MassStorageClassDevice.o + .debug_line 0x0000bafc 0x462 Bin/MIDIClassDevice.o + .debug_line 0x0000bf5e 0x7d5 Bin/PrinterClassDevice.o + .debug_line 0x0000c733 0x7ba Bin/RNDISClassDevice.o + .debug_line 0x0000ceed 0x1a Bin/AndroidAccessoryClassHost.o + .debug_line 0x0000cf07 0x1a Bin/AudioClassHost.o + .debug_line 0x0000cf21 0x1a Bin/CDCClassHost.o + .debug_line 0x0000cf3b 0x1a Bin/HIDClassHost.o + .debug_line 0x0000cf55 0x1a Bin/MassStorageClassHost.o + .debug_line 0x0000cf6f 0x1a Bin/MIDIClassHost.o + .debug_line 0x0000cf89 0x1a Bin/PrinterClassHost.o + .debug_line 0x0000cfa3 0x1a Bin/RNDISClassHost.o + .debug_line 0x0000cfbd 0x1a Bin/StillImageClassHost.o + .debug_line 0x0000cfd7 0xa1 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_line 0x0000d078 0x1a6 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_line 0x0000d21e 0x359 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_line 0x0000d577 0x104 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug_frame 0x00000000 0x2304 + *(.debug_frame) + .debug_frame 0x00000000 0x24 Bin/Chameleon-Mini.o + .debug_frame 0x00000024 0x24 Bin/LUFADescriptors.o + .debug_frame 0x00000048 0xa0 Bin/System.o + .debug_frame 0x000000e8 0xf4 Bin/Configuration.o + .debug_frame 0x000001dc 0x64 Bin/Random.o + .debug_frame 0x00000240 0x40 Bin/Common.o + .debug_frame 0x00000280 0x174 Bin/Memory.o + .debug_frame 0x000003f4 0xc0 Bin/Button.o + .debug_frame 0x000004b4 0x114 Bin/Log.o + .debug_frame 0x000005c8 0xa8 Bin/Settings.o + .debug_frame 0x00000670 0xa0 Bin/LED.o + .debug_frame 0x00000710 0xcc Bin/Terminal.o + .debug_frame 0x000007dc 0x3d4 Bin/Commands.o + .debug_frame 0x00000bb0 0x6c Bin/XModem.o + .debug_frame 0x00000c1c 0x78 Bin/CommandLine.o + .debug_frame 0x00000c94 0x100 Bin/ISO14443-2A.o + .debug_frame 0x00000d94 0xbc Bin/MifareUltralight.o + .debug_frame 0x00000e50 0xfc Bin/MifareClassic.o + .debug_frame 0x00000f4c 0x34 Bin/ISO14443-3A.o + .debug_frame 0x00000f80 0x13c Bin/Crypto1.o + .debug_frame 0x000010bc 0x11c Bin/HIDParser.o + .debug_frame 0x000011d8 0xd0 Bin/ConfigDescriptors.o + .debug_frame 0x000012a8 0x40 Bin/DeviceStandardReq.o + .debug_frame 0x000012e8 0x24 Bin/Events.o + .debug_frame 0x0000130c 0x2c Bin/USBTask.o + .debug_frame 0x00001338 0x24 Bin/Device_XMEGA.o + .debug_frame 0x0000135c 0x4f8 Bin/EndpointStream_XMEGA.o + .debug_frame 0x00001854 0x160 Bin/Endpoint_XMEGA.o + .debug_frame 0x000019b4 0x5c Bin/USBController_XMEGA.o + .debug_frame 0x00001a10 0x8c Bin/USBInterrupt_XMEGA.o + .debug_frame 0x00001a9c 0xa4 Bin/AudioClassDevice.o + .debug_frame 0x00001b40 0x1e0 Bin/CDCClassDevice.o + .debug_frame 0x00001d20 0xf0 Bin/HIDClassDevice.o + .debug_frame 0x00001e10 0x80 Bin/MassStorageClassDevice.o + .debug_frame 0x00001e90 0xa4 Bin/MIDIClassDevice.o + .debug_frame 0x00001f34 0x194 Bin/PrinterClassDevice.o + .debug_frame 0x000020c8 0x100 Bin/RNDISClassDevice.o + .debug_frame 0x000021c8 0x88 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_frame 0x00002250 0x30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_frame 0x00002280 0x4c c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_frame 0x000022cc 0x38 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug_str 0x00000000 0x7fb5 + *(.debug_str) + .debug_str 0x00000000 0xb76 Bin/Chameleon-Mini.o + 0xc3b (size before relaxing) + .debug_str 0x00000b76 0x8cc Bin/LUFADescriptors.o + 0xb22 (size before relaxing) + .debug_str 0x00001442 0x9d2 Bin/System.o + 0xc3b (size before relaxing) + .debug_str 0x00001e14 0x402 Bin/Configuration.o + 0x783 (size before relaxing) + .debug_str 0x00002216 0x27 Bin/Random.o + 0x11c (size before relaxing) + .debug_str 0x0000223d 0x56 Bin/Common.o + 0x13f (size before relaxing) + .debug_str 0x00002293 0x37b Bin/Memory.o + 0x9f5 (size before relaxing) + .debug_str 0x0000260e 0x1fa Bin/Button.o + 0x90f (size before relaxing) + .debug_str 0x00002808 0x101 Bin/Log.o + 0x9a7 (size before relaxing) + .debug_str 0x00002909 0xc0 Bin/Settings.o + 0x7ba (size before relaxing) + .debug_str 0x000029c9 0x8f Bin/LED.o + 0x851 (size before relaxing) + .debug_str 0x00002a58 0x253 Bin/Terminal.o + 0x861 (size before relaxing) + .debug_str 0x00002cab 0x509 Bin/Commands.o + 0xf89 (size before relaxing) + .debug_str 0x000031b4 0x130 Bin/XModem.o + 0x538 (size before relaxing) + .debug_str 0x000032e4 0xc1 Bin/CommandLine.o + 0x515 (size before relaxing) + .debug_str 0x000033a5 0x1a Bin/Codec.o + 0x27d (size before relaxing) + .debug_str 0x000033bf 0x12f9 Bin/ISO14443-2A.o + 0x1d48 (size before relaxing) + .debug_str 0x000046b8 0x17d Bin/MifareUltralight.o + 0x4f7 (size before relaxing) + .debug_str 0x00004835 0x272 Bin/MifareClassic.o + 0x69d (size before relaxing) + .debug_str 0x00004aa7 0x1a Bin/ISO14443-3A.o + 0x136 (size before relaxing) + .debug_str 0x00004ac1 0x95 Bin/Crypto1.o + 0x1c4 (size before relaxing) + .debug_str 0x00004b56 0x492 Bin/HIDParser.o + 0x5f8 (size before relaxing) + .debug_str 0x00004fe8 0x22e Bin/ConfigDescriptors.o + 0x436 (size before relaxing) + .debug_str 0x00005216 0xa04 Bin/DeviceStandardReq.o + 0x1134 (size before relaxing) + .debug_str 0x00005c1a 0x31 Bin/Events.o + 0xe3 (size before relaxing) + .debug_str 0x00005c4b 0x2b Bin/HostStandardReq.o + 0xdd (size before relaxing) + .debug_str 0x00005c76 0x6d Bin/USBTask.o + 0x3af (size before relaxing) + .debug_str 0x00005ce3 0x4a Bin/Device_XMEGA.o + 0x523 (size before relaxing) + .debug_str 0x00005d2d 0x4d9 Bin/EndpointStream_XMEGA.o + 0x8c7 (size before relaxing) + .debug_str 0x00006206 0x2aa Bin/Endpoint_XMEGA.o + 0xa35 (size before relaxing) + .debug_str 0x000064b0 0x2c Bin/Host_XMEGA.o + 0xde (size before relaxing) + .debug_str 0x000064dc 0x32 Bin/PipeStream_XMEGA.o + 0xe4 (size before relaxing) + .debug_str 0x0000650e 0x2c Bin/Pipe_XMEGA.o + 0xde (size before relaxing) + .debug_str 0x0000653a 0x1bb Bin/USBController_XMEGA.o + 0xdc5 (size before relaxing) + .debug_str 0x000066f5 0xaa Bin/USBInterrupt_XMEGA.o + 0x896 (size before relaxing) + .debug_str 0x0000679f 0x280 Bin/AudioClassDevice.o + 0x70a (size before relaxing) + .debug_str 0x00006a1f 0x286 Bin/CDCClassDevice.o + 0xa5f (size before relaxing) + .debug_str 0x00006ca5 0x248 Bin/HIDClassDevice.o + 0xa7a (size before relaxing) + .debug_str 0x00006eed 0x261 Bin/MassStorageClassDevice.o + 0x85d (size before relaxing) + .debug_str 0x0000714e 0x115 Bin/MIDIClassDevice.o + 0x6b4 (size before relaxing) + .debug_str 0x00007263 0x269 Bin/PrinterClassDevice.o + 0x988 (size before relaxing) + .debug_str 0x000074cc 0x6e5 Bin/RNDISClassDevice.o + 0xdbd (size before relaxing) + .debug_str 0x00007bb1 0x3b Bin/AndroidAccessoryClassHost.o + 0xed (size before relaxing) + .debug_str 0x00007bec 0x30 Bin/AudioClassHost.o + 0xe2 (size before relaxing) + .debug_str 0x00007c1c 0x2e Bin/CDCClassHost.o + 0xe0 (size before relaxing) + .debug_str 0x00007c4a 0x2e Bin/HIDClassHost.o + 0xe0 (size before relaxing) + .debug_str 0x00007c78 0x36 Bin/MassStorageClassHost.o + 0xe8 (size before relaxing) + .debug_str 0x00007cae 0x2f Bin/MIDIClassHost.o + 0xe1 (size before relaxing) + .debug_str 0x00007cdd 0x32 Bin/PrinterClassHost.o + 0xe4 (size before relaxing) + .debug_str 0x00007d0f 0x30 Bin/RNDISClassHost.o + 0xe2 (size before relaxing) + .debug_str 0x00007d3f 0x35 Bin/StillImageClassHost.o + 0xe7 (size before relaxing) + .debug_str 0x00007d74 0x81 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + 0xba (size before relaxing) + .debug_str 0x00007df5 0x91 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + 0x149 (size before relaxing) + .debug_str 0x00007e86 0xcd c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + 0x1ad (size before relaxing) + .debug_str 0x00007f53 0x62 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + 0x10d (size before relaxing) + +.debug_loc 0x00000000 0xeb2a + *(.debug_loc) + .debug_loc 0x00000000 0x277 Bin/LUFADescriptors.o + .debug_loc 0x00000277 0x2f Bin/System.o + .debug_loc 0x000002a6 0x3cf Bin/Configuration.o + .debug_loc 0x00000675 0xaa Bin/Random.o + .debug_loc 0x0000071f 0x319 Bin/Common.o + .debug_loc 0x00000a38 0xc2f Bin/Memory.o + .debug_loc 0x00001667 0x75a Bin/Button.o + .debug_loc 0x00001dc1 0x5d9 Bin/Log.o + .debug_loc 0x0000239a 0x2bb Bin/Settings.o + .debug_loc 0x00002655 0x555 Bin/LED.o + .debug_loc 0x00002baa 0x1c9 Bin/Terminal.o + .debug_loc 0x00002d73 0xe44 Bin/Commands.o + .debug_loc 0x00003bb7 0x2e3 Bin/XModem.o + .debug_loc 0x00003e9a 0x4f4 Bin/CommandLine.o + .debug_loc 0x0000438e 0x515 Bin/ISO14443-2A.o + .debug_loc 0x000048a3 0x679 Bin/MifareUltralight.o + .debug_loc 0x00004f1c 0x101d Bin/MifareClassic.o + .debug_loc 0x00005f39 0x231 Bin/ISO14443-3A.o + .debug_loc 0x0000616a 0xa3a Bin/Crypto1.o + .debug_loc 0x00006ba4 0xc34 Bin/HIDParser.o + .debug_loc 0x000077d8 0x536 Bin/ConfigDescriptors.o + .debug_loc 0x00007d0e 0x2d9 Bin/DeviceStandardReq.o + .debug_loc 0x00007fe7 0x22 Bin/USBTask.o + .debug_loc 0x00008009 0x2bf0 Bin/EndpointStream_XMEGA.o + .debug_loc 0x0000abf9 0x581 Bin/Endpoint_XMEGA.o + .debug_loc 0x0000b17a 0xa3 Bin/USBController_XMEGA.o + .debug_loc 0x0000b21d 0x200 Bin/USBInterrupt_XMEGA.o + .debug_loc 0x0000b41d 0x3ad Bin/AudioClassDevice.o + .debug_loc 0x0000b7ca 0x9f6 Bin/CDCClassDevice.o + .debug_loc 0x0000c1c0 0x473 Bin/HIDClassDevice.o + .debug_loc 0x0000c633 0x303 Bin/MassStorageClassDevice.o + .debug_loc 0x0000c936 0x35f Bin/MIDIClassDevice.o + .debug_loc 0x0000cc95 0x8b8 Bin/PrinterClassDevice.o + .debug_loc 0x0000d54d 0xd71 Bin/RNDISClassDevice.o + .debug_loc 0x0000e2be 0x1e8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_loc 0x0000e4a6 0x74 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_loc 0x0000e51a 0x51d c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_loc 0x0000ea37 0xf3 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug_macinfo + *(.debug_macinfo) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges 0x00000000 0x1de0 + *(.debug_ranges) + .debug_ranges 0x00000000 0x28 Bin/Chameleon-Mini.o + .debug_ranges 0x00000028 0x10 Bin/LUFADescriptors.o + .debug_ranges 0x00000038 0x48 Bin/System.o + .debug_ranges 0x00000080 0xb0 Bin/Configuration.o + .debug_ranges 0x00000130 0x28 Bin/Random.o + .debug_ranges 0x00000158 0x48 Bin/Common.o + .debug_ranges 0x000001a0 0x320 Bin/Memory.o + .debug_ranges 0x000004c0 0xe8 Bin/Button.o + .debug_ranges 0x000005a8 0x88 Bin/Log.o + .debug_ranges 0x00000630 0x40 Bin/Settings.o + .debug_ranges 0x00000670 0x138 Bin/LED.o + .debug_ranges 0x000007a8 0xc0 Bin/Terminal.o + .debug_ranges 0x00000868 0x190 Bin/Commands.o + .debug_ranges 0x000009f8 0x48 Bin/XModem.o + .debug_ranges 0x00000a40 0x120 Bin/CommandLine.o + .debug_ranges 0x00000b60 0xc0 Bin/ISO14443-2A.o + .debug_ranges 0x00000c20 0xc8 Bin/MifareUltralight.o + .debug_ranges 0x00000ce8 0x230 Bin/MifareClassic.o + .debug_ranges 0x00000f18 0x18 Bin/ISO14443-3A.o + .debug_ranges 0x00000f30 0x70 Bin/Crypto1.o + .debug_ranges 0x00000fa0 0x150 Bin/HIDParser.o + .debug_ranges 0x000010f0 0x40 Bin/ConfigDescriptors.o + .debug_ranges 0x00001130 0x138 Bin/DeviceStandardReq.o + .debug_ranges 0x00001268 0x10 Bin/Events.o + .debug_ranges 0x00001278 0x60 Bin/USBTask.o + .debug_ranges 0x000012d8 0x10 Bin/Device_XMEGA.o + .debug_ranges 0x000012e8 0x4a8 Bin/EndpointStream_XMEGA.o + .debug_ranges 0x00001790 0x188 Bin/Endpoint_XMEGA.o + .debug_ranges 0x00001918 0x20 Bin/USBController_XMEGA.o + .debug_ranges 0x00001938 0x20 Bin/USBInterrupt_XMEGA.o + .debug_ranges 0x00001958 0x38 Bin/AudioClassDevice.o + .debug_ranges 0x00001990 0x100 Bin/CDCClassDevice.o + .debug_ranges 0x00001a90 0x20 Bin/HIDClassDevice.o + .debug_ranges 0x00001ab0 0xa0 Bin/MassStorageClassDevice.o + .debug_ranges 0x00001b50 0x48 Bin/MIDIClassDevice.o + .debug_ranges 0x00001b98 0x128 Bin/PrinterClassDevice.o + .debug_ranges 0x00001cc0 0xc8 Bin/RNDISClassDevice.o + .debug_ranges 0x00001d88 0x28 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + .debug_ranges 0x00001db0 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + .debug_ranges 0x00001dc0 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + .debug_ranges 0x00001dd0 0x10 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + +.debug_macro + *(.debug_macro) +OUTPUT(Chameleon-Mini.elf elf32-avr) +LOAD linker stubs + +Cross Reference Table + +Symbol File +ActiveConfiguration Bin/MifareClassic.o + Bin/MifareUltralight.o + Bin/ISO14443-2A.o + Bin/Commands.o + Bin/Button.o + Bin/Configuration.o + Bin/Chameleon-Mini.o +Audio_Device_ConfigureEndpoints Bin/AudioClassDevice.o +Audio_Device_Event_Stub Bin/AudioClassDevice.o +Audio_Device_ProcessControlRequest Bin/AudioClassDevice.o +BufferToHexString Bin/Common.o + Bin/Commands.o +ButtonGetActionByName Bin/Button.o + Bin/Commands.o +ButtonGetActionList Bin/Button.o + Bin/Commands.o +ButtonInit Bin/Button.o + Bin/Chameleon-Mini.o +ButtonSetActionById Bin/Button.o +ButtonSetActionByName Bin/Button.o + Bin/Commands.o +ButtonTick Bin/Button.o + Bin/Chameleon-Mini.o +CALLBACK_Audio_Device_GetSetEndpointProperty Bin/AudioClassDevice.o +CALLBACK_Audio_Device_GetSetInterfaceProperty Bin/AudioClassDevice.o +CALLBACK_HIDParser_FilterHIDReportItem Bin/HIDParser.o +CALLBACK_HID_Device_CreateHIDReport Bin/HIDClassDevice.o +CALLBACK_HID_Device_ProcessHIDReport Bin/HIDClassDevice.o +CALLBACK_MS_Device_SCSICommandReceived Bin/MassStorageClassDevice.o +CALLBACK_USB_GetDescriptor Bin/LUFADescriptors.o + Bin/DeviceStandardReq.o +CDC_Device_BytesReceived Bin/CDCClassDevice.o +CDC_Device_ConfigureEndpoints Bin/CDCClassDevice.o + Bin/Terminal.o +CDC_Device_CreateBlockingStream Bin/CDCClassDevice.o +CDC_Device_CreateStream Bin/CDCClassDevice.o +CDC_Device_Event_Stub Bin/CDCClassDevice.o +CDC_Device_Flush Bin/CDCClassDevice.o +CDC_Device_ProcessControlRequest Bin/CDCClassDevice.o + Bin/Terminal.o +CDC_Device_ReceiveByte Bin/CDCClassDevice.o + Bin/Terminal.o +CDC_Device_SendByte Bin/CDCClassDevice.o + Bin/XModem.o + Bin/Terminal.o + Bin/Log.o +CDC_Device_SendControlLineStateChange Bin/CDCClassDevice.o +CDC_Device_SendData Bin/CDCClassDevice.o + Bin/Terminal.o +CDC_Device_SendString Bin/CDCClassDevice.o + Bin/Terminal.o +CDC_Device_USBTask Bin/CDCClassDevice.o + Bin/Terminal.o +CodecBuffer Bin/ISO14443-2A.o + Bin/Codec.o +CommandExecButton Bin/Commands.o + Bin/CommandLine.o +CommandExecButtonLong Bin/Commands.o + Bin/CommandLine.o +CommandExecClear Bin/Commands.o + Bin/CommandLine.o +CommandExecConfig Bin/Commands.o + Bin/CommandLine.o +CommandExecDownload Bin/Commands.o + Bin/CommandLine.o +CommandExecHelp Bin/Commands.o + Bin/CommandLine.o +CommandExecLedGreen Bin/Commands.o + Bin/CommandLine.o +CommandExecLedRed Bin/Commands.o + Bin/CommandLine.o +CommandExecLogMem Bin/Commands.o + Bin/CommandLine.o +CommandExecLogMode Bin/Commands.o + Bin/CommandLine.o +CommandExecReset Bin/Commands.o + Bin/CommandLine.o +CommandExecUpgrade Bin/Commands.o + Bin/CommandLine.o +CommandExecUpload Bin/Commands.o + Bin/CommandLine.o +CommandGetButton Bin/Commands.o + Bin/CommandLine.o +CommandGetButtonLong Bin/Commands.o + Bin/CommandLine.o +CommandGetConfig Bin/Commands.o + Bin/CommandLine.o +CommandGetLedGreen Bin/Commands.o + Bin/CommandLine.o +CommandGetLedRed Bin/Commands.o + Bin/CommandLine.o +CommandGetLogMem Bin/Commands.o + Bin/CommandLine.o +CommandGetLogMode Bin/Commands.o + Bin/CommandLine.o +CommandGetMemSize Bin/Commands.o + Bin/CommandLine.o +CommandGetReadOnly Bin/Commands.o + Bin/CommandLine.o +CommandGetRssi Bin/Commands.o + Bin/CommandLine.o +CommandGetSetting Bin/Commands.o + Bin/CommandLine.o +CommandGetUid Bin/Commands.o + Bin/CommandLine.o +CommandGetUidSize Bin/Commands.o + Bin/CommandLine.o +CommandGetVersion Bin/Commands.o + Bin/CommandLine.o +CommandLineInit Bin/CommandLine.o +CommandLineProcessByte Bin/CommandLine.o + Bin/Terminal.o +CommandLineTick Bin/CommandLine.o + Bin/Terminal.o +CommandSetButton Bin/Commands.o + Bin/CommandLine.o +CommandSetButtonLong Bin/Commands.o + Bin/CommandLine.o +CommandSetConfig Bin/Commands.o + Bin/CommandLine.o +CommandSetLedGreen Bin/Commands.o + Bin/CommandLine.o +CommandSetLedRed Bin/Commands.o + Bin/CommandLine.o +CommandSetLogMem Bin/Commands.o + Bin/CommandLine.o +CommandSetLogMode Bin/Commands.o + Bin/CommandLine.o +CommandSetReadOnly Bin/Commands.o + Bin/CommandLine.o +CommandSetSetting Bin/Commands.o + Bin/CommandLine.o +CommandSetUid Bin/Commands.o + Bin/CommandLine.o +CommandTable Bin/CommandLine.o + Bin/Commands.o +ConfigurationDescriptor Bin/LUFADescriptors.o +ConfigurationGetList Bin/Configuration.o + Bin/Commands.o +ConfigurationInit Bin/Configuration.o + Bin/Settings.o + Bin/Chameleon-Mini.o +ConfigurationSetById Bin/Configuration.o +ConfigurationSetByName Bin/Configuration.o + Bin/Commands.o +Crypto1Auth Bin/Crypto1.o + Bin/MifareClassic.o +Crypto1Byte Bin/Crypto1.o + Bin/MifareClassic.o +Crypto1FilterOutput Bin/Crypto1.o + Bin/MifareClassic.o +Crypto1Nibble Bin/Crypto1.o + Bin/MifareClassic.o +Crypto1PRNG Bin/Crypto1.o + Bin/MifareClassic.o +Crypto1Setup Bin/Crypto1.o + Bin/MifareClassic.o +DeviceDescriptor Bin/LUFADescriptors.o +EVENT_Audio_Device_StreamStartStop Bin/AudioClassDevice.o +EVENT_CDC_Device_BreakSent Bin/CDCClassDevice.o +EVENT_CDC_Device_ControLineStateChanged Bin/CDCClassDevice.o +EVENT_CDC_Device_LineEncodingChanged Bin/CDCClassDevice.o +EVENT_PRNT_Device_SoftReset Bin/PrinterClassDevice.o +EVENT_USB_Device_ConfigurationChanged Bin/Terminal.o + Bin/DeviceStandardReq.o +EVENT_USB_Device_Connect Bin/Terminal.o + Bin/USBInterrupt_XMEGA.o +EVENT_USB_Device_ControlRequest Bin/Terminal.o + Bin/DeviceStandardReq.o +EVENT_USB_Device_Disconnect Bin/Terminal.o + Bin/USBInterrupt_XMEGA.o +EVENT_USB_Device_Reset Bin/Events.o + Bin/USBInterrupt_XMEGA.o +EVENT_USB_Device_StartOfFrame Bin/Events.o + Bin/USBInterrupt_XMEGA.o +EVENT_USB_Device_Suspend Bin/Events.o +EVENT_USB_Device_WakeUp Bin/Events.o +Endpoint_ClearEndpoints Bin/Endpoint_XMEGA.o + Bin/USBInterrupt_XMEGA.o +Endpoint_ClearIN Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/DeviceStandardReq.o +Endpoint_ClearOUT Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/DeviceStandardReq.o +Endpoint_ClearSETUP Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o + Bin/DeviceStandardReq.o +Endpoint_ClearStatusStage Bin/Endpoint_XMEGA.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o + Bin/DeviceStandardReq.o +Endpoint_ConfigureEndpointTable Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o +Endpoint_ConfigureEndpoint_PRV Bin/Endpoint_XMEGA.o + Bin/USBInterrupt_XMEGA.o + Bin/USBController_XMEGA.o +Endpoint_Discard_Stream Bin/EndpointStream_XMEGA.o +Endpoint_IsINReady Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/DeviceStandardReq.o +Endpoint_IsOUTReceived Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o +Endpoint_IsSETUPReceived Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/USBTask.o + Bin/DeviceStandardReq.o +Endpoint_Null_Stream Bin/EndpointStream_XMEGA.o +Endpoint_Read_8 Bin/Endpoint_XMEGA.o + Bin/PrinterClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/DeviceStandardReq.o +Endpoint_Read_Control_EStream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Read_Control_EStream_LE Bin/EndpointStream_XMEGA.o +Endpoint_Read_Control_Stream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Read_Control_Stream_LE Bin/EndpointStream_XMEGA.o + Bin/RNDISClassDevice.o + Bin/HIDClassDevice.o + Bin/AudioClassDevice.o +Endpoint_Read_EStream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Read_EStream_LE Bin/EndpointStream_XMEGA.o +Endpoint_Read_Stream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Read_Stream_LE Bin/EndpointStream_XMEGA.o + Bin/RNDISClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o +Endpoint_SelectEndpoint Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/USBTask.o + Bin/DeviceStandardReq.o +Endpoint_StallTransaction Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/MassStorageClassDevice.o + Bin/DeviceStandardReq.o +Endpoint_WaitUntilReady Bin/Endpoint_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o +Endpoint_Write_8 Bin/Endpoint_XMEGA.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/DeviceStandardReq.o +Endpoint_Write_Control_EStream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Write_Control_EStream_LE Bin/EndpointStream_XMEGA.o +Endpoint_Write_Control_PStream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Write_Control_PStream_LE Bin/EndpointStream_XMEGA.o + Bin/DeviceStandardReq.o +Endpoint_Write_Control_Stream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Write_Control_Stream_LE Bin/EndpointStream_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/HIDClassDevice.o + Bin/AudioClassDevice.o + Bin/DeviceStandardReq.o +Endpoint_Write_EStream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Write_EStream_LE Bin/EndpointStream_XMEGA.o +Endpoint_Write_PStream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Write_PStream_LE Bin/EndpointStream_XMEGA.o +Endpoint_Write_Stream_BE Bin/EndpointStream_XMEGA.o +Endpoint_Write_Stream_LE Bin/EndpointStream_XMEGA.o + Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o +GlobalSettings Bin/LED.o + Bin/Settings.o + Bin/Log.o + Bin/Button.o + Bin/Memory.o + Bin/Configuration.o +HID_Device_ConfigureEndpoints Bin/HIDClassDevice.o +HID_Device_ProcessControlRequest Bin/HIDClassDevice.o +HID_Device_USBTask Bin/HIDClassDevice.o +HexStringToBuffer Bin/Common.o + Bin/Commands.o +ISO14443AAppendCRCA Bin/ISO14443-3A.o + Bin/MifareClassic.o + Bin/MifareUltralight.o +ISO14443ACheckCRCA Bin/ISO14443-3A.o + Bin/MifareClassic.o + Bin/MifareUltralight.o +ISO14443ACodecInit Bin/ISO14443-2A.o + Bin/Configuration.o +ISO14443ACodecTask Bin/ISO14443-2A.o + Bin/Configuration.o +LEDGetFuncByName Bin/LED.o + Bin/Commands.o +LEDGetFuncList Bin/LED.o + Bin/Commands.o +LEDGreenAction Bin/LED.o +LEDInit Bin/LED.o + Bin/Chameleon-Mini.o +LEDRedAction Bin/LED.o +LEDSetFuncById Bin/LED.o +LEDSetFuncByName Bin/LED.o + Bin/Commands.o +LEDTick Bin/LED.o + Bin/Chameleon-Mini.o +LEDTrigger Bin/LED.o + Bin/ISO14443-2A.o + Bin/Terminal.o + Bin/Settings.o + Bin/Memory.o +LanguageString Bin/LUFADescriptors.o +LogFunc Bin/ISO14443-2A.o + Bin/Log.o +LogGetModeByName Bin/Log.o + Bin/Commands.o +LogGetModeList Bin/Log.o + Bin/Commands.o +LogInit Bin/Log.o + Bin/Settings.o + Bin/Chameleon-Mini.o +LogMemClear Bin/Log.o + Bin/Commands.o +LogMemFree Bin/Log.o + Bin/Commands.o +LogMemLoadBlock Bin/Log.o + Bin/Commands.o +LogSetModeById Bin/Log.o +LogSetModeByName Bin/Log.o + Bin/Commands.o +LogTask Bin/Log.o + Bin/Chameleon-Mini.o +LogTick Bin/Log.o + Bin/Chameleon-Mini.o +MIDI_Device_ConfigureEndpoints Bin/MIDIClassDevice.o +MIDI_Device_Flush Bin/MIDIClassDevice.o +MIDI_Device_ReceiveEventPacket Bin/MIDIClassDevice.o +MIDI_Device_SendEventPacket Bin/MIDIClassDevice.o +MIDI_Device_USBTask Bin/MIDIClassDevice.o +MS_Device_ConfigureEndpoints Bin/MassStorageClassDevice.o +MS_Device_ProcessControlRequest Bin/MassStorageClassDevice.o +MS_Device_USBTask Bin/MassStorageClassDevice.o +ManufacturerString Bin/LUFADescriptors.o +MemoryClear Bin/Memory.o + Bin/Commands.o +MemoryDownloadBlock Bin/Memory.o + Bin/Commands.o +MemoryInit Bin/Memory.o + Bin/Chameleon-Mini.o +MemoryReadBlock Bin/Memory.o + Bin/MifareClassic.o + Bin/MifareUltralight.o +MemoryRecall Bin/Memory.o + Bin/Settings.o + Bin/Button.o +MemoryStore Bin/Memory.o + Bin/Settings.o + Bin/Button.o +MemoryUploadBlock Bin/Memory.o + Bin/Commands.o +MemoryWriteBlock Bin/Memory.o + Bin/MifareClassic.o + Bin/MifareUltralight.o +MifareClassicAppInit1K Bin/MifareClassic.o + Bin/Configuration.o +MifareClassicAppInit4K Bin/MifareClassic.o + Bin/Configuration.o +MifareClassicAppProcess Bin/MifareClassic.o + Bin/Configuration.o +MifareClassicAppReset Bin/MifareClassic.o + Bin/Configuration.o +MifareClassicAppTask Bin/MifareClassic.o + Bin/Configuration.o +MifareClassicGetUid Bin/MifareClassic.o + Bin/Configuration.o +MifareClassicSetUid Bin/MifareClassic.o + Bin/Configuration.o +MifarePlus1kAppInit_7B Bin/MifareClassic.o + Bin/Configuration.o +MifareUltralightAppInit Bin/MifareUltralight.o + Bin/Configuration.o +MifareUltralightAppProcess Bin/MifareUltralight.o + Bin/Configuration.o +MifareUltralightAppReset Bin/MifareUltralight.o + Bin/Configuration.o +MifareUltralightAppTask Bin/MifareUltralight.o + Bin/Configuration.o +MifareUltralightGetUid Bin/MifareUltralight.o + Bin/Configuration.o +MifareUltralightSetUid Bin/MifareUltralight.o + Bin/Configuration.o +PRNT_Device_BytesReceived Bin/PrinterClassDevice.o +PRNT_Device_ConfigureEndpoints Bin/PrinterClassDevice.o +PRNT_Device_CreateBlockingStream Bin/PrinterClassDevice.o +PRNT_Device_CreateStream Bin/PrinterClassDevice.o +PRNT_Device_Event_Stub Bin/PrinterClassDevice.o +PRNT_Device_Flush Bin/PrinterClassDevice.o +PRNT_Device_ProcessControlRequest Bin/PrinterClassDevice.o +PRNT_Device_ReceiveByte Bin/PrinterClassDevice.o +PRNT_Device_SendByte Bin/PrinterClassDevice.o +PRNT_Device_SendData Bin/PrinterClassDevice.o +PRNT_Device_SendString Bin/PrinterClassDevice.o +PRNT_Device_USBTask Bin/PrinterClassDevice.o +ProductString Bin/LUFADescriptors.o +RNDIS_Device_ConfigureEndpoints Bin/RNDISClassDevice.o +RNDIS_Device_IsPacketReceived Bin/RNDISClassDevice.o +RNDIS_Device_ProcessControlRequest Bin/RNDISClassDevice.o +RNDIS_Device_ReadPacket Bin/RNDISClassDevice.o +RNDIS_Device_SendPacket Bin/RNDISClassDevice.o +RNDIS_Device_USBTask Bin/RNDISClassDevice.o +RandomGetBuffer Bin/Random.o + Bin/MifareClassic.o +RandomGetByte Bin/Random.o + Bin/Commands.o + Bin/Button.o +RandomInit Bin/Random.o + Bin/Chameleon-Mini.o +RandomTick Bin/Random.o + Bin/Chameleon-Mini.o +SettingsCycle Bin/Settings.o + Bin/Button.o +SettingsGetActiveById Bin/Settings.o +SettingsGetActiveByName Bin/Settings.o + Bin/Commands.o +SettingsLoad Bin/Settings.o + Bin/Chameleon-Mini.o +SettingsSave Bin/Settings.o + Bin/Commands.o +SettingsSetActiveById Bin/Settings.o +SettingsSetActiveByName Bin/Settings.o + Bin/Commands.o +StoredSettings Bin/Settings.o +SystemEnterBootloader Bin/System.o + Bin/Commands.o +SystemInit Bin/System.o + Bin/Chameleon-Mini.o +SystemInterruptInit Bin/System.o + Bin/Chameleon-Mini.o +SystemReset Bin/System.o + Bin/Commands.o +SystemStartUSBClock Bin/System.o + Bin/Terminal.o +SystemStopUSBClock Bin/System.o + Bin/Terminal.o +TerminalBuffer Bin/CommandLine.o + Bin/XModem.o + Bin/Terminal.o +TerminalHandle Bin/Terminal.o + Bin/XModem.o + Bin/Log.o +TerminalInit Bin/Terminal.o + Bin/Chameleon-Mini.o +TerminalSendBlock Bin/Terminal.o + Bin/XModem.o + Bin/Log.o +TerminalSendString Bin/Terminal.o + Bin/CommandLine.o +TerminalSendStringP Bin/Terminal.o + Bin/CommandLine.o +TerminalState Bin/Terminal.o +TerminalTask Bin/Terminal.o + Bin/Chameleon-Mini.o +TerminalTick Bin/Terminal.o + Bin/Chameleon-Mini.o +USB_ControlRequest Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/AudioClassDevice.o + Bin/Endpoint_XMEGA.o + Bin/EndpointStream_XMEGA.o + Bin/USBTask.o + Bin/DeviceStandardReq.o +USB_DeviceState Bin/RNDISClassDevice.o + Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/MassStorageClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/USBInterrupt_XMEGA.o + Bin/USBController_XMEGA.o + Bin/Endpoint_XMEGA.o + Bin/EndpointStream_XMEGA.o + Bin/USBTask.o + Bin/DeviceStandardReq.o +USB_Device_ConfigurationNumber Bin/USBInterrupt_XMEGA.o + Bin/USBController_XMEGA.o + Bin/DeviceStandardReq.o +USB_Device_CurrentlySelfPowered Bin/USBController_XMEGA.o + Bin/DeviceStandardReq.o +USB_Device_ProcessControlRequest Bin/DeviceStandardReq.o + Bin/USBTask.o +USB_Device_RemoteWakeupEnabled Bin/USBController_XMEGA.o + Bin/DeviceStandardReq.o +USB_Device_SendRemoteWakeup Bin/Device_XMEGA.o +USB_Disable Bin/USBController_XMEGA.o + Bin/Commands.o + Bin/Terminal.o +USB_EndpointTable Bin/USBController_XMEGA.o +USB_Endpoint_FIFOs Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/Endpoint_XMEGA.o + Bin/DeviceStandardReq.o +USB_Endpoint_SelectedEndpoint Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/CDCClassDevice.o + Bin/Endpoint_XMEGA.o + Bin/EndpointStream_XMEGA.o + Bin/USBTask.o +USB_Endpoint_SelectedFIFO Bin/PrinterClassDevice.o + Bin/MIDIClassDevice.o + Bin/HIDClassDevice.o + Bin/CDCClassDevice.o + Bin/Endpoint_XMEGA.o + Bin/EndpointStream_XMEGA.o +USB_Endpoint_SelectedHandle Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/Endpoint_XMEGA.o + Bin/DeviceStandardReq.o +USB_Event_Stub Bin/Events.o +USB_GetHIDReportItemInfo Bin/HIDParser.o +USB_GetHIDReportSize Bin/HIDParser.o +USB_GetNextDescriptorComp Bin/ConfigDescriptors.o +USB_GetNextDescriptorOfType Bin/ConfigDescriptors.o +USB_GetNextDescriptorOfTypeAfter Bin/ConfigDescriptors.o +USB_GetNextDescriptorOfTypeBefore Bin/ConfigDescriptors.o +USB_INT_ClearAllInterrupts Bin/USBInterrupt_XMEGA.o + Bin/USBController_XMEGA.o +USB_INT_DisableAllInterrupts Bin/USBInterrupt_XMEGA.o + Bin/USBController_XMEGA.o +USB_Init Bin/USBController_XMEGA.o + Bin/Terminal.o +USB_IsInitialized Bin/USBController_XMEGA.o + Bin/USBTask.o +USB_ProcessHIDReport Bin/HIDParser.o +USB_ResetInterface Bin/USBController_XMEGA.o +USB_SetHIDReportItemInfo Bin/HIDParser.o +USB_USBTask Bin/USBTask.o + Bin/PrinterClassDevice.o + Bin/MassStorageClassDevice.o + Bin/CDCClassDevice.o + Bin/EndpointStream_XMEGA.o + Bin/Terminal.o +XModemProcessByte Bin/XModem.o + Bin/Terminal.o +XModemReceive Bin/XModem.o + Bin/Commands.o +XModemSend Bin/XModem.o + Bin/Commands.o +XModemTick Bin/XModem.o + Bin/Terminal.o +__bad_interrupt c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__bss_end c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) +__bss_start c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) +__data_end c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) +__data_load_start c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) +__data_start c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) +__divmodsi4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) +__do_clear_bss c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_clear_bss.o) + Bin/USBController_XMEGA.o + Bin/Endpoint_XMEGA.o + Bin/USBTask.o + Bin/DeviceStandardReq.o + Bin/Crypto1.o + Bin/MifareClassic.o + Bin/MifareUltralight.o + Bin/ISO14443-2A.o + Bin/Codec.o + Bin/CommandLine.o + Bin/XModem.o + Bin/Terminal.o + Bin/LED.o + Bin/Settings.o + Bin/Log.o + Bin/Button.o + Bin/Memory.o + Bin/Configuration.o +__do_copy_data c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_copy_data.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + Bin/RNDISClassDevice.o + Bin/CDCClassDevice.o + Bin/Crypto1.o + Bin/Commands.o + Bin/Terminal.o +__eerd_block_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + Bin/Settings.o +__eerd_byte_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + Bin/EndpointStream_XMEGA.o +__eeupd_byte_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) + Bin/EndpointStream_XMEGA.o +__eeupd_r18_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) +__eewr_block_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + Bin/Settings.o +__eewr_byte_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) +__eewr_r18_x32a4u c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_byte_atxmega32a4u.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eewr_block_atxmega32a4u.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) +__epilogue_restores__ c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_epilogue.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) +__heap_end c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__init c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__mulohisi3 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) +__mulshisi3 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) + Bin/Commands.o +__muluhisi3 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_mulshisi3.o) +__prologue_saves__ c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_prologue.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) +__stack c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__tablejump2__ c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) + Bin/HIDParser.o +__tablejump__ c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_tablejump.o) +__udivmodsi4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_udivmodsi4.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_divmodsi4.o) +__ultoa_invert c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(ultoa_invert.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) +__umulhisi3 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_umulhisi3.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_muluhisi3.o) +__vector_1 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_10 Bin/System.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_100 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_101 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_102 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_103 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_104 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_105 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_106 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_107 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_108 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_109 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_11 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_110 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_111 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_112 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_113 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_114 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_115 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_116 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_117 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_118 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_119 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_12 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_120 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_121 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_122 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_123 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_124 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_125 Bin/USBInterrupt_XMEGA.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_126 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_13 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_14 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_15 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_16 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_17 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_18 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_19 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_2 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_20 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_21 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_22 Bin/ISO14443-2A.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_23 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_24 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_25 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_26 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_27 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_28 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_29 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_3 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_30 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_31 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_32 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_33 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_34 Bin/ISO14443-2A.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_35 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_36 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_37 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_38 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_39 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_40 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_41 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_42 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_43 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_44 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_45 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_46 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_47 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_48 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_49 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_5 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_50 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_51 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_52 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_53 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_54 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_55 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_56 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_57 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_58 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_59 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_6 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_60 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_61 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_62 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_63 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_64 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_65 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_66 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_67 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_68 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_69 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_7 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_70 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_71 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_72 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_73 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_74 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_75 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_76 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_77 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_78 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_79 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_80 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_81 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_82 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_83 Bin/ISO14443-2A.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_84 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_85 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_86 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_87 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_88 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_89 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_9 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_90 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_91 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_92 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_93 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_94 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_95 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_96 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_97 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_98 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_99 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vector_default Bin/System.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +__vectors c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +_exit c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) +eeprom_mapen c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_byte_atxmega32a4u.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eeupd_byte_atxmega32a4u.o) +exit c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avrxmega2\libgcc.a(_exit.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +fputc c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(fputc.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) +main Bin/Chameleon-Mini.o + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2/crtx32a4u.o +memcmp c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcmp.o) + Bin/HIDClassDevice.o +memcpy c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(eerd_block_atxmega32a4u.o) + Bin/RNDISClassDevice.o + Bin/HIDClassDevice.o +memcpy_P c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memcpy_P.o) + Bin/RNDISClassDevice.o + Bin/Configuration.o +memset c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(memset.o) + Bin/HIDClassDevice.o +rand c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) + Bin/Random.o +rand_r c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) +snprintf_P c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) + Bin/Commands.o +srand c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(rand.o) +strcmp_P c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strcmp_P.o) + Bin/CommandLine.o + Bin/Commands.o + Bin/LED.o + Bin/Log.o + Bin/Button.o +strncat_P c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncat_P.o) + Bin/Log.o +strncpy_P c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strncpy_P.o) + Bin/LED.o + Bin/Log.o + Bin/Button.o +strnlen c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) +strnlen_P c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(strnlen_P.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) +vfprintf c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(vfprintf_std.o) + c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.1002/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avrxmega2\libc.a(snprintf_p.o) diff --git a/Firmware/Chameleon-Mini/Chameleon-Mini.sym b/Firmware/Chameleon-Mini/Chameleon-Mini.sym index 0f11987..47e8088 100644 --- a/Firmware/Chameleon-Mini/Chameleon-Mini.sym +++ b/Firmware/Chameleon-Mini/Chameleon-Mini.sym @@ -1,731 +1,806 @@ - 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 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__ -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__ -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__ -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__ -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__ -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__ -0000024c T ProductString -0000024c T __trampolines_end -0000024c T __trampolines_start -0000026a T ManufacturerString -00000284 T LanguageString -00000288 T ConfigurationDescriptor -000002c6 T DeviceDescriptor -000002d8 t ConfigurationTable -00000347 t ButtonActionTable -00000467 t __c.6505 -0000046e t __c.6466 -00000471 t __c.6461 -00000474 t __c.6434 -0000047b t __c.6416 -0000047e t __c.6405 -000004b7 t __c.6407 -000004be t __c.6409 -000004c5 t __c.6411 -000004cb t __c.6197 -000004ce t __c.6195 -000004d1 t StatusTable -00000597 T CommandTable -000006f8 T __ctors_end -000006f8 T __ctors_start -000006f8 T __dtors_end -000006f8 T __dtors_start -000006f8 W __init -00000704 T __do_copy_data -0000071a T __do_clear_bss -00000722 t .do_clear_bss_loop -00000724 t .do_clear_bss_start -00000730 T __bad_interrupt -00000730 W __vector_1 -00000730 W __vector_10 -00000730 W __vector_100 -00000730 W __vector_101 -00000730 W __vector_102 -00000730 W __vector_103 -00000730 W __vector_104 -00000730 W __vector_105 -00000730 W __vector_106 -00000730 W __vector_107 -00000730 W __vector_108 -00000730 W __vector_109 -00000730 W __vector_11 -00000730 W __vector_110 -00000730 W __vector_111 -00000730 W __vector_112 -00000730 W __vector_113 -00000730 W __vector_114 -00000730 W __vector_115 -00000730 W __vector_116 -00000730 W __vector_117 -00000730 W __vector_118 -00000730 W __vector_119 -00000730 W __vector_12 -00000730 W __vector_120 -00000730 W __vector_121 -00000730 W __vector_122 -00000730 W __vector_123 -00000730 W __vector_124 -00000730 W __vector_126 -00000730 W __vector_13 -00000730 W __vector_14 -00000730 W __vector_15 -00000730 W __vector_16 -00000730 W __vector_17 -00000730 W __vector_18 -00000730 W __vector_19 -00000730 W __vector_2 -00000730 W __vector_20 -00000730 W __vector_21 -00000730 W __vector_23 -00000730 W __vector_24 -00000730 W __vector_25 -00000730 W __vector_26 -00000730 W __vector_27 -00000730 W __vector_28 -00000730 W __vector_29 -00000730 W __vector_3 -00000730 W __vector_30 -00000730 W __vector_31 -00000730 W __vector_32 -00000730 W __vector_33 -00000730 W __vector_35 -00000730 W __vector_36 -00000730 W __vector_37 -00000730 W __vector_38 -00000730 W __vector_39 -00000730 W __vector_4 -00000730 W __vector_40 -00000730 W __vector_41 -00000730 W __vector_42 -00000730 W __vector_43 -00000730 W __vector_44 -00000730 W __vector_45 -00000730 W __vector_46 -00000730 W __vector_47 -00000730 W __vector_48 -00000730 W __vector_49 -00000730 W __vector_5 -00000730 W __vector_50 -00000730 W __vector_51 -00000730 W __vector_52 -00000730 W __vector_53 -00000730 W __vector_54 -00000730 W __vector_55 -00000730 W __vector_56 -00000730 W __vector_57 -00000730 W __vector_58 -00000730 W __vector_59 -00000730 W __vector_6 -00000730 W __vector_60 -00000730 W __vector_61 -00000730 W __vector_62 -00000730 W __vector_63 -00000730 W __vector_64 -00000730 W __vector_65 -00000730 W __vector_66 -00000730 W __vector_67 -00000730 W __vector_68 -00000730 W __vector_69 -00000730 W __vector_7 -00000730 W __vector_70 -00000730 W __vector_71 -00000730 W __vector_72 -00000730 W __vector_73 -00000730 W __vector_74 -00000730 W __vector_75 -00000730 W __vector_76 -00000730 W __vector_77 -00000730 W __vector_78 -00000730 W __vector_79 -00000730 W __vector_8 -00000730 W __vector_80 -00000730 W __vector_81 -00000730 W __vector_82 -00000730 W __vector_84 -00000730 W __vector_85 -00000730 W __vector_86 -00000730 W __vector_87 -00000730 W __vector_88 -00000730 W __vector_89 -00000730 W __vector_9 -00000730 W __vector_90 -00000730 W __vector_91 -00000730 W __vector_92 -00000730 W __vector_93 -00000730 W __vector_94 -00000730 W __vector_95 -00000730 W __vector_96 -00000730 W __vector_97 -00000730 W __vector_98 -00000730 W __vector_99 -00000732 T main -000007a8 T CALLBACK_USB_GetDescriptor -00000824 T __vector_default -00000830 T SystemInit -0000089e T SystemReset -000008ac T SystemEnterBootloader -000008b8 T SystemStartUSBClock -000008ea T SystemStopUSBClock -00000906 T SystemInterruptInit -00000912 t CodecInitDummy -00000914 t CodecTaskDummy -00000916 t ApplicationInitDummy -00000918 t ApplicationResetDummy -0000091a t ApplicationTaskDummy -0000091c t ApplicationProcessDummy -00000922 t ApplicationGetUidDummy -00000924 t ApplicationSetUidDummy -00000926 T ConfigurationSetById -0000095c T ConfigurationInit -00000968 T ConfigurationSetByName -000009e2 T ConfigurationGetList -00000a56 T RandomInit -00000a58 T RandomGetByte -00000a5e T RandomGetBuffer -00000a7e T RandomTick -00000a8e T BufferToHexString -00000b14 T HexStringToBuffer -00000ba8 T MemoryReadBlock -00000bd8 T MemoryWriteBlock -00000c06 T MemoryClear -00000c1c T MemoryRecall -00000d08 T MemoryInit -00000e04 T MemoryStore -0000107e T MemoryUploadBlock -00001410 T MemoryDownloadBlock -0000148a T ButtonInit -00001498 T ButtonTick -00001652 T ButtonGetActionList -000016c4 T ButtonGetActionByName -000016e0 T ButtonSetActionByName -000017a0 T SettingsLoad -000017b0 T SettingsSave -000017c0 T SettingsSetActiveById -000017fc T SettingsCycle -000018d6 T SettingsGetActiveByName -000018e4 T SettingsSetActiveByName -000018fe T TerminalSendString -00001908 T TerminalSendStringP -00001930 T TerminalSendBlock -0000193c T TerminalInit -00001946 T TerminalTask -00001984 T TerminalTick -00001a04 T EVENT_USB_Device_Connect -00001a0e T EVENT_USB_Device_Disconnect -00001a18 T EVENT_USB_Device_ConfigurationChanged -00001a20 T EVENT_USB_Device_ControlRequest -00001a28 T CommandGetVersion -00001a64 T CommandGetConfig -00001a90 T CommandSetConfig -00001aa2 T CommandExecConfig -00001aae T CommandGetUid -00001b02 T CommandSetUid -00001ba6 T CommandGetReadOnly -00001bca T CommandSetReadOnly -00001bf2 T CommandExecUpload -00001bfc T CommandExecDownload -00001c06 T CommandExecReset -00001c1c T CommandExecUpgrade -00001c32 T CommandGetMemSize -00001c62 T CommandGetUidSize -00001c8e T CommandExecButton -00001c98 T CommandGetButton -00001ca2 T CommandSetButton -00001cb2 T CommandGetSetting -00001cbc T CommandSetSetting -00001ccc T CommandExecClear -00001cd4 T CommandExecHelp -00001d68 T CommandGetRssi -00001dd0 T XModemReceive -00001e00 T XModemSend -00001e26 T XModemProcessByte -000020e8 T XModemTick -00002144 T CommandLineProcessByte -00002490 T CommandLineTick -00002492 t StartDemod -000024ce T __vector_34 -00002556 T __vector_22 -000026ca T __vector_83 -00002886 T ISO14443ACodecInit -000028f4 T ISO14443ACodecTask -000029ea T MifareClassicAppInit1K -00002a04 T MifareClassicAppInit4K -00002a1e T MifareClassicAppReset -00002a26 T MifareClassicAppTask -00002a28 T MifareClassicAppProcess -00002fff W __stack -000031ce T MifareClassicGetUid -000031da T MifareClassicSetUid -0000321a T ISO14443AAppendCRCA -00003276 T ISO14443ACheckCRCA -000032f2 t Crypto1LFSR -0000337e T Crypto1FilterOutput -000033e2 T Crypto1Setup -0000357c T Crypto1Auth -000035c6 T Crypto1Byte -000035ec T Crypto1Nibble -00003612 T Crypto1PRNG -000036b2 T USB_Device_ProcessControlRequest -000038f2 W EVENT_USB_Device_Reset -000038f2 W EVENT_USB_Device_StartOfFrame -000038f2 W EVENT_USB_Device_Suspend -000038f2 W EVENT_USB_Device_WakeUp -000038f2 T USB_Event_Stub -000038f4 T USB_USBTask -0000391e T Endpoint_Write_Stream_LE -000039e6 T Endpoint_Write_Control_Stream_LE -00003b10 T Endpoint_Write_Control_PStream_LE -00003c68 T Endpoint_ClearIN -00003c9a T Endpoint_ClearOUT -00003cb8 T Endpoint_Read_8 -00003cd8 T Endpoint_Write_8 -00003cf8 T Endpoint_SelectEndpoint -00003d6a T Endpoint_IsINReady -00003d82 T Endpoint_IsOUTReceived -00003db4 T Endpoint_IsSETUPReceived -00003de6 T Endpoint_ClearSETUP -00003e3e T Endpoint_StallTransaction -00003e76 T Endpoint_ConfigureEndpoint_PRV -00003f0c T Endpoint_ConfigureEndpointTable -00003fe4 T Endpoint_ClearEndpoints -00004054 T Endpoint_ClearStatusStage -00004080 T Endpoint_WaitUntilReady -00004126 T USB_Disable -00004140 T USB_ResetInterface -0000419c T USB_Init -000041ec T USB_INT_DisableAllInterrupts -000041fa T USB_INT_ClearAllInterrupts -00004206 T __vector_125 -000042e0 T CDC_Device_ConfigureEndpoints -0000432a T CDC_Device_SendString -00004374 T CDC_Device_SendData -000043c8 T CDC_Device_SendByte -00004432 T CDC_Device_Flush -000044ae T CDC_Device_USBTask -000044e4 T CDC_Device_ReceiveByte -0000459c T CDC_Device_Event_Stub -0000459c W EVENT_CDC_Device_BreakSent -0000459c W EVENT_CDC_Device_ControLineStateChanged -0000459c W EVENT_CDC_Device_LineEncodingChanged -0000459e T CDC_Device_ProcessControlRequest -000046d2 T __tablejump2__ -000046d6 T __tablejump__ -000046de T __mulshisi3 -000046e2 T __mulohisi3 -000046ea T __muluhisi3 -000046fe T __umulhisi3 -0000471c t do_rand -000047ac T rand_r -000047ae T rand -000047b4 T srand -000047ca T memcpy_P -000047dc T strcmp_P -000047ee T strncpy_P -0000480c T memcpy -0000481e T snprintf_P -00004878 T vfprintf -00004bfe T __eerd_block_x32a4u -00004c14 T __eewr_block_x32a4u -00004c26 T __eewr_byte_x32a4u -00004c28 T __eewr_r18_x32a4u -00004c6c T strnlen_P -00004c82 T strnlen -00004c98 T fputc -00004cfc T __ultoa_invert -00004db8 T __divmodsi4 -00004dd0 t __divmodsi4_neg2 -00004dde t __divmodsi4_exit -00004de0 T __negsi2 -00004df0 T __prologue_saves__ -00004e22 T __epilogue_restores__ -00004e52 T __udivmodsi4 -00004e5e t __udivmodsi4_loop -00004e78 t __udivmodsi4_ep -00004e96 W exit -00004e96 T _exit -00004e98 t __stop_program -00004e9a A __data_load_start -00004e9a T _etext -00004f2c A __data_load_end -00802000 D __data_start -00802000 d TerminalInitDelay -00802001 D TerminalHandle -0080201c d next -00802020 d TableC -00802040 d TableAB -00802092 B __bss_start -00802092 D __data_end -00802092 D _edata -00802092 b Memory -00802492 b LastButtonState.4250 -00802493 B LEDPulseMask -00802494 B TerminalState -00802495 b CallbackFunc -00802497 b BlockAddress -0080249b b BufferIdx -0080249d b RetryTimeout -0080249e b RetryCount -0080249f b Checksum -008024a0 b ReceivedFrameNumber -008024a1 b CurrentFrameNumber -008024a2 b State -008024a3 b BufferIdx -008024a5 b SamplePosition -008024a6 b LoadModState -008024a7 b LastBit -008024a8 b IsParityBit -008024a9 b SampleRegister -008024aa b DataRegister -008024ab b BitSent -008024ad b BitCount -008024af b ParityBufferPtr -008024b1 b CodecBufferPtr -008024b3 b Flags -008024b5 b CardSAKValue -008024b6 b CardATQAValue -008024b8 b BlockBuffer -008024c8 b CurrentAddress -008024c9 b ReaderResponse -008024cd b CardResponse -008024d1 b State -008024d2 b StateOdd -008024d5 b StateEven -008024d8 B ActiveConfiguration -008024fd B GlobalSettings -00802510 B TerminalBuffer -00802610 B CodecBuffer -00802710 B USB_Device_ConfigurationNumber -00802711 B USB_Device_CurrentlySelfPowered -00802712 B USB_Device_RemoteWakeupEnabled -00802713 B USB_IsInitialized -00802714 B USB_DeviceState -00802715 B USB_ControlRequest -0080271d B USB_Endpoint_SelectedFIFO -0080271f B USB_Endpoint_SelectedHandle -00802721 B USB_Endpoint_SelectedEndpoint -00802722 B USB_Endpoint_FIFOs -00802a3a B USB_EndpointTable -00802a9d B __bss_end -00802a9d B _end -00810000 D StoredSettings -00810013 D __eeprom_end + 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 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__ +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__ +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__ +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__ +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__ +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 +0000021a T ManufacturerString +00000234 T LanguageString +00000238 T ConfigurationDescriptor +00000276 T DeviceDescriptor +00000288 t ConfigurationTable +00000366 t ButtonActionTable +00000486 t LogModeTable +000004b6 t __c.6349 +000004b8 t LEDFuncTable +000005b8 t __c.6462 +000005f1 t __c.6464 +000005f8 t __c.6466 +000005ff t __c.6468 +00000605 t __c.6473 +00000608 t __c.6491 +0000060f t __c.6518 +00000612 t __c.6523 +00000615 t __c.6573 +0000061b t __c.6575 +00000623 t __c.6577 +00000629 t __c.6582 +0000062c t __c.6587 +00000634 t __c.6589 +0000063a t __c.6619 +00000641 T CommandTable +0000080f t __c.6126 +00000812 t __c.6128 +00000815 t StatusTable +000008dc T __ctors_end +000008dc T __ctors_start +000008dc T __dtors_end +000008dc T __dtors_start +000008dc W __init +000008dc T __trampolines_end +000008dc T __trampolines_start +000008e8 T __do_copy_data +000008fe T __do_clear_bss +00000906 t .do_clear_bss_loop +00000908 t .do_clear_bss_start +00000914 T __bad_interrupt +00000914 W __vector_1 +00000914 W __vector_100 +00000914 W __vector_101 +00000914 W __vector_102 +00000914 W __vector_103 +00000914 W __vector_104 +00000914 W __vector_105 +00000914 W __vector_106 +00000914 W __vector_107 +00000914 W __vector_108 +00000914 W __vector_109 +00000914 W __vector_11 +00000914 W __vector_110 +00000914 W __vector_111 +00000914 W __vector_112 +00000914 W __vector_113 +00000914 W __vector_114 +00000914 W __vector_115 +00000914 W __vector_116 +00000914 W __vector_117 +00000914 W __vector_118 +00000914 W __vector_119 +00000914 W __vector_12 +00000914 W __vector_120 +00000914 W __vector_121 +00000914 W __vector_122 +00000914 W __vector_123 +00000914 W __vector_124 +00000914 W __vector_126 +00000914 W __vector_13 +00000914 W __vector_14 +00000914 W __vector_15 +00000914 W __vector_16 +00000914 W __vector_17 +00000914 W __vector_18 +00000914 W __vector_19 +00000914 W __vector_2 +00000914 W __vector_20 +00000914 W __vector_21 +00000914 W __vector_23 +00000914 W __vector_24 +00000914 W __vector_25 +00000914 W __vector_26 +00000914 W __vector_27 +00000914 W __vector_28 +00000914 W __vector_29 +00000914 W __vector_3 +00000914 W __vector_30 +00000914 W __vector_31 +00000914 W __vector_32 +00000914 W __vector_33 +00000914 W __vector_35 +00000914 W __vector_36 +00000914 W __vector_37 +00000914 W __vector_38 +00000914 W __vector_39 +00000914 W __vector_4 +00000914 W __vector_40 +00000914 W __vector_41 +00000914 W __vector_42 +00000914 W __vector_43 +00000914 W __vector_44 +00000914 W __vector_45 +00000914 W __vector_46 +00000914 W __vector_47 +00000914 W __vector_48 +00000914 W __vector_49 +00000914 W __vector_5 +00000914 W __vector_50 +00000914 W __vector_51 +00000914 W __vector_52 +00000914 W __vector_53 +00000914 W __vector_54 +00000914 W __vector_55 +00000914 W __vector_56 +00000914 W __vector_57 +00000914 W __vector_58 +00000914 W __vector_59 +00000914 W __vector_6 +00000914 W __vector_60 +00000914 W __vector_61 +00000914 W __vector_62 +00000914 W __vector_63 +00000914 W __vector_64 +00000914 W __vector_65 +00000914 W __vector_66 +00000914 W __vector_67 +00000914 W __vector_68 +00000914 W __vector_69 +00000914 W __vector_7 +00000914 W __vector_70 +00000914 W __vector_71 +00000914 W __vector_72 +00000914 W __vector_73 +00000914 W __vector_74 +00000914 W __vector_75 +00000914 W __vector_76 +00000914 W __vector_77 +00000914 W __vector_78 +00000914 W __vector_79 +00000914 W __vector_8 +00000914 W __vector_80 +00000914 W __vector_81 +00000914 W __vector_82 +00000914 W __vector_84 +00000914 W __vector_85 +00000914 W __vector_86 +00000914 W __vector_87 +00000914 W __vector_88 +00000914 W __vector_89 +00000914 W __vector_9 +00000914 W __vector_90 +00000914 W __vector_91 +00000914 W __vector_92 +00000914 W __vector_93 +00000914 W __vector_94 +00000914 W __vector_95 +00000914 W __vector_96 +00000914 W __vector_97 +00000914 W __vector_98 +00000914 W __vector_99 +00000916 T main +000009a2 T CALLBACK_USB_GetDescriptor +00000a24 T __vector_default +00000a30 T __vector_10 +00000a32 T SystemInit +00000ab8 T SystemReset +00000ac6 T SystemEnterBootloader +00000ad2 T SystemStartUSBClock +00000b0e T SystemStopUSBClock +00000b34 T SystemInterruptInit +00000b40 t CodecInitDummy +00000b42 t CodecTaskDummy +00000b44 t ApplicationInitDummy +00000b46 t ApplicationResetDummy +00000b48 t ApplicationTaskDummy +00000b4a t ApplicationProcessDummy +00000b50 t ApplicationGetUidDummy +00000b52 t ApplicationSetUidDummy +00000b54 T ConfigurationSetById +00000b8a T ConfigurationInit +00000b96 T ConfigurationSetByName +00000c18 T ConfigurationGetList +00000c76 T RandomInit +00000c78 T RandomGetByte +00000c7e T RandomGetBuffer +00000c9c T RandomTick +00000cac T BufferToHexString +00000d30 T HexStringToBuffer +00000dbc T MemoryReadBlock +00000dec T MemoryWriteBlock +00000e24 T MemoryClear +00000e34 T MemoryRecall +00000f20 T MemoryInit +0000101e T MemoryStore +000012ac T MemoryUploadBlock +00001636 T MemoryDownloadBlock +000016b0 t ExecuteButtonAction +0000185a T ButtonInit +00001868 T ButtonTick +000018b2 T ButtonGetActionList +00001916 T ButtonSetActionById +00001964 T ButtonGetActionByName +0000199c T ButtonSetActionByName +00001a60 t LogFuncOff +00001a62 t LogFuncTerminal +00001a8e T LogTick +00001a90 T LogTask +00001a92 T LogMemLoadBlock +00001ac2 T LogMemClear +00001aec T LogMemFree +00001af6 T LogSetModeById +00001b36 t LogFuncMemory +00001ba4 T LogInit +00001bb2 T LogSetModeByName +00001bfc T LogGetModeByName +00001c18 T LogGetModeList +00001c68 T SettingsLoad +00001c78 T SettingsSave +00001c88 T SettingsSetActiveById +00001cec T SettingsCycle +00001e0c T SettingsGetActiveById +00001e14 T SettingsGetActiveByName +00001e28 T SettingsSetActiveByName +00001e3a T LEDInit +00001e44 T LEDTick +00001f5e T LEDTrigger +00001f7e T LEDGetFuncList +00001fe2 T LEDSetFuncById +0000208e T LEDGetFuncByName +000020c8 T LEDSetFuncByName +00002178 T TerminalSendString +00002182 T TerminalSendStringP +000021aa T TerminalSendBlock +000021b6 T TerminalInit +000021c0 T TerminalTask +00002202 T TerminalTick +00002282 T EVENT_USB_Device_Connect +00002288 T EVENT_USB_Device_Disconnect +0000228e T EVENT_USB_Device_ConfigurationChanged +00002296 T EVENT_USB_Device_ControlRequest +0000229e T CommandGetVersion +000022da T CommandGetConfig +00002306 T CommandSetConfig +00002318 T CommandExecConfig +00002324 T CommandGetUid +00002372 T CommandSetUid +00002424 T CommandGetReadOnly +00002448 T CommandSetReadOnly +00002470 T CommandExecUpload +0000247a T CommandExecDownload +00002484 T CommandExecReset +0000249a T CommandExecUpgrade +000024b0 T CommandGetMemSize +000024e0 T CommandGetUidSize +0000250c T CommandExecButton +00002516 T CommandGetButton +00002524 T CommandSetButton +00002538 T CommandExecButtonLong +00002542 T CommandGetButtonLong +00002550 T CommandSetButtonLong +00002564 T CommandExecLedGreen +0000256e T CommandGetLedGreen +0000257c T CommandSetLedGreen +00002590 T CommandExecLedRed +0000259a T CommandGetLedRed +000025a8 T CommandSetLedRed +000025bc T CommandExecLogMode +000025c6 T CommandGetLogMode +000025d0 T CommandSetLogMode +000025e0 T CommandExecLogMem +00002614 T CommandGetLogMem +00002648 T CommandSetLogMem +00002688 T CommandGetSetting +00002692 T CommandSetSetting +000026a2 T CommandExecClear +000026aa T CommandExecHelp +00002742 T CommandGetRssi +000027aa t CalcChecksum.constprop.0 +000027be T XModemReceive +000027f4 T XModemSend +00002820 T XModemProcessByte +00002ab6 T XModemTick +00002b2c T CommandLineProcessByte +00002d3a T CommandLineTick +00002d3c t StartDemod +00002db6 T __vector_34 +00002e18 T __vector_22 +00002f60 T __vector_83 +00002fff W __stack +00003142 T ISO14443ACodecInit +000031b0 T ISO14443ACodecTask +00003312 T MifareUltralightAppInit +0000331a T MifareUltralightAppReset +00003322 T MifareUltralightAppTask +00003324 T MifareUltralightAppProcess +000035c8 T MifareUltralightGetUid +000035ee T MifareUltralightSetUid +0000366c T MifareClassicAppInit1K +0000368a T MifarePlus1kAppInit_7B +000036b4 T MifareClassicAppInit4K +000036d2 T MifareClassicAppReset +000036da T MifareClassicAppTask +000036dc T MifareClassicAppProcess +00004264 T MifareClassicGetUid +000042a6 T MifareClassicSetUid +00004304 T ISO14443AAppendCRCA +00004362 T ISO14443ACheckCRCA +000043e0 t Crypto1LFSR +0000446c T Crypto1FilterOutput +000044d4 T Crypto1Setup +00004814 T Crypto1Auth +00004866 T Crypto1Byte +000048e8 T Crypto1Nibble +00004930 T Crypto1PRNG +000049e6 T USB_Device_ProcessControlRequest +00004c7c W EVENT_USB_Device_Reset +00004c7c W EVENT_USB_Device_StartOfFrame +00004c7c W EVENT_USB_Device_Suspend +00004c7c W EVENT_USB_Device_WakeUp +00004c7c T USB_Event_Stub +00004c7e T USB_USBTask +00004ca8 T Endpoint_Write_Stream_LE +00004d80 T Endpoint_Write_Control_Stream_LE +00004ec2 T Endpoint_Write_Control_PStream_LE +00005000 T Endpoint_ClearIN +00005032 T Endpoint_ClearOUT +00005050 T Endpoint_Read_8 +0000506e T Endpoint_Write_8 +0000508c T Endpoint_SelectEndpoint +000050fe T Endpoint_StallTransaction +00005136 T Endpoint_ClearSETUP +0000518e T Endpoint_IsSETUPReceived +000051c0 T Endpoint_IsOUTReceived +000051f2 T Endpoint_IsINReady +0000520a T Endpoint_ConfigureEndpoint_PRV +000052a4 T Endpoint_ConfigureEndpointTable +00005390 T Endpoint_ClearEndpoints +00005400 T Endpoint_ClearStatusStage +0000542c T Endpoint_WaitUntilReady +000054d2 T USB_Disable +000054ec T USB_ResetInterface +00005548 T USB_Init +0000559a T USB_INT_DisableAllInterrupts +000055a8 T USB_INT_ClearAllInterrupts +000055b4 T __vector_125 +0000568e T CDC_Device_ConfigureEndpoints +000056d8 T CDC_Device_SendString +0000572a T CDC_Device_SendData +0000577e T CDC_Device_SendByte +000057ec T CDC_Device_Flush +0000587c T CDC_Device_USBTask +000058b2 T CDC_Device_ReceiveByte +00005970 T CDC_Device_Event_Stub +00005970 W EVENT_CDC_Device_BreakSent +00005970 W EVENT_CDC_Device_ControLineStateChanged +00005970 W EVENT_CDC_Device_LineEncodingChanged +00005972 T CDC_Device_ProcessControlRequest +00005aac T __mulshisi3 +00005ab0 T __mulohisi3 +00005ab8 T __muluhisi3 +00005acc T __umulhisi3 +00005ae4 t do_rand +00005b7a T rand_r +00005b7c T rand +00005b82 T srand +00005b98 T memcpy_P +00005baa T strcmp_P +00005bbc T strncat_P +00005bdc T strncpy_P +00005bfa T memcpy +00005c0c T snprintf_P +00005c66 T vfprintf +00006000 T __eerd_block_x32a4u +00006016 T __eewr_block_x32a4u +00006028 T __eewr_byte_x32a4u +0000602a T __eewr_r18_x32a4u +0000606e T strnlen_P +00006084 T strnlen +0000609a T fputc +000060f2 T __ultoa_invert +000061ae T __divmodsi4 +000061c4 t __divmodsi4_neg1 +000061d4 t __divmodsi4_neg2 +000061e2 t __divmodsi4_exit +000061e4 T __prologue_saves__ +00006216 T __epilogue_restores__ +00006246 T __udivmodsi4 +00006252 t __udivmodsi4_loop +0000626c t __udivmodsi4_ep +0000628a T _exit +0000628a W exit +0000628c t __stop_program +0000628e A __data_load_start +0000628e T _etext +00006320 A __data_load_end +00802000 D __data_start +00802000 D TerminalHandle +0080201b d TerminalInitDelay +0080201c d next +00802020 d TableAB +00802070 d TableC +00802092 B __bss_start +00802092 D __data_end +00802092 D _edata +00802092 b Memory +00802492 b PressTickCounter.4306 +00802493 b LogMem +00802893 b LogMemPtr +00802895 b LogMemLeft +00802897 B LEDRedAction +00802898 B LEDGreenAction +00802899 b BlinkPrescaler.4245 +0080289a B TerminalState +0080289b b State +0080289c b CurrentFrameNumber +0080289d b RetryCount +0080289e b RetryTimeout +008028a0 b BlockAddress +008028a4 b CallbackFunc +008028a6 b BufferIdx +008028a8 b Checksum +008028a9 b ReceivedFrameNumber +008028aa b BufferIdx +008028ac b SamplePosition +008028ad b LoadModState +008028ae b LastBit +008028af b IsParityBit +008028b0 b SampleRegister +008028b1 b DataRegister +008028b2 b BitSent +008028b4 b BitCount +008028b6 b Flags +008028b8 b CodecBufferPtr +008028ba b ParityBufferPtr +008028bc b State +008028bd b CompatWritePageAddress +008028be b State +008028bf b CardATQAValue +008028c1 b CardSAKValue +008028c2 b _7BUID +008028c3 b CurrentAddress +008028c4 b ReaderResponse +008028c8 b CardResponse +008028cc b BlockBuffer +008028dc b StateOdd +008028df b StateEven +008028e2 B ActiveConfiguration +00802907 B LogFunc +00802909 B GlobalSettings +0080293c B TerminalBuffer +00802a3c B CodecBuffer +00802b3c B USB_Device_ConfigurationNumber +00802b3d B USB_Device_CurrentlySelfPowered +00802b3e B USB_Device_RemoteWakeupEnabled +00802b3f B USB_IsInitialized +00802b40 B USB_DeviceState +00802b41 B USB_ControlRequest +00802b49 B USB_Endpoint_SelectedFIFO +00802b4b B USB_Endpoint_SelectedHandle +00802b4d B USB_Endpoint_SelectedEndpoint +00802b4e B USB_Endpoint_FIFOs +00802e66 B USB_EndpointTable +00802ec9 B __bss_end +00802ec9 B _end +00810000 D StoredSettings +00810033 D __eeprom_end diff --git a/Firmware/Chameleon-Mini/Codec/Codec.c b/Firmware/Chameleon-Mini/Codec/Codec.c index 0f30957..d31ed95 100644 --- a/Firmware/Chameleon-Mini/Codec/Codec.c +++ b/Firmware/Chameleon-Mini/Codec/Codec.c @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * CODEC.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 18.02.2013 + * Author: skuser */ #include "Codec.h" diff --git a/Firmware/Chameleon-Mini/Codec/Codec.h b/Firmware/Chameleon-Mini/Codec/Codec.h index 5b001a7..714c176 100644 --- a/Firmware/Chameleon-Mini/Codec/Codec.h +++ b/Firmware/Chameleon-Mini/Codec/Codec.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * CODEC.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 18.02.2013 + * Author: skuser */ #ifndef CODEC_H_ @@ -68,12 +20,12 @@ #define CODEC_DEMOD_POWER_MASK PIN1_bm #define CODEC_DEMOD_IN_PORT PORTB #define CODEC_DEMOD_IN_MASK (CODEC_DEMOD_IN_MASK0 | CODEC_DEMOD_IN_MASK1) -#define CODEC_DEMOD_IN_MASK0 PIN0_bm -#define CODEC_DEMOD_IN_MASK1 PIN2_bm -#define CODEC_DEMOD_IN_PINCTRL0 PIN0CTRL -#define CODEC_DEMOD_IN_PINCTRL1 PIN2CTRL -#define CODEC_DEMOD_IN_EVMUX0 EVSYS_CHMUX_PORTB_PIN0_gc -#define CODEC_DEMOD_IN_EVMUX1 EVSYS_CHMUX_PORTB_PIN2_gc +#define CODEC_DEMOD_IN_MASK0 PIN2_bm +#define CODEC_DEMOD_IN_MASK1 PIN0_bm +#define CODEC_DEMOD_IN_PINCTRL0 PIN2CTRL +#define CODEC_DEMOD_IN_PINCTRL1 PIN0CTRL +#define CODEC_DEMOD_IN_EVMUX0 EVSYS_CHMUX_PORTB_PIN2_gc +#define CODEC_DEMOD_IN_EVMUX1 EVSYS_CHMUX_PORTB_PIN0_gc #define CODEC_DEMOD_IN_INT0_VECT PORTB_INT0_vect #define CODEC_LOADMOD_PORT PORTC #define CODEC_LOADMOD_MASK PIN6_bm diff --git a/Firmware/Chameleon-Mini/Codec/ISO14443-2A.c b/Firmware/Chameleon-Mini/Codec/ISO14443-2A.c index 6527171..1db5986 100644 --- a/Firmware/Chameleon-Mini/Codec/ISO14443-2A.c +++ b/Firmware/Chameleon-Mini/Codec/ISO14443-2A.c @@ -1,62 +1,16 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * ISO14443A.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 18.02.2013 + * Author: skuser */ #include "ISO14443-2A.h" #include "../System.h" #include "../Application/Application.h" +#include "../LED.h" #include "Codec.h" +#include "Log.h" /* Timing definitions for ISO14443A */ #define ISO14443A_SUBCARRIER_DIVIDER 16 @@ -133,6 +87,14 @@ static void StartDemod(void) { /* Activate Power for demodulator */ CodecSetDemodPower(true); + CodecBufferPtr = CodecBuffer; + ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; + DataRegister = 0; + SampleRegister = 0; + SamplePosition = 0; + BitCount = 0; + IsParityBit = false; + /* Configure sampling-timer free running and sync to first modulation-pause. */ CODEC_TIMER_SAMPLING.CNT = 0; CODEC_TIMER_SAMPLING.PER = SAMPLE_RATE_SYSTEM_CYCLES - 1; @@ -143,19 +105,14 @@ static void StartDemod(void) { /* Start looking out for modulation pause via interrupt. */ CODEC_DEMOD_IN_PORT.INT0MASK = CODEC_DEMOD_IN_MASK0; + SystemSleepSetMode(SYSTEM_SMODE_PSAVE); } ISR(CODEC_DEMOD_IN_INT0_VECT) { /* This is the first edge of the first modulation-pause after StartDemod. - * Now we have time to prepare our timers and variables to start + * Now we have time to start * demodulating beginning from one bit-width after this edge. */ - CodecBufferPtr = CodecBuffer; - ParityBufferPtr = &CodecBuffer[ISO14443A_BUFFER_PARITY_OFFSET]; - DataRegister = 0; - SampleRegister = 0; - SamplePosition = 0; - BitCount = 0; - IsParityBit = false; + SystemSleepSetMode(SYSTEM_SMODE_IDLE); /* Sampling timer has been preset to sample-rate and has automatically synced * to THIS first modulation pause. Thus after exactly one bit-width from here, @@ -441,6 +398,9 @@ void ISO14443ACodecTask(void) { uint16_t AnswerBitCount = ISO14443A_APP_NO_RESPONSE; if (DemodBitCount > 0) { + LogEntry(LOG_INFO_RX_DATA, CodecBuffer, (DemodBitCount+7)/8); + LEDTrigger(LED_CODEC_RX, LED_PULSE); + /* Call application if we received data */ AnswerBitCount = ApplicationProcess(CodecBuffer, DemodBitCount); @@ -461,6 +421,9 @@ void ISO14443ACodecTask(void) { } if (AnswerBitCount != ISO14443A_APP_NO_RESPONSE) { + LogEntry(LOG_INFO_TX_DATA, CodecBuffer, (AnswerBitCount + 7) / 8); + LEDTrigger(LED_CODEC_TX, LED_PULSE); + BitCount = AnswerBitCount; BitSent = 0; CodecBufferPtr = CodecBuffer; @@ -481,5 +444,7 @@ void ISO14443ACodecTask(void) { * for incoming data again. */ StartDemod(); } + + //SystemSleep(); } diff --git a/Firmware/Chameleon-Mini/Codec/ISO14443-2A.h b/Firmware/Chameleon-Mini/Codec/ISO14443-2A.h index 0fbcaa5..1f17f05 100644 --- a/Firmware/Chameleon-Mini/Codec/ISO14443-2A.h +++ b/Firmware/Chameleon-Mini/Codec/ISO14443-2A.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * ISO14443-2A.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 18.02.2013 + * Author: skuser */ #ifndef ISO14443_2A_H_ diff --git a/Firmware/Chameleon-Mini/Common.c b/Firmware/Chameleon-Mini/Common.c index 2406493..d53804d 100644 --- a/Firmware/Chameleon-Mini/Common.c +++ b/Firmware/Chameleon-Mini/Common.c @@ -1,58 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "Common.h" uint16_t BufferToHexString(char* HexOut, uint16_t MaxChars, const void* Buffer, uint16_t ByteCount) diff --git a/Firmware/Chameleon-Mini/Common.h b/Firmware/Chameleon-Mini/Common.h index 0ae3835..b0a97d9 100644 --- a/Firmware/Chameleon-Mini/Common.h +++ b/Firmware/Chameleon-Mini/Common.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Common.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 20.03.2013 + * Author: skuser */ #ifndef COMMON_H_ diff --git a/Firmware/Chameleon-Mini/Configuration.c b/Firmware/Chameleon-Mini/Configuration.c index faf2462..eb60560 100644 --- a/Firmware/Chameleon-Mini/Configuration.c +++ b/Firmware/Chameleon-Mini/Configuration.c @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Standards.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 15.02.2013 + * Author: skuser */ #include "Configuration.h" @@ -86,6 +38,23 @@ static const PROGMEM ConfigurationType ConfigurationTable[] = { .MemorySize = 0, .ReadOnly = true }, +#ifdef CONFIG_MF_ULTRALIGHT_SUPPORT + [CONFIG_MF_ULTRALIGHT] = { + .ConfigurationID = CONFIG_MF_ULTRALIGHT, + .ConfigurationName = "MF_ULTRALIGHT", + .CodecInitFunc = ISO14443ACodecInit, + .CodecTaskFunc = ISO14443ACodecTask, + .ApplicationInitFunc = MifareUltralightAppInit, + .ApplicationResetFunc = MifareUltralightAppReset, + .ApplicationTaskFunc = MifareUltralightAppTask, + .ApplicationProcessFunc = MifareUltralightAppProcess, + .ApplicationGetUidFunc = MifareUltralightGetUid, + .ApplicationSetUidFunc = MifareUltralightSetUid, + .UidSize = MIFARE_ULTRALIGHT_UID_SIZE, + .MemorySize = MIFARE_ULTRALIGHT_MEM_SIZE, + .ReadOnly = false + }, +#endif #ifdef CONFIG_MF_CLASSIC_1K_SUPPORT [CONFIG_MF_CLASSIC_1K] = { .ConfigurationID = CONFIG_MF_CLASSIC_1K, @@ -103,6 +72,23 @@ static const PROGMEM ConfigurationType ConfigurationTable[] = { .ReadOnly = false }, #endif +#ifdef CONFIG_MF_Plus1k_7B_SUPPORT +[CONFIG_MF_Plus1k_7B] = { + .ConfigurationID = CONFIG_MF_Plus1k_7B, + .ConfigurationName = "MF_PLUS1K_7B", + .CodecInitFunc = ISO14443ACodecInit, + .CodecTaskFunc = ISO14443ACodecTask, + .ApplicationInitFunc = MifarePlus1kAppInit_7B, + .ApplicationResetFunc = MifareClassicAppReset, + .ApplicationTaskFunc = MifareClassicAppTask, + .ApplicationProcessFunc = MifareClassicAppProcess, + .ApplicationGetUidFunc = MifareClassicGetUid, + .ApplicationSetUidFunc = MifareClassicSetUid, + .UidSize = ISO14443A_UID_SIZE_DOUBLE, + .MemorySize = MIFARE_CLASSIC_1K_MEM_SIZE, + .ReadOnly = false +}, +#endif #ifdef CONFIG_MF_CLASSIC_4K_SUPPORT [CONFIG_MF_CLASSIC_4K] = { .ConfigurationID = CONFIG_MF_CLASSIC_4K, @@ -120,6 +106,24 @@ static const PROGMEM ConfigurationType ConfigurationTable[] = { .ReadOnly = false }, #endif +#ifdef CONFIG_ISO14443A_SNIFF_SUPPORT + [CONFIG_ISO14443A_SNIFF] = { + .ConfigurationID = CONFIG_ISO14443A_SNIFF, + .ConfigurationName = "ISO14443A_SNIFF", + .CodecInitFunc = ISO14443ACodecInit, + .CodecTaskFunc = ISO14443ACodecTask, + .ApplicationInitFunc = ApplicationInitDummy, + .ApplicationResetFunc = ApplicationResetDummy, + .ApplicationTaskFunc = ApplicationTaskDummy, + .ApplicationProcessFunc = ApplicationProcessDummy, + .ApplicationGetUidFunc = ApplicationGetUidDummy, + .ApplicationSetUidFunc = ApplicationSetUidDummy, + .UidSize = 0, + .MemorySize = 0, + .ReadOnly = true + }, +#endif + }; ConfigurationType ActiveConfiguration; diff --git a/Firmware/Chameleon-Mini/Configuration.h b/Firmware/Chameleon-Mini/Configuration.h index 6c814b8..1e1d3bc 100644 --- a/Firmware/Chameleon-Mini/Configuration.h +++ b/Firmware/Chameleon-Mini/Configuration.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Standards.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 15.02.2013 + * Author: skuser */ #ifndef STANDARDS_H_ @@ -74,20 +26,15 @@ typedef enum { #ifdef CONFIG_MF_CLASSIC_1K_SUPPORT CONFIG_MF_CLASSIC_1K, #endif +#ifdef CONFIG_MF_Plus1k_7B_SUPPORT + CONFIG_MF_Plus1k_7B, +#endif #ifdef CONFIG_MF_CLASSIC_4K_SUPPORT CONFIG_MF_CLASSIC_4K, #endif -#ifdef CONFIG_ISO15693_GEN_SUPPORT - CONFIG_ISO15693_GEN, -#endif #ifdef CONFIG_ISO14443A_SNIFF_SUPPORT CONFIG_ISO14443A_SNIFF, #endif -#ifdef CONFIG_ISO15693_SNIFF_SUPPORT - CONFIG_ISO15693_SNIFF, -#endif - //CONFIG_MF_DESFIRE, - //CONFIG_ISO14443A_RELAY diff --git a/Firmware/Chameleon-Mini/LED.c b/Firmware/Chameleon-Mini/LED.c index d3360d6..997a19e 100644 --- a/Firmware/Chameleon-Mini/LED.c +++ b/Firmware/Chameleon-Mini/LED.c @@ -1,58 +1,201 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "LED.h" +#include "Settings.h" + +#define BLINK_PRESCALER 1 /* x LEDTick(); */ + +LEDActionEnum LEDGreenAction = LED_NO_ACTION; +LEDActionEnum LEDRedAction = LED_NO_ACTION; + +static const char PROGMEM LEDFuncTable[][32] = +{ + [LED_NO_FUNC] = "NONE", + [LED_TERMINAL_CONN] = "TERMINAL_CONN", + [LED_TERMINAL_RXTX] = "TERMINAL_RXTX", + [LED_SETTING_CHANGE] = "SETTING_CHANGE", + [LED_MEMORY_STORED] = "MEMORY_STORED", + [LED_MEMORY_CHANGED] = "MEMORY_CHANGED", + //TODO: [LED_FIELD_DETECTED] = "FIELD_DETECTED", + [LED_CODEC_RX] = "CODEC_RX", + [LED_CODEC_TX] = "CODEC_TX", + //TODO: [LED_APP_SELECTED] = "APP_SELECTED", + +}; + +INLINE void Tick(uint8_t Mask, LEDActionEnum* Action) +{ + static uint8_t BlinkPrescaler = 0; + + switch (*Action) + { + case LED_NO_ACTION: + /* Do nothing */ + break; + + case LED_OFF: + LED_PORT.OUTCLR = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_ON: + LED_PORT.OUTSET = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_TOGGLE: + LED_PORT.OUTTGL = Mask; + *Action = LED_NO_ACTION; + break; + + case LED_PULSE: + if (!(LED_PORT.OUT & Mask)) { + LED_PORT.OUTSET = Mask; + } else { + LED_PORT.OUTCLR = Mask; + *Action = LED_NO_ACTION; + } + break; + + case LED_BLINK_1X ... LED_BLINK_8X: + if (++BlinkPrescaler == BLINK_PRESCALER) { + BlinkPrescaler = 0; + /* Blink functionality occurs at slower speed than Tick-frequency */ + + if (!(LED_PORT.OUT & Mask)) { + /* LED is off, turn it on */ + LED_PORT.OUTSET = Mask; + } else { + /* LED is on, turn it off and change state */ + LED_PORT.OUTCLR = Mask; + + if (*Action == LED_BLINK_1X) { + *Action = LED_NO_ACTION; + } else { + /* Still some blinks to do. Use the fact that LED_BLINK_XY are ordered sequentially */ + *Action = *Action - 1; + } + } + } + break; + + default: + /* Should not happen (TM) */ + *Action = LED_NO_ACTION; + break; + + } +} + +void LEDInit(void) +{ + LED_PORT.DIRSET = LED_MASK; +} + + +void LEDTick(void) +{ + Tick(LED_RED, &LEDRedAction); + Tick(LED_GREEN, &LEDGreenAction); +} + +/* TODO: This would be nicer as INLINE */ +void LEDTrigger(LEDFunctionEnum Func, LEDActionEnum Action) { + if (GlobalSettings.ActiveSettingPtr->LEDGreenFunction == Func) { + LEDGreenAction = Action; + } + + if (GlobalSettings.ActiveSettingPtr->LEDRedFunction == Func) { + LEDRedAction = Action; + } +} + +void LEDGetFuncList(char* ListOut, uint16_t BufferSize) +{ + uint8_t i; + + /* Account for '\0' */ + BufferSize--; + + for (i=0; i sizeof(LEDFuncTable[i]) ) { + /* While not end-of-string and enough buffer to + * put a complete configuration name */ + *ListOut++ = c; + FuncName++; + BufferSize--; + } + + if ( i < (LED_FUNC_COUNT - 1) ) { + /* No comma on last configuration */ + *ListOut++ = ','; + BufferSize--; + } + } + + *ListOut = '\0'; +} + +void LEDSetFuncById(uint8_t Mask, LEDFunctionEnum Func) +{ +#ifndef LED_SETTING_GLOBAL + if (Mask & LED_GREEN) { + GlobalSettings.ActiveSettingPtr->LEDGreenFunction = Func; + } + + if (Mask & LED_RED) { + GlobalSettings.ActiveSettingPtr->LEDRedFunction = Func; + } +#else + /* Write LED func to all settings when using global settings */ + for (uint8_t i=0; iLEDGreenFunction], BufferSize); + } else if (Mask == LED_RED) { + strncpy_P(FuncOut, LEDFuncTable[GlobalSettings.ActiveSettingPtr->LEDRedFunction], BufferSize); + } else { + *FuncOut = '\0'; + } +} + +bool LEDSetFuncByName(uint8_t Mask, const char* FuncName) +{ + uint8_t i; + + for (i=0; i +#include "Common.h" -#define LED_PORT PORTA -#define LED_GREEN PIN5_bm -#define LED_RED PIN4_bm -#define LED_MASK (LED_GREEN | LED_RED) +#define LED_PORT PORTA +#define LED_GREEN PIN5_bm +#define LED_RED PIN4_bm +#define LED_MASK (LED_GREEN | LED_RED) -extern uint8_t LEDPulseMask; +typedef enum LEDFunctionEnum { + LED_NO_FUNC = 0, /* Don't light up the LED */ + LED_TERMINAL_CONN, /* A Terminal/USB connection has been established */ + LED_TERMINAL_RXTX, /* There is traffic on the terminal */ -static inline -void LEDInit(void) { - LED_PORT.DIRSET = LED_MASK; -} + LED_SETTING_CHANGE, /* Outputs a blink code that shows the current setting */ -static inline -void LEDSetOn(uint8_t Mask) { - LED_PORT.OUTSET = Mask; -} + LED_MEMORY_STORED, /* Blink once when memory has been stored to flash */ + LED_MEMORY_CHANGED, /* Switch LED on when card memory has changed compared to flash */ -static inline -void LEDSetOff(uint8_t Mask) { - LED_PORT.OUTCLR = Mask; -} + //TODO: LED_FIELD_DETECTED, /* Shows LED while a reader field is being detected */ -static inline -void LEDToggle(uint8_t Mask) { - LED_PORT.OUTTGL = Mask; -} + LED_CODEC_RX, /* Blink LED when receiving codec data */ + LED_CODEC_TX, /* Blink LED when transmitting codec data */ -static inline -void LEDPulse(uint8_t Mask) { - LEDPulseMask = Mask; - LED_PORT.OUTSET = Mask; -} + //TODO: LED_APP_SELECTED, /* Show LED while the correct UID has been selected and the application is active */ -static inline -void LEDTick(void) { - LED_PORT.OUTCLR = LEDPulseMask; - LEDPulseMask = 0; -} + /* Has to be last element */ + LED_FUNC_COUNT +} LEDFunctionEnum; + +typedef enum LEDActionEnum { + LED_NO_ACTION = 0x00, + LED_OFF = 0x10, + LED_ON = 0x11, + LED_TOGGLE = 0x12, + LED_PULSE = 0x13, + LED_BLINK = 0x20, + LED_BLINK_1X = 0x20, + LED_BLINK_2X, /* Have to be sequentially ordered */ + LED_BLINK_3X, + LED_BLINK_4X, + LED_BLINK_5X, + LED_BLINK_6X, + LED_BLINK_7X, + LED_BLINK_8X, +} LEDActionEnum; + +extern LEDActionEnum LEDGreenAction; +extern LEDActionEnum LEDRedAction; + +void LEDInit(void); +void LEDTick(void); + +void LEDTrigger(LEDFunctionEnum Func, LEDActionEnum Action); + +void LEDGetFuncList(char* ListOut, uint16_t BufferSize); +void LEDSetFuncById(uint8_t Mask, LEDFunctionEnum Func); +void LEDGetFuncByName(uint8_t Mask, char* FuncOut, uint16_t BufferSize); +bool LEDSetFuncByName(uint8_t Mask, const char* FuncName); #endif /* LED_H */ diff --git a/Firmware/Chameleon-Mini/Log.c b/Firmware/Chameleon-Mini/Log.c new file mode 100644 index 0000000..f362e3a --- /dev/null +++ b/Firmware/Chameleon-Mini/Log.c @@ -0,0 +1,152 @@ +#include "Log.h" +#include "Settings.h" +#include "Terminal/Terminal.h" +#include + +static uint8_t LogMem[1024]; +static uint8_t* LogMemPtr; +static uint16_t LogMemLeft; +LogFuncType LogFunc; + +static const char PROGMEM LogModeTable[][16] = { + [LOG_MODE_OFF] = "OFF", + [LOG_MODE_MEMORY] = "MEMORY", + [LOG_MODE_TERMINAL] = "TERMINAL" +}; + +static void LogFuncOff(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + /* Do nothing */ +} + +static void LogFuncMemory(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + if (LogMemLeft >= (Length + 2)) { + LogMemLeft -= Length + 2; + + uint8_t* DataPtr = (uint8_t*) Data; + + *LogMemPtr++ = (uint8_t) Entry; + *LogMemPtr++ = (uint8_t) Length; + + while(Length--) { + *LogMemPtr++ = *DataPtr++; + } + } else { + /* If memory full. Deactivate logmode */ + LogSetModeById(LOG_MODE_OFF); + } +} + +static void LogFuncTerminal(LogEntryEnum Entry, void* Data, uint8_t Length) +{ + TerminalSendByte((uint8_t) Entry); + TerminalSendByte((uint8_t) Length); + TerminalSendBlock(Data, Length); +} + +void LogInit(void) +{ + LogMemClear(); + LogSetModeById(GlobalSettings.ActiveSettingPtr->LogMode); +} + +void LogTick(void) +{ + +} + +void LogTask(void) +{ + +} + +bool LogMemLoadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) +{ + if (BlockAddress < sizeof(LogMem)) { + uint8_t* DataPtr = (uint8_t*) Buffer; + uint8_t* MemPtr = &LogMem[BlockAddress]; + + while(ByteCount-- > 0) { + *DataPtr++ = *MemPtr++; + } + + return true; + } else { + return false; + } +} + +void LogMemClear(void) +{ + uint16_t i; + + for (i=0; iLogMode = Mode; + + switch(Mode) { + case LOG_MODE_OFF: + LogFunc = LogFuncOff; + break; + + case LOG_MODE_MEMORY: + LogFunc = LogFuncMemory; + break; + + case LOG_MODE_TERMINAL: + LogFunc = LogFuncTerminal; + break; + + default: + break; + } + +} + +bool LogSetModeByName(const char* Name) +{ + uint8_t i; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + if (strcmp_P(Name, LogModeTable[i]) == 0) { + LogSetModeById(i); + return true; + } + } + + return false; +} + +void LogGetModeByName(char* Name, uint16_t BufferSize) +{ + strncpy_P(Name, LogModeTable[GlobalSettings.ActiveSettingPtr->LogMode], BufferSize); +} + +void LogGetModeList(char* List, uint16_t BufferSize) +{ + uint8_t i; + + *List = '\0'; + + for (i=0; i<(sizeof(LogModeTable) / sizeof(*LogModeTable)); i++) { + strncat_P(List, LogModeTable[i], BufferSize); + + if (i < (sizeof(LogModeTable) / sizeof(*LogModeTable) - 1)) { + strncat_P(List, PSTR(","), BufferSize); + } + } +} diff --git a/Firmware/Chameleon-Mini/Log.h b/Firmware/Chameleon-Mini/Log.h new file mode 100644 index 0000000..fa30f95 --- /dev/null +++ b/Firmware/Chameleon-Mini/Log.h @@ -0,0 +1,49 @@ +#ifndef LOG_H_ +#define LOG_H_ + +#include "Common.h" + +typedef enum { + /* Generic */ + LOG_INFO_GENERIC = 0x10, + LOG_INFO_CONFIG_CHANGED = 0x11, + + /* Codec */ + LOG_INFO_RX_DATA = 0x20, + LOG_INFO_TX_DATA = 0x21, + + /* App */ + LOG_INFO_APP_RESET = 0x30, + LOG_ERR_APP_AUTH_FAIL = 0x31, + LOG_ERR_APP_CHECKSUM_FAIL = 0x32, + + LOG_EMPTY = 0xFF +} LogEntryEnum; + +typedef enum { + LOG_MODE_OFF, + LOG_MODE_MEMORY, + LOG_MODE_TERMINAL +} LogModeEnum; + +typedef void (*LogFuncType) (LogEntryEnum Entry, void* Data, uint8_t Length); + +extern LogFuncType LogFunc; + +void LogInit(void); +void LogTick(void); +void LogTask(void); + +void LogMemClear(void); +uint16_t LogMemFree(void); +/* XModem callback */ +bool LogMemLoadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount); + +void LogSetModeById(LogModeEnum Mode); +bool LogSetModeByName(const char* Name); +void LogGetModeByName(char* Name, uint16_t BufferSize); +void LogGetModeList(char* List, uint16_t BufferSize); + +INLINE void LogEntry(LogEntryEnum Entry, void* Data, uint8_t Length) { LogFunc(Entry, Data, Length); } + +#endif /* LOG_H_ */ diff --git a/Firmware/Chameleon-Mini/Makefile b/Firmware/Chameleon-Mini/Makefile index 11c3204..2978a11 100644 --- a/Firmware/Chameleon-Mini/Makefile +++ b/Firmware/Chameleon-Mini/Makefile @@ -1,57 +1,3 @@ -# Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL -# AUTHORS"). All rights reserved. -# -# DEFINITIONS: -# -# "WORK": The material covered by this license includes the schematic -# diagrams, designs, circuit or circuit board layouts, mechanical -# drawings, documentation (in electronic or printed form), source code, -# binary software, data files, assembled devices, and any additional -# material provided by the ORIGINAL AUTHORS in the ChameleonMini project -# (https://github.com/skuep/ChameleonMini). -# -# LICENSE TERMS: -# -# Redistributions and use of this WORK, with or without modification, or -# of substantial portions of this WORK are permitted provided that the -# following conditions are met: -# -# Redistributions and use of this WORK, with or without modification, or -# of substantial portions of this WORK must include the above copyright -# notice, this list of conditions, the below disclaimer, and the following -# attribution: -# -# "Based on ChameleonMini an open-source RFID emulator: -# https://github.com/skuep/ChameleonMini" -# -# The attribution must be clearly visible to a user, for example, by being -# printed on the circuit board and an enclosure, and by being displayed by -# software (both in binary and source code form). -# -# At any time, the majority of the ORIGINAL AUTHORS may decide to give -# written permission to an entity to use or redistribute the WORK (with or -# without modification) WITHOUT having to include the above copyright -# notice, this list of conditions, the below disclaimer, and the above -# attribution. -# -# DISCLAIMER: -# -# THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF -# THE POSSIBILITY OF SUCH DAMAGE. -# -# The views and conclusions contained in the hardware, software, and -# documentation should not be interpreted as representing official -# policies, either expressed or implied, of the ORIGINAL AUTHORS. - # This makefile uses sh in order to build the project. # Note when using AVR-Toolchain, you have to install cygwin and # append cygwin's bin directory to the PATH environment variable @@ -60,41 +6,83 @@ SHELL = /bin/sh #Supported configurations SETTINGS += -DCONFIG_MF_CLASSIC_1K_SUPPORT +SETTINGS += -DCONFIG_MF_Plus1k_7B_SUPPORT SETTINGS += -DCONFIG_MF_CLASSIC_4K_SUPPORT +SETTINGS += -DCONFIG_MF_ULTRALIGHT_SUPPORT +SETTINGS += -DCONFIG_ISO14443A_SNIFF_SUPPORT + +#Support magic mode on mifare classic configuration +SETTINGS += -DSUPPORT_MF_CLASSIC_MAGIC_MODE #Support activating firmware upgrade mode through command-line SETTINGS += -DSUPPORT_FIRMWARE_UPGRADE #Default configuration +#SETTINGS += -DDEFAULT_CONFIGURATION=CONFIG_MF_Plus1k_7B +#SETTINGS += -DDEFAULT_CONFIGURATION=CONFIG_MF_CLASSIC_1K +#SETTINGS += -DDEFAULT_CONFIGURATION=CONFIG_MF_CLASSIC_4K +#SETTINGS += -DDEFAULT_CONFIGURATION=CONFIG_MF_ULTRALIGHT SETTINGS += -DDEFAULT_CONFIGURATION=CONFIG_NONE -#Default button action +#Default button actions #SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_UID_RANDOM #SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_UID_LEFT_INCREMENT #SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_UID_RIGHT_INCREMENT #SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_UID_LEFT_DECREMENT #SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_UID_RIGHT_DECREMENT SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_CYCLE_SETTINGS +#SETTINGS += -DDEFAULT_BUTTON_ACTION=BUTTON_ACTION_STORE_MEM +SETTINGS += -DDEFAULT_BUTTON_LONG_ACTION=BUTTON_ACTION_RECALL_MEM + +#Define if button action setting should be independent of active setting +SETTINGS += -DBUTTON_SETTING_GLOBAL + +#Default LED functions + +#SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_TERMINAL_CONN +#SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_TERMINAL_RXTX +SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_SETTING_CHANGE +#SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_MEMORY_STORED +#SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_MEMORY_CHANGED +#SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_CODEC_RX +#SETTINGS += -DDEFAULT_RED_LED_ACTION=LED_CODEC_TX + +SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_TERMINAL_CONN +#SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_TERMINAL_RXTX +#SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_SETTING_CHANGE +#SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_MEMORY_STORED +#SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_MEMORY_CHANGED +#SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_CODEC_RX +#SETTINGS += -DDEFAULT_GREEN_LED_ACTION=LED_CODEC_TX + + +#Define if LED function setting should be independent of active setting +SETTINGS += -DLED_SETTING_GLOBAL + +#Default logging mode +SETTINGS += -DDEFAULT_LOG_MODE=LOG_MODE_OFF +#SETTINGS += -DDEFAULT_LOG_MODE=LOG_MODE_MEMORY +#SETTINGS += -DDEFAULT_LOG_MODE=LOG_MODE_TERMINAL #Default setting -SETTINGS += -DDEFAULT_SETTING=0 +SETTINGS += -DDEFAULT_SETTING=SETTINGS_FIRST #Use EEPROM to store settings SETTINGS += -DENABLE_EEPROM_SETTINGS #Build configuration BUILD_DATE = $(shell date +'\"%y%m%d\"') -MCU = atxmega32a4u +MCU = atxmega32a4u #atxmega128a4u ARCH = XMEGA BOARD = NONE F_CPU = 32000000 F_USB = 48000000 TARGET = Chameleon-Mini OPTIMIZATION = 3 -SRC += $(TARGET).c LUFADescriptors.c System.c Configuration.c Random.c Common.c Memory.c Button.c Settings.c LED.c +SRC += $(TARGET).c LUFADescriptors.c System.c Configuration.c Random.c Common.c Memory.c Button.c Log.c Settings.c LED.c SRC += Terminal/Terminal.c Terminal/Commands.c Terminal/XModem.c Terminal/CommandLine.c SRC += Codec/Codec.c Codec/ISO14443-2A.c -SRC += Application/MifareClassic.c Application/ISO14443-3A.c Application/Crypto1.c +SRC += Application/MifareUltralight.c Application/MifareClassic.c Application/ISO14443-3A.c Application/Crypto1.c SRC += $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) LUFA_PATH = ../LUFA CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -DBUILD_DATE=$(BUILD_DATE) $(SETTINGS) diff --git a/Firmware/Chameleon-Mini/Memory.c b/Firmware/Chameleon-Mini/Memory.c index 936f537..0a24fe7 100644 --- a/Firmware/Chameleon-Mini/Memory.c +++ b/Firmware/Chameleon-Mini/Memory.c @@ -1,63 +1,15 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Flash.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 20.03.2013 + * Author: skuser */ - #include "Memory.h" #include "Configuration.h" #include "Common.h" #include "Settings.h" +#include "LED.h" #define FLASH_CMD_STATUS_REG_READ 0xD7 #define FLASH_CMD_MEM_TO_BUF1 0x53 @@ -203,6 +155,7 @@ INLINE void FlashWrite(const void* Buffer, uint32_t Address, uint16_t ByteCount) ByteCount -= PageBytes; Address += PageBytes; + Buffer += PageBytes; } } @@ -228,9 +181,9 @@ void MemoryInit(void) MEMORY_FLASH_PORT.DIRSET = MEMORY_FLASH_SCK | MEMORY_FLASH_MOSI | MEMORY_FLASH_CS; - MEMORY_FLASH_USART.BAUDCTRLA = 0; + MEMORY_FLASH_USART.BAUDCTRLA = 15;//0; MEMORY_FLASH_USART.BAUDCTRLB = 0; - MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; + MEMORY_FLASH_USART.CTRLC = USART_CMODE_MSPI_gc; // | USART_CHSIZE_8BIT_gc; MEMORY_FLASH_USART.CTRLB = USART_RXEN_bm | USART_TXEN_bm; @@ -267,6 +220,8 @@ void MemoryWriteBlock(const void* Buffer, uint16_t Address, uint16_t ByteCount) while(ByteCount--) { *DstPtr++ = *SrcPtr++; } + + LEDTrigger(LED_MEMORY_CHANGED, LED_ON); } void MemoryClear(void) @@ -279,13 +234,16 @@ void MemoryClear(void) void MemoryRecall(void) { /* Recall memory from permanent flash */ - FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + FlashRead(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); } void MemoryStore(void) { /* Store current memory into permanent flash */ - FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + FlashWrite(Memory, (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING, MEMORY_SIZE_PER_SETTING); + + LEDTrigger(LED_MEMORY_CHANGED, LED_OFF); + LEDTrigger(LED_MEMORY_STORED, LED_PULSE); } bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) @@ -296,7 +254,7 @@ bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount) } else { /* Calculate bytes left in memory and start writing */ uint32_t BytesLeft = MEMORY_SIZE_PER_SETTING - BlockAddress; - uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSetting * MEMORY_SIZE_PER_SETTING; + uint32_t FlashAddress = (uint32_t) BlockAddress + (uint32_t) GlobalSettings.ActiveSettingIdx * MEMORY_SIZE_PER_SETTING; ByteCount = MIN(ByteCount, BytesLeft); /* Store into flash */ @@ -336,4 +294,5 @@ bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount return true; } -} \ No newline at end of file +} + diff --git a/Firmware/Chameleon-Mini/Memory.h b/Firmware/Chameleon-Mini/Memory.h index e492dc7..ec54dc6 100644 --- a/Firmware/Chameleon-Mini/Memory.h +++ b/Firmware/Chameleon-Mini/Memory.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Flash.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 20.03.2013 + * Author: skuser */ #ifndef MEMORY_H_ @@ -81,4 +33,3 @@ bool MemoryUploadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount); bool MemoryDownloadBlock(void* Buffer, uint32_t BlockAddress, uint16_t ByteCount); #endif /* MEMORY_H_ */ - diff --git a/Firmware/Chameleon-Mini/ProgramViaBootloader.bat b/Firmware/Chameleon-Mini/ProgramViaBootloader.bat index 7c2e602..0818b8b 100644 --- a/Firmware/Chameleon-Mini/ProgramViaBootloader.bat +++ b/Firmware/Chameleon-Mini/ProgramViaBootloader.bat @@ -1,6 +1,11 @@ @ECHO OFF + +REM This script programs the Chameleon using batchisp (Atmel Flip) and DFU (device firmware upgrade via USB) +REM You need to install Flip, otherwise it does not work +REM Make sure to adjust the COMPORT variable to the actual com port the CDC Device enumerates as +REM This is necessary to send the upgrade command and thus set the chameleon into DFU mode + SET COMPORT=COM5 -SET BATCHISP=C:\Programme\Atmel\Flip 3.4.7\bin SET TIMEOUT=5 SET COMMAND=UPGRADE @@ -13,5 +18,4 @@ ECHO Waiting for DFU Bootloader ping 127.0.0.1 -n %TIMEOUT% -w 1000 > nul ECHO Start Programming -SET PATH=%BATCHISP%;%PATH% make dfu-flip diff --git a/Firmware/Chameleon-Mini/README.txt b/Firmware/Chameleon-Mini/README.txt new file mode 100644 index 0000000..1d264bc --- /dev/null +++ b/Firmware/Chameleon-Mini/README.txt @@ -0,0 +1,9 @@ +== Compiling the firmware == +For compiling under windows you need to do the following: +1. Install AVR GNU Toolchain from Atmel +2. Install Cygwin for sh.exe (base installation is sufficient) +3. Add the bin path of cygwin (containing sh.exe) to the PATH environment variable for MAKE to find it + +Then you should be good to go to build the firmware by typing in the following: +> make + diff --git a/Firmware/Chameleon-Mini/Random.c b/Firmware/Chameleon-Mini/Random.c index 74bb572..697c351 100644 --- a/Firmware/Chameleon-Mini/Random.c +++ b/Firmware/Chameleon-Mini/Random.c @@ -1,58 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "Random.h" #include diff --git a/Firmware/Chameleon-Mini/Random.h b/Firmware/Chameleon-Mini/Random.h index a40f086..de778a9 100644 --- a/Firmware/Chameleon-Mini/Random.h +++ b/Firmware/Chameleon-Mini/Random.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Random.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 22.03.2013 + * Author: skuser */ #ifndef RANDOM_H_ diff --git a/Firmware/Chameleon-Mini/Settings.c b/Firmware/Chameleon-Mini/Settings.c index 9dbe8ae..6be3d03 100644 --- a/Firmware/Chameleon-Mini/Settings.c +++ b/Firmware/Chameleon-Mini/Settings.c @@ -1,71 +1,25 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "Settings.h" #include #include "Configuration.h" +#include "Log.h" #include "Memory.h" +#include "LED.h" + +#define SETTING_TO_INDEX(S) (S - SETTINGS_FIRST) +#define INDEX_TO_SETTING(I) (I + SETTINGS_FIRST) SettingsType GlobalSettings; SettingsType EEMEM StoredSettings = { - .ActiveSetting = DEFAULT_SETTING, - .ActiveSettingPtr = &GlobalSettings.Settings[DEFAULT_SETTING], + .ActiveSettingIdx = SETTING_TO_INDEX(DEFAULT_SETTING), + .ActiveSettingPtr = &GlobalSettings.Settings[SETTING_TO_INDEX(DEFAULT_SETTING)], .Settings = { [0 ... (SETTINGS_COUNT-1)] = { .Configuration = DEFAULT_CONFIGURATION, .ButtonAction = DEFAULT_BUTTON_ACTION, + .ButtonLongAction = DEFAULT_BUTTON_LONG_ACTION, + .LogMode = DEFAULT_LOG_MODE, + .LEDRedFunction = DEFAULT_RED_LED_ACTION, + .LEDGreenFunction = DEFAULT_GREEN_LED_ACTION } } }; @@ -81,37 +35,48 @@ void SettingsSave(void) { void SettingsCycle(void) { uint8_t i = SETTINGS_COUNT; - uint8_t Setting = GlobalSettings.ActiveSetting; + uint8_t SettingIdx = GlobalSettings.ActiveSettingIdx; while (i-- > 0) { - Setting = (Setting + 1) % SETTINGS_COUNT; + /* Try to set one of the SETTINGS_COUNT following settings. + * But only set if it is not CONFIG_NONE. */ + SettingIdx = (SettingIdx + 1) % SETTINGS_COUNT; - if (GlobalSettings.Settings[Setting].Configuration != CONFIG_NONE) { - SettingsSetActiveById(Setting); + if (GlobalSettings.Settings[SettingIdx].Configuration != CONFIG_NONE) { + SettingsSetActiveById(INDEX_TO_SETTING(SettingIdx)); break; } } } -void SettingsSetActiveById(uint8_t Setting) { - if (Setting < SETTINGS_COUNT) { +bool SettingsSetActiveById(uint8_t Setting) { + if ( (Setting >= SETTINGS_FIRST) && (Setting <= SETTINGS_LAST) ) { + uint8_t SettingIdx = SETTING_TO_INDEX(Setting); /* Store current memory contents permanently */ MemoryStore(); - - GlobalSettings.ActiveSetting = Setting; + + GlobalSettings.ActiveSettingIdx = SettingIdx; GlobalSettings.ActiveSettingPtr = - &GlobalSettings.Settings[GlobalSettings.ActiveSetting]; + &GlobalSettings.Settings[SettingIdx]; /* Settings have changed. Progress changes through system */ ConfigurationInit(); - + LogInit(); + /* Recall new memory contents */ MemoryRecall(); + + /* Notify LED. blink according to current setting */ + LEDTrigger(LED_SETTING_CHANGE, LED_BLINK + SettingIdx); + + return true; + } else { + return false; } } uint8_t SettingsGetActiveById(void) { - return GlobalSettings.ActiveSetting; + return INDEX_TO_SETTING(GlobalSettings.ActiveSettingIdx); } void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize) { @@ -122,9 +87,8 @@ void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize) { bool SettingsSetActiveByName(const char* Setting) { uint8_t SettingNr = Setting[0] - '0'; - if ((Setting[1] == '\0') && (SettingNr < SETTINGS_COUNT)) { - SettingsSetActiveById(SettingNr); - return true; + if (Setting[1] == '\0') { + return SettingsSetActiveById(SettingNr); } else { return false; } diff --git a/Firmware/Chameleon-Mini/Settings.h b/Firmware/Chameleon-Mini/Settings.h index 59e675e..f8ce4dc 100644 --- a/Firmware/Chameleon-Mini/Settings.h +++ b/Firmware/Chameleon-Mini/Settings.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * Settings.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 21.12.2013 + * Author: skuser */ #ifndef SETTINGS_H_ @@ -58,16 +10,24 @@ #include "Button.h" #include "Configuration.h" +#include "Log.h" +#include "LED.h" #define SETTINGS_COUNT 8 +#define SETTINGS_FIRST 1 +#define SETTINGS_LAST (SETTINGS_FIRST + SETTINGS_COUNT - 1) typedef struct { ButtonActionEnum ButtonAction; + ButtonActionEnum ButtonLongAction; + LogModeEnum LogMode; ConfigurationEnum Configuration; + LEDFunctionEnum LEDRedFunction; + LEDFunctionEnum LEDGreenFunction; } SettingsEntryType; typedef struct { - uint8_t ActiveSetting; + uint8_t ActiveSettingIdx; SettingsEntryType* ActiveSettingPtr; SettingsEntryType Settings[SETTINGS_COUNT]; } SettingsType; @@ -78,7 +38,7 @@ void SettingsLoad(void); void SettingsSave(void); void SettingsCycle(void); -void SettingsSetActiveById(uint8_t Setting); +bool SettingsSetActiveById(uint8_t Setting); uint8_t SettingsGetActiveById(void); void SettingsGetActiveByName(char* SettingOut, uint16_t BufferSize); bool SettingsSetActiveByName(const char* Setting); diff --git a/Firmware/Chameleon-Mini/System.c b/Firmware/Chameleon-Mini/System.c index f21bcfa..db5b42a 100644 --- a/Firmware/Chameleon-Mini/System.c +++ b/Firmware/Chameleon-Mini/System.c @@ -1,71 +1,21 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * System.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 10.02.2013 + * Author: skuser */ #include "System.h" #include "LED.h" - -/* AVR Toolchain changed defines */ -#ifndef WDT_PER_500CLK_gc -#define WDT_PER_500CLK_gc WDT_PER_512CLK_gc -#endif +#include ISR(BADISR_vect) { while(1); } +EMPTY_INTERRUPT(RTC_OVF_vect); + void SystemInit(void) { if (RST.STATUS & RST_WDRF_bm) { @@ -96,9 +46,14 @@ void SystemInit(void) TCE0.PER = F_CPU / 256 / SYSTEM_TICK_FREQ - 1; TCE0.CTRLA = TC_CLKSEL_DIV256_gc; - /* Enable RTC with roughly 1kHz clock */ + /* Enable RTC with roughly 1kHz clock for system tick + * and to wake up while sleeping. */ CLK.RTCCTRL = CLK_RTCSRC_ULP_gc | CLK_RTCEN_bm; + RTC.PER = 1000 / SYSTEM_TICK_FREQ - 1; + RTC.COMP = 1000 / SYSTEM_TICK_FREQ - 1; RTC.CTRL = RTC_PRESCALER_DIV1_gc; + RTC.INTCTRL = RTC_OVFINTLVL_LO_gc; + /* Enable EEPROM data memory mapping */ NVM.CTRLB |= NVM_EEMAPEN_bm; @@ -121,6 +76,8 @@ void SystemEnterBootloader(void) void SystemStartUSBClock(void) { + SystemSleepDisable(); + /* 48MHz USB Clock using 12MHz XTAL */ OSC.XOSCCTRL = OSC_FRQRANGE_12TO16_gc | OSC_XOSCSEL_XTAL_16KCLK_gc; OSC.CTRL |= OSC_XOSCEN_bm; @@ -136,6 +93,8 @@ void SystemStartUSBClock(void) void SystemStopUSBClock(void) { + SystemSleepEnable(); + /* Disable USB Clock to minimize power consumption */ CLK.USBCTRL &= ~CLK_USBSEN_bm; OSC.CTRL &= ~OSC_PLLEN_bm; @@ -148,3 +107,4 @@ void SystemInterruptInit(void) PMIC.CTRL = PMIC_LOLVLEN_bm | PMIC_MEDLVLEN_bm | PMIC_HILVLEN_bm; sei(); } + diff --git a/Firmware/Chameleon-Mini/System.h b/Firmware/Chameleon-Mini/System.h index 63f7c74..240036f 100644 --- a/Firmware/Chameleon-Mini/System.h +++ b/Firmware/Chameleon-Mini/System.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * System.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 10.02.2013 + * Author: skuser */ #ifndef SYSTEM_H @@ -72,6 +24,9 @@ typedef uint16_t SystemRTCType; #define SYSTEM_TICK_FREQ 10 #define SYSTEM_TICK_MS (1000/SYSTEM_TICK_FREQ) +#define SYSTEM_SMODE_PSAVE SLEEP_SMODE_PSAVE_gc +#define SYSTEM_SMODE_IDLE SLEEP_SMODE_IDLE_gc + void SystemInit(void); void SystemReset(void); void SystemEnterBootloader(void); @@ -79,23 +34,42 @@ void SystemStartUSBClock(void); void SystemStopUSBClock(void); void SystemInterruptInit(void); INLINE bool SystemTick100ms(void); -INLINE SystemRTCType SystemGetRTC(void); - - -INLINE SystemRTCType SystemGetRTC(void) -{ - return RTC.CNT; -} +INLINE void SystemSleep(void); +INLINE void SystemSleepEnable(void); +INLINE void SystemSleepDisable(void); +INLINE void SystemSleepSetMode(uint8_t SleepMode); INLINE bool SystemTick100ms(void) { - if (TCE0.INTFLAGS & TC0_OVFIF_bm) { - TCE0.INTFLAGS = TC0_OVFIF_bm; + if (RTC.INTFLAGS & RTC_COMPIF_bm) { + while(RTC.STATUS & RTC_SYNCBUSY_bm) + ; - return true; + RTC.INTFLAGS = RTC_COMPIF_bm; + return true; } return false; } +INLINE void SystemSleep(void) +{ + asm volatile("sleep"); +} + +INLINE void SystemSleepEnable(void) +{ + SLEEP.CTRL |= SLEEP_SEN_bm; +} + +INLINE void SystemSleepDisable(void) +{ + SLEEP.CTRL &= ~SLEEP_SEN_bm; +} + +INLINE void SystemSleepSetMode(uint8_t SleepMode) +{ + SLEEP.CTRL = (SLEEP.CTRL & ~SLEEP_SMODE_gm) | SleepMode; +} + #endif /* SYSTEM_H */ diff --git a/Firmware/Chameleon-Mini/Terminal/CommandLine.c b/Firmware/Chameleon-Mini/Terminal/CommandLine.c index 5c49777..0ffc6a8 100644 --- a/Firmware/Chameleon-Mini/Terminal/CommandLine.c +++ b/Firmware/Chameleon-Mini/Terminal/CommandLine.c @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * CommandLine.c * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 04.05.2013 + * Author: skuser */ #include "CommandLine.h" @@ -152,6 +104,36 @@ const PROGMEM CommandEntryType CommandTable[] = { .SetFunc = CommandSetButton, .GetFunc = CommandGetButton }, + { + .Command = COMMAND_BUTTON_LONG, + .ExecFunc = CommandExecButtonLong, + .SetFunc = CommandSetButtonLong, + .GetFunc = CommandGetButtonLong + }, + { + .Command = COMMAND_LEDGREEN, + .ExecFunc = CommandExecLedGreen, + .SetFunc = CommandSetLedGreen, + .GetFunc = CommandGetLedGreen + }, + { + .Command = COMMAND_LEDRED, + .ExecFunc = CommandExecLedRed, + .SetFunc = CommandSetLedRed, + .GetFunc = CommandGetLedRed + }, + { + .Command = COMMAND_LOGMODE, + .ExecFunc = CommandExecLogMode, + .SetFunc = CommandSetLogMode, + .GetFunc = CommandGetLogMode + }, + { + .Command = COMMAND_LOGMEM, + .ExecFunc = CommandExecLogMem, + .SetFunc = CommandSetLogMem, + .GetFunc = CommandGetLogMem + }, { .Command = COMMAND_SETTING, .ExecFunc = NO_FUNCTION, diff --git a/Firmware/Chameleon-Mini/Terminal/CommandLine.h b/Firmware/Chameleon-Mini/Terminal/CommandLine.h index aee76dd..230b6de 100644 --- a/Firmware/Chameleon-Mini/Terminal/CommandLine.h +++ b/Firmware/Chameleon-Mini/Terminal/CommandLine.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * CommandLine.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 04.05.2013 + * Author: skuser */ #ifndef COMMANDLINE_H_ diff --git a/Firmware/Chameleon-Mini/Terminal/Commands.c b/Firmware/Chameleon-Mini/Terminal/Commands.c index e49f665..60837f9 100644 --- a/Firmware/Chameleon-Mini/Terminal/Commands.c +++ b/Firmware/Chameleon-Mini/Terminal/Commands.c @@ -1,57 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ #include "Commands.h" #include @@ -226,14 +172,14 @@ CommandStatusIdType CommandExecButton(char* OutMessage) CommandStatusIdType CommandGetButton(char* OutParam) { - ButtonGetActionByName(OutParam, TERMINAL_BUFFER_SIZE); + ButtonGetActionByName(BUTTON_PRESS_SHORT, OutParam, TERMINAL_BUFFER_SIZE); return COMMAND_INFO_OK_WITH_TEXT_ID; } CommandStatusIdType CommandSetButton(const char* InParam) { - if (ButtonSetActionByName(InParam)) { + if (ButtonSetActionByName(BUTTON_PRESS_SHORT, InParam)) { SettingsSave(); return COMMAND_INFO_OK_ID; } else { @@ -241,6 +187,134 @@ CommandStatusIdType CommandSetButton(const char* InParam) } } +CommandStatusIdType CommandExecButtonLong(char* OutMessage) +{ + ButtonGetActionList(OutMessage, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandGetButtonLong(char* OutParam) +{ + ButtonGetActionByName(BUTTON_PRESS_LONG, OutParam, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandSetButtonLong(const char* InParam) +{ + if (ButtonSetActionByName(BUTTON_PRESS_LONG, InParam)) { + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + +CommandStatusIdType CommandExecLedGreen(char* OutMessage) +{ + LEDGetFuncList(OutMessage, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandGetLedGreen(char* OutParam) +{ + LEDGetFuncByName(LED_GREEN, OutParam, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandSetLedGreen(const char* InParam) +{ + if (LEDSetFuncByName(LED_GREEN, InParam)) { + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + +CommandStatusIdType CommandExecLedRed(char* OutMessage) +{ + LEDGetFuncList(OutMessage, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandGetLedRed(char* OutParam) +{ + LEDGetFuncByName(LED_RED, OutParam, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandSetLedRed(const char* InParam) +{ + if (LEDSetFuncByName(LED_RED, InParam)) { + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + +CommandStatusIdType CommandExecLogMode(char* OutMessage) +{ + /* Get list of log modes */ + LogGetModeList(OutMessage, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandGetLogMode(char* OutParam) +{ + /* Get Logmode */ + LogGetModeByName(OutParam, TERMINAL_BUFFER_SIZE); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandSetLogMode(const char* InParam) +{ + if (LogSetModeByName(InParam)) { + SettingsSave(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + +CommandStatusIdType CommandExecLogMem(char* OutMessage) +{ + snprintf_P(OutMessage, TERMINAL_BUFFER_SIZE, + PSTR("%S,%S"), PSTR(COMMAND_LOGMEM_LOADBIN), PSTR(COMMAND_LOGMEM_CLEAR) ); + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandGetLogMem(char* OutParam) +{ + snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, + PSTR("%u"), LogMemFree()); + + + return COMMAND_INFO_OK_WITH_TEXT_ID; +} + +CommandStatusIdType CommandSetLogMem(const char* InParam) +{ + if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_LOADBIN)) == 0) { + XModemSend(LogMemLoadBlock); + return COMMAND_INFO_XMODEM_WAIT_ID; + } else if (strcmp_P(InParam, PSTR(COMMAND_LOGMEM_CLEAR)) == 0) { + LogMemClear(); + return COMMAND_INFO_OK_ID; + } else { + return COMMAND_ERR_INVALID_PARAM_ID; + } +} + CommandStatusIdType CommandGetSetting(char* OutParam) { SettingsGetActiveByName(OutParam, TERMINAL_BUFFER_SIZE); diff --git a/Firmware/Chameleon-Mini/Terminal/Commands.h b/Firmware/Chameleon-Mini/Terminal/Commands.h index 2ca30d7..f0da172 100644 --- a/Firmware/Chameleon-Mini/Terminal/Commands.h +++ b/Firmware/Chameleon-Mini/Terminal/Commands.h @@ -1,57 +1,4 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ + #ifndef COMMANDS_H_ #define COMMANDS_H_ @@ -135,6 +82,33 @@ CommandStatusIdType CommandExecButton(char* OutMessage); CommandStatusIdType CommandGetButton(char* OutParam); CommandStatusIdType CommandSetButton(const char* InParam); +#define COMMAND_BUTTON_LONG "BUTTON_LONG" +CommandStatusIdType CommandExecButtonLong(char* OutMessage); +CommandStatusIdType CommandGetButtonLong(char* OutParam); +CommandStatusIdType CommandSetButtonLong(const char* InParam); + +#define COMMAND_LEDGREEN "LEDGREEN" +CommandStatusIdType CommandExecLedGreen(char* OutMessage); +CommandStatusIdType CommandGetLedGreen(char* OutParam); +CommandStatusIdType CommandSetLedGreen(const char* InParam); + +#define COMMAND_LEDRED "LEDRED" +CommandStatusIdType CommandExecLedRed(char* OutMessage); +CommandStatusIdType CommandGetLedRed(char* OutParam); +CommandStatusIdType CommandSetLedRed(const char* InParam); + +#define COMMAND_LOGMODE "LOGMODE" +CommandStatusIdType CommandExecLogMode(char* OutMessage); +CommandStatusIdType CommandGetLogMode(char* OutParam); +CommandStatusIdType CommandSetLogMode(const char* InParam); + +#define COMMAND_LOGMEM "LOGMEM" +#define COMMAND_LOGMEM_LOADBIN "LOADBIN" +#define COMMAND_LOGMEM_CLEAR "CLEAR" +CommandStatusIdType CommandExecLogMem(char* OutMessage); +CommandStatusIdType CommandGetLogMem(char* OutParam); +CommandStatusIdType CommandSetLogMem(const char* InParam); + #define COMMAND_SETTING "SETTING" CommandStatusIdType CommandGetSetting(char* OutParam); CommandStatusIdType CommandSetSetting(const char* InParam); diff --git a/Firmware/Chameleon-Mini/Terminal/Terminal.c b/Firmware/Chameleon-Mini/Terminal/Terminal.c index 5e20bd0..d1360a9 100644 --- a/Firmware/Chameleon-Mini/Terminal/Terminal.c +++ b/Firmware/Chameleon-Mini/Terminal/Terminal.c @@ -1,57 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ #include "Terminal.h" #include "../System.h" @@ -121,7 +67,7 @@ static void ProcessByte(void) { if (Byte >= 0) { /* Byte received */ - LEDPulse(LED_RED); + LEDTrigger(LED_TERMINAL_RXTX, LED_PULSE); if (XModemProcessByte(Byte)) { /* XModem handled the byte */ @@ -178,30 +124,34 @@ void TerminalInit(void) void TerminalTask(void) { - CDC_Device_USBTask(&TerminalHandle); - USB_USBTask(); + if (TerminalState == TERMINAL_INITIALIZED) { + CDC_Device_USBTask(&TerminalHandle); + USB_USBTask(); - ProcessByte(); + ProcessByte(); + } } void TerminalTick(void) { SenseVBus(); - XModemTick(); - CommandLineTick(); + if (TerminalState == TERMINAL_INITIALIZED) { + XModemTick(); + CommandLineTick(); + } } /** Event handler for the library USB Connection event. */ void EVENT_USB_Device_Connect(void) { - LEDSetOn(LED_GREEN); + LEDTrigger(LED_TERMINAL_CONN, LED_ON); } /** Event handler for the library USB Disconnection event. */ void EVENT_USB_Device_Disconnect(void) { - LEDSetOff(LED_GREEN); + LEDTrigger(LED_TERMINAL_CONN, LED_OFF); } diff --git a/Firmware/Chameleon-Mini/Terminal/Terminal.h b/Firmware/Chameleon-Mini/Terminal/Terminal.h index 840d55e..2cd4753 100644 --- a/Firmware/Chameleon-Mini/Terminal/Terminal.h +++ b/Firmware/Chameleon-Mini/Terminal/Terminal.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * CommandLine.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 10.02.2013 + * Author: skuser */ #ifndef TERMINAL_H_ diff --git a/Firmware/Chameleon-Mini/Terminal/XModem.c b/Firmware/Chameleon-Mini/Terminal/XModem.c index 66074e5..a24a4ba 100644 --- a/Firmware/Chameleon-Mini/Terminal/XModem.c +++ b/Firmware/Chameleon-Mini/Terminal/XModem.c @@ -1,58 +1,3 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. - * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. - */ - #include "XModem.h" #include "Terminal.h" @@ -62,12 +7,13 @@ #define BYTE_CAN 0x18 #define BYTE_EOF 0x1A #define BYTE_EOT 0x04 +#define BYTE_ESC 0x1B #define XMODEM_BLOCK_SIZE 128 -#define RECV_INIT_TIMEOUT 5 /* x 100ms */ -#define RECV_INIT_COUNT 20 /* 10 secs */ -#define SEND_INIT_TIMEOUT 100 /* x 100ms */ +#define RECV_INIT_TIMEOUT 5 /* #Ticks between sending of NAKs to the sender */ +#define RECV_INIT_COUNT 60 /* #Timeouts until receive failure */ +#define SEND_INIT_TIMEOUT 300 /* #Ticks waiting for NAKs from the receiver before failure */ #define FIRST_FRAME_NUMBER 1 #define CHECKSUM_INIT_VALUE 0 @@ -89,7 +35,7 @@ static uint8_t CurrentFrameNumber; static uint8_t ReceivedFrameNumber; static uint8_t Checksum; static uint8_t RetryCount; -static uint8_t RetryTimeout; +static uint16_t RetryTimeout; static uint16_t BufferIdx; static uint32_t BlockAddress; @@ -140,7 +86,7 @@ bool XModemProcessByte(uint8_t Byte) /* Transmission finished */ TerminalSendByte(BYTE_ACK); State = STATE_OFF; - } else if (Byte == BYTE_CAN) { + } else if ( (Byte == BYTE_CAN) || (Byte == BYTE_ESC) ) { /* Cancel transmission */ State = STATE_OFF; } else { @@ -218,6 +164,8 @@ bool XModemProcessByte(uint8_t Byte) if (Byte == BYTE_NAK) { CurrentFrameNumber = FIRST_FRAME_NUMBER - 1; Byte = BYTE_ACK; + } else if (Byte == BYTE_ESC) { + State = STATE_OFF; } /* Fallthrough */ diff --git a/Firmware/Chameleon-Mini/Terminal/XModem.h b/Firmware/Chameleon-Mini/Terminal/XModem.h index fa35d20..d9f9d5d 100644 --- a/Firmware/Chameleon-Mini/Terminal/XModem.h +++ b/Firmware/Chameleon-Mini/Terminal/XModem.h @@ -1,56 +1,8 @@ -/* Copyright 2013 Timo Kasper, Simon Küppers, David Oswald ("ORIGINAL - * AUTHORS"). All rights reserved. +/* + * TerminalXModem.h * - * DEFINITIONS: - * - * "WORK": The material covered by this license includes the schematic - * diagrams, designs, circuit or circuit board layouts, mechanical - * drawings, documentation (in electronic or printed form), source code, - * binary software, data files, assembled devices, and any additional - * material provided by the ORIGINAL AUTHORS in the ChameleonMini project - * (https://github.com/skuep/ChameleonMini). - * - * LICENSE TERMS: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK are permitted provided that the - * following conditions are met: - * - * Redistributions and use of this WORK, with or without modification, or - * of substantial portions of this WORK must include the above copyright - * notice, this list of conditions, the below disclaimer, and the following - * attribution: - * - * "Based on ChameleonMini an open-source RFID emulator: - * https://github.com/skuep/ChameleonMini" - * - * The attribution must be clearly visible to a user, for example, by being - * printed on the circuit board and an enclosure, and by being displayed by - * software (both in binary and source code form). - * - * At any time, the majority of the ORIGINAL AUTHORS may decide to give - * written permission to an entity to use or redistribute the WORK (with or - * without modification) WITHOUT having to include the above copyright - * notice, this list of conditions, the below disclaimer, and the above - * attribution. - * - * DISCLAIMER: - * - * THIS PRODUCT IS PROVIDED BY THE ORIGINAL AUTHORS "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE ORIGINAL AUTHORS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS PRODUCT, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the hardware, software, and - * documentation should not be interpreted as representing official - * policies, either expressed or implied, of the ORIGINAL AUTHORS. + * Created on: 22.03.2013 + * Author: skuser */ #ifndef XMODEM_H_