Make the VirtualFAT firmware file read from device flash when opened by the host in the incomplete Mass Storage class bootloader.

pull/1469/head
Dean Camera 12 years ago
parent d5d9ff73e5
commit 63e1fc6e6c

@ -138,8 +138,10 @@ static void ReadBlock(const uint16_t BlockNumber)
default:
if ((BlockNumber >= 4) && (BlockNumber < (4 + (FIRMWARE_FILE_SIZE / SECTOR_SIZE_BYTES))))
{
for (uint16_t i = 0; i < 512; i++)
BlockBuffer[i] = 'A' + (i % 26);
uint32_t ReadFlashAddress = (uint32_t)(BlockNumber - 4) * SECTOR_SIZE_BYTES;
for (uint16_t i = 0; i < SECTOR_SIZE_BYTES; i++)
BlockBuffer[i] = pgm_read_byte_far(ReadFlashAddress++);
}
break;

Loading…
Cancel
Save