PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

fix wrong running status in app.h if start an app after stop it.

Open oneWayOut opened this issue 1 year ago • 0 comments

Solved Problem

I found that if I start hello example in the console, stop it, and start it again, the status is still running. Just like below:

pxh> hello start
hello starting.
hello
pxh> hello  Doing work...
pxh> hello stop
pxh> Doing work...
goodbye
pxh> hello start
INFO  [hello] already running

pxh> hello status
INFO  [hello] is running

The problem could be showed in nsh shell also.

Solution

  • Using a single variable instead of two to indicate the running status in app.h, which can solve the problem.

Context

This problem was reported before: https://discuss.px4.io/t/px4-hello-example-cannot-exit/33682

oneWayOut avatar May 07 '24 16:05 oneWayOut