Skip to content

Commit

Permalink
make works!
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiasini committed Sep 25, 2019
1 parent b74005d commit b2a30fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crypto/getcertheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def to_c_uint32(x):
nums = []
for i in range(0x20):
nums.append(x%(2**32))
x /= (2**32)
x //= (2**32)
return "{"+'U,'.join(map(str, nums))+"U}"

for fn in sys.argv[1:]:
Expand Down
6 changes: 3 additions & 3 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def reconnect(self):
def flash_static(handle, code):
# confirm flasher is present
fr = handle.controlRead(Panda.REQUEST_IN, 0xb0, 0, 0, 0xc)
assert fr[4:8] == "\xde\xad\xd0\x0d"
assert fr[4:8] == b"\xde\xad\xd0\x0d"

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

if code is None:
with open(fn) as f:
with open(fn, "rb") as f:
code = f.read()

# get version
Expand Down Expand Up @@ -364,7 +364,7 @@ def enter_bootloader(self):
pass

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

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

0 comments on commit b2a30fd

Please sign in to comment.