summaryrefslogtreecommitdiff
path: root/digital/avr/modules/flash/flash.h
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-11-10 21:09:56 +0100
committerNélio Laranjeiro2008-11-10 21:09:56 +0100
commitb8bcbaebba4c29cd5ac5ca01262d3be4245c482b (patch)
tree17ff15ab97fc26109718688451e990820fb024c0 /digital/avr/modules/flash/flash.h
parent4443d7dbf02cc4390cb632eb12b47dc7d3162bfd (diff)
avr/modules/flash: Fix the flash_sector_next function.
It was returning the next sector address instead of the current one.
Diffstat (limited to 'digital/avr/modules/flash/flash.h')
-rw-r--r--digital/avr/modules/flash/flash.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/digital/avr/modules/flash/flash.h b/digital/avr/modules/flash/flash.h
index 06c64f54..0738cf36 100644
--- a/digital/avr/modules/flash/flash.h
+++ b/digital/avr/modules/flash/flash.h
@@ -29,6 +29,8 @@
#define FLASH_ADDRESS_HIGH 0x1FFFFF
#define FLASH_ADDRESS_ERROR 0xFFFFFF
+#define FLASH_ADDRESS_INC(val) \
+ ((val) + 1) & FLASH_ADDRESS_HIGH
#define FLASH_PAGE_SIZE 0x1000
#define FLASH_PAGE_MASK (FLASH_ADDRESS_HIGH & FLASH_PAGE_SIZE)