mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Bootup logo: Draw in centre
Some checks failed
CI / build (MHP30) (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / check_readme (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
Some checks failed
CI / build (MHP30) (push) Has been cancelled
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / check_readme (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user