Skip to content

Commit

Permalink
Merge pull request letscontrolit#4858 from tonhuisman/feature/NeoPixe…
Browse files Browse the repository at this point in the history
…l-replace-adafruit_neopixel-lib-by-neopixelbus

[NEOPIXEL] Add NeoPixelBus_wrapper and implement in NeoPixel plugins
  • Loading branch information
TD-er authored Nov 4, 2023
2 parents 7051079 + 1667456 commit c1938c3
Show file tree
Hide file tree
Showing 242 changed files with 7,765 additions and 18,152 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
sudo apt-get update
sudo apt install binutils build-essential libffi-dev libgit2-dev
pip3 install --upgrade pip
pip install wheel
pip install -r requirements.txt
platformio update
- name: Build and archive
Expand Down
7 changes: 3 additions & 4 deletions lib/Adafruit_NeoMatrix/Adafruit_NeoMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
*/

#include "gamma.h"
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#include "Adafruit_NeoMatrix.h"
#ifdef __AVR__
#include <avr/pgmspace.h>
#elif defined(ESP8266)
Expand All @@ -73,7 +72,7 @@
// Constructor for single matrix:
Adafruit_NeoMatrix::Adafruit_NeoMatrix(int w, int h, uint8_t pin,
uint8_t matrixType, neoPixelType ledType)
: Adafruit_GFX(w, h), Adafruit_NeoPixel(w * h, pin, ledType),
: Adafruit_GFX(w, h), NeoPixelBus_wrapper(w * h, pin, ledType),
type(matrixType), matrixWidth(w), matrixHeight(h), tilesX(0), tilesY(0),
remapFn(NULL) {}

Expand All @@ -82,7 +81,7 @@ Adafruit_NeoMatrix::Adafruit_NeoMatrix(uint8_t mW, uint8_t mH, uint8_t tX,
uint8_t tY, uint8_t pin,
uint8_t matrixType, neoPixelType ledType)
: Adafruit_GFX(mW * tX, mH * tY),
Adafruit_NeoPixel(mW * mH * tX * tY, pin, ledType), type(matrixType),
NeoPixelBus_wrapper(mW * mH * tX * tY, pin, ledType), type(matrixType),
matrixWidth(mW), matrixHeight(mH), tilesX(tX), tilesY(tY), remapFn(NULL) {
}

Expand Down
6 changes: 4 additions & 2 deletions lib/Adafruit_NeoMatrix/Adafruit_NeoMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#include <pins_arduino.h>
#endif
#include <Adafruit_GFX.h>
#include <Adafruit_NeoPixel.h>
#include <NeoPixelBus_wrapper.h>

// 2023-10-26 tonhuisman: Apply NeoPixelBus_wrapper as replacement for Adafruit_NeoPixel library

// Matrix layout information is passed in the 'matrixType' parameter for
// each constructor (the parameter immediately following is the LED type
Expand Down Expand Up @@ -79,7 +81,7 @@
/**
* @brief Class for using NeoPixel matrices with the GFX graphics library.
*/
class Adafruit_NeoMatrix : public Adafruit_GFX, public Adafruit_NeoPixel {
class Adafruit_NeoMatrix : public Adafruit_GFX, public NeoPixelBus_wrapper {

public:
/**
Expand Down
46 changes: 0 additions & 46 deletions lib/Adafruit_NeoPixel/.github/ISSUE_TEMPLATE.md

This file was deleted.

26 changes: 0 additions & 26 deletions lib/Adafruit_NeoPixel/.github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

29 changes: 0 additions & 29 deletions lib/Adafruit_NeoPixel/.github/workflows/githubci.yml

This file was deleted.

4 changes: 0 additions & 4 deletions lib/Adafruit_NeoPixel/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions lib/Adafruit_NeoPixel/.travis.yml

This file was deleted.

Loading

0 comments on commit c1938c3

Please sign in to comment.