i2c_spi_buses:Track NuttX change to getopts avoid name collision

NuttX #defined optarg and getopt to move to TLS. This fixes the
  name collision.
This commit is contained in:
David Sidrane
2021-06-16 17:07:47 +02:00
committed by Julian Oes
parent 64db89ab20
commit 84dd8839a2
55 changed files with 245 additions and 214 deletions
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2019-2020 PX4 Development Team. All rights reserved.
* Copyright (c) 2019-2020, 2021 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -77,15 +77,15 @@ extern "C" __EXPORT int paw3902_main(int argc, char *argv[])
cli.spi_mode = SPIDEV_MODE0;
cli.default_spi_frequency = SPI_SPEED;
while ((ch = cli.getopt(argc, argv, "Y:")) != EOF) {
while ((ch = cli.getOpt(argc, argv, "Y:")) != EOF) {
switch (ch) {
case 'Y':
cli.custom1 = atoi(cli.optarg());
cli.custom1 = atoi(cli.optArg());
break;
}
}
const char *verb = cli.optarg();
const char *verb = cli.optArg();
if (!verb) {
ThisDriver::print_usage();
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2018 PX4 Development Team. All rights reserved.
* Copyright (c) 2018, 2021 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -74,15 +74,15 @@ pmw3901_main(int argc, char *argv[])
cli.spi_mode = SPIDEV_MODE0;
cli.default_spi_frequency = PMW3901_SPI_BUS_SPEED;
while ((ch = cli.getopt(argc, argv, "R:")) != EOF) {
while ((ch = cli.getOpt(argc, argv, "R:")) != EOF) {
switch (ch) {
case 'R':
cli.rotation = (enum Rotation)atoi(cli.optarg());
cli.rotation = (enum Rotation)atoi(cli.optArg());
break;
}
}
const char *verb = cli.optarg();
const char *verb = cli.optArg();
if (!verb) {
ThisDriver::print_usage();
+4 -4
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2013-2019 PX4 Development Team. All rights reserved.
* Copyright (c) 2013-2019, 2021 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -411,15 +411,15 @@ px4flow_main(int argc, char *argv[])
cli.orientation = distance_sensor_s::ROTATION_DOWNWARD_FACING;
cli.i2c_address = I2C_FLOW_ADDRESS_DEFAULT;
while ((ch = cli.getopt(argc, argv, "R:")) != EOF) {
while ((ch = cli.getOpt(argc, argv, "R:")) != EOF) {
switch (ch) {
case 'R':
cli.orientation = atoi(cli.optarg());
cli.orientation = atoi(cli.optArg());
break;
}
}
const char *verb = cli.optarg();
const char *verb = cli.optArg();
if (!verb) {
ThisDriver::print_usage();