Altera_Forum
Honored Contributor
13 years agoTrying to understand MicroC/OS-II
Hello i have a NEEK Board and i've runned web server example with sucess.
However now i want to do other stuffs in my program, like a PIO read. i don't know how can i do it, i took a look at the webserver.c code and it's like thatint main (int argc, char* argv, char* envp)
{
/* Initialize the current flash block, for flash programming. */
current_flash_block = -1;
INT8U error_code;
/* Clear the RTOS timer */
OSTimeSet(0);
/* WSInitialTask will initialize the NicheStack TCP/IP Stack and then
* initialize the rest of the web server's tasks.
*/
error_code = OSTaskCreateExt(WSInitialTask,
NULL,
(void *)&WSInitialTaskStk,
WS_INITIAL_TASK_PRIO,
WS_INITIAL_TASK_PRIO,
WSInitialTaskStk,
TASK_STACKSIZE,
NULL,
0);
alt_uCOSIIErrorHandler(error_code, 0);
/*
* As with all MicroC/OS-II designs, once the initial thread(s) and
* associated RTOS resources are declared, we start the RTOS. That's it!
*/
OSStart();
while(1); /* Correct Program Flow never gets here. */
return -1;
} Where should my C code go? Before OSStart? Is the ethernet set up and running before it? How can i manipulate it? I can't see OSStart function in the code. I've already programmed a lot in pure C for NIOS2 and uCLinux but never with uCOS, any tips from where i should begin?