summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2019-02-04 22:35:02 -0800
committerKeith Packard <keithp@keithp.com>2019-02-18 13:07:29 -0800
commit119a829e58aff5dd7801fe7ef8cae886bf31fec1 (patch)
tree9264a35f14304ae6743060c2eb4d469ebbf3f8ef
parentacf032eb39504657e9289ca54844967b9c3bed76 (diff)
altos/stm: Note that ao_i2c_recv_dma_isr isn't actually used
This function resets the i2c transceiver after DMA completes, but it hasn't ever been hooked up. Some testing would be a good idea. For now, just add a comment and mark the function as referenced to avoid a compiler warning. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/stm/ao_i2c_stm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/stm/ao_i2c_stm.c b/src/stm/ao_i2c_stm.c
index 23805aa8..c02bc5a5 100644
--- a/src/stm/ao_i2c_stm.c
+++ b/src/stm/ao_i2c_stm.c
@@ -341,6 +341,17 @@ ao_i2c_recv(void *block, uint16_t len, uint8_t index, uint8_t stop)
(0 << STM_DMA_CCR_PINC) |
(0 << STM_DMA_CCR_CIRC) |
(STM_DMA_CCR_DIR_PER_TO_MEM << STM_DMA_CCR_DIR));
+
+ /* XXX ao_i2c_recv_dma_isr hasn't ever been used, so it
+ * doesn't appear to be necessary. Testing with a device
+ * that uses i2c would really be useful here to discover
+ * whether this function is necessary or not.
+ */
+#if 0
+ ao_dma_set_isr(rx_dma_index, ao_i2c_recv_dma_isr);
+#else
+ (void) ao_i2c_recv_dma_isr;
+#endif
stm_i2c->cr1 = AO_STM_I2C_CR1 | (1 << STM_I2C_CR1_ACK);
stm_i2c->cr2 = AO_STM_I2C_CR2 |
(1 << STM_I2C_CR2_DMAEN) | (1 << STM_I2C_CR2_LAST);