From 237b871a561bc5b35bfb544a906fcdfda73a3f9a Mon Sep 17 00:00:00 2001 From: pablo2048 Date: Tue, 25 Jul 2023 17:51:49 +0200 Subject: [PATCH] Pouziti nove tridy pro rizeni preruseni (soucast ESPFoundation Gen2) --- src/WSLed.cpp | 5 +++-- src/WSLed.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WSLed.cpp b/src/WSLed.cpp index e69dd20..e277a62 100644 --- a/src/WSLed.cpp +++ b/src/WSLed.cpp @@ -1,5 +1,6 @@ // Ovladani signalizacni chytre LED diody #include "WSLed.hpp" +#include #if defined(ARDUINO_ARCH_ESP32) // # include "esp_task.h" // https://github.com/JSchaenzle/ESP32-NeoPixel-WS2812-RMT/blob/master/ws2812_control.c @@ -65,13 +66,13 @@ void wsLED::show() ESP_ERROR_CHECK(rmt_write_items(LED_RMT_TX_CHANNEL, led_data_buffer, LED_BUFFER_ITEMS, false)); mEndTime = micros() + 100; // TODO: unfortunately this time is not valid for ESP32 using RMT peripheral #else - noInterrupts(); + IntCtrl.disable(); #if defined(WSLED_PL9823) espShow(mPin, color, 1 * 3, false); #else espShow(mPin, color, 1 * 3, true); #endif - interrupts(); + IntCtrl.enable(); mEndTime = micros(); #endif } diff --git a/src/WSLed.hpp b/src/WSLed.hpp index 5696c1e..b4f7dfb 100644 --- a/src/WSLed.hpp +++ b/src/WSLed.hpp @@ -148,7 +148,7 @@ class wsLED { void show(); void setColor(const LEDRGB & color); - bool canShow() const; + [[nodiscard]] bool canShow() const; public: wsLED(int pin, int order = RGB);