forked from Makuna/NeoPixelBus
NEOPIXEBUS_NO_STL (#314)
This commit is contained in:
@ -53,7 +53,7 @@ NeoPixelAnimator animations(PixelCount, NEO_CENTISECONDS);
|
|||||||
// NEO_DECASECONDS 10000 // ~7.5 days, 10 second updates
|
// NEO_DECASECONDS 10000 // ~7.5 days, 10 second updates
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_AVR
|
#if defined(NEOPIXEBUS_NO_STL)
|
||||||
// for AVR, you need to manage the state due to lack of STL/compiler support
|
// for AVR, you need to manage the state due to lack of STL/compiler support
|
||||||
// for Esp8266 you can define the function using a lambda and state is created for you
|
// for Esp8266 you can define the function using a lambda and state is created for you
|
||||||
// see below for an example
|
// see below for an example
|
||||||
@ -158,7 +158,7 @@ void SetupAnimationSet()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_AVR
|
#if defined(NEOPIXEBUS_NO_STL)
|
||||||
// each animation starts with the color that was present
|
// each animation starts with the color that was present
|
||||||
animationState[pixel].StartingColor = originalColor;
|
animationState[pixel].StartingColor = originalColor;
|
||||||
// and ends with a random color
|
// and ends with a random color
|
||||||
|
@ -43,7 +43,7 @@ struct AnimationParam
|
|||||||
AnimationState state;
|
AnimationState state;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_AVR
|
#if defined(NEOPIXEBUS_NO_STL)
|
||||||
|
|
||||||
typedef void(*AnimUpdateCallback)(const AnimationParam& param);
|
typedef void(*AnimUpdateCallback)(const AnimationParam& param);
|
||||||
|
|
||||||
|
@ -27,6 +27,14 @@ License along with NeoPixel. If not, see
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
// some platforms do not come with STL or properly defined one, specifically functional
|
||||||
|
// if you see...
|
||||||
|
// undefined reference to `std::__throw_bad_function_call()'
|
||||||
|
// ...then that platform should be added here so NEOPIXEBUS_NO_STL gets defined
|
||||||
|
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR) || defined(STM32L432xx) || defined(STM32L476xx) || defined(ARDUINO_ARCH_SAM)
|
||||||
|
#define NEOPIXEBUS_NO_STL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// some platforms do not define this standard progmem type for some reason
|
// some platforms do not define this standard progmem type for some reason
|
||||||
//
|
//
|
||||||
#ifndef PGM_VOID_P
|
#ifndef PGM_VOID_P
|
||||||
@ -89,7 +97,7 @@ License along with NeoPixel. If not, see
|
|||||||
|
|
||||||
#include "internal/NeoArmMethod.h"
|
#include "internal/NeoArmMethod.h"
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARCH_AVR)
|
#elif defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)
|
||||||
|
|
||||||
#include "internal/NeoAvrMethod.h"
|
#include "internal/NeoAvrMethod.h"
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ License along with NeoPixel. If not, see
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_AVR
|
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ License along with NeoPixel. If not, see
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_AVR
|
#if defined(NEOPIXEBUS_NO_STL)
|
||||||
|
|
||||||
typedef uint16_t(*LayoutMapCallback)(int16_t x, int16_t y);
|
typedef uint16_t(*LayoutMapCallback)(int16_t x, int16_t y);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ License along with NeoPixel. If not, see
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef ARDUINO_ARCH_AVR
|
#if defined(NEOPIXEBUS_NO_STL)
|
||||||
|
|
||||||
typedef float(*AnimEaseFunction)(float unitValue);
|
typedef float(*AnimEaseFunction)(float unitValue);
|
||||||
|
|
||||||
|
@ -25,10 +25,7 @@ License along with NeoPixel. If not, see
|
|||||||
-------------------------------------------------------------------------*/
|
-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "RgbColor.h"
|
#include "NeoPixelBus.h"
|
||||||
#include "RgbwColor.h"
|
|
||||||
#include "NeoEase.h"
|
|
||||||
#include "NeoGamma.h"
|
|
||||||
|
|
||||||
const uint8_t NeoGammaTableMethod::_table[] = {
|
const uint8_t NeoGammaTableMethod::_table[] = {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
@ -24,6 +24,7 @@ License along with NeoPixel. If not, see
|
|||||||
<http://www.gnu.org/licenses/>.
|
<http://www.gnu.org/licenses/>.
|
||||||
-------------------------------------------------------------------------*/
|
-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "NeoPixelBus.h"
|
||||||
#include "NeoPixelAnimator.h"
|
#include "NeoPixelAnimator.h"
|
||||||
|
|
||||||
NeoPixelAnimator::NeoPixelAnimator(uint16_t countAnimations, uint16_t timeScale) :
|
NeoPixelAnimator::NeoPixelAnimator(uint16_t countAnimations, uint16_t timeScale) :
|
||||||
|
@ -34,7 +34,7 @@ License along with NeoPixel. If not, see
|
|||||||
-------------------------------------------------------------------------*/
|
-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// must also check for arm due to Teensy incorrectly having ARDUINO_ARCH_AVR set
|
// must also check for arm due to Teensy incorrectly having ARDUINO_ARCH_AVR set
|
||||||
#if defined(ARDUINO_ARCH_AVR) && !defined(__arm__)
|
#if (defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)) && !defined(__arm__)
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user