mirror of https://github.com/FOME-Tech/fome-fw.git
happy non-firmware
This commit is contained in:
parent
b81c30bd4a
commit
6a92e0cc69
|
@ -314,6 +314,14 @@ static int lua_getDigital(lua_State* l) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool getAuxDigital(int index) {
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
return efiReadPin(engineConfiguration->luaDigitalInputPins[index]);
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int lua_getAuxDigital(lua_State* l) {
|
static int lua_getAuxDigital(lua_State* l) {
|
||||||
auto idx = luaL_checkinteger(l, 1);
|
auto idx = luaL_checkinteger(l, 1);
|
||||||
if (idx < 0 || idx >= LUA_DIGITAL_INPUT_COUNT) {
|
if (idx < 0 || idx >= LUA_DIGITAL_INPUT_COUNT) {
|
||||||
|
@ -328,8 +336,11 @@ static int lua_getAuxDigital(lua_State* l) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool state = efiReadPin(engineConfiguration->luaDigitalInputPins[idx]);
|
#if !EFI_SIMULATOR
|
||||||
|
bool state = getAuxDigital(idx);
|
||||||
lua_pushboolean(l, state);
|
lua_pushboolean(l, state);
|
||||||
|
#endif // !EFI_SIMULATOR
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue