Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: [PATCH] usb_serial.c fix for gcc const PROGMEM requirement

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    6

    Post [PATCH] usb_serial.c fix for gcc const PROGMEM requirement

    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.
    Attached Files Attached Files
    Last edited by SpacedOut; 12-01-2012 at 08:24 PM. Reason: sepcify where usb_serial.c came from

  2. #2
    Why not post it on pastebin and link? Easier to view.

  3. #3
    Junior Member Mneventh's Avatar
    Join Date
    Jan 2014
    Posts
    6
    I had to do the same fix to Blinky Example Source Code from http://www.pjrc.com/teensy/gcc.html on Debian GNU/Linux.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •