Skip to content

Commit

Permalink
serialhdl: Only load the CAN module if CAN bus is configured
Browse files Browse the repository at this point in the history
Temporarily postpone loading the CAN module so that moonraker (and
similar) can improve upgrade scripts.

Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Mar 13, 2021
1 parent c7dc3e7 commit 4cbcd45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion klippy/serialhdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import logging, threading, os
import serial, can
import serial

import msgproto, chelper, util

Expand Down Expand Up @@ -103,6 +103,7 @@ def _start_session(self, serial_dev, serial_fd_type='u', client_id=0):
self.serialqueue, receive_window)
return True
def connect_canbus(self, canbus_uuid, canbus_nodeid, canbus_iface="can0"):
import can # XXX
txid = canbus_nodeid * 2 + 256
filters = [{"can_id": txid+1, "can_mask": 0x7ff, "extended": False}]
# Prep for SET_NODEID command
Expand Down

0 comments on commit 4cbcd45

Please sign in to comment.