208 {
210
212
213
215 return;
216 }
217
218
221#if (EFI_CAN_BUS_COUNT >= 3)
223#endif
224
225
226 if (!device1 && !device2) {
227#if (EFI_CAN_BUS_COUNT >= 3)
228 if (!device3)
229#endif
230 return;
231 }
232
233
234 if (((device1 == device2) && device1) ||
235#if (EFI_CAN_BUS_COUNT >= 3)
236 ((device2 == device3) && device2) ||
237 ((device3 == device1) && device3) ||
238#endif
239 0) {
240 criticalError("CAN pins must be set to different devices");
241 return;
242 }
243
244
245 if (device1) {
246
247
248
249 CANConfig canConfig;
252 canStart(device1, &canConfig);
253
254
256 }
257
258 if (device2) {
259 CANConfig canConfig;
262 canStart(device2, &canConfig);
263
264
266 }
267
268#if (EFI_CAN_BUS_COUNT >= 3)
269 if (device3) {
270 CANConfig canConfig;
273 canStart(device3, &canConfig);
274
275
277 }
278#endif
279
280
282 canWrite.start();
283 }
284
288#if (EFI_CAN_BUS_COUNT >= 3)
290#endif
291 }
292
294}
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