tonton81 / FlexCAN_T4

FlexCAN (CAN 2.0 / CANFD) Library for Teensy 3.x and 4.0
https://forum.pjrc.com/threads/56035-FlexCAN_T4-FlexCAN-for-Teensy-4
MIT License
196 stars 66 forks source link

CAN alternative pin state is reset in .begin() if not in use #17

Closed noisymime closed 3 years ago

noisymime commented 4 years ago

When the CAN0.begin() function is called, it checks whether the default or alternative pins should be used. If the default pins are used, the config of the alternative pins is set to 0.

This means that if pins 29 or 30 (On a Teensy 3.5 or 3.6) are in use as outputs, they will no longer function as their config has been reset.

Steps to reproduce (Using Teensy 3.5 or 3.6):

Actual Behaviour: The pins (29 and 30) will not output a high state

Expected behaviour: The pin state of 29 and 30 should be retained because they are not in use by CAN0.

civic2016 commented 4 years ago

Make sure you have an updated copy of this repo, this has been referenced and fixed on issue #14