Skip to content

Commit 4864990

Browse files
Ralimdiscip
andauthored
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 <[email protected]>
1 parent 18e936a commit 4864990

File tree

76 files changed

+2052
-1588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2052
-1588
lines changed

source/Core/BSP/MHP30/configuration.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
*
5858
*/
5959
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right
60+
#define MAX_ORIENTATION_MODE 1 // Unlikely to ever change
6061
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
6162

6263
/**
@@ -151,7 +152,7 @@
151152
#define ACCEL_MSA
152153

153154
#define PROFILE_SUPPORT
154-
155+
#define OLED_96x16 1
155156
#define POW_PD 1
156157
#define POW_PD_EXT 0
157158
#define USB_PD_EPR_WATTAGE 0 /*No EPR*/

source/Core/BSP/Miniware/configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
*
5858
*/
5959
#define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic
60+
#define MAX_ORIENTATION_MODE 2 // Up to auto
6061
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
6162

6263
/**
@@ -276,6 +277,7 @@
276277
#else
277278
#define FLASH_LOGOADDR (0x08000000 + (62 * 1024))
278279
#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
280+
#define OLED_96x16 1
279281
#endif /* TS101 */
280282

281283
#endif /* CONFIGURATION_H_ */

source/Core/BSP/Pinecil/configuration.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
*
5858
*/
5959
#define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic
60+
#define MAX_ORIENTATION_MODE 2 // Up to auto
6061
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
6162

6263
/**
@@ -145,14 +146,15 @@
145146
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
146147
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
147148

149+
#define OLED_96x16 1
148150
#define POW_PD 1
149151
#define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */
150-
#define POW_PD_EXT 0
151-
#define POW_QC 1
152-
#define POW_DC 1
153-
#define POW_QC_20V 1
154-
#define ENABLE_QC2 1
155-
#define MAG_SLEEP_SUPPORT 1
152+
#define POW_PD_EXT 0
153+
#define POW_QC 1
154+
#define POW_DC 1
155+
#define POW_QC_20V 1
156+
#define ENABLE_QC2 1
157+
#define MAG_SLEEP_SUPPORT 1
156158
#define TEMP_TMP36
157159
#define ACCEL_BMA
158160
#define ACCEL_SC7

source/Core/BSP/Pinecilv2/configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
*
5858
*/
5959
#define ORIENTATION_MODE 2 // 0: Right 1:Left 2:Automatic - Default Automatic
60+
#define MAX_ORIENTATION_MODE 2 // Up to auto
6061
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
6162

6263
/**
@@ -155,6 +156,7 @@
155156
#define ENABLE_QC2 1
156157
#define MAG_SLEEP_SUPPORT 1
157158
#define DEVICE_HAS_VALIDATION_SUPPORT
159+
#define OLED_96x16 1
158160
#define TEMP_NTC
159161
#define ACCEL_BMA
160162
#define CUSTOM_MAX_TEMP_C 1 // Uses custom max temp lookup

source/Core/BSP/Sequre/configuration.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
* OLED Orientation
6666
*
6767
*/
68-
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default Automatic
68+
#define ORIENTATION_MODE 0 // 0: Right 1:Left (2:Automatic N/A)
69+
#define MAX_ORIENTATION_MODE 1 // Disable auto mode
6970
#define REVERSE_BUTTON_TEMP_CHANGE 0 // 0:Default 1:Reverse - Reverse the plus and minus button assigment for temperature change
7071

7172
/**

source/Core/Drivers/BootLogo.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void delay() {
1515
}
1616

1717
void BootLogo::handleShowingLogo(const uint8_t *ptrLogoArea) {
18+
OLED::clearScreen();
1819
// Read the first few bytes and figure out what format we are looking at
1920
if (OLD_LOGO_HEADER_VALUE == *(reinterpret_cast<const uint32_t *>(ptrLogoArea))) {
2021
showOldFormat(ptrLogoArea);
@@ -23,11 +24,17 @@ void BootLogo::handleShowingLogo(const uint8_t *ptrLogoArea) {
2324
}
2425

2526
OLED::clearScreen();
26-
OLED::refresh();
2727
}
2828

2929
void BootLogo::showOldFormat(const uint8_t *ptrLogoArea) {
30+
#ifdef OLED_128x32
31+
// Draw in middle
32+
OLED::drawAreaSwapped(16, 8, 96, 16, (uint8_t *)(ptrLogoArea + 4));
33+
34+
#else
3035
OLED::drawAreaSwapped(0, 0, 96, 16, (uint8_t *)(ptrLogoArea + 4));
36+
37+
#endif
3138
OLED::refresh();
3239
// Delay here with static logo until a button is pressed or its been the amount of seconds set by the user
3340
delay();
@@ -85,8 +92,12 @@ int BootLogo::showNewFrame(const uint8_t *ptrLogoArea) {
8592
return 1;
8693
break;
8794
case 0xFF:
88-
// Full frame update
95+
// Full frame update
96+
#ifdef OLED_128x32
97+
OLED::drawArea(16, 8, 96, 16, ptrLogoArea + 1);
98+
#else
8999
OLED::drawArea(0, 0, 96, 16, ptrLogoArea + 1);
100+
#endif
90101
length = 96;
91102
break;
92103
default:
@@ -95,7 +106,11 @@ int BootLogo::showNewFrame(const uint8_t *ptrLogoArea) {
95106
for (int p = 0; p < length; p++) {
96107
uint8_t index = ptrLogoArea[1 + (p * 2)];
97108
uint8_t value = ptrLogoArea[2 + (p * 2)];
109+
#ifdef OLED_128x32
110+
OLED::drawArea(16 + (index % 96), index >= 96 ? 16 : 8, 1, 8, &value);
111+
#else
98112
OLED::drawArea(index % 96, index >= 96 ? 8 : 0, 1, 8, &value);
113+
#endif
99114
}
100115
}
101116

0 commit comments

Comments
 (0)