Direct ports writing error

Hi..I'm just stuck in weird problem...I want to write a byte to a whole port , but I get this error message when compiling..

"ATC_Eth_board:40: error: '255' cannot be used as a function"

What I've done till now :
declared a byte
byte cleara = B11111111;

set the proper direction

DDRA = B11111111;

then I just want to write that byte...

PORTA = cleara ;

When is compiled, it gives me that error ....
I have IDE 1.0.6...

We are to guess which is line 40? Sorry, I'm not into guessing games.

Well...I didn't thought that's so important to explain every comma from the error message, thinking that's obvious that at that line is the "PORTA = cleara;"....thanks for help...

Please post the entire sketch.

Also what microcontroller is that?

The controller is an Atmega2560…

The code is here:

#include <TimerOne.h>
#include <Wire.h>
#include <ICSC.h>

bool flag1= false;
bool flag2= false;
bool flag_y = false;
bool flag_n = false;
volatile bool high = false;
volatile bool low = false;

int flash_buffa=0;
int flash_buffb=0;
int phase_buffa=0;
int phase_buffb=0;

byte cleara = B11111111;// COMENZI PE ZERO …
byte clearb = B11110000;
byte reda = B01101101;// RGVR GVRG
byte redb = B10110000;//VRGV 0000
byte yellow_ona= B10110110;
byte yellow_onb= B11010000;
byte yellow_offa= B11111111;
byte yellow_offb= B11110000;

void setup()
{
Serial.begin(115200);
Wire.begin();
DDRA=B11111111;
DDRF=B11110000;//PF4-7 OUTPUT
DDRD=B00001111;//PD-4-7 INPUTS
DDRC=B00000000;//PC INPUTS
DDRG=0xFF// PG OUTPUTS…LEDURI DE STARE
// =======set I/O pins to outputs
PORTA = cleara; // port A off lights
PORTF = clearb; // port F off lights

//==ICSC set-up ===============================

ICSC.begin(2, 115200,&Serial1,3);
ICSC.registerCommand(‘G’, &Flash_yellow);
ICSC.registerCommand(‘R’, &All_red);
ICSC.registerCommand(‘D’, &Display);
ICSC.registerCommand(‘O’,&Clear);
ICSC.registerCommand(‘r’, &Ready);

//=================pins set-up ====================
digitalWrite(24, HIGH);
//=======timer 1 set-up =============================
Timer1.initialize(480000);
Timer1.attachInterrupt(blinkLED);
Timer1.stop();

}

void loop()
{
ICSC.process();

if(flag_y)
{
Yellow();
}
if(flag_n)
{
Normal_run();
}

}

//===========================================================================
void blinkLED()
{
high=true;
}
//============================================================================
void Clear(unsigned char src, char command, unsigned char len, char *data)
{
flag_y=false;
flag_n=false;
Timer1.stop();
PORTA = cleara; // port A off lights
PORTF = clearb; // port C off lights

}
//===============================================================================

void Flash_yellow(unsigned char src, char command, unsigned char len, char *data)
{
Timer1.start();
flag_y = true;
high=true;

}
//===============================================================================
void All_red(unsigned char src, char command, unsigned char len, char *data)
{
flag_y=false;
flag_n=false;
Timer1.stop();
PORTA = reda; // port A off lights
PORTF = redb; // port C off lights

}
//===============================================================================
void Display(unsigned char src, char command, unsigned char len, char *data)
{
uint16_t *phasea=(uint16_t *)data;
uint16_t *flasha=(uint16_t *)(data+2);

flash_buffa=lowByte(*flasha);
flash_buffb=highByte(*flasha);
phase_buffa=lowByte(*phasea);
phase_buffb=highByte(*phasea);
//buff=(&(*data));
flag_y=false;
flag_n=true;
high=true;
Serial.println(phase_buffa,BIN);
Serial.println(phase_buffb,BIN);
Serial.println(flash_buffa,BIN);
Serial.println(flash_buffb,BIN);
Serial.println(’ ');
Timer1.start();
}
//=================================================================================
void Normal_run()
{
if(high)
{
if(!flag2)
{

PORTA=phase_buffa; // port A
PORTF=phase_buffb; // port F
high=false;
flag2=true;
}
else
{

PORTA=flash_buffa; // port A off lights
PORTF=flash_buffb; // port F off lights
flag2=false;
high=false;
}
}

}
//==============================================================================
void Ready(unsigned char src, char command, unsigned char len, char *data)
{
Serial.println(command);
delay(10);
ICSC.send(1,‘K’,NULL,NULL);
}
//===============================================================================
void Yellow()
{
if(high)
{
if(!flag1)
{
PORTA=yellow_ona; // port A
PORTF=yellow_onb; // port C
flag1=true;
high= false;
}
else
{
PORTA=yellow_offa; // port B
PORTF=yellow_offb; // port B
flag1=false;
high=false;
}
}

}

where could be the error ?
Thanks…

void setup()
{
  byte cleara = B11111111;
  DDRA = B11111111;
  PORTA = cleara;
}

void loop()
{
}

Binary sketch size: 672 bytes (of a 258,048 byte maximum)

So, I'd be inclined to think that you are doing something else that the compiler doesn't like.

where could be the error ?

Perhaps if you posted the code correctly, using code tags, not quote tags...

Sorry, PaulS for this inconvenience, but I had used the " Copy for forum" utility that I founded in the IDE and then just pasted it..The weird thing is that I've done this before, direct port manipulation, but I've never got that message, regardless the value for that byte.

You don’t “paste the code”. Instead, enclose it in code tags ("</>") button.

Yep, founded the mistake...Indeed, PaulS, it was something that IDE don'ts like at all... :slight_smile: ..But at line 38, not 40 as the IDE says....A missing semicolon.... :grin:
This reminds me how life depends by little things.. :slight_smile:
Thanks...