Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong formula for gas_wait causing huge sampling delays #67

Closed
antoine-sac opened this issue Sep 15, 2023 · 0 comments
Closed

Wrong formula for gas_wait causing huge sampling delays #67

antoine-sac opened this issue Sep 15, 2023 · 0 comments

Comments

@antoine-sac
Copy link

antoine-sac commented Sep 15, 2023

A typo in the code makes the gas sampling take over 4 seconds in most cases.

As per datasheet, _calc_gas_wait(100) should be 0x59 but we always get 0xff instead -- I suggest adding a test with this known-good value.

The code currently reads

durval: UINT8 = 0xFF  # Max duration
if dur < 0xFC0:
    return durval

but it should be

durval: UINT8 = 0xFF  # Max duration
if dur >= 0xFC0:
    return durval

cf https://github.com/boschsensortec/BME68x-Sensor-API/blob/master/bme68x.c#L1181C13-L1181C13

That's probably the root cause of #65 and does not help #66 either (because we block waiting for sleep while gas wait is active).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant