remove legacy reset line support (#19770)
old-commit-hash: 8c31ab3cee7c2f3a4b91c223aa5c0eedae533fe6
This commit is contained in:
@@ -10,30 +10,19 @@
|
||||
#include "messaging.hpp"
|
||||
#include "panda.h"
|
||||
|
||||
#ifdef QCOM2
|
||||
bool is_legacy_panda_reset() {
|
||||
FILE *file = fopen("/persist/LEGACY_PANDA_RESET", "r");
|
||||
if(file) {
|
||||
fclose(file);
|
||||
}
|
||||
return (file != NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
void panda_set_power(bool power){
|
||||
#ifdef QCOM2
|
||||
int err = 0;
|
||||
bool is_legacy = is_legacy_panda_reset();
|
||||
|
||||
err += gpio_init(GPIO_STM_RST_N, true);
|
||||
err += gpio_init(GPIO_STM_BOOT0, true);
|
||||
|
||||
err += gpio_set(GPIO_STM_RST_N, is_legacy ? false : true);
|
||||
err += gpio_set(GPIO_STM_RST_N, true);
|
||||
err += gpio_set(GPIO_STM_BOOT0, false);
|
||||
|
||||
util::sleep_for(100); // 100 ms
|
||||
|
||||
err += gpio_set(GPIO_STM_RST_N, is_legacy ? power : (!power));
|
||||
err += gpio_set(GPIO_STM_RST_N, !power);
|
||||
assert(err == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -10,9 +10,6 @@ from selfdrive.hardware import TICI
|
||||
from selfdrive.hardware.tici.pins import GPIO_HUB_RST_N, GPIO_STM_BOOT0, GPIO_STM_RST_N
|
||||
from selfdrive.swaglog import cloudlog
|
||||
|
||||
def is_legacy_panda_reset():
|
||||
return os.path.isfile("/persist/LEGACY_PANDA_RESET")
|
||||
|
||||
def set_panda_power(power=True):
|
||||
if not TICI:
|
||||
return
|
||||
@@ -20,12 +17,12 @@ def set_panda_power(power=True):
|
||||
gpio_init(GPIO_STM_RST_N, True)
|
||||
gpio_init(GPIO_STM_BOOT0, True)
|
||||
|
||||
gpio_set(GPIO_STM_RST_N, False if is_legacy_panda_reset() else True)
|
||||
gpio_set(GPIO_STM_RST_N, True)
|
||||
gpio_set(GPIO_HUB_RST_N, True)
|
||||
|
||||
time.sleep(0.1)
|
||||
|
||||
gpio_set(GPIO_STM_RST_N, power if is_legacy_panda_reset() else (not power))
|
||||
gpio_set(GPIO_STM_RST_N, not power)
|
||||
|
||||
|
||||
def get_firmware_fn():
|
||||
|
||||
Reference in New Issue
Block a user