mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 01:11:36 +08:00
shutdown: add px4_shutdown_{lock,unlock} API methods
Prevents the system from shutting down.
This commit is contained in:
@@ -81,5 +81,19 @@ __EXPORT int px4_unregister_shutdown_hook(shutdown_hook_t hook);
|
||||
*/
|
||||
__EXPORT int px4_shutdown_request(bool reboot, bool to_bootloader);
|
||||
|
||||
|
||||
/**
|
||||
* Grab the shutdown lock. It will prevent the system from shutting down until the lock is released.
|
||||
* It is safe to call this recursively.
|
||||
* @return 0 on success, <0 on error
|
||||
*/
|
||||
__EXPORT int px4_shutdown_lock(void);
|
||||
|
||||
/**
|
||||
* Release the shutdown lock.
|
||||
* @return 0 on success, <0 on error
|
||||
*/
|
||||
__EXPORT int px4_shutdown_unlock(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user