You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for you work. This library works very reliably for us. We did have to make a small change though to the function "getComplexData". The while-loop in there may hang and the function may run indefinitely.
We changed the code around the while loop waiting for the STATUS_DATA_VALID as follows:
bool AD5933::getComplexData(int *real, int *imag) {
// ako, 2021-02-09: this while loop may hang! --> return if max requests exceeded
// Wait for a measurement to be available
int maxLoops = 1000;
while ((readStatusRegister() & STATUS_DATA_VALID) != STATUS_DATA_VALID) {
if(maxLoops > 0){
maxLoops--;
delay(1);
}
else
{
// timeout
*real = -1;
*imag = -1;
return false;
}
}
...
Would you consider incorporating this into the official release?
Best regards,
Adrian
The text was updated successfully, but these errors were encountered:
Dear author:
Thank you for you work. This library works very reliably for us. We did have to make a small change though to the function "getComplexData". The while-loop in there may hang and the function may run indefinitely.
We changed the code around the while loop waiting for the STATUS_DATA_VALID as follows:
bool AD5933::getComplexData(int *real, int *imag) {
// ako, 2021-02-09: this while loop may hang! --> return if max requests exceeded
// Wait for a measurement to be available
int maxLoops = 1000;
while ((readStatusRegister() & STATUS_DATA_VALID) != STATUS_DATA_VALID) {
if(maxLoops > 0){
maxLoops--;
delay(1);
}
else
{
// timeout
*real = -1;
*imag = -1;
return false;
}
}
...
Would you consider incorporating this into the official release?
Best regards,
Adrian
The text was updated successfully, but these errors were encountered: