altos/ao_storage: allow erased byte value to be set by application
[fw/altos] / src / kernel / ao_storage.c
index 1554cee777254740a0d98f1bd8d7e3b71f8dad7c..213ec2d6872825cda21173ff15a13bfd8d6a5a6b 100644 (file)
@@ -86,6 +86,10 @@ ao_storage_write(ao_pos_t pos, void *v_buf, uint16_t len)
        return 1;
 }
 
+#ifndef AO_STORAGE_ERASED_BYTE
+#define AO_STORAGE_ERASED_BYTE 0xff
+#endif
+
 uint8_t
 ao_storage_is_erased(uint32_t pos)
 {
@@ -107,7 +111,7 @@ ao_storage_is_erased(uint32_t pos)
                        goto done;
                }
                for (i = 0; i < this_time; i++)
-                       if (storage_data[i] != 0xff) {
+                       if (storage_data[i] != AO_STORAGE_ERASED_BYTE) {
                                ret = 0;
                                goto done;
                        }