Skip to content

Fixes RMT examples and adds ESP32-S3 config #6235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class MyProcessor {

public:
MyProcessor(uint8_t pin, float nanoTicks) {
assert((rmt_recv = rmtInit(21, RMT_RX_MODE, RMT_MEM_192)));
if ((rmt_recv = rmtInit(pin, RMT_RX_MODE, RMT_MEM_192)) == NULL)
{
Serial.println("init receiver failed\n");
}

realNanoTick = rmtSetTick(rmt_recv, nanoTicks);
};
Expand Down Expand Up @@ -59,6 +62,6 @@ void setup()

void loop()
{
Serial.printf("GPIO 4: %08x 5: %08x 6: %08x\n", mp1.val(), mp2.val(), mp3.val());
Serial.printf("GPIO 4: %08x 5: %08x 10: %08x\n", mp1.val(), mp2.val(), mp3.val());
delay(500);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@

#include "esp32-hal.h"

// The effect seen in ESP32C3, ESP32S2 and ESP32S3 is like a Blink of RGB LED
#if CONFIG_IDF_TARGET_ESP32S2
#define BUILTIN_RGBLED_PIN 18
#elif CONFIG_IDF_TARGET_ESP32S3
#define BUILTIN_RGBLED_PIN 48
#elif CONFIG_IDF_TARGET_ESP32C3
#define BUILTIN_RGBLED_PIN 8
#else
#define BUILTIN_RGBLED_PIN 21 // ESP32 has no builtin RGB LED
#endif

#define NR_OF_LEDS 8*4
#define NR_OF_ALL_BITS 24*NR_OF_LEDS

Expand Down Expand Up @@ -41,7 +52,7 @@ void setup()
{
Serial.begin(115200);

if ((rmt_send = rmtInit(18, RMT_TX_MODE, RMT_MEM_64)) == NULL)
if ((rmt_send = rmtInit(BUILTIN_RGBLED_PIN, RMT_TX_MODE, RMT_MEM_64)) == NULL)
{
Serial.println("init sender failed\n");
}
Expand Down