Split out NVM access code in the AVRISP project into a seperate NVMTarget.c source...
[pub/USBasp.git] / Projects / AVRISP / AVRISP.c
index 44b8356..c0572fc 100644 (file)
@@ -48,7 +48,7 @@ int main(void)
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 \r
        for (;;)\r
-       {
+       {\r
                Process_AVRISP_Commands();\r
                \r
                V2Params_UpdateParamValues();\r
@@ -111,20 +111,24 @@ void EVENT_USB_Device_ConfigurationChanged(void)
        }\r
 }\r
 \r
-/** Processes incomming V2 Protocol commands from the host, returning a response when required. */
-void Process_AVRISP_Commands(void)
-{
+/** Processes incoming V2 Protocol commands from the host, returning a response when required. */\r
+void Process_AVRISP_Commands(void)\r
+{\r
        /* Device must be connected and configured for the task to run */\r
        if (USB_DeviceState != DEVICE_STATE_Configured)\r
-         return;
-
+         return;\r
+\r
        Endpoint_SelectEndpoint(AVRISP_DATA_EPNUM);\r
-       
-       /* Check to see if a V2 Protocol command has been received - if not, abort */
-       if (!(Endpoint_IsOUTReceived()))
-         return;
-
-       /* Pass off processing of the V2 Protocol command to the V2 Protocol handler */
-       V2Protocol_ProcessCommand();\r
-}
-
+       \r
+       /* Check to see if a V2 Protocol command has been received */\r
+       if (Endpoint_IsOUTReceived())\r
+       {\r
+               LEDs_SetAllLEDs(LEDMASK_BUSY);\r
+\r
+               /* Pass off processing of the V2 Protocol command to the V2 Protocol handler */\r
+               V2Protocol_ProcessCommand();\r
+\r
+               LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
+       }\r
+}\r
+\r