Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
- bool NVMBusEnabled;
+ bool NVMBusEnabled = false;
if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
{
XPROGTarget_SendByte(0x07);
/* Enable access to the XPROG NVM bus by sending the documented NVM access key to the device */
- XPROGTarget_SendByte(PDI_CMD_KEY);
+ XPROGTarget_SendByte(PDI_CMD_KEY);
for (uint8_t i = sizeof(PDI_NVMENABLE_KEY); i > 0; i--)
XPROGTarget_SendByte(PDI_NVMENABLE_KEY[i - 1]);
/* Wait until the NVM bus becomes active */
NVMBusEnabled = XMEGANVM_WaitWhileNVMBusBusy();
}
- else
+ else if (XPROG_SelectedProtocol == XPRG_PROTOCOL_TPI)
{
/* Enable TPI programming mode with the attached target */
XPROGTarget_EnableTargetTPI();
EraseBuffCommand = XMEGA_NVM_CMD_ERASEEEPROMPAGEBUFF;
break;
case XPRG_MEM_TYPE_USERSIG:
- /* User signature is paged, but needs us to manually indicate the mode bits since the host doesn't set them */
- WriteMemory_XPROG_Params.PageMode = (XPRG_PAGEMODE_ERASE | XPRG_PAGEMODE_WRITE);
WriteCommand = XMEGA_NVM_CMD_WRITEUSERSIG;
break;
case XPRG_MEM_TYPE_FUSE: