mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-19 17:22:59 +00:00
add locks
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#ifdef T5_S3_EPAPER_PRO
|
||||
|
||||
#include "SPILock.h"
|
||||
#include "TouchDrvGT911.hpp"
|
||||
#include "Wire.h"
|
||||
#include "input/TouchScreenImpl1.h"
|
||||
@@ -11,6 +12,7 @@ TouchDrvGT911 touch;
|
||||
bool readTouch(int16_t *x, int16_t *y)
|
||||
{
|
||||
if (!digitalRead(GT911_PIN_INT)) {
|
||||
concurrency::LockGuard g(spiLock);
|
||||
if (touch.getPoint(x, y) && (*x >= 0) && (*y >= 0) && (*x < EPD_WIDTH) && (*y < EPD_HEIGHT)) {
|
||||
LOG_DEBUG("touched(%d/%d)", *x, *y);
|
||||
return true;
|
||||
@@ -22,6 +24,7 @@ bool readTouch(int16_t *x, int16_t *y)
|
||||
// T5-S3-ePaper Pro specific (late-) init
|
||||
void lateInitVariant_T5S3Pro(void)
|
||||
{
|
||||
concurrency::LockGuard g(spiLock);
|
||||
touch.setPins(GT911_PIN_RST, GT911_PIN_INT);
|
||||
if (touch.begin(Wire, GT911_SLAVE_ADDRESS_L, GT911_PIN_SDA, GT911_PIN_SCL)) {
|
||||
touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch);
|
||||
|
||||
@@ -5,7 +5,7 @@ board_build.partition = default_16MB.csv
|
||||
board_check = false
|
||||
upload_protocol = esptool
|
||||
build_type = debug
|
||||
build_flags = -g -O0
|
||||
build_flags = -g -O0 -fno-strict-aliasing
|
||||
${esp32_base.build_flags}
|
||||
-I variants/esp32s3/t5s3_epaper
|
||||
-D T5_S3_EPAPER_PRO
|
||||
@@ -13,6 +13,8 @@ build_flags = -g -O0
|
||||
-D TOUCH_THRESHOLD_X=50
|
||||
-D TOUCH_THRESHOLD_Y=30
|
||||
-D TIME_LONG_PRESS=500
|
||||
-D CONFIG_DISABLE_HAL_LOCKS=1 ; we use SPILock instead
|
||||
-D EINK_LIMIT_GHOSTING_PX
|
||||
; -D GPS_POWER_TOGGLE
|
||||
|
||||
build_src_filter =
|
||||
|
||||
Reference in New Issue
Block a user