解决一些软件bug

1.make.py添加输出源文件的命令
2.解决找不到usart设备导致文件管理无法退出卡死的问题
3.解决点击关于本机卡死的问题
4.解决工具界面中文工具显示乱码的问题
This commit is contained in:
2025-07-05 23:48:54 +08:00
parent 0981cae9c4
commit fed557e2e1
8 changed files with 96 additions and 54 deletions

View File

@@ -3,7 +3,32 @@
{
"name": "stm32",
"includePath": [
"${workspaceFolder}/**"
"Project/Src/MJPEG",
"Project/Src/MJPEG/JPEG",
"Project/Src/STM32/CMSIS/Device/ST/STM32F4xx/Include",
"Project/Src/STM32/CMSIS/Include",
"Project/Src/STM32/DSP/Include",
"Project/Src/STM32/STM32F4xx_StdPeriph_Driver/inc",
"Project/Src/Drive/Include",
"Project/Src/FATS",
"Project/Src/FreeType",
"Project/Src/FreeType/include",
"Project/Src/JPEG",
"Project/Src/lib",
"Project/Src/lpng1637",
"Project/Src/lua-5.4.2",
"Project/Src/lua-5.4.2/src",
"Project/Src/MP3",
"Project/Src/MP3/helix",
"Project/Src/MY",
"Project/Src/MyApp",
"Project/Src/MyWin",
"Project/Src/MyWin/MyWinCore",
"Project/Src/MyWin/Window",
"Project/Src/MyWinApp",
"Project/Src/rt-thread",
"Project/Src/rt-thread/include",
"Project/Src/zlib"
],
"defines": [
"USE_STDPERIPH_DRIVER",
@@ -17,7 +42,7 @@
"compilerPath": "D:/Program Files/arm-gnu-toolchain/bin/arm-none-eabi-gcc",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-gcc-arm"
"intelliSenseMode": "windows-gcc-arm"
}
],
"version": 4

View File

@@ -12,7 +12,8 @@
"mywin_user_status_bar.h": "c",
"elf.h": "c",
"string.h": "c",
"aftypes.h": "c"
"aftypes.h": "c",
"base.h": "c"
},
"cortex-debug.variableUseNaturalFormat": false,
"files.autoGuessEncoding": true,

View File

@@ -21,9 +21,9 @@
/*------------------------<2D>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>غ<EFBFBD><D8BA><EFBFBD>-----------------------------*/
// 1,ʹ<><CAB9>nrf<72><66><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ô<EFBFBD><C3B4><EFBFBD>
#define USE_NRF 0
#define USE_NRF 0
static int tools_updata_thread_on(void);
static int tools_updata_thread_off(void);
@@ -62,7 +62,11 @@ static void cd_updata_thread(void *t)
}
#else
FILE *f=fopen("usart","r");
if(f==NULL) return;
if(f==NULL) {
myfree(data);
g_updata_down=1;
return;
}
#endif
while(1)
{
@@ -257,7 +261,7 @@ static void puts_char(stdout_file *p,int ch)
static int put(int ch)
{
stdout_file *file=g_stdout_file;
if(file)
{
if(ch>0x80)

View File

@@ -32,27 +32,27 @@
#ifndef u8
#ifndef u8
# define u8 uint8_t
#endif
#ifndef u16
#ifndef u16
# define u16 uint16_t
#endif
#ifndef u32
#ifndef u32
# define u32 uint32_t
#endif
#ifndef s8
#ifndef s8
# define s8 int8_t
#endif
#ifndef s16
#ifndef s16
# define s16 int16_t
#endif
#ifndef s32
#ifndef s32
# define s32 int32_t
#endif
#define sprintf rt_sprintf
typedef struct

View File

@@ -12,7 +12,7 @@
#include "math.h"
#include "mywin_user_lock.h"
#define WIN_HOME_TYPE "WIN_HomeStruct"
@@ -34,9 +34,9 @@ WIN_HomeStruct *WIN_CreatHome (WIN_WindowStruct *base,
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣѭ<CFA2><D1AD>
if (msgLoop==0)
{
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))HOME_DefaultMsgLoop;
}
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))HOME_DefaultMsgLoop;
}
WIN_HomeStruct *ret=mymalloc (sizeof ( WIN_HomeStruct));
//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><ECBAAF>
if (ret)
@@ -57,16 +57,16 @@ WIN_HomeStruct *WIN_CreatHome (WIN_WindowStruct *base,
((WIN_WindowStruct *)ret)->color=0xd7c1ac;
ret->color1=0x7d7064;
ret->timerId= WIN_CreatTimer ((WIN_WindowStruct *)ret,100);
WIN_TouchWinStruct *t=(WIN_TouchWinStruct *)ret;
WIN_WindowStruct *w=(WIN_WindowStruct *)ret;
// TOUCHWIN_AddChild(t,TOUCH_CON_DOWN_PAR(w->x_size,w->y_size,creat_menu));
// TOUCHWIN_AddChild(t,TOUCH_CON_LEFT_PAR(w->x_size,w->y_size,creat_tool));
}
}
return ret;
}
@@ -95,9 +95,9 @@ static WIN_TouchWinStruct *creat_menu(WIN_TouchWinStruct *base)
WIN_SetBkColor (temp,((WIN_WindowStruct *)base)->bkcolor);
WIN_SetColor (temp,((WIN_WindowStruct *)base)->color);
WIN_TouchWinStruct *t=(WIN_TouchWinStruct *)temp;
// WIN_TouchWinStruct *t=(WIN_TouchWinStruct *)CreatPicSet((WIN_WindowStruct *)base);
return t;
}
@@ -110,9 +110,9 @@ static WIN_TouchWinStruct *creat_tool(WIN_TouchWinStruct *base)
temp=(WIN_WindowStruct *)MENU_Tool ((WIN_WindowStruct *)base,&((WIN_WindowStruct *)base)->pic);
WIN_SetBkColor (temp,((WIN_WindowStruct *)base)->bkcolor);
WIN_SetColor (temp,((WIN_WindowStruct *)base)->color);
WIN_TouchWinStruct *t=(WIN_TouchWinStruct *)temp;
return t;
}
@@ -126,7 +126,7 @@ static WIN_TouchWinStruct *creat_tool(WIN_TouchWinStruct *base)
<09>̰<EFBFBD><CCB0>ϼ<EFBFBD><CFBC><EFBFBD>Ӧ<EFBFBD>ü<EFBFBD><C3BC><EFBFBD>
<09>̰<EFBFBD><CCB0>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD><DDB9><EFBFBD>
<09><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
int HOME_KeyBord (WIN_HomeStruct *home,WIN_KeyStruct *k)
{
@@ -203,15 +203,15 @@ int HOME_TouchMove(WIN_HomeStruct *home,WIN_MoveStruct *m)
//Ĭ<>ϻ<EFBFBD><CFBB>ƺ<EFBFBD><C6BA><EFBFBD>
void HOME_DefaultPaint (WIN_HomeStruct *home)
{
int x=0;
int y=0;
int x_size=((WIN_WindowStruct *)home)->x_size;
int y_size=((WIN_WindowStruct *)home)->y_size;
WIN_PaintBackGround ((WIN_WindowStruct *)home);
u32 font_type=WIN_SetFontSize(24);
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
WIN_SetLcdBkColor (((WIN_WindowStruct *)home)->bkcolor);
WIN_SetLcdColor (((WIN_WindowStruct *)home)->color);
@@ -221,7 +221,7 @@ void HOME_DefaultPaint (WIN_HomeStruct *home)
int dat_y=190+20;
mymemcpy (txt_dat,home->date,10);
WIN_DrawTxtHCenterAt (home->date,x_size/2,dat_y);
//<2F><>ʾʱ<CABE><CAB1>
char txt_min[10]={0};
int time_x=0;
@@ -239,9 +239,9 @@ void HOME_DefaultPaint (WIN_HomeStruct *home)
WIN_SetFontSize(35);
time_y-=WIN_GetFontHight();
WIN_DrawTxtAt(home->time+5,time_x,time_y);
WIN_SetFontSize(font_type);
//<2F><>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
// static int angle=0;
// angle++;if(angle>=360) angle=0;
@@ -249,7 +249,7 @@ void HOME_DefaultPaint (WIN_HomeStruct *home)
// int p_y=cosf(angle*3.14159f/180.0f)*50;
// WIN_DrawLine(350+50,136,350+50+p_x,136+p_y);
// WIN_DrawLineAA(350+50,136+50,350+50+p_x,136+50+p_y,4);
}
@@ -278,7 +278,7 @@ static int savefile_to_sd (void *ptr)
char *file_name=mymalloc (256);
FRESULT ret=FR_OK;
int file_name_len=strlen(t->name);
//ֻ֧<D6BB><D6A7>3<EFBFBD><33><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>β׺
if(t->name[file_name_len-4]!='.')
{
@@ -286,10 +286,10 @@ static int savefile_to_sd (void *ptr)
myfree(file_name);
return 0;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
sprintf (file_name,"0:/%s/%s",&t->name[file_name_len-3],t->name);
open:
ret=f_open (file,file_name,FA_CREATE_NEW|FA_WRITE);
if(ret==FR_NO_PATH)
@@ -304,7 +304,7 @@ static int savefile_to_sd (void *ptr)
UINT real=0;
ret=f_write (file,t->data,t->dataLen,&real);
if (ret!=FR_OK)
while (1);
while (1);
else ret_int=1;//<2F><><EFBFBD><EFBFBD>1<EFBFBD>ɹ<EFBFBD>
}
else ret_int=0;
@@ -364,9 +364,9 @@ void HOME_AlarmRun (WIN_HomeStruct *home)
mp3Data.data=data;mp3Data.dataSize=size;
work=WIN_CreatThreadPro ((int (*)(void *))g_alarmRingWork,&mp3Data,&work_ret,17);
}
MSGBOX_TipsTime ((WIN_WindowStruct *)win,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>",txt_buff,"ȷ<EFBFBD><EFBFBD>",5*60*1000);
//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>
if (data)
{
@@ -385,8 +385,8 @@ void HOME_AlarmRun (WIN_HomeStruct *home)
WIN_ExWorkFunClear(work);
}
myfree(data);
}
}
myfree(txt_buff);
}
@@ -398,7 +398,7 @@ void HOME_RecvFile (WIN_HomeStruct *home,SysFile_RecvedStruct *r)
if (r->recved)
{
char *txt=mymalloc (256);
sprintf (txt,"<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>%d Byte",r->name,r->dataLen);
sprintf(txt,"<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>%ld Byte",r->name,r->dataLen);
if (MSGBOX_Inquiry ((WIN_WindowStruct *)win,"<EFBFBD>Ƿ񱣴棿",txt,"<EFBFBD><EFBFBD>","<EFBFBD><EFBFBD>")==0)
{
int index=MSGBOX_Select ((WIN_WindowStruct *)win,"<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>",(char **)g_fileSaveItem,
@@ -438,7 +438,7 @@ void HOME_DefaultMsgLoop (WIN_HomeStruct *home,WIN_MsgStruct *msg)
WIN_KeyStruct *k=0;
WIN_MoveStruct *m;
switch (msg->msg)
{
{
case WIN_MSG_PAINT:
HOME_DefaultPaint(home);
break;
@@ -463,7 +463,7 @@ void HOME_DefaultMsgLoop (WIN_HomeStruct *home,WIN_MsgStruct *msg)
RTC_DateTypeDef rtc_date={0};
RTC_GetTime (RTC_Format_BIN,&rtc_time);
RTC_GetDate (RTC_Format_BIN,&rtc_date);
if (home->sec!=rtc_time.RTC_Seconds)
{
home->sec=rtc_time.RTC_Seconds;
@@ -474,7 +474,7 @@ void HOME_DefaultMsgLoop (WIN_HomeStruct *home,WIN_MsgStruct *msg)
sprintf (home-> date,"%04d-%02d-%02d %s",rtc_date.RTC_Year+2000,rtc_date.RTC_Month,rtc_date.RTC_Date,g_week[rtc_date.RTC_WeekDay-1]);
sprintf (home->time,"%02d:%02d:%02d",rtc_time.RTC_Hours,rtc_time.RTC_Minutes,rtc_time.RTC_Seconds);
WIN_SetInvalidWhenTop ((WIN_WindowStruct *)home);
}
//if (WIN_FindTopWin(WIN_GetBaseWindow())==(WIN_WindowStruct *)home)
{

View File

@@ -59,9 +59,12 @@ WIN_MenuStruct *MENU_Setting (WIN_WindowStruct *base,WIN_PicStruct *pic)
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>õı<C3B5><C4B1><EFBFBD>
#define APP_SOURCE (*(u32 *)(0x08020000+4*7))
#define APP_APPNAME (*(char **)(0x08020000+4*8))
#define APP_SIZE (*(u32 *)(0x08020000+4*9))
// #define APP_SOURCE (*(u32 *)(0x08020000+4*7))
// #define APP_APPNAME (*(char **)(0x08020000+4*8))
// #define APP_SIZE (*(u32 *)(0x08020000+4*9))
#define APP_SOURCE (*(u32 *)(0x08000000+4*7))
#define APP_APPNAME (*(char **)(0x08000000+4*8))
#define APP_SIZE (*(u32 *)(0x08000000+4*9))

View File

@@ -31,22 +31,19 @@ void MENU_ToolScanFile(WIN_MenuStruct *menu)
FRESULT ret = FR_OK;
DIR dir = {0};
FILINFO *file_info = 0;
char *tmp = mymalloc(256);
file_info = mymalloc(sizeof(FILINFO));
ret = f_findfirst(&dir, file_info, TOOL_APP_PATH, "*.axf");
while ((ret == FR_OK) && (file_info->fname[0] != 0))
{
if (AM_DIR & file_info->fattrib)
continue;
gbk2utf8_str(file_info->fname, tmp);
if (MENU_GetAllItemNum(menu) < TOOL_APP_MAXNUM)
MENU_AddItem(menu, 0, tmp);
MENU_AddItem(menu, 0, file_info->fname);
else
break;
ret = f_findnext(&dir, file_info);
}
myfree(file_info);
myfree(tmp);
}
static void MENU_ToolEnter(WIN_MenuStruct *menu)

View File

@@ -319,6 +319,18 @@ def main():
for item in SRC_DIR:
SRC += find_type(item,'.c')
if len(sys.argv) > 1:
l=[]
if sys.argv[1] == 'show_inc':
l=INC
elif sys.argv[1] == 'show_src':
l=SRC
l.sort()
for item in l:
t=item.replace('\\','/')
print(f"\"Project/{t}\",")
return
if build_depend(SRC):
if build_object(SRC):
if build_target(SRC):