diff --git a/src/internal/NeoUtil.h b/src/internal/NeoUtil.h index 53afc57..f67aed2 100644 --- a/src/internal/NeoUtil.h +++ b/src/internal/NeoUtil.h @@ -26,6 +26,24 @@ License along with NeoPixel. If not, see #pragma once +#ifdef ARDUINO_ARCH_ESP32 +#if defined NDEBUG || defined CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT +#define ESP_ERROR_CHECK_WITHOUT_ABORT_SILENT_TIMEOUT(x) ({ \ + esp_err_t err_rc_ = (x); \ + err_rc_; \ + }) +#else +#define ESP_ERROR_CHECK_WITHOUT_ABORT_SILENT_TIMEOUT(x) ({ \ + esp_err_t err_rc_ = (x); \ + if (unlikely(err_rc_ != ESP_OK && err_rc_ != ESP_ERR_TIMEOUT)) { \ + _esp_error_check_failed_without_abort(err_rc_, __FILE__, __LINE__, \ + __ASSERT_FUNC, #x); \ + } \ + err_rc_; \ + }) +#endif // NDEBUG +#endif // ARDUINO_ARCH_ESP32 + // some platforms do not come with STL or properly defined one, specifically functional // if you see... // undefined reference to `std::__throw_bad_function_call()' diff --git a/src/internal/methods/NeoEsp32RmtMethod.h b/src/internal/methods/NeoEsp32RmtMethod.h index 77aee61..02a00d3 100644 --- a/src/internal/methods/NeoEsp32RmtMethod.h +++ b/src/internal/methods/NeoEsp32RmtMethod.h @@ -595,10 +595,9 @@ public: free(_dataSending); } - bool IsReadyToUpdate() const { - return (ESP_OK == ESP_ERROR_CHECK_WITHOUT_ABORT(rmt_wait_tx_done(_channel.RmtChannelNumber, 0))); + return (ESP_OK == ESP_ERROR_CHECK_WITHOUT_ABORT_SILENT_TIMEOUT(rmt_wait_tx_done(_channel.RmtChannelNumber, 0))); } void Initialize()