Problem with bars thresholds

This commit is contained in:
bsongis
2012-06-29 21:32:37 +00:00
parent 133a52473d
commit 2d99899bce
3 changed files with 16 additions and 16 deletions
-14
View File
@@ -63,20 +63,6 @@ uint16_t currentConsumptionBoundary = 0;
FrskyData frskyData;
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
enum BarThresholdIdx {
THLD_ALT,
THLD_RPM,
THLD_FUEL,
THLD_T1,
THLD_T2,
THLD_SPEED,
THLD_DIST,
THLD_GPSALT,
THLD_CELL,
THLD_CURRENT,
THLD_CONSUMPTION,
THLD_MAX,
};
uint8_t barsThresholds[THLD_MAX];
#endif
+15 -1
View File
@@ -163,7 +163,21 @@ struct FrskyData {
};
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
extern uint8_t barsThresholds[];
enum BarThresholdIdx {
THLD_ALT,
THLD_RPM,
THLD_FUEL,
THLD_T1,
THLD_T2,
THLD_SPEED,
THLD_DIST,
THLD_GPSALT,
THLD_CELL,
THLD_CURRENT,
THLD_CONSUMPTION,
THLD_MAX,
};
extern uint8_t barsThresholds[THLD_MAX];
#endif
// Global Fr-Sky telemetry data variables
+1 -1
View File
@@ -566,7 +566,7 @@ bool __getSwitch(int8_t swtch)
// Telemetry
if (cs.v1 > CSW_CHOUT_BASE+NUM_CHNOUT) {
y = convertTelemValue(cs.v1-(CSW_CHOUT_BASE+NUM_CHNOUT), 128+cs.v2);
uint8_t idx = cs.v1-CSW_CHOUT_BASE-NUM_CHNOUT-TELEM_ALT
uint8_t idx = cs.v1-CSW_CHOUT_BASE-NUM_CHNOUT-TELEM_ALT;
if (idx < THLD_MAX) {
// Fill the threshold array
barsThresholds[idx] = 128 + cs.v2;