mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Clear i2c abort reason less often. (#2026)
It seems to be possible to get stuck in the loop which is checking for abort. It can take 100s of iterations before an abort happens and on each iteration we're clearing the abort interrupt even when it's not required. If we only clear the abort when needed the lockup doesn't seem to be reproducible. Fixes #2025
This commit is contained in:
parent
4726a56d24
commit
68778b1135
1 changed files with 4 additions and 1 deletions
|
|
@ -298,7 +298,10 @@ static int i2c_read_blocking_internal(i2c_inst_t *i2c, uint8_t addr, uint8_t *ds
|
|||
|
||||
do {
|
||||
abort_reason = i2c->hw->tx_abrt_source;
|
||||
abort = (bool) i2c->hw->clr_tx_abrt;
|
||||
if (i2c->hw->raw_intr_stat & I2C_IC_RAW_INTR_STAT_TX_ABRT_BITS) {
|
||||
abort = true;
|
||||
i2c->hw->clr_tx_abrt;
|
||||
}
|
||||
if (timeout_check) {
|
||||
timeout = timeout_check(ts, false);
|
||||
abort |= timeout;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue