diff --git a/chip/stm32/dma.c b/chip/stm32/dma.c index c37063a894..935ffed038 100644 --- a/chip/stm32/dma.c +++ b/chip/stm32/dma.c @@ -217,7 +217,7 @@ int dma_wait(int channel) if (deadline.val <= get_time().val) return -1; else - usleep(DMA_POLLING_INTERVAL_US); + udelay(DMA_POLLING_INTERVAL_US); } return 0; } diff --git a/chip/stm32/i2c.c b/chip/stm32/i2c.c index 8ac6823cea..5205abbda6 100644 --- a/chip/stm32/i2c.c +++ b/chip/stm32/i2c.c @@ -131,7 +131,7 @@ static int i2c_write_raw_slave(int port, void *buf, int len) /* Configuring i2c2 to use DMA */ STM32_I2C_CR2(port) |= (1 << 11); - if (!in_interrupt_context()) { + if (in_interrupt_context()) { /* Poll for the transmission complete flag */ dma_wait(DMAC_I2C_TX); dma_clear_isr(DMAC_I2C_TX);