Fix for native touch

This commit is contained in:
Ken Van Hoeylandt 2025-08-15 18:54:20 +02:00
parent 4509e693da
commit 0279568c68
2 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,13 @@
#include "EspLcdNativeTouch.h"
bool EspLcdNativeTouch::getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* pointCount, uint8_t maxPointCount) {
#include <Tactility/LogEsp.h>
constexpr char* TAG = "EspLcdNativeTouch";
bool EspLcdNativeTouch::getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* _Nullable strength, uint8_t* pointCount, uint8_t maxPointCount) {
if (esp_lcd_touch_read_data(handle) != ESP_OK) {
TT_LOG_E(TAG, "Read data failed");
return false;
}
return esp_lcd_touch_get_coordinates(handle, x, y, strength, pointCount, maxPointCount) == ESP_OK;
}

View File

@ -11,14 +11,13 @@ public:
*
* @param[in] x array of X coordinates
* @param[in] y array of Y coordinates
* @param[in] strength Array of strengths
* @param[in] strength optional array of strengths
* @param[in] pointCount the number of points currently touched on the screen
* @param[in] maxPointCount the maximum number of points that can be touched at once
*
* @return
* - Returns true, when touched and coordinates readed. Otherwise returns false.
* @return true when touched and coordinates are available
*/
virtual bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* pointCount, uint8_t maxPointCount) = 0;
virtual bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* _Nullable strength, uint8_t* pointCount, uint8_t maxPointCount) = 0;
};
}