trash80 / Arduinoboy

Official ArduinoBoy Repository for serial MIDI communication to the Nintendo Gameboy.
GNU General Public License v2.0
317 stars 48 forks source link

Compilation Error for Arduino Nano Every: 'PIND' was not declared in this scope. #22

Closed MeltedHugo closed 10 months ago

MeltedHugo commented 10 months ago

I'm trying to build this with an Arduino Nano Every. I get a compilation error that "PIND" is not declared.

Is there a workaround of some sort for the Nano Every?

./Mode_LSDJ_Keyboard.ino: In function 'void sendKeyboardByteToGameboy(byte)':
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_LSDJ_Keyboard.ino:209:3: note: in expansion of macro 'GB_SET'
   GB_SET(0,0,0);
   ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_LSDJ_Keyboard.ino:209:3: note: in expansion of macro 'GB_SET'
   GB_SET(0,0,0);
   ^~~~~~
./Mode_LSDJ_Midiout.ino: In function 'boolean getIncommingSlaveByte()':
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_LSDJ_Midiout.ino:254:3: note: in expansion of macro 'GB_SET'
   GB_SET(0,0,0);
   ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_LSDJ_Midiout.ino:254:3: note: in expansion of macro 'GB_SET'
   GB_SET(0,0,0);
   ^~~~~~
./Mode_LSDJ_SlaveSync.ino: In function 'void sendClockTickToLSDJ()':
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_LSDJ_SlaveSync.ino:91:5: note: in expansion of macro 'GB_SET'
     GB_SET(0,0,0);
     ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_LSDJ_SlaveSync.ino:91:5: note: in expansion of macro 'GB_SET'
     GB_SET(0,0,0);
     ^~~~~~
./Mode_MidiGb.ino: In function 'void sendByteToGameboy(byte)':
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_MidiGb.ino:107:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,1,0);
        ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_MidiGb.ino:107:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,1,0);
        ^~~~~~
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_MidiGb.ino:110:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,0,0);
        ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_MidiGb.ino:110:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,0,0);
        ^~~~~~
./Mode_Nanoloop.ino: In function 'boolean sendTickToNanoloop(boolean, boolean)':
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_Nanoloop.ino:74:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,1,0);
        ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_Nanoloop.ino:74:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,1,0);
        ^~~~~~
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_Nanoloop.ino:77:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,0,0);
        ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_Nanoloop.ino:77:8: note: in expansion of macro 'GB_SET'
        GB_SET(0,0,0);
        ^~~~~~
./Arduinoboy.ino:231:48: error: 'PIND' was not declared in this scope
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_Nanoloop.ino:82:5: note: in expansion of macro 'GB_SET'
     GB_SET(0,1,0);
     ^~~~~~
./Arduinoboy.ino:231:48: note: suggested alternative: 'PIN0'
 #define GB_SET(bit_cl,bit_out,bit_in) PORTD = (PIND & B11111000) | ((bit_in<<2) | ((bit_out)<<1) | bit_cl)
                                                ^
./Mode_Nanoloop.ino:82:5: note: in expansion of macro 'GB_SET'
     GB_SET(0,1,0);
     ^~~~~~

exit status 1

Compilation error: 'PIND' was not declared in this scope
MeltedHugo commented 10 months ago

I replaced "PIND" with "PD" and it seems to work.