fix pc detection, remove tools (#626)

master
Willem Melching 2021-02-01 14:57:49 +01:00 committed by GitHub
parent f71fd7b91b
commit 97cd401abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 35 deletions

View File

@ -4,13 +4,19 @@ CFLAGS += -Tstm32_flash.ld
DFU_UTIL = "dfu-util"
# Compile fast charge (DCP) only not on EON
PC = 0
ifeq (,$(wildcard /EON))
ifeq (,$(wildcard /TICI))
PC = 1
endif
endif
ifeq (1, $(PC))
BUILDER = DEV
else
CFLAGS += "-DEON"
BUILDER = EON
DFU_UTIL = "tools/dfu-util-aarch64"
endif
#COMPILER_PATH = /home/batman/Downloads/gcc-arm-none-eabi-9-2020-q2-update/bin/

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,33 +0,0 @@
#!/usr/bin/env python3
import sys
import time
import usb1
def enter_download_mode(device):
handle = device.open()
handle.claimInterface(0)
try:
handle.controlWrite(usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE, 0xd1, 0, 0, b'')
except (usb1.USBErrorIO, usb1.USBErrorPipe):
print("Device download mode enabled.")
time.sleep(1)
else:
print("Device failed to enter download mode.")
sys.exit(1)
def find_first_panda(context=None):
context = context or usb1.USBContext()
for device in context.getDeviceList(skip_on_error=True):
if device.getVendorID() == 0xbbaa and device.getProductID() & 0xFF00 == 0xdd00:
return device
if __name__ == "__main__":
panda_dev = find_first_panda()
if panda_dev is None:
print("no device found")
sys.exit(0)
print("found device")
enter_download_mode(panda_dev)