Fix off by one on the capture buffer due to earlier debugging. I finally realized I was checking if an unsigned int was less than zero. Thanks Szilárd for the correct indexes in the issue comments.

This commit is contained in:
Andrew Gillham
2023-10-03 23:48:07 -05:00
parent 0b2651864e
commit 739144d57e
3 changed files with 14 additions and 14 deletions

View File

@@ -2,7 +2,7 @@
*
* SUMP Protocol Implementation for Arduino boards.
*
* Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021 Andrew Gillham
* Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023 Andrew Gillham
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,7 @@
*/
void captureInline2mhz() {
unsigned int i;
signed int i;
/*
* basic trigger, wait until all trigger conditions are met on port.
@@ -14441,7 +14441,7 @@ void captureInline2mhz() {
* dump the samples back to the SUMP client. nothing special
* is done for any triggers, this is effectively the 0/100 buffer split.
*/
for (i = readCount ; i > 0; i--) {
for (i = readCount-1 ; i >= 0; i--) {
#ifdef USE_PORTD
Serial.write(logicdata[i] >> 2);
#else