aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2019-03-27 22:01:30 +1100
committerDean Camera <dean@fourwalledcubicle.com>2019-03-27 22:01:30 +1100
commit5ba628d10b54d58d445896290ba9799bd76a73b3 (patch)
tree74b35494ee2267dad8a7b918208a21f960f5d965
parentffaa83ad27fa3713a86d04dcbf200b1de0454bfc (diff)
downloadlufa-5ba628d10b54d58d445896290ba9799bd76a73b3.tar.gz
lufa-5ba628d10b54d58d445896290ba9799bd76a73b3.tar.bz2
lufa-5ba628d10b54d58d445896290ba9799bd76a73b3.zip
MassStorageBootloader: Move more code into AUX_BOOT_SECTION to save space in small flash devices.
-rw-r--r--Bootloaders/MassStorage/BootloaderAPI.c9
-rw-r--r--Bootloaders/MassStorage/BootloaderAPI.h2
2 files changed, 9 insertions, 2 deletions
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;
diff --git a/Bootloaders/MassStorage/BootloaderAPI.h b/Bootloaders/MassStorage/BootloaderAPI.h
index 13d8a8ff4..87e16ffd7 100644
--- a/Bootloaders/MassStorage/BootloaderAPI.h
+++ b/Bootloaders/MassStorage/BootloaderAPI.h
@@ -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);