WIP: Split Render for multiple screen resolutions (#1888)

* Create README.md

* Move to new folder

* Migrating

* Migrate Remainder

* format fix (all but one) (#1889)

* Update USBPDDebug_FS2711.cpp

* Delete PrintVoltage.cpp

* Copy in 128x32 template

* Mask drawing for 96x16

* Import #1819

* Update Font.h

* Homescreen

* Update draw_homescreen_detailed.cpp

* Fix oled normal draw for variable height

* Update OLED.cpp

* Draw settings icons

* Update draw_homescreen_simplified.cpp

* Update draw_power_source_icon.cpp

* Fixup oled drawing for fill area

* Update the region fill for mixed heights

* Fix newline height

* FIXUP! Draw icons in settings menu at correct size

* Fix scrollbar

* Update settingsGUI.cpp

* S60(P) Disable auto display rotation

* On tall oled, scroll in 2 line increments

* Bugfix transition L<->R

@discip I take it back, there was a bug :)

* Draw every other one on transitions

* .

* cleanup

* Bootup logo: Draw in centre

* Update OLED.hpp

---------

Co-authored-by: discip <53649486+discip@users.noreply.github.com>
This commit is contained in:
Ben V. Brown
2024-07-12 08:27:05 +10:00
committed by GitHub
parent 18e936ae6d
commit 48649908a7
76 changed files with 2052 additions and 1588 deletions

View File

@@ -15,6 +15,7 @@ void delay() {
}
void BootLogo::handleShowingLogo(const uint8_t *ptrLogoArea) {
OLED::clearScreen();
// Read the first few bytes and figure out what format we are looking at
if (OLD_LOGO_HEADER_VALUE == *(reinterpret_cast<const uint32_t *>(ptrLogoArea))) {
showOldFormat(ptrLogoArea);
@@ -23,11 +24,17 @@ void BootLogo::handleShowingLogo(const uint8_t *ptrLogoArea) {
}
OLED::clearScreen();
OLED::refresh();
}
void BootLogo::showOldFormat(const uint8_t *ptrLogoArea) {
#ifdef OLED_128x32
// Draw in middle
OLED::drawAreaSwapped(16, 8, 96, 16, (uint8_t *)(ptrLogoArea + 4));
#else
OLED::drawAreaSwapped(0, 0, 96, 16, (uint8_t *)(ptrLogoArea + 4));
#endif
OLED::refresh();
// Delay here with static logo until a button is pressed or its been the amount of seconds set by the user
delay();
@@ -85,8 +92,12 @@ int BootLogo::showNewFrame(const uint8_t *ptrLogoArea) {
return 1;
break;
case 0xFF:
// Full frame update
// Full frame update
#ifdef OLED_128x32
OLED::drawArea(16, 8, 96, 16, ptrLogoArea + 1);
#else
OLED::drawArea(0, 0, 96, 16, ptrLogoArea + 1);
#endif
length = 96;
break;
default:
@@ -95,7 +106,11 @@ int BootLogo::showNewFrame(const uint8_t *ptrLogoArea) {
for (int p = 0; p < length; p++) {
uint8_t index = ptrLogoArea[1 + (p * 2)];
uint8_t value = ptrLogoArea[2 + (p * 2)];
#ifdef OLED_128x32
OLED::drawArea(16 + (index % 96), index >= 96 ? 16 : 8, 1, 8, &value);
#else
OLED::drawArea(index % 96, index >= 96 ? 8 : 0, 1, 8, &value);
#endif
}
}