Api-hal-power: reset routine. Power: safe to poweroff message, cleanup. (#436)

This commit is contained in:
あく
2021-04-30 07:51:48 +03:00
committed by GitHub
parent eb82748d50
commit 43ff095724
8 changed files with 77 additions and 38 deletions

View File

@@ -1,4 +1,5 @@
#include "power_views.h"
#include <gui/elements.h>
static void draw_stat(Canvas* canvas, int x, int y, IconName icon, char* val) {
canvas_draw_frame(canvas, x - 7, y + 7, 30, 13);
@@ -122,3 +123,9 @@ void power_off_draw_callback(Canvas* canvas, void* context) {
(model->poweroff_tick - osKernelGetTickCount()) / osKernelGetTickFreq());
canvas_draw_str(canvas, 5, 42, buffer);
}
void power_disconnect_draw_callback(Canvas* canvas, void* context) {
canvas_set_font(canvas, FontPrimary);
elements_multiline_text_aligned(
canvas, 64, 32, AlignCenter, AlignCenter, "It's now safe to turn off\nyour flipper");
}