Improve I2C locking and implement I2C for TactilityC (#147)
I2C: - Lock timeout set to reasonable times - Check lock status in all functions - Refactor lock/unlock to return `bool` values - Implement functions in TactilityC Other: - Updated screenshots
This commit is contained in:
committed by
GitHub
parent
a9e890a7f3
commit
7187e5e49e
@@ -49,7 +49,7 @@ static void onScanTimer(TT_UNUSED std::shared_ptr<void> context) {
|
||||
for (uint8_t address = 0; address < 128; ++address) {
|
||||
i2c_port_t port;
|
||||
if (getPort(data, &port)) {
|
||||
if (hal::i2c::masterCheckAddressForDevice(port, address, 10 / portTICK_PERIOD_MS)) {
|
||||
if (hal::i2c::masterHasDeviceAtAddress(port, address, 10 / portTICK_PERIOD_MS)) {
|
||||
TT_LOG_I(TAG, "Found device at address %d", address);
|
||||
if (!shouldStopScanTimer(data)) {
|
||||
addAddressToList(data, address);
|
||||
|
||||
Reference in New Issue
Block a user