Skip to content

Commit

Permalink
HUB75 live preview
Browse files Browse the repository at this point in the history
  • Loading branch information
softhack007 committed Aug 8, 2024
1 parent f8154a8 commit 56e72ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wled00/bus_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ BusHub75Matrix::BusHub75Matrix(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWh
else {
_valid = true;
display->clearScreen(); // initially clear the screen buffer
display->setBrightness8(127); // range is 0-255, 0 - 0%, 255 - 100%
_bri = 127;

if (_ledBuffer) free(_ledBuffer); // should not happen
if (_ledsDirty) free(_ledsDirty); // should not happen
Expand Down Expand Up @@ -781,13 +783,14 @@ void __attribute__((hot)) BusHub75Matrix::setPixelColor(uint16_t pix, uint32_t c
uint32_t BusHub75Matrix::getPixelColor(uint16_t pix) const {
if (!_valid || pix >= _len) return BLACK;
if (_ledBuffer)
return uint32_t(_ledBuffer[pix]) & 0x00FFFFFF;
return uint32_t(_ledBuffer[pix].scale8(_bri)) & 0x00FFFFFF; // scale8() is needed to mimic NeoPixelBus, which returns scaled-down colours
else
return BLACK;
}

void BusHub75Matrix::setBrightness(uint8_t b, bool immediate) {
this->display->setBrightness(b);
_bri = b;
}

void __attribute__((hot)) BusHub75Matrix::show(void) {
Expand Down

0 comments on commit 56e72ef

Please sign in to comment.