diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-02-08 21:31:03 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-02-08 21:31:03 +0000 |
commit | 7a1033025bbf0dcf4e4dc770fccb4edea86144a4 (patch) | |
tree | 2945687afa64de6fe618ac22a4e58b158eba876c /Projects/AVRISP-MKII/Lib/XPROG | |
parent | c60897df393cd6716e1bc32c9dcbe78c8f06059f (diff) | |
download | lufa-7a1033025bbf0dcf4e4dc770fccb4edea86144a4.tar.gz lufa-7a1033025bbf0dcf4e4dc770fccb4edea86144a4.tar.bz2 lufa-7a1033025bbf0dcf4e4dc770fccb4edea86144a4.zip |
Minor documentation fixes.
Make an explicit constant name for the CMDEX bit of the target's NVM command register in the AVRISP-MKII Clone project.
Diffstat (limited to 'Projects/AVRISP-MKII/Lib/XPROG')
-rw-r--r-- | Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c | 14 | ||||
-rw-r--r-- | Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.h | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c index 820374fb9..567bd5777 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 05ee5be9c..a8704df3c 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 |