-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Noticed a typo for the shake report. In the SH-2 doc (6.5.32 page 78) it shows the lower 3 bit contain the x,y,z status bits. but the bit mask here has 0x111, it should be 0b111 or likely clearer for a "<H" may be 0x07.
in init.py line 302
def _parse_shake_report(report_bytes: bytearray) -> bool:
shake_bitfield = unpack_from("<H", report_bytes, offset=4)[0]
return (shake_bitfield & 0x111) > 0
I don't have CircuitPython, so I don't have any way to test, so I won't do a pull request. What I believe will fix it:
def _parse_shake_report(report_bytes: bytearray) -> bool:
shake_bitfield = unpack_from("<H", report_bytes, offset=4)[0]
return (shake_bitfield & 0x07) > 0
Metadata
Metadata
Assignees
Labels
No labels