Homescreen

This commit is contained in:
Ben V. Brown
2024-03-20 22:20:20 +11:00
parent 3a111d2924
commit ca2485c574
2 changed files with 13 additions and 13 deletions

View File

@@ -10,13 +10,13 @@ void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) {
bool tempOnDisplay = false;
bool tipDisconnectedDisplay = false;
if (OLED::getRotation()) {
OLED::drawArea(54, 0, 42, 16, buttonAF);
OLED::drawArea(12, 0, 42, 16, buttonBF);
OLED::drawArea(54, 0, 56, 32, buttonAF);
OLED::drawArea(12, 0, 56, 32, buttonBF);
OLED::setCursor(0, 0);
ui_draw_power_source_icon();
} else {
OLED::drawArea(0, 0, 42, 16, buttonA); // Needs to be flipped so button ends up
OLED::drawArea(42, 0, 42, 16, buttonB); // on right side of screen
OLED::drawArea(0, 0, 56, 32, buttonA); // Needs to be flipped so button ends up
OLED::drawArea(42, 0, 56, 32, buttonB); // on right side of screen
OLED::setCursor(84, 0);
ui_draw_power_source_icon();
}
@@ -35,10 +35,10 @@ void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) {
// Location changes on screen rotation
if (OLED::getRotation()) {
// in right handed mode we want to draw over the first part
OLED::fillArea(55, 0, 41, 16, 0); // clear the area for the temp
OLED::fillArea(55, 0, 56, 32, 0); // clear the area for the temp
OLED::setCursor(56, 0);
} else {
OLED::fillArea(0, 0, 41, 16, 0); // clear the area
OLED::fillArea(0, 0, 56, 32, 0); // clear the area
OLED::setCursor(0, 0);
}
// If we have a tip connected draw the temp, if not we leave it blank
@@ -52,9 +52,9 @@ void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) {
if (OLED::getRotation()) {
// in right handed mode we want to draw over the first part
OLED::drawArea(54, 0, 42, 16, disconnectedTipF);
OLED::drawArea(54, 0, 56, 32, disconnectedTipF);
} else {
OLED::drawArea(0, 0, 42, 16, disconnectedTip);
OLED::drawArea(0, 0, 56, 32, disconnectedTip);
}
}
}

View File

@@ -8,11 +8,11 @@ uint8_t disconnectedTipF[sizeof(disconnectedTip)];
void ui_pre_render_assets(void) {
// Generate the flipped screen into ram for later use
// flipped is generated by flipping each row
for (int row = 0; row < 2; row++) {
for (int x = 0; x < 42; x++) {
buttonAF[(row * 42) + x] = buttonA[(row * 42) + (41 - x)];
buttonBF[(row * 42) + x] = buttonB[(row * 42) + (41 - x)];
disconnectedTipF[(row * 42) + x] = disconnectedTip[(row * 42) + (41 - x)];
for (int row = 0; row < 4; row++) {
for (int x = 0; x < 56; x++) {
buttonAF[(row * 56) + x] = buttonA[(row * 56) + (41 - x)];
buttonBF[(row * 56) + x] = buttonB[(row * 56) + (41 - x)];
disconnectedTipF[(row * 56) + x] = disconnectedTip[(row * 56) + (41 - x)];
}
}
}