Skip to content

Commit 0a08d4c

Browse files
committed
WiP on I2SClocklessLedDriver
1 parent 51f2774 commit 0a08d4c

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

platformio.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ lib_deps =
257257
#For ADS1115 sensor uncomment following
258258
; adafruit/Adafruit BusIO @ 1.13.2
259259
; adafruit/Adafruit ADS1X15 @ 2.4.0
260+
https://github.com/hpwit/I2SClocklessLedDriver.git#ef99706
260261

261262
extra_scripts = ${scripts_defaults.extra_scripts}
262263

wled00/bus_manager.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -480,23 +480,19 @@ void BusNetwork::cleanup() {
480480
// ***************************************************************************
481481

482482
BusI2SClocklessLedDriver::BusI2SClocklessLedDriver(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) {
483-
FastLED.addLeds(this->data, bc.count, bc.start);
484-
driver.initled((uint8_t*)leds,pins,NUMSTRIPS,NUM_LEDS_PER_STRIP,ORDER_GRB);
485-
driver.setBrightness(10);
486-
}
483+
driver.initled((uint8_t*)leds, bc.pins, 1, bc.count, ORDER_GRB);
484+
}
487485

488486
void BusI2SClocklessLedDriver::setPixelColor(uint16_t pix, uint32_t c) {
489-
this->leds[pix].r = R(c);
490-
this->leds[pix].g = G(c);
491-
this->leds[pix].b = B(c);
487+
this->driver.setPixel(pix, R(c), G(c), B(c));
492488
}
493489

494490
void BusI2SClocklessLedDriver::show() {
495-
FastLED.show();
491+
driver.showPixels();
496492
}
497493

498494
void BusI2SClocklessLedDriver::setBrightness(uint8_t b, bool immediate) {
499-
FastLED.setBrightness(b);
495+
driver.setBrightness(b);
500496
}
501497

502498
// ***************************************************************************

wled00/bus_manager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ class BusI2SClocklessLedDriver : public Bus {
362362
return _len;
363363
}
364364

365-
private:
365+
private:
366+
uint8_t leds[1024*3]; // TODO: dynamic
366367
I2SClocklessLedDriver driver;
367368
};
368369

0 commit comments

Comments
 (0)