tomyoct 发表于 2013-6-27 20:40:37

RT-thread 问题求教

将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;

staticrt_sem_tDispSem;
//staticrt_mailbox_tEventMbox;

/*********************************************************************
*
*      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);
}

U32GUI_X_GetTaskId (void)
{
       return 0;
}

voidGUI_X_InitOS (void)
{
    DispSem   = rt_sem_create("sem",1,0);       
    //EventMbox = rt_mb_create("mbx",0,0);
}


voidGUI_X_Lock (void)
{
   
   
    rt_sem_take(DispSem,RT_WAITING_FOREVER);
}


voidGUI_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); }

channe 发表于 2013-6-27 21:00:57

刷屏得分,刷屏频率?
CPU时钟 系统滴答时钟 其他程序
页: [1]
查看完整版本: RT-thread 问题求教