Browse Source
px4_shutdown_request() was called from the power button IRQ callback, which invoked a work queue callback. But on NuttX, the work queue uses a semaphore, and thus it cannot be called from IRQ context. This patch switches to publishing an uORB msg instead, which is handled in the commander main thread. To increase failure resistance, we could subscribe to the same topic in another module for redundancy, in case commander runs wild.sbg
4 changed files with 53 additions and 6 deletions
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
# power button state notification message |
||||
|
||||
uint8 PWR_BUTTON_STATE_IDEL = 0 # Button went up without meeting shutdown button down time (delete event) |
||||
uint8 PWR_BUTTON_STATE_DOWN = 1 # Button went Down |
||||
uint8 PWR_BUTTON_STATE_UP = 2 # Button went Up |
||||
uint8 PWR_BUTTON_STATE_REQUEST_SHUTDOWN = 3 # Button went Up after meeting shutdown button down time |
||||
|
||||
uint8 event # one of PWR_BUTTON_STATE_* |
Loading…
Reference in new issue