207 {
209
211
212
214 return;
215 }
216
217
220#if (EFI_CAN_BUS_COUNT >= 3)
222#endif
223
224
225 if (!device1 && !device2) {
226#if (EFI_CAN_BUS_COUNT >= 3)
227 if (!device3)
228#endif
229 return;
230 }
231
232
233 if (((device1 == device2) && device1) ||
234#if (EFI_CAN_BUS_COUNT >= 3)
235 ((device2 == device3) && device2) ||
236 ((device3 == device1) && device3) ||
237#endif
238 0) {
239 criticalError("CAN pins must be set to different devices");
240 return;
241 }
242
243
244 if (device1) {
245
246
247
248 CANConfig canConfig;
251 canStart(device1, &canConfig);
252
253
255 }
256
257 if (device2) {
258 CANConfig canConfig;
261 canStart(device2, &canConfig);
262
263
265 }
266
267#if (EFI_CAN_BUS_COUNT >= 3)
268 if (device3) {
269 CANConfig canConfig;
272 canStart(device3, &canConfig);
273
274
276 }
277#endif
278
279
281 canWrite.start();
282 }
283
287#if (EFI_CAN_BUS_COUNT >= 3)
289#endif
290 }
291
293}
static void applyListenOnly(CANConfig *canConfig, bool isListenOnly)
static CCM_OPTIONAL CanRead canRead1(0)
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.