Minor optimizations and corrections to the incomplete Mass Storage class bootloader.

This commit is contained in:
Dean Camera 2013-03-10 08:38:47 +00:00
parent d5cff25cd1
commit 6c9632ae38
6 changed files with 9 additions and 44 deletions

View file

@ -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 */

View file

@ -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 */

View file

@ -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