switch (bRequest)\r
{\r
case DFU_DNLOAD:\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
/* Check if bootloader is waiting to terminate */\r
if (WaitForExit)\r
/* If the request has a data stage, load it into the command struct */\r
if (SentCommand.DataSize)\r
{\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
+ while (!(Endpoint_IsOUTReceived()));\r
\r
/* First byte of the data stage is the DNLOAD request's command */\r
SentCommand.Command = Endpoint_Read_Byte();\r
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
if (!(Endpoint_BytesInEndpoint()))\r
{\r
- Endpoint_ClearSetupOUT();\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
}\r
\r
/* Write the next word into the current flash page */\r
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */\r
if (!(Endpoint_BytesInEndpoint()))\r
{\r
- Endpoint_ClearSetupOUT();\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
}\r
\r
/* Read the byte from the USB interface and write to to the EEPROM */\r
}\r
}\r
\r
- Endpoint_ClearSetupOUT();\r
+ Endpoint_ClearControlOUT();\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupINReady()));\r
- Endpoint_ClearSetupIN();\r
+ while (!(Endpoint_IsINReady()));\r
+ Endpoint_ClearControlIN();\r
\r
break;\r
case DFU_UPLOAD:\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
- while (!(Endpoint_IsSetupINReady()));\r
+ while (!(Endpoint_IsINReady()));\r
\r
if (DFU_State != dfuUPLOAD_IDLE)\r
{\r
/* Check if endpoint is full - if so clear it and wait until ready for next packet */\r
if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)\r
{\r
- Endpoint_ClearSetupIN();\r
- while (!(Endpoint_IsSetupINReady()));\r
+ Endpoint_ClearControlIN();\r
+ while (!(Endpoint_IsINReady()));\r
}\r
\r
/* Read the flash word and send it via USB to the host */\r
/* Check if endpoint is full - if so clear it and wait until ready for next packet */\r
if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)\r
{\r
- Endpoint_ClearSetupIN();\r
- while (!(Endpoint_IsSetupINReady()));\r
+ Endpoint_ClearControlIN();\r
+ while (!(Endpoint_IsINReady()));\r
}\r
\r
/* Read the EEPROM byte and send it via USB to the host */\r
DFU_State = dfuIDLE;\r
}\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
\r
break;\r
case DFU_GETSTATUS:\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
/* Write 8-bit status value */\r
Endpoint_Write_Byte(DFU_Status);\r
/* Write 8-bit state string ID number */\r
Endpoint_Write_Byte(0);\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
\r
break; \r
case DFU_CLRSTATUS:\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
/* Reset the status value variable to the default OK status */\r
DFU_Status = OK;\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupINReady()));\r
- Endpoint_ClearSetupIN();\r
+ while (!(Endpoint_IsINReady()));\r
+ Endpoint_ClearControlIN();\r
\r
break;\r
case DFU_GETSTATE:\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
/* Write the current device state to the endpoint */\r
Endpoint_Write_Byte(DFU_State);\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
\r
break;\r
case DFU_ABORT:\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
/* Reset the current state variable to the default idle state */\r
DFU_State = dfuIDLE;\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupINReady()));\r
- Endpoint_ClearSetupIN();\r
+ while (!(Endpoint_IsINReady()));\r
+ Endpoint_ClearControlIN();\r
\r
break;\r
}\r
{\r
if (!(Endpoint_BytesInEndpoint()))\r
{\r
- Endpoint_ClearSetupOUT();\r
+ Endpoint_ClearControlOUT();\r
\r
/* Wait until next data packet received */\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
+ while (!(Endpoint_IsOUTReceived()));\r
}\r
\r
Endpoint_Discard_Byte(); \r