A simple but very effective scope. Up to 6 channels of 32 bit float data at 1 kHz.
Fork of HIDScope by
Diff: HIDScope.cpp
- Revision:
- 5:80d551456856
- Parent:
- 0:79e3f3072f3b
--- a/HIDScope.cpp Thu Sep 22 08:00:52 2016 +0000 +++ b/HIDScope.cpp Thu Oct 06 12:54:02 2016 +0000 @@ -1,6 +1,6 @@ #include "HIDScope.h" -HIDScope::HIDScope(int channels) : hid(64,64) +HIDScope::HIDScope(int channels, bool non_blocking) : send_non_blocking(non_blocking), hid(64,64) { bufferData = new float[channels](); channelCount = channels; @@ -29,9 +29,6 @@ void HIDScope::send() { - for(int ch=0; ch<channelCount; ch++) - memcpy(&scopeData.data[ch*4], &bufferData[ch], 4); // Copy a 4 byte float to the char array - - // Send non blocking, can be adjusted to blocking (hid.send) + memcpy(&scopeData.data, bufferData, sizeof( float ) * channelCount); // Copy a 4 byte float to the char array hid.sendNB(&scopeData); } \ No newline at end of file