MCP_CAN_lib 10 kpbs

Looks good to me, it is simple and backwards compatible.

One alternative is to make an uint32_t variable CANtimeout with a default of 2500 and add two functions

  • uint32_t getTimeout() and
  • bool setTimeout(uint32_t to)

Might need more work to get it working, however the advantage is you could add logic like "0 ==> no time out" to extreme long timeouts of several minutes. And changing the timeout depending on e.g. command sent or device contacted. The set function could guard a reasonable minimal timeout of e.g. 1000 us.

An even more elaborated alternative would combine the two methods.

1 Like