altos: Make sure flight erase log comes after config blog
authorKeith Packard <keithp@keithp.com>
Tue, 12 Nov 2013 07:22:49 +0000 (16:22 +0900)
committerKeith Packard <keithp@keithp.com>
Tue, 12 Nov 2013 07:27:31 +0000 (16:27 +0900)
Oops. When converting from ao_storage to ao_config, I accidentally had
the flight erase log overwriting the config block.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_log.c
src/core/ao_storage.h

index 1a1f5ff6c37a7c56bd4f6944b59616d599c6da5a..701c81aba7444ba95c8a4ae7203c5fa7683c61dc 100644 (file)
@@ -49,7 +49,7 @@ static __xdata struct ao_log_erase erase;
 static uint32_t
 ao_log_erase_pos(uint8_t i)
 {
 static uint32_t
 ao_log_erase_pos(uint8_t i)
 {
-       return i * sizeof (struct ao_log_erase);
+       return i * sizeof (struct ao_log_erase) + AO_CONFIG_MAX_SIZE;
 }
 
 void
 }
 
 void
index d6e95605e7e6265e3bc8e17c8ff4ae3e2f3bdcb7..6cc6fcb70797bfa5dbc66fed6979925e58d44c50 100644 (file)
@@ -51,8 +51,6 @@ extern __pdata ao_pos_t       ao_storage_config;
 /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */
 extern __pdata uint16_t ao_storage_unit;
 
 /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */
 extern __pdata uint16_t ao_storage_unit;
 
-#define AO_STORAGE_ERASE_LOG   (ao_storage_config + AO_CONFIG_MAX_SIZE)
-
 /* Initialize above values. Can only be called once the OS is running */
 void
 ao_storage_setup(void) __reentrant;
 /* Initialize above values. Can only be called once the OS is running */
 void
 ao_storage_setup(void) __reentrant;