View previous topic :: View next topic |
Author |
Message |
Guest
|
RTOS and task problem |
Posted: Wed Aug 01, 2007 5:25 am |
|
|
I've got problem with task and RTOS.
I configured RTOS like this:
Quote: |
#use rtos(timer=0, minor_cycle=20ms)
|
and task function is declared:
Quote: |
#task(rate=900ms,max=20ms)
void task_compute_tempo()
{
#asm
//saving CPU settings before task execution
MOVWF save_w
SWAPF status,W
BCF status,5
BCF status,6
MOVWF save_status
#endasm
compute_tempo(); //
#asm
// restoring task settings after execution
SWAPF save_status,W
MOVWF status
SWAPF save_w,F
SWAPF save_w,W
#endasm
}
|
main function:
Quote: |
main()
{
same_commend_1();
same_commend_2();
same_commend_3();
....
....
same_commend_n();
rtos_run();
for(;;) //unfinitive main loop of program
{
some_function_1();
some_function_2();
some_function_3();
....
some_function_n();
}
}
|
In PIC (18f4620) -program runs correctly till rtos_run() commend. Than it execute task (correctly) but do not get into loop, and do not execute the rest of program. It only count task and execute interrupts (what is of course of). But I neet to execute the rest of program.
What should I change to execute the rest of program??? |
|
|
silelis
Joined: 12 Jun 2007 Posts: 68 Location: Poland, podlaskie district
|
|
Posted: Thu Aug 02, 2007 1:21 am |
|
|
Is there anybody who knows the answer??
Is there someone who can send me CCS RTOS tutorial, or some RTOS example code??? |
|
|
Pret
Joined: 18 Jul 2006 Posts: 92 Location: Iasi, Romania
|
|
Posted: Thu Aug 02, 2007 3:00 am |
|
|
Read CCS documentation about RTOS. The function call rtos_run() does not return until rtos_terminate() call is encountered. Therefore your infinit loop is not executed. If you still want to execute it.. create another task that contains the for body. |
|
|
|