Color LCD Fix SBUS rate. PPM use defines

This commit is contained in:
dlktdr
2021-11-04 15:25:34 +10:00
committed by Peter Feerick
parent 172caf09bc
commit 4ae6152d62
+8 -8
View File
@@ -1197,13 +1197,13 @@ class ModuleWindow : public FormGroup {
// PPM frame length // PPM frame length
auto edit = new NumberEdit( auto edit = new NumberEdit(
this, grid.getFieldSlot(3, 0), 125, 35 * 5 + 225, this, grid.getFieldSlot(3, 0), 125, 35 * PPM_STEP_SIZE + PPM_DEF_PERIOD,
GET_DEFAULT(g_model.moduleData[moduleIdx].ppm.frameLength * 5 + GET_DEFAULT(g_model.moduleData[moduleIdx].ppm.frameLength * PPM_STEP_SIZE +
225), PPM_DEF_PERIOD),
SET_VALUE(g_model.moduleData[moduleIdx].ppm.frameLength, SET_VALUE(g_model.moduleData[moduleIdx].ppm.frameLength,
(newValue - 225) / 5), (newValue - PPM_DEF_PERIOD) / PPM_STEP_SIZE),
0, PREC1); 0, PREC1);
edit->setStep(5); edit->setStep(PPM_STEP_SIZE);
edit->setSuffix(STR_MS); edit->setSuffix(STR_MS);
// PPM frame delay // PPM frame delay
@@ -1419,9 +1419,9 @@ class ModuleWindow : public FormGroup {
// SBUS refresh rate // SBUS refresh rate
if (isModuleSBUS(moduleIdx)) { if (isModuleSBUS(moduleIdx)) {
new StaticText(this, grid.getLabelSlot(true), STR_REFRESHRATE, 0, COLOR_THEME_PRIMARY1); new StaticText(this, grid.getLabelSlot(true), STR_REFRESHRATE, 0, COLOR_THEME_PRIMARY1);
auto edit = new NumberEdit(this, grid.getFieldSlot(2, 0), 60, 400, auto edit = new NumberEdit(this, grid.getFieldSlot(2, 0), SBUS_MIN_PERIOD, SBUS_MAX_PERIOD,
GET_DEFAULT((int16_t)g_model.moduleData[moduleIdx].ppm.frameLength*5 + 225), GET_DEFAULT((int16_t)g_model.moduleData[moduleIdx].sbus.refreshRate * SBUS_STEPSIZE + SBUS_DEF_PERIOD),
SET_VALUE(g_model.moduleData[moduleIdx].ppm.frameLength, (newValue - 225)/5), SET_VALUE(g_model.moduleData[moduleIdx].sbus.refreshRate, (newValue - SBUS_DEF_PERIOD) / SBUS_STEPSIZE),
0, PREC1); 0, PREC1);
edit->setSuffix(STR_MS); edit->setSuffix(STR_MS);
edit->setStep(SBUS_STEPSIZE); edit->setStep(SBUS_STEPSIZE);