color: fix print format warnings

This commit is contained in:
Raphael Coeffic
2022-07-04 07:56:28 +02:00
parent e9067e612f
commit 1bc35f54de
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -311,7 +311,7 @@ ColorEditor::ColorEditor(FormGroup *window, const rect_t rect, uint32_t color,
lv_label_set_text_static(barLabels[i], _colorType->getLabelChars()[i]);
barValLabels[i] = create_bar_value_label(lvobj, x + 10, y + 3);
lv_label_set_text_fmt(barValLabels[i], "%d", bar->value);
lv_label_set_text_fmt(barValLabels[i], "%" PRIu32, bar->value);
}
lv_obj_add_event_cb(lvobj, ColorEditor::value_changed, LV_EVENT_VALUE_CHANGED, nullptr);
@@ -336,7 +336,7 @@ void ColorEditor::setRGB()
// update bars & labels
for (int i = 0; i < MAX_BARS; i++) {
auto bar = _colorType->bars[i];
lv_label_set_text_fmt(barValLabels[i], "%d", bar->value);
lv_label_set_text_fmt(barValLabels[i], "%" PRIu32, bar->value);
bar->invalidate();
}
+3 -3
View File
@@ -33,7 +33,7 @@ struct MPMProtoOption : public FormGroup::Line
Choice* choice;
NumberEdit* edit;
CheckBox* cb;
DynamicNumber<int>* rssi;
DynamicNumber<uint16_t>* rssi;
MPMProtoOption(FormGroup* form, FlexGridLayout *layout);
void update(const MultiRfProtocols::RfProto* rfProto, ModuleData* md);
@@ -51,8 +51,8 @@ MPMProtoOption::MPMProtoOption(FormGroup* form, FlexGridLayout *layout) :
choice = new Choice(box, rect_t{}, 0, 0, nullptr);
edit = new NumberEdit(box, rect_t{}, 0, 0, nullptr);
cb = new CheckBox(box, rect_t{}, nullptr, nullptr);
rssi = new DynamicNumber<int>(
box, rect_t{}, [] { return (int)TELEMETRY_RSSI(); }, 0, "RSSI: ", " db");
rssi = new DynamicNumber<uint16_t>(
box, rect_t{}, [] { return (uint16_t)TELEMETRY_RSSI(); }, 0, "RSSI: ", " db");
}
void MPMProtoOption::update(const MultiRfProtocols::RfProto* rfProto, ModuleData* md)
+1 -1
View File
@@ -182,7 +182,7 @@ void DebugViewPage::build(FormWindow *window)
// Free mem
new StaticText(window, grid.getLabelSlot(), STR_FREE_MEM_LABEL, 0,
COLOR_THEME_PRIMARY1);
new DynamicNumber<int>(
new DynamicNumber<int32_t>(
window, grid.getFieldSlot(), [] { return availableMemory(); },
COLOR_THEME_PRIMARY1, nullptr, "b");
grid.nextLine();