Skip to content

Commit

Permalink
Merge pull request #1171 from discip/master
Browse files Browse the repository at this point in the history
changed the source of the DisconnectedTip Icon to reduce code 😊
  • Loading branch information
Ralim authored Jan 9, 2022
2 parents 26493c0 + 7db7a11 commit 1a4ff29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
24 changes: 3 additions & 21 deletions source/Core/Drivers/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,12 @@ const uint8_t idleScreenBG[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, 0xba, 0x83, 0x80, 0x8e, 0xaa, 0x8e, 0x80, 0x80, 0xbf, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x22, 0x4a, 0x46, 0x8a, 0xa6, 0x8a, 0xa6, 0x8a, 0xa6,
0x8a, 0xa6, 0x8e, 0xa6, 0x8e, 0xa6, 0x8e, 0xa6, 0x8e, 0xbe, 0x80, 0xae, 0x94, 0x8c, 0x94, 0x88, 0x8a, 0x89, 0x80, 0x40, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00};
const uint8_t disconnectedTipIcon[] = {
const uint8_t disconnectedTip[] = {
//
// 41 x 16
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xc0, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xcc, 0x9c, 0x38, 0x70, 0xe0, 0xc0, 0x80, 0x20, 0x70, 0x38, 0x1c, 0xcc, 0x40,
0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0x60, 0xe0, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x05, 0x00, 0x07, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04,
0x31, 0x38, 0x1c, 0x0e, 0x04, 0x01, 0x03, 0x07, 0x0e, 0x1c, 0x39, 0x30, 0x01, 0x03, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x09, 0x0f};
const uint8_t disconnectedTipIconFlip[] = {
//
// 41 x 16
0xe0, 0x60, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x40, 0xcc, 0x1c, 0x38, 0x70, 0x20, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x9c, 0xcc, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x0f, 0x09, 0x04, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x03, 0x01, 0x30,
0x39, 0x1c, 0x0e, 0x07, 0x03, 0x01, 0x04, 0x0e, 0x1c, 0x38, 0x31, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x07, 0x00, 0x05, 0x02, 0x01, 0x02, 0x01, 0x01, 0x01};
#endif

#if defined(MODEL_TS80) + defined(MODEL_TS80P) >= 1
Expand All @@ -158,18 +152,12 @@ const uint8_t idleScreenBG[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, 0xba, 0x83, 0x80, 0x8e, 0xaa, 0x8e, 0x80, 0x80, 0xbf, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x44, 0x4c, 0x94, 0x8c, 0x94, 0x8c, 0x94, 0x8c,
0x94, 0x8c, 0x94, 0x80, 0x9c, 0x8a, 0xa6, 0x8a, 0xa6, 0x8e, 0xa6, 0x9c, 0x81, 0x94, 0x88, 0x88, 0x8a, 0x81, 0x80, 0x40, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00};
const uint8_t disconnectedTipIcon[] = {
const uint8_t disconnectedTip[] = {
//
// 41 x 16
0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x40, 0xc0, 0x40, 0x80, 0x00, 0x80, 0x80, 0x8c, 0x9c, 0x38, 0x70, 0xe0, 0xc0, 0x80, 0x20, 0x70, 0x38, 0x9c, 0x8c,
0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0x40, 0xe0, 0x60, 0xe0, 0x01, 0x01, 0x01, 0x02, 0x00, 0x03, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x03, 0x00, 0x02,
0x01, 0x32, 0x39, 0x1c, 0x0e, 0x04, 0x01, 0x03, 0x07, 0x0e, 0x1c, 0x38, 0x31, 0x02, 0x01, 0x02, 0x00, 0x02, 0x01, 0x04, 0x01, 0x04, 0x01, 0x0a, 0x01, 0x0f};
const uint8_t disconnectedTipIconFlip[] = {
//
// 41 x 16
0xe0, 0x60, 0xe0, 0x40, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x8c, 0x9c, 0x38, 0x70, 0x20, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x9c, 0x8c, 0x80, 0x80, 0x00,
0x80, 0x40, 0xc0, 0x40, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x0a, 0x01, 0x04, 0x01, 0x04, 0x01, 0x02, 0x00, 0x02, 0x01, 0x02, 0x31, 0x38,
0x1c, 0x0e, 0x07, 0x03, 0x01, 0x04, 0x0e, 0x1c, 0x39, 0x32, 0x01, 0x02, 0x00, 0x03, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x03, 0x00, 0x02, 0x01, 0x01, 0x01};
#endif

#ifdef MODEL_MHP30
Expand All @@ -182,18 +170,12 @@ const uint8_t idleScreenBG[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x40, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x83, 0xba, 0x83, 0x80, 0x8e, 0xaa, 0x8e, 0x80, 0x80, 0xbf, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x40, 0x40, 0x86, 0x89, 0x85, 0x91, 0x8b, 0x93,
0x8b, 0xa3, 0x97, 0xa7, 0x97, 0xa7, 0x8f, 0xaf, 0x87, 0x97, 0xa5, 0x86, 0x93, 0x8b, 0x93, 0x83, 0x89, 0xa5, 0x89, 0x46, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00};
const uint8_t disconnectedTipIcon[] = {
const uint8_t disconnectedTip[] = {
//
// 41 x 16
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0xa0, 0x30, 0x70, 0x70, 0x60, 0x4c, 0x9c, 0x38, 0x70, 0xe4, 0xcc, 0x88, 0x20, 0x70, 0x38, 0x9c, 0x4c, 0x60,
0x70, 0x60, 0x20, 0xa0, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x29, 0x10, 0x22, 0x01,
0x32, 0x38, 0x1c, 0x0e, 0x04, 0x01, 0x03, 0x07, 0x0e, 0x1c, 0x38, 0x30, 0x01, 0x12, 0x29, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
const uint8_t disconnectedTipIconFlip[] = {
//
// 41 x 16
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0xa0, 0x20, 0x60, 0x70, 0x60, 0x4c, 0x9c, 0x38, 0x70, 0x20, 0x88, 0xcc, 0xe4, 0x70, 0x38, 0x9c, 0x4c, 0x60, 0x70,
0x70, 0x30, 0xa0, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x29, 0x12, 0x01, 0x30,
0x38, 0x1c, 0x0e, 0x07, 0x03, 0x01, 0x04, 0x0e, 0x1c, 0x38, 0x32, 0x01, 0x22, 0x10, 0x29, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
#endif

// 16 x 16
Expand Down
12 changes: 8 additions & 4 deletions source/Core/Threads/GUIThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ void showWarnings() {
}

uint8_t idleScreenBGF[sizeof(idleScreenBG)];
uint8_t disconnectedTipF[sizeof(disconnectedTip)];
/* StartGUITask function */
void startGUITask(void const *argument) {
(void)argument;
Expand All @@ -853,6 +854,9 @@ void startGUITask(void const *argument) {
for (int x = 0; x < 84; x++) {
idleScreenBGF[(row * 84) + x] = idleScreenBG[(row * 84) + (83 - x)];
}
for (int x = 0; x < 41; x++) {
disconnectedTipF[(row * 41) + x] = disconnectedTip[(row * 41) + (40 - x)];
}
}
}
getTipRawTemp(1); // reset filter
Expand Down Expand Up @@ -963,9 +967,9 @@ void startGUITask(void const *argument) {
if (OLED::getRotation()) {
#endif
// in right handed mode we want to draw over the first part
OLED::drawArea(55, 0, 41, 16, disconnectedTipIconFlip);
OLED::drawArea(55, 0, 41, 16, disconnectedTipF);
} else {
OLED::drawArea(0, 0, 41, 16, disconnectedTipIcon);
OLED::drawArea(0, 0, 41, 16, disconnectedTip);
}
#ifdef OLED_FLIP
if (!OLED::getRotation()) {
Expand Down Expand Up @@ -1076,9 +1080,9 @@ void startGUITask(void const *argument) {
if (OLED::getRotation()) {
#endif
// in right handed mode we want to draw over the first part
OLED::drawArea(55, 0, 41, 16, disconnectedTipIconFlip);
OLED::drawArea(55, 0, 41, 16, disconnectedTipF);
} else {
OLED::drawArea(0, 0, 41, 16, disconnectedTipIcon);
OLED::drawArea(0, 0, 41, 16, disconnectedTip);
}
}
}
Expand Down

0 comments on commit 1a4ff29

Please sign in to comment.