@@ -13,11 +13,8 @@ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Publ
1313Version 1-1-2016
1414Version 14-1-2016 sample0_us
1515Version 10-2-2017 1, 2, 3, 4 channels
16- Version 10-2-2017 sampleA sampleB sampleABC sampleABCD to avoid mistakes
17- all unsigned int -> int
18- added stop()
19- sizeof(int)
20- SerialUSB -> Serial (incl. <Albert.h>)
16+ Version 10-2-2017 sampleA sampleB sampleABC sampleABCD to avoid mistakes, all unsigned int -> int, added stop(), sizeof(int)
17+ SerialUSB -> Serial (incl. <Albert.h>), short
2118
2219start ___|____________________________________|________
2320
@@ -44,7 +41,7 @@ void Scope::start(byte _channels, int _preSamples, unsigned int _recordLenght)
4441 stopPtr=32767 ;
4542 samplingOn=1 ;
4643 channels = _channels;
47- recordLenght = maxBytes/(sizeof (int )*channels);
44+ recordLenght = maxBytes/(sizeof (short )*channels);
4845 if (_recordLenght <= recordLenght) recordLenght = _recordLenght;
4946 if (abs (_preSamples) <= recordLenght) preSamples = _preSamples;
5047}
@@ -73,22 +70,22 @@ void Scope::show()
7370 stopPtr = 32767 ;
7471}
7572
76- void Scope::sampleA (int valueA) // 1 channel
73+ void Scope::sampleA (short valueA) // 1 channel
7774{ if (samplingOn)
7875 { ringBuffer.chA [ptr] = valueA;
7976 sampleControl ();
8077 }
8178}
8279
83- void Scope::sampleAB (int valueA, int valueB) // 2 channels
80+ void Scope::sampleAB (short valueA, short valueB) // 2 channels
8481{ if (samplingOn)
8582 { ringBuffer.chAB [ptr][0 ] = valueA;
8683 ringBuffer.chAB [ptr][1 ] = valueB;
8784 sampleControl ();
8885 }
8986}
9087
91- void Scope::sampleABC (int valueA, int valueB, int valueC) // 3 channels
88+ void Scope::sampleABC (short valueA, short valueB, short valueC) // 3 channels
9289{ if (samplingOn)
9390 { ringBuffer.chABC [ptr][0 ] = valueA;
9491 ringBuffer.chABC [ptr][1 ] = valueB;
@@ -97,7 +94,7 @@ void Scope::sampleABC(int valueA, int valueB, int valueC) // 3 channels
9794 }
9895}
9996
100- void Scope::sampleABCD (int valueA, int valueB, int valueC, int valueD) // 4 channels
97+ void Scope::sampleABCD (short valueA, short valueB, short valueC, short valueD) // 4 channels
10198{ if (samplingOn)
10299 { ringBuffer.chABCD [ptr][0 ] = valueA;
103100 ringBuffer.chABCD [ptr][1 ] = valueB;
0 commit comments