/* * can_task.cpp * * Created on: 10 Dec 2023 * Author: Carl */ #include #include namespace demo { CanSpam::CanSpam(uint32_t canID) : TacosThread("CAN Spam", osPriorityNormal) { setCanID(canID); } void CanSpam::init() { } void CanSpam::func() { CanSysMsg msg; // Send some random stuff msg.payload[0] = 1; msg.payload[1] = 2; msg.payload[2] = 3; msg.header.sid = getCanID(); msg.header.format = 0; sta::tacos::queueCanBusMsg(msg, 0); STA_DEBUG_PRINTLN("Can Task sent message"); this->periodicDelay(1); // Delay to ensure 1 Hz rate. } } // namespace demo