From aa8d41602936c58562f203d726d91f3a605f0bad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 Nov 2020 09:54:30 -0600 Subject: [PATCH] Add ESP32S2 pins in comments --- FeatherCAN_CircuitPython/listener-ack.py | 3 +++ FeatherCAN_CircuitPython/listener.py | 3 +++ FeatherCAN_CircuitPython/sender-ack.py | 3 +++ FeatherCAN_CircuitPython/sender.py | 3 +++ 4 files changed, 12 insertions(+) diff --git a/FeatherCAN_CircuitPython/listener-ack.py b/FeatherCAN_CircuitPython/listener-ack.py index 44ca0c751..4a3c80dc1 100644 --- a/FeatherCAN_CircuitPython/listener-ack.py +++ b/FeatherCAN_CircuitPython/listener-ack.py @@ -14,7 +14,10 @@ if hasattr(board, 'BOOST_ENABLE'): boost_enable = digitalio.DigitalInOut(board.BOOST_ENABLE) boost_enable.switch_to_output(True) +# Use this line if your board has dedicated CAN pins. (Feather M4 CAN and Feather STM32F405) can = canio.CAN(rx=board.CAN_RX, tx=board.CAN_TX, baudrate=250_000, auto_restart=True) +# On ESP32S2 most pins can be used for CAN. Uncomment the following line to use IO5 and IO6 +#can = canio.CAN(rx=board.IO6, tx=board.IO5, baudrate=250_000, auto_restart=True) listener = can.listen(matches=[canio.Match(0x408)], timeout=.9) old_bus_state = None diff --git a/FeatherCAN_CircuitPython/listener.py b/FeatherCAN_CircuitPython/listener.py index b736ac9d4..0df157e14 100644 --- a/FeatherCAN_CircuitPython/listener.py +++ b/FeatherCAN_CircuitPython/listener.py @@ -14,7 +14,10 @@ if hasattr(board, 'BOOST_ENABLE'): boost_enable = digitalio.DigitalInOut(board.BOOST_ENABLE) boost_enable.switch_to_output(True) +# Use this line if your board has dedicated CAN pins. (Feather M4 CAN and Feather STM32F405) can = canio.CAN(rx=board.CAN_RX, tx=board.CAN_TX, baudrate=250_000, auto_restart=True) +# On ESP32S2 most pins can be used for CAN. Uncomment the following line to use IO5 and IO6 +#can = canio.CAN(rx=board.IO6, tx=board.IO5, baudrate=250_000, auto_restart=True) listener = can.listen(matches=[canio.Match(0x408)], timeout=.9) old_bus_state = None diff --git a/FeatherCAN_CircuitPython/sender-ack.py b/FeatherCAN_CircuitPython/sender-ack.py index 99d31cc0f..9999eb945 100644 --- a/FeatherCAN_CircuitPython/sender-ack.py +++ b/FeatherCAN_CircuitPython/sender-ack.py @@ -15,7 +15,10 @@ if hasattr(board, 'BOOST_ENABLE'): boost_enable = digitalio.DigitalInOut(board.BOOST_ENABLE) boost_enable.switch_to_output(True) +# Use this line if your board has dedicated CAN pins. (Feather M4 CAN and Feather STM32F405) can = canio.CAN(rx=board.CAN_RX, tx=board.CAN_TX, baudrate=250_000, auto_restart=True) +# On ESP32S2 most pins can be used for CAN. Uncomment the following line to use IO5 and IO6 +#can = canio.CAN(rx=board.IO6, tx=board.IO5, baudrate=250_000, auto_restart=True) listener = can.listen(matches=[canio.Match(0x409)], timeout=.1) old_bus_state = None diff --git a/FeatherCAN_CircuitPython/sender.py b/FeatherCAN_CircuitPython/sender.py index 4f71c00a7..23702e3d2 100644 --- a/FeatherCAN_CircuitPython/sender.py +++ b/FeatherCAN_CircuitPython/sender.py @@ -15,7 +15,10 @@ if hasattr(board, 'BOOST_ENABLE'): boost_enable = digitalio.DigitalInOut(board.BOOST_ENABLE) boost_enable.switch_to_output(True) +# Use this line if your board has dedicated CAN pins. (Feather M4 CAN and Feather STM32F405) can = canio.CAN(rx=board.CAN_RX, tx=board.CAN_TX, baudrate=250_000, auto_restart=True) +# On ESP32S2 most pins can be used for CAN. Uncomment the following line to use IO5 and IO6 +#can = canio.CAN(rx=board.IO6, tx=board.IO5, baudrate=250_000, auto_restart=True) old_bus_state = None count = 0