From 3deb46d0aec569342efcc36b93d29279235da5fd Mon Sep 17 00:00:00 2001 From: Markus Kovero Date: Tue, 10 Sep 2024 23:08:05 +0300 Subject: [PATCH 1/9] Hd108 bare minimal for me (#838) --- examples/Hd108Test/Hd108Test.ino | 84 +++++++++++++++++++++ src/internal/features/DotStarLrgbFeatures.h | 9 ++- src/internal/features/DotStarRgbFeatures.h | 7 ++ src/internal/methods/Hd108GenericMethod.h | 2 +- 4 files changed, 100 insertions(+), 2 deletions(-) create mode 100755 examples/Hd108Test/Hd108Test.ino diff --git a/examples/Hd108Test/Hd108Test.ino b/examples/Hd108Test/Hd108Test.ino new file mode 100755 index 0000000..94e9965 --- /dev/null +++ b/examples/Hd108Test/Hd108Test.ino @@ -0,0 +1,84 @@ +// DotStarTest +// This example will cycle between showing four pixels as Red, Green, Blue, White +// and then showing those pixels as Black. +// +// There is serial output of the current state so you can confirm and follow along +// + +#include + +const uint16_t PixelCount = 4; // this example assumes 4 pixels, making it smaller will cause a failure + +// make sure to set this to the correct pins +const uint8_t DotClockPin = 9; +const uint8_t DotDataPin = 8; + +uint16_t colorSaturation=32768; + +// for software bit bang, with Rgb48Color +NeoPixelBus strip(PixelCount, DotClockPin, DotDataPin); + +// for hardware SPI (best performance but must use hardware pins) +//NeoPixelBus strip(PixelCount); + +// Rgbw64Color implementation +// NeoPixelBus strip(PixelCount, DotClockPin, DotDataPin); + +Rgb48Color red(colorSaturation, 0, 0); +Rgb48Color green(0, colorSaturation, 0); +Rgb48Color blue(0, 0, colorSaturation); +Rgb48Color white(colorSaturation); +Rgb48Color black(0); + +// for use with RGB DotStars when using the luminance/brightness global value +// note that its range is only 0 - 31 (31 is full bright) and +// also note that it is not useful for POV displays as it will cause more flicker +Rgbw64Color redL(colorSaturation, 0, 0, 31); // use white value to store luminance +Rgbw64Color greenL(0, colorSaturation, 0, 31); // use white value to store luminance +Rgbw64Color blueL(0, 0, colorSaturation, 31); // use white value to store luminance +Rgbw64Color whiteL(colorSaturation, colorSaturation, colorSaturation, colorSaturation / 8); // luminance is only 0-31 + +void setup() +{ + Serial.begin(115200); + while (!Serial); // wait for serial attach + + Serial.println(); + Serial.println("Initializing..."); + Serial.flush(); + + // this resets all the neopixels to an off state + strip.Begin(); + strip.ClearTo(black); + strip.Show(); + + Serial.println(); + Serial.println("Running..."); +} + +void loop() +{ + delay(5000); + + Serial.println("Colors R, G, B, W..."); + + // set the colors, + strip.SetPixelColor(0, red); + strip.SetPixelColor(1, green); + strip.SetPixelColor(2, blue); + strip.SetPixelColor(3, white); + strip.Show(); + + + delay(5000); + + Serial.println("Off ..."); + + // turn off the pixels + strip.SetPixelColor(0, black); + strip.SetPixelColor(1, black); + strip.SetPixelColor(2, black); + strip.SetPixelColor(3, black); + strip.Show(); + +} \ No newline at end of file diff --git a/src/internal/features/DotStarLrgbFeatures.h b/src/internal/features/DotStarLrgbFeatures.h index d70a203..a88dceb 100644 --- a/src/internal/features/DotStarLrgbFeatures.h +++ b/src/internal/features/DotStarLrgbFeatures.h @@ -73,4 +73,11 @@ class DotStarLbgr64Feature : { }; -typedef DotStarLbgr64Feature Hd108LbgrFeature; \ No newline at end of file +class DotStarLrgb64Feature : + public DotStarL4WordFeature, + public NeoElementsNoSettings +{ +}; + +typedef DotStarLbgr64Feature Hd108LbgrFeature; +typedef DotStarLrgb64Feature Hd108LrgbFeature; \ No newline at end of file diff --git a/src/internal/features/DotStarRgbFeatures.h b/src/internal/features/DotStarRgbFeatures.h index cf5513e..313ab74 100644 --- a/src/internal/features/DotStarRgbFeatures.h +++ b/src/internal/features/DotStarRgbFeatures.h @@ -74,4 +74,11 @@ class DotStarBgr48Feature : { }; +class DotStarRgb48Feature : + public DotStarX4WordFeature, + public NeoElementsNoSettings +{ +}; + typedef DotStarBgr48Feature Hd108BgrFeature; +typedef DotStarRgb48Feature Hd108RgbFeature; diff --git a/src/internal/methods/Hd108GenericMethod.h b/src/internal/methods/Hd108GenericMethod.h index 4556bbe..a1df987 100644 --- a/src/internal/methods/Hd108GenericMethod.h +++ b/src/internal/methods/Hd108GenericMethod.h @@ -78,7 +78,7 @@ public: void Update(bool) { - const uint8_t startFrame[4] = { 0x00 }; + const uint8_t startFrame[16] = { 0x00 }; const uint8_t endFrame[4] = { 0xff }; _wire.beginTransaction(); From 773613a1c59fa4a5a2c0b8daa89c00c5bbbba82e Mon Sep 17 00:00:00 2001 From: lolimpol Date: Sat, 14 Sep 2024 21:39:28 +0200 Subject: [PATCH 2/9] Update Tlc59711RgbFeatures.h (#839) --- src/internal/features/Tlc59711RgbFeatures.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/internal/features/Tlc59711RgbFeatures.h b/src/internal/features/Tlc59711RgbFeatures.h index aec9183..f3bfba9 100644 --- a/src/internal/features/Tlc59711RgbFeatures.h +++ b/src/internal/features/Tlc59711RgbFeatures.h @@ -161,14 +161,20 @@ private: }; -class Tlc59711RgbFeature : +class Tlc59711RgbFeature : // RGB only public Neo3WordFeature, public Tlc59711ElementsSettings { }; -class Tlc59711RgbwFeature : +class Tlc59711RgbwFeature : // RGB + warmer white public Neo4WordFeature, public Tlc59711ElementsSettings { }; + +class Tlc59711RgbwcFeature : // RGB + warmer white + cooler white in that order + public Neo5WordFeature, + public Tlc59711ElementsSettings +{ +}; From 67a79fe74efd414a2b03e09456187cde9d8881ef Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 21 Sep 2024 09:30:14 -0700 Subject: [PATCH 3/9] missing include (#844) --- src/internal/animations/NeoPixelAnimator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/internal/animations/NeoPixelAnimator.cpp b/src/internal/animations/NeoPixelAnimator.cpp index 446bc4a..1cbfba3 100644 --- a/src/internal/animations/NeoPixelAnimator.cpp +++ b/src/internal/animations/NeoPixelAnimator.cpp @@ -25,6 +25,7 @@ License along with NeoPixel. If not, see -------------------------------------------------------------------------*/ #include +#include "../NeoUtil.h" #include "NeoPixelAnimator.h" NeoPixelAnimator::NeoPixelAnimator(uint16_t countAnimations, uint16_t timeScale) : From bc9f1dbf59f843227133abc1a4b3b41f957604aa Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Mon, 23 Sep 2024 09:07:46 -0700 Subject: [PATCH 4/9] Fixed (#845) --- src/NeoPixelBus.h | 9 +++++++++ src/internal/methods/DotStarEsp32DmaSpiMethod.h | 5 +++++ src/internal/methods/DotStarGenericMethod.h | 5 +++++ src/internal/methods/Hd108GenericMethod.h | 5 +++++ src/internal/methods/Lpd6803GenericMethod.h | 5 +++++ src/internal/methods/Lpd8806GenericMethod.h | 5 +++++ src/internal/methods/Mbi6033GenericMethod.h | 5 +++++ src/internal/methods/NeoArmMethod.h | 5 +++++ src/internal/methods/NeoAvrMethod.h | 5 +++++ src/internal/methods/NeoEsp32I2sMethod.h | 5 +++++ src/internal/methods/NeoEsp32I2sXMethod.h | 5 +++++ src/internal/methods/NeoEsp32LcdXMethod.h | 5 +++++ src/internal/methods/NeoEsp32RmtMethod.h | 6 ++++++ src/internal/methods/NeoEsp8266DmaMethod.h | 5 +++++ src/internal/methods/NeoEsp8266I2sDmx512Method.h | 5 +++++ src/internal/methods/NeoEsp8266UartMethod.h | 16 ++++++++++++++++ src/internal/methods/NeoEspBitBangMethod.h | 5 +++++ src/internal/methods/NeoNrf52xMethod.h | 5 +++++ src/internal/methods/P9813GenericMethod.h | 5 +++++ src/internal/methods/PixieStreamMethod.h | 5 +++++ src/internal/methods/Rp2040/NeoRp2040x4Method.h | 6 ++++++ src/internal/methods/Sm16716GenericMethod.h | 5 +++++ src/internal/methods/Tlc5947GenericMethod.h | 5 +++++ src/internal/methods/Tlc59711GenericMethod.h | 5 +++++ src/internal/methods/Ws2801GenericMethod.h | 5 +++++ 25 files changed, 142 insertions(+) diff --git a/src/NeoPixelBus.h b/src/NeoPixelBus.h index 5e30714..61167d7 100644 --- a/src/NeoPixelBus.h +++ b/src/NeoPixelBus.h @@ -330,6 +330,15 @@ public: void SetPixelSettings(const typename T_COLOR_FEATURE::SettingsObject& settings) { T_COLOR_FEATURE::applySettings(_method.getData(), _method.getDataSize(), settings); + if (_method.SwapBuffers()) + { + // some methods have two internal buffers + // so need to swap so settings are stored in both copies + // + T_COLOR_FEATURE::applySettings(_method.getData(), _method.getDataSize(), settings); + // swap back to minimize inconsistencies + _method.SwapBuffers(); + } Dirty(); }; diff --git a/src/internal/methods/DotStarEsp32DmaSpiMethod.h b/src/internal/methods/DotStarEsp32DmaSpiMethod.h index 5ab5a77..f44e3cc 100644 --- a/src/internal/methods/DotStarEsp32DmaSpiMethod.h +++ b/src/internal/methods/DotStarEsp32DmaSpiMethod.h @@ -188,6 +188,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data + _sizeStartFrame; diff --git a/src/internal/methods/DotStarGenericMethod.h b/src/internal/methods/DotStarGenericMethod.h index 615d9ef..3f2f1c3 100644 --- a/src/internal/methods/DotStarGenericMethod.h +++ b/src/internal/methods/DotStarGenericMethod.h @@ -110,6 +110,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Hd108GenericMethod.h b/src/internal/methods/Hd108GenericMethod.h index a1df987..6b9cbe5 100644 --- a/src/internal/methods/Hd108GenericMethod.h +++ b/src/internal/methods/Hd108GenericMethod.h @@ -101,6 +101,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Lpd6803GenericMethod.h b/src/internal/methods/Lpd6803GenericMethod.h index 2e95e7e..a57dcee 100644 --- a/src/internal/methods/Lpd6803GenericMethod.h +++ b/src/internal/methods/Lpd6803GenericMethod.h @@ -106,6 +106,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Lpd8806GenericMethod.h b/src/internal/methods/Lpd8806GenericMethod.h index b28e575..757ed93 100644 --- a/src/internal/methods/Lpd8806GenericMethod.h +++ b/src/internal/methods/Lpd8806GenericMethod.h @@ -106,6 +106,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Mbi6033GenericMethod.h b/src/internal/methods/Mbi6033GenericMethod.h index eaddbca..5f66729 100644 --- a/src/internal/methods/Mbi6033GenericMethod.h +++ b/src/internal/methods/Mbi6033GenericMethod.h @@ -129,6 +129,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoArmMethod.h b/src/internal/methods/NeoArmMethod.h index dba4000..3b0b7e8 100644 --- a/src/internal/methods/NeoArmMethod.h +++ b/src/internal/methods/NeoArmMethod.h @@ -97,6 +97,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoAvrMethod.h b/src/internal/methods/NeoAvrMethod.h index fe8468a..53d471c 100644 --- a/src/internal/methods/NeoAvrMethod.h +++ b/src/internal/methods/NeoAvrMethod.h @@ -244,6 +244,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoEsp32I2sMethod.h b/src/internal/methods/NeoEsp32I2sMethod.h index f8d7e78..85aae16 100644 --- a/src/internal/methods/NeoEsp32I2sMethod.h +++ b/src/internal/methods/NeoEsp32I2sMethod.h @@ -282,6 +282,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoEsp32I2sXMethod.h b/src/internal/methods/NeoEsp32I2sXMethod.h index fd628fa..ecc304a 100644 --- a/src/internal/methods/NeoEsp32I2sXMethod.h +++ b/src/internal/methods/NeoEsp32I2sXMethod.h @@ -841,6 +841,11 @@ public: return true; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoEsp32LcdXMethod.h b/src/internal/methods/NeoEsp32LcdXMethod.h index b868b85..e6e98ac 100644 --- a/src/internal/methods/NeoEsp32LcdXMethod.h +++ b/src/internal/methods/NeoEsp32LcdXMethod.h @@ -654,6 +654,11 @@ public: return true; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoEsp32RmtMethod.h b/src/internal/methods/NeoEsp32RmtMethod.h index 8e6fdbf..208b1ac 100644 --- a/src/internal/methods/NeoEsp32RmtMethod.h +++ b/src/internal/methods/NeoEsp32RmtMethod.h @@ -651,6 +651,12 @@ public: return false; } + bool SwapBuffers() + { + std::swap(_dataSending, _dataEditing); + return true; + } + uint8_t* getData() const { return _dataEditing; diff --git a/src/internal/methods/NeoEsp8266DmaMethod.h b/src/internal/methods/NeoEsp8266DmaMethod.h index d372e1e..766426d 100644 --- a/src/internal/methods/NeoEsp8266DmaMethod.h +++ b/src/internal/methods/NeoEsp8266DmaMethod.h @@ -271,6 +271,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoEsp8266I2sDmx512Method.h b/src/internal/methods/NeoEsp8266I2sDmx512Method.h index a98e34d..9dc717d 100644 --- a/src/internal/methods/NeoEsp8266I2sDmx512Method.h +++ b/src/internal/methods/NeoEsp8266I2sDmx512Method.h @@ -213,6 +213,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data + T_SPEED::HeaderSize; diff --git a/src/internal/methods/NeoEsp8266UartMethod.h b/src/internal/methods/NeoEsp8266UartMethod.h index be3e7a3..48cd3ca 100644 --- a/src/internal/methods/NeoEsp8266UartMethod.h +++ b/src/internal/methods/NeoEsp8266UartMethod.h @@ -205,6 +205,11 @@ protected: ptr = const_cast(T_UARTCONTEXT::FillUartFifo(T_UARTFEATURE::Index, ptr, end)); } } + + bool SwapUartBuffers() + { + return false; + } }; // this template method class is used to glue uart feature and context for @@ -274,6 +279,12 @@ protected: std::swap(_dataSending, _data); } + bool SwapUartBuffers() + { + std::swap(_dataSending, _data); + return true; + } + private: T_UARTCONTEXT _context; @@ -420,6 +431,11 @@ public: return false; } + bool SwapBuffers() + { + return this->SwapUartBuffers(); + } + uint8_t* getData() const { return this->_data; diff --git a/src/internal/methods/NeoEspBitBangMethod.h b/src/internal/methods/NeoEspBitBangMethod.h index 6a70e65..c875891 100644 --- a/src/internal/methods/NeoEspBitBangMethod.h +++ b/src/internal/methods/NeoEspBitBangMethod.h @@ -262,6 +262,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/NeoNrf52xMethod.h b/src/internal/methods/NeoNrf52xMethod.h index 82a6ca4..d4f8bcc 100644 --- a/src/internal/methods/NeoNrf52xMethod.h +++ b/src/internal/methods/NeoNrf52xMethod.h @@ -429,6 +429,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/P9813GenericMethod.h b/src/internal/methods/P9813GenericMethod.h index b014e1e..43f454c 100644 --- a/src/internal/methods/P9813GenericMethod.h +++ b/src/internal/methods/P9813GenericMethod.h @@ -102,6 +102,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/PixieStreamMethod.h b/src/internal/methods/PixieStreamMethod.h index 3dd5368..8ad9b43 100644 --- a/src/internal/methods/PixieStreamMethod.h +++ b/src/internal/methods/PixieStreamMethod.h @@ -86,6 +86,11 @@ public: return true; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Rp2040/NeoRp2040x4Method.h b/src/internal/methods/Rp2040/NeoRp2040x4Method.h index a8ee727..8ba02fe 100644 --- a/src/internal/methods/Rp2040/NeoRp2040x4Method.h +++ b/src/internal/methods/Rp2040/NeoRp2040x4Method.h @@ -271,6 +271,12 @@ Serial.println(); return false; } + bool SwapBuffers() + { + std::swap(_dataSending, _dataEditing); + return true; + } + uint8_t* getData() const { return _dataEditing; diff --git a/src/internal/methods/Sm16716GenericMethod.h b/src/internal/methods/Sm16716GenericMethod.h index 065fb9c..6fa97fd 100644 --- a/src/internal/methods/Sm16716GenericMethod.h +++ b/src/internal/methods/Sm16716GenericMethod.h @@ -109,6 +109,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Tlc5947GenericMethod.h b/src/internal/methods/Tlc5947GenericMethod.h index 60aee68..caa713b 100644 --- a/src/internal/methods/Tlc5947GenericMethod.h +++ b/src/internal/methods/Tlc5947GenericMethod.h @@ -170,6 +170,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Tlc59711GenericMethod.h b/src/internal/methods/Tlc59711GenericMethod.h index 43f9525..68bde4b 100644 --- a/src/internal/methods/Tlc59711GenericMethod.h +++ b/src/internal/methods/Tlc59711GenericMethod.h @@ -157,6 +157,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; diff --git a/src/internal/methods/Ws2801GenericMethod.h b/src/internal/methods/Ws2801GenericMethod.h index ccb69a2..965fa60 100644 --- a/src/internal/methods/Ws2801GenericMethod.h +++ b/src/internal/methods/Ws2801GenericMethod.h @@ -108,6 +108,11 @@ public: return false; } + bool SwapBuffers() + { + return false; + } + uint8_t* getData() const { return _data; From b99c595084dc804cb805db9cfdb18c59723159b1 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Mon, 23 Sep 2024 13:13:40 -0700 Subject: [PATCH 5/9] inc version (#846) --- library.json | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 5e8d8b9..51b14b3 100644 --- a/library.json +++ b/library.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/Makuna/NeoPixelBus" }, - "version": "2.8.2", + "version": "2.8.3", "frameworks": "arduino", "platforms": "*", "dependencies": [ diff --git a/library.properties b/library.properties index 9d9c825..e2e0794 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=NeoPixelBus by Makuna -version=2.8.2 +version=2.8.3 author=Michael C. Miller (makuna@live.com) maintainer=Michael C. Miller (makuna@live.com) sentence=A library that makes controlling NeoPixels (WS2812x and many others) and DotStars (SK6812 and many others) easy. From 54b49bc3c40c57184f87ef00b3583a497537bf8c Mon Sep 17 00:00:00 2001 From: Dimitre Date: Tue, 24 Sep 2024 02:14:45 -0300 Subject: [PATCH 6/9] Support for Teensy 4.0 / 4.1 (#849) --- src/internal/methods/NeoArmMethod.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/internal/methods/NeoArmMethod.h b/src/internal/methods/NeoArmMethod.h index 3b0b7e8..017cedd 100644 --- a/src/internal/methods/NeoArmMethod.h +++ b/src/internal/methods/NeoArmMethod.h @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- NeoPixel library helper functions for ARM MCUs. -Teensy 3.0, 3.1, LC, Arduino Due +Teensy 3.0, 3.1, 3.5, 3.6, 4.0, 4.1, LC, Arduino Due Written by Michael C. Miller. Some work taken from the Adafruit NeoPixel library. @@ -124,8 +124,8 @@ private: uint8_t _pin; // output pin number }; -// Teensy 3.0 or 3.1 (3.2) or 3.5 or 3.6 -#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) +// Teensy +#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined (__IMXRT1062__) || defined (__IMXRT1052__) class NeoArmMk20dxSpeedProps800KbpsBase { @@ -204,10 +204,15 @@ public: uint8_t pix; uint8_t mask; - volatile uint8_t* set = portSetRegister(pin); - volatile uint8_t* clr = portClearRegister(pin); + volatile auto set = portSetRegister(pin); + volatile auto clr = portClearRegister(pin); uint32_t cyc; +#if defined(KINETIS) || defined(KINETISL) + uint8_t msk = 1; +#else + uint32_t msk = digitalPinToBitMask(pin); +#endif ARM_DEMCR |= ARM_DEMCR_TRCENA; ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA; @@ -221,7 +226,7 @@ public: while (ARM_DWT_CYCCNT - cyc < T_SPEEDPROPS::Cycles); cyc = ARM_DWT_CYCCNT; - *set = 1; + *set = msk; if (pix & mask) { while (ARM_DWT_CYCCNT - cyc < T_SPEEDPROPS::CyclesT1h); @@ -230,7 +235,7 @@ public: { while (ARM_DWT_CYCCNT - cyc < T_SPEEDPROPS::CyclesT0h); } - *clr = 1; + *clr = msk; } } } From 7c2a3437f76e23264d3dc9fe4bd925d9cdc73ab8 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Tue, 24 Sep 2024 15:54:17 -0300 Subject: [PATCH 7/9] typo fix: KINETISK (#850) --- src/internal/methods/NeoArmMethod.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/methods/NeoArmMethod.h b/src/internal/methods/NeoArmMethod.h index 017cedd..130aae4 100644 --- a/src/internal/methods/NeoArmMethod.h +++ b/src/internal/methods/NeoArmMethod.h @@ -208,7 +208,7 @@ public: volatile auto clr = portClearRegister(pin); uint32_t cyc; -#if defined(KINETIS) || defined(KINETISL) +#if defined(KINETISK) || defined(KINETISL) uint8_t msk = 1; #else uint32_t msk = digitalPinToBitMask(pin); From 16a1eb192384de6ec616490c179b6f4bf46e121a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 3 Dec 2024 10:29:59 -0500 Subject: [PATCH 8/9] fix (#864) --- src/internal/animations/NeoEase.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/internal/animations/NeoEase.h b/src/internal/animations/NeoEase.h index 7c8e171..7f040cf 100644 --- a/src/internal/animations/NeoEase.h +++ b/src/internal/animations/NeoEase.h @@ -211,9 +211,8 @@ public: } else { - return (-0.5f * (cos(PI * (unitValue-0.5f)) + 1.0f)); + return (-0.5f * cos(PI * (unitValue - 0.5f)) + 1.0f); } - } static float ExponentialIn(float unitValue) From 3dabc2ee829fe041a8c516b0c89b433e8066ee76 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 26 Dec 2024 20:04:36 -0500 Subject: [PATCH 9/9] STM32WLE5xx support (#867) --- src/internal/methods/NeoArmMethod.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/internal/methods/NeoArmMethod.h b/src/internal/methods/NeoArmMethod.h index 130aae4..2ea403b 100644 --- a/src/internal/methods/NeoArmMethod.h +++ b/src/internal/methods/NeoArmMethod.h @@ -560,7 +560,7 @@ typedef NeoArm400KbpsMethod NeoArmApa106Method; typedef NeoArmWs2805Method NeoArmWs2814Method; typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod; -#elif defined(ARDUINO_STM32_FEATHER) || defined(ARDUINO_ARCH_STM32L4) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32F1)// FEATHER WICED (120MHz) +#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_STM32_FEATHER) || defined(ARDUINO_ARCH_STM32L4) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32F1)// FEATHER WICED (120MHz) class NeoArmStm32SpeedProps800KbpsBase { @@ -705,7 +705,21 @@ public: volatile uint32_t* set = &(GPIO->BRR); volatile uint32_t* clr = &(GPIO->BSRR); +#elif defined(STM32WLE5xx) + const unsigned long GPIO_BASE_ADDR = 0x48000000UL; + const unsigned long GPIO_BASE_OFFSET = 0x00000400UL; + const uint32_t GPIO_NUMBER = 16; + + uint32_t pinMask = 1 << (pin % GPIO_NUMBER); + + GPIO_TypeDef* GPIO = reinterpret_cast(GPIO_BASE_ADDR + ((pin / GPIO_NUMBER) * GPIO_BASE_OFFSET)); + + volatile uint32_t* set = &(GPIO->BRR); + volatile uint32_t* clr = &(GPIO->BSRR); +#else +#error "SPECIFIC STM32 CHIP NOT ACCOUNTED FOR" #endif + for (;;) { if (p & bitMask)