summaryrefslogtreecommitdiff
path: root/digital/avr/modules/flash/flash.h
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-11-28 21:47:34 +0100
committerNélio Laranjeiro2008-11-28 21:47:34 +0100
commit34764c3924c79a1af978ee38a15d92d56035677e (patch)
tree32fd3ebc8f35d3db1905e2810fb8643685abd8fa /digital/avr/modules/flash/flash.h
parenta703e03d9245449e9edf77c595d192ff4c2d2b43 (diff)
digital/avr/modules/flash: Fix the macros to compute the actual page size.
Diffstat (limited to 'digital/avr/modules/flash/flash.h')
-rw-r--r--digital/avr/modules/flash/flash.h6
1 files changed, 3 insertions, 3 deletions
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.