summaryrefslogtreecommitdiff
path: root/src/drivers/touchwheel.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-09-08 13:45:05 +1000
committerjacqueline <me@jacqueline.id.au>2023-09-08 13:45:05 +1000
commit6b9fb9edace1b0441eb8d5e9ee8e5c6ec1287554 (patch)
tree8f4cd3d5d9eeddb015b4ec97f14e004e9e701dfb /src/drivers/touchwheel.cpp
parent493a70b07c98787bf247e577d17d6b1a3e16a084 (diff)
downloadtangara-fw-6b9fb9edace1b0441eb8d5e9ee8e5c6ec1287554.tar.gz
Support retries for samd and touchwheel i2c
Diffstat (limited to 'src/drivers/touchwheel.cpp')
-rw-r--r--src/drivers/touchwheel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/touchwheel.cpp b/src/drivers/touchwheel.cpp
index 77b78c23..6d624b0f 100644
--- a/src/drivers/touchwheel.cpp
+++ b/src/drivers/touchwheel.cpp
@@ -76,7 +76,7 @@ void TouchWheel::WriteRegister(uint8_t reg, uint8_t val) {
.write_addr(kTouchWheelAddress, I2C_MASTER_WRITE)
.write_ack(reg, val)
.stop();
- esp_err_t res = transaction.Execute();
+ esp_err_t res = transaction.Execute(1);
if (res != ESP_OK) {
ESP_LOGW(kTag, "write failed: %s", esp_err_to_name(res));
}
@@ -92,7 +92,7 @@ uint8_t TouchWheel::ReadRegister(uint8_t reg) {
.write_addr(kTouchWheelAddress, I2C_MASTER_READ)
.read(&res, I2C_MASTER_NACK)
.stop();
- if (transaction.Execute() == ESP_OK) {
+ if (transaction.Execute(1) == ESP_OK) {
return res;
} else {
return 0;