mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
Changed getopt with px4_getopt which was causing motor_test to always go to the usage function
This commit is contained in:
committed by
Lorenz Meier
parent
03c3ea0040
commit
304afa5629
@@ -39,6 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <px4_config.h>
|
#include <px4_config.h>
|
||||||
|
#include <px4_getopt.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -103,7 +104,10 @@ int motor_test_main(int argc, char *argv[])
|
|||||||
float value = 0.0f;
|
float value = 0.0f;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "m:p:")) != EOF) {
|
int myoptind = 1;
|
||||||
|
const char *myoptarg = NULL;
|
||||||
|
|
||||||
|
while ((ch = px4_getopt(argc, argv, "m:p:", &myoptind, &myoptarg)) != EOF) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
|
|
||||||
case 'm':
|
case 'm':
|
||||||
|
|||||||
Reference in New Issue
Block a user