Skip to content

Assembler compile error #302

Closed
Closed

Description

@NicoHood

I got a weird assembler error, with a special function. I reduced the sketch to this (only to get the error, the function itself does not make sense like this):

#include "FastLED.h"
#define NUM_LEDS    25
CRGB leds[NUM_LEDS]; // Define the array of leds

void setup() {}

void loop() {
  heartbeat(leds, sizeof(leds) / 3, CRGB::Green);
}

void heartbeat(CRGB l[], uint16_t length, CRGB color) {
  for (uint16_t i = 0; i < 256; i++) {
    for (uint16_t led = 0; led < length; led++) {
      l[led] = color;
      l[led].nscale8_video(cos8(i + 128));
    }
  }
}

I guess some inline assembler misses that a special instruction requires an upper register (as the error already sais). This happens with 328 and 32u4 (didnt test the rest). Using latest IDE from git.

In file included from /tmp/arduino_modified_sketch_438581/sketch_may05a.ino:2:0:
/home/linuxuser/Documents/Arduino/sketchbook/libraries/FastLED/FastLED.h:12:2: warning: #warning FastLED version 3.001.001 (Not really a warning, just telling you here.) [-Wcpp]
 #warning FastLED version 3.001.001  (Not really a warning, just telling you here.)
  ^
/tmp/ccyvcv0T.s: Assembler messages:
/tmp/ccyvcv0T.s:195: Error: register number above 15 required
/tmp/ccyvcv0T.s:197: Error: register number above 15 required
Using library FastLED at version 3.1.1 in folder: /home/linuxuser/Documents/Arduino/sketchbook/libraries/FastLED 
exit status 1
Error compiling for board Arduino/Genuino Uno.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions