add beep in setting

This commit is contained in:
不吃油炸鸡
2025-10-14 15:53:15 +08:00
parent 2e6a33b331
commit 8d39ebb456
3 changed files with 15 additions and 3 deletions

View File

@@ -6,15 +6,19 @@
#include "../ui.h"
lv_obj_t * ui_SetPage = NULL;
// backlight
static lv_obj_t * ui_PanelBL = NULL;
static lv_obj_t * ui_SliderBL = NULL;
static lv_obj_t * ui_LabelBL = NULL;
// key sound
static lv_obj_t * ui_PanelKS = NULL;
static lv_obj_t * ui_SwitchKS = NULL;
static lv_obj_t * ui_LabelKS = NULL;
// language
static lv_obj_t * ui_PanelLang = NULL;
static lv_obj_t * ui_SwitchLang = NULL;
static lv_obj_t * ui_LabelLang = NULL;
// about
static lv_obj_t * ui_PanelAbout = NULL;
static lv_obj_t * ui_LabelAbout = NULL;
@@ -177,7 +181,7 @@ void ui_SetPage_screen_init(void)
lv_label_set_text(ui_LabelAbout, "About\nPower-Pico\nA uA current meter\nV 1.0.0");
lv_obj_set_style_text_font(ui_LabelAbout, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
//
// store panels in array
panels[0] = ui_PanelBL;
panels[1] = ui_PanelKS;
panels[2] = ui_PanelLang;

View File

@@ -3,6 +3,7 @@
#include "user_TasksInit.h"
#include "main.h"
#include "key.h"
#include "beep.h"
/* Private typedef -----------------------------------------------------------*/
@@ -27,6 +28,13 @@ void KeyTask(void *argument)
if(keystr != 0)
{
osMessageQueuePut(Key_MessageQueue, &keystr, 0, 1);
// beep
if(1)
{
beep_open();
osDelay(50);
beep_close();
}
}
osDelay(10);
}