Commit 988604b2 authored by Dean Camera's avatar Dean Camera
Browse files

Moved calls to V2Params_UpdateParamValues() out of the main AVRISP-MKII and...

Moved calls to V2Params_UpdateParamValues() out of the main AVRISP-MKII and XPLAINBridge project loops and into the AVRISP management function.
parent 51c2dcf3
...@@ -48,9 +48,7 @@ int main(void) ...@@ -48,9 +48,7 @@ int main(void)
for (;;) for (;;)
{ {
Process_AVRISP_Commands(); AVRISP_Task();
V2Params_UpdateParamValues();
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -108,12 +106,14 @@ void EVENT_USB_Device_ConfigurationChanged(void) ...@@ -108,12 +106,14 @@ void EVENT_USB_Device_ConfigurationChanged(void)
} }
/** Processes incoming V2 Protocol commands from the host, returning a response when required. */ /** 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 */ /* Device must be connected and configured for the task to run */
if (USB_DeviceState != DEVICE_STATE_Configured) if (USB_DeviceState != DEVICE_STATE_Configured)
return; return;
V2Params_UpdateParamValues();
Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM); Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
/* Check to see if a V2 Protocol command has been received */ /* Check to see if a V2 Protocol command has been received */
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
/* Function Prototypes: */ /* Function Prototypes: */
void SetupHardware(void); void SetupHardware(void);
void Process_AVRISP_Commands(void); void AVRISP_Task(void);
void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Connect(void);
void EVENT_USB_Device_Disconnect(void); void EVENT_USB_Device_Disconnect(void);
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
* - Minimum ISP target clock speed of 500KHz due to hardware SPI module prescaler limitations * - Minimum ISP target clock speed of 500KHz due to hardware SPI module prescaler limitations
* - No reversed/shorted target connector detection and notification * - No reversed/shorted target connector detection and notification
* - A seperate header is required for each of the ISP, PDI and TPI programming protocols that the user wishes to use * - A seperate header is required for each of the ISP, PDI and TPI programming protocols that the user wishes to use
* - XMEGA EEPROM erase section command does not work (but EEPROM read/write and chip erase does)
* *
* On AVR models with an ADC converter, AVCC should be tied to 5V (e.g. VBUS) and the VTARGET_ADC_CHANNEL token should be * On AVR models with an ADC converter, AVCC should be tied to 5V (e.g. VBUS) and the VTARGET_ADC_CHANNEL token should be
* set to an appropriate ADC channel number in the project makefile for VTARGET detection to operate correctly. On models * set to an appropriate ADC channel number in the project makefile for VTARGET detection to operate correctly. On models
......
...@@ -86,14 +86,9 @@ int main(void) ...@@ -86,14 +86,9 @@ int main(void)
for (;;) for (;;)
{ {
if (CurrentFirmwareMode == MODE_USART_BRIDGE) if (CurrentFirmwareMode == MODE_USART_BRIDGE)
{ UARTBridge_Task();
USARTBridge_Task();
}
else else
{ AVRISP_Task();
AVRISP_Task();
V2Params_UpdateParamValues();
}
USB_USBTask(); USB_USBTask();
} }
...@@ -105,6 +100,8 @@ void AVRISP_Task(void) ...@@ -105,6 +100,8 @@ void AVRISP_Task(void)
if (USB_DeviceState != DEVICE_STATE_Configured) if (USB_DeviceState != DEVICE_STATE_Configured)
return; return;
V2Params_UpdateParamValues();
Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM); Endpoint_SelectEndpoint(AVRISP_DATA_OUT_EPNUM);
/* Check to see if a V2 Protocol command has been received */ /* Check to see if a V2 Protocol command has been received */
...@@ -119,7 +116,7 @@ void AVRISP_Task(void) ...@@ -119,7 +116,7 @@ void AVRISP_Task(void)
} }
} }
void USARTBridge_Task(void) void UARTBridge_Task(void)
{ {
/* Must be in the configured state for the USART Bridge code to process data */ /* Must be in the configured state for the USART Bridge code to process data */
if (USB_DeviceState != DEVICE_STATE_Configured) if (USB_DeviceState != DEVICE_STATE_Configured)
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
/* Function Prototypes: */ /* Function Prototypes: */
void SetupHardware(void); void SetupHardware(void);
void AVRISP_Task(void); void AVRISP_Task(void);
void USARTBridge_Task(void); void UARTBridge_Task(void);
void EVENT_USB_Device_ConfigurationChanged(void); void EVENT_USB_Device_ConfigurationChanged(void);
void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_UnhandledControlRequest(void);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment