From 8220af8edeaa20605005945935f339bd1a89e8d1 Mon Sep 17 00:00:00 2001 From: Hans Date: Wed, 13 Sep 2023 13:02:10 +0200 Subject: [PATCH] Fix buggy DSP readback code Without the additional setstop parameter, the code doesn't work very well with the ESP32 --- src/SigmaDSP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SigmaDSP.cpp b/src/SigmaDSP.cpp index 88e1d7f..a2f4aab 100644 --- a/src/SigmaDSP.cpp +++ b/src/SigmaDSP.cpp @@ -1143,7 +1143,7 @@ void SigmaDSP::writeRegisterBlock(uint16_t memoryAddress, uint16_t length, const * * @param memoryAddress DSP memory address * @param readout Which register to read - * @param numberOfBytes How manu bytes to read + * @param numberOfBytes How many bytes to read * @return int32_t value where four bytes in the block are concatenated */ int32_t SigmaDSP::readBack(uint16_t memoryAddress, uint16_t readout, uint8_t numberOfBytes) @@ -1168,7 +1168,7 @@ int32_t SigmaDSP::readBack(uint16_t memoryAddress, uint16_t readout, uint8_t num _WireObject.endTransmission(false); int32_t returnVal = 0; - _WireObject.requestFrom(_dspAddress, numberOfBytes); + _WireObject.requestFrom(_dspAddress, numberOfBytes, (uint8_t)0); for(uint8_t i = 0; i < numberOfBytes; i++) returnVal = returnVal << 8 | _WireObject.read();