Prevent device from sleep mode while setuping display (#366)
This commit is contained in:
parent
10978c51fd
commit
025b77ecc1
@ -2,6 +2,7 @@
|
|||||||
#include "icon_i.h"
|
#include "icon_i.h"
|
||||||
|
|
||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
|
#include <api-hal.h>
|
||||||
|
|
||||||
uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr);
|
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);
|
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_init() {
|
||||||
Canvas* canvas = furi_alloc(sizeof(Canvas));
|
Canvas* canvas = furi_alloc(sizeof(Canvas));
|
||||||
|
|
||||||
|
api_hal_power_insomnia_enter();
|
||||||
|
|
||||||
u8g2_Setup_st7565_erc12864_alt_f(
|
u8g2_Setup_st7565_erc12864_alt_f(
|
||||||
&canvas->fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32);
|
&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_SetPowerSave(&canvas->fb, 0);
|
||||||
u8g2_SendBuffer(&canvas->fb);
|
u8g2_SendBuffer(&canvas->fb);
|
||||||
|
|
||||||
|
api_hal_power_insomnia_exit();
|
||||||
|
|
||||||
return canvas;
|
return canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user