Skip to content
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

Esp32 Core version 3 #2144

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix whitespace
BorisKofman committed Sep 19, 2024

Verified

This commit was signed with the committer’s verified signature.
thornomad Damon Timm
commit eac0e4d3dbdc70dc5ba1803a7c0c22f5add952ed
8 changes: 4 additions & 4 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ static ETSTimer timer;
#define ARDUINO_COREV3 1
#else
#define ARDUINO_COREV3 0
#endif // defined(ESP_ARDUINO_VERSION)
#endif // defined(ESP_ARDUINO_VERSION)

#if _ESP32_IRRECV_TIMER_HACK
// Required structs/types from:
@@ -380,7 +380,7 @@ void IRrecv::enableIRIn(const bool pullup) {
#else
// Fallback for ESP32 core version 2.x or earlier
timer = timerBegin(0, 1000000, true); // Old signature with divider
BorisKofman marked this conversation as resolved.
Show resolved Hide resolved
#endif // ARDUINO_COREV3
#endif // ARDUINO_COREV3

// Ensure the timer is successfully initialized
#ifdef DEBUG
@@ -398,7 +398,7 @@ void IRrecv::enableIRIn(const bool pullup) {
// Attach timer interrupt for core version 2.x
timerAlarmWrite(timer, MS_TO_USEC(params.timeout), true);
timerAttachInterrupt(timer, &read_timeout, false);
#endif // ARDUINO_COREV3
#endif // ARDUINO_COREV3

#endif // ESP32

@@ -469,7 +469,7 @@ void IRrecv::resume(void) {
#else
// For ESP32 core version 2.x
timerAlarmDisable(timer); // Disable the alarm
#endif // ARDUINO_COREV3
#endif // ARDUINO_COREV3

// Re-enable GPIO interrupt in both versions
gpio_intr_enable((gpio_num_t)params.recvpin);