diff --git a/src/SafeFile.cpp b/src/SafeFile.cpp index 67086789ff..04919627d6 100644 --- a/src/SafeFile.cpp +++ b/src/SafeFile.cpp @@ -7,6 +7,9 @@ static File openFile(const char *filename, bool fullAtomic) { concurrency::LockGuard g(spiLock); LOG_DEBUG("Opening %s, fullAtomic=%d", filename, fullAtomic); +#ifdef HAPTIC_FEEDBACK_PIN + digitalWrite(HAPTIC_FEEDBACK_PIN, LOW); // the write stalls the loop that would end a haptic pulse +#endif if (!fullAtomic) { FSCom.remove(filename); // Nuke the old file to make space (ignore if it !exists) } diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index 248537806b..5ef50a5a0e 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -43,6 +43,12 @@ #if defined(BUTTON_PIN_TOUCH) ButtonThread *TouchButtonThread = nullptr; +#ifndef TOUCH_SINGLEPRESS +#define TOUCH_SINGLEPRESS INPUT_BROKER_NONE +#endif +#ifndef TOUCH_LONGPRESS +#define TOUCH_LONGPRESS INPUT_BROKER_BACK +#endif #if HAS_BACKLIGHT static bool touchBacklightWasOn = false; static bool touchBacklightActive = false; @@ -247,8 +253,8 @@ void InputBroker::Init() BaseType_t higherWake = 0; concurrency::mainDelay.interruptFromISR(&higherWake); }; - touchConfig.singlePress = INPUT_BROKER_NONE; - touchConfig.longPress = INPUT_BROKER_BACK; + touchConfig.singlePress = TOUCH_SINGLEPRESS; + touchConfig.longPress = TOUCH_LONGPRESS; #if HAS_BACKLIGHT // Touch pad drives the backlight on devices that have one touchConfig.longPress = INPUT_BROKER_NONE; diff --git a/variants/nrf52840/t-impulse-plus/variant.h b/variants/nrf52840/t-impulse-plus/variant.h index 33cfaff247..9e6e4ba744 100644 --- a/variants/nrf52840/t-impulse-plus/variant.h +++ b/variants/nrf52840/t-impulse-plus/variant.h @@ -61,6 +61,8 @@ #define PIN_BUTTON_TOUCH D18 #define BUTTON_TOUCH_ACTIVE_LOW true #define BUTTON_TOUCH_ACTIVE_PULLUP false +#define TOUCH_SINGLEPRESS INPUT_BROKER_USER_PRESS +#define TOUCH_LONGPRESS INPUT_BROKER_SELECT // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // Analog Pin Definitions