mirror of https://github.com/arendst/Tasmota.git
adjust neopixel busy time (#18723)
* adjust neopixel busy time * Adjust time for Berry
This commit is contained in:
parent
e05d75248e
commit
6fa22aae6b
|
@ -134,11 +134,15 @@ extern "C" {
|
||||||
if (s_sk6812_grbw) s_sk6812_grbw->Begin();
|
if (s_sk6812_grbw) s_sk6812_grbw->Begin();
|
||||||
break;
|
break;
|
||||||
case 2: // # 02 : show void -> void
|
case 2: // # 02 : show void -> void
|
||||||
if (s_ws2812_grb) s_ws2812_grb->Show();
|
{
|
||||||
if (s_sk6812_grbw) s_sk6812_grbw->Show();
|
uint32_t pixels_size; // number of bytes to push
|
||||||
|
if (s_ws2812_grb) { s_ws2812_grb->Show(); pixels_size = s_ws2812_grb->PixelsSize(); }
|
||||||
|
if (s_sk6812_grbw) { s_sk6812_grbw->Show(); pixels_size = s_ws2812_grb->PixelsSize(); }
|
||||||
|
|
||||||
// Wait for RMT/I2S to complete fixes distortion due to analogRead
|
// Wait for RMT/I2S to complete fixes distortion due to analogRead
|
||||||
// delay(5);
|
// 1ms is needed for 96 bytes
|
||||||
SystemBusyDelay(5); // Max 256 leds
|
SystemBusyDelay((pixels_size + 95) / 96);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 3: // # 03 : CanShow void -> bool
|
case 3: // # 03 : CanShow void -> bool
|
||||||
if (s_ws2812_grb) be_pushbool(vm, s_ws2812_grb->CanShow());
|
if (s_ws2812_grb) be_pushbool(vm, s_ws2812_grb->CanShow());
|
||||||
|
|
|
@ -218,7 +218,7 @@ void Ws2812LibStripShow(void) {
|
||||||
#if defined(USE_WS2812_DMA) || defined(USE_WS2812_RMT) || defined(USE_WS2812_I2S)
|
#if defined(USE_WS2812_DMA) || defined(USE_WS2812_RMT) || defined(USE_WS2812_I2S)
|
||||||
// Wait for DMA/RMT/I2S to complete fixes distortion due to analogRead
|
// Wait for DMA/RMT/I2S to complete fixes distortion due to analogRead
|
||||||
// delay((Settings->light_pixels >> 6) +1); // 256 / 64 = 4 +1 = 5
|
// delay((Settings->light_pixels >> 6) +1); // 256 / 64 = 4 +1 = 5
|
||||||
SystemBusyDelay((Settings->light_pixels >> 6) +1); // 256 / 64 = 4 +1 = 5
|
SystemBusyDelay( (Settings->light_pixels + 31) >> 5); // (256 + 32) / 32 = 8
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue