Skip to content
Browse files

MassStorageBootloader: Move more code into AUX_BOOT_SECTION to save s…

…pace in small flash devices.
  • Loading branch information...
abcminiuser committed Mar 27, 2019
1 parent ffaa83a commit 5ba628d10b54d58d445896290ba9799bd76a73b3
Showing with 9 additions and 2 deletions.
  1. +7 −2 Bootloaders/MassStorage/BootloaderAPI.c
  2. +2 −0 Bootloaders/MassStorage/BootloaderAPI.h
@@ -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;
@@ -52,6 +52,8 @@

/* 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);

0 comments on commit 5ba628d

Please sign in to comment.
You can’t perform that action at this time.