X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/008e0e2e0a13e64e03f27f1c9a008ef201560878..c37fd0ef91c58003eab6f3a5461d970ea1a22602:/Projects/AVRISP-MKII/AVRISP.c diff --git a/Projects/AVRISP-MKII/AVRISP.c b/Projects/AVRISP-MKII/AVRISP.c index 0766025c1..33ea07b52 100644 --- a/Projects/AVRISP-MKII/AVRISP.c +++ b/Projects/AVRISP-MKII/AVRISP.c @@ -42,15 +42,14 @@ int main(void) { SetupHardware(); + V2Protocol_Init(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); sei(); for (;;) { - Process_AVRISP_Commands(); - V2Params_UpdateParamValues(); - + AVRISP_Task(); USB_USBTask(); } } @@ -68,7 +67,6 @@ void SetupHardware(void) /* Hardware Initialization */ LEDs_Init(); USB_Init(); - V2Protocol_Init(); } /** Event handler for the library USB Connection event. */ @@ -108,12 +106,14 @@ void EVENT_USB_Device_ConfigurationChanged(void) } /** Processes incoming V2 Protocol commands from the host, returning a response when required. */ -void Process_AVRISP_Commands(void) +void AVRISP_Task(void) { /* Device must be connected and configured for the task to run */ if (USB_DeviceState != DEVICE_STATE_Configured) return; + V2Params_UpdateParamValues(); + Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM); /* Check to see if a V2 Protocol command has been received */