Add silent timeout macro for ESP32 debug error check (#801)

This commit is contained in:
Michael Miller
2024-04-25 14:07:38 -07:00
committed by GitHub
parent e40289f89c
commit 89a6a8b019
2 changed files with 19 additions and 2 deletions

View File

@@ -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()'

View File

@@ -594,10 +594,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()