Canned message plugin status fix.

This commit is contained in:
Balazs Kelemen
2022-01-19 09:55:06 +01:00
parent 1ff3b3326c
commit 53399f06e5
2 changed files with 64 additions and 68 deletions

View File

@@ -2,18 +2,14 @@
#include "SinglePortPlugin.h"
#include "input/InputBroker.h"
enum cannedMessagePluginActionType
enum cannedMessagePluginRunState
{
CANNED_MESSAGE_ACTION_NONE,
CANNED_MESSAGE_ACTION_SELECT,
CANNED_MESSAGE_ACTION_UP,
CANNED_MESSAGE_ACTION_DOWN
};
enum cannedMessagePluginSendigState
{
SENDING_STATE_NONE,
SENDING_STATE_ACTIVE
CANNED_MESSAGE_RUN_STATE_INACTIVE,
CANNED_MESSAGE_RUN_STATE_ACTIVE,
CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE,
CANNED_MESSAGE_RUN_STATE_ACTION_SELECT,
CANNED_MESSAGE_RUN_STATE_ACTION_UP,
CANNED_MESSAGE_RUN_STATE_ACTION_DOWN
};
@@ -38,7 +34,6 @@ class CannedMessagePlugin :
const char* getPrevMessage();
const char* getNextMessage();
bool shouldDraw();
cannedMessagePluginSendigState getSendingState();
void eventUp();
void eventDown();
void eventSelect();
@@ -62,9 +57,8 @@ class CannedMessagePlugin :
virtual void drawFrame(
OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
volatile cannedMessagePluginActionType action = CANNED_MESSAGE_ACTION_NONE;
int currentMessageIndex = -1;
cannedMessagePluginSendigState sendingState = SENDING_STATE_NONE;
cannedMessagePluginRunState runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
char messageStore[CANNED_MESSAGE_PLUGIN_MESSAGES_SIZE];
char *messages[CANNED_MESSAGE_PLUGIN_MESSAGE_MAX_COUNT];