From 359d2885e11f95a4d8283f884d781fa548a207ae Mon Sep 17 00:00:00 2001 From: h2zero Date: Tue, 31 Mar 2020 21:38:28 -0600 Subject: [PATCH] Modify IDF v4 fix to maintain v3 compatibility --- src/FreeRTOS.cpp | 2 +- src/FreeRTOS.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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();