Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions proto9x/sensor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

from enum import Enum

from hashlib import sha256
import os.path
from .tls import tls
from .usb import usb
from .db import db, subtype_to_string
Expand Down Expand Up @@ -214,7 +215,7 @@ def open(self, load_calib_data=True):
factory_bits = get_factory_bits(0x0e00)
self.factory_calibration_values = factory_bits[3][4:]

if load_calib_data and isfile(calib_data_path):
if load_calib_data and os.path.isfile(calib_data_path):
with open(calib_data_path, 'rb') as f:
self.calib_data = f.read()
print('Calibration data loaded from a file.')
Expand Down
2 changes: 1 addition & 1 deletion proto9x/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def purge_int_queue(self):
except:
pass

def open(self, vendor=0x138a, product=0x0097):
def open(self, vendor=0x06cb, product=0x009a):
self.dev = ucore.find(idVendor=vendor, idProduct=product)
self.dev.default_timeout = 15000
self.thread = Thread(target=lambda: self.int_thread())
Expand Down