From 412541e218b87131db8782c4219f14b228562b22 Mon Sep 17 00:00:00 2001 From: fnqbruce Date: Wed, 23 Oct 2019 14:01:36 +1000 Subject: [PATCH 1/3] Fix FIFO error in ADXL372 wrapper code Because the FIFO on the ADXL372 provides 512 records, the adxl_read_reg_multiple() function must support 16-bit values for count, not just 8-bit. --- Arduino Uno R3/examples/ADXL372_example/adxl372.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp b/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp index f2c55cb..3d27de7 100644 --- a/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp +++ b/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp @@ -42,7 +42,7 @@ //#define ADXL_DEBUG static int adxl_read_reg_multiple(adxl_spi_handle *spi, unsigned char reg, - unsigned char count, unsigned char *val) + unsigned short count, unsigned char *val) { reg = reg << 1 | ADXL_SPI_RNW; return spi_write_then_read(spi, ®, 1, val, count); From 032e3ff32bf91ed0a605209e5e91268fc4ad4b55 Mon Sep 17 00:00:00 2001 From: fnqbruce Date: Tue, 29 Oct 2019 17:47:25 +1000 Subject: [PATCH 2/3] Reduced character count for changed line only --- Arduino Uno R3/examples/ADXL372_example/adxl372.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp b/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp index 3d27de7..70c4cde 100644 --- a/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp +++ b/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp @@ -42,7 +42,8 @@ //#define ADXL_DEBUG static int adxl_read_reg_multiple(adxl_spi_handle *spi, unsigned char reg, - unsigned short count, unsigned char *val) + unsigned short count, + unsigned char *val) { reg = reg << 1 | ADXL_SPI_RNW; return spi_write_then_read(spi, ®, 1, val, count); From d11045783e09155a1bca47ab0010489e4a48722d Mon Sep 17 00:00:00 2001 From: fnqbruce Date: Tue, 29 Oct 2019 17:54:57 +1000 Subject: [PATCH 3/3] Emulated declaration style of Communication.cpp Signed-off-by: fnqbruce --- Arduino Uno R3/examples/ADXL372_example/adxl372.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp b/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp index 70c4cde..6fa8f7c 100644 --- a/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp +++ b/Arduino Uno R3/examples/ADXL372_example/adxl372.cpp @@ -42,8 +42,7 @@ //#define ADXL_DEBUG static int adxl_read_reg_multiple(adxl_spi_handle *spi, unsigned char reg, - unsigned short count, - unsigned char *val) + unsigned count, unsigned char *val) { reg = reg << 1 | ADXL_SPI_RNW; return spi_write_then_read(spi, ®, 1, val, count);