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

This commit is contained in:
Dean Camera 2013-03-09 09:24:26 +00:00
parent d5d9ff73e5
commit 63e1fc6e6c

View File

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