Skip to content

Commit 0bffad9

Browse files
authored
Add files via upload
1 parent 194d385 commit 0bffad9

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

avdweb_SWscope.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void SWscope::start(byte _channels, int _preSamples, unsigned int _recordLenght)
4444
stopPtr=32767;
4545
samplingOn=1;
4646
channels = _channels;
47-
recordLenght = maxBytes/(sizeof(short)*channels);
47+
recordLenght = maxScopeBytes/(sizeof(short)*channels);
4848
if(_recordLenght <= recordLenght) recordLenght = _recordLenght;
4949
if(abs(_preSamples) <= recordLenght) preSamples = _preSamples;
5050
}
@@ -138,8 +138,3 @@ void SWscope::testBuffer()
138138
probeA(i);
139139
}
140140
}
141-
142-
143-
144-
145-

avdweb_SWscope.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Publ
1212
#include <Arduino.h>
1313

1414
#if defined(__arm__)
15-
const unsigned int maxBytes = 7000; // SAMD21: max ~ 7000
15+
const unsigned int maxScopeBytes = 7000; // SAMD21: max ~ 7000
1616
#else
17-
const int maxBytes = 700; // AVR: max ~ 780
17+
const int maxScopeBytes = 100; // ATTENTION SET HERE, AVR ATmega328: max ~ 780 ATmega168: max ~ 320
1818
#endif
1919

2020
class SWscope
@@ -36,10 +36,10 @@ class SWscope
3636
void sampleControl();
3737
unsigned int calcPtr(int ptr);
3838

39-
union{short chA[maxBytes/2];
40-
short chAB[maxBytes/4][2];
41-
short chABC[maxBytes/3][3];
42-
short chABCD[maxBytes/8][4];} ringBuffer;
39+
union{short chA[maxScopeBytes/2];
40+
short chAB[maxScopeBytes/4][2];
41+
short chABC[maxScopeBytes/3][3];
42+
short chABCD[maxScopeBytes/8][4];} ringBuffer;
4343

4444
unsigned long sample0_us, usPerDiv;
4545
bool triggered, samplingOn;
@@ -48,5 +48,3 @@ class SWscope
4848
};
4949

5050
#endif
51-
52-

0 commit comments

Comments
 (0)