Skip to content

Commit d3374b1

Browse files
committed
add FastLED problematic sketch on samd
1 parent 28ab018 commit d3374b1

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/arduino.cc/builder/test/helper_tools_downloader.go

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func DownloadCoresAndToolsAndLibraries(t *testing.T) {
138138
Library{Name: "CapacitiveSensor", Version: "0.5.0", VersionInLibProperties: "0.5"},
139139
Library{Name: "Ethernet", Version: "1.1.1"},
140140
Library{Name: "Robot IR Remote", Version: "1.0.2"},
141+
Library{Name: "FastLED", Version: "3.1.0"},
141142
}
142143

143144
download(t, cores, boardsManagerCores, boardsManagerRedBearCores, tools, toolsMultipleVersions, boardsManagerTools, boardsManagerRFduinoTools, libraries)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "FastLED.h"
2+
3+
#define DATA_PIN 7
4+
#define CLK_PIN 6
5+
#define LED_TYPE APA102
6+
#define COLOR_ORDER GRB
7+
#define NUM_LEDS 79
8+
CRGB leds[NUM_LEDS];
9+
10+
#define BRIGHTNESS 96
11+
#define FRAMES_PER_SECOND 120
12+
void setup() {
13+
14+
FastLED.addLeds<LED_TYPE, DATA_PIN, CLK_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
15+
}
16+
17+
void loop() {
18+
19+
}
20+
21+
typedef void (*SimplePatternList[])();
22+
//SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };
23+
SimplePatternList gPatterns = {sinelon};
24+
25+
void sinelon()
26+
{
27+
}

src/arduino.cc/builder/test/try_build_of_problematic_sketch_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ func TestTryBuild035(t *testing.T) {
185185
tryBuild(t, "sketch_with_enum_class", "sketch_with_enum_class.ino")
186186
}
187187

188+
func TestTryBuild036(t *testing.T) {
189+
context := makeDefaultContext(t)
190+
context[constants.CTX_FQBN] = "arduino:samd:arduino_zero_native"
191+
tryBuildWithContext(t, context, "sketch11", "sketch_fastleds.ino")
192+
}
193+
188194
func makeDefaultContext(t *testing.T) map[string]interface{} {
189195
DownloadCoresAndToolsAndLibraries(t)
190196

0 commit comments

Comments
 (0)