mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 20:35:17 +03:00
The script for SBEC now searches for a SBEC sensor
This commit is contained in:
parent
3bc75c1d55
commit
d5ce54047c
3 changed files with 67 additions and 14 deletions
|
@ -1096,7 +1096,8 @@ static int luaSetTelemetryValue(lua_State * L)
|
|||
const char* name = luaL_optstring(L, 7, NULL);
|
||||
if (name != NULL && strlen(name) > 0) {
|
||||
str2zchar(zname, name, 4);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
zname[0] = hex2zchar((id & 0xf000) >> 12);
|
||||
zname[1] = hex2zchar((id & 0x0f00) >> 8);
|
||||
zname[2] = hex2zchar((id & 0x00f0) >> 4);
|
||||
|
@ -1111,7 +1112,8 @@ static int luaSetTelemetryValue(lua_State * L)
|
|||
telemetrySensor.instance = instance;
|
||||
telemetrySensor.init(zname, unit, prec);
|
||||
lua_pushboolean(L, true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
lua_pushboolean(L, false);
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue