File tree Expand file tree Collapse file tree
lib/steami_config/steami_config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,21 +243,16 @@ def get_accelerometer_calibration(self):
243243
244244
245245 def apply_accelerometer_calibration (self , ism330dl_instance ):
246- """Apply stored calibration to ISM330DL instance.
247-
248- The instance must support offset attributes (user-defined).
249-
250- Args:
251- ism330dl_instance: ISM330DL driver instance
252- """
246+ """Apply stored accelerometer calibration to an ISM330DL instance."""
253247 if type (ism330dl_instance ).__name__ .lower () != "ism330dl" :
254248 return
255249
256250 cal = self .get_accelerometer_calibration ()
257251 if cal is None :
258252 return
259253
260- # the driver does NOT have native offset support, so we add attributes dynamically
261- ism330dl_instance ._accel_offset_x = cal ["ox" ]
262- ism330dl_instance ._accel_offset_y = cal ["oy" ]
263- ism330dl_instance ._accel_offset_z = cal ["oz" ]
254+ ism330dl_instance .set_accel_offset (
255+ cal ["ox" ],
256+ cal ["oy" ],
257+ cal ["oz" ],
258+ )
You can’t perform that action at this time.
0 commit comments