diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.txt b/Projects/AVRISP-MKII/AVRISP-MKII.txt index d2977dde9f..a6f00b4a3a 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.txt +++ b/Projects/AVRISP-MKII/AVRISP-MKII.txt @@ -215,63 +215,69 @@ * AUX_LINE_PORT * Makefile LUFA_OPTS * PORT register for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board. + * but is generally used for the target's /RESET line. + * \n \n Ignored when compiled for the XPLAIN board. * * * AUX_LINE_PIN * Makefile LUFA_OPTS * PIN register for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board. + * but is generally used for the target's /RESET line. + * \n \n Ignored when compiled for the XPLAIN board. * * * AUX_LINE_DDR * Makefile LUFA_OPTS * DDR register for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Ignored when compiled for the XPLAIN board. + * but is generally used for the target's /RESET line. + * \n \n Ignored when compiled for the XPLAIN board. * * * AUX_LINE_MASK * Makefile LUFA_OPTS * Mask for the programmer's AUX target line. The use of this line varies between the programming protocols, - * but is generally used for the target's /RESET line. Must not be the AVR's /SS pin. Ignored when - * compiled for the XPLAIN board. + * but is generally used for the target's /RESET line. Must not be the AVR's /SS pin. + * \n \n Ignored when compiled for the XPLAIN board. * * * VTARGET_ADC_CHANNEL * Makefile LUFA_OPTS * ADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined. - * Ignored when compiled for targets lacking an ADC. + * \n \n Ignored when compiled for targets lacking an ADC. * * * ENABLE_ISP_PROTOCOL * Makefile LUFA_OPTS - * Define to enable SPI programming protocol support. Ignored when compiled for the XPLAIN board. + * Define to enable SPI programming protocol support. + * \n \n Ignored when compiled for the XPLAIN board. * * * ENABLE_XPROG_PROTOCOL * Makefile LUFA_OPTS - * Define to enable PDI and TPI programming protocol support. Ignored when compiled for the XPLAIN board. + * Define to enable PDI and TPI programming protocol support. + * \n \n Ignored when compiled for the XPLAIN board. * * * NO_VTARGET_DETECT * Makefile LUFA_OPTS * Define to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer - * to report a fixed 3.3V target voltage to the host regardless of the real target voltage. Ignored when compiled for - * targets lacking an ADC. + * to report a fixed 3.3V target voltage to the host regardless of the real target voltage. + * \n \n Ignored when compiled for targets lacking an ADC. * * * VTARGET_REF_VOLTS * Makefile LUFA_OPTS * Indicates the programmer AVR's AVCC reference voltage when measuring the target's supply voltage. Note that the supply * voltage should never exceed the reference voltage on the programmer AVR without some form of protection to prevent damage - * to the ADC. Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined. + * to the ADC. + * \n \n Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined. * * * VTARGET_USE_INTERNAL_REF * Makefile LUFA_OPTS * Selects the internal 2.56V ADC reference voltage, instead of using the AVR's VREF pin. When enabled, this option will - * override the VTARGET_REF_VOLTS configuration option. Ignored when compiled for targets lacking an ADC, or when - * NO_VTARGET_DETECT is defined. + * override the VTARGET_REF_VOLTS configuration option. + * \n \n Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined. * * * VTARGET_SCALE_FACTOR @@ -279,7 +285,8 @@ * Indicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the * ADC pin for measuring the target's supply voltage, so that voltages above the programmer AVR's AVCC reference voltage can be * measured. This should be the reciprocal of the division performed - e.g. if the VTARGET voltage is halved, this should be set - * to 2. Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined. + * to 2. + * \n \n Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined. * * * LIBUSB_DRIVER_COMPAT @@ -291,7 +298,7 @@ * XCK_RESCUE_CLOCK_ENABLE * Makefile LUFA_OPTS * Define to move the ISP rescue clock to the AVR's XCK pin instead of the OCR1A output pin. This is useful for existing programming - * hardware that does not expose the OCR1A pin of the AVR, but *may* cause some issues with PDI programming mode. + * hardware that does not expose the OCR1A pin of the AVR, but may cause some issues with PDI programming mode. * * * INVERTED_ISP_MISO @@ -301,6 +308,7 @@ * * * FIRMWARE_VERSION_MINOR + * Makefile LUFA_OPTS * Define to set the minor firmware revision nunber reported to the host on request. By default this will use a firmware version compatible * with the latest Atmel IDE version, however if desired the reported minor value can be adjusted here. * diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c index 820374fb96..567bd57772 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c @@ -186,7 +186,7 @@ bool XMEGANVM_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest) /* Set CMDEX bit in NVM CTRLA register to start the CRC generation */ XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2)); XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CTRLA); - XPROGTarget_SendByte(1 << 0); + XPROGTarget_SendByte(XMEGA_NVM_BIT_CTRLA_CMDEX); /* Wait until the NVM bus is ready again */ if (!(XMEGANVM_WaitWhileNVMBusBusy())) @@ -202,11 +202,11 @@ bool XMEGANVM_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest) /* Send the REPEAT command to grab the CRC bytes */ XPROGTarget_SendByte(PDI_CMD_REPEAT | PDI_DATSIZE_1BYTE); - XPROGTarget_SendByte(XMEGA_CRC_LENGTH - 1); + XPROGTarget_SendByte(XMEGA_CRC_LENGTH_BYTES - 1); /* Read in the CRC bytes from the target */ XPROGTarget_SendByte(PDI_CMD_LD | (PDI_POINTER_INDIRECT_PI << 2) | PDI_DATSIZE_1BYTE); - for (uint8_t i = 0; i < XMEGA_CRC_LENGTH; i++) + for (uint8_t i = 0; i < XMEGA_CRC_LENGTH_BYTES; i++) ((uint8_t*)CRCDest)[i] = XPROGTarget_ReceiveByte(); return (TimeoutExpired == false); @@ -304,7 +304,7 @@ bool XMEGANVM_WritePageMemory(const uint8_t WriteBuffCommand, const uint8_t Eras /* Set CMDEX bit in NVM CTRLA register to start the buffer erase */ XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2)); XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CTRLA); - XPROGTarget_SendByte(1 << 0); + XPROGTarget_SendByte(XMEGA_NVM_BIT_CTRLA_CMDEX); } if (WriteSize) @@ -376,7 +376,7 @@ bool XMEGANVM_EraseMemory(const uint8_t EraseCommand, const uint32_t Address) /* Set CMDEX bit in NVM CTRLA register to start the erase sequence */ XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2)); XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CTRLA); - XPROGTarget_SendByte(1 << 0); + XPROGTarget_SendByte(XMEGA_NVM_BIT_CTRLA_CMDEX); } else if (EraseCommand == XMEGA_NVM_CMD_ERASEEEPROM) { @@ -388,7 +388,7 @@ bool XMEGANVM_EraseMemory(const uint8_t EraseCommand, const uint32_t Address) /* Set CMDEX bit in NVM CTRLA register to start the buffer erase */ XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2)); XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CTRLA); - XPROGTarget_SendByte(1 << 0); + XPROGTarget_SendByte(XMEGA_NVM_BIT_CTRLA_CMDEX); /* Wait until the NVM controller is no longer busy */ if (!(XMEGANVM_WaitWhileNVMControllerBusy())) @@ -420,7 +420,7 @@ bool XMEGANVM_EraseMemory(const uint8_t EraseCommand, const uint32_t Address) /* Set CMDEX bit in NVM CTRLA register to start the EEPROM erase sequence */ XPROGTarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2)); XMEGANVM_SendNVMRegAddress(XMEGA_NVM_REG_CTRLA); - XPROGTarget_SendByte(1 << 0); + XPROGTarget_SendByte(XMEGA_NVM_BIT_CTRLA_CMDEX); } else { diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h index 05ee5be9cc..a8704df3cf 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h @@ -56,7 +56,7 @@ #endif /* Defines: */ - #define XMEGA_CRC_LENGTH 3 + #define XMEGA_CRC_LENGTH_BYTES 3 #define XMEGA_NVM_REG_ADDR0 0x00 #define XMEGA_NVM_REG_ADDR1 0x01 @@ -70,6 +70,8 @@ #define XMEGA_NVM_REG_INTCTRL 0x0D #define XMEGA_NVM_REG_STATUS 0x0F #define XMEGA_NVM_REG_LOCKBITS 0x10 + + #define XMEGA_NVM_BIT_CTRLA_CMDEX (1 << 0) #define XMEGA_NVM_CMD_NOOP 0x00 #define XMEGA_NVM_CMD_CHIPERASE 0x40 diff --git a/Projects/XPLAINBridge/XPLAINBridge.txt b/Projects/XPLAINBridge/XPLAINBridge.txt index 52cf99facc..9dead426eb 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.txt +++ b/Projects/XPLAINBridge/XPLAINBridge.txt @@ -91,6 +91,7 @@ * * * FIRMWARE_VERSION_MINOR + * Makefile LUFA_OPTS * Define to set the minor firmware revision nunber reported to the host on request. By default this will use a firmware version compatible * with the latest Atmel IDE version, however if desired the reported minor value can be adjusted here. *