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 compile issue

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



Joined: 16 Mar 2012
Posts: 12

View user's profile Send private message

RTOS compile issue
PostPosted: Wed Mar 28, 2012 3:29 am     Reply with quote

Using PIC 18F26K22, PCWH Version 4.119

I get this error

*** Error 9 "main.c" Line54(6,37) Macro identifier requires parameters
*** Error 100 "main.c" Line 54(6,37): USE parameter value is out of range "((A"

Here is the code.. Line 54 is the #TASK line

Code:
// macros
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))

#include <main.h>
#include <string.h>

#include <battery.c>
#include <oled.c>


// Switches
#define SW1             PIN_A2
#define SW2             PIN_A1
#define SW3             PIN_A0
float number;

#USE RTOS(timer=0,minor_cycle=20ms) // RTOS will use timer zero, minor cycle will be 20ms
 
void Display_Demo()
{
   long charge;
   char string[20];
   static int1 up;

   oled_smalltext( 0, 7, "tare            power");
   
   if( number > 0.00)
      sprintf(string,"+%2.3fd",number);
   else
      sprintf(string,"%2.3fd",number);
   
   oled_bigtext( 0, string);
   
   if(up)
      number += 0.134287;
   else
      number -= 0.34287;
     
   if ( number > 90 ) up = false;
   if ( number < -90) up = true;
   
   
   charge = battery_read();
   sprintf(string,"Battery:%lu",charge);
   oled_smalltext( 0, 0, String);
}


#TASK(rate=1s,max=20ms,queue=5)     
void display_task()
{
   display_demo();
}
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Thu Mar 29, 2012 4:37 am     Reply with quote

You don't show enough for us to answer. You do realise though that you still need a 'main', which must call rtos_run?.
Separately, CCS has a habit of carrying on compiling past the point where an error occurs, and then complaining at the line where it stops being able to cope. The fault therefor could be anywhere in the earlier include files.

Best Wishes
cwedgwood



Joined: 16 Mar 2012
Posts: 12

View user's profile Send private message

PostPosted: Thu Apr 05, 2012 2:43 am     Reply with quote

I have the answer to this.

My definition of the max macro causes a problem with the #task line, because the max= gets macro substituted.
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