vmount: tell user how to use vmount test

This confused me, so hopefully it will help the next user, e.g. me.
This commit is contained in:
Julian Oes 2019-11-22 16:11:19 +01:00 committed by Lorenz Meier
parent a36a3d6c5c
commit 334a599b2d
1 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2013-2017 PX4 Development Team. All rights reserved.
* Copyright (c) 2013-2019 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
@ -432,12 +432,21 @@ int vmount_main(int argc, char *argv[])
return -1;
}
if (!strcmp(argv[1], "start") || !strcmp(argv[1], "test")) {
const bool found_start = !strcmp(argv[1], "start");
const bool found_test = !strcmp(argv[1], "test");
if (found_start || found_test) {
/* this is not an error */
if (thread_running) {
PX4_WARN("mount driver already running");
return 0;
if (found_start) {
PX4_WARN("mount driver already running");
return 0;
} else {
PX4_WARN("mount driver already running, run vmount stop before 'vmount test'");
return 1;
}
}
thread_should_exit = false;