Skip to content

Commit

Permalink
Fix hardware timers
Browse files Browse the repository at this point in the history
Fixes: #5337
Fixes: #4743

Thanks to @maxgerhardt
  • Loading branch information
me-no-dev committed Jun 28, 2021
1 parent 21947eb commit 8f46bad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cores/esp32/esp32-hal-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#define HWTIMER_LOCK() portENTER_CRITICAL(timer->lock)
#define HWTIMER_UNLOCK() portEXIT_CRITICAL(timer->lock)

typedef struct {
typedef volatile struct {
union {
struct {
uint32_t reserved0: 10;
Expand Down Expand Up @@ -272,6 +272,12 @@ void timerEnd(hw_timer_t *timer){
}

void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){
#if CONFIG_IDF_TARGET_ESP32
if(edge){
log_w("EDGE timer interrupt does not work properly on ESP32! Setting to LEVEL...");
edge = false;
}
#endif
static bool initialized = false;
static intr_handle_t intr_handle = NULL;
if(intr_handle){
Expand Down

0 comments on commit 8f46bad

Please sign in to comment.