OctoWS2811: section attribute not allowed for 'displayMemory'

Status
Not open for further replies.

626Pilot

Active member
I think I may have found a bug in the Teensy Arduino IDE add-on.

I was working with the OctoWS2811 demo code on a Teensy++ 3.1. This is with Arduino 1.0.6 and the OctoWS2811 library, both downloaded last week.

Everything worked fine with the example sketch, but then when I tried to integrate the code into a proper class-based C++ program, I got this error: "section attribute not allowed for 'displayMemory'".

Code:
#include <Wire.h>
#include <SPI.h>
#include <EEPROM.h>
#include <Time.h>
#include <new.h>
#include <string.h>

#define NEOPIXEL_NUM_PIXELS 24

class blah {

  private:

    DMAMEM int displayMemory[NEOPIXEL_NUM_PIXELS * 6];
    int drawingMemory[NEOPIXEL_NUM_PIXELS * 6];

};

The same code compiles fine when placed in the global scope, but I need it to be in a class.

If I take out the DMAMEM it will compile, but of course it won't wind up in the right memory location for the DMA controller to access it.

I did some research. The usual comment is that it has something to do with PROGMEM. I'm not actually using PROGMEM in any of my code (flash strings, etc.) I also saw mention that this happens sometimes on non-Arduino boards that have Arduino IDE extensions (of which the Teensy is an example) and that something has to be patched by the developer (in this case, PJRC).

Not sure what I can do next. Thanks for any advice!
 
Well, I decided to resolve the issue by putting it in the global scope and passing it in from the initial setup() function. It's hackish and looks awfully ugly, but it does work.
 
Status
Not open for further replies.
Back
Top