stm32/i2cslave: Account for slow addr_match callback.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
2443878bd9
commit
78d16672e1
1 changed files with 3 additions and 0 deletions
|
|
@ -94,6 +94,9 @@ void i2c_slave_irq_handler(i2c_slave_t *i2c) {
|
|||
i2c->ISR = I2C_ISR_TXE;
|
||||
i2c->ICR = I2C_ICR_ADDRCF;
|
||||
i2c_slave_process_addr_match(i2c, (i2c->ISR >> I2C_ISR_DIR_Pos) & 1);
|
||||
// Re-read ISR in case i2c_slave_process_addr_match() took some time
|
||||
// to process and TXIS/RXNE was set in the meantime.
|
||||
isr = i2c->ISR;
|
||||
}
|
||||
if (isr & I2C_ISR_TXIS) {
|
||||
// This callback must call i2c_slave_write_byte.
|
||||
|
|
|
|||
Loading…
Reference in a new issue