mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-04 17:11:01 +00:00
Refactor display handling add Raspbian TFT display (#2998)
* Refactor display handling add Raspbian TFT display * Add missed change * Add static casts * Add missed TFT refactor for RAK14014 * Add missed GPIO configuration * Adds Native keyboard input option * Get the ifdefs right * CannedMessage send via queue, not run immediately. * Fixup systemd service file * Add display blanking for Raspberry Pi * Add a couple missed key definitions --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
#include "configuration.h"
|
||||
#if ARCH_RASPBERRY_PI
|
||||
#include "PortduinoGlue.h"
|
||||
#endif
|
||||
#if HAS_SCREEN
|
||||
#include "CannedMessageModule.h"
|
||||
#include "FSCommon.h"
|
||||
@@ -163,9 +166,14 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
||||
}
|
||||
if (event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL)) {
|
||||
LOG_DEBUG("Canned message event Cancel\n");
|
||||
// emulate a timeout. Same result
|
||||
this->lastTouchMillis = 0;
|
||||
validEvent = true;
|
||||
UIFrameEvent e = {false, true};
|
||||
e.frameChanged = true;
|
||||
this->currentMessageIndex = -1;
|
||||
this->freetext = ""; // clear freetext
|
||||
this->cursor = 0;
|
||||
this->destSelect = false;
|
||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
this->notifyObservers(&e);
|
||||
}
|
||||
if ((event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_BACK)) ||
|
||||
(event->inputEvent == static_cast<char>(meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_LEFT)) ||
|
||||
@@ -212,7 +220,11 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
||||
|
||||
if (validEvent) {
|
||||
// Let runOnce to be called immediately.
|
||||
setIntervalFromNow(0);
|
||||
if (this->runState == CANNED_MESSAGE_RUN_STATE_ACTION_SELECT) {
|
||||
setIntervalFromNow(0); // on fast keypresses, this isn't fast enough.
|
||||
} else {
|
||||
runOnce();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
#include "modules/TextMessageModule.h"
|
||||
#include "modules/TraceRouteModule.h"
|
||||
#include "modules/WaypointModule.h"
|
||||
#if ARCH_RASPBERRY_PI
|
||||
#include "input/LinuxInputImpl.h"
|
||||
#endif
|
||||
#if HAS_TELEMETRY
|
||||
#include "modules/Telemetry/DeviceTelemetry.h"
|
||||
#endif
|
||||
@@ -44,7 +47,7 @@
|
||||
void setupModules()
|
||||
{
|
||||
if (config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||
#if HAS_BUTTON
|
||||
#if HAS_BUTTON || ARCH_RASPBERRY_PI
|
||||
inputBroker = new InputBroker();
|
||||
#endif
|
||||
adminModule = new AdminModule();
|
||||
@@ -61,7 +64,7 @@ void setupModules()
|
||||
|
||||
new RemoteHardwareModule();
|
||||
new ReplyModule();
|
||||
#if HAS_BUTTON
|
||||
#if HAS_BUTTON || ARCH_RASPBERRY_PI
|
||||
rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1();
|
||||
if (!rotaryEncoderInterruptImpl1->init()) {
|
||||
delete rotaryEncoderInterruptImpl1;
|
||||
@@ -79,6 +82,10 @@ void setupModules()
|
||||
kbMatrixImpl->init();
|
||||
#endif // INPUTBROKER_MATRIX_TYPE
|
||||
#endif // HAS_BUTTON
|
||||
#if ARCH_RASPBERRY_PI
|
||||
aLinuxInputImpl = new LinuxInputImpl();
|
||||
aLinuxInputImpl->init();
|
||||
#endif
|
||||
#if HAS_TRACKBALL
|
||||
trackballInterruptImpl1 = new TrackballInterruptImpl1();
|
||||
trackballInterruptImpl1->init();
|
||||
|
||||
Reference in New Issue
Block a user