tonton81 / ESP32_CAN

ESP32 CAN library based off of FlexCAN_T4
MIT License
10 stars 3 forks source link

Including ESP32_CAN.h in more than 1 file causes multiple definitions of CANBUS_TASK #6

Open MikeP-NZ opened 9 months ago

MikeP-NZ commented 9 months ago

Making CANBUS_TASK static stops the duplicate definition of this handle.

TaskHandle_t CANBUS_TASK = NULL;

I don't know if there's a better way to do this. I needed to have a couple of class object generate and send CANBus message frames and also process the incoming frames. The change seems to achieve what I wanted and works.