mirror of https://github.com/commaai/panda.git
parent
091773f448
commit
dd82382d5f
|
@ -117,11 +117,6 @@ void harness_tick(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void harness_init(void) {
|
void harness_init(void) {
|
||||||
// delay such that the connection is fully made before trying orientation detection
|
|
||||||
current_board->set_led(LED_BLUE, true);
|
|
||||||
delay(10000000);
|
|
||||||
current_board->set_led(LED_BLUE, false);
|
|
||||||
|
|
||||||
// try to detect orientation
|
// try to detect orientation
|
||||||
harness.status = harness_detect_orientation();
|
harness.status = harness_detect_orientation();
|
||||||
if (harness.status != HARNESS_STATUS_NC) {
|
if (harness.status != HARNESS_STATUS_NC) {
|
||||||
|
|
|
@ -304,6 +304,10 @@ class Panda:
|
||||||
for bus in range(PANDA_BUS_CNT):
|
for bus in range(PANDA_BUS_CNT):
|
||||||
self.set_can_speed_kbps(bus, self._can_speed_kbps)
|
self.set_can_speed_kbps(bus, self._can_speed_kbps)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def spi(self) -> bool:
|
||||||
|
return isinstance(self._handle, PandaSpiHandle)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def spi_connect(cls, serial, ignore_version=False):
|
def spi_connect(cls, serial, ignore_version=False):
|
||||||
# get UID to confirm slave is present and up
|
# get UID to confirm slave is present and up
|
||||||
|
|
|
@ -7,4 +7,7 @@ def test_boot_time(p):
|
||||||
st = time.monotonic()
|
st = time.monotonic()
|
||||||
p.reset(reconnect=False)
|
p.reset(reconnect=False)
|
||||||
assert Panda.wait_for_panda(p.get_usb_serial(), timeout=3.0)
|
assert Panda.wait_for_panda(p.get_usb_serial(), timeout=3.0)
|
||||||
assert time.monotonic() - st < 3.0
|
|
||||||
|
# USB enumeration is slow, so SPI is faster
|
||||||
|
assert time.monotonic() - st < (1.0 if p.spi else 5.0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue