From ddcc94da4326f9ce954bd31a46b36165c58e6c18 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 6 Jan 2011 12:51:39 -0800 Subject: altos: Simplify storage API This removes the config-specific APIs and exposes global variables for the available storage space, block size and config storage location. Signed-off-by: Keith Packard --- src/ao_config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ao_config.c') diff --git a/src/ao_config.c b/src/ao_config.c index fd33e2cc..2153b841 100644 --- a/src/ao_config.c +++ b/src/ao_config.c @@ -32,7 +32,9 @@ __xdata uint8_t ao_config_mutex; static void _ao_config_put(void) { - ao_ee_write_config((uint8_t *) &ao_config, sizeof (ao_config)); + ao_storage_setup(); + ao_storage_write(ao_storage_config, &ao_config, sizeof (ao_config)); + ao_storage_flush(); } #endif @@ -42,7 +44,8 @@ _ao_config_get(void) if (ao_config_loaded) return; #if HAS_EEPROM - ao_ee_read_config((uint8_t *) &ao_config, sizeof (ao_config)); + ao_storage_setup(); + ao_storage_read(ao_storage_config, &ao_config, sizeof (ao_config)); #endif if (ao_config.major != AO_CONFIG_MAJOR) { ao_config.major = AO_CONFIG_MAJOR; -- cgit v1.2.3