|
楼主 |
发表于 2011-5-6 11:15:24
|
显示全部楼层
回复【4楼】chinaye1
-----------------------------------------------------------------------
你好,我修改了触屏函数,可是还是甚至touch_sample.c都只能显示,触摸屏不能用。
我想请教一下touch_sample.c是不是ke要做成ucos任务一样,在mian函数中调用,这个该怎么弄,我用的Nios II,可以写main函数。
例如有个ucos在nios上的例子是这样的
#include <stdio.h>
#include "includes.h"
/* Definition of Task Stacks */
#define TASK_STACKSIZE 2048
OS_STK task1_stk[TASK_STACKSIZE];
OS_STK task2_stk[TASK_STACKSIZE];
/* Definition of Task Priorities */
#define TASK1_PRIORITY 1
#define TASK2_PRIORITY 2
/* Prints "Hello World" and sleeps for three seconds */
void task1(void* pdata)
{
while (1)
{
printf("Hello from task1\n");
OSTimeDlyHMSM(0, 0, 3, 0);
}
}
/* Prints "Hello World" and sleeps for three seconds */
void task2(void* pdata)
{
while (1)
{
printf("Hello from task2\n");
OSTimeDlyHMSM(0, 0, 3, 0);
}
}
/* The main function creates two task and starts multi-tasking */
int main(void)
{
OSTaskCreateExt(task1,
NULL,
(void *)&task1_stk[TASK_STACKSIZE-1],
TASK1_PRIORITY,
TASK1_PRIORITY,
task1_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(task2,
NULL,
(void *)&task2_stk[TASK_STACKSIZE-1],
TASK2_PRIORITY,
TASK2_PRIORITY,
task2_stk,
TASK_STACKSIZE,
NULL,
0);
OSStart();
return 0;
}
我不知道怎么在nios 的ucos中调用触屏和gui
是不是很RZ的问题啊?
请教 |
|