Browse Source
Add muted icon to show when buzzer is muted
pull/1672/head
Leah
4 months ago
Failed to extract signature
3 changed files with
20 additions and
0 deletions
-
examples/companion_radio/ui-new/UITask.cpp
-
examples/companion_radio/ui-new/UITask.h
-
examples/companion_radio/ui-new/icons.h
|
|
|
@ -131,6 +131,14 @@ class HomeScreen : public UIScreen { |
|
|
|
// fill the battery based on the percentage
|
|
|
|
int fillWidth = (batteryPercentage * (iconWidth - 4)) / 100; |
|
|
|
display.fillRect(iconX + 2, iconY + 2, fillWidth, iconHeight - 4); |
|
|
|
|
|
|
|
// show muted icon if buzzer is muted
|
|
|
|
#ifdef PIN_BUZZER |
|
|
|
if (_task->isBuzzerQuiet()) { |
|
|
|
display.setColor(DisplayDriver::RED); |
|
|
|
display.drawXbm(iconX - 9, iconY + 1, muted_icon, 8, 8); |
|
|
|
} |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
CayenneLPP sensors_lpp; |
|
|
|
|
|
|
|
@ -78,6 +78,14 @@ public: |
|
|
|
bool hasDisplay() const { return _display != NULL; } |
|
|
|
bool isButtonPressed() const; |
|
|
|
|
|
|
|
bool isBuzzerQuiet() { |
|
|
|
#ifdef PIN_BUZZER |
|
|
|
return buzzer.isQuiet(); |
|
|
|
#else |
|
|
|
return true; |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void toggleBuzzer(); |
|
|
|
bool getGPSState(); |
|
|
|
void toggleGPS(); |
|
|
|
|
|
|
|
@ -116,3 +116,7 @@ static const uint8_t advert_icon[] = { |
|
|
|
0x04, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
|
|
}; |
|
|
|
|
|
|
|
static const uint8_t muted_icon[] = { |
|
|
|
0x20, 0x6a, 0xea, 0xe4, 0xe4, 0xea, 0x6a, 0x20 |
|
|
|
}; |