shutdown: add px4_shutdown_{lock,unlock} API methods

Prevents the system from shutting down.
This commit is contained in:
Beat Küng
2017-07-29 23:10:47 +02:00
committed by Lorenz Meier
parent 2815c62acf
commit 898a8dcd57
2 changed files with 62 additions and 13 deletions
+14
View File
@@ -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