Skip to content

Commit 884d8f1

Browse files
committed
Reverting UITask.h changes
1 parent 33d5f85 commit 884d8f1

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

examples/companion_radio/UITask.h

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,74 @@
11
#pragma once
2+
23
#include <MeshCore.h>
34
#include <helpers/ui/DisplayDriver.h>
45
#include <stddef.h>
56

67
#ifdef PIN_BUZZER
7-
#include <helpers/ui/buzzer.h>
8+
#include <helpers/ui/buzzer.h>
89
#endif
910

10-
#include "Button.h"
1111
#include "NodePrefs.h"
12+
#include "Button.h"
1213

13-
enum class UIEventType { none, contactMessage, channelMessage, roomMessage, newContactMessage, ack };
14+
enum class UIEventType
15+
{
16+
none,
17+
contactMessage,
18+
channelMessage,
19+
roomMessage,
20+
newContactMessage,
21+
ack
22+
};
1423

1524
class UITask {
16-
DisplayDriver *_display;
17-
mesh::MainBoard *_board;
25+
DisplayDriver* _display;
26+
mesh::MainBoard* _board;
1827
#ifdef PIN_BUZZER
1928
genericBuzzer buzzer;
2029
#endif
2130
unsigned long _next_refresh, _auto_off;
2231
bool _connected;
2332
uint32_t _pin_code;
24-
NodePrefs *_node_prefs;
33+
NodePrefs* _node_prefs;
2534
char _version_info[32];
2635
char _origin[62];
2736
char _msg[80];
2837
int _msgcount;
2938
bool _need_refresh = true;
30-
bool _displayWasOn = false; // Track display state before button press
39+
bool _displayWasOn = false; // Track display state before button press
3140

3241
// Button handlers
3342
#if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA)
34-
Button *_userButton = nullptr;
43+
Button* _userButton = nullptr;
3544
#endif
3645

3746
void renderCurrScreen();
3847
void userLedHandler();
3948
void renderBatteryIndicator(uint16_t batteryMilliVolts);
40-
49+
4150
// Button action handlers
4251
void handleButtonAnyPress();
4352
void handleButtonShortPress();
4453
void handleButtonDoublePress();
4554
void handleButtonTriplePress();
4655
void handleButtonLongPress();
4756

57+
4858
public:
49-
UITask(mesh::MainBoard *board) : _board(board), _display(NULL)
50-
{
51-
_next_refresh = 0;
52-
_connected = false;
59+
60+
UITask(mesh::MainBoard* board) : _board(board), _display(NULL) {
61+
_next_refresh = 0;
62+
_connected = false;
5363
}
54-
void begin(DisplayDriver *display, NodePrefs *node_prefs, const char *build_date,
55-
const char *firmware_version, uint32_t pin_code);
64+
void begin(DisplayDriver* display, NodePrefs* node_prefs, const char* build_date, const char* firmware_version, uint32_t pin_code);
5665

5766
void setHasConnection(bool connected) { _connected = connected; }
5867
bool hasDisplay() const { return _display != NULL; }
5968
void clearMsgPreview();
6069
void msgRead(int msgcount);
61-
void newMsg(uint8_t path_len, const char *from_name, const char *text, int msgcount);
70+
void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount);
6271
void soundBuzzer(UIEventType bet = UIEventType::none);
6372
void shutdown(bool restart = false);
6473
void loop();
65-
};
74+
};

0 commit comments

Comments
 (0)