搜索
bottom↓
回复: 1

RT-thread 问题求教

[复制链接]

出0入0汤圆

发表于 2013-6-27 20:40:37 | 显示全部楼层 |阅读模式
将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周年了!感谢大家的支持与爱护!!

曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……

出0入0汤圆

发表于 2013-6-27 21:00:57 | 显示全部楼层
刷屏得分,刷屏频率?
CPU时钟 系统滴答时钟 其他程序
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-8-25 23:07

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表