Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Split Render for multiple screen resolutions #1888

Merged
merged 33 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f58d7df
Create README.md
Ralim Feb 17, 2024
6a0a19f
Move to new folder
Ralim Feb 17, 2024
9ff4805
Migrating
Ralim Feb 18, 2024
d4c1805
Migrate Remainder
Ralim Feb 28, 2024
dcfb0b9
format fix (all but one) (#1889)
discip Feb 29, 2024
df81e88
Update USBPDDebug_FS2711.cpp
Ralim Mar 20, 2024
6aa4e6a
Delete PrintVoltage.cpp
Ralim Mar 20, 2024
d8d9663
Copy in 128x32 template
Ralim Mar 20, 2024
976d90c
Mask drawing for 96x16
Ralim Mar 20, 2024
5a69829
Import #1819
Ralim Mar 20, 2024
3a111d2
Update Font.h
Ralim Mar 20, 2024
ca2485c
Homescreen
Ralim Mar 20, 2024
fe534c9
Update draw_homescreen_detailed.cpp
Ralim Mar 20, 2024
5f48b53
Fix oled normal draw for variable height
Ralim Mar 21, 2024
bf36fd6
Update OLED.cpp
Ralim Mar 21, 2024
95a85e6
Draw settings icons
Ralim Mar 21, 2024
dea759f
Update draw_homescreen_simplified.cpp
Ralim Mar 21, 2024
ccdbc80
Update draw_power_source_icon.cpp
Ralim Mar 22, 2024
2450b65
Fixup oled drawing for fill area
Ralim Apr 3, 2024
8e48988
Update the region fill for mixed heights
Ralim Apr 3, 2024
cef0ee3
Fix newline height
Ralim Apr 9, 2024
f436574
FIXUP! Draw icons in settings menu at correct size
Ralim Apr 9, 2024
ab930c4
Fix scrollbar
Ralim Apr 9, 2024
7b18975
Update settingsGUI.cpp
Ralim Apr 9, 2024
a9ecbca
S60(P) Disable auto display rotation
Ralim Apr 9, 2024
c45c77e
On tall oled, scroll in 2 line increments
Ralim Apr 9, 2024
9e51a9c
Bugfix transition L<->R
Ralim Apr 9, 2024
2cb27c9
Draw every other one on transitions
Ralim Apr 9, 2024
fbe4633
.
Ralim Apr 9, 2024
c53ab37
cleanup
Ralim Apr 9, 2024
6159aa7
Bootup logo: Draw in centre
Ralim Apr 10, 2024
e5a917b
Merge branch 'dev' into gui-multi-screen
discip Jul 11, 2024
e16a2d4
Update OLED.hpp
discip Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
Copy link
Collaborator

@discip discip Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just from a parametric perspective:
Could we use something like this here (instead of static values):
https://github.com/Ralim/IronOS-dfu/blob/7ab0a57c49e1913b87b49ae458e641aa48adea87/src/oled.c#L168

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment the whole bootlogo stuff is setup only for that sizing. Which is sort of why I left it like that. 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious? 😊

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very valid question.
Still on the fence for what to do about the boot logo stuff.
Since limited frames could be messy, but also nice to do static full screen at the least.
But having half-half also feels messy.

So maybe I just carve out a little more logo space on these devices to have at least some frames of boot logo?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inclined to leave it as-is for the super short term as there are probably bigger issues to solve 🙃


#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