Skip to content

Commit c317e91

Browse files
committed
build flag
1 parent c0d1f94 commit c317e91

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

.github/workflows/arduino_cron.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,61 @@ jobs:
100100
git clone --quiet https://github.com/pschatzmann/ESP32-A2DP /home/runner/Arduino/libraries/ESP32-A2DP
101101
git clone --quiet https://github.com/pschatzmann/arduino-audio-tools /home/runner/Arduino/libraries/arduino-audio-tools
102102
103+
- name: Configure build flags for FastLED
104+
run: |
105+
echo "Checking for FastLED usage in repository..."
106+
107+
# Check if any sketch uses FastLED
108+
USES_FASTLED=false
109+
110+
# Find all .ino files and check for FastLED usage
111+
while IFS= read -r sketch; do
112+
if grep -q "#include.*FastLED" "$sketch" 2>/dev/null || grep -q "include.*FastLED" "$sketch" 2>/dev/null; then
113+
echo "Found FastLED usage in: $sketch"
114+
USES_FASTLED=true
115+
break
116+
fi
117+
done < <(find . -name "*.ino" -type f)
118+
119+
# If FastLED is used, create platform.local.txt files for ALL platforms
120+
if [ "$USES_FASTLED" = true ]; then
121+
echo "FastLED detected in repository, applying compile flag fix for all platforms"
122+
123+
# Wait for Arduino CLI to be fully set up
124+
sleep 2
125+
126+
# Find all platform.txt files and create corresponding platform.local.txt
127+
if [ -d ~/.arduino15/packages ]; then
128+
find ~/.arduino15/packages -name platform.txt -type f | while read platform_file; do
129+
dir=$(dirname "$platform_file")
130+
echo "compiler.cpp.extra_flags=-DFASTLED_USE_COMPILE_TESTS=0" > "$dir/platform.local.txt"
131+
echo "Created platform.local.txt in $dir"
132+
done
133+
fi
134+
135+
# Also check for Arduino cores in other possible locations
136+
ARDUINO_DIRS=(
137+
"$HOME/.arduino15"
138+
"$HOME/Arduino"
139+
"/usr/local/share/arduino"
140+
"/usr/share/arduino"
141+
)
142+
143+
for arduino_dir in "${ARDUINO_DIRS[@]}"; do
144+
if [ -d "$arduino_dir/packages" ]; then
145+
find "$arduino_dir/packages" -name platform.txt -type f 2>/dev/null | while read platform_file; do
146+
dir=$(dirname "$platform_file")
147+
if [ ! -f "$dir/platform.local.txt" ]; then
148+
echo "compiler.cpp.extra_flags=-DFASTLED_USE_COMPILE_TESTS=0" > "$dir/platform.local.txt"
149+
echo "Created platform.local.txt in $dir"
150+
fi
151+
done
152+
fi
153+
done
154+
else
155+
echo "No FastLED usage detected in repository"
156+
fi
157+
103158
- name: test platforms
104159
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
105160

