mcu_standby() Lua function fix #7467

This commit is contained in:
rusefillc 2025-02-19 09:57:07 -05:00
parent 99b954788e
commit 199032e4ed
4 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,7 @@ DDEFS += -DEFI_SENT_SUPPORT=TRUE
# we have hellen board id BOARD_ID_GDI4CHAN_A
DDEFS += -DHW_HELLEN_4K_GDI=1
DDEFS += -DLUA_STM32_STANDBY=1
include $(BOARDS_DIR)/hellen/hellen-common-mega144.mk

View File

@ -26,3 +26,4 @@ endif
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ALPHAX_8CHAN
DDEFS += -DHW_HELLEN_8CHAN=1
DDEFS += -DLUA_STM32_STANDBY=1

View File

@ -33,4 +33,6 @@ DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ALPHAX_8CHAN
DDEFS += -DHW_HELLEN_8CHAN=1
DDEFS += -DLUA_STM32_STANDBY=1
ONBOARD_MEMS_TYPE=LIS2DH12

View File

@ -84,7 +84,9 @@ void configureRusefiLuaUtilHooks(lua_State* lState) {
#define STARTUP_STANDBY_PROHIBITED_PERIOD_SEC 3
#endif
#if defined(STM32F4) || defined(STM32F7)
// works on STM32F4 and STM32F7 but only on specific boards
// (it's all about PA0 being not used by ADC etc)
#if defined(LUA_STM32_STANDBY)
lua_register(lState, "mcu_standby", [](lua_State*) {
if (getTimeNowS() < STARTUP_STANDBY_PROHIBITED_PERIOD_SEC) {
criticalError("mcu_standby invoked right on start");