mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
src: remove NuttX ifdefs around args
It doesn't look like they are required anymore.
This commit is contained in:
@@ -1137,12 +1137,9 @@ int GPS::task_spawn(int argc, char *argv[], Instance instance)
|
|||||||
|
|
||||||
int GPS::run_trampoline_secondary(int argc, char *argv[])
|
int GPS::run_trampoline_secondary(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
// the task name is the first argument
|
||||||
#ifdef __PX4_NUTTX
|
|
||||||
// on NuttX task_create() adds the task name as first argument
|
|
||||||
argc -= 1;
|
argc -= 1;
|
||||||
argv += 1;
|
argv += 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
GPS *gps = instantiate(argc, argv, Instance::Secondary);
|
GPS *gps = instantiate(argc, argv, Instance::Secondary);
|
||||||
if (gps) {
|
if (gps) {
|
||||||
|
|||||||
@@ -1838,16 +1838,9 @@ Mavlink::task_main(int argc, char *argv[])
|
|||||||
|
|
||||||
_interface_name = nullptr;
|
_interface_name = nullptr;
|
||||||
|
|
||||||
#ifdef __PX4_NUTTX
|
// We don't care about the name and verb at this point.
|
||||||
/* the NuttX optarg handler does not
|
|
||||||
* ignore argv[0] like the POSIX handler
|
|
||||||
* does, nor does it deal with non-flag
|
|
||||||
* verbs well. So we remove the application
|
|
||||||
* name and the verb.
|
|
||||||
*/
|
|
||||||
argc -= 2;
|
argc -= 2;
|
||||||
argv += 2;
|
argv += 2;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* don't exit from getopt loop to leave getopt global variables in consistent state,
|
/* don't exit from getopt loop to leave getopt global variables in consistent state,
|
||||||
* set error flag instead */
|
* set error flag instead */
|
||||||
|
|||||||
@@ -163,16 +163,9 @@ static int vmount_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
InputTest *test_input = nullptr;
|
InputTest *test_input = nullptr;
|
||||||
|
|
||||||
#ifdef __PX4_NUTTX
|
// We don't need the task name.
|
||||||
/* the NuttX optarg handler does not
|
|
||||||
* ignore argv[0] like the POSIX handler
|
|
||||||
* does, nor does it deal with non-flag
|
|
||||||
* verbs well. So we Remove the application
|
|
||||||
* name and the verb.
|
|
||||||
*/
|
|
||||||
argc -= 1;
|
argc -= 1;
|
||||||
argv += 1;
|
argv += 1;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (argc > 0 && !strcmp(argv[0], "test")) {
|
if (argc > 0 && !strcmp(argv[0], "test")) {
|
||||||
PX4_INFO("Starting in test mode");
|
PX4_INFO("Starting in test mode");
|
||||||
|
|||||||
Reference in New Issue
Block a user