X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/ffaa83ad27fa3713a86d04dcbf200b1de0454bfc..5ba628d10b54d58d445896290ba9799bd76a73b3:/Bootloaders/MassStorage/BootloaderAPI.c?ds=inline diff --git a/Bootloaders/MassStorage/BootloaderAPI.c b/Bootloaders/MassStorage/BootloaderAPI.c index 21d13bbe3..8fbe44f01 100644 --- a/Bootloaders/MassStorage/BootloaderAPI.c +++ b/Bootloaders/MassStorage/BootloaderAPI.c @@ -35,10 +35,15 @@ #include "BootloaderAPI.h" -static bool IsPageAddressValid(const uint32_t Address) +bool IsPageAddressValid(const uint32_t Address) { /* Determine if the given page address is correctly aligned to the - start of a flash page. */ + start of a flash page. + + Note that this is not static, as we need to force it into the + AUX_BOOT_SECTION on small flash devices to save space. + */ + bool PageAddressIsAligned = !(Address & (SPM_PAGESIZE - 1)); return (Address < BOOT_START_ADDR) && PageAddressIsAligned;