committed by
Raphael Coeffic
parent
25cce2611c
commit
6d490bddf0
@@ -364,8 +364,7 @@ bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
|
||||
field.desc[0] = '\0';
|
||||
for (int i=0; i<MAX_TELEMETRY_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
char sensorName[TELEM_LABEL_LEN+1];
|
||||
int len = zchar2str(sensorName, g_model.telemetrySensors[i].label, TELEM_LABEL_LEN);
|
||||
const char* sensorName = g_model.telemetrySensors[i].label;
|
||||
if (!strncmp(sensorName, name, len)) {
|
||||
if (name[len] == '\0') {
|
||||
field.id = MIXSRC_FIRST_TELEM + 3*i;
|
||||
|
||||
@@ -1558,7 +1558,7 @@ static int luaModelGetSensor(lua_State *L)
|
||||
TelemetrySensor & sensor = g_model.telemetrySensors[idx];
|
||||
lua_newtable(L);
|
||||
lua_pushtableinteger(L, "type", sensor.type);
|
||||
lua_pushtablezstring(L, "name", sensor.label);
|
||||
lua_pushtablestring(L, "name", sensor.label);
|
||||
lua_pushtableinteger(L, "unit", sensor.unit);
|
||||
lua_pushtableinteger(L, "prec", sensor.prec);
|
||||
if (sensor.type == TELEM_TYPE_CUSTOM) {
|
||||
|
||||
@@ -841,7 +841,7 @@ void luaError(lua_State * L, uint8_t error, bool acknowledge)
|
||||
warningType = WARNING_TYPE_INFO;
|
||||
popupFunc = displayAcknowledgeLuaError;
|
||||
#else
|
||||
POPUP_WARNING(errorTitle, lua_warning_info);
|
||||
displayLuaError(errorTitle);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user