avr/io.h changed from 016 to 017?

Trying to compile nuelectronic's nokia 3310 display example on 017: It seems that avr/io.h isn't as expected. nuelectronics.com/estore/index.php?main_page=product_info&products_id=12

Library:nuelectronics.com/download/projects/nokia_3310_lcd.zip

I put that library under arduino.app/Contents/Resources/hardware/library/nokia_3310_lcd

error:

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c: In function 'LCD_init':

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: 'PB2' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: (Each undeclared identifier is reported only once

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: for each function it appears in.)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: 'PB0' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: 'PB1' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: 'PB3' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:11: error: 'PB5' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:12: error: 'PD7' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c: In function 'LCD_write_byte':

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:42: error: 'PB2' undeclared (first use in this function)

/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/libraries/nokia_3310_lcd/n3310_lcd.c:44: error: 'PB0' undeclared (first use in this function)

LCD_INIT function with line 10:
void LCD_init(void)
{

// LCD_RST = 0; Next is line 10:
DDRB |= (1<<SPI_CS)|(1<<LCD_DC)|(1<<LCD_RST)|(1<<SPI_MOSI)|(1<<SPI_SCK);
DDRD |= (1<<LCD_BL);

PORTB &= ~(1<<LCD_RST);

delayMicroseconds(1);

PORTB |= (1<<LCD_RST);

// PORTB &= ~(1<<SPI_CS);
// delayMicroseconds(1);
// PORTB |= (1<<SPI_CS);
// delayMicroseconds(1);

SPCR = 0x51; // enable SPI master, fosc/16 = 1MH

PORTD |= (1<<LCD_BL); // turn on backlight

LCD_write_byte(0x21, 0);
LCD_write_byte(0xc8, 0);
LCD_write_byte(0x06, 0);
LCD_write_byte(0x13, 0);
LCD_write_byte(0x20, 0);
LCD_clear();
LCD_write_byte(0x0c, 0);

}

code where every pin is defined:

define LCD_RST PB1

define SPI_CS PB2

define SPI_MOSI PB3

define SPI_SCK PB5

define LCD_DC PB0

define LCD_BL PD7

┬┐where it should be the code to handle PBx?

Finally I fixed the code. it seems that include files in new avr lacks of some define:

define PB7 7

define PB6 6

define PB5 5

define PB4 4

define PB3 3

define PB2 2

define PB1 1

define PB0 0

Just replace each define with it's value on nokia lcd header files and everything works. io.h must include iom32.h to define these values.

But something isn't working with these includes in io.h.

Apparently names like PB0 are deprecated (by the avr-libc people) and should be replaced with things like PORTB0. For the 328, they didn't include the old definitions.

Thank you.