Open Gadgetoid opened 2 years ago
The buffer swap:
https://github.com/Abstract-Horizon/vl53l5cx_python/blob/b6bed0ad85061b97eac31a55743e649e13b7a2f1/vl53l5cx/vl53l5cx.py#L319-L338
Can be more readable and faster using:
@staticmethod def swap_buffer(buffer: List[int], size: int) -> None: for i in range(0, min(size, len(buffer)), 4): buffer[i:i+4] = reversed(buffer[i:i+4])
I don't mind raising a PR for this and some other bits and bobs (i2c_msg is never set if you pass in an i2c object).
Raised as a draft along with some other bits for your consideration in #4
The buffer swap:
https://github.com/Abstract-Horizon/vl53l5cx_python/blob/b6bed0ad85061b97eac31a55743e649e13b7a2f1/vl53l5cx/vl53l5cx.py#L319-L338
Can be more readable and faster using:
I don't mind raising a PR for this and some other bits and bobs (i2c_msg is never set if you pass in an i2c object).