wayoda / LedControl

An Arduino library for MAX7219 and MAX7221 Led display drivers
Other
464 stars 246 forks source link

LedControl.h Compile error using Arduino Giga R1 #53

Open Ca11isidrin opened 7 months ago

Ca11isidrin commented 7 months ago

I used LCDemoMatrix.ino example which works great on a Mega 2560, but the project I'm working on uses the Giga R1, but when I try to compile the same sketch on the R1, I get errors on expansion of macro SPI_MOSI see end for copy of error message. I created a totally blank sketch containing only the following:

#include "LedControl.h" 
void setup(){ 
} 
void loop(){
}

even tried the <> round the LedControl.h and including Arduino.h into the LedControl.h file (as this seems to fix other issues in the past) but whatever I've tried it still returns the same error on compiling.

Is there anything I can try to rectify this ? I'm assuming it down to the Giga being MBed so maybe the files need updating so this will work with the Giga.

Hoping you can help with this

Chris

ERROR MESSAGE In file included from /Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/cores/arduino/Arduino.h:76:0,vfrom /private/var/folders/tb/rs678pkd0vj60ndbmk3l1b800000gn/T/arduino/sketches/3C0EF7E69088BCAD6968DD946D6405E4/sketch/sketch_apr7b.ino.cpp:1: /Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:23: error: expected identifier before '(' token

define PIN_SPI_MOSI (90u)

                   ^

/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:243:41: note: in expansion of macro 'PIN_SPI_MOSI'

define SPI_MOSI (digitalPinToPinName(PIN_SPI_MOSI))

                                     ^~~~~~~~~~~~

/Documents/Arduino/libraries/LedControl/src/LedControl.h:72:13: note: in expansion of macro 'SPI_MOSI' int SPI_MOSI; ^ /Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:24: error: expected ')' before numeric constant

define PIN_SPI_MOSI (90u)

                    ^

/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:24: note: in definition of macro 'PIN_SPI_MOSI'

define PIN_SPI_MOSI (90u)

                    ^~~

/Documents/Arduino/libraries/LedControl/src/LedControl.h:72:13: note: in expansion of macro 'SPI_MOSI' int SPI_MOSI; ^ /Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:24: error: expected ')' before numeric constant

define PIN_SPI_MOSI (90u)

                    ^

/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:24: note: in definition of macro 'PIN_SPI_MOSI'

define PIN_SPI_MOSI (90u)

                    ^~~

/Documents/Arduino/libraries/LedControl/src/LedControl.h:72:13: note: in expansion of macro 'SPI_MOSI' int SPI_MOSI; ^ /Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:24: error: expected ')' before numeric constant

define PIN_SPI_MOSI (90u)

                    ^

/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.1.1/variants/GIGA/pins_arduino.h:175:24: note: in definition of macro 'PIN_SPI_MOSI'

define PIN_SPI_MOSI (90u)

                    ^~~

/Documents/Arduino/libraries/LedControl/src/LedControl.h:72:13: note: in expansion of macro 'SPI_MOSI' int SPI_MOSI; ^

exit status 1

Compilation error: exit status 1