Browse Source

Teached the FMU driver that stopping is also an option

sbg
Lorenz Meier 11 years ago
parent
commit
727342a516
  1. 20
      src/drivers/px4fmu/fmu.cpp

20
src/drivers/px4fmu/fmu.cpp

@ -1093,6 +1093,20 @@ fmu_start(void)
return ret; return ret;
} }
int
fmu_stop(void)
{
int ret = OK;
if (g_fmu != nullptr) {
delete g_fmu;
g_fmu = nullptr;
}
return ret;
}
void void
test(void) test(void)
{ {
@ -1224,6 +1238,12 @@ fmu_main(int argc, char *argv[])
PortMode new_mode = PORT_MODE_UNSET; PortMode new_mode = PORT_MODE_UNSET;
const char *verb = argv[1]; const char *verb = argv[1];
if (!strcmp(verb, "stop")) {
fmu_stop();
errx(0, "FMU driver stopped");
}
if (fmu_start() != OK) if (fmu_start() != OK)
errx(1, "failed to start the FMU driver"); errx(1, "failed to start the FMU driver");

Loading…
Cancel
Save