From: Keith Packard Date: Tue, 23 Jun 2020 23:16:28 +0000 (-0700) Subject: altos/ao_storage: Allow apps to #define storage parameters X-Git-Tag: 1.9.5~1^2~46 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=0375e9840ea1bcc486b56ccb3aaace57875312a7 altos/ao_storage: Allow apps to #define storage parameters This avoids placing them in RAM. Signed-off-by: Keith Packard --- diff --git a/src/kernel/ao_storage.h b/src/kernel/ao_storage.h index 1c5867e0..026074b5 100644 --- a/src/kernel/ao_storage.h +++ b/src/kernel/ao_storage.h @@ -31,10 +31,14 @@ typedef ao_storage_pos_t ao_pos_t; /* Total bytes of available storage */ +#ifndef ao_storage_total extern ao_pos_t ao_storage_total; +#endif /* Block size - device is erased in these units. At least 256 bytes */ +#ifndef ao_storage_block extern ao_pos_t ao_storage_block; +#endif #ifndef USE_STORAGE_CONFIG #define USE_STORAGE_CONFIG 1 @@ -50,7 +54,9 @@ extern ao_pos_t ao_storage_config; #endif /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */ +#ifndef ao_storage_unit extern uint16_t ao_storage_unit; +#endif /* Initialize above values. Can only be called once the OS is running */ void