arduino-CAN icon indicating copy to clipboard operation
arduino-CAN copied to clipboard

leave loopback mode

Open creativtransfer opened this issue 7 years ago • 0 comments

Once configured for loopback mode, what is the proper way to restore normal mode? For the moment, I used CAN.filter(0x00); since it resets the mode back to normal but can you please update your code so loopback() expects a bool?

int ESP32SJA1000Class::loopback(bool mode = true) { _loopback = mode; modifyRegister(REG_MOD, 0x17, 0x01); // reset

if(mode){ modifyRegister(REG_MOD, 0x17, 0x04); // self test mode }else{ modifyRegister(REG_MOD, 0x17, 0x00); // normal mode } return 1; }

creativtransfer avatar Nov 18 '18 15:11 creativtransfer