CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RTOS and task problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








RTOS and task problem
PostPosted: Wed Aug 01, 2007 5:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 02, 2007 1:21 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 02, 2007 3:00 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group