Pouziti nove tridy pro rizeni preruseni (soucast ESPFoundation Gen2)

This commit is contained in:
Pavel Brychta 2023-07-25 17:51:49 +02:00
parent 13d2b01e5c
commit 237b871a56
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
// Ovladani signalizacni chytre LED diody // Ovladani signalizacni chytre LED diody
#include "WSLed.hpp" #include "WSLed.hpp"
#include <Interrupts.hpp>
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)
// # include "esp_task.h" // # include "esp_task.h"
// https://github.com/JSchaenzle/ESP32-NeoPixel-WS2812-RMT/blob/master/ws2812_control.c // 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)); 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 mEndTime = micros() + 100; // TODO: unfortunately this time is not valid for ESP32 using RMT peripheral
#else #else
noInterrupts(); IntCtrl.disable();
#if defined(WSLED_PL9823) #if defined(WSLED_PL9823)
espShow(mPin, color, 1 * 3, false); espShow(mPin, color, 1 * 3, false);
#else #else
espShow(mPin, color, 1 * 3, true); espShow(mPin, color, 1 * 3, true);
#endif #endif
interrupts(); IntCtrl.enable();
mEndTime = micros(); mEndTime = micros();
#endif #endif
} }

View File

@ -148,7 +148,7 @@ class wsLED {
void show(); void show();
void setColor(const LEDRGB & color); void setColor(const LEDRGB & color);
bool canShow() const; [[nodiscard]] bool canShow() const;
public: public:
wsLED(int pin, int order = RGB); wsLED(int pin, int order = RGB);