diff --git a/src/FreeRTOS.cpp b/src/FreeRTOS.cpp index ced1616..2cc7a98 100644 --- a/src/FreeRTOS.cpp +++ b/src/FreeRTOS.cpp @@ -261,7 +261,7 @@ void FreeRTOS::Semaphore::setName(std::string name) { * @param [in] length The amount of storage to allocate for the ring buffer. * @param [in] type The type of buffer. One of RINGBUF_TYPE_NOSPLIT, RINGBUF_TYPE_ALLOWSPLIT, RINGBUF_TYPE_BYTEBUF. */ -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) +#ifdef ESP_IDF_VERSION //Quick hack to detect if using IDF version that replaced ringbuf_type_t Ringbuffer::Ringbuffer(size_t length, RingbufferType_t type) { #else Ringbuffer::Ringbuffer(size_t length, ringbuf_type_t type) { diff --git a/src/FreeRTOS.h b/src/FreeRTOS.h index 40462f4..0787727 100644 --- a/src/FreeRTOS.h +++ b/src/FreeRTOS.h @@ -61,9 +61,9 @@ public: */ class Ringbuffer { public: -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) +#ifdef ESP_IDF_VERSION //Quick hack to detect if using IDF version that replaced ringbuf_type_t Ringbuffer(size_t length, RingbufferType_t type = RINGBUF_TYPE_NOSPLIT); -#else +#else Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT); #endif ~Ringbuffer();