-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HUB75 support #3777
Open
netmindz
wants to merge
35
commits into
Aircoookie:0_15
Choose a base branch
from
netmindz:HUB75-AC
base: 0_15
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add HUB75 support #3777
Changes from 11 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
7ef84cf
Add HUB75 support
netmindz 7603b5a
Remove getMaxPixels
netmindz 755f91f
Remove referece to MM
netmindz 2bd1e81
Default to mrfaptastic pinout
netmindz 07a1588
Cleanup comments
netmindz 74f77a7
Merge branch 'bus-config' into HUB75-AC
netmindz ecd46f2
Swap to new way to have dynamic LED types list
netmindz aae9446
Add "old-style" changes to settings_led for hub75
netmindz e94943d
Assign proper type ID for Hub75
netmindz e066b50
hub75 - remove hard coded panel sizes
netmindz 78fb9dc
Cleanup mxconfig.chain_length
netmindz e185f2e
Hub75 compact pin defintion
netmindz f96acd6
Hub75 - Tweaks to webui
netmindz e0d78d5
Porting latest BusHub75Matrix from MoonModules - Mostly authored by F…
netmindz 21c582e
Porting latest BusHub75Matrix from MoonModules - Mostly authored by F…
netmindz ad402ad
Hub75 - Misc fixes - WiP
netmindz 23e578b
Swap BusHub75Matrix to use allocateMultiplePins
netmindz 382d7e8
Remove stray whitespace from xml.cpp
netmindz fc07397
cleanup hub75 comments
netmindz 713cbb8
Merge branch '0_15' into HUB75-AC
netmindz b7aba15
Always copy all the pin data
netmindz e111b6e
Hub75 - PIN_COUNT const
netmindz 8632a0a
Hub75 - use actual panel config values
netmindz 0a8d86c
Always copy all the pin data
netmindz 9a9c65a
Whitespace
netmindz fbeead0
Exclude hub75 from pin validdation for xml.cpp
netmindz e74eb7d
Move examples envs for hub75
netmindz 6ce6b95
Merge branch '0_15' into HUB75-AC
netmindz 5b86c67
Error for ESP8266 and hub75
netmindz 4276671
HUB75 - Remove hot from show
netmindz f7b8828
HUB75 - code formatting
netmindz c356846
HUB75 - fix hasRGB and missing override
netmindz 6f03854
HUB75 - add comments to example env
netmindz f1b9952
HUB75 - Support BGR color order
netmindz de8a366
HUB75 - lower color depth for larger panels
netmindz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#ifndef BusManager_h | ||
#define BusManager_h | ||
|
||
#ifdef WLED_ENABLE_HUB75MATRIX | ||
#include <ESP32-HUB75-MatrixPanel-I2S-DMA.h> | ||
#endif | ||
/* | ||
* Class for addressing various light types | ||
*/ | ||
|
@@ -140,6 +143,7 @@ class Bus { | |
static constexpr bool isOnOff(uint8_t type) { return (type == TYPE_ONOFF); } | ||
static constexpr bool isPWM(uint8_t type) { return (type >= TYPE_ANALOG_MIN && type <= TYPE_ANALOG_MAX); } | ||
static constexpr bool isVirtual(uint8_t type) { return (type >= TYPE_VIRTUAL_MIN && type <= TYPE_VIRTUAL_MAX); } | ||
static constexpr bool isHub75(uint8_t type) { return (type >= TYPE_HUB75MATRIX_MIN && type <= TYPE_HUB75MATRIX_MAX); } | ||
static constexpr bool is16bit(uint8_t type) { return type == TYPE_UCS8903 || type == TYPE_UCS8904 || type == TYPE_SM16825; } | ||
static constexpr int numPWMPins(uint8_t type) { return (type - 40); } | ||
|
||
|
@@ -310,6 +314,51 @@ class BusNetwork : public Bus { | |
bool _broadcastLock; | ||
}; | ||
|
||
#ifdef WLED_ENABLE_HUB75MATRIX | ||
class BusHub75Matrix : public Bus { | ||
public: | ||
BusHub75Matrix(BusConfig &bc); | ||
|
||
bool hasRGB() { return true; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't actually override as inline, bu that suggestion helped find and fix that bug |
||
bool hasWhite() { return false; } | ||
|
||
void setPixelColor(uint16_t pix, uint32_t c); | ||
|
||
void show() { | ||
if(mxconfig.double_buff) { | ||
display->flipDMABuffer(); // Show the back buffer, set currently output buffer to the back (i.e. no longer being sent to LED panels) | ||
display->clearScreen(); // Now clear the back-buffer | ||
} | ||
} | ||
|
||
void setBrightness(uint8_t b, bool immediate); | ||
|
||
uint8_t getPins(uint8_t* pinArray) { | ||
pinArray[0] = mxconfig.chain_length; | ||
return 1; | ||
} // Fake value due to keep finaliseInit happy | ||
|
||
void deallocatePins(); | ||
|
||
void cleanup() { | ||
deallocatePins(); | ||
delete display; | ||
_valid = false; | ||
} | ||
|
||
~BusHub75Matrix() { | ||
cleanup(); | ||
} | ||
|
||
static std::vector<LEDType> getLEDTypes(void); | ||
|
||
private: | ||
MatrixPanel_I2S_DMA *display = nullptr; | ||
HUB75_I2S_CFG mxconfig; | ||
uint8_t r, g, b, x, y; | ||
|
||
}; | ||
#endif | ||
|
||
//temporary struct for passing bus configuration to bus | ||
struct BusConfig { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will require this to be moved into sample file. I want platformio.ini clean and only used for default official builds.