From: joeycastillo Date: Sun, 27 Oct 2024 18:30:58 +0000 (-0400) Subject: don't reformat filesystem on every boot X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=59b58b549982bf1e59a3f3296a777207f36b2023;p=sensor-watch.git don't reformat filesystem on every boot --- diff --git a/filesystem/filesystem.c b/filesystem/filesystem.c index e265a86..3b47642 100644 --- a/filesystem/filesystem.c +++ b/filesystem/filesystem.c @@ -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;