FastLED 3.9.12
Loading...
Searching...
No Matches
assert.h
1#pragma once
2
3
4
5#include "fl/warn.h"
6#include "fl/strstream.h"
7
8#ifndef DEBUG
9#define FASTLED_ASSERT(x, MSG) FASTLED_WARN_IF(!(x), MSG)
10#else
11
12#ifdef ESP32
13#include "esp_log.h"
14#include "esp_check.h"
15#define FASTLED_ASSERT(x, MSG) \
16 { \
17 if (!(x)) { \
18 ESP_LOGE("#### FastLED", "%s", (fl::StrStream() << MSG).c_str()); \
19 ESP_ERROR_CHECK(ESP_FAIL); \
20 } \
21 }
22#else
23#define FASTLED_ASSERT(x, MSG) FASTLED_WARN_IF(!(x), MSG)
24#endif
25#endif