View Full Version : [PATCH] usb_serial.c fix for gcc const PROGMEM requirement

12-01-2012, 09:22 PM
I'm running avr-gcc (GCC) 4.7.0 and found that usb_serial.c version 1.1 from http://www.pjrc.com/teensy/usb_serial.html no longer compiles with the following error,
error: variable 'device_descriptor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

It seems reasonable, to require const since the program can't modify it, so here's an updated usb_serial.c and diff.

On a side note, it seems strange that a forum for microcontroller programming and support doesn't allow the .c .cc .cpp .h .diff .gz and like file extensions.

12-03-2012, 07:43 PM
Why not post it on pastebin and link? Easier to view.

01-31-2014, 04:52 PM
I had to do the same fix to Blinky Example Source Code from http://www.pjrc.com/teensy/gcc.html on Debian GNU/Linux.