MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / init

Method init

libraries/AP_CANManager/AP_CANManager.cpp:278–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277#else
278void AP_CANManager::init()
279{
280 WITH_SEMAPHORE(_sem);
281 for (uint8_t i = 0; i < HAL_NUM_CAN_IFACES; i++) {
282 if ((AP_CAN::Protocol) _drv_param[i]._driver_type.get() == AP_CAN::Protocol::DroneCAN) {
283 _drivers[i] = _drv_param[i]._uavcan = NEW_NOTHROW AP_DroneCAN(i);
284
285 if (_drivers[i] == nullptr) {
286 AP_BoardConfig::allocation_error("uavcan %d", i + 1);
287 continue;
288 }
289
290 AP_Param::load_object_from_eeprom((AP_DroneCAN*)_drivers[i], AP_DroneCAN::var_info);
291 _drivers[i]->init(i, true);
292 _driver_type_cache[i] = (AP_CAN::Protocol) _drv_param[i]._driver_type.get();
293 }
294 }
295}
296#endif
297
298/*

Callers 2

AP_CANManager.cppFile · 0.45
register_driverMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected