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 support@ccsinfo.com

rtos_disable giving Error 51

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



Joined: 13 Nov 2007
Posts: 2
Location: Stonehaven Scotland

View user's profile Send private message

rtos_disable giving Error 51
PostPosted: Tue Nov 13, 2007 2:15 am     Reply with quote

Folks,

My first post to this forum so apologies in advance if I step out of line. I have had PCM and PCH for some time (v3.204) and recently bought PCD and the IDE (v4.060). I've been playing with the RTOS example 9 however no matter how I try and compile it, the rtos_disable function is giving me an Error 51 A numberic expression must appear here.

As I cannot post the example code according to forum rules, I have posted a completely cut down piece of code which demonstrates the same problem.

Code:


#include <18F452.h>
#use delay(clock=20000000)
#use rtos(timer=0,minor_cycle=100ms)

#task(rate=1000ms,max=100ms)
void task1()
{
}

#task(rate=1000ms,max=100ms)
void task2()
{
   rtos_enable(task1);
   rtos_disable(task1);

}


void main ( ) {
   // initialize input variables
   rtos_run();
}


The same error occurs irrespective of the compiler and target chip I use. I have also re-installed the compilers on other machines just in case it was my environment. I have also tried compiling using MPLAB IDE really clutching at straws but I get the same error.

I have an open support question with CCS but thought I would consult this august body as well.

Am I missing something here by not using the RTOS functions right or has anyone else come across the same problem ?

Thanks in advance,

Mark
Ttelmah
Guest







PostPosted: Tue Nov 13, 2007 9:01 am     Reply with quote

What compiler version are you actually trying this on?.
The RTOS examples, were only added with the mid 3.23x compilers, and requires a compiler 'late' enough, to accept the function name, as a value. Example 9, compiles and runs fine on the V4 compilers, but will give the error you are listing, if you try to compile them on an older compiler.
It sounds as if the wrong compiler is actually being used.

Best Wishes
mmarooth



Joined: 13 Nov 2007
Posts: 2
Location: Stonehaven Scotland

View user's profile Send private message

PostPosted: Tue Nov 13, 2007 9:47 am     Reply with quote

Yep,

Retested again and my v4.060 does compile it. Must have been a dumb mistake I made last time I tried it Embarassed Interestingly enough, the only rtos function that does not work with my v3.204 compiler is rtos_disable().

Thanks for the help.
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