Skip to content

Commit 12bf82e

Browse files
committed
needs more time to boot
1 parent de77dab commit 12bf82e

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

adafruit_bno080/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,21 +638,22 @@ def hard_reset(self):
638638
"""Hardware reset the sensor to an initial unconfigured state"""
639639
if not self._reset:
640640
return
641+
#print("Hard resetting...")
641642
self._reset.direction = digitalio.Direction.OUTPUT
642643
self._reset.value = True
643644
time.sleep(0.01)
644645
self._reset.value = False
645646
time.sleep(0.01)
646647
self._reset.value = True
647-
time.sleep(0.1)
648+
time.sleep(0.5)
648649

649650
def soft_reset(self):
650651
"""Reset the sensor to an initial unconfigured state"""
651-
print("Resetting...", end="")
652+
print("Soft resetting...", end="")
652653
data = bytearray(1)
653654
data[0] = 1
654655
seq = self._send_packet(BNO_CHANNEL_EXE, data)
655-
time.sleep(0.1)
656+
time.sleep(0.5)
656657

657658
for i in range(3):
658659
while True: # retry reading packets until ready!

adafruit_bno080/i2c.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,8 @@ def _send_packet(self, channel, data):
5151

5252
def _read_header(self):
5353
"""Reads the first 4 bytes available as a header"""
54-
while True:
55-
with self.bus_device_obj as i2c:
56-
try:
57-
i2c.readinto(self._data_buffer, end=4) # this is expecting a header
58-
break
59-
except RuntimeError:
60-
time.sleep(0.1)
61-
pass
54+
with self.bus_device_obj as i2c:
55+
i2c.readinto(self._data_buffer, end=4) # this is expecting a header
6256
packet_header = Packet.header_from_buffer(self._data_buffer)
6357
self._dbg(packet_header)
6458
return packet_header

0 commit comments

Comments
 (0)