Skip to content

Commit

Permalink
[Bugfix] Correct mis-matched function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
tonhuisman committed Dec 28, 2023
1 parent 15bfa17 commit 30ea382
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Doxyfile*
doxygen_sqlite3.db
html
.vscode/*
4 changes: 2 additions & 2 deletions Adafruit_NeoPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ void Adafruit_NeoPixel::rp2040Show(uint8_t pin, uint8_t *pixels, uint32_t numBy

#if defined(ESP8266)
// ESP8266 show() is external to enforce ICACHE_RAM_ATTR execution
extern "C" IRAM_ATTR void espShow(uint16_t pin, uint8_t *pixels,
extern "C" IRAM_ATTR void espShow(int16_t pin, uint8_t *pixels,
uint32_t numBytes, uint8_t type);
#elif defined(ESP32)
extern "C" void espShow(uint16_t pin, uint8_t *pixels, uint32_t numBytes,
extern "C" void espShow(int16_t pin, uint8_t *pixels, uint32_t numBytes,
uint8_t type);
#endif // ESP8266

Expand Down
4 changes: 2 additions & 2 deletions esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#ifdef HAS_ESP_IDF_5

void espShow(uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
void espShow(int16_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
rmt_data_t led_data[numBytes * 8];

if (!rmtInit(pin, RMT_TX_MODE, RMT_MEM_NUM_BLOCKS_1, 10000000)) {
Expand Down Expand Up @@ -131,7 +131,7 @@ static void IRAM_ATTR ws2812_rmt_adapter(const void *src, rmt_item32_t *dest, si
*item_num = num;
}

void espShow(uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
void espShow(int16_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
// Reserve channel
rmt_channel_t channel = ADAFRUIT_RMT_CHANNEL_MAX;
for (size_t i = 0; i < ADAFRUIT_RMT_CHANNEL_MAX; i++) {
Expand Down
4 changes: 2 additions & 2 deletions esp8266.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ static inline uint32_t _getCycleCount(void) {

#ifdef ESP8266
IRAM_ATTR void espShow(
uint8_t pin, uint8_t *pixels, uint32_t numBytes, __attribute__((unused)) boolean is800KHz) {
int16_t pin, uint8_t *pixels, uint32_t numBytes, __attribute__((unused)) boolean is800KHz) {
#else
void espShow(
uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
int16_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz) {
#endif

#define CYCLES_800_T0H (F_CPU / 2500001) // 0.4us
Expand Down
2 changes: 1 addition & 1 deletion kendyte_k210.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "sysctl.h"

void k210Show(
uint8_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz)
int16_t pin, uint8_t *pixels, uint32_t numBytes, boolean is800KHz)
{

#define CYCLES_800_T0H (sysctl_clock_get_freq(SYSCTL_CLOCK_CPU) / 2500000) // 0.4us
Expand Down

0 comments on commit 30ea382

Please sign in to comment.