|
将ucGUI 移植到 STM32F407 RT-thread1.1 系统下,ucGUI 刷屏才得分 4xxxxxx,而在相同情况下 把rt-thread 换成ucos ucGUI 刷屏得分能到1xxxxxxx,相差几乎3倍,lcd驱动ucgui版本硬件都是一样的,就是所用的操作系统不一样而已,不知问题出在哪里?
rt-thread的ucGUI移植部分:
#include "GUI.h"
#include "GUI_X.h"
#include <rtthread.h>
/*********************************************************************
*
* Global data
*/
volatile int OS_TimeMS;
static rt_sem_t DispSem;
//static rt_mailbox_t EventMbox;
/*********************************************************************
*
* Timing:
* GUI_X_GetTime()
* GUI_X_Delay(int)
Some timing dependent routines require a GetTime
and delay function. Default time unit (tick), normally is
1 ms.
*/
int GUI_X_GetTime(void) {
return ((int)rt_tick_get());
}
void GUI_X_Delay(int ms) {
rt_tick_t temp;
temp=(ms*1000)/RT_TICK_PER_SECOND;
rt_thread_delay(temp);
}
/*********************************************************************
*
* GUI_X_Init()
*
* Note:
* GUI_X_Init() is called from GUI_Init is a possibility to init
* some hardware which needs to be up and running before the GUI.
* If not required, leave this routine blank.
*/
void GUI_X_Init(void) {}
/*********************************************************************
*
* GUI_X_ExecIdle
*
* Note:
* Called if WM is in idle state
*/
void GUI_X_ExecIdle(void)
{
rt_thread_delay(1);
}
U32 GUI_X_GetTaskId (void)
{
return 0;
}
void GUI_X_InitOS (void)
{
DispSem = rt_sem_create("sem",1,0);
//EventMbox = rt_mb_create("mbx",0,0);
}
void GUI_X_Lock (void)
{
rt_sem_take(DispSem,RT_WAITING_FOREVER);
}
void GUI_X_Unlock (void)
{
rt_sem_release(DispSem);
}
/*********************************************************************
*
* Logging: OS dependent
Note:
Logging is used in higher debug levels only. The typical target
build does not use logging and does therefor not require any of
the logging routines below. For a release build without logging
the routines below may be eliminated to save some space.
(If the linker is not function aware and eliminates unreferenced
functions automatically)
*/
void GUI_X_Log (const char *s) { GUI_USE_PARA(s); }
void GUI_X_Warn (const char *s) { GUI_USE_PARA(s); }
void GUI_X_ErrorOut(const char *s) { GUI_USE_PARA(s); } |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|