mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
更新格式注释
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user