confusing WinAVR compiler warning

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just upgraded to the latest release version of WinAVR, and now my code (that always compiled fine before) is getting an odd warning:

cutter_eeprom.h: In function 'eeprom_write_byte':
cutter_eeprom.h:60: warning: left shift count is negative

Referencing the line of code:

loop_until_bit_is_clear(SPMCSR,SELFPRGEN);

which waits for any pending SPM operations to finish (then the code later writes a byte to the EEPROM).

I can't seem to find any information about this warning. Any idea what it is, and if it will cause problems?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So what are the defintions of:

SPMCSR
SELFPRGEN
loop_until_but_is_clear

It's going to be something like:

while(SPMCSR & (1<<SELFPRGEN));

So if SELFPRGEN is defined as a negative value (though that seems odd) it would explain the warning.

Maybe look at the .i file?

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like the headers now include-
#define SELFPRGEN ~_BV(0) /* Self Programming Enable */

for the fuses.

But it then (silently, I guess), redefines SELFPRGEN, which was previously 0.

These are the headers affected- iom168.h,iom168p.h,iom328p.h,iom48p.h,iom88p.h,iom88.h,iotn2313.h,iotn48.h,iotn88.h

Simply use 0 instead of SELFPRGEN for now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update-

They have already changed the headers to use FUSE_SELFPRGEN. You can download the 20080228 interim libc version, or wait for the next libc.

Windows-
http://download.savannah.gnu.org...
Not Windows-
http://download.savannah.gnu.org...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, we belatedly saw the conflict and consequently changed the names. Sorry for all the hassle. One could just as easily change the name of the fuse in the header file directly without having to download any new version.