File tree 2 files changed +0
-24
lines changed
2 files changed +0
-24
lines changed Original file line number Diff line number Diff line change 2
2
import os
3
3
import time
4
4
import random
5
- import _thread
6
5
from collections import defaultdict
7
6
from panda import Panda
8
7
from panda_jungle import PandaJungle # pylint: disable=import-error
18
17
19
18
_panda_serials = []
20
19
21
- def start_heartbeat_thread (p ):
22
- def heartbeat_thread (p ):
23
- while True :
24
- try :
25
- p .send_heartbeat ()
26
- time .sleep (.5 )
27
- except Exception :
28
- break
29
- _thread .start_new_thread (heartbeat_thread , (p ,))
30
20
31
21
def panda_init (serial , enable_canfd = False ):
32
22
p = Panda (serial = serial )
33
- start_heartbeat_thread (p )
34
23
p .set_power_save (False )
35
24
for bus in range (3 ):
36
25
if enable_canfd :
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
import os
3
3
import sys
4
- import time
5
- import _thread
6
4
7
5
sys .path .append (os .path .join (os .path .dirname (os .path .realpath (__file__ )), ".." ))
8
6
from panda import Panda # noqa: E402
9
7
10
8
# This script is intended to be used in conjunction with the echo_loopback_test.py test script from panda jungle.
11
9
# It sends a reversed response back for every message received containing b"test".
12
-
13
- def heartbeat_thread (p ):
14
- while True :
15
- try :
16
- p .send_heartbeat ()
17
- time .sleep (0.5 )
18
- except Exception :
19
- continue
20
-
21
- # Resend every CAN message that has been received on the same bus, but with the data reversed
22
10
if __name__ == "__main__" :
23
11
p = Panda ()
24
- _thread .start_new_thread (heartbeat_thread , (p ,))
25
12
p .set_safety_mode (Panda .SAFETY_ALLOUTPUT )
26
13
p .set_power_save (False )
27
14
You can’t perform that action at this time.
0 commit comments