Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8f46bad

Browse files
Fix hardware timers
Fixes: #5337 Fixes: #4743 Thanks to @maxgerhardt
1 parent 21947eb commit 8f46bad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎cores/esp32/esp32-hal-timer.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#define HWTIMER_LOCK() portENTER_CRITICAL(timer->lock)
4848
#define HWTIMER_UNLOCK() portEXIT_CRITICAL(timer->lock)
4949

50-
typedef struct {
50+
typedef volatilestruct {
5151
union {
5252
struct {
5353
uint32_t reserved0: 10;
@@ -272,6 +272,12 @@ void timerEnd(hw_timer_t *timer){
272272
}
273273

274274
void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){
275+
#if CONFIG_IDF_TARGET_ESP32
276+
if(edge){
277+
log_w("EDGE timer interrupt does not work properly on ESP32! Setting to LEVEL...");
278+
edge = false;
279+
}
280+
#endif
275281
static bool initialized = false;
276282
static intr_handle_t intr_handle = NULL;
277283
if(intr_handle){

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /