diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2013-03-18 17:18:11 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-03-18 17:18:11 +0000 |
commit | be33d3a5156ea3fde221c9e174ad0405eb8d1f8d (patch) | |
tree | b027f4af999f39ed4554270c089a003479be7af7 /Bootloaders/MassStorage/Lib/VirtualFAT.h | |
parent | f8a1dc7424cd83f2f3e87274010d379a661b76e4 (diff) | |
download | lufa-be33d3a5156ea3fde221c9e174ad0405eb8d1f8d.tar.gz lufa-be33d3a5156ea3fde221c9e174ad0405eb8d1f8d.tar.bz2 lufa-be33d3a5156ea3fde221c9e174ad0405eb8d1f8d.zip |
Update Mass Storage bootloader so that it can support devices with only 4KB bootloader sections by creating a special AUX section before the real bootloader section to store part of the bootloader code.
Diffstat (limited to 'Bootloaders/MassStorage/Lib/VirtualFAT.h')
-rw-r--r-- | Bootloaders/MassStorage/Lib/VirtualFAT.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Bootloaders/MassStorage/Lib/VirtualFAT.h b/Bootloaders/MassStorage/Lib/VirtualFAT.h index 16b4b738d..8019691dc 100644 --- a/Bootloaders/MassStorage/Lib/VirtualFAT.h +++ b/Bootloaders/MassStorage/Lib/VirtualFAT.h @@ -37,9 +37,11 @@ #include <LUFA/Drivers/USB/USB.h> + #include "../BootloaderAPI.h" + /* Macros: */ /** Size of the virtual FIRMWARE.BIN file in bytes. */ - #define FIRMWARE_FILE_SIZE_BYTES (FLASHEND - (FLASHEND - BOOT_START_ADDR)) + #define FIRMWARE_FILE_SIZE_BYTES (FLASHEND - (FLASHEND - BOOT_START_ADDR) - AUX_BOOT_SECTION_SIZE) /** Number of sectors that comprise a single logical disk cluster. */ #define SECTOR_PER_CLUSTER 4 @@ -144,16 +146,16 @@ #if defined(INCLUDE_FROM_VIRTUAL_FAT_C) static void UpdateFAT12ClusterEntry(uint8_t* const FATTable, const uint16_t Index, - const uint16_t ChainEntry); - static void WriteVirtualBlock(const uint16_t BlockNumber); - static void ReadVirtualBlock(const uint16_t BlockNumber); + const uint16_t ChainEntry) AUX_BOOT_SECTION; + static void WriteVirtualBlock(const uint16_t BlockNumber) AUX_BOOT_SECTION; + static void ReadVirtualBlock(const uint16_t BlockNumber) AUX_BOOT_SECTION; #endif void VirtualFAT_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, - uint16_t TotalBlocks); + uint16_t TotalBlocks) AUX_BOOT_SECTION; void VirtualFAT_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, - uint16_t TotalBlocks); + uint16_t TotalBlocks) AUX_BOOT_SECTION; #endif |