From 527039e7a479e6985737c88ae4f5466695bab018 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 12 May 2023 18:13:27 -0400 Subject: [PATCH] weak standby callback --- firmware/controllers/algo/engine_configuration.cpp | 2 ++ firmware/controllers/algo/engine_configuration.h | 5 +++-- firmware/controllers/lua/lua_hooks_util.cpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 1f6731f8b2..06499184bd 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -1044,5 +1044,7 @@ void commonFrankensoAnalogInputs() { __attribute__((weak)) void setBoardDefaultConfiguration() { } __attribute__((weak)) void setBoardConfigOverrides() { } +__attribute__((weak)) void onBoardStandBy() { } + __attribute__((weak)) int getBoardMetaOutputsCount() { return 0; } __attribute__((weak)) Gpio* getBoardMetaOutputs() { return nullptr; } diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index eb7da2abd9..eb969fdee4 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -60,8 +60,9 @@ void resetConfigurationExt(engine_type_e engineType); void rememberCurrentConfiguration(); #endif /* __cplusplus */ -void setBoardDefaultConfiguration(void); -void setBoardConfigOverrides(void); +void setBoardDefaultConfiguration(); +void setBoardConfigOverrides(); +void onBoardStandBy(); void boardOnConfigurationChange(engine_configuration_s *previousConfiguration); #if !EFI_UNIT_TEST diff --git a/firmware/controllers/lua/lua_hooks_util.cpp b/firmware/controllers/lua/lua_hooks_util.cpp index e930fdd86c..f1f53d6fbb 100644 --- a/firmware/controllers/lua/lua_hooks_util.cpp +++ b/firmware/controllers/lua/lua_hooks_util.cpp @@ -82,6 +82,7 @@ void configureRusefiLuaUtilHooks(lua_State* l) { #if defined(STM32F4) || defined(STM32F7) lua_register(l, "mcu_standby", [](lua_State*) { + onBoardStandBy(); stm32_standby(); return 0; });