210 {
212
214
215
217 return;
218 }
219
220
223#if (EFI_CAN_BUS_COUNT >= 3)
225#endif
226
227
228 if (!device1 && !device2) {
229#if (EFI_CAN_BUS_COUNT >= 3)
230 if (!device3)
231#endif
232 return;
233 }
234
235
236 if (((device1 == device2) && device1) ||
237#if (EFI_CAN_BUS_COUNT >= 3)
238 ((device2 == device3) && device2) ||
239 ((device3 == device1) && device3) ||
240#endif
241 0) {
242 criticalError("CAN pins must be set to different devices");
243 return;
244 }
245
246
247 if (device1) {
248
249
250
251 CANConfig canConfig;
254 canStart(device1, &canConfig);
255
256
258 }
259
260 if (device2) {
261 CANConfig canConfig;
264 canStart(device2, &canConfig);
265
266
268 }
269
270#if (EFI_CAN_BUS_COUNT >= 3)
271 if (device3) {
272 CANConfig canConfig;
275 canStart(device3, &canConfig);
276
277
279 }
280#endif
281
282
284 canWrite.start();
285 }
286
290#if (EFI_CAN_BUS_COUNT >= 3)
292#endif
293 }
294
296}
static void applyListenOnly(CANConfig *canConfig, bool isListenOnly)
static CCM_OPTIONAL CanRead canRead1(0)
static CANDriver * getCanDevice(size_t index)
static CCM_OPTIONAL CanRead canRead3(2)
static CCM_OPTIONAL CanRead canRead2(1)
const CANConfig * findCanConfig(can_baudrate_e rate)
static void setDevice(size_t idx, CANDriver *device)
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
static constexpr engine_configuration_s * engineConfiguration
can_baudrate_e canBaudRate
can_baudrate_e can2BaudRate
can_baudrate_e can3BaudRate