mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-340 I2C NACK causes next transfers to fail.
Needed to clear the NACK flag in the ISR, or the next transfers seem to get a nack too because the IRQ comes back git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3017 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
f6a2584f12
commit
4c51e80b5b
@ -1100,6 +1100,7 @@ void PIOS_I2C_ER_IRQ_Handler(uint32_t i2c_id)
|
||||
|
||||
if(event & I2C_FLAG_AF) {
|
||||
i2c_nack_counter++;
|
||||
I2C_ClearFlag(i2c_adapter->cfg->regs, I2C_FLAG_AF);
|
||||
i2c_adapter_inject_event(i2c_adapter, I2C_EVENT_NACK);
|
||||
} else { /* Mostly bus errors here */
|
||||
i2c_adapter_log_fault(PIOS_I2C_ERROR_INTERRUPT);
|
||||
|
Loading…
Reference in New Issue
Block a user