Go Down

Topic: not worked since IDE 1.6.0 (Read 4132 times) previous topic - next topic

alb12

Ok, always the same problem with 1.6.1
have you an idea for the next update of gcc?
I need made an update have you Solution for my problem?

westfw

It's not liking the CLEAR_BIT and SET_BIT macros:
Code: [Select]
#define SET_BIT(var,bitnum)   (*((unsigned long*)(&var)) |= 1UL << bitnum)

They ARE a bit "wonky" re-casting the struct to a long.  I suspect that the optimizer is putting the struct into registers, and then getting confused when it needs the address (although it shouldn't:  registers of an avr do have an address!)

This particular program can be made compilable by adding "static" to the definition of temperatureData in checkTemp:
Code: [Select]
      static struct temperatureData receivedTemperature;


Do the other people having problems have similar code structures?
(it didn't like an assignment to the cast structure either, although that resulted in a different error:)
Code: [Select]
          *(unsigned long *)(&receivedTemperature) = tmp;

I'm not seeing a bug submitted against gcc for this particular code.


alb12

I haven't submit error, I don't know make it.

I have make this modification :
 
Code: [Select]
#define SET_BIT(var,bitnum)   (*((unsigned long*)(&var)) |= 1UL << bitnum)
Code: [Select]
  static struct temperatureData receivedTemperature;

I haven't upload the sketch on arduino uno but I have check the code and this seems ok

federicofissore

alb12 does it compile? or gcc keeps on crashing?

alb12


federicofissore

so westfw was right then. thank you :)

Go Up