File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,9 @@ void AP_CANManager::init()
199
199
}
200
200
201
201
// Allocate the set type of Driver
202
+ switch (drv_type[drv_num]) {
202
203
#if HAL_ENABLE_DRONECAN_DRIVERS
203
- if (drv_type[drv_num] == AP_CAN::Protocol::DroneCAN) {
204
+ case AP_CAN::Protocol::DroneCAN:
204
205
_drivers[drv_num] = _drv_param[drv_num]._uavcan = NEW_NOTHROW AP_DroneCAN (drv_num);
205
206
206
207
if (_drivers[drv_num] == nullptr ) {
@@ -209,10 +210,10 @@ void AP_CANManager::init()
209
210
}
210
211
211
212
AP_Param::load_object_from_eeprom ((AP_DroneCAN*)_drivers[drv_num], AP_DroneCAN::var_info);
212
- } else
213
+ break ;
213
214
#endif
214
215
#if HAL_PICCOLO_CAN_ENABLE
215
- if (drv_type[drv_num] == AP_CAN::Protocol::PiccoloCAN) {
216
+ case AP_CAN::Protocol::PiccoloCAN:
216
217
_drivers[drv_num] = _drv_param[drv_num]._piccolocan = NEW_NOTHROW AP_PiccoloCAN;
217
218
218
219
if (_drivers[drv_num] == nullptr ) {
@@ -221,9 +222,9 @@ void AP_CANManager::init()
221
222
}
222
223
223
224
AP_Param::load_object_from_eeprom ((AP_PiccoloCAN*)_drivers[drv_num], AP_PiccoloCAN::var_info);
224
- } else
225
+ break ;
225
226
#endif
226
- {
227
+ default :
227
228
continue ;
228
229
}
229
230
You can’t perform that action at this time.
0 commit comments