chore: Fix a bunch of compile warnings (#2748)
* chore: fix warnings for simu and firmware, part 1 * chore: fix warnings
This commit is contained in:
@@ -31,9 +31,11 @@ LvglWrapper* LvglWrapper::_instance = nullptr;
|
||||
|
||||
static lv_indev_drv_t touchDriver;
|
||||
static lv_indev_drv_t keyboard_drv;
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
static lv_indev_drv_t rotaryDriver;
|
||||
|
||||
static lv_indev_t* rotaryDevice = nullptr;
|
||||
#endif
|
||||
static lv_indev_t* keyboardDevice = nullptr;
|
||||
static lv_indev_t* touchDevice = nullptr;
|
||||
|
||||
|
||||
@@ -153,8 +153,6 @@ void BindWaitDialog::checkEvents()
|
||||
{
|
||||
auto& bindInfo = getPXX2BindInformationBuffer();
|
||||
|
||||
auto form = &content->form;
|
||||
|
||||
if (moduleState[moduleIdx].mode == MODULE_MODE_NORMAL) {
|
||||
|
||||
// returned to normal after bind
|
||||
@@ -842,8 +840,8 @@ void RxOptions::update()
|
||||
selectionMax++;
|
||||
}
|
||||
|
||||
uint8_t mapping = hwSettings.receiverSettings.outputsMapping[i];
|
||||
uint8_t channel = getShiftedChannel(moduleIdx, mapping);
|
||||
//uint8_t mapping = hwSettings.receiverSettings.outputsMapping[i];
|
||||
// uint8_t channel = getShiftedChannel(moduleIdx, mapping);
|
||||
|
||||
// TODO
|
||||
// auto r = grid.getFieldSlot(2, 1);
|
||||
|
||||
@@ -57,7 +57,7 @@ InputMixGroup::InputMixGroup(Window* parent, mixsrc_t idx) :
|
||||
if (idx >= MIXSRC_FIRST_CH && idx <= MIXSRC_LAST_CH
|
||||
&& g_model.limitData[idx - MIXSRC_CH1].name[0] != '\0') {
|
||||
chText = lv_label_create(lvobj);
|
||||
lv_label_set_text_fmt(chText, TR_CH "%u", idx - MIXSRC_CH1 + 1);
|
||||
lv_label_set_text_fmt(chText, TR_CH "%zu", (size_t)(idx - MIXSRC_CH1 + 1));
|
||||
lv_obj_set_style_text_font(chText, getFont(FONT(XS)), 0);
|
||||
#if LCD_H > LCD_W
|
||||
lv_obj_set_style_pad_bottom(chText, -2, 0);
|
||||
|
||||
@@ -122,20 +122,19 @@ InputSource::InputSource(Window* parent, ExpoData* input) :
|
||||
|
||||
sensor_form = new FormGroup(this, rect_t{});
|
||||
sensor_form->setFlexLayout();
|
||||
auto sensor_form_obj = sensor_form->getLvObj();
|
||||
|
||||
FlexGridLayout grid(col_dsc, row_dsc);
|
||||
auto line = sensor_form->newLine(&grid);
|
||||
|
||||
// Value
|
||||
Window* w = new StaticText(line, rect_t{}, STR_VALUE, 0, COLOR_THEME_PRIMARY1);
|
||||
new StaticText(line, rect_t{}, STR_VALUE, 0, COLOR_THEME_PRIMARY1);
|
||||
auto sensor = new SensorValue(line, rect_t{}, input);
|
||||
|
||||
|
||||
// Scale
|
||||
line = sensor_form->newLine(&grid);
|
||||
w = new StaticText(line, rect_t{}, STR_SCALE, 0, COLOR_THEME_PRIMARY1);
|
||||
w = new NumberEdit(line, rect_t{}, 0,
|
||||
new StaticText(line, rect_t{}, STR_SCALE, 0, COLOR_THEME_PRIMARY1);
|
||||
new NumberEdit(line, rect_t{}, 0,
|
||||
maxTelemValue(input->srcRaw - MIXSRC_FIRST_TELEM + 1),
|
||||
GET_SET_DEFAULT(input->scale), 0, sensor->getSensorPrec());
|
||||
|
||||
|
||||
@@ -106,11 +106,13 @@ void MainView6POS::paint(BitmapBuffer * dc)
|
||||
void MainView6POS::checkEvents()
|
||||
{
|
||||
Window::checkEvents();
|
||||
#if NUM_XPOTS > 0 // prevent compiler warning
|
||||
int16_t newValue = 1 + (potsPos[idx] & 0x0f);
|
||||
if (value != newValue) {
|
||||
value = newValue;
|
||||
invalidate();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
MainViewVerticalSlider::MainViewVerticalSlider(Window* parent, uint8_t idx) :
|
||||
|
||||
@@ -58,7 +58,7 @@ void lcdSetFlushCb(void (*cb)(lv_disp_drv_t *, uint16_t*, const rect_t&))
|
||||
|
||||
static lv_disp_drv_t* refr_disp = nullptr;
|
||||
|
||||
#if !defined(LCD_VERTICAL_INVERT)
|
||||
#if !defined(LCD_VERTICAL_INVERT) && 0
|
||||
// TODO: DMA copy would be possible (use function from draw_ctx???
|
||||
static void _copy_screen_area(uint16_t* dst, uint16_t* src, const lv_area_t& copy_area)
|
||||
{
|
||||
|
||||
@@ -145,7 +145,7 @@ class InputLineButton : public InputMixButton
|
||||
|
||||
if (line.name[0]) {
|
||||
int cnt = lv_snprintf(s, maxlen, "%.*s ", (int)sizeof(line.name), line.name);
|
||||
if (cnt >= maxlen) maxlen = 0;
|
||||
if ((size_t)cnt >= maxlen) maxlen = 0;
|
||||
else { maxlen -= cnt; s += cnt; }
|
||||
}
|
||||
|
||||
@@ -153,13 +153,13 @@ class InputLineButton : public InputMixButton
|
||||
if (line.swtch) {
|
||||
char* sw_pos = getSwitchPositionName(line.swtch);
|
||||
int cnt = lv_snprintf(s, maxlen, "%s ", sw_pos);
|
||||
if (cnt >= maxlen) maxlen = 0;
|
||||
if ((size_t)cnt >= maxlen) maxlen = 0;
|
||||
else { maxlen -= cnt; s += cnt; }
|
||||
}
|
||||
if (line.curve.value != 0) {
|
||||
getCurveRefString(s, maxlen, line.curve);
|
||||
int cnt = strnlen(s, maxlen);
|
||||
if (cnt >= maxlen) maxlen = 0;
|
||||
if ((size_t)cnt >= maxlen) maxlen = 0;
|
||||
else { maxlen -= cnt; s += cnt; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ void MixLineButton::refresh()
|
||||
|
||||
if (line.name[0]) {
|
||||
int cnt = lv_snprintf(s, maxlen, "%.*s ", (int)sizeof(line.name), line.name);
|
||||
if (cnt >= maxlen) maxlen = 0;
|
||||
if ((size_t)cnt >= maxlen) maxlen = 0;
|
||||
else { maxlen -= cnt; s += cnt; }
|
||||
}
|
||||
|
||||
@@ -275,13 +275,13 @@ void MixLineButton::refresh()
|
||||
if (line.swtch) {
|
||||
char* sw_pos = getSwitchPositionName(line.swtch);
|
||||
int cnt = lv_snprintf(s, maxlen, "%s ", sw_pos);
|
||||
if (cnt >= maxlen) maxlen = 0;
|
||||
if ((size_t)cnt >= maxlen) maxlen = 0;
|
||||
else { maxlen -= cnt; s += cnt; }
|
||||
}
|
||||
if (line.curve.value != 0) {
|
||||
getCurveRefString(s, maxlen, line.curve);
|
||||
int cnt = strnlen(s, maxlen);
|
||||
if (cnt >= maxlen) maxlen = 0;
|
||||
if ((size_t)cnt >= maxlen) maxlen = 0;
|
||||
else { maxlen -= cnt; s += cnt; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,12 +466,12 @@ void ModelTelemetryPage::build(FormWindow * window, int8_t focusSensorIndex)
|
||||
grid.nextLine();
|
||||
|
||||
new StaticText(window, grid.getLabelSlot(true), STR_LOWALARM, 0, COLOR_THEME_PRIMARY1);
|
||||
auto edit = new NumberEdit(window, grid.getFieldSlot(), 0, 100,
|
||||
new NumberEdit(window, grid.getFieldSlot(), 0, 100,
|
||||
GET_SET_DEFAULT(g_model.rfAlarms.warning));
|
||||
grid.nextLine();
|
||||
|
||||
new StaticText(window, grid.getLabelSlot(true), STR_CRITICALALARM, 0, COLOR_THEME_PRIMARY1);
|
||||
edit = new NumberEdit(window, grid.getFieldSlot(), 0, 100,
|
||||
new NumberEdit(window, grid.getFieldSlot(), 0, 100,
|
||||
GET_SET_DEFAULT(g_model.rfAlarms.critical));
|
||||
grid.nextLine();
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ class PreviewWindow : public FormGroup
|
||||
|
||||
gettime(&t);
|
||||
int s = snprintf(str, sizeof(str), "%d %s\n", t.tm_mday, STR_MONTHS[t.tm_mon]);
|
||||
if (s > 0 && s < sizeof(str) - 6 /* 00:00\0 */) {
|
||||
if (s > 0 && (size_t)s < sizeof(str) - 6 /* 00:00\0 */) {
|
||||
getTimerString(str + s, getValue(MIXSRC_TX_TIME));
|
||||
}
|
||||
dc->drawText(rect.w - 40, 5, str, COLOR_THEME_PRIMARY2 | FONT(XS));
|
||||
|
||||
@@ -52,9 +52,6 @@ void draw_splash_cb(lv_event_t * e)
|
||||
|
||||
void drawSplash()
|
||||
{
|
||||
constexpr LcdFlags splash_background_color =
|
||||
COLOR2FLAGS(((0xC >> 3) << 11) | ((0x3F >> 2) << 5) | (0x66 >> 3));
|
||||
|
||||
static bool loadSplashImg = true;
|
||||
static BitmapBuffer* splashImg = nullptr;
|
||||
static lv_obj_t* splashScreen = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user