From f4e10095ac739e9a7df2bb070afce712edd8bbd6 Mon Sep 17 00:00:00 2001 From: Zero <75466116+BoYs-J@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:48:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/main/src/driver/ssd1306/ssd1306_oled.c | 11 ++++++----- application/main/src/main.c | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/main/src/driver/ssd1306/ssd1306_oled.c b/application/main/src/driver/ssd1306/ssd1306_oled.c index 1fa5ee137..d3999e87c 100644 --- a/application/main/src/driver/ssd1306/ssd1306_oled.c +++ b/application/main/src/driver/ssd1306/ssd1306_oled.c @@ -295,13 +295,14 @@ static void ssd1306_event_handler(enum user_event event, void* arg) } break; case USER_EVT_POWERSAVE: // 处理省电模式 + if (ssd1306_is_sleep && ssd1306_inited) { + break; + } switch (param) { case PWR_SAVE_ENTER: - if (!ssd1306_is_sleep && ssd1306_inited) { - ssd1306_is_sleep = true; - ssd1306_sleep(); - break; - } + ssd1306_is_sleep = true; + ssd1306_sleep(); + break; case PWR_SAVE_EXIT: ssd1306_is_sleep = false; ssd1306_wake(); diff --git a/application/main/src/main.c b/application/main/src/main.c index fb6fc97d4..cc1577dbe 100644 --- a/application/main/src/main.c +++ b/application/main/src/main.c @@ -268,7 +268,6 @@ static void sleep_delay_handler(void* p_context) uint8_t sleep_mode = (uint32_t)p_context; switch (sleep_mode) { case SLEEP_EVT_AUTO: - break; case SLEEP_EVT_MANUAL: sleep_mode_enter(true); break;