Add support for multi-protocol trainer (#6896)

* Add support for multi-protocol trainer

* Fix telemetry condition

* Trainer mode not supported on Sky9X

* fixed radio trainer screen

- convert values properly.
- apply the weights as setup.

* Fix T16 with BT

* String fixes

* Cosmetics
This commit is contained in:
Raphael Coeffic
2019-10-22 15:53:12 +02:00
committed by 3djc
parent 5c9fba04c7
commit 6d77932f89
17 changed files with 107 additions and 40 deletions
@@ -88,10 +88,13 @@ void menuRadioTrainer(event_t event)
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
for (uint8_t i=0; i<4; i++) {
uint8_t x = (i*TRAINER_CALIB_COLUMN_WIDTH + 16) * FW/2;
int32_t chVal = ppmInput[i] - g_eeGeneral.trainer.calib[i];
chVal *= g_eeGeneral.trainer.mix[i].studWeight * 10;
chVal /= 512;
#if defined (PPM_UNIT_PERCENT_PREC1)
lcdDrawNumber(x, MENU_HEADER_HEIGHT+1+6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])*2, PREC1|RIGHT);
lcdDrawNumber(x, MENU_HEADER_HEIGHT+1+6*FH, chVal, PREC1|RIGHT);
#else
lcdDrawNumber(x, MENU_HEADER_HEIGHT+1+6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])/5, RIGHT);
lcdDrawNumber(x, MENU_HEADER_HEIGHT+1+6*FH, chVal / 10, RIGHT);
#endif
}