|
|
@ -8,6 +8,8 @@ from common.gpio import GPIO_HUB_RST_N, GPIO_STM_BOOT0, GPIO_STM_RST_N, gpio_ini |
|
|
|
from panda import BASEDIR, Panda, PandaDFU, build_st |
|
|
|
from panda import BASEDIR, Panda, PandaDFU, build_st |
|
|
|
from selfdrive.swaglog import cloudlog |
|
|
|
from selfdrive.swaglog import cloudlog |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_legacy_panda_reset(): |
|
|
|
|
|
|
|
return os.path.isfile("/persist/LEGACY_PANDA_RESET") |
|
|
|
|
|
|
|
|
|
|
|
def set_panda_power(power=True): |
|
|
|
def set_panda_power(power=True): |
|
|
|
if not TICI: |
|
|
|
if not TICI: |
|
|
@ -16,12 +18,12 @@ def set_panda_power(power=True): |
|
|
|
gpio_init(GPIO_STM_RST_N, True) |
|
|
|
gpio_init(GPIO_STM_RST_N, True) |
|
|
|
gpio_init(GPIO_STM_BOOT0, True) |
|
|
|
gpio_init(GPIO_STM_BOOT0, True) |
|
|
|
|
|
|
|
|
|
|
|
gpio_set(GPIO_STM_RST_N, False) |
|
|
|
gpio_set(GPIO_STM_RST_N, False if is_legacy_panda_reset() else True) |
|
|
|
gpio_set(GPIO_HUB_RST_N, True) |
|
|
|
gpio_set(GPIO_HUB_RST_N, True) |
|
|
|
|
|
|
|
|
|
|
|
time.sleep(0.1) |
|
|
|
time.sleep(0.1) |
|
|
|
|
|
|
|
|
|
|
|
gpio_set(GPIO_STM_RST_N, power) |
|
|
|
gpio_set(GPIO_STM_RST_N, power if is_legacy_panda_reset() else (not power)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_firmware_fn(): |
|
|
|
def get_firmware_fn(): |
|
|
|