diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | bitswap.h | 2 | ||||
-rw-r--r-- | chipsets.h | 1 | ||||
-rw-r--r-- | color.h | 2 | ||||
-rw-r--r-- | colorpalettes.h | 1 | ||||
-rw-r--r-- | colorutils.h | 1 | ||||
-rw-r--r-- | controller.h | 1 | ||||
-rw-r--r-- | cpp_compat.h | 2 | ||||
-rw-r--r-- | dmx.h | 1 | ||||
-rw-r--r-- | fastled_config.h | 2 | ||||
-rw-r--r-- | fastled_delay.h | 2 | ||||
-rw-r--r-- | fastled_progmem.h | 2 | ||||
-rw-r--r-- | fastpin.h | 2 | ||||
-rw-r--r-- | fastspi.h | 2 | ||||
-rw-r--r-- | fastspi_bitbang.h | 2 | ||||
-rw-r--r-- | fastspi_nop.h | 5 | ||||
-rw-r--r-- | fastspi_ref.h | 6 | ||||
-rw-r--r-- | fastspi_types.h | 2 | ||||
-rw-r--r-- | hsv2rgb.h | 2 | ||||
-rw-r--r-- | led_sysdefs.h | 2 | ||||
-rw-r--r-- | lib8tion.h | 8 | ||||
-rw-r--r-- | noise.cpp | 4 | ||||
-rw-r--r-- | noise.h | 4 | ||||
-rw-r--r-- | pixelset.h | 21 | ||||
-rw-r--r-- | pixeltypes.h | 2 | ||||
-rw-r--r-- | platforms.h | 2 | ||||
-rw-r--r-- | power_mgt.h | 2 |
27 files changed, 70 insertions, 16 deletions
@@ -1,6 +1,7 @@ [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/FastLED/public) -IMPORTANT NOTE: For AVR based systems, avr-gcc 4.8.x is supported, as is avr-gcc 4.3 and earlier. There are known issues with avr-gcc 4.7 and timing based chipsets like the WS2812B. If you are using a linux system make sure you are using avr-gcc 4.8.x not avr-gcc 4.7.x. +IMPORTANT NOTE: For AVR based systems, avr-gcc 4.8.x is supported and tested. This means Arduino 1.6.5 and later. + FastLED 3.1 =========== @@ -1,6 +1,8 @@ #ifndef __INC_BITSWAP_H #define __INC_BITSWAP_H +#include "FastLED.h" + FASTLED_NAMESPACE_BEGIN ///@file bitswap.h @@ -1,6 +1,7 @@ #ifndef __INC_CHIPSETS_H #define __INC_CHIPSETS_H +#include "FastLED.h" #include "pixeltypes.h" ///@file chipsets.h @@ -1,6 +1,8 @@ #ifndef __INC_COLOR_H #define __INC_COLOR_H +#include "FastLED.h" + FASTLED_NAMESPACE_BEGIN ///@file color.h diff --git a/colorpalettes.h b/colorpalettes.h index 97f0cb5d..4458575e 100644 --- a/colorpalettes.h +++ b/colorpalettes.h @@ -1,6 +1,7 @@ #ifndef __INC_COLORPALETTES_H #define __INC_COLORPALETTES_H +#include "FastLED.h" #include "colorutils.h" ///@file colorpalettes.h diff --git a/colorutils.h b/colorutils.h index f27e0f4c..87bfce5d 100644 --- a/colorutils.h +++ b/colorutils.h @@ -4,6 +4,7 @@ ///@file colorutils.h /// functions for color fill, paletters, blending, and more +#include "FastLED.h" #include "pixeltypes.h" #include "fastled_progmem.h" diff --git a/controller.h b/controller.h index e0e86422..3df29ee7 100644 --- a/controller.h +++ b/controller.h @@ -4,6 +4,7 @@ ///@file controller.h /// base definitions used by led controllers for writing out led data +#include "FastLED.h" #include "led_sysdefs.h" #include "pixeltypes.h" #include "color.h" diff --git a/cpp_compat.h b/cpp_compat.h index 94674170..ab5b773a 100644 --- a/cpp_compat.h +++ b/cpp_compat.h @@ -1,6 +1,8 @@ #ifndef __INC_CPP_COMPAT_H #define __INC_CPP_COMPAT_H +#include "FastLED.h" + #if __cplusplus <= 199711L #define static_assert(expression, message) @@ -1,6 +1,7 @@ #ifndef __INC_DMX_H #define __INC_DMX_H +#include "FastLED.h" #ifdef DmxSimple_h #include<DmxSimple.h> diff --git a/fastled_config.h b/fastled_config.h index 42023f53..2ddcef84 100644 --- a/fastled_config.h +++ b/fastled_config.h @@ -1,6 +1,8 @@ #ifndef __INC_FASTLED_CONFIG_H #define __INC_FASTLED_CONFIG_H +#include "FastLED.h" + ///@file fastled_config.h /// contains definitions that can be used to configure FastLED at compile time diff --git a/fastled_delay.h b/fastled_delay.h index 5df7609d..ca6b06ab 100644 --- a/fastled_delay.h +++ b/fastled_delay.h @@ -1,6 +1,8 @@ #ifndef __INC_FL_DELAY_H #define __INC_FL_DELAY_H +#include "FastLED.h" + ///@file fastled_delay.h ///Utility functions and classes for managing delaycycles diff --git a/fastled_progmem.h b/fastled_progmem.h index f7cedc02..342fe6eb 100644 --- a/fastled_progmem.h +++ b/fastled_progmem.h @@ -1,6 +1,8 @@ #ifndef __INC_FL_PROGMEM_H #define __INC_FL_PROGMEM_H +#include "FastLED.h" + ///@file fastled_progmem.h /// wrapper definitions to allow seamless use of PROGMEM in environmens that have it @@ -1,6 +1,8 @@ #ifndef __INC_FASTPIN_H #define __INC_FASTPIN_H +#include "FastLED.h" + #include "led_sysdefs.h" #pragma GCC diagnostic push @@ -1,6 +1,8 @@ #ifndef __INC_FASTSPI_H #define __INC_FASTSPI_H +#include "FastLED.h" + #include "controller.h" #include "lib8tion.h" diff --git a/fastspi_bitbang.h b/fastspi_bitbang.h index 65c2a5d8..d8530de6 100644 --- a/fastspi_bitbang.h +++ b/fastspi_bitbang.h @@ -1,6 +1,8 @@ #ifndef __INC_FASTSPI_BITBANG_H #define __INC_FASTSPI_BITBANG_H +#include "FastLED.h" + #include "fastled_delay.h" FASTLED_NAMESPACE_BEGIN diff --git a/fastspi_nop.h b/fastspi_nop.h index aa363394..5c5da010 100644 --- a/fastspi_nop.h +++ b/fastspi_nop.h @@ -1,6 +1,10 @@ #ifndef __INC_FASTSPI_NOP_H #define __INC_FASTSPI_NOP_H +#if 0 // Guard against the arduino ide idiotically including every header file + +#include "FastLED.h" + FASTLED_NAMESPACE_BEGIN /// A nop/stub class, mostly to show the SPI methods that are needed/used by the various SPI chipset implementations. Should @@ -57,3 +61,4 @@ public: FASTLED_NAMESPACE_END #endif +#endif diff --git a/fastspi_ref.h b/fastspi_ref.h index 157ea2e3..f68e63ef 100644 --- a/fastspi_ref.h +++ b/fastspi_ref.h @@ -1,6 +1,9 @@ #ifndef __INC_FASTSPI_ARM_SAM_H #define __INC_FASTSPI_ARM_SAM_H +#if 0 // guard against the arduino ide idiotically including every header file +#include "FastLED.h" + FASTLED_NAMESPACE_BEGIN // A skeletal implementation of hardware SPI support. Fill in the necessary code for init, waiting, and writing. The rest of @@ -87,3 +90,6 @@ public: FASTLED_NAMESPACE_END #endif + +#endif + diff --git a/fastspi_types.h b/fastspi_types.h index 955ac938..5510bba8 100644 --- a/fastspi_types.h +++ b/fastspi_types.h @@ -1,6 +1,8 @@ #ifndef __INC_FASTSPI_TYPES_H #define __INC_FASTSPI_TYPES_H +#include "FastLED.h" + FASTLED_NAMESPACE_BEGIN // Some helper macros for getting at mis-ordered byte values @@ -1,6 +1,8 @@ #ifndef __INC_HSV2RGB_H #define __INC_HSV2RGB_H +#include "FastLED.h" + #include "pixeltypes.h" FASTLED_NAMESPACE_BEGIN diff --git a/led_sysdefs.h b/led_sysdefs.h index bb5fd8ff..c6cecd52 100644 --- a/led_sysdefs.h +++ b/led_sysdefs.h @@ -1,6 +1,8 @@ #ifndef __INC_LED_SYSDEFS_H #define __INC_LED_SYSDEFS_H +#include "FastLED.h" + #include "fastled_config.h" #if defined(NRF51) || defined(__RFduino__) @@ -1,10 +1,12 @@ +#ifndef __INC_LIB8TION_H +#define __INC_LIB8TION_H + +#include "FastLED.h" + #ifndef __INC_LED_SYSDEFS_H #error WTH? led_sysdefs needs to be included first #endif -#ifndef __INC_LIB8TION_H -#define __INC_LIB8TION_H - FASTLED_NAMESPACE_BEGIN /* @@ -655,7 +655,7 @@ void fill_noise8(CRGB *leds, int num_leds, void fill_noise16(CRGB *leds, int num_leds, uint8_t octaves, uint16_t x, int scale, uint8_t hue_octaves, uint16_t hue_x, int hue_scale, - uint16_t time) { + uint16_t time, uint8_t hue_shift) { uint8_t V[num_leds]; uint8_t H[num_leds]; @@ -666,7 +666,7 @@ void fill_noise16(CRGB *leds, int num_leds, fill_raw_noise8(H,num_leds,hue_octaves,hue_x,hue_scale,time); for(int i = 0; i < num_leds; i++) { - leds[i] = CHSV(H[i],255,V[i]); + leds[i] = CHSV(H[i] + hue_shift,255,V[i]); } } @@ -1,6 +1,8 @@ #ifndef __INC_NOISE_H #define __INC_NOISE_H +#include "FastLED.h" + FASTLED_NAMESPACE_BEGIN ///@file noise.h @@ -81,7 +83,7 @@ void fill_noise8(CRGB *leds, int num_leds, void fill_noise16(CRGB *leds, int num_leds, uint8_t octaves, uint16_t x, int scale, uint8_t hue_octaves, uint16_t hue_x, int hue_scale, - uint16_t time); + uint16_t time, uint8_t hue_shift=0); void fill_2dnoise8(CRGB *leds, int width, int height, bool serpentine, uint8_t octaves, uint16_t x, int xscale, uint16_t y, int yscale, uint16_t time, uint8_t hue_octaves, uint16_t hue_x, int hue_xscale, uint16_t hue_y, uint16_t hue_yscale,uint16_t hue_time,bool blend); @@ -1,6 +1,8 @@ #ifndef __INC_PIXELSET_H #define __INC_PIXELSET_H +#include "FastLED.h" + /// Represents a set of CRGB led objects. Provides the [] array operator, and works like a normal array in that case. /// This should be kept in sync with the set of functions provided by CRGB as well as functions in colorutils. Note /// that a pixel set is a window into another set of led data, it is not its own set of led data. @@ -15,20 +17,20 @@ public: public: /// PixelSet copy constructor - inline CPixelView(const CPixelView & other) : leds(other.leds), len(other.len), dir(other.dir), end_pos(other.end_pos) {} + inline CPixelView(const CPixelView & other) : dir(other.dir), len(other.len), leds(other.leds), end_pos(other.end_pos) {} /// pixelset constructor for a pixel set starting at the given PIXEL_TYPE* and going for _len leds. Note that the length /// can be backwards, creating a PixelSet that walks backwards over the data /// @param leds point to the raw led data /// @param len how many leds in this set - inline CPixelView(PIXEL_TYPE *_leds, int _len) : leds(_leds), len(_len), dir(_len < 0 ? -1 : 1), end_pos(_leds + _len) {} + inline CPixelView(PIXEL_TYPE *_leds, int _len) : dir(_len < 0 ? -1 : 1), len(_len), leds(_leds), end_pos(_leds + _len) {} /// PixelSet constructor for the given set of leds, with start and end boundaries. Note that start can be after /// end, resulting in a set that will iterate backwards /// @param leds point to the raw led data /// @param start the start index of the leds for this array /// @param end the end index of the leds for this array - inline CPixelView(PIXEL_TYPE *_leds, int _start, int _end) : leds(_leds), dir(((_end-_start)<0) ? -1 : 1), len((_end - _start) + dir), end_pos(_leds + len) {} + inline CPixelView(PIXEL_TYPE *_leds, int _start, int _end) : dir(((_end-_start)<0) ? -1 : 1), len((_end - _start) + dir), leds(_leds + _start), end_pos(_leds + _start + len) {} /// Get the size of this set /// @return the size of the set @@ -51,7 +53,7 @@ public: /// result in a reverse ordering for many functions (useful for mirroring) /// @param start the first element from this set for the new subset /// @param end the last element for the new subset - inline CPixelView operator()(int start, int end) { return CPixelView(leds+start, start, end); } + inline CPixelView operator()(int start, int end) { return CPixelView(leds, start, end); } /// Access an inclusive subset of the leds in this set, starting from the first. /// @param end the last element for the new subset @@ -71,11 +73,12 @@ public: } - // void dump() const { - // Serial.print("len: "); Serial.print(len); Serial.print(", dir:"); Serial.print((int)dir); - // Serial.print(", range:"); Serial.print((uint32_t)leds); Serial.print("-"); Serial.print((uint32_t)end_pos); - // Serial.print(", diff:"); Serial.print((int32_t)(end_pos - leds)); - // } + void dump() const { + Serial.print("len: "); Serial.print(len); Serial.print(", dir:"); Serial.print((int)dir); + Serial.print(", range:"); Serial.print((uint32_t)leds); Serial.print("-"); Serial.print((uint32_t)end_pos); + Serial.print(", diff:"); Serial.print((int32_t)(end_pos - leds)); + Serial.println(""); + } /// Copy the contents of the passed in set to our set. Note if one set is smaller than the other, only the /// smallest number of items will be copied over. diff --git a/pixeltypes.h b/pixeltypes.h index 8ff9120b..89225ae1 100644 --- a/pixeltypes.h +++ b/pixeltypes.h @@ -1,6 +1,8 @@ #ifndef __INC_PIXELS_H #define __INC_PIXELS_H +#include "FastLED.h" + #include <stdint.h> #include "lib8tion.h" #include "color.h" diff --git a/platforms.h b/platforms.h index 4f5d7ee6..c36b016c 100644 --- a/platforms.h +++ b/platforms.h @@ -1,6 +1,8 @@ #ifndef __INC_PLATFORMS_H #define __INC_PLATFORMS_H +#include "FastLED.h" + #include "fastled_config.h" #if defined(NRF51) diff --git a/power_mgt.h b/power_mgt.h index 9ff6f208..5d0ec61c 100644 --- a/power_mgt.h +++ b/power_mgt.h @@ -1,6 +1,8 @@ #ifndef POWER_MGT_H #define POWER_MGT_H +#include "FastLED.h" + #include "pixeltypes.h" FASTLED_NAMESPACE_BEGIN |