189 {
191
193
194
196 return;
197 }
198
199
202#if (EFI_CAN_BUS_COUNT >= 3)
204#endif
205
206
207 if (!device1 && !device2) {
208#if (EFI_CAN_BUS_COUNT >= 3)
209 if (!device3)
210#endif
211 return;
212 }
213
214
215 if (((device1 == device2) && device1) ||
216#if (EFI_CAN_BUS_COUNT >= 3)
217 ((device2 == device3) && device2) ||
218 ((device3 == device1) && device3) ||
219#endif
220 0) {
221 criticalError("CAN pins must be set to different devices");
222 return;
223 }
224
225
226 if (device1) {
227
228
229
230 CANConfig canConfig;
233 canStart(device1, &canConfig);
234
235
237 }
238
239 if (device2) {
240 CANConfig canConfig;
243 canStart(device2, &canConfig);
244
245
247 }
248
249#if (EFI_CAN_BUS_COUNT >= 3)
250 if (device3) {
251 CANConfig canConfig;
254 canStart(device3, &canConfig);
255
256
258 }
259#endif
260
261
263 canWrite.start();
264 }
265
269#if (EFI_CAN_BUS_COUNT >= 3)
271#endif
272 }
273
275}
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.