Remove panda set power functions (#20712)

* remove panda set power functions

* removed
albatross
Willem Melching 2021-04-20 15:31:19 +02:00 committed by GitHub
parent a19d94ae2d
commit 34328ba305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 42 deletions

View File

@ -578,8 +578,6 @@ int main() {
#endif
LOG("set affinity returns %d", err);
panda_set_power(true);
while (!do_exit){
std::vector<std::thread> threads;
threads.push_back(std::thread(panda_state_thread, getenv("STARTED") != nullptr));

View File

@ -10,23 +10,6 @@
#include "messaging.hpp"
#include "panda.h"
void panda_set_power(bool power){
#ifdef QCOM2
int err = 0;
err += gpio_init(GPIO_STM_RST_N, true);
err += gpio_init(GPIO_STM_BOOT0, 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, !power);
assert(err == 0);
#endif
}
Panda::Panda(){
// init libusb
int err = libusb_init(&ctx);

View File

@ -39,8 +39,6 @@ struct __attribute__((packed)) health_t {
};
void panda_set_power(bool power);
class Panda {
private:
libusb_context *ctx = NULL;

View File

@ -9,7 +9,6 @@ os.environ['FILEREADER_CACHE'] = '1'
from common.realtime import config_realtime_process, Ratekeeper
from selfdrive.boardd.boardd import can_capnp_to_can_list
from selfdrive.pandad import set_panda_power
from tools.lib.logreader import LogReader
from panda import Panda
@ -78,7 +77,6 @@ def connect():
time.sleep(1)
if __name__ == "__main__":
set_panda_power(False)
time.sleep(1)
if "FLASH" in os.environ and PandaJungle is not None:

View File

@ -5,29 +5,11 @@ import time
from panda import BASEDIR as PANDA_BASEDIR, Panda, PandaDFU
from common.basedir import BASEDIR
from common.gpio import gpio_init, gpio_set
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
PANDA_FW_FN = os.path.join(PANDA_BASEDIR, "board", "obj", "panda.bin.signed")
def set_panda_power(power=True):
if not TICI:
return
gpio_init(GPIO_STM_RST_N, True)
gpio_init(GPIO_STM_BOOT0, 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, not power)
def get_expected_signature():
try:
return Panda.get_signature_from_firmware(PANDA_FW_FN)
@ -100,7 +82,6 @@ def update_panda():
def main():
set_panda_power()
update_panda()
os.chdir(os.path.join(BASEDIR, "selfdrive/boardd"))