mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-19 03:13:14 +00:00
Improvements
This commit is contained in:
parent
88eecf363e
commit
73b24a6460
@ -7,6 +7,8 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
idf_component_register(
|
idf_component_register(
|
||||||
SRCS ${SOURCES}
|
SRCS ${SOURCES}
|
||||||
INCLUDE_DIRS "Include/"
|
INCLUDE_DIRS "Include/"
|
||||||
|
# TODO move the related logic for esp_time in Tactility/time.h into the Platform/ subproject
|
||||||
|
REQUIRES esp_timer
|
||||||
)
|
)
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
#include <tactility/concurrent/timer.h>
|
#include <tactility/concurrent/timer.h>
|
||||||
#include <tactility/check.h>
|
#include <tactility/check.h>
|
||||||
#include <tactility/freertos/timers.h>
|
#include <tactility/freertos/timers.h>
|
||||||
|
|||||||
@ -36,12 +36,11 @@ error_t i2c_controller_write_register(Device* device, uint8_t address, uint8_t r
|
|||||||
error_t i2c_controller_write_register_array(Device* device, uint8_t address, const uint8_t* data, uint16_t dataSize, TickType_t timeout) {
|
error_t i2c_controller_write_register_array(Device* device, uint8_t address, const uint8_t* data, uint16_t dataSize, TickType_t timeout) {
|
||||||
const auto* driver = device_get_driver(device);
|
const auto* driver = device_get_driver(device);
|
||||||
assert(dataSize % 2 == 0);
|
assert(dataSize % 2 == 0);
|
||||||
error_t error;
|
|
||||||
for (int i = 0; i < dataSize; i += 2) {
|
for (int i = 0; i < dataSize; i += 2) {
|
||||||
error = I2C_DRIVER_API(driver)->write_register(device, address, data[i], &data[i + 1], 1, timeout);
|
error_t error = I2C_DRIVER_API(driver)->write_register(device, address, data[i], &data[i + 1], 1, timeout);
|
||||||
if (error != ERROR_NONE) break;
|
if (error != ERROR_NONE) return error;
|
||||||
}
|
}
|
||||||
return error;
|
return ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_t i2c_controller_has_device_at_address(Device* device, uint8_t address, TickType_t timeout) {
|
error_t i2c_controller_has_device_at_address(Device* device, uint8_t address, TickType_t timeout) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user