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