collin80 / M2RET

GVRET fork to Macchina M2 board
MIT License
71 stars 21 forks source link

Fix CAN enable failure #13

Closed cybermaggedon closed 4 years ago

cybermaggedon commented 4 years ago

On my Macchina M2 with latest M2RET, calling the 'O' command or CAN0EN/CAN1EN causes the device to stop emitting CAN messages. Problem seems to be that you can't call Can.begin(...) more than once, so changed Can.begin to disable/enable and set_baudrate.

Possibly fixes #9, I first discovered this when noticing that SavvyCAN worked fine with the device, but running slcand, didn't, and I noticed the O command seemed to kill the message stream. With this change, slcand / Lawicel mode works for me.