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

Method run

libraries/AP_HAL_Linux/HAL_Linux_Class.cpp:345–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void HAL_Linux::run(int argc, char* const argv[], Callbacks* callbacks) const
346{
347#if AP_MODULE_SUPPORTED
348 const char *module_path = AP_MODULE_DEFAULT_DIRECTORY;
349#endif
350
351 enum long_options {
352 CMDLINE_SERIAL0 = 1, // must be in 0-9 order and numbered consecutively
353 CMDLINE_SERIAL1,
354 CMDLINE_SERIAL2,
355 CMDLINE_SERIAL3,
356 CMDLINE_SERIAL4,
357 CMDLINE_SERIAL5,
358 CMDLINE_SERIAL6,
359 CMDLINE_SERIAL7,
360 CMDLINE_SERIAL8,
361 CMDLINE_SERIAL9,
362 };
363
364 int opt;
365 const struct GetOptLong::option options[] = {
366 {"uartA", true, 0, 'A'},
367 {"uartB", true, 0, 'B'},
368 {"uartC", true, 0, 'C'},
369 {"uartD", true, 0, 'D'},
370 {"uartE", true, 0, 'E'},
371 {"uartF", true, 0, 'F'},
372 {"uartG", true, 0, 'G'},
373 {"uartH", true, 0, 'H'},
374 {"uartI", true, 0, 'I'},
375 {"uartJ", true, 0, 'J'},
376 {"serial0", true, 0, CMDLINE_SERIAL0},
377 {"serial1", true, 0, CMDLINE_SERIAL1},
378 {"serial2", true, 0, CMDLINE_SERIAL2},
379 {"serial3", true, 0, CMDLINE_SERIAL3},
380 {"serial4", true, 0, CMDLINE_SERIAL4},
381 {"serial5", true, 0, CMDLINE_SERIAL5},
382 {"serial6", true, 0, CMDLINE_SERIAL6},
383 {"serial7", true, 0, CMDLINE_SERIAL7},
384 {"serial8", true, 0, CMDLINE_SERIAL8},
385 {"serial9", true, 0, CMDLINE_SERIAL9},
386 {"log-directory", true, 0, 'l'},
387 {"terrain-directory", true, 0, 't'},
388 {"storage-directory", true, 0, 's'},
389 {"module-directory", true, 0, 'M'},
390 {"defaults", true, 0, 'd'},
391 {"cpu-affinity", true, 0, 'c'},
392 {"help", false, 0, 'h'},
393 {0, false, 0, 0}
394 };
395
396 GetOptLong gopt(argc, argv, "A:B:C:D:E:F:G:H:I:J:l:t:s:he:SM:c:",
397 options);
398
399 /*
400 parse command line options
401 */
402 while ((opt = gopt.getoption()) != -1) {

Callers 1

setupFunction · 0.45

Calls 15

_usageFunction · 0.85
getoptionMethod · 0.80
set_device_pathMethod · 0.80
parse_cpu_setMethod · 0.80
set_cpu_affinityMethod · 0.80
initFunction · 0.70
initMethod · 0.45
beginMethod · 0.45

Tested by 1

setupFunction · 0.36