From 9efa27cbced8bf64ee013eb9193899cac3e2f8b5 Mon Sep 17 00:00:00 2001 From: Staars Date: Sat, 7 Nov 2020 18:55:05 +0100 Subject: [PATCH] prevent compile error with ESP-idf>4 --- lib/libesp32/NimBLE-Arduino/src/FreeRTOS.cpp | 2 +- lib/libesp32/NimBLE-Arduino/src/FreeRTOS.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.cpp b/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.cpp index ff1061c10..4ebab3958 100644 --- a/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.cpp +++ b/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.cpp @@ -264,7 +264,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. */ -#ifdef ESP_IDF_VERSION //Quick hack to detect if using IDF version that replaced ringbuf_type_t +#if defined(ESP_IDF_VERSION) && !defined(ESP_IDF_VERSION_VAL) //Quick hack to detect if using IDF version that replaced ringbuf_type_t, ESP_IDF_VERSION_VAL is for IDF>4.0.0 Ringbuffer::Ringbuffer(size_t length, RingbufferType_t type) { #else Ringbuffer::Ringbuffer(size_t length, ringbuf_type_t type) { diff --git a/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.h b/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.h index 2f3d9386c..f93f0b1a0 100644 --- a/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.h +++ b/lib/libesp32/NimBLE-Arduino/src/FreeRTOS.h @@ -68,7 +68,7 @@ public: */ class Ringbuffer { public: -#ifdef ESP_IDF_VERSION //Quick hack to detect if using IDF version that replaced ringbuf_type_t +#if defined(ESP_IDF_VERSION) && !defined(ESP_IDF_VERSION_VAL) //Quick hack to detect if using IDF version that replaced ringbuf_type_t, ESP_IDF_VERSION_VAL is for IDF>4.0.0 Ringbuffer(size_t length, RingbufferType_t type = RINGBUF_TYPE_NOSPLIT); #else Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT);