From 34764c3924c79a1af978ee38a15d92d56035677e Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Fri, 28 Nov 2008 21:47:34 +0100 Subject: digital/avr/modules/flash: Fix the macros to compute the actual page size. --- digital/avr/modules/flash/flash.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'digital/avr/modules/flash/flash.h') diff --git a/digital/avr/modules/flash/flash.h b/digital/avr/modules/flash/flash.h index 0738cf36..0468ebdc 100644 --- a/digital/avr/modules/flash/flash.h +++ b/digital/avr/modules/flash/flash.h @@ -33,7 +33,7 @@ ((val) + 1) & FLASH_ADDRESS_HIGH #define FLASH_PAGE_SIZE 0x1000 -#define FLASH_PAGE_MASK (FLASH_ADDRESS_HIGH & FLASH_PAGE_SIZE) +#define FLASH_PAGE_MASK (FLASH_ADDRESS_HIGH & ~(FLASH_PAGE_SIZE-1)) #define FLASH_PAGE(val) ((val) & FLASH_PAGE_MASK) #define FLASH_ERASE_FULL 0x60 @@ -104,12 +104,12 @@ flash_status_aai (void) uint8_t flash_init (void); -/** Find the next sector to write. +/** Find the first writable sector. * \param addr the address to start the research. * \return the address of the next sector. */ uint32_t -flash_sector_next (uint32_t addr); +flash_first_sector (void); /** Write in the flash byte provided in parameter. * \param data the buffer to store the data. -- cgit v1.2.3