[FL-1905] Fix power off notification (#748)

* view dispatcher: add set view front API
* power: add power off notification
* Gui: rename ViewPort `send_to` API.
* Makefile: add blackmagick support

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-10-06 18:41:22 +03:00
committed by GitHub
parent c8b36dd406
commit 5232d5daba
12 changed files with 66 additions and 34 deletions

View File

@@ -3,8 +3,13 @@
#include "furi-hal-power.h"
#include "furi-hal-boot.h"
void power_off() {
void power_off(Power* power) {
furi_hal_power_off();
// Notify user if USB is plugged
view_dispatcher_send_to_front(power->view_dispatcher);
view_dispatcher_switch_to_view(power->view_dispatcher, PowerViewPopup);
osDelay(10);
furi_crash("Disconnect USB for safe shutdown");
}
void power_reboot(PowerBootMode mode) {