fix(led): keep app chord lights when strumming during sing-along

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yuquanjun 2026-10-13 16:11:28 +08:00
parent 5b2c8137eb
commit ccad4570d8
3 changed files with 26 additions and 2 deletions

View File

@ -113,6 +113,23 @@ uint8_t TOUCH_AREA_NUM = (sizeof(Touch_Areas)/sizeof(Touch_AreaTypeDef));
const uint8_t Version[3] = {0,2,52}; /* major.minor.patch — 0.2.52: 开机 Logo 保持到彩灯结束再进模式选择 */
uint8_t Led = 8;
/* App 已下发琴颈引导灯:拨片勿再全绿盖掉 */
static uint8_t s_app_neck_led = 0;
void AppNeckLed_NoteGuide(void)
{
s_app_neck_led = 1;
}
void AppNeckLed_ClearGuide(void)
{
s_app_neck_led = 0;
}
uint8_t AppNeckLed_IsGuide(void)
{
return s_app_neck_led;
}
bool PressFlag = 0;
void Return_Light_buff(uint8_t key_id_1629);
@ -1836,8 +1853,9 @@ void Pick_Handle()
{
uint8_t session_was_on = StartFlag ? 1u : 0u;
StartFlag = 1;
/* 普通:播放中指板 LED 全绿,关闭走向灯刷新 */
app_tm1629_all_on(LED_COLOR_G);
/* 普通:播放中指板 LED 全绿。App 弹唱正在引导时不要盖成全绿。 */
if (!AppNeckLed_IsGuide())
app_tm1629_all_on(LED_COLOR_G);
if (mGuiData[GUI_AUTOBAND_SW].Current)
{
/* 播放中再拨:Stop+Start 重启段落;冷启动前也先 Stop 清残留 */
@ -1959,6 +1977,7 @@ void BL_Set_led(uint8_t led, uint8_t chord_type)
* 导致 UI 与 MIDI 发声不一致;和弦品质仅由映射页 02 03/02 04 维护。 */
(void)chord_type;
Led = led;
AppNeckLed_NoteGuide();
tm1629_set_identity_led((LedNum_TypeDef)led);
}

View File

@ -270,6 +270,10 @@ void Band_EndStartFollowup(void); /* 兼容空操作 */
void BL_Set_led(uint8_t Led, uint8_t chord_type);
/* App 曲目引导灯有效时,拨片不要把琴颈打成全绿 */
void AppNeckLed_NoteGuide(void);
void AppNeckLed_ClearGuide(void);
uint8_t AppNeckLed_IsGuide(void);
uint8_t GetChordNotesByType(uint8_t MIDI_Index,uint8_t type,uint8_t *buff);
/* 伴奏已在播时仅更新和弦音,不 Restart(快转调) */

View File

@ -615,6 +615,7 @@ static void handleDevDisconnect(uint8_t *data)
{
uint8_t resp[6] = {0xF0, 0x60, 0x01, 0x00, 0x01, 0xF7};
(void)data;
AppNeckLed_ClearGuide();
USART4_SendData(resp, sizeof(resp));
}