![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
mmarooth
Joined: 13 Nov 2007 Posts: 2 Location: Stonehaven Scotland
|
rtos_disable giving Error 51 |
Posted: Tue Nov 13, 2007 2:15 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Tue Nov 13, 2007 9:01 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
mmarooth
Joined: 13 Nov 2007 Posts: 2 Location: Stonehaven Scotland
|
|
Posted: Tue Nov 13, 2007 9:47 am |
|
|
Yep,
Retested again and my v4.060 does compile it. Must have been a dumb mistake I made last time I tried it Interestingly enough, the only rtos function that does not work with my v3.204 compiler is rtos_disable().
Thanks for the help. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|