mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 22:20:37 +00:00
rak10701 (rak wismeshtap) optimization (#5280)
* Improve the processing speed of virtual keyboards * Remove the disable GPS feature, as it would interfere with the normal use of TFT * Changed the default screen sleep time to 30s * Rename platform rak10701 -> rak wismeshtap * Fixed rak wismeshtap turned off gps caused the screen not to display * Reduce the size of the flash, otherwise uf2 will not work Co-authored-by: Daniel Cao <daniel.cao@rakwireless.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com> Co-authored-by: Tom Fifield <tom@tomfifield.net>
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#include "TouchScreenBase.h"
|
||||
#include "main.h"
|
||||
|
||||
#if defined(RAK14014) && !defined(MESHTASTIC_EXCLUDE_CANNEDMESSAGES)
|
||||
#include "modules/CannedMessageModule.h"
|
||||
#endif
|
||||
|
||||
#ifndef TIME_LONG_PRESS
|
||||
#define TIME_LONG_PRESS 400
|
||||
#endif
|
||||
@@ -102,12 +106,30 @@ int32_t TouchScreenBase::runOnce()
|
||||
}
|
||||
_touchedOld = touched;
|
||||
|
||||
#if defined RAK14014
|
||||
// Speed up the processing speed of the keyboard in virtual keyboard mode
|
||||
auto state = cannedMessageModule->getRunState();
|
||||
if (state == CANNED_MESSAGE_RUN_STATE_FREETEXT) {
|
||||
if (_tapped) {
|
||||
_tapped = false;
|
||||
e.touchEvent = static_cast<char>(TOUCH_ACTION_TAP);
|
||||
LOG_DEBUG("action TAP(%d/%d)\n", _last_x, _last_y);
|
||||
}
|
||||
} else {
|
||||
if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) {
|
||||
_tapped = false;
|
||||
e.touchEvent = static_cast<char>(TOUCH_ACTION_TAP);
|
||||
LOG_DEBUG("action TAP(%d/%d)\n", _last_x, _last_y);
|
||||
}
|
||||
}
|
||||
#else
|
||||
// fire TAP event when no 2nd tap occured within time
|
||||
if (_tapped && (time_t(millis()) - _start) > TIME_LONG_PRESS - 50) {
|
||||
_tapped = false;
|
||||
e.touchEvent = static_cast<char>(TOUCH_ACTION_TAP);
|
||||
LOG_DEBUG("action TAP(%d/%d)", _last_x, _last_y);
|
||||
}
|
||||
#endif
|
||||
|
||||
// fire LONG_PRESS event without the need for release
|
||||
if (touched && (time_t(millis()) - _start) > TIME_LONG_PRESS) {
|
||||
|
||||
Reference in New Issue
Block a user