Fix boot black screen and mode-select touch Y-axis mapping.

Send POWER_ON before slow peripheral init, enable backlight at LCD init,
init W25Q128 early, and avoid App_Auto preset load deadlock. Disable
LCD dump by default and enlarge UI thread stack for stable drawing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
yuquanjun 2026-09-02 12:16:05 +08:00
parent 42534a28b8
commit 9b3d457da6
7 changed files with 22 additions and 16 deletions

View File

@ -171,14 +171,16 @@ void System_PowerOn(void)
BSP_BlueToothPowerEnable(1); BSP_BlueToothPowerEnable(1);
powon = true; /* 更新开机标志 */ powon = true; /* 更新开机标志 */
/* 先通知 UI 亮屏,避免外设初始化阻塞导致长时间黑屏 */
LOG_I("PWR", "send POWER_ON");
MainTask_Sendmsg(MSG_ID_POWER_ON, 0, 0, 0);
AD85020B_Init(); AD85020B_Init();
TM1629D_Key_LED_Init(); TM1629D_Key_LED_Init();
app_tm1617_init(); app_tm1617_init();
XPT2046_Init(); XPT2046_Init();
App_Auto_Init(); App_Auto_Init();
LOG_I("PWR", "periph ready send POWER_ON"); LOG_I("PWR", "periph ready");
/* 通知 UI 层画开机界面 */
MainTask_Sendmsg(MSG_ID_POWER_ON,0,0,0);
} }
static void PowerOn(void) static void PowerOn(void)

View File

@ -95,11 +95,15 @@ void App_Auto_Init(void)
m_presetCount = AutoBandTop1_GetPresetItemCount(); m_presetCount = AutoBandTop1_GetPresetItemCount();
int ret = AutoBandTop1_LoadPresetItemFromFlash(0); int ret = AutoBandTop1_LoadPresetItemFromFlash(0);
if(ret != 0) if (ret != 0)
{ {
for(;;); LOG_E("AUTO", "LoadPreset fail ret=%d addr=0x%08X",
ret, (unsigned)ADDRESS);
}
else
{
AutoBandTop1_ChangeBPM(mGuiData[1].Current);
} }
AutoBandTop1_ChangeBPM(mGuiData[1].Current);
} }
//void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) //void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

View File

@ -4,7 +4,7 @@
#include "includes.h" #include "includes.h"
#ifndef DEBUG_LCD_DUMP #ifndef DEBUG_LCD_DUMP
#define DEBUG_LCD_DUMP 1 #define DEBUG_LCD_DUMP 0
#endif #endif
#if DEBUG_LCD_DUMP #if DEBUG_LCD_DUMP

View File

@ -203,9 +203,7 @@ void LCD_Init(void)
LCD_WR_DATA8(0x0F); LCD_WR_DATA8(0x0F);
// LCD_WR_REG(0x29); //Display on // LCD_WR_REG(0x29); //Display on
LCD_FillByColor(0, 0, 240, 320, BLACK); // 初始全屏白色 LCD_FillByColor(0, 0, 240, 320, BLACK);
LCD_WR_REG(0x29); //Display on LCD_WR_REG(0x29); //Display on
// LCD_BLK_Set(); LCD_BLK_Set();
} }

View File

@ -192,13 +192,13 @@ static uint8_t TP_AdcCoordValid(uint16_t x, uint16_t y)
#define CALIB_Y_MAX 3950 #define CALIB_Y_MAX 3950
/* /*
* IRQ raw.x raw.y SWAP * 线 BOOT/raw.xXraw.yY
* Y raw.y * TP_MIRROR_Y=1 Y
* ADC raw.y=4095 ADC 退 * DOUT(PA15) raw.y ADC 退
*/ */
#define TP_SWAP_XY 0 #define TP_SWAP_XY 0
#define TP_MIRROR_X 0 #define TP_MIRROR_X 0
#define TP_MIRROR_Y 1 #define TP_MIRROR_Y 0
static uint16_t TP_MapAxis(uint16_t adc, uint16_t adc_min, uint16_t adc_max, uint16_t px_max) static uint16_t TP_MapAxis(uint16_t adc, uint16_t adc_min, uint16_t adc_max, uint16_t px_max)
{ {

View File

@ -81,6 +81,7 @@ int main(void)
/* add user code begin 2 */ /* add user code begin 2 */
bsp_init(); bsp_init();
BSP_MainPowerEnable(1);
LCD_Init(); LCD_Init();
LCD_Dump_Init(); LCD_Dump_Init();
app_log_init(); app_log_init();
@ -140,6 +141,7 @@ void bsp_init(void)
/* init spi1 function. */ /* init spi1 function. */
wk_spi1_init(); wk_spi1_init();
W25Q128_Init();
/* init adc1 function. */ /* init adc1 function. */
wk_adc1_init(); wk_adc1_init();

View File

@ -9,7 +9,7 @@ static struct rt_thread TaskBTRecvThread;
static struct rt_thread TaskAutobandThread; static struct rt_thread TaskAutobandThread;
ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskScanThread_Stack[512]; ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskScanThread_Stack[512];
ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskUIThread_Stack[1024]; ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskUIThread_Stack[2048];
ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskTouchThread_Stack[1536]; ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskTouchThread_Stack[1536];
ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskMainThread_Stack[512]; ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskMainThread_Stack[512];
ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskBTTHandlehread_Stack[512]; ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskBTTHandlehread_Stack[512];