|
|
View previous topic :: View next topic |
Author |
Message |
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
RTOS compile issue |
Posted: Wed Mar 28, 2012 3:29 am |
|
|
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: 19504
|
|
Posted: Thu Mar 29, 2012 4:37 am |
|
|
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
|
|
Posted: Thu Apr 05, 2012 2:43 am |
|
|
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. |
|
|
|
|
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
|