mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-05 01:20:59 +00:00
implement screen blink
This commit is contained in:
@@ -894,6 +894,27 @@ void Screen::handleStartBluetoothPinScreen(uint32_t pin)
|
||||
setFastFramerate();
|
||||
}
|
||||
|
||||
void Screen::blink() {
|
||||
setFastFramerate();
|
||||
uint8_t count = 10;
|
||||
uint8_t blinker = 0;
|
||||
|
||||
dispdev.setBrightness(254);
|
||||
|
||||
while(count>0) {
|
||||
if (blinker == 254) {
|
||||
blinker = 0;
|
||||
count--;
|
||||
} else {
|
||||
blinker++;
|
||||
}
|
||||
int width = blinker / (254.00 / SCREEN_WIDTH);
|
||||
dispdev.fillRect(0, 0, width, SCREEN_HEIGHT);
|
||||
dispdev.display();
|
||||
}
|
||||
dispdev.setBrightness(brightness);
|
||||
}
|
||||
|
||||
void Screen::handlePrint(const char *text)
|
||||
{
|
||||
DEBUG_MSG("Screen: %s", text);
|
||||
|
||||
@@ -107,6 +107,8 @@ class Screen : public concurrency::OSThread
|
||||
*/
|
||||
void doDeepSleep();
|
||||
|
||||
void blink();
|
||||
|
||||
/// Handles a button press.
|
||||
void onPress() { enqueueCmd(ScreenCmd{.cmd = Cmd::ON_PRESS}); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user