Skip to content

Commit

Permalink
tester: cnt_cmd % 16 and simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed Apr 17, 2024
1 parent f3e35b8 commit 8e70d9a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions firmware/test/motor_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,11 @@ def CAN_tx_thread(p:Panda, bus):
global _angle
global _mode
cnt_cmd = 0
dat = steering_msg_cmd_data(cnt_cmd, _mode, _torque, _angle)
p.can_send(MSG_STEERING_COMMAND_FRAME_ID, dat, bus)

t_prev =0
while True:
time.sleep(MOTOR_MSG_TS)
cnt_cmd += 1
dat = steering_msg_cmd_data(cnt_cmd % 0xF, _mode, _torque, _angle)
dat = steering_msg_cmd_data(cnt_cmd, _mode, _torque, _angle)
p.can_send(MSG_STEERING_COMMAND_FRAME_ID, dat, bus)

cnt_cmd = (cnt_cmd + 1) % 16
time.sleep(MOTOR_MSG_TS)

def CAN_rx_thread(p, bus):
t_status_msg_prev =0
Expand Down

0 comments on commit 8e70d9a

Please sign in to comment.