Merge pull request #248 from pimoroni/patch-icp10125-i2c-lockup

ICP10125: Fix block indefinitely on repeated start
pull/250/head v1.18.1
Philip Howard 2022-02-10 17:30:17 +00:00 zatwierdzone przez GitHub
commit 9fafa3edb1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -39,7 +39,7 @@ namespace pimoroni {
}
void ICP10125::reset() {
uint16_t command = SOFT_RESET;
uint16_t command = __bswap16(SOFT_RESET);
i2c->write_blocking(address, (uint8_t *)&command, 2, false);
sleep_ms(10); // Soft reset time is 170us but you can never be too sure...
}
@ -86,7 +86,7 @@ namespace pimoroni {
uint16_result result;
uint16_t command = __bswap16(READ_ID);
i2c->write_blocking(address, (uint8_t *)&command, 2, false);
i2c->write_blocking(address, (uint8_t *)&command, 2, true);
i2c->read_blocking(address, (uint8_t *)&result, 3, false);
if(result.crc8 != crc8((uint8_t *)&result.data, 2)) {