Skip to content

Commit

Permalink
修正休眠息屏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYs-J authored Nov 8, 2024
1 parent df2e63d commit d10c443
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions application/main/src/driver/ssd1306/ssd1306_oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static void status_mark_dirty()
}
}

static bool ssd1306_inited = false, ssd1306_init_show = false;
static bool ssd1306_inited = false, ssd1306_init_show = false, ssd1306_is_sleep = false;

static void ssd1306_event_handler(enum user_event event, void* arg)
{
Expand All @@ -283,7 +283,8 @@ static void ssd1306_event_handler(enum user_event event, void* arg)
ssd1306_show_all();
break;
case KBD_STATE_SLEEP: // 睡眠
if (ssd1306_inited) {
if (!ssd1306_is_sleep && ssd1306_inited) {
ssd1306_is_sleep = true;
ssd1306_sleep();
nrf_delay_ms(10);
ssd1306_oled_uninit();
Expand All @@ -294,7 +295,7 @@ static void ssd1306_event_handler(enum user_event event, void* arg)
}
break;
case USER_EVT_POWERSAVE: // 处理省电模式
if (ssd1306_inited) {
if (ssd1306_is_sleep && ssd1306_inited) {
break;
}
switch (param) {
Expand Down

0 comments on commit d10c443

Please sign in to comment.