mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-30 11:23:53 +00:00
implement screen blink
This commit is contained in:
parent
7205e9a5b4
commit
db2193b526
@ -894,6 +894,27 @@ void Screen::handleStartBluetoothPinScreen(uint32_t pin)
|
|||||||
setFastFramerate();
|
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)
|
void Screen::handlePrint(const char *text)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Screen: %s", text);
|
DEBUG_MSG("Screen: %s", text);
|
||||||
|
@ -107,6 +107,8 @@ class Screen : public concurrency::OSThread
|
|||||||
*/
|
*/
|
||||||
void doDeepSleep();
|
void doDeepSleep();
|
||||||
|
|
||||||
|
void blink();
|
||||||
|
|
||||||
/// Handles a button press.
|
/// Handles a button press.
|
||||||
void onPress() { enqueueCmd(ScreenCmd{.cmd = Cmd::ON_PRESS}); }
|
void onPress() { enqueueCmd(ScreenCmd{.cmd = Cmd::ON_PRESS}); }
|
||||||
|
|
||||||
|
@ -986,14 +986,16 @@ void handleBlinkLED(HTTPRequest *req, HTTPResponse *res)
|
|||||||
|
|
||||||
uint8_t count = 10;
|
uint8_t count = 10;
|
||||||
|
|
||||||
while (count > 0)
|
/*while (count > 0)
|
||||||
{
|
{
|
||||||
setLed(true);
|
setLed(true);
|
||||||
delay(50);
|
delay(50);
|
||||||
setLed(false);
|
setLed(false);
|
||||||
delay(50);
|
delay(50);
|
||||||
count = count - 1;
|
count = count - 1;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
screen->blink();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
|
void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
|
||||||
|
Loading…
Reference in New Issue
Block a user