library.deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
depends=Adafruit SSD1305, Adafruit ILI9341, Adafruit BusIO, SD, Adafruit NeoPixel, Adafruit VS1053 Library, Adafruit BluefruitLE nRF51, Adafruit seesaw Library, Ethernet, Stepper, Adafruit IO Arduino, [email protected], Adafruit LiquidCrystal, Adafruit SoftServo, TinyWireM, Adafruit AM radio library, WaveHC, Adafruit LED Backpack Library, MAX31850 OneWire, Adafruit VC0706 Serial Camera Library, RTClib, Adafruit SleepyDog Library, Adafruit Thermal Printer Library, Adafruit Zero I2S Library, Adafruit EPD, Adafruit SSD1351 library, Adafruit FONA Library, Adafruit Motor Shield V2 Library, Adafruit NeoMatrix, Adafruit Soundboard library, Adafruit Circuit Playground, ArduinoJson, Adafruit TCS34725, Adafruit Pixie, Adafruit GPS Library, TinyGPS, WiFi101, Adafruit DotStar, Adafruit Si7021 Library, Adafruit WS2801 Library, Mouse, Keyboard, Time, IRremote, Adafruit LSM9DS0 Library, Adafruit Arcada Library, MIDIUSB, PubSubClient, Adafruit LIS2MDL, Adafruit NeoPXL8, Adafruit MCP23017 Arduino Library, Adafruit MLX90640, LiquidCrystal, Adafruit NeoTrellis M4 Library, RGB matrix Panel, Adafruit MLX90614 Library, Adafruit RGB LCD Shield Library, MAX6675 library, Adafruit MP3, Adafruit Keypad, Adafruit Arcada GifDecoder, Keypad, Neosegment, Encoder, Adafruit TiCoServo, Adafruit Trellis Library, FauxmoESP, Adafruit LSM303 Accel, Adafruit LSM303DLH Mag, Adafruit LSM303DLHC, CapacitiveSensor, Adafruit Zero PDM Library, Adafruit DMA neopixel library, elapsedMillis, DST RTC, Adafruit SHARP Memory Display, Adafruit SPIFlash, BSEC Software Library, WiiChuck, Adafruit DPS310, Adafruit AHTX0, RotaryEncoder, Adafruit MCP9808 Library, LSM303, Adafruit Protomatter, Adafruit IS31FL3741 Library, Sensirion I2C SCD4x, Adafruit TestBed, Bounce2, Adafruit AHRS, Adafruit DRV2605 Library, STM32duino VL53L4CD, PicoDVI - Adafruit Fork, Adafruit MMA8451 Library, Adafruit TSC2007, GFX Library for Arduino, Adafruit PyCamera Library, Adafruit ADG72x, Adafruit BNO055, Adafruit SHT4x Library, Adafruit VCNL4200 Library, Adafruit GC9A01A, Adafruit DVI HSTX, Adafruit TLV320 I2S
1+
depends=Adafruit SSD1305, Adafruit ILI9341, Adafruit BusIO, SD, Adafruit NeoPixel, Adafruit VS1053 Library, Adafruit BluefruitLE nRF51, Adafruit seesaw Library, Ethernet, Stepper, Adafruit IO Arduino, FastLED, Adafruit LiquidCrystal, Adafruit SoftServo, TinyWireM, Adafruit AM radio library, WaveHC, Adafruit LED Backpack Library, MAX31850 OneWire, Adafruit VC0706 Serial Camera Library, RTClib, Adafruit SleepyDog Library, Adafruit Thermal Printer Library, Adafruit Zero I2S Library, Adafruit EPD, Adafruit SSD1351 library, Adafruit FONA Library, Adafruit Motor Shield V2 Library, Adafruit NeoMatrix, Adafruit Soundboard library, Adafruit Circuit Playground, ArduinoJson, Adafruit TCS34725, Adafruit Pixie, Adafruit GPS Library, TinyGPS, WiFi101, Adafruit DotStar, Adafruit Si7021 Library, Adafruit WS2801 Library, Mouse, Keyboard, Time, IRremote, Adafruit LSM9DS0 Library, Adafruit Arcada Library, MIDIUSB, PubSubClient, Adafruit LIS2MDL, Adafruit NeoPXL8, Adafruit MCP23017 Arduino Library, Adafruit MLX90640, LiquidCrystal, Adafruit NeoTrellis M4 Library, RGB matrix Panel, Adafruit MLX90614 Library, Adafruit RGB LCD Shield Library, MAX6675 library, Adafruit MP3, Adafruit Keypad, Adafruit Arcada GifDecoder, Keypad, Neosegment, Encoder, Adafruit TiCoServo, Adafruit Trellis Library, FauxmoESP, Adafruit LSM303 Accel, Adafruit LSM303DLH Mag, Adafruit LSM303DLHC, CapacitiveSensor, Adafruit Zero PDM Library, Adafruit DMA neopixel library, elapsedMillis, DST RTC, Adafruit SHARP Memory Display, Adafruit SPIFlash, BSEC Software Library, WiiChuck, Adafruit DPS310, Adafruit AHTX0, RotaryEncoder, Adafruit MCP9808 Library, LSM303, Adafruit Protomatter, Adafruit IS31FL3741 Library, Sensirion I2C SCD4x, Adafruit TestBed, Bounce2, Adafruit AHRS, Adafruit DRV2605 Library, STM32duino VL53L4CD, PicoDVI - Adafruit Fork, Adafruit MMA8451 Library, Adafruit TSC2007, GFX Library for Arduino, Adafruit PyCamera Library, Adafruit ADG72x, Adafruit BNO055, Adafruit SHT4x Library, Adafruit VCNL4200 Library, Adafruit GC9A01A, Adafruit DVI HSTX, Adafruit TLV320 I2S

simple_strand_palettes/simple_strand_palettes.ino

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
//
33
// SPDX-License-Identifier: MIT
44

5-
#include "FastLED.h"
6-
5+
// Disable FastLED compile tests to avoid type conflicts
6+
// Force type definitions before FastLED include
7+
#include <FastLED.h>
8+
9+
// If for some reason you are hitting this then use a BUILD define
10+
// (not an include define) in your build flags section
11+
// '-DFASTLED_USE_COMPILE_TESTS=0'
12+
#ifdef FASTLED_USE_COMPILE_TESTS
13+
#define FASTLED_USE_COMPILE_TESTS 0
14+
#endif
715
// ColorWavesWithPalettes
816
// Animated shifting color waves, with several cross-fading color palettes.
917
// by Mark Kriegsman, August 2015

0 commit comments

Comments
 (0)