Reverting UITask.h changes
This commit is contained in:
@@ -1,37 +1,46 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <MeshCore.h>
|
#include <MeshCore.h>
|
||||||
#include <helpers/ui/DisplayDriver.h>
|
#include <helpers/ui/DisplayDriver.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#ifdef PIN_BUZZER
|
#ifdef PIN_BUZZER
|
||||||
#include <helpers/ui/buzzer.h>
|
#include <helpers/ui/buzzer.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Button.h"
|
|
||||||
#include "NodePrefs.h"
|
#include "NodePrefs.h"
|
||||||
|
#include "Button.h"
|
||||||
|
|
||||||
enum class UIEventType { none, contactMessage, channelMessage, roomMessage, newContactMessage, ack };
|
enum class UIEventType
|
||||||
|
{
|
||||||
|
none,
|
||||||
|
contactMessage,
|
||||||
|
channelMessage,
|
||||||
|
roomMessage,
|
||||||
|
newContactMessage,
|
||||||
|
ack
|
||||||
|
};
|
||||||
|
|
||||||
class UITask {
|
class UITask {
|
||||||
DisplayDriver *_display;
|
DisplayDriver* _display;
|
||||||
mesh::MainBoard *_board;
|
mesh::MainBoard* _board;
|
||||||
#ifdef PIN_BUZZER
|
#ifdef PIN_BUZZER
|
||||||
genericBuzzer buzzer;
|
genericBuzzer buzzer;
|
||||||
#endif
|
#endif
|
||||||
unsigned long _next_refresh, _auto_off;
|
unsigned long _next_refresh, _auto_off;
|
||||||
bool _connected;
|
bool _connected;
|
||||||
uint32_t _pin_code;
|
uint32_t _pin_code;
|
||||||
NodePrefs *_node_prefs;
|
NodePrefs* _node_prefs;
|
||||||
char _version_info[32];
|
char _version_info[32];
|
||||||
char _origin[62];
|
char _origin[62];
|
||||||
char _msg[80];
|
char _msg[80];
|
||||||
int _msgcount;
|
int _msgcount;
|
||||||
bool _need_refresh = true;
|
bool _need_refresh = true;
|
||||||
bool _displayWasOn = false; // Track display state before button press
|
bool _displayWasOn = false; // Track display state before button press
|
||||||
|
|
||||||
// Button handlers
|
// Button handlers
|
||||||
#if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA)
|
#if defined(PIN_USER_BTN) || defined(PIN_USER_BTN_ANA)
|
||||||
Button *_userButton = nullptr;
|
Button* _userButton = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void renderCurrScreen();
|
void renderCurrScreen();
|
||||||
@@ -45,20 +54,20 @@ class UITask {
|
|||||||
void handleButtonTriplePress();
|
void handleButtonTriplePress();
|
||||||
void handleButtonLongPress();
|
void handleButtonLongPress();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UITask(mesh::MainBoard *board) : _board(board), _display(NULL)
|
|
||||||
{
|
UITask(mesh::MainBoard* board) : _board(board), _display(NULL) {
|
||||||
_next_refresh = 0;
|
_next_refresh = 0;
|
||||||
_connected = false;
|
_connected = false;
|
||||||
}
|
}
|
||||||
void begin(DisplayDriver *display, NodePrefs *node_prefs, const char *build_date,
|
void begin(DisplayDriver* display, NodePrefs* node_prefs, const char* build_date, const char* firmware_version, uint32_t pin_code);
|
||||||
const char *firmware_version, uint32_t pin_code);
|
|
||||||
|
|
||||||
void setHasConnection(bool connected) { _connected = connected; }
|
void setHasConnection(bool connected) { _connected = connected; }
|
||||||
bool hasDisplay() const { return _display != NULL; }
|
bool hasDisplay() const { return _display != NULL; }
|
||||||
void clearMsgPreview();
|
void clearMsgPreview();
|
||||||
void msgRead(int msgcount);
|
void msgRead(int msgcount);
|
||||||
void newMsg(uint8_t path_len, const char *from_name, const char *text, int msgcount);
|
void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount);
|
||||||
void soundBuzzer(UIEventType bet = UIEventType::none);
|
void soundBuzzer(UIEventType bet = UIEventType::none);
|
||||||
void shutdown(bool restart = false);
|
void shutdown(bool restart = false);
|
||||||
void loop();
|
void loop();
|
||||||
|
|||||||
Reference in New Issue
Block a user