- /* Send confirmation byte back to the host */
- WriteNextResponseByte('\r');
- }
- else if ((Command == 'B') || (Command == 'g'))
- {
- /* Delegate the block write/read to a separate function for clarity */
- ReadWriteMemoryBlock(Command);
- }
- else if (Command == 'R')
- {
- #if (FLASHEND > 0xFFFF)
- uint16_t ProgramWord = pgm_read_word_far(CurrAddress);
- #else
- uint16_t ProgramWord = pgm_read_word(CurrAddress);
- #endif
-
- WriteNextResponseByte(ProgramWord >> 8);
- WriteNextResponseByte(ProgramWord & 0xFF);
- }
- else if (Command == 'D')
- {
- /* Read the byte from the endpoint and write it to the EEPROM */
- eeprom_write_byte((uint8_t*)((uint16_t)(CurrAddress >> 1)), FetchNextCommandByte());
-
- /* Increment the address after use */
- CurrAddress += 2;
-
- /* Send confirmation byte back to the host */
- WriteNextResponseByte('\r');
- }
- else if (Command == 'd')
- {
- /* Read the EEPROM byte and write it to the endpoint */
- WriteNextResponseByte(eeprom_read_byte((uint8_t*)((uint16_t)(CurrAddress >> 1))));
+ /* Send confirmation byte back to the host */
+ WriteNextResponseByte('\r');
+ }
+ else if (Command == 'c')
+ {
+ /* Write the low byte to the current flash page */
+ boot_page_fill(CurrAddress | 0x01, FetchNextCommandByte());