Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <dgarcia@dgarcia.net>2019-08-13 04:39:58 +0300
committerDaniel Garcia <dgarcia@dgarcia.net>2019-08-13 04:39:58 +0300
commit1a40bd20209d12d89ed436459665494484f20b71 (patch)
treedd3a3ace6771f99184dd4206ee4a84a6c8e61279
parent526f7f5eaca5310225dd10b5a9b2fd3b40ed5f02 (diff)
Wiring parallel clockless support for the Teensy 4 into FastLED.addLeds - updaitng parallel output example - time to merge back to master\!teensy4
-rw-r--r--FastLED.h8
-rw-r--r--examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino15
-rw-r--r--platforms/arm/mxrt1062/block_clockless_arm_mxrt1062.h6
3 files changed, 25 insertions, 4 deletions
diff --git a/FastLED.h b/FastLED.h
index b4302662..3903eaa6 100644
--- a/FastLED.h
+++ b/FastLED.h
@@ -315,6 +315,14 @@ public:
return addLeds(&c, data, nLedsOrOffset, nLedsIfOffset);
}
+#if defined(__FASTLED_HAS_FIBCC) && (__FASTLED_HAS_FIBCC == 1)
+ template<uint8_t NUM_LANES, template<uint8_t DATA_PIN, EOrder RGB_ORDER> class CHIPSET, uint8_t DATA_PIN, EOrder RGB_ORDER=RGB>
+ static CLEDController &addLeds(struct CRGB *data, int nLeds) {
+ static __FIBCC<CHIPSET, DATA_PIN, NUM_LANES, RGB_ORDER> c;
+ return addLeds(&c, data, nLeds);
+ }
+#endif
+
#ifdef FASTSPI_USE_DMX_SIMPLE
template<EClocklessChipsets CHIPSET, uint8_t DATA_PIN, EOrder RGB_ORDER=RGB>
static CLEDController &addLeds(struct CRGB *data, int nLedsOrOffset, int nLedsIfOffset = 0)
diff --git a/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino b/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino
index fc7c9e77..8c447b54 100644
--- a/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino
+++ b/examples/Multiple/ParallelOutputDemo/ParallelOutputDemo.ino
@@ -1,6 +1,6 @@
#include <FastLED.h>
-#define NUM_LEDS_PER_STRIP 64
+#define NUM_LEDS_PER_STRIP 16
// Note: this can be 12 if you're using a teensy 3 and don't mind soldering the pads on the back
#define NUM_STRIPS 16
@@ -17,15 +17,24 @@ CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
// WS2811_PORTD: 25,26,27,28,14,15,29,11
//
+
+// IBCC<WS2811, 1, 16> outputs;
+
void setup() {
+ delay(5000);
+ Serial.begin(57600);
+ Serial.println("Starting...");
// LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
// LEDS.addLeds<WS2811_PORTB,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
// LEDS.addLeds<WS2811_PORTD,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP).setCorrection(TypicalLEDStrip);
LEDS.addLeds<WS2811_PORTDC,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);
- LEDS.setBrightness(32);
+
+ // Teensy 4 parallel output example
+ // LEDS.addLeds<NUM_STRIPS, WS2811, 1>(leds,NUM_LEDS_PER_STRIP);
}
void loop() {
+ Serial.println("Loop....");
static uint8_t hue = 0;
for(int i = 0; i < NUM_STRIPS; i++) {
for(int j = 0; j < NUM_LEDS_PER_STRIP; j++) {
@@ -43,5 +52,5 @@ void loop() {
hue++;
LEDS.show();
- LEDS.delay(10);
+ // LEDS.delay(100);
}
diff --git a/platforms/arm/mxrt1062/block_clockless_arm_mxrt1062.h b/platforms/arm/mxrt1062/block_clockless_arm_mxrt1062.h
index 6655ca79..5ee22458 100644
--- a/platforms/arm/mxrt1062/block_clockless_arm_mxrt1062.h
+++ b/platforms/arm/mxrt1062/block_clockless_arm_mxrt1062.h
@@ -9,7 +9,7 @@ FASTLED_NAMESPACE_BEGIN
#define __FL_T4_MASK ((1<<(LANES))-1)
template <uint8_t LANES, int FIRST_PIN, int T1, int T2, int T3, EOrder RGB_ORDER = GRB, int XTRA0 = 0, bool FLIP = false, int WAIT_TIME = 50>
-class InlineBlockClocklessController : public CPixelLEDController<RGB_ORDER, LANES, __FL_T4_MASK> {
+class FlexibleInlineBlockClocklessController : public CPixelLEDController<RGB_ORDER, LANES, __FL_T4_MASK> {
uint8_t m_bitOffsets[16];
uint8_t m_nActualLanes;
@@ -202,6 +202,10 @@ public:
}
};
+template<template<uint8_t DATA_PIN, EOrder RGB_ORDER> class CHIPSET, uint8_t DATA_PIN, int NUM_LANES, EOrder RGB_ORDER=GRB>
+class __FIBCC : public FlexibleInlineBlockClocklessController<NUM_LANES,DATA_PIN,CHIPSET<DATA_PIN,RGB_ORDER>::__T1(),CHIPSET<DATA_PIN,RGB_ORDER>::__T2(),CHIPSET<DATA_PIN,RGB_ORDER>::__T3(),RGB_ORDER,CHIPSET<DATA_PIN,RGB_ORDER>::__XTRA0(),CHIPSET<DATA_PIN,RGB_ORDER>::__FLIP(),CHIPSET<DATA_PIN,RGB_ORDER>::__WAIT_TIME()> {};
+
+#define __FASTLED_HAS_FIBCC 1
#endif //defined(FASTLED_TEENSY4)
FASTLED_NAMESPACE_END