MassStorageBootloader: Move more code into AUX_BOOT_SECTION to save space in small...
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 27 Mar 2019 11:01:30 +0000 (22:01 +1100)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 27 Mar 2019 11:01:30 +0000 (22:01 +1100)
Bootloaders/MassStorage/BootloaderAPI.c
Bootloaders/MassStorage/BootloaderAPI.h

index 21d13bb..8fbe44f 100644 (file)
 
 #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;
index 13d8a8f..87e16ff 100644 (file)
@@ -52,6 +52,8 @@
                #endif
 
        /* Function Prototypes: */
+               bool    IsPageAddressValid(const uint32_t Address) AUX_BOOT_SECTION ATTR_NO_INLINE;
+
                void    BootloaderAPI_ErasePage(const uint32_t Address);
                void    BootloaderAPI_WritePage(const uint32_t Address);
                void    BootloaderAPI_FillWord(const uint32_t Address, const uint16_t Word);