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
+5 -2
View File
@@ -86,10 +86,13 @@ bool menuRadioTrainer(event_t event)
if (attr) s_editMode = 0;
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 6*FH, STR_CAL, attr);
for (int i=0; i<4; i++) {
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(TRAINER_COLUMN_1+i*TRAINER_COLUMN_WIDTH, MENU_CONTENT_TOP + 6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])*2, LEFT|PREC1);
lcdDrawNumber(TRAINER_COLUMN_1+i*TRAINER_COLUMN_WIDTH, MENU_CONTENT_TOP + 6*FH, chVal, LEFT|PREC1);
#else
lcdDrawNumber(TRAINER_COLUMN_1+i*TRAINER_COLUMN_WIDTH, MENU_CONTENT_TOP + 6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])/5, LEFT);
lcdDrawNumber(TRAINER_COLUMN_1+i*TRAINER_COLUMN_WIDTH, MENU_CONTENT_TOP + 6*FH, chVal / 10, LEFT);
#endif
}