Rename new CDC class bootloader NO_LOCK_BYTE_SUPPORT compile time option to NO_LOCK_BYTE_WRITE_SUPPORT as reads are still permitted.

Clean up CDC bootloader command processing code.
pull/1469/head
Dean Camera 14 years ago
parent 475323e400
commit 40db485c79

@ -332,21 +332,31 @@ void CDC_Task(void)
Endpoint_SelectEndpoint(CDC_RX_EPNUM);
/* Check if endpoint has a command in it sent from the host */
if (Endpoint_IsOUTReceived())
{
if (!(Endpoint_IsOUTReceived()))
return;
/* Read in the bootloader command (first byte sent from host) */
uint8_t Command = FetchNextCommandByte();
if ((Command == 'L') || (Command == 'P') || (Command == 'T') || (Command == 'E'))
{
if (Command == 'E')
{
RunBootloader = false;
/* Send confirmation byte back to the host */
WriteNextResponseByte('\r');
}
else if (Command == 'T')
{
FetchNextCommandByte();
/* Send confirmation byte back to the host */
WriteNextResponseByte('\r');
}
else if ((Command == 'L') || (Command == 'P'))
{
/* Send confirmation byte back to the host */
WriteNextResponseByte('\r');
}
else if (Command == 't')
{
/* Return ATMEGA128 part code - this is only to allow AVRProg to use the bootloader */
@ -392,20 +402,18 @@ void CDC_Task(void)
else if (Command == 'e')
{
/* Clear the application section of flash */
for (uint32_t CurrFlashAddress = 0; CurrFlashAddress < BOOT_START_ADDR; CurrFlashAddress++)
for (uint32_t CurrFlashAddress = 0; CurrFlashAddress < BOOT_START_ADDR; CurrFlashAddress += SPM_PAGESIZE)
{
boot_page_erase(CurrFlashAddress);
boot_spm_busy_wait();
boot_page_write(CurrFlashAddress);
boot_spm_busy_wait();
CurrFlashAddress += SPM_PAGESIZE;
}
/* Send confirmation byte back to the host */
WriteNextResponseByte('\r');
}
#if !defined(NO_LOCK_BYTE_SUPPORT)
#if !defined(NO_LOCK_BYTE_WRITE_SUPPORT)
else if (Command == 'l')
{
/* Set the lock bits to those given by the host */
@ -550,5 +558,4 @@ void CDC_Task(void)
/* Acknowledge the command from the host */
Endpoint_ClearOUT();
}
}

@ -82,7 +82,7 @@
* to be made using the block-level commands.
* </tr>
* <tr>
* <td>NO_LOCK_BYTE_SUPPORT</td>
* <td>NO_LOCK_BYTE_WRITE_SUPPORT</td>
* <td>Makefile LUFA_OPTS</td>
* <td>Define to disable lock byte write support in the bootloader, preventing the lock bits from being set progmatically.
* </tr>

@ -127,7 +127,7 @@ LUFA_OPTS += -D NO_SOF_EVENTS
#LUFA_OPTS += -D NO_BLOCK_SUPPORT
#LUFA_OPTS += -D NO_EEPROM_BYTE_SUPPORT
#LUFA_OPTS += -D NO_FLASH_BYTE_SUPPORT
#LUFA_OPTS += -D NO_LOCK_BYTE_SUPPORT
#LUFA_OPTS += -D NO_LOCK_BYTE_WRITE_SUPPORT
# Create the LUFA source path variables by including the LUFA root makefile

@ -30,9 +30,9 @@
* - Added default test tone generation mode to the Device mode AudioInput demos
* - Added new NO_CLASS_DRIVER_AUTOFLUSH compile time option to disable automatic flushing of interfaces when the USB management
* tasks for each driver is called
* - Added standard keyboard HID report scancode defines (thanks to László Monda)
* - Added standard keyboard HID report scancode defines (thanks to Laszlo Monda)
* - Added new Pipe_GetBusyBanks(), Endpoint_GetBusyBanks() and Endpoint_AbortPendingIN() functions
* - Added new NO_BLOCK_SUPPORT, NO_EEPROM_BYTE_SUPPORT, NO_FLASH_BYTE_SUPPORT and NO_LOCK_BYTE_SUPPORT compile time options to the
* - Added new NO_BLOCK_SUPPORT, NO_EEPROM_BYTE_SUPPORT, NO_FLASH_BYTE_SUPPORT and NO_LOCK_BYTE_WRITE_SUPPORT compile time options to the
* CDC class bootloader
*
* <b>Changed:</b>

Loading…
Cancel
Save