Welcome! Log In Create A New Profile

Advanced

Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular

Posted by TinHead 
Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 03, 2012 10:17AM
Hi Repetier,


As you might know on Linux you need to get your own avr toolchain installed/compiled to use Arduino.
I would like to use the latest and the greatest done in the Gentoo way but in all avr-libc version I can get to compile properly the way the PROGMEM stuff is declared has been changed.

As far as I understand you are supposed to make use of constants now so I have gone ahead and added the "const" keyword wherever the compiler complains.

However I got stuck at this line:
const short *temptables[7] PROGMEM = {(short int *)&temptable_1[0][0],(short int *)&temptable_2[0][0],(short int *)&temptable_3[0][0],(short int *)&temptable_4[0][0]

It's already a const but the compiler complains:

Extruder.cpp:48:1: warning: missing braces around initializer for ‘int [8]’ [-Wmissing-braces]
Extruder.cpp: In function ‘void initExtruder()’:
Extruder.cpp:190:8: warning: variable ‘dummyADCResult’ set but not used [-Wunused-but-set-variable]
Extruder.cpp: At global scope:
Extruder.cpp:352:28: error: variable ‘temptables’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’

Any idea what's wrong with it?

I realize this might not fix anything but I can try smiling smiley
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 03, 2012 01:55PM
const short *temptables[7] means an array of pointers to constant shorts.

You need const short * const temptables[7] to mean constant pointers to constant shorts.


[www.hydraraptor.blogspot.com]
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 03, 2012 02:04PM
Thanks nopehead that fixed this err ... now on to dozens others ... oh well.
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 04, 2012 04:02AM
Yeah OK ... this is way over my c/c++, maybe you can have look some time Repetier.

Cheers.
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 04, 2012 04:28AM
UPDATE: It compiles !
I'll try uploading it and if it works do a diff on it to show my changes related to master.
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 04, 2012 04:48AM
Attached are the changes I needed to make for a clean compile without SD and LCD support (can't test those).
Attachments:
open | download - avr-libc-1.8.0-Repetier.patch (1.5 KB)
open | download - avr-libc-1.8.0-extruder.patch (2.3 KB)
open | download - avr-libc-1.8.0-ui.patch (329 bytes)
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 04, 2012 07:16AM
Sorry for looking so late. Had much to do. As I see you already finished your changes succesfully. Great work. Will put that into the next release.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Compiling Repetier-fw on newer AVR toolchains - avr-libc-1.8.0 in particular
March 04, 2012 08:20AM
Hey no worries good thing I have it working.
Sorry, only registered users may post in this forum.

Click here to login