Future proof the XPROG protocol of the AVRISP-MKII project, so that non PDI and TPI...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 22 Jul 2010 12:34:32 +0000 (12:34 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 22 Jul 2010 12:34:32 +0000 (12:34 +0000)
Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c

index 84d82bc..0f5269d 100644 (file)
@@ -115,7 +115,7 @@ static void XPROGProtocol_EnterXPROGMode(void)
        Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
        Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
        
        Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM);
        Endpoint_SetEndpointDirection(ENDPOINT_DIR_IN);
        
-       bool NVMBusEnabled;
+       bool NVMBusEnabled = false;
 
        if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
        {
 
        if (XPROG_SelectedProtocol == XPRG_PROTOCOL_PDI)
        {
@@ -138,7 +138,7 @@ static void XPROGProtocol_EnterXPROGMode(void)
                /* Wait until the NVM bus becomes active */
                NVMBusEnabled = XMEGANVM_WaitWhileNVMBusBusy();
        }
                /* 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();
        {
                /* Enable TPI programming mode with the attached target */
                XPROGTarget_EnableTargetTPI();