- read = AO_MS5607_ADC_READ;
- ao_spi_send(&read, 1, AO_MS5607_SPI_INDEX);
- ao_spi_recv(&reply, 3, AO_MS5607_SPI_INDEX);
+ reply[0] = AO_MS5607_ADC_READ;
+#if defined(AO_SPI_DUPLEX) && AO_SPI_DUPLEX == 0
+ ao_spi_send(reply, 1, AO_MS5607_SPI_INDEX);
+ ao_spi_recv(reply+1, 3, AO_MS5607_SPI_INDEX);
+#else
+ ao_spi_duplex(&reply, &reply, 4, AO_MS5607_SPI_INDEX);
+#endif