altos: Broke TeleMetrum GPS reporting by holding the GPS mutex too much
[fw/altos] / src / core / ao_storage.h
index ea94639980c0574105a280844f948c394780e538..6cc6fcb70797bfa5dbc66fed6979925e58d44c50 100644 (file)
@@ -35,14 +35,22 @@ extern __pdata ao_pos_t     ao_storage_total;
 /* Block size - device is erased in these units. At least 256 bytes */
 extern __pdata ao_pos_t        ao_storage_block;
 
+#ifndef USE_STORAGE_CONFIG
+#define USE_STORAGE_CONFIG 1
+#endif
+
+#if USE_STORAGE_CONFIG
 /* Byte offset of config block. Will be ao_storage_block bytes long */
 extern __pdata ao_pos_t        ao_storage_config;
 
+#define ao_storage_log_max     ao_storage_config
+#else
+#define ao_storage_log_max     ao_storage_total
+#endif
+
 /* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */
 extern __pdata uint16_t ao_storage_unit;
 
-#define AO_STORAGE_ERASE_LOG   (ao_storage_config + AO_CONFIG_MAX_SIZE)
-
 /* Initialize above values. Can only be called once the OS is running */
 void
 ao_storage_setup(void) __reentrant;