| 16 | uint8_t *rbuf, |
| 17 | size_t rbuf_len); |
| 18 | inline void process_dma(i2c_dma_t *i2c_dma) |
| 19 | { |
| 20 | if (i2c_dma->running) |
| 21 | { |
| 22 | i2c_dma->running = false; |
| 23 | cancel_alarm(i2c_dma->timeout_alarm_id); |
| 24 | if (i2c_dma->abort_detected || !i2c_dma->stop_detected) |
| 25 | { |
| 26 | dma_channel_abort(i2c_dma->tx_chan); |
| 27 | if (i2c_dma->reading) |
| 28 | { |
| 29 | dma_channel_abort(i2c_dma->rx_chan); |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | if (i2c_dma->dmaInterface[i2c_dma->currentDevAddr]) |
| 34 | { |
| 35 | i2c_dma->dmaInterface[i2c_dma->currentDevAddr]->processData(i2c_dma->currentDevAddr, i2c_dma->running, i2c_dma->timeout, i2c_dma->abort_detected, i2c_dma->stop_detected); |
| 36 | } |
| 37 | i2c_dma->timeout = false; |
| 38 | i2c_dma->abort_detected = false; |
| 39 | i2c_dma->stop_detected = false; |
| 40 | i2c_dma->processing = false; |
| 41 | } |
| 42 | |
| 43 | static i2c_dma_t i2c_dma_list[2] = {0}; |
| 44 | static void i2c_dma_irq_handler(i2c_dma_t *i2c_dma) |
no test coverage detected