mcu_standby() Lua function fix #7467
This commit is contained in:
parent
99b954788e
commit
199032e4ed
|
@ -18,6 +18,7 @@ DDEFS += -DEFI_SENT_SUPPORT=TRUE
|
||||||
# we have hellen board id BOARD_ID_GDI4CHAN_A
|
# we have hellen board id BOARD_ID_GDI4CHAN_A
|
||||||
|
|
||||||
DDEFS += -DHW_HELLEN_4K_GDI=1
|
DDEFS += -DHW_HELLEN_4K_GDI=1
|
||||||
|
DDEFS += -DLUA_STM32_STANDBY=1
|
||||||
|
|
||||||
include $(BOARDS_DIR)/hellen/hellen-common-mega144.mk
|
include $(BOARDS_DIR)/hellen/hellen-common-mega144.mk
|
||||||
|
|
||||||
|
|
|
@ -26,3 +26,4 @@ endif
|
||||||
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ALPHAX_8CHAN
|
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ALPHAX_8CHAN
|
||||||
|
|
||||||
DDEFS += -DHW_HELLEN_8CHAN=1
|
DDEFS += -DHW_HELLEN_8CHAN=1
|
||||||
|
DDEFS += -DLUA_STM32_STANDBY=1
|
||||||
|
|
|
@ -33,4 +33,6 @@ DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ALPHAX_8CHAN
|
||||||
|
|
||||||
DDEFS += -DHW_HELLEN_8CHAN=1
|
DDEFS += -DHW_HELLEN_8CHAN=1
|
||||||
|
|
||||||
|
DDEFS += -DLUA_STM32_STANDBY=1
|
||||||
|
|
||||||
ONBOARD_MEMS_TYPE=LIS2DH12
|
ONBOARD_MEMS_TYPE=LIS2DH12
|
||||||
|
|
|
@ -84,7 +84,9 @@ void configureRusefiLuaUtilHooks(lua_State* lState) {
|
||||||
#define STARTUP_STANDBY_PROHIBITED_PERIOD_SEC 3
|
#define STARTUP_STANDBY_PROHIBITED_PERIOD_SEC 3
|
||||||
#endif
|
#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*) {
|
lua_register(lState, "mcu_standby", [](lua_State*) {
|
||||||
if (getTimeNowS() < STARTUP_STANDBY_PROHIBITED_PERIOD_SEC) {
|
if (getTimeNowS() < STARTUP_STANDBY_PROHIBITED_PERIOD_SEC) {
|
||||||
criticalError("mcu_standby invoked right on start");
|
criticalError("mcu_standby invoked right on start");
|
||||||
|
|
Loading…
Reference in New Issue