From ab399e897b33f7688698c07006e521c3daf75526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=90=83=E6=B2=B9=E7=82=B8=E9=B8=A1?= <1425962791@qq.com> Date: Mon, 1 Dec 2025 18:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=BC=E5=BC=8F=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Power_Pico/BSP/KEY/key.c | 18 +++++++++--------- Power_Pico/User/GUI/ui.c | 3 +-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Power_Pico/BSP/KEY/key.c b/Power_Pico/BSP/KEY/key.c index b57ff25..145cf18 100644 --- a/Power_Pico/BSP/KEY/key.c +++ b/Power_Pico/BSP/KEY/key.c @@ -3,16 +3,16 @@ void Key_Port_Init(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitTypeDef GPIO_InitStruct = {0}; - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); - /*Configure GPIO pin : PA0 */ - GPIO_InitStruct.Pin = KEYB_PIN | KEYY_PIN | KEYL_PIN | KEYR_PIN | KEYN_PIN; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(KEYB_PORT, &GPIO_InitStruct); + /*Configure GPIO pin : PA0 */ + GPIO_InitStruct.Pin = KEYB_PIN | KEYY_PIN | KEYL_PIN | KEYR_PIN | KEYN_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(KEYB_PORT, &GPIO_InitStruct); } // mode: 0 - sigle press, 1 - long press @@ -49,7 +49,7 @@ uint8_t KeyScan(uint8_t mode) // 松开才有效 if ( key_down && KEYB && KEYY && KEYL && KEYR && KEYN ) { - osDelay(3);//ensure the key + osDelay(3); // ensure the key if(KEYB && KEYY && KEYL && KEYR && KEYN) { key_up = 1; diff --git a/Power_Pico/User/GUI/ui.c b/Power_Pico/User/GUI/ui.c index ff0f36a..7592456 100644 --- a/Power_Pico/User/GUI/ui.c +++ b/Power_Pico/User/GUI/ui.c @@ -124,8 +124,7 @@ static void _ui_Start_animation(void) { void ui_init(void) { lv_disp_t * dispp = lv_display_get_default(); - lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), - true, LV_FONT_DEFAULT); + lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), true, LV_FONT_DEFAULT); lv_disp_set_theme(dispp, theme); // set system settings