Context
Part of the auto-trigger consistency harmonization (#44).
The ISM330DL _ensure_data() (merged in PR #124) uses a fixed sleep_ms(100) after restoring ODR, without polling STATUS_REG for data ready or raising on timeout. This is inconsistent with the pattern used by WSEN-HIDS, LIS2MDL, VL53L1X, and APDS9960 which all poll for data ready and raise OSError on timeout.
Current behavior
def _ensure_data(self):
if self._is_power_down():
self.configure_accel(self._accel_odr, self._accel_scale)
self.configure_gyro(self._gyro_odr, self._gyro_scale)
sleep_ms(100)
Expected behavior
def _ensure_data(self):
if self._is_power_down():
self.configure_accel(self._accel_odr, self._accel_scale)
self.configure_gyro(self._gyro_odr, self._gyro_scale)
for _ in range(50):
if self.status()["accel_ready"]:
return
sleep_ms(10)
raise OSError("ISM330DL data ready timeout")
Related
Context
Part of the auto-trigger consistency harmonization (#44).
The ISM330DL
_ensure_data()(merged in PR #124) uses a fixedsleep_ms(100)after restoring ODR, without polling STATUS_REG for data ready or raising on timeout. This is inconsistent with the pattern used by WSEN-HIDS, LIS2MDL, VL53L1X, and APDS9960 which all poll for data ready and raiseOSErroron timeout.Current behavior
Expected behavior
Related