From 841aade75549a4aa130ddb4124d915c6004db458 Mon Sep 17 00:00:00 2001 From: Tester23 Date: Thu, 28 Sep 2023 08:41:00 +0200 Subject: [PATCH] fix build without lfs --- openBeken_win32_mvsc2017.vcxproj | 1 + openBeken_win32_mvsc2017.vcxproj.filters | 3 +++ src/littlefs/our_lfs.h | 3 ++- src/obk_config.h | 1 + src/win_main.c | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/openBeken_win32_mvsc2017.vcxproj b/openBeken_win32_mvsc2017.vcxproj index f32f05c82..4c70093f7 100644 --- a/openBeken_win32_mvsc2017.vcxproj +++ b/openBeken_win32_mvsc2017.vcxproj @@ -1321,6 +1321,7 @@ true true + diff --git a/openBeken_win32_mvsc2017.vcxproj.filters b/openBeken_win32_mvsc2017.vcxproj.filters index 0003e72e9..1d2d3c273 100644 --- a/openBeken_win32_mvsc2017.vcxproj.filters +++ b/openBeken_win32_mvsc2017.vcxproj.filters @@ -1298,6 +1298,9 @@ Drv + + LFS + diff --git a/src/littlefs/our_lfs.h b/src/littlefs/our_lfs.h index b3842dd9d..47754d082 100644 --- a/src/littlefs/our_lfs.h +++ b/src/littlefs/our_lfs.h @@ -11,7 +11,7 @@ #include "../obk_config.h" #include "lfs.h" -#if ENABLE_LITTLEFS +// we need that even if LFS is disabled #if PLATFORM_BK7231T // start 0x1000 after OTA addr @@ -34,6 +34,7 @@ #define LFS_BLOCKS_END 0x1AB000 #endif +#if ENABLE_LITTLEFS // 512k MAX - i.e. no more that 0x80000 // 0x8000 = 32k diff --git a/src/obk_config.h b/src/obk_config.h index 906be22eb..43cfe1e72 100644 --- a/src/obk_config.h +++ b/src/obk_config.h @@ -52,6 +52,7 @@ #define ENABLE_DRIVER_CHARGINGLIMIT 1 #define ENABLE_DRIVER_BATTERY 1 + #elif PLATFORM_BL602 // I have enabled drivers on BL602 diff --git a/src/win_main.c b/src/win_main.c index 942c09213..862c6bbb7 100644 --- a/src/win_main.c +++ b/src/win_main.c @@ -9,6 +9,7 @@ #include #include #include +#include "obk_config.h" #include "new_common.h" #include "driver\drv_public.h" #include "cmnds\cmd_public.h" @@ -111,7 +112,9 @@ void SIM_Hack_ClearSimulatedPinRoles(); void SIM_ClearOBK(const char *flashPath) { if (bObkStarted) { DRV_ShutdownAllDrivers(); +#if ENABLE_LITTLEFS release_lfs(); +#endif SIM_Hack_ClearSimulatedPinRoles(); WIN_ResetMQTT(); UART_ResetForSimulator();