altos/ao_storage: Allow apps to #define storage parameters
authorKeith Packard <keithp@keithp.com>
Tue, 23 Jun 2020 23:16:28 +0000 (16:16 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 8 Aug 2020 03:30:11 +0000 (20:30 -0700)
This avoids placing them in RAM.

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

index 1c5867e09eed3e9dc78f79a9a00490d488c3d9a4..026074b5d2db4c2bd30768a2e1fcd2de780bc636 100644 (file)
 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