增加蓝牙界面的LED闪烁功能
This commit is contained in:
parent
eb768383da
commit
7fb019d8ad
@ -169,6 +169,13 @@ u8 kt_key_event_filter_after(int key_event, int key_value)
|
|||||||
u8 ret = false;
|
u8 ret = false;
|
||||||
switch (key_event)
|
switch (key_event)
|
||||||
{
|
{
|
||||||
|
case KEY_USER_FLASH_LED:
|
||||||
|
if (app_get_curr_task() == APP_MUSIC_TASK || app_get_curr_task() == APP_BT_TASK)
|
||||||
|
{
|
||||||
|
kt_ui_post_key_event(key_event, key_value);
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case KEY_USER_LED:
|
case KEY_USER_LED:
|
||||||
//kt_set_ex_led_color(key_value);
|
//kt_set_ex_led_color(key_value);
|
||||||
{
|
{
|
||||||
@ -188,7 +195,7 @@ u8 kt_key_event_filter_after(int key_event, int key_value)
|
|||||||
ret = true;
|
ret = true;
|
||||||
break;
|
break;
|
||||||
case KEY_USER_SETTING:
|
case KEY_USER_SETTING:
|
||||||
if (app_get_curr_task() == APP_MUSIC_TASK)
|
if (app_get_curr_task() == APP_MUSIC_TASK || app_get_curr_task() == APP_BT_TASK)
|
||||||
{
|
{
|
||||||
kt_ui_post_key_event(key_event, key_value);
|
kt_ui_post_key_event(key_event, key_value);
|
||||||
ret = true;
|
ret = true;
|
||||||
@ -197,14 +204,16 @@ u8 kt_key_event_filter_after(int key_event, int key_value)
|
|||||||
case KEY_MUSIC_NEXT:
|
case KEY_MUSIC_NEXT:
|
||||||
case KEY_MUSIC_PREV:
|
case KEY_MUSIC_PREV:
|
||||||
/* 仅在 Music 页设置模式下转发,用于列表焦点移动 */
|
/* 仅在 Music 页设置模式下转发,用于列表焦点移动 */
|
||||||
if (app_get_curr_task() == APP_MUSIC_TASK && kt_ui_music_setting_mode())
|
if ((app_get_curr_task() == APP_MUSIC_TASK && kt_ui_music_setting_mode()) ||
|
||||||
|
(app_get_curr_task() == APP_BT_TASK && kt_ui_bt_setting_mode()))
|
||||||
{
|
{
|
||||||
kt_ui_post_key_event(key_event, key_value);
|
kt_ui_post_key_event(key_event, key_value);
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KEY_MUSIC_PP: /* 设置模式下 PP 单击 = 确认 */
|
case KEY_MUSIC_PP: /* 设置模式下 PP 单击 = 确认 */
|
||||||
if (app_get_curr_task() == APP_MUSIC_TASK && kt_ui_music_setting_mode())
|
if ((app_get_curr_task() == APP_MUSIC_TASK && kt_ui_music_setting_mode()) ||
|
||||||
|
(app_get_curr_task() == APP_BT_TASK && kt_ui_bt_setting_mode()))
|
||||||
{
|
{
|
||||||
kt_ui_post_key_event(key_event, key_value);
|
kt_ui_post_key_event(key_event, key_value);
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|||||||
@ -12,13 +12,13 @@
|
|||||||
const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
const u16 bt_key_ad_table[KEY_AD_NUM_MAX][KEY_EVENT_MAX] = {
|
||||||
//单击 //长按 //hold //抬起 //双击 //三击
|
//单击 //长按 //hold //抬起 //双击 //三击
|
||||||
[0] = {
|
[0] = {
|
||||||
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_NULL, KEY_NULL
|
KEY_CHANGE_MODE, KEY_POWEROFF, KEY_POWEROFF_HOLD, KEY_NULL, KEY_USER_FLASH_LED, KEY_NULL
|
||||||
},
|
},
|
||||||
[1] = {
|
[1] = {
|
||||||
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_NULL, KEY_NULL
|
||||||
},
|
},
|
||||||
[2] = {
|
[2] = {
|
||||||
KEY_MUSIC_PP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_USER_LED, KEY_NULL
|
KEY_MUSIC_PP, KEY_USER_SETTING, KEY_NULL, KEY_NULL, KEY_USER_LED, KEY_NULL
|
||||||
},
|
},
|
||||||
[3] = {
|
[3] = {
|
||||||
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_NULL, KEY_NULL
|
||||||
|
|||||||
@ -173,6 +173,7 @@ enum {
|
|||||||
//KEY_USER_APP_BT_START,
|
//KEY_USER_APP_BT_START,
|
||||||
//KEY_USER_APP_MUSIC_START,
|
//KEY_USER_APP_MUSIC_START,
|
||||||
KEY_USER_LED,
|
KEY_USER_LED,
|
||||||
|
KEY_USER_FLASH_LED,
|
||||||
KEY_USER_SETTING,
|
KEY_USER_SETTING,
|
||||||
|
|
||||||
KEY_IR_NUM_0, //中间不允许插入
|
KEY_IR_NUM_0, //中间不允许插入
|
||||||
|
|||||||
@ -1188,7 +1188,7 @@ void app_bt_task()
|
|||||||
int res;
|
int res;
|
||||||
int msg[32];
|
int msg[32];
|
||||||
ui_update_status(STATUS_EXIT_LOWPOWER);
|
ui_update_status(STATUS_EXIT_LOWPOWER);
|
||||||
eye_led_stop(); // 仅在music模式下才有eye led,所以这里需要停止eye led
|
eye_led_stop(); // 这里需要先停止eye led,避免在切换页面时,eye led还在闪烁
|
||||||
start_led_timer();
|
start_led_timer();
|
||||||
kt_ui_show_page(KT_PAGE_BT);
|
kt_ui_show_page(KT_PAGE_BT);
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "kt.h"
|
#include "kt.h"
|
||||||
#include "kt_ui.h"
|
#include "kt_ui.h"
|
||||||
|
#include "eye_led.h"
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
此文件函数主要是music模式按键处理和事件处理
|
此文件函数主要是music模式按键处理和事件处理
|
||||||
@ -1121,6 +1122,7 @@ void app_music_task()
|
|||||||
int msg[32];
|
int msg[32];
|
||||||
kt_ui_show_page(KT_PAGE_MUSIC);
|
kt_ui_show_page(KT_PAGE_MUSIC);
|
||||||
music_task_start();
|
music_task_start();
|
||||||
|
eye_led_stop();
|
||||||
|
|
||||||
#if (MUSIC_DEVICE_TONE_EN)
|
#if (MUSIC_DEVICE_TONE_EN)
|
||||||
music_player_play_start();
|
music_player_play_start();
|
||||||
@ -1140,6 +1142,8 @@ void app_music_task()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
BT_LED_ON();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
app_task_get_msg(msg, ARRAY_SIZE(msg), 1);
|
||||||
|
|||||||
@ -142,6 +142,13 @@ u8 kt_ui_music_setting_mode(void)
|
|||||||
return ui_music_get_setting_flag();
|
return ui_music_get_setting_flag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 kt_ui_bt_setting_mode(void)
|
||||||
|
{
|
||||||
|
if (current_page_id != KT_PAGE_BT)
|
||||||
|
return 0;
|
||||||
|
return ui_bt_get_setting_flag();
|
||||||
|
}
|
||||||
|
|
||||||
/* 按键分发: 根据当前页面调用对应页面的按键处理 */
|
/* 按键分发: 根据当前页面调用对应页面的按键处理 */
|
||||||
static void ui_dispatch_key_event(int key_event, int key_value)
|
static void ui_dispatch_key_event(int key_event, int key_value)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -17,4 +17,6 @@ int kt_ui_get_current_page(void);
|
|||||||
|
|
||||||
/* Music 页是否处于设置模式(用于按键过滤:NEXT/PREV 在设置模式下转发给 UI) */
|
/* Music 页是否处于设置模式(用于按键过滤:NEXT/PREV 在设置模式下转发给 UI) */
|
||||||
u8 kt_ui_music_setting_mode(void);
|
u8 kt_ui_music_setting_mode(void);
|
||||||
|
/* BT 页是否处于设置模式(用于按键过滤:NEXT/PREV/PP 在设置模式下转发给 UI) */
|
||||||
|
u8 kt_ui_bt_setting_mode(void);
|
||||||
#endif
|
#endif
|
||||||
158
apps/ui/ui_bt.c
158
apps/ui/ui_bt.c
@ -6,12 +6,85 @@
|
|||||||
#include "user_cfg.h"
|
#include "user_cfg.h"
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include "drv_st7789.h"
|
#include "drv_st7789.h"
|
||||||
|
#include "eye_led.h"
|
||||||
|
|
||||||
extern void bt_get_play_time(tPlayTime *pt);
|
extern void bt_get_play_time(tPlayTime *pt);
|
||||||
|
|
||||||
static lv_obj_t *bar_progress;
|
static lv_obj_t *bar_progress;
|
||||||
static lv_obj_t *label_curr_time;
|
static lv_obj_t *label_curr_time;
|
||||||
static lv_obj_t *label_total_time;
|
static lv_obj_t *label_total_time;
|
||||||
|
static lv_obj_t *led_list;
|
||||||
|
|
||||||
|
#define LED_MODE_COUNT 8
|
||||||
|
#define LIST_TOP 58
|
||||||
|
#define LIST_W (LCD_W - 24)
|
||||||
|
#define LIST_H (BAR_Y - LIST_TOP - 5)
|
||||||
|
#define ROW_GAP 1
|
||||||
|
|
||||||
|
static u8 setting_flag;
|
||||||
|
static int led_focus_idx;
|
||||||
|
static u8 last_led_mode = 1;
|
||||||
|
|
||||||
|
static void clear_focus_style(lv_obj_t *btn)
|
||||||
|
{
|
||||||
|
lv_obj_set_style_bg_opa(btn, LV_OPA_TRANSP, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void set_focus_style(lv_obj_t *btn)
|
||||||
|
{
|
||||||
|
lv_obj_set_style_bg_opa(btn, LV_OPA_COVER, 0);
|
||||||
|
lv_obj_set_style_bg_color(btn, lv_color_hex(0x333333), 0);
|
||||||
|
lv_obj_scroll_to_view(btn, LV_ANIM_OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ui_bt_update_led_mode_item(u8 mode)
|
||||||
|
{
|
||||||
|
if (!led_list) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < LED_MODE_COUNT; i++) {
|
||||||
|
lv_obj_t *c = lv_obj_get_child(led_list, i);
|
||||||
|
if (!c) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
lv_color_t color = (mode != 0 && (int)(mode - 1) == i)
|
||||||
|
? lv_color_hex(0x00FF00)
|
||||||
|
: lv_color_hex(0xFFFFFF);
|
||||||
|
lv_obj_set_style_text_color(c, color, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ui_bt_update_led_focus_style(void)
|
||||||
|
{
|
||||||
|
if (!led_list) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < LED_MODE_COUNT; i++) {
|
||||||
|
lv_obj_t *c = lv_obj_get_child(led_list, i);
|
||||||
|
if (!c) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (setting_flag && i == led_focus_idx) {
|
||||||
|
set_focus_style(c);
|
||||||
|
} else {
|
||||||
|
clear_focus_style(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void create_led_mode_list(lv_obj_t *list)
|
||||||
|
{
|
||||||
|
const char *mode_text[] = {"Mode 1", "Mode 2", "Mode 3", "Mode 4", "Mode 5", "Mode 6", "Mode 7", "Mode 8"};
|
||||||
|
for (int i = 0; i < LED_MODE_COUNT; i++) {
|
||||||
|
lv_obj_t *btn = lv_list_add_btn(list, LV_SYMBOL_CHARGE, mode_text[i]);
|
||||||
|
lv_obj_set_style_pad_all(btn, 2, 0);
|
||||||
|
lv_obj_set_style_bg_opa(btn, LV_OPA_TRANSP, 0);
|
||||||
|
lv_obj_set_style_text_color(btn, lv_color_hex(0xFFFFFF), 0);
|
||||||
|
lv_obj_set_style_border_width(btn, 1, 0);
|
||||||
|
lv_obj_set_style_border_side(btn, LV_BORDER_SIDE_BOTTOM, 0);
|
||||||
|
lv_obj_set_style_border_color(btn, lv_color_hex(0xAAAAAA), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 刷新播放时间显示 */
|
/* 刷新播放时间显示 */
|
||||||
static void ui_bt_refresh_play_time(void)
|
static void ui_bt_refresh_play_time(void)
|
||||||
@ -49,11 +122,11 @@ lv_obj_t *ui_bt_create(void)
|
|||||||
lv_obj_clear_flag(scr, LV_OBJ_FLAG_SCROLLABLE);
|
lv_obj_clear_flag(scr, LV_OBJ_FLAG_SCROLLABLE);
|
||||||
|
|
||||||
#define TITLE_H 36
|
#define TITLE_H 36
|
||||||
#define BAR_W (LCD_W - 48)
|
#define BAR_W (LCD_W - 104)
|
||||||
#define BAR_X 24
|
#define BAR_X 52
|
||||||
#define BAR_H 14 /* 加粗进度条 */
|
#define BAR_H 14 /* 加粗进度条 */
|
||||||
#define BAR_Y (LCD_H - 70) /* 靠下 */
|
#define BAR_Y (LCD_H - BAR_H - 5) /* 距底部 5 像素 */
|
||||||
#define TIME_Y (BAR_Y + BAR_H + 8)
|
#define TIME_Y (BAR_Y - 1)
|
||||||
|
|
||||||
/* 顶部标题 */
|
/* 顶部标题 */
|
||||||
lv_obj_t *title = lv_label_create(scr);
|
lv_obj_t *title = lv_label_create(scr);
|
||||||
@ -74,7 +147,26 @@ lv_obj_t *ui_bt_create(void)
|
|||||||
lv_obj_set_style_text_font(label_bt_name, &lv_font_montserrat_12, 0);
|
lv_obj_set_style_text_font(label_bt_name, &lv_font_montserrat_12, 0);
|
||||||
lv_obj_set_width(label_bt_name, LCD_W);
|
lv_obj_set_width(label_bt_name, LCD_W);
|
||||||
lv_obj_set_style_text_align(label_bt_name, LV_TEXT_ALIGN_CENTER, 0);
|
lv_obj_set_style_text_align(label_bt_name, LV_TEXT_ALIGN_CENTER, 0);
|
||||||
lv_obj_center(label_bt_name);
|
lv_obj_set_pos(label_bt_name, 0, 39);
|
||||||
|
|
||||||
|
led_list = lv_list_create(scr);
|
||||||
|
lv_obj_set_size(led_list, LIST_W, LIST_H);
|
||||||
|
lv_obj_set_pos(led_list, 12, LIST_TOP);
|
||||||
|
lv_obj_set_style_bg_opa(led_list, LV_OPA_TRANSP, 0);
|
||||||
|
lv_obj_set_style_border_width(led_list, 1, 0);
|
||||||
|
lv_obj_set_style_border_color(led_list, lv_color_hex(0xCCCCCC), 0);
|
||||||
|
lv_obj_set_style_text_color(led_list, lv_color_hex(0xFFFFFF), 0);
|
||||||
|
lv_obj_set_style_text_font(led_list, &lv_font_montserrat_12, 0);
|
||||||
|
lv_obj_set_style_pad_row(led_list, ROW_GAP, 0);
|
||||||
|
create_led_mode_list(led_list);
|
||||||
|
{
|
||||||
|
u8 mode = eye_led_get_mode();
|
||||||
|
if (mode != 0) {
|
||||||
|
last_led_mode = mode;
|
||||||
|
}
|
||||||
|
ui_bt_update_led_mode_item(mode);
|
||||||
|
}
|
||||||
|
ui_bt_update_led_focus_style();
|
||||||
|
|
||||||
/* 进度条:靠下、加粗,背景色调亮便于与背景图区分 */
|
/* 进度条:靠下、加粗,背景色调亮便于与背景图区分 */
|
||||||
bar_progress = lv_bar_create(scr);
|
bar_progress = lv_bar_create(scr);
|
||||||
@ -93,13 +185,13 @@ lv_obj_t *ui_bt_create(void)
|
|||||||
lv_label_set_text(label_curr_time, "0:00");
|
lv_label_set_text(label_curr_time, "0:00");
|
||||||
lv_obj_set_style_text_color(label_curr_time, lv_color_hex(0xFFFFFF), 0);
|
lv_obj_set_style_text_color(label_curr_time, lv_color_hex(0xFFFFFF), 0);
|
||||||
lv_obj_set_style_text_font(label_curr_time, &lv_font_montserrat_12, 0);
|
lv_obj_set_style_text_font(label_curr_time, &lv_font_montserrat_12, 0);
|
||||||
lv_obj_set_pos(label_curr_time, BAR_X, TIME_Y);
|
lv_obj_set_pos(label_curr_time, 8, TIME_Y);
|
||||||
|
|
||||||
label_total_time = lv_label_create(scr);
|
label_total_time = lv_label_create(scr);
|
||||||
lv_label_set_text(label_total_time, "0:00");
|
lv_label_set_text(label_total_time, "0:00");
|
||||||
lv_obj_set_style_text_color(label_total_time, lv_color_hex(0xFFFFFF), 0);
|
lv_obj_set_style_text_color(label_total_time, lv_color_hex(0xFFFFFF), 0);
|
||||||
lv_obj_set_style_text_font(label_total_time, &lv_font_montserrat_12, 0);
|
lv_obj_set_style_text_font(label_total_time, &lv_font_montserrat_12, 0);
|
||||||
lv_obj_set_pos(label_total_time, BAR_X + BAR_W - 30, TIME_Y);
|
lv_obj_set_pos(label_total_time, BAR_X + BAR_W + 8, TIME_Y);
|
||||||
|
|
||||||
ui_bt_refresh_play_time();
|
ui_bt_refresh_play_time();
|
||||||
|
|
||||||
@ -111,14 +203,58 @@ void ui_bt_on_key(int key_event, int key_value)
|
|||||||
(void)key_value;
|
(void)key_value;
|
||||||
switch (key_event)
|
switch (key_event)
|
||||||
{
|
{
|
||||||
/* case KEY_MUSIC_PREV:
|
case KEY_MUSIC_PREV:
|
||||||
case KEY_USER_PREV:
|
if (setting_flag) {
|
||||||
kt_ui_show_page(KT_PAGE_HOME);
|
led_focus_idx = (led_focus_idx - 1 + LED_MODE_COUNT) % LED_MODE_COUNT;
|
||||||
break; */
|
ui_bt_update_led_focus_style();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KEY_MUSIC_NEXT:
|
||||||
|
if (setting_flag) {
|
||||||
|
led_focus_idx = (led_focus_idx + 1) % LED_MODE_COUNT;
|
||||||
|
ui_bt_update_led_focus_style();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KEY_MUSIC_PP:
|
||||||
|
if (setting_flag) {
|
||||||
|
eye_led_stop();
|
||||||
|
last_led_mode = (u8)(led_focus_idx + 1);
|
||||||
|
eye_led_set_mode(last_led_mode);
|
||||||
|
eye_led_start();
|
||||||
|
ui_bt_update_led_mode_item(last_led_mode);
|
||||||
|
setting_flag = 0;
|
||||||
|
ui_bt_update_led_focus_style();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KEY_USER_FLASH_LED:
|
||||||
|
if (eye_led_get_mode() != 0) {
|
||||||
|
eye_led_stop();
|
||||||
|
ui_bt_update_led_mode_item(0);
|
||||||
|
} else {
|
||||||
|
eye_led_set_mode(last_led_mode);
|
||||||
|
eye_led_start();
|
||||||
|
ui_bt_update_led_mode_item(last_led_mode);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KEY_USER_SETTING:
|
||||||
|
setting_flag = !setting_flag;
|
||||||
|
if (setting_flag) {
|
||||||
|
led_focus_idx = 0;
|
||||||
|
}
|
||||||
|
ui_bt_update_led_focus_style();
|
||||||
|
break;
|
||||||
case KEY_USER_PLAY_TIME_UPDATE:
|
case KEY_USER_PLAY_TIME_UPDATE:
|
||||||
ui_bt_refresh_play_time();
|
ui_bt_refresh_play_time();
|
||||||
break;
|
break;
|
||||||
|
case KEY_USER_EYE_LED_STOP:
|
||||||
|
ui_bt_update_led_mode_item(0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u8 ui_bt_get_setting_flag(void)
|
||||||
|
{
|
||||||
|
return setting_flag;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
#ifndef __UI_BT_H__
|
#ifndef __UI_BT_H__
|
||||||
#define __UI_BT_H__
|
#define __UI_BT_H__
|
||||||
|
|
||||||
|
#include "kt.h"
|
||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
|
||||||
lv_obj_t *ui_bt_create(void);
|
lv_obj_t *ui_bt_create(void);
|
||||||
void ui_bt_on_key(int key_event, int key_value);
|
void ui_bt_on_key(int key_event, int key_value);
|
||||||
void ui_bt_update_play_time(void);
|
void ui_bt_update_play_time(void);
|
||||||
|
u8 ui_bt_get_setting_flag(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -52,17 +52,16 @@ static const char music_scan_param[] = "-t"
|
|||||||
#define LIST_TOP 36
|
#define LIST_TOP 36
|
||||||
#define LIST_ROWS 6
|
#define LIST_ROWS 6
|
||||||
#define ROW_GAP 1
|
#define ROW_GAP 1
|
||||||
#define LIST_AVAIL_H (LCD_H - 50 - LIST_TOP) /* BAR_Y - LIST_TOP = 154 */
|
#define BAR_W (LCD_W - 104)
|
||||||
|
#define BAR_X 52
|
||||||
|
#define BAR_H 14
|
||||||
|
#define BAR_Y (LCD_H - BAR_H - 5)
|
||||||
|
#define TIME_Y (BAR_Y - 1)
|
||||||
|
#define LIST_AVAIL_H (BAR_Y - LIST_TOP - 5)
|
||||||
#define ROW_H ((LIST_AVAIL_H - (LIST_ROWS - 1) * ROW_GAP) / LIST_ROWS) /* 每行约 24px,保证6行容纳 */
|
#define ROW_H ((LIST_AVAIL_H - (LIST_ROWS - 1) * ROW_GAP) / LIST_ROWS) /* 每行约 24px,保证6行容纳 */
|
||||||
#define LIST_H (LIST_ROWS * ROW_H + (LIST_ROWS - 1) * ROW_GAP)
|
#define LIST_H (LIST_ROWS * ROW_H + (LIST_ROWS - 1) * ROW_GAP)
|
||||||
#define LIST_W ((LCD_W - 16) / 2 - 4) /* 左右各一半,中间留缝 */
|
#define LIST_W ((LCD_W - 16) / 2 - 4) /* 左右各一半,中间留缝 */
|
||||||
|
|
||||||
#define BAR_W (LCD_W - 48)
|
|
||||||
#define BAR_X 24
|
|
||||||
#define BAR_H 14
|
|
||||||
#define BAR_Y (LCD_H - 45)
|
|
||||||
#define TIME_Y (BAR_Y + BAR_H + 7)
|
|
||||||
|
|
||||||
static lv_obj_t *file_list = NULL;
|
static lv_obj_t *file_list = NULL;
|
||||||
static lv_obj_t *bar_progress = NULL;
|
static lv_obj_t *bar_progress = NULL;
|
||||||
static lv_obj_t *label_curr_time = NULL;
|
static lv_obj_t *label_curr_time = NULL;
|
||||||
@ -82,6 +81,7 @@ static u8 setting_flag = 0;
|
|||||||
static u8 row_select_mode = ROW_SELECT_LIST; /* 0=list 选择,1=行选择 */
|
static u8 row_select_mode = ROW_SELECT_LIST; /* 0=list 选择,1=行选择 */
|
||||||
static u8 focus_list_id = FOCUS_LIST_FILE; /* 当前选中的列表 */
|
static u8 focus_list_id = FOCUS_LIST_FILE; /* 当前选中的列表 */
|
||||||
static int focus_idx = 0; /* 行选择时当前列表内的索引 */
|
static int focus_idx = 0; /* 行选择时当前列表内的索引 */
|
||||||
|
static u8 last_led_mode = 1;
|
||||||
|
|
||||||
void ui_music_update_led_mode_item(u8 mode);
|
void ui_music_update_led_mode_item(u8 mode);
|
||||||
|
|
||||||
@ -285,9 +285,10 @@ static void focus_confirm(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
eye_led_stop();
|
eye_led_stop();
|
||||||
eye_led_set_mode((u8)(focus_idx + 1));
|
last_led_mode = (u8)(focus_idx + 1);
|
||||||
|
eye_led_set_mode(last_led_mode);
|
||||||
eye_led_start();
|
eye_led_start();
|
||||||
ui_music_update_led_mode_item((u8)(focus_idx + 1));
|
ui_music_update_led_mode_item(last_led_mode);
|
||||||
}
|
}
|
||||||
setting_flag = 0;
|
setting_flag = 0;
|
||||||
focus_exit_setting();
|
focus_exit_setting();
|
||||||
@ -499,7 +500,12 @@ void ui_music_refresh_file_list(void)
|
|||||||
ui_music_update_playing_item(music_player_get_file_sclust());
|
ui_music_update_playing_item(music_player_get_file_sclust());
|
||||||
}
|
}
|
||||||
/* 若 eye LED 正在运行,恢复高亮对应模式 */
|
/* 若 eye LED 正在运行,恢复高亮对应模式 */
|
||||||
ui_music_update_led_mode_item(eye_led_get_mode());
|
{
|
||||||
|
u8 mode = eye_led_get_mode();
|
||||||
|
if (mode != 0)
|
||||||
|
last_led_mode = mode;
|
||||||
|
ui_music_update_led_mode_item(mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 刷新播放进度(music_player 返回秒,与 file_dec_get_cur_time 一致) */
|
/* 刷新播放进度(music_player 返回秒,与 file_dec_get_cur_time 一致) */
|
||||||
@ -626,13 +632,13 @@ lv_obj_t *ui_music_create(void)
|
|||||||
lv_label_set_text(label_curr_time, "0:00");
|
lv_label_set_text(label_curr_time, "0:00");
|
||||||
lv_obj_set_style_text_color(label_curr_time, lv_color_hex(0xFFFFFF), 0);
|
lv_obj_set_style_text_color(label_curr_time, lv_color_hex(0xFFFFFF), 0);
|
||||||
lv_obj_set_style_text_font(label_curr_time, &lv_font_montserrat_12, 0);
|
lv_obj_set_style_text_font(label_curr_time, &lv_font_montserrat_12, 0);
|
||||||
lv_obj_set_pos(label_curr_time, BAR_X, TIME_Y);
|
lv_obj_set_pos(label_curr_time, 8, TIME_Y);
|
||||||
|
|
||||||
label_total_time = lv_label_create(scr);
|
label_total_time = lv_label_create(scr);
|
||||||
lv_label_set_text(label_total_time, "0:00");
|
lv_label_set_text(label_total_time, "0:00");
|
||||||
lv_obj_set_style_text_color(label_total_time, lv_color_hex(0xFFFFFF), 0);
|
lv_obj_set_style_text_color(label_total_time, lv_color_hex(0xFFFFFF), 0);
|
||||||
lv_obj_set_style_text_font(label_total_time, &lv_font_montserrat_12, 0);
|
lv_obj_set_style_text_font(label_total_time, &lv_font_montserrat_12, 0);
|
||||||
lv_obj_set_pos(label_total_time, BAR_X + BAR_W - 30, TIME_Y);
|
lv_obj_set_pos(label_total_time, BAR_X + BAR_W + 8, TIME_Y);
|
||||||
|
|
||||||
ui_music_refresh_play_time();
|
ui_music_refresh_play_time();
|
||||||
|
|
||||||
@ -669,6 +675,19 @@ void ui_music_on_key(int key_event, int key_value)
|
|||||||
case KEY_USER_EYE_LED_STOP:
|
case KEY_USER_EYE_LED_STOP:
|
||||||
ui_music_update_led_mode_item(0);
|
ui_music_update_led_mode_item(0);
|
||||||
break;
|
break;
|
||||||
|
case KEY_USER_FLASH_LED:
|
||||||
|
if (eye_led_get_mode() != 0)
|
||||||
|
{
|
||||||
|
eye_led_stop();
|
||||||
|
ui_music_update_led_mode_item(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eye_led_set_mode(last_led_mode);
|
||||||
|
eye_led_start();
|
||||||
|
ui_music_update_led_mode_item(last_led_mode);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case KEY_USER_SETTING:
|
case KEY_USER_SETTING:
|
||||||
setting_flag = !setting_flag;
|
setting_flag = !setting_flag;
|
||||||
if (setting_flag)
|
if (setting_flag)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
cpu/br23/tools/download/standard/update.ufw
Normal file
BIN
cpu/br23/tools/download/standard/update.ufw
Normal file
Binary file not shown.
@ -1737,6 +1737,7 @@ objs/apps/kaotings/kt.c.o
|
|||||||
-r=objs/apps/kaotings/kt.c.o,app_get_curr_task,l
|
-r=objs/apps/kaotings/kt.c.o,app_get_curr_task,l
|
||||||
-r=objs/apps/kaotings/kt.c.o,kt_ui_post_key_event,l
|
-r=objs/apps/kaotings/kt.c.o,kt_ui_post_key_event,l
|
||||||
-r=objs/apps/kaotings/kt.c.o,kt_ui_music_setting_mode,l
|
-r=objs/apps/kaotings/kt.c.o,kt_ui_music_setting_mode,l
|
||||||
|
-r=objs/apps/kaotings/kt.c.o,kt_ui_bt_setting_mode,l
|
||||||
-r=objs/apps/kaotings/kt.c.o,sys_timer_del,l
|
-r=objs/apps/kaotings/kt.c.o,sys_timer_del,l
|
||||||
-r=objs/apps/kaotings/kt.c.o,sys_timer_add,l
|
-r=objs/apps/kaotings/kt.c.o,sys_timer_add,l
|
||||||
-r=objs/apps/kaotings/kt.c.o,get_bt_connect_status,l
|
-r=objs/apps/kaotings/kt.c.o,get_bt_connect_status,l
|
||||||
@ -1776,6 +1777,8 @@ objs/apps/ui/kt_ui.c.o
|
|||||||
-r=objs/apps/ui/kt_ui.c.o,kt_ui_get_current_page,pl
|
-r=objs/apps/ui/kt_ui.c.o,kt_ui_get_current_page,pl
|
||||||
-r=objs/apps/ui/kt_ui.c.o,kt_ui_music_setting_mode,pl
|
-r=objs/apps/ui/kt_ui.c.o,kt_ui_music_setting_mode,pl
|
||||||
-r=objs/apps/ui/kt_ui.c.o,ui_music_get_setting_flag,l
|
-r=objs/apps/ui/kt_ui.c.o,ui_music_get_setting_flag,l
|
||||||
|
-r=objs/apps/ui/kt_ui.c.o,kt_ui_bt_setting_mode,pl
|
||||||
|
-r=objs/apps/ui/kt_ui.c.o,ui_bt_get_setting_flag,l
|
||||||
-r=objs/apps/ui/kt_ui.c.o,lv_init,l
|
-r=objs/apps/ui/kt_ui.c.o,lv_init,l
|
||||||
-r=objs/apps/ui/kt_ui.c.o,lv_port_disp_init,l
|
-r=objs/apps/ui/kt_ui.c.o,lv_port_disp_init,l
|
||||||
-r=objs/apps/ui/kt_ui.c.o,os_taskq_pend,l
|
-r=objs/apps/ui/kt_ui.c.o,os_taskq_pend,l
|
||||||
@ -1815,21 +1818,33 @@ objs/apps/ui/ui_bt.c.o
|
|||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_width,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_width,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_text_align,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_text_align,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,bt_get_local_name,l
|
-r=objs/apps/ui/ui_bt.c.o,bt_get_local_name,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_bar_create,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_list_create,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_size,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_size,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_bg_opa,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_border_width,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_border_color,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_row,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,eye_led_get_mode,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_bar_create,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_bar_set_range,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_bar_set_range,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_bar_set_value,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_bar_set_value,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_bg_color,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_bg_color,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_bg_opa,l
|
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_radius,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_radius,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,ui_bt_on_key,pl
|
-r=objs/apps/ui/ui_bt.c.o,ui_bt_on_key,pl
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,eye_led_stop,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,eye_led_set_mode,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,eye_led_start,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,ui_bt_get_setting_flag,pl
|
||||||
-r=objs/apps/ui/ui_bt.c.o,bt_get_play_time,l
|
-r=objs/apps/ui/ui_bt.c.o,bt_get_play_time,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_snprintf,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_snprintf,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_left,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_left,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_right,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_right,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_top,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_top,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_bottom,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_pad_bottom,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_obj_align,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_list_add_btn,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_set_style_border_side,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_get_child,l
|
||||||
|
-r=objs/apps/ui/ui_bt.c.o,lv_obj_scroll_to_view,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,img_bg,l
|
-r=objs/apps/ui/ui_bt.c.o,img_bg,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_font_montserrat_20,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_font_montserrat_20,l
|
||||||
-r=objs/apps/ui/ui_bt.c.o,lv_font_montserrat_12,l
|
-r=objs/apps/ui/ui_bt.c.o,lv_font_montserrat_12,l
|
||||||
@ -1838,8 +1853,8 @@ objs/apps/ui/ui_music.c.o
|
|||||||
-r=objs/apps/ui/ui_music.c.o,music_player_get_play_status,l
|
-r=objs/apps/ui/ui_music.c.o,music_player_get_play_status,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,ui_music_update_playing_item,pl
|
-r=objs/apps/ui/ui_music.c.o,ui_music_update_playing_item,pl
|
||||||
-r=objs/apps/ui/ui_music.c.o,music_player_get_file_sclust,l
|
-r=objs/apps/ui/ui_music.c.o,music_player_get_file_sclust,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,ui_music_update_led_mode_item,pl
|
|
||||||
-r=objs/apps/ui/ui_music.c.o,eye_led_get_mode,l
|
-r=objs/apps/ui/ui_music.c.o,eye_led_get_mode,l
|
||||||
|
-r=objs/apps/ui/ui_music.c.o,ui_music_update_led_mode_item,pl
|
||||||
-r=objs/apps/ui/ui_music.c.o,ui_music_update_play_time,pl
|
-r=objs/apps/ui/ui_music.c.o,ui_music_update_play_time,pl
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_get_child,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_get_child,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_text_color,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_text_color,l
|
||||||
@ -1866,6 +1881,9 @@ objs/apps/ui/ui_music.c.o
|
|||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_bg_color,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_bg_color,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_radius,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_radius,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,ui_music_on_key,pl
|
-r=objs/apps/ui/ui_music.c.o,ui_music_on_key,pl
|
||||||
|
-r=objs/apps/ui/ui_music.c.o,eye_led_stop,l
|
||||||
|
-r=objs/apps/ui/ui_music.c.o,eye_led_set_mode,l
|
||||||
|
-r=objs/apps/ui/ui_music.c.o,eye_led_start,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,ui_music_get_setting_flag,pl
|
-r=objs/apps/ui/ui_music.c.o,ui_music_get_setting_flag,pl
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_del,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_del,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,dev_manager_find_active,l
|
-r=objs/apps/ui/ui_music.c.o,dev_manager_find_active,l
|
||||||
@ -1893,9 +1911,6 @@ objs/apps/ui/ui_music.c.o
|
|||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_pad_top,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_pad_top,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_pad_bottom,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_set_style_pad_bottom,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_obj_scroll_to_view,l
|
-r=objs/apps/ui/ui_music.c.o,lv_obj_scroll_to_view,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,eye_led_stop,l
|
|
||||||
-r=objs/apps/ui/ui_music.c.o,eye_led_set_mode,l
|
|
||||||
-r=objs/apps/ui/ui_music.c.o,eye_led_start,l
|
|
||||||
-r=objs/apps/ui/ui_music.c.o,img_bg,l
|
-r=objs/apps/ui/ui_music.c.o,img_bg,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_font_montserrat_20,l
|
-r=objs/apps/ui/ui_music.c.o,lv_font_montserrat_20,l
|
||||||
-r=objs/apps/ui/ui_music.c.o,lv_font_montserrat_12,l
|
-r=objs/apps/ui/ui_music.c.o,lv_font_montserrat_12,l
|
||||||
@ -3610,7 +3625,9 @@ objs/apps/soundbox/task_manager/music/music.c.o
|
|||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,music_app_check,pl
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,music_app_check,pl
|
||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_music_task,pl
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_music_task,pl
|
||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,kt_ui_show_page,l
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,kt_ui_show_page,l
|
||||||
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,eye_led_stop,l
|
||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,tone_play_with_callback_by_name,l
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,tone_play_with_callback_by_name,l
|
||||||
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,gpio_set_output_value,l
|
||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_task_get_msg,l
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_task_get_msg,l
|
||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_default_event_deal,l
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_default_event_deal,l
|
||||||
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_task_exitting,l
|
-r=objs/apps/soundbox/task_manager/music/music.c.o,app_task_exitting,l
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user