aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/DFU/BootloaderDFU.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-04-16 08:50:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-04-16 08:50:34 +0000
commit8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c (patch)
tree65c37548f19c26de3971639067d6f290095f5843 /Bootloaders/DFU/BootloaderDFU.c
parentef06bfd1c0ef5272c32808e23d0fd60d2d1bca9c (diff)
downloadlufa-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.tar.gz
lufa-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.tar.bz2
lufa-8f6b4ddf764c3a54e42d00a7502c82c5c3e71b1c.zip
Fixed GenericHIDHost demo report write routine incorrect for control type requests (thanks to Andrei Krainev).
Removed Endpoint_ClearCurrentBank() and Pipe_ClearCurrentBank() in favour of new Endpoint_ClearIN(), Endpoint_ClearOUT(), Endpoint_ClearControlIN(), Endpoint_ClearControlOUT(), Pipe_ClearIN(), Pipe_ClearOUT(), Pipe_ClearControlIN() and Pipe_ClearControlOUT() macros (done to allow for the detection of packets of zero length). Renamed *_ReadWriteAllowed() macros to *_IsReadWriteAllowed() to remain consistent with the rest of the LUFA API. Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived(), Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP(), the Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent() and the Pipe_ClearSetupSent() macro is no longer applicable and should be removed - changes made to compliment the new endpoint and pipe bank management API. Updated all demos, bootloaders and projects to use the new endpoint and pipe management APIs (thanks to Roman Thiel). Updated library doxygen documentation, added groups, changed documentation macro functions to real functions for clarity. Removed old endpoint and pipe aliased read/write/discard routines which did not have an explicit endian specifier for clarity. Removed the ButtLoadTag.h header file, as no one used for its intended purpose anyway.
Diffstat (limited to 'Bootloaders/DFU/BootloaderDFU.c')
-rw-r--r--Bootloaders/DFU/BootloaderDFU.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c
index 5375b9c9d..f3580163e 100644
--- a/Bootloaders/DFU/BootloaderDFU.c
+++ b/Bootloaders/DFU/BootloaderDFU.c
@@ -163,7 +163,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
switch (bRequest)
{
case DFU_DNLOAD:
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearControlSETUP();
/* Check if bootloader is waiting to terminate */
if (WaitForExit)
@@ -178,7 +178,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* If the request has a data stage, load it into the command struct */
if (SentCommand.DataSize)
{
- while (!(Endpoint_IsSetupOUTReceived()));
+ while (!(Endpoint_IsOUTReceived()));
/* First byte of the data stage is the DNLOAD request's command */
SentCommand.Command = Endpoint_Read_Byte();
@@ -235,8 +235,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */
if (!(Endpoint_BytesInEndpoint()))
{
- Endpoint_ClearSetupOUT();
- while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearControlOUT();
+ while (!(Endpoint_IsOUTReceived()));
}
/* Write the next word into the current flash page */
@@ -279,8 +279,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Check if endpoint is empty - if so clear it and wait until ready for next packet */
if (!(Endpoint_BytesInEndpoint()))
{
- Endpoint_ClearSetupOUT();
- while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearControlOUT();
+ while (!(Endpoint_IsOUTReceived()));
}
/* Read the byte from the USB interface and write to to the EEPROM */
@@ -296,17 +296,17 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
}
}
- Endpoint_ClearSetupOUT();
+ Endpoint_ClearControlOUT();
/* Acknowledge status stage */
- while (!(Endpoint_IsSetupINReady()));
- Endpoint_ClearSetupIN();
+ while (!(Endpoint_IsINReady()));
+ Endpoint_ClearControlIN();
break;
case DFU_UPLOAD:
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearControlSETUP();
- while (!(Endpoint_IsSetupINReady()));
+ while (!(Endpoint_IsINReady()));
if (DFU_State != dfuUPLOAD_IDLE)
{
@@ -343,8 +343,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Check if endpoint is full - if so clear it and wait until ready for next packet */
if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)
{
- Endpoint_ClearSetupIN();
- while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearControlIN();
+ while (!(Endpoint_IsINReady()));
}
/* Read the flash word and send it via USB to the host */
@@ -368,8 +368,8 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Check if endpoint is full - if so clear it and wait until ready for next packet */
if (Endpoint_BytesInEndpoint() == FIXED_CONTROL_ENDPOINT_SIZE)
{
- Endpoint_ClearSetupIN();
- while (!(Endpoint_IsSetupINReady()));
+ Endpoint_ClearControlIN();
+ while (!(Endpoint_IsINReady()));
}
/* Read the EEPROM byte and send it via USB to the host */
@@ -384,15 +384,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
DFU_State = dfuIDLE;
}
- Endpoint_ClearSetupIN();
+ Endpoint_ClearControlIN();
/* Acknowledge status stage */
- while (!(Endpoint_IsSetupOUTReceived()));
- Endpoint_ClearSetupOUT();
+ while (!(Endpoint_IsOUTReceived()));
+ Endpoint_ClearControlOUT();
break;
case DFU_GETSTATUS:
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearControlSETUP();
/* Write 8-bit status value */
Endpoint_Write_Byte(DFU_Status);
@@ -407,46 +407,46 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
/* Write 8-bit state string ID number */
Endpoint_Write_Byte(0);
- Endpoint_ClearSetupIN();
+ Endpoint_ClearControlIN();
/* Acknowledge status stage */
- while (!(Endpoint_IsSetupOUTReceived()));
- Endpoint_ClearSetupOUT();
+ while (!(Endpoint_IsOUTReceived()));
+ Endpoint_ClearControlOUT();
break;
case DFU_CLRSTATUS:
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearControlSETUP();
/* Reset the status value variable to the default OK status */
DFU_Status = OK;
/* Acknowledge status stage */
- while (!(Endpoint_IsSetupINReady()));
- Endpoint_ClearSetupIN();
+ while (!(Endpoint_IsINReady()));
+ Endpoint_ClearControlIN();
break;
case DFU_GETSTATE:
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearControlSETUP();
/* Write the current device state to the endpoint */
Endpoint_Write_Byte(DFU_State);
- Endpoint_ClearSetupIN();
+ Endpoint_ClearControlIN();
/* Acknowledge status stage */
- while (!(Endpoint_IsSetupOUTReceived()));
- Endpoint_ClearSetupOUT();
+ while (!(Endpoint_IsOUTReceived()));
+ Endpoint_ClearControlOUT();
break;
case DFU_ABORT:
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearControlSETUP();
/* Reset the current state variable to the default idle state */
DFU_State = dfuIDLE;
/* Acknowledge status stage */
- while (!(Endpoint_IsSetupINReady()));
- Endpoint_ClearSetupIN();
+ while (!(Endpoint_IsINReady()));
+ Endpoint_ClearControlIN();
break;
}
@@ -463,10 +463,10 @@ static void DiscardFillerBytes(uint8_t NumberOfBytes)
{
if (!(Endpoint_BytesInEndpoint()))
{
- Endpoint_ClearSetupOUT();
+ Endpoint_ClearControlOUT();
/* Wait until next data packet received */
- while (!(Endpoint_IsSetupOUTReceived()));
+ while (!(Endpoint_IsOUTReceived()));
}
Endpoint_Discard_Byte();