- /* Send block size to the host */
- WriteNextResponseByte(SPM_PAGESIZE >> 8);
- WriteNextResponseByte(SPM_PAGESIZE & 0xFF);
- }
- else if (Command == 'e')
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'p')
+ {
+ /* Indicate serial programmer back to the host */
+ WriteNextResponseByte('S');
+ }
+ else if (Command == 'S')
+ {
+ /* Write the 7-byte software identifier to the endpoint */
+ for (uint8_t CurrByte = 0; CurrByte < 7; CurrByte++)
+ WriteNextResponseByte(SOFTWARE_IDENTIFIER[CurrByte]);
+ }
+ else if (Command == 'V')
+ {
+ WriteNextResponseByte('0' + BOOTLOADER_VERSION_MAJOR);
+ WriteNextResponseByte('0' + BOOTLOADER_VERSION_MINOR);
+ }
+ else if (Command == 's')
+ {
+ WriteNextResponseByte(AVR_SIGNATURE_3);
+ WriteNextResponseByte(AVR_SIGNATURE_2);
+ WriteNextResponseByte(AVR_SIGNATURE_1);
+ }
+ else if (Command == 'e')
+ {
+ /* Clear the application section of flash */
+ for (uint32_t CurrFlashAddress = 0; CurrFlashAddress < BOOT_START_ADDR; CurrFlashAddress += SPM_PAGESIZE)