处理状态栏中内存显示异常的问题
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
WIN_StatusBarStruct *WIN_CreatStatusBar (WIN_WindowStruct *base,
|
||||
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
||||
int x,int y,int x_size,int y_size)
|
||||
{
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣѭ<CFA2><D1AD>
|
||||
if (msgLoop==0)
|
||||
{
|
||||
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))STATUSBAR_DefaultMsgLoop;
|
||||
}
|
||||
|
||||
msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))STATUSBAR_DefaultMsgLoop;
|
||||
}
|
||||
|
||||
WIN_StatusBarStruct *ret=mymalloc (sizeof ( WIN_StatusBarStruct));
|
||||
//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9>캯<EFBFBD><ECBAAF>
|
||||
if (ret)
|
||||
@@ -48,8 +48,8 @@ WIN_StatusBarStruct *WIN_CreatStatusBar (WIN_WindowStruct *base,
|
||||
ret->app_y_step=30;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ WIN_StatusBarStruct *WIN_CreatStatusBar (WIN_WindowStruct *base,
|
||||
void STATUSBAR_StateUpdata (WIN_StatusBarStruct *statusbar,STATUSBAR_DataStruct *s)
|
||||
{
|
||||
int temp=statusbar->stat.mode_x;
|
||||
|
||||
|
||||
//ʹ<><CAB9><EFBFBD>ڴ渴<DAB4>Ƶķ<C6B5><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽṹ<C6BD><E1B9B9>
|
||||
mymemcpy (& statusbar->stat,s,sizeof (STATUSBAR_DataStruct));
|
||||
if (strlen(statusbar->stat.mode)>8)
|
||||
@@ -120,7 +120,7 @@ void STATUSBAR_ScanApp(WIN_StatusBarStruct *bar)
|
||||
{
|
||||
app_struct *app=appm_get(i);
|
||||
if(app)
|
||||
{
|
||||
{
|
||||
bar->app_item[bar->app_num].app=app;
|
||||
bar->app_num++;
|
||||
}
|
||||
@@ -138,14 +138,14 @@ void STATUSBAR_ClearApp(WIN_StatusBarStruct *bar)
|
||||
//Ĭ<>ϻ<EFBFBD><CFBB>ƺ<EFBFBD><C6BA><EFBFBD>
|
||||
void STATUSBAR_DefaultPaint (WIN_StatusBarStruct *statusbar)
|
||||
{
|
||||
|
||||
|
||||
int x=0;
|
||||
int y=0;
|
||||
int x_size=((WIN_WindowStruct *)statusbar)->x_size;
|
||||
// int y_size=((WIN_WindowStruct *)statusbar)->y_size;
|
||||
int y_size=20;
|
||||
int tag_xsize=0;//<2F><><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>
|
||||
|
||||
|
||||
//<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
||||
WIN_SetLcdBkColor (statusbar->backColor);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>ʾͼƬ
|
||||
@@ -158,25 +158,25 @@ void STATUSBAR_DefaultPaint (WIN_StatusBarStruct *statusbar)
|
||||
{
|
||||
WIN_Clear();
|
||||
}
|
||||
|
||||
|
||||
u32 font_type =WIN_SetFontSize (16);
|
||||
|
||||
|
||||
WIN_SetLcdColor (statusbar->color);
|
||||
|
||||
|
||||
//<2F><>ʾʱ<CABE><CAB1>
|
||||
WIN_SetFontMode (WIN_DRAWMODE_ALONE);
|
||||
WIN_SetLcdBkColor (statusbar->color);
|
||||
if (statusbar->stat.time[0])
|
||||
{
|
||||
WIN_DrawTxtAt (statusbar->stat.time,x,y_size/2-WIN_GetFontHight()/2);
|
||||
WIN_DrawTxtAt (statusbar->stat.time,x,y_size/2-WIN_GetFontHight()/2);
|
||||
}
|
||||
|
||||
|
||||
//<2F><>ʾģʽ
|
||||
if (statusbar->stat.mode[0])
|
||||
{
|
||||
WIN_DrawTxtHCenterAt (statusbar->stat.mode,x_size/2,y_size/2-WIN_GetFontHight()/2);
|
||||
WIN_DrawTxtHCenterAt (statusbar->stat.mode,x_size/2,y_size/2-WIN_GetFontHight()/2);
|
||||
}
|
||||
|
||||
|
||||
//<2F><>ʾ<EFBFBD><CABE><EFBFBD>ذٷֱ<D9B7>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (statusbar->stat.betty[0])
|
||||
{
|
||||
@@ -184,8 +184,8 @@ void STATUSBAR_DefaultPaint (WIN_StatusBarStruct *statusbar)
|
||||
WIN_DrawTxtAt (statusbar->stat.betty,x_size-tag_xsize-1,y_size/2-WIN_GetFontHight()/2);
|
||||
x_size-=tag_xsize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int y_step=statusbar->app_y_step;
|
||||
x=15;
|
||||
y=statusbar->y_size_def+10;
|
||||
@@ -209,14 +209,14 @@ void STATUSBAR_DefaultPaint (WIN_StatusBarStruct *statusbar)
|
||||
rect->x_size=x_size/4;
|
||||
rect->y_size=y_step;
|
||||
WIN_DrawTxtAt("ɾ<EFBFBD><EFBFBD>",rect->x,txt_y);
|
||||
|
||||
|
||||
y+=y_step;
|
||||
WIN_DrawHLine(10,y,x_size-1-10);
|
||||
}
|
||||
|
||||
|
||||
WIN_SetFontSize (font_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ int STATUSBAR_TouchMove(WIN_StatusBarStruct *statusbar,WIN_MoveStruct *m)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Ĭ<><C4AC><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void STATUSBAR_DefaultMsgLoop (WIN_StatusBarStruct *statusbar,WIN_MsgStruct *msg)
|
||||
{
|
||||
@@ -335,7 +335,7 @@ void STATUSBAR_DefaultMsgLoop (WIN_StatusBarStruct *statusbar,WIN_MsgStruct *msg
|
||||
WIN_TouchStruct *t=0;
|
||||
STATUSBAR_DataStruct *s=0;
|
||||
switch (msg->msg)
|
||||
{
|
||||
{
|
||||
case WIN_MSG_PAINT:
|
||||
STATUSBAR_DefaultPaint(statusbar);
|
||||
break;
|
||||
@@ -359,14 +359,16 @@ void STATUSBAR_DefaultMsgLoop (WIN_StatusBarStruct *statusbar,WIN_MsgStruct *msg
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD>״̬<D7B4><CCAC>
|
||||
statusbar->sec=Seconds;
|
||||
int a=mem_perused(),b=exmem_perused();
|
||||
sprintf (statu->time,"%02d:%02d:%02d", Hours,Minutes,Seconds);
|
||||
sprintf (statu->mode,"mem:%.1f,exm:%.1f",mem_perused()/100.0,exmem_perused()/100.0);
|
||||
sprintf (statu->mode,"mem:%02d.%02d,exm:%02d.%02d",a/100,a%100,
|
||||
b/100,b%100);
|
||||
sprintf (statu->betty,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:100%%");
|
||||
STATUSBAR_StateUpdata (statusbar,statu);
|
||||
|
||||
|
||||
STATUSBAR_ClearApp(statusbar);
|
||||
STATUSBAR_ScanApp(statusbar);
|
||||
|
||||
|
||||
WIN_SetInvalidWhenTop ((WIN_WindowStruct *)statusbar);
|
||||
}
|
||||
myfree(statu);
|
||||
|
@@ -27,7 +27,7 @@ typedef struct
|
||||
char time[20];
|
||||
char mode[100];
|
||||
int mode_x; //<2F><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾx<CABE><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>
|
||||
char betty[5];
|
||||
char betty[10];
|
||||
int blueState;
|
||||
int heartState;
|
||||
int nfcState;
|
||||
@@ -39,7 +39,7 @@ typedef struct
|
||||
{
|
||||
app_struct *app;
|
||||
RECT_Struct enter;
|
||||
RECT_Struct exit;
|
||||
RECT_Struct exit;
|
||||
}STATUSBAR_AppStruct;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ typedef struct
|
||||
{
|
||||
WIN_WindowStruct win;
|
||||
STATUSBAR_ResStruct res; //<2F><>ʾ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>Դ
|
||||
STATUSBAR_DataStruct stat;
|
||||
STATUSBAR_DataStruct stat;
|
||||
int img_xsize;//ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD>
|
||||
WIN_PicStruct pic;//״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ
|
||||
u32 backColor; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
||||
@@ -55,15 +55,15 @@ typedef struct
|
||||
int timerId; //<2F><>ʱ<EFBFBD><CAB1>id
|
||||
int timerIdGet; //<2F><><EFBFBD>ڻ<EFBFBD>ȡʱ<C8A1><CAB1>
|
||||
u8 sec;
|
||||
|
||||
|
||||
int mov_start; //<2F>ƶ<EFBFBD><C6B6><EFBFBD>ʼ
|
||||
int y_size_def; //Ĭ<>ϵ<EFBFBD>y<EFBFBD>ߴ<EFBFBD>
|
||||
int dis; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>С
|
||||
|
||||
|
||||
int app_num;
|
||||
int app_y_step;
|
||||
STATUSBAR_AppStruct app_item[APPM_LIST_MAXLEN];
|
||||
|
||||
|
||||
}WIN_StatusBarStruct;
|
||||
|
||||
|
||||
@@ -74,20 +74,20 @@ WIN_StatusBarStruct *WIN_CreatStatusBar (WIN_WindowStruct *base,
|
||||
int x,int y,int x_size,int y_size);
|
||||
|
||||
|
||||
|
||||
|
||||
//״̬<D7B4><CCAC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
|
||||
void STATUSBAR_StateUpdata (WIN_StatusBarStruct *statusbar,STATUSBAR_DataStruct *s);
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>ļ<EFBFBD>
|
||||
void STATUSBAR_SetRes (WIN_StatusBarStruct *statusbar,STATUSBAR_ResStruct *r);
|
||||
|
||||
|
||||
//<2F><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>ͼƬ
|
||||
void STATUSBAR_SetBackPic (WIN_StatusBarStruct *statusbar,WIN_PicStruct *pic);
|
||||
|
||||
|
||||
//Ĭ<>ϻ<EFBFBD><CFBB>ƺ<EFBFBD><C6BA><EFBFBD>
|
||||
void STATUSBAR_DefaultPaint (WIN_StatusBarStruct *statusbar);
|
||||
|
||||
|
||||
|
||||
|
||||
//Ĭ<><C4AC><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void STATUSBAR_DefaultMsgLoop (WIN_StatusBarStruct *statusbar,WIN_MsgStruct *msg);
|
||||
|
||||
|
@@ -9,6 +9,7 @@ from multiprocessing import Process,Queue,Value,cpu_count
|
||||
|
||||
|
||||
os.environ["PATH"]+=";D:/Program Files/arm-gnu-toolchain/bin"
|
||||
os.environ["LANG"]="zh_CN.GBK"
|
||||
|
||||
CC="arm-none-eabi-gcc"
|
||||
AS = CC + ' -x assembler-with-cpp'
|
||||
@@ -25,6 +26,8 @@ CFLAG=[
|
||||
'-Wall',
|
||||
'-fdata-sections',
|
||||
'-ffunction-sections',
|
||||
# '-u _printf_float', # 使用这个选项会导致调用exit
|
||||
'-specs=nano.specs', # 使用nano-newlib
|
||||
# debug
|
||||
'-g -gdwarf-2'
|
||||
]
|
||||
@@ -298,7 +301,7 @@ def build_target(src:list):
|
||||
obj_list.append('.'.join([name,'o']))
|
||||
dst=os.path.join(OUTPUT,TARGET)+".elf"
|
||||
if(check_rebuild(dst,obj_list)):
|
||||
rsp=f"{' '.join(obj_list)} -o {dst} {flags} -specs=nano.specs \
|
||||
rsp=f"{' '.join(obj_list)} -o {dst} {flags} \
|
||||
-T{LD_FILE} -lc -lm -lnosys -Wl,-Map={OUTPUT}/{TARGET}.map,--cref -Wl,--gc-sections \
|
||||
-Wl,--no-warn-rwx-segments -Wl,-print-memory-usage"
|
||||
print(f"链接 {dst}")
|
||||
|
Reference in New Issue
Block a user