Modify IDF v4 fix to maintain v3 compatibility

This commit is contained in:
h2zero 2020-03-31 21:38:28 -06:00
parent 74ba03e3a8
commit 359d2885e1
2 changed files with 3 additions and 3 deletions

View file

@ -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] 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. * @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) { Ringbuffer::Ringbuffer(size_t length, RingbufferType_t type) {
#else #else
Ringbuffer::Ringbuffer(size_t length, ringbuf_type_t type) { Ringbuffer::Ringbuffer(size_t length, ringbuf_type_t type) {

View file

@ -61,9 +61,9 @@ public:
*/ */
class Ringbuffer { class Ringbuffer {
public: 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); Ringbuffer(size_t length, RingbufferType_t type = RINGBUF_TYPE_NOSPLIT);
#else #else
Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT); Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT);
#endif #endif
~Ringbuffer(); ~Ringbuffer();