summaryrefslogtreecommitdiffhomepage
path: root/digital/avr/modules/flash/flash.c
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-10-21 13:38:44 +0200
committerNélio Laranjeiro2008-10-21 13:38:44 +0200
commit62dea0dc173ece90867f2aabd0af63c353517bfd (patch)
tree98e88407ff068f896fcfdb054da9cff6fa86a617 /digital/avr/modules/flash/flash.c
parent7500ab5bbecf67689c5069d2a8ae358b4f75899c (diff)
avr/modules/flash: (see ticket #36)
* Update the defines. * Modified the define for the flash page mask. * Update the sector_next function (Not tested yet).
Diffstat (limited to 'digital/avr/modules/flash/flash.c')
-rw-r--r--digital/avr/modules/flash/flash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/digital/avr/modules/flash/flash.c b/digital/avr/modules/flash/flash.c
index edca7273..db5645aa 100644
--- a/digital/avr/modules/flash/flash.c
+++ b/digital/avr/modules/flash/flash.c
@@ -141,16 +141,16 @@ flash_init (void)
}
/** Find the next sector to write.
- * \return the address of the next sector.
- */
+ * \param addr the address to start the research.
+ * \return the address of the next sector.
+ */
uint32_t
-flash_sector_next (void)
+flash_sector_next (uint32_t addr)
{
- uint32_t addr;
uint8_t rsp = 0;
/* Search for the next address to start writing. */
- for (addr = 0;
+ for (addr = FLASH_PAGE (addr);
(rsp != 0xFF) && (addr < FLASH_ADDRESS_HIGH);
addr += FLASH_PAGE_SIZE - 1)
{