tobyjaffey / bus-ninja

AVR Bus-Pirate-a-like
http://blog.hodgepig.org/busninja/
89 stars 33 forks source link

master fails to compile #18

Open J-Dunn opened 6 years ago

J-Dunn commented 6 years ago

this project looks like just what I need but current master fails to compile.

There was a warning about an unused variable which got promoted to an error. Easily fixed.

Then I hit this :


led.c:89:23: error: variable 'led_sequences' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 static const uint8_t *led_sequences[] PROGMEM =

now I could start trying to work it all out but presumably master should actually compile. So I'm wondering what is wrong here.

pfalcon commented 6 years ago

So I'm wondering what is wrong here.

You use a smart-ass compiler. Compilers of ol' good days ("Latest commit a62cc7e on Mar 18, 2015") didn't behave like that.

J-Dunn commented 6 years ago

since you seem to understand the problem is there a work around for my 'smart-ass' compiler? Something like a -fdont_be_a_smart_ass option or maybe a suggested mod to the code.

btw I'm using avr-gcc in case you had not already guessed.

dsl400 commented 5 years ago

I have to agree with J-Dunn on both cases, the code does not compile and there is nothing helpful about your response

aaroneiche commented 5 years ago

For others who end up here. The problem is that a change in the compiler results in not seeing the array members as const even if the array itself is. To fix this error, change

static const uint8_t *led_sequences[] PROGMEM to static const uint8_t * const led_sequences[] PROGMEM

This is explained more clearly on the Arduino Wiki

It should be noted there are other compiling issues.