[Horus] Warnings fixed
This commit is contained in:
@@ -166,7 +166,7 @@ bool menuSetupScreensView(evt_t event)
|
|||||||
|
|
||||||
currentScreen = customScreens[0];
|
currentScreen = customScreens[0];
|
||||||
|
|
||||||
unsigned int layoutIndex = 0;
|
int layoutIndex = 0;
|
||||||
for (unsigned int i=0; i<countRegisteredLayouts; i++) {
|
for (unsigned int i=0; i<countRegisteredLayouts; i++) {
|
||||||
if (registeredLayouts[i] == currentScreen->getFactory()) {
|
if (registeredLayouts[i] == currentScreen->getFactory()) {
|
||||||
layoutIndex = i;
|
layoutIndex = i;
|
||||||
@@ -182,7 +182,7 @@ bool menuSetupScreensView(evt_t event)
|
|||||||
linesCount++;
|
linesCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
SUBMENU_WITH_OPTIONS("Main views setup", LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR, { NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1), ORPHAN_ROW, 0, 0, 0, 0 });
|
SUBMENU_WITH_OPTIONS("Main views setup", LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR, { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW, 0, 0, 0, 0 });
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_CONTENT_TOP + i * FH;
|
coord_t y = MENU_CONTENT_TOP + i * FH;
|
||||||
@@ -216,8 +216,8 @@ bool menuSetupScreensView(evt_t event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int lastDisplayedLayout = min<int>(menuHorizontalOffset + 4, countRegisteredLayouts);
|
unsigned int lastDisplayedLayout = min<int>(menuHorizontalOffset + 4, countRegisteredLayouts);
|
||||||
for (int i=menuHorizontalOffset, x=SCREENS_SETUP_2ND_COLUMN; i<lastDisplayedLayout; i++, x += 56) {
|
for (uint8_t i=menuHorizontalOffset, x=SCREENS_SETUP_2ND_COLUMN; i<lastDisplayedLayout; i++, x += 56) {
|
||||||
const LayoutFactory * factory = registeredLayouts[i];
|
const LayoutFactory * factory = registeredLayouts[i];
|
||||||
factory->drawThumb(x, y, currentScreen->getFactory() == factory ? (menuHorizontalPosition < 0 ? TEXT_INVERTED_COLOR : TEXT_INVERTED_BGCOLOR) : LINE_COLOR);
|
factory->drawThumb(x, y, currentScreen->getFactory() == factory ? (menuHorizontalPosition < 0 ? TEXT_INVERTED_COLOR : TEXT_INVERTED_BGCOLOR) : LINE_COLOR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ void GaugeWidget::refresh()
|
|||||||
int32_t max = persistentData->options[2].signedValue;
|
int32_t max = persistentData->options[2].signedValue;
|
||||||
uint16_t color = persistentData->options[3].unsignedValue;
|
uint16_t color = persistentData->options[3].unsignedValue;
|
||||||
|
|
||||||
getvalue_t value = getValue(index);
|
int32_t value = getValue(index);
|
||||||
getvalue_t value_in_range = value;
|
int32_t value_in_range = value;
|
||||||
if (value < min)
|
if (value < min)
|
||||||
value_in_range = min;
|
value_in_range = min;
|
||||||
else if (value > max)
|
else if (value > max)
|
||||||
value_in_range;
|
value_in_range = max;
|
||||||
|
|
||||||
int w = divRoundClosest(zone.w * (value_in_range - min), (max - min));
|
int w = divRoundClosest(zone.w * (value_in_range - min), (max - min));
|
||||||
int percent = divRoundClosest(100 * (value_in_range - min), (max - min));
|
int percent = divRoundClosest(100 * (value_in_range - min), (max - min));
|
||||||
|
|||||||
Reference in New Issue
Block a user