You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// duty cycle resolution (_depth) can be extracted from this formula: 1MHz > _frequency * 2^_depth
390
-
if (_frequency > 1760) _depth = 8;
391
-
elseif (_frequency > 880) _depth = 9;
392
-
else _depth = 10; // WLED_PWM_FREQ <= 880Hz
393
404
analogWriteRange((1<<_depth)-1);
394
405
analogWriteFreq(_frequency);
395
406
#else
396
407
_ledcStart = pinManager.allocateLedc(numPins);
397
408
if (_ledcStart == 255) { //no more free LEDC channels
398
409
deallocatePins(); return;
399
410
}
400
-
// duty cycle resolution (_depth) can be extracted from this formula: 80MHz > _frequency * 2^_depth
401
-
if (_frequency > 78124) _depth = 9;
402
-
elseif (_frequency > 39062) _depth = 10;
403
-
elseif (_frequency > 19531) _depth = 11;
404
-
else _depth = 12; // WLED_PWM_FREQ <= 19531Hz
405
411
#endif
406
412
407
413
for (unsigned i = 0; i < numPins; i++) {
@@ -419,7 +425,7 @@ BusPwm::BusPwm(BusConfig &bc)
419
425
}
420
426
_data = _pwmdata; // avoid malloc() and use stack
421
427
_valid = true;
422
-
DEBUG_PRINTF_P(PSTR("%successfully inited PWM strip with type %uand pins %u,%u,%u,%u,%u\n"), _valid?"S":"Uns", bc.type, _pins[0], _pins[1], _pins[2], _pins[3], _pins[4]);
428
+
DEBUG_PRINTF_P(PSTR("%successfully inited PWM strip with type %u, frequency %u, bit depth %u and pins %u,%u,%u,%u,%u\n"), _valid?"S":"Uns", bc.type, _frequency, _depth, _pins[0], _pins[1], _pins[2], _pins[3], _pins[4]);
423
429
}
424
430
425
431
voidBusPwm::setPixelColor(uint16_t pix, uint32_t c) {
0 commit comments