summaryrefslogtreecommitdiff
path: root/src/ao_config.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-01-06 12:51:39 -0800
committerKeith Packard <keithp@keithp.com>2011-01-06 12:51:39 -0800
commitddcc94da4326f9ce954bd31a46b36165c58e6c18 (patch)
tree808d9c89e1d43e22017655217e730e54d79ed397 /src/ao_config.c
parentf3f1b1488bdc92fa9277dc549ba9f3210a8d4c8c (diff)
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 <keithp@keithp.com>
Diffstat (limited to 'src/ao_config.c')
-rw-r--r--src/ao_config.c7
1 files changed, 5 insertions, 2 deletions
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;