Context
Part of the auto-trigger consistency harmonization (#44).
The HTS221 _ensure_data() calls trigger_one_shot() which uses a fixed sleep_ms(15) without polling the STATUS register for data ready or raising on timeout. While the fixed delay works because the datasheet guarantees the conversion time, it is inconsistent with the pattern used by WSEN-HIDS, LIS2MDL, VL53L1X, and APDS9960 which all poll for data ready and raise on timeout.
Current behavior
def trigger_one_shot(self):
# ... configure one-shot ...
sleep_ms(15)
def _ensure_data(self):
if self._is_power_down() or self._is_one_shot_mode():
self.trigger_one_shot()
Expected behavior
Add polling of STATUS register after trigger_one_shot() with a bounded timeout, and raise OSError if data never becomes ready. This provides a consistent safety net across all drivers.
Related
Context
Part of the auto-trigger consistency harmonization (#44).
The HTS221
_ensure_data()callstrigger_one_shot()which uses a fixedsleep_ms(15)without polling the STATUS register for data ready or raising on timeout. While the fixed delay works because the datasheet guarantees the conversion time, it is inconsistent with the pattern used by WSEN-HIDS, LIS2MDL, VL53L1X, and APDS9960 which all poll for data ready and raise on timeout.Current behavior
Expected behavior
Add polling of STATUS register after
trigger_one_shot()with a bounded timeout, and raiseOSErrorif data never becomes ready. This provides a consistent safety net across all drivers.Related