File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,16 @@ void UITask::renderCurrScreen() {
162162 if (_display == NULL ) return ; // assert() ??
163163
164164 char tmp[80 ];
165- if (_origin[0 ] && _msg[0 ]) { // message preview
165+ if (_alert[0 ]) {
166+ uint16_t textWidth = _display->getTextWidth (_alert);
167+ _display->setCursor ((_display->width () - textWidth) / 2 , 22 );
168+ _display->setTextSize (1.4 );
169+ _display->setColor (DisplayDriver::GREEN);
170+ _display->print (_alert);
171+ _alert[0 ] = 0 ;
172+ _need_refresh = true ;
173+ return ;
174+ } else if (_origin[0 ] && _msg[0 ]) { // message preview
166175 // render message preview
167176 _display->setCursor (0 , 0 );
168177 _display->setTextSize (1 );
@@ -343,11 +352,17 @@ void UITask::handleButtonShortPress() {
343352void UITask::handleButtonDoublePress () {
344353 MESH_DEBUG_PRINTLN (" UITask: double press triggered, sending advert" );
345354 // ADVERT
355+ #ifdef PIN_BUZZER
356+ soundBuzzer (UIEventType::ack);
357+ #endif
346358 if (the_mesh.advert ()) {
347359 MESH_DEBUG_PRINTLN (" Advert sent!" );
360+ sprintf (_alert, " Advert sent!" );
348361 } else {
349362 MESH_DEBUG_PRINTLN (" Advert failed!" );
363+ sprintf (_alert, " Advert failed.." );
350364 }
365+ _need_refresh = true ;
351366}
352367
353368void UITask::handleButtonTriplePress () {
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class UITask {
3333 char _version_info[32 ];
3434 char _origin[62 ];
3535 char _msg[80 ];
36+ char _alert[80 ];
3637 int _msgcount;
3738 bool _need_refresh = true ;
3839 bool _displayWasOn = false ; // Track display state before button press
You can’t perform that action at this time.
0 commit comments