]> git.earman.xyz Git - sensor-watch.git/commitdiff
don't reformat filesystem on every boot
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 27 Oct 2024 18:30:58 +0000 (14:30 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 27 Oct 2024 18:30:58 +0000 (14:30 -0400)
filesystem/filesystem.c

index e265a8648050ff1504257bfa7a92785a9600b56f..3b476426684d7d8eccfb02b8261164bbe512776c 100644 (file)
@@ -142,7 +142,7 @@ bool filesystem_init(void) {
 
     // reformat if we can't mount the filesystem
     // this should only happen on the first boot
-    if (1) {
+    if (err < 0) {
         printf("Ignore that error! Formatting filesystem...\r\n");
         err = lfs_format(&eeprom_filesystem, &watch_lfs_cfg);
         if (err < 0) return false;