diff --git a/README.org b/README.org index a3086a7..4ab1fff 100644 --- a/README.org +++ b/README.org @@ -4,7 +4,7 @@ * Library Information - Name :: AD57X4R - - Version :: 5.0.0 + - Version :: 5.0.1 - License :: BSD - URL :: https://github.com/janelia-arduino/AD57X4R - Author :: Peter Polidoro diff --git a/library.properties b/library.properties index 2e91cb7..f635efd 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AD57X4R -version=5.0.0 +version=5.0.1 author=Peter Polidoro maintainer=Peter Polidoro sentence=Provides an SPI based interface to the AD5724R, AD5734R, and the AD5754R Quad 12-/14-/16-Bit Unipolar/Bipolar Voltage Output DACs. diff --git a/src/AD57X4R/AD57X4R.cpp b/src/AD57X4R/AD57X4R.cpp index 880fa4d..673641b 100644 --- a/src/AD57X4R/AD57X4R.cpp +++ b/src/AD57X4R/AD57X4R.cpp @@ -513,7 +513,7 @@ void AD57X4R::writeMosiDatagramToChip(int chip, spiBeginTransaction(); for (int chip_n=(chip_count_ - 1); chip_n>=0; --chip_n) { - Datagram mosi_datagram_n = mosi_datagram_array[chip]; + Datagram mosi_datagram_n = mosi_datagram_array[chip_n]; for (int byte_n=(DATAGRAM_SIZE - 1); byte_n>=0; --byte_n) { uint8_t byte_write = (mosi_datagram_n.bytes >> (8*byte_n)) & 0xff; @@ -533,12 +533,12 @@ AD57X4R::Datagram AD57X4R::readMisoDatagramFromChip(int chip) spiBeginTransaction(); for (int chip_n=(chip_count_ - 1); chip_n>=0; --chip_n) { - miso_datagram_array[chip].bytes = 0; + miso_datagram_array[chip_n].bytes = 0; for (int byte_n=(DATAGRAM_SIZE - 1); byte_n>=0; --byte_n) { - uint8_t byte_write = (mosi_datagram_array[chip].bytes >> (8*byte_n)) & 0xff; + uint8_t byte_write = (mosi_datagram_array[chip_n].bytes >> (8*byte_n)) & 0xff; uint8_t byte_read = SPI.transfer(byte_write); - miso_datagram_array[chip].bytes |= ((uint32_t)byte_read) << (8*byte_n); + miso_datagram_array[chip_n].bytes |= ((uint32_t)byte_read) << (8*byte_n); } } spiEndTransaction();