diff options
-rw-r--r-- | os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c b/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c index f348121dd..2ea78ca89 100644 --- a/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c +++ b/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c @@ -161,14 +161,15 @@ static void i2c_lld_serve_interrupt(I2CDriver *i2cp, uint32_t isr) { /* Stops the associated DMA streams.*/
dmaStreamDisable(i2cp->dmatx);
dmaStreamDisable(i2cp->dmarx);
-
- /* Errors are propagated to the upper layer.*/
- if (i2cp->errors) {
- _i2c_wakeup_error_isr(i2cp);
- return;
- }
}
- _i2c_wakeup_isr(i2cp);
+ if (i2cp->errors) {
+ /* Errors are signaled to the upper layer.*/
+ _i2c_wakeup_error_isr(i2cp);
+ }
+ else {
+ /* Normal transaction end.*/
+ _i2c_wakeup_isr(i2cp);
+ }
}
/**
|