r/FastLED • u/BarrettT123 • Sep 28 '24
Support Problem compiling for Attiny1604?
Hi everyone,
I am working on a project where I am trying to control 5 Adafruit neopixels with an attiny1604, using the FastLED library and the MegaTinyCore. When I try to compile anything using this library (including examples), i get this error message:
C:\Users\barre\AppData\Local\Temp\ccdw3hUZ.ltrans0.ltrans.o: In function \L_4616':`
<artificial>:(.text+0xa14): undefined reference to \timer_millis'`
<artificial>:(.text+0xa18): undefined reference to \timer_millis'`
<artificial>:(.text+0xa1c): undefined reference to \timer_millis'`
<artificial>:(.text+0xa20): undefined reference to \timer_millis'`
<artificial>:(.text+0xa30): undefined reference to \timer_millis'`
C:\Users\barre\AppData\Local\Temp\ccdw3hUZ.ltrans0.ltrans.o:<artificial>:(.text+0xa34): more undefined references to \timer_millis' follow`
collect2.exe: error: ld returned 1 exit status
Using library FastLED at version 3.7.8 in folder: C:\Users\barre\OneDrive\Documents\Arduino\libraries\FastLED
exit status 1
Compilation error: exit status 1
I have looked around online, but have not been able to find anything that worked. Does anyone here have any idea what could be causing this?
View all comments
Show parent comment
2
u/ZachVorhies Zach Vorhies Sep 28 '24
I was in this part of the codebase last week and today.
I implemented an optional timer for FastLED for these boards. I have no idea if it works or not.
If you want the injected timer then this is what you need to do:
If you are using 3.7.8 then you can simply define
And this should do it
However, the next release this will change to:
So my suggestion is to define both of these to 1 like this:
This needs to be more than a define you set before including FastLED.h, it needs to be part of the build system defines. I think Arduino allows you to have a config.h at the project root that will get included in some projects. ChatGPT says that FastLED is one of them.
Also, starting on the next release FastLED will inject a weak timer_millis variable into program to prevent this linker error. It should be eliminated if the timer_millis actually exists, like as it is in your code.