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 example doesn't compile

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



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

RTOS example doesn't compile
PostPosted: Wed Jul 15, 2009 10:02 am     Reply with quote

Hello all,

I have trouble compiling ex_rtos_demo_1_tasks.c from the examples directory without any modification. I am using PCH 4.064.

Code:

#include <18F452.h>
#use delay(clock=20000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
// this tells the compiler that the rtos functionality will be needed, that
// timer0 will be used as the timing device, and that the minor cycle for
// all tasks will be 100 miliseconds
#use rtos(timer=0,minor_cycle=100ms)

// each function that is to be an operating system task must have the #task
// preprocessor directive located above it.
// in this case, the task will run every second, its maximum time to run must
// be less than or equal to the minor cycle, and there is no need for a
// queue at this point, so no memory will be reserved.
#task(rate=1000ms,max=100ms)
// the function can be called anything that a standard function can be called
void The_first_rtos_task ( )
{
   printf("1\n\r");
}

#task(rate=500ms,max=100ms)
void The_second_rtos_task ( )
{
   printf("\t2!\n\r");
}

#task(rate=100ms,max=100ms)
void The_third_rtos_task ( )
{
   printf("\t\t3\n\r");
}

// main is still the entry point for the program
void main ( )
{
   // rtos_run begins the loop which will call the task functions above at the
   // schedualed time
   rtos_run ( );
}


And all I get are these errors from the compiler:

Code:

Executing: "C:\Program Files\PICC\Ccsc.exe" +FH "C:\Program Files\PICC\Examples\ex_rtos_demo_1_tasks.c" +DF +LN +T +A +M +Z +Y=9 +EA
*** Error 101 "ex_rtos_demo_1_tasks.c" Line 23(5,37): Library in USE not found
*** Error 100 "ex_rtos_demo_1_tasks.c" Line 30(6,29): USE parameter value is out of range   "#USE RTOS must appear before #TASK"
*** Error 100 "ex_rtos_demo_1_tasks.c" Line 37(6,28): USE parameter value is out of range   "#USE RTOS must appear before #TASK"
*** Error 100 "ex_rtos_demo_1_tasks.c" Line 43(6,28): USE parameter value is out of range   "#USE RTOS must appear before #TASK"
*** Error 12 "ex_rtos_demo_1_tasks.c" Line 54(15,16): Undefined identifier  -- rtos_run
      5 Errors,  0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Wed Jul 15 11:45:15 2009

Any idea what the problem is?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 15, 2009 11:26 am     Reply with quote

You only get the RTOS if you have the IDE compiler (PCWH, etc.)
You don't get it with the command line compilers (PCM, PCH, etc.)
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

PostPosted: Wed Jul 15, 2009 11:42 am     Reply with quote

Thanks. I didn't know that...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 15, 2009 11:56 am     Reply with quote

There are two posts giving a free RTOS in the Code Library forum:
http://www.ccsinfo.com/forum/viewtopic.php?t=39433
http://www.ccsinfo.com/forum/viewtopic.php?t=21407
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