CreaTe-M8-BME / CreaTeBME

Python Package for interfacing the bluetooth IMU module for CreaTe M8 BME.
GNU General Public License v3.0
0 stars 2 forks source link

Blocking now doesn't accidentally clear the queue #26

Closed MaxLiebe closed 3 months ago

MaxLiebe commented 3 months ago

Short explanation of what was broken and how it was fixed:

Whenever get_measurements() is called, it also clears the queue. This meant that if one of the sensors had sent data while the other hadn't sent any in the exact same frame, the data of the first sensor would get cleared. This means that even if the second sensor sent data a short time after this, the while loop would still continue because it would now think the first sensor hadn't sent any data.

We now access the queue directly to make sure we don't clear it. Then when we're sure both sensors have sent data we clear it once to make sure both sensors have the around same amount of data points.

MaxLiebe commented 3 months ago

Please review this quickly, many people are having issues with this ;)