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

[Taranis] Issue #554 Radio part done. We have now modes on trims.

Let's say we are configuring the Rudder Trim on phase 1:
- R:0  => Rudder trim = Rudder trim(phase 0)
- R+0  => Rudder trim = Rudder trim(phase 0) + Rudder trim(phase 1)
- R--  => Rudder trim is OFF

Still needs to be done:
- The result on screen is awful. I need ideas. Martin?
- Companion conversions / UI for this feature
- R+1 when configuring Rudder Trim on phase 1 should be impossible
This commit is contained in:
Bertrand Songis 2014-01-24 16:49:33 +01:00
parent 6fd9c47649
commit 046a4d253d
5 changed files with 128 additions and 47 deletions

View file

@ -1162,9 +1162,31 @@ void putsTmrMode(xcoord_t x, uint8_t y, int8_t mode, LcdFlags att)
putsSwitches(x, y, mode-(TMR_VAROFS-1), att);
}
#if defined(PCBTARANIS)
void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
{
int16_t v = getRawTrimValue(phase, idx);
trim_t v = getRawTrimValue(phase, idx);
putsChnLetter(x, y, idx+1, att);
if (v.mode < 0) {
lcd_putsAtt(x+FWNUM, y, "--", att);
}
else {
uint8_t p = v.mode >> 1;
if (v.mode % 2 == 0) {
lcd_putcAtt(x+FWNUM, y, '+', att);
}
else {
lcd_putcAtt(x+FWNUM, y, ':', att);
}
lcd_putcAtt(x+2*FWNUM, y, '0'+p, att);
}
}
#else
void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)
{
trim_t v = getRawTrimValue(phase, idx);
if (v > TRIM_EXTENDED_MAX) {
uint8_t p = v - TRIM_EXTENDED_MAX - 1;
@ -1175,6 +1197,7 @@ void putsTrimMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags at
putsChnLetter(x, y, idx+1, att);
}
}
#endif
#if ROTARY_ENCODERS > 0
void putsRotaryEncoderMode(xcoord_t x, uint8_t y, uint8_t phase, uint8_t idx, LcdFlags att)