projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Simplify storage API
[fw/altos]
/
src
/
ao_config.c
diff --git
a/src/ao_config.c
b/src/ao_config.c
index fd33e2cc2569b6229a4b81a8b01518102031512b..2153b84152fdacdd645677f0375865870312bf16 100644
(file)
--- 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)
{
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
}
#endif
@@
-42,7
+44,8
@@
_ao_config_get(void)
if (ao_config_loaded)
return;
#if HAS_EEPROM
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;
#endif
if (ao_config.major != AO_CONFIG_MAJOR) {
ao_config.major = AO_CONFIG_MAJOR;