From 025b77ecc11176414542bedb22e18a3f859f64c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Thu, 4 Mar 2021 20:12:41 +0300 Subject: [PATCH] Prevent device from sleep mode while setuping display (#366) --- applications/gui/canvas.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/applications/gui/canvas.c b/applications/gui/canvas.c index 7076fdc64..6c68176ac 100644 --- a/applications/gui/canvas.c +++ b/applications/gui/canvas.c @@ -2,6 +2,7 @@ #include "icon_i.h" #include +#include uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); @@ -9,6 +10,8 @@ uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ Canvas* canvas_init() { Canvas* canvas = furi_alloc(sizeof(Canvas)); + api_hal_power_insomnia_enter(); + u8g2_Setup_st7565_erc12864_alt_f( &canvas->fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); @@ -19,6 +22,8 @@ Canvas* canvas_init() { u8g2_SetPowerSave(&canvas->fb, 0); u8g2_SendBuffer(&canvas->fb); + api_hal_power_insomnia_exit(); + return canvas; }