1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

Review sensor physID handling (#7374)

Review sensor physID handling
This commit is contained in:
3djc 2020-03-10 18:15:03 +01:00 committed by GitHub
parent e4f8735c7a
commit cc585950c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -104,7 +104,7 @@ void menuModelSensor(event_t event)
if (sensor->type == TELEM_TYPE_CUSTOM) {
lcdDrawTextAlignedLeft(y, STR_ID);
lcdDrawHexNumber(SENSOR_2ND_COLUMN, y, sensor->id, LEFT|(menuHorizontalPosition==0 ? attr : 0));
lcdDrawHexChar(SENSOR_3RD_COLUMN, y, (sensor->instance & 0x1F) + 1, LEFT|(menuHorizontalPosition==1 ? attr : 0));
lcdDrawNumber(SENSOR_3RD_COLUMN, y, (sensor->instance & 0x1F) + 1, LEFT|(menuHorizontalPosition==1 ? attr : 0));
if (attr && s_editMode > 0) {
switch (menuHorizontalPosition) {
case 0:

View file

@ -326,7 +326,7 @@ uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
if (isTelemetryFieldAvailable(i)) {
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
if (sensor->id == id) {
return sensor->instance;
return sensor->frskyInstance.physID + 1;
}
}
}

View file

@ -168,7 +168,13 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t origin, const uint8_t * packe
if (primId == DATA_FRAME) {
uint8_t originMask;
if (origin == TELEMETRY_ENDPOINT_SPORT) {
#if defined(SIMU) && defined(INTERNAL_MODULE_PXX2)
// When running simu on ACCESS radio, we set the origin as internal module
origin = 0;
originMask = 0x01;
#else
originMask = 0x04;
#endif
}
else {
uint8_t moduleIndex = (origin >> 2);