Permalink
Browse files

Arduion 1.6.6 and later, when you Include a library from the Sketch m…

…enu, will include _every_ header file - instead of just the library's main header file. Guard against that particular [REDACTED].
  • Loading branch information...
focalintent committed Dec 26, 2015
1 parent fc0d6b8 commit 39b75cc0d01d94503b200f520bf8af12860a2606
Showing with 70 additions and 16 deletions.
  1. +2 −1 README.md
  2. +2 −0 bitswap.h
  3. +1 −0 chipsets.h
  4. +2 −0 color.h
  5. +1 −0 colorpalettes.h
  6. +1 −0 colorutils.h
  7. +1 −0 controller.h
  8. +2 −0 cpp_compat.h
  9. +1 −0 dmx.h
  10. +2 −0 fastled_config.h
  11. +2 −0 fastled_delay.h
  12. +2 −0 fastled_progmem.h
  13. +2 −0 fastpin.h
  14. +2 −0 fastspi.h
  15. +2 −0 fastspi_bitbang.h
  16. +5 −0 fastspi_nop.h
  17. +6 −0 fastspi_ref.h
  18. +2 −0 fastspi_types.h
  19. +2 −0 hsv2rgb.h
  20. +2 −0 led_sysdefs.h
  21. +5 −3 lib8tion.h
  22. +2 −2 noise.cpp
  23. +3 −1 noise.h
  24. +12 −9 pixelset.h
  25. +2 −0 pixeltypes.h
  26. +2 −0 platforms.h
  27. +2 −0 power_mgt.h
View
@@ -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
===========
View
@@ -1,6 +1,8 @@
#ifndef __INC_BITSWAP_H
#define __INC_BITSWAP_H
+#include "FastLED.h"
+
FASTLED_NAMESPACE_BEGIN
///@file bitswap.h
View
@@ -1,6 +1,7 @@
#ifndef __INC_CHIPSETS_H
#define __INC_CHIPSETS_H
+#include "FastLED.h"
#include "pixeltypes.h"
///@file chipsets.h
View
@@ -1,6 +1,8 @@
#ifndef __INC_COLOR_H
#define __INC_COLOR_H
+#include "FastLED.h"
+
FASTLED_NAMESPACE_BEGIN
///@file color.h
View
@@ -1,6 +1,7 @@
#ifndef __INC_COLORPALETTES_H
#define __INC_COLORPALETTES_H
+#include "FastLED.h"
#include "colorutils.h"
///@file colorpalettes.h
View
@@ -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"
View
@@ -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"
View
@@ -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)
View
1 dmx.h
@@ -1,6 +1,7 @@
#ifndef __INC_DMX_H
#define __INC_DMX_H
+#include "FastLED.h"
#ifdef DmxSimple_h
#include<DmxSimple.h>
View
@@ -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
View
@@ -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
View
@@ -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
View
@@ -1,6 +1,8 @@
#ifndef __INC_FASTPIN_H
#define __INC_FASTPIN_H
+#include "FastLED.h"
+
#include "led_sysdefs.h"
#pragma GCC diagnostic push
View
@@ -1,6 +1,8 @@
#ifndef __INC_FASTSPI_H
#define __INC_FASTSPI_H
+#include "FastLED.h"
+
#include "controller.h"
#include "lib8tion.h"
View
@@ -1,6 +1,8 @@
#ifndef __INC_FASTSPI_BITBANG_H
#define __INC_FASTSPI_BITBANG_H
+#include "FastLED.h"
+
#include "fastled_delay.h"
FASTLED_NAMESPACE_BEGIN
View
@@ -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 @@ class NOPSPIOutput {
FASTLED_NAMESPACE_END
#endif
+#endif
View
@@ -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 @@ class REFHardwareSPIOutput {
FASTLED_NAMESPACE_END
#endif
+
+#endif
+
View
@@ -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
View
@@ -1,6 +1,8 @@
#ifndef __INC_HSV2RGB_H
#define __INC_HSV2RGB_H
+#include "FastLED.h"
+
#include "pixeltypes.h"
FASTLED_NAMESPACE_BEGIN
View
@@ -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__)
View
@@ -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
/*
View
@@ -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]);
}
}
View
@@ -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);
View
@@ -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 @@ class CPixelView {
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 @@ class CPixelView {
/// 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 @@ class CPixelView {
}
- // 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.
View
@@ -1,6 +1,8 @@
#ifndef __INC_PIXELS_H
#define __INC_PIXELS_H
+#include "FastLED.h"
+
#include <stdint.h>
#include "lib8tion.h"
#include "color.h"
View
@@ -1,6 +1,8 @@
#ifndef __INC_PLATFORMS_H
#define __INC_PLATFORMS_H
+#include "FastLED.h"
+
#include "fastled_config.h"
#if defined(NRF51)
View
@@ -1,6 +1,8 @@
#ifndef POWER_MGT_H
#define POWER_MGT_H
+#include "FastLED.h"
+
#include "pixeltypes.h"
FASTLED_NAMESPACE_BEGIN

0 comments on commit 39b75cc

Please sign in to comment.