altos: Allow use of internal EEPROM for config storage
[fw/altos] / src / core / ao_storage.h
index ea94639980c0574105a280844f948c394780e538..d6e95605e7e6265e3bc8e17c8ff4ae3e2f3bdcb7 100644 (file)
@@ -35,9 +35,19 @@ 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;