Skip to content

Wrong formula for gas_wait causing huge sampling delays #67

Closed
@antoine-sac

Description

@antoine-sac

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions