Skip to content

Commit

Permalink
[ESP-IDF5.1] Fix build issue on older IDF based builds
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-er committed Oct 23, 2023
1 parent 852a709 commit 65666f8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/NeoPixelBus/src/internal/NeoEsp32RmtMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ License along with NeoPixel. If not, see
-------------------------------------------------------------------------*/

#include <Arduino.h>

#if defined(ARDUINO_ARCH_ESP32) && ESP_IDF_VERSION_MAJOR < 5 && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C2)
#include "NeoSettings.h"
#include "NeoBusChannel.h"
#include "NeoEsp32RmtMethod.h"

#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C2)


// translate NeoPixelBuffer into RMT buffer
// this is done on the fly so we don't require a send buffer in raw RMT format
Expand Down
2 changes: 1 addition & 1 deletion lib/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ License along with NeoPixel. If not, see

#pragma once

#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C2)
#if defined(ARDUINO_ARCH_ESP32) && ESP_IDF_VERSION_MAJOR < 5 && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32C2)

/* General Reference documentation for the APIs used in this implementation
LOW LEVEL: (what is actually used)
Expand Down
3 changes: 1 addition & 2 deletions lib/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#if ESP_IDF_VERSION_MAJOR >= 5 && defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C2)
#include "../internal/NeoEsp32RmtMethod_idf5.h"

#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C2)


size_t rmt_encode_led_strip(rmt_encoder_t *encoder, rmt_channel_handle_t channel, const void *primary_data, size_t data_size, rmt_encode_state_t *ret_state)
{
Expand Down
6 changes: 3 additions & 3 deletions lib/NeoPixelBus/src/internal/NeoEsp32RmtMethod_idf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ License along with NeoPixel. If not, see

#pragma once

#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C2)
#if defined(ARDUINO_ARCH_ESP32) && ESP_IDF_VERSION_MAJOR >= 5 && !defined(CONFIG_IDF_TARGET_ESP32C2)

/* General Reference documentation for the APIs used in this implementation
LOW LEVEL: (what is actually used)
Expand Down Expand Up @@ -367,9 +367,9 @@ class NeoEsp32RmtChannelN
{
public:
NeoEsp32RmtChannelN(NeoBusChannel channel) :
RmtChannelNumber(RmtChannelNumber)
RmtChannelNumber(nullptr)
{
RmtChannelNumber = NULL;
//RmtChannelNumber = NULL;
};
NeoEsp32RmtChannelN() = delete; // no default constructor
rmt_channel_handle_t RmtChannelNumber = NULL;
Expand Down
8 changes: 4 additions & 4 deletions lib/NeoPixelBus/src/internal/NeoEsp32SpiMethod_idf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ License along with NeoPixel. If not, see

#pragma once

#if defined(ARDUINO_ARCH_ESP32)
#if defined(ARDUINO_ARCH_ESP32) && ESP_IDF_VERSION_MAJOR >= 5

#if (defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C6)) && !defined(HSPI_HOST)
// HSPI_HOST depreciated in C3
Expand All @@ -37,7 +37,7 @@ License along with NeoPixel. If not, see

#include <Arduino.h>

extern void AddLog(uint32_t loglevel, PGM_P formatP, ...); // TODO: Remove all Addlogs
// extern void AddLog(uint32_t loglevel, PGM_P formatP, ...); // TODO: Remove all Addlogs

extern "C"
{
Expand Down Expand Up @@ -329,7 +329,7 @@ template<typename T_SPEED, typename T_CHANNEL> class NeoEsp32SpiMethodBase
_spi_strip->bytes_per_pixel = bytes_per_pixel;
_spi_strip->strip_len = _pixelCount;

AddLog(2,"SPI:initialized with error code: %u on pin: %u",ret, _pin);
// AddLog(2,"SPI:initialized with error code: %u on pin: %u",ret, _pin);
return;
err:
if (_spi_strip) {
Expand All @@ -341,7 +341,7 @@ template<typename T_SPEED, typename T_CHANNEL> class NeoEsp32SpiMethodBase
}
free(_spi_strip);
}
AddLog(2,"SPI-Error:initialized with error code: %u on pin: %u",ret, _pin);
// AddLog(2,"SPI-Error:initialized with error code: %u on pin: %u",ret, _pin);
return;
}

Expand Down

0 comments on commit 65666f8

Please sign in to comment.