From 837eb0fceb083ca6aaa7ef0e24429d26422bba4f Mon Sep 17 00:00:00 2001 From: Nicole Parrot Date: Wed, 7 Mar 2018 12:17:36 -0500 Subject: [PATCH] remove print statement (#37) reconfig_bus() is now mutex protected --- Python/di_sensors/easy_inertial_measurement_unit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/di_sensors/easy_inertial_measurement_unit.py b/Python/di_sensors/easy_inertial_measurement_unit.py index 44bb43d..8e2860c 100644 --- a/Python/di_sensors/easy_inertial_measurement_unit.py +++ b/Python/di_sensors/easy_inertial_measurement_unit.py @@ -50,7 +50,7 @@ def __init__(self, port="AD1", use_mutex=False): ifMutexAcquire(self.use_mutex) try: - print("INSTANTIATING ON PORT {} OR BUS {} WITH MUTEX {}".format(port, bus, use_mutex)) + # print("INSTANTIATING ON PORT {} OR BUS {} WITH MUTEX {}".format(port, bus, use_mutex)) super(self.__class__, self).__init__(bus = bus) # on GPG3 we ask that the IMU be at the back of the robot, facing outward # We do not support the IMU on GPG2 but leaving the if statement in case @@ -69,7 +69,9 @@ def __init__(self, port="AD1", use_mutex=False): ifMutexRelease(self.use_mutex) def reconfig_bus(self): + ifMutexAcquire(self.use_mutex) self.BNO055.i2c_bus.reconfig_bus() + ifMutexRelease(self.use_mutex) def calibrate(self): print("calibrating")