Skip to content

Commit

Permalink
drivers: nrfx_{twi, twim}: Fix busy flag not reset
Browse files Browse the repository at this point in the history
This is necessary so that next occurence of nrfx_{twi, twim}_enable()
followed by {twi, twim}_xfer() will not raised a NRFX_ERROR_BUSY error.

This could happen when a previous transfer is started but is aborted
using nrfx_{twi, twim}_disable() before the end of the transaction which
calls {twi, twim}_irq_handler().

Signed-off-by: Xavier Chapron <[email protected]>
  • Loading branch information
Xavier Chapron authored and nika-nordic committed Mar 18, 2021
1 parent d779b49 commit c7c5127
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/src/nrfx_twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ void nrfx_twi_disable(nrfx_twi_t const * p_instance)
nrf_twi_disable(p_twi);

p_cb->state = NRFX_DRV_STATE_INITIALIZED;
p_cb->busy = false;
NRFX_LOG_INFO("Instance disabled: %d.", p_instance->drv_inst_idx);
}

Expand Down
1 change: 1 addition & 0 deletions drivers/src/nrfx_twim.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ void nrfx_twim_disable(nrfx_twim_t const * p_instance)
nrf_twim_disable(p_twim);

p_cb->state = NRFX_DRV_STATE_INITIALIZED;
p_cb->busy = false;
NRFX_LOG_INFO("Instance disabled: %d.", p_instance->drv_inst_idx);
}

Expand Down

0 comments on commit c7c5127

Please sign in to comment.