Sensors don't use ZCHAR in 2.4

Resolves #97
This commit is contained in:
Raphael Coeffic
2021-06-02 11:19:11 +02:00
committed by Raphael Coeffic
parent 25cce2611c
commit 6d490bddf0
28 changed files with 2157 additions and 2195 deletions
+1 -2
View File
@@ -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;
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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 {