mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-20 15:35:05 +00:00
Fix for native touch
This commit is contained in:
parent
4509e693da
commit
0279568c68
@ -1,5 +1,13 @@
|
|||||||
#include "EspLcdNativeTouch.h"
|
#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;
|
return esp_lcd_touch_get_coordinates(handle, x, y, strength, pointCount, maxPointCount) == ESP_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,14 +11,13 @@ public:
|
|||||||
*
|
*
|
||||||
* @param[in] x array of X coordinates
|
* @param[in] x array of X coordinates
|
||||||
* @param[in] y array of Y 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] pointCount the number of points currently touched on the screen
|
||||||
* @param[in] maxPointCount the maximum number of points that can be touched at once
|
* @param[in] maxPointCount the maximum number of points that can be touched at once
|
||||||
*
|
*
|
||||||
* @return
|
* @return true when touched and coordinates are available
|
||||||
* - Returns true, when touched and coordinates readed. Otherwise returns false.
|
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user