Hi, I’m getting compilation errors trying to use FastLED in a platformio project, specifically
fastspi.h:89:78: error: expected template-name before '<' token
Full build output here:
Any ideas?
Hi, I’m getting compilation errors trying to use FastLED in a platformio project, specifically
fastspi.h:89:78: error: expected template-name before '<' token
Full build output here:
Any ideas?
Please can you share your setup function? The appears to be a syntax error in it…
Ah! Those errors are coming from #define <i>_AVR_ATmega328P_</i>, but without that I get #warning "No pin/port mappings found"
What hardware are you trying to build for? Fastled requires some fairly specific hardware definitions per platform. (Also, building with platformio isn’t really officially tested/supported at the moment)
@Daniel_Garcia I’m building for a custom board with an ATMega328p— hence trying to dig up a #define that would work with that.
If platformio is causing the issue, any other ‘pro’ IDEs that might be better? (I’m looking for something a little more powerful than the default Arduino IDE if possible)
I don’t know for sure that platformio causing the issue - but I’d say shake out your basic build/#define issues using the Arduino IDE for now – the number of platforms that FastLED supports makes putting time in testing/supporting other IDE arrangements prohibitive and the vast vast vast majority of FastLED users are using the Arduino IDE which is why I’ve focused on that.
As for the specific complaint, the ATMega328p define that you set, among other things, indicates that there should be hardware SPI support, so it does:
#define AVR_HARDWARE_SPI 1
However https://github.com/FastLED/FastLED/blob/master/platforms/avr/fastspi_avr.h does #Ifdef checks before defining AVRHardwareSPIOutput - my guess is that your combination of includes/defines isn’t providing the SPSR register definition that’s needed to compile hardware SPI on AVR.
You can probably work around getting all that shaken out by putting
#define FASTLED_FORCE_SOFTWARE_SPI 1
before including FastLED.h.