Minor optimizations and corrections to the incomplete Mass Storage class bootloader.
This commit is contained in:
@@ -307,11 +307,8 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
|
||||
*/
|
||||
static bool SCSI_Command_ModeSense_6(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
|
||||
{
|
||||
/* Send an empty header response with the Write Protect flag status */
|
||||
Endpoint_Write_8(0x00);
|
||||
Endpoint_Write_8(0x00);
|
||||
Endpoint_Write_8(0x00);
|
||||
Endpoint_Write_8(0x00);
|
||||
/* Send an empty header response indicating Write Protect flag is off */
|
||||
Endpoint_Write_32_LE(0);
|
||||
Endpoint_ClearIN();
|
||||
|
||||
/* Update the bytes transferred counter and succeed the command */
|
||||
|
||||
@@ -51,8 +51,6 @@ static const FATBootBlock_t BootBlock =
|
||||
.VolumeSerialNumber = 0x12345678,
|
||||
.VolumeLabel = "LUFA BOOT ",
|
||||
.FilesystemIdentifier = "FAT12 ",
|
||||
.BootstrapProgram = {0},
|
||||
.MagicSignature = 0xAA55,
|
||||
};
|
||||
|
||||
static FATDirectoryEntry_t FirmwareFileEntry =
|
||||
@@ -138,6 +136,10 @@ static void ReadBlock(const uint16_t BlockNumber)
|
||||
{
|
||||
case 0: /* Block 0: Boot block sector */
|
||||
memcpy(BlockBuffer, &BootBlock, sizeof(FATBootBlock_t));
|
||||
|
||||
/* Add the magic signature to the end of the block */
|
||||
BlockBuffer[SECTOR_SIZE_BYTES - 2] = 0x55;
|
||||
BlockBuffer[SECTOR_SIZE_BYTES - 1] = 0xAA;
|
||||
break;
|
||||
|
||||
case 1: /* Block 1: First FAT12 cluster chain copy */
|
||||
|
||||
@@ -72,8 +72,6 @@
|
||||
uint32_t VolumeSerialNumber;
|
||||
uint8_t VolumeLabel[11];
|
||||
uint8_t FilesystemIdentifier[8];
|
||||
uint8_t BootstrapProgram[448];
|
||||
uint16_t MagicSignature;
|
||||
} FATBootBlock_t;
|
||||
|
||||
typedef struct
|
||||
|
||||
Reference in New Issue
Block a user