Skip to content

Commit

Permalink
WIP: Split Render for multiple screen resolutions (#1888)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Ralim and discip authored Jul 11, 2024
1 parent 18e936a commit 4864990
Show file tree
Hide file tree
Showing 76 changed files with 2,052 additions and 1,588 deletions.
3 changes: 2 additions & 1 deletion source/Core/BSP/MHP30/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
*
*/
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right
#define MAX_ORIENTATION_MODE 1 // Unlikely to ever change
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change

/**
Expand Down Expand Up @@ -151,7 +152,7 @@
#define ACCEL_MSA

#define PROFILE_SUPPORT

#define OLED_96x16 1
#define POW_PD 1
#define POW_PD_EXT 0
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/
Expand Down
2 changes: 2 additions & 0 deletions source/Core/BSP/Miniware/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
*
*/
#define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic
#define MAX_ORIENTATION_MODE 2 // Up to auto
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change

/**
Expand Down Expand Up @@ -276,6 +277,7 @@
#else
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
#define OLED_96x16 1
#endif /* TS101 */

#endif /* CONFIGURATION_H_ */
14 changes: 8 additions & 6 deletions source/Core/BSP/Pinecil/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
*
*/
#define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic
#define MAX_ORIENTATION_MODE 2 // Up to auto
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change

/**
Expand Down Expand Up @@ -145,14 +146,15 @@
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F

#define OLED_96x16 1
#define POW_PD 1
#define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */
#define POW_PD_EXT 0
#define POW_QC 1
#define POW_DC 1
#define POW_QC_20V 1
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define POW_PD_EXT 0
#define POW_QC 1
#define POW_DC 1
#define POW_QC_20V 1
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define TEMP_TMP36
#define ACCEL_BMA
#define ACCEL_SC7
Expand Down
2 changes: 2 additions & 0 deletions source/Core/BSP/Pinecilv2/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
*
*/
#define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic
#define MAX_ORIENTATION_MODE 2 // Up to auto
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change

/**
Expand Down Expand Up @@ -155,6 +156,7 @@
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define DEVICE_HAS_VALIDATION_SUPPORT
#define OLED_96x16 1
#define TEMP_NTC
#define ACCEL_BMA
#define CUSTOM_MAX_TEMP_C 1 // Uses custom max temp lookup
Expand Down
3 changes: 2 additions & 1 deletion source/Core/BSP/Sequre/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
* OLED Orientation
*
*/
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default Automatic
#define ORIENTATION_MODE 0 // 0: Right 1:Left (2:Automatic N/A)
#define MAX_ORIENTATION_MODE 1 // Disable auto mode
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change

/**
Expand Down
19 changes: 17 additions & 2 deletions source/Core/Drivers/BootLogo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -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:
Expand All @@ -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
}
}

Expand Down
Loading

0 comments on commit 4864990

Please sign in to comment.