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:
parent
42534a28b8
commit
9b3d457da6
|
|
@ -171,14 +171,16 @@ void System_PowerOn(void)
|
|||
BSP_BlueToothPowerEnable(1);
|
||||
powon = true; /* 更新开机标志 */
|
||||
|
||||
/* 先通知 UI 亮屏,避免外设初始化阻塞导致长时间黑屏 */
|
||||
LOG_I("PWR", "send POWER_ON");
|
||||
MainTask_Sendmsg(MSG_ID_POWER_ON, 0, 0, 0);
|
||||
|
||||
AD85020B_Init();
|
||||
TM1629D_Key_LED_Init();
|
||||
app_tm1617_init();
|
||||
XPT2046_Init();
|
||||
App_Auto_Init();
|
||||
LOG_I("PWR", "periph ready send POWER_ON");
|
||||
/* 通知 UI 层画开机界面 */
|
||||
MainTask_Sendmsg(MSG_ID_POWER_ON,0,0,0);
|
||||
LOG_I("PWR", "periph ready");
|
||||
}
|
||||
|
||||
static void PowerOn(void)
|
||||
|
|
|
|||
|
|
@ -97,10 +97,14 @@ void App_Auto_Init(void)
|
|||
int ret = AutoBandTop1_LoadPresetItemFromFlash(0);
|
||||
if (ret != 0)
|
||||
{
|
||||
for(;;);
|
||||
LOG_E("AUTO", "LoadPreset fail ret=%d addr=0x%08X",
|
||||
ret, (unsigned)ADDRESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
AutoBandTop1_ChangeBPM(mGuiData[1].Current);
|
||||
}
|
||||
}
|
||||
|
||||
//void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
//{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "includes.h"
|
||||
|
||||
#ifndef DEBUG_LCD_DUMP
|
||||
#define DEBUG_LCD_DUMP 1
|
||||
#define DEBUG_LCD_DUMP 0
|
||||
#endif
|
||||
|
||||
#if DEBUG_LCD_DUMP
|
||||
|
|
|
|||
|
|
@ -203,9 +203,7 @@ void LCD_Init(void)
|
|||
LCD_WR_DATA8(0x0F);
|
||||
// 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_BLK_Set();
|
||||
|
||||
|
||||
LCD_BLK_Set();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,13 +192,13 @@ static uint8_t TP_AdcCoordValid(uint16_t x, uint16_t y)
|
|||
#define CALIB_Y_MAX 3950
|
||||
|
||||
/*
|
||||
* 实测(IRQ 有效按下):raw.x 常贴高,上下主要改 raw.y → 不要 SWAP。
|
||||
* Y 镜像:上方「万能」对应更大 raw.y。
|
||||
* 空闲 ADC 噪声是 raw.y=4095,禁止走 ADC 回退,否则幽灵点击。
|
||||
* 竖屏线性映射(与 BOOT/量产一致):raw.x→屏幕X,raw.y→屏幕Y,不做镜像。
|
||||
* 若 TP_MIRROR_Y=1 会导致 Y 轴反转(点「专业」误中「万能」)。
|
||||
* DOUT(PA15) 浮空输入;空闲 raw.y 噪声禁止走 ADC 回退。
|
||||
*/
|
||||
#define TP_SWAP_XY 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ int main(void)
|
|||
/* add user code begin 2 */
|
||||
|
||||
bsp_init();
|
||||
BSP_MainPowerEnable(1);
|
||||
LCD_Init();
|
||||
LCD_Dump_Init();
|
||||
app_log_init();
|
||||
|
|
@ -140,6 +141,7 @@ void bsp_init(void)
|
|||
|
||||
/* init spi1 function. */
|
||||
wk_spi1_init();
|
||||
W25Q128_Init();
|
||||
|
||||
/* init adc1 function. */
|
||||
wk_adc1_init();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ static struct rt_thread TaskBTRecvThread;
|
|||
static struct rt_thread TaskAutobandThread;
|
||||
|
||||
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 TaskMainThread_Stack[512];
|
||||
ALIGN(RT_ALIGN_SIZE) static rt_uint8_t TaskBTTHandlehread_Stack[512];
|
||||
|
|
|
|||
Loading…
Reference in New Issue