Skip to content

Commit b2a30fd

Browse files
committedSep 25, 2019
make works!
1 parent b74005d commit b2a30fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎crypto/getcertheader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def to_c_uint32(x):
2626
nums = []
2727
for i in range(0x20):
2828
nums.append(x%(2**32))
29-
x /= (2**32)
29+
x //= (2**32)
3030
return "{"+'U,'.join(map(str, nums))+"U}"
3131

3232
for fn in sys.argv[1:]:

‎python/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def reconnect(self):
232232
def flash_static(handle, code):
233233
# confirm flasher is present
234234
fr = handle.controlRead(Panda.REQUEST_IN, 0xb0, 0, 0, 0xc)
235-
assert fr[4:8] == "\xde\xad\xd0\x0d"
235+
assert fr[4:8] == b"\xde\xad\xd0\x0d"
236236

237237
# unlock flash
238238
print("flash: unlocking")
@@ -274,7 +274,7 @@ def flash(self, fn=None, code=None, reconnect=True):
274274
fn = os.path.join(BASEDIR, "board", fn)
275275

276276
if code is None:
277-
with open(fn) as f:
277+
with open(fn, "rb") as f:
278278
code = f.read()
279279

280280
# get version
@@ -364,7 +364,7 @@ def enter_bootloader(self):
364364
pass
365365

366366
def get_version(self):
367-
return self._handle.controlRead(Panda.REQUEST_IN, 0xd6, 0, 0, 0x40)
367+
return bytes(self._handle.controlRead(Panda.REQUEST_IN, 0xd6, 0, 0, 0x40)).decode('utf8')
368368

369369
def get_type(self):
370370
return self._handle.controlRead(Panda.REQUEST_IN, 0xc1, 0, 0, 0x40)

0 commit comments

Comments
 (0)