From b1d25ac7b72045a82c3c1820a4bc878e9c9e4032 Mon Sep 17 00:00:00 2001 From: Tavis Date: Thu, 26 Dec 2024 15:08:31 -0800 Subject: [PATCH] fix for nrf52 lfs assert boot loop (#5670) * fix for nrf52 lfs assert boot loop * guard format in ifdef FSCom block * add ifndef portduino for format call --- src/FSCommon.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index 6cd17dac8..df46c1941 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -55,6 +55,15 @@ extern "C" void lfs_assert(const char *reason) { LOG_ERROR("LFS assert: %s", reason); lfs_assert_failed = true; + +#ifndef ARCH_PORTDUINO +#ifdef FSCom + // CORRUPTED FILESYSTEM. This causes bootloop so + // might as well try formatting now. + LOG_ERROR("Trying FSCom.format()"); + FSCom.format(); +#endif +#endif } /**