mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 01:05:10 +03:00
Reset SF can now reset individual telemetry items (fix #161)
This commit is contained in:
parent
51500d4455
commit
aced02f2bb
5 changed files with 48 additions and 8 deletions
|
@ -453,6 +453,23 @@ int availableTelemetryIndex()
|
|||
return -1;
|
||||
}
|
||||
|
||||
int lastUsedTelemetryIndex()
|
||||
{
|
||||
for (int index=TELEM_VALUES_MAX-1; index>=0; index--) {
|
||||
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index];
|
||||
if (telemetrySensor.isAvailable()) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool isSensorAvailableInResetSpecialFunction(int index)
|
||||
{
|
||||
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index-FUNC_RESET_PARAM_FIRST_TELEM];
|
||||
return telemetrySensor.isAvailable();
|
||||
}
|
||||
|
||||
void setTelemetryValue(TelemetryProtocol protocol, uint16_t id, uint8_t instance, int32_t value, uint32_t unit, uint32_t prec)
|
||||
{
|
||||
int index = getTelemetryIndex(protocol, id, instance);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue