Skip to content

Commit 85c44ce

Browse files
sylvioalvesLucasTambor
authored andcommitted
wifi: isr: use interrupt allocator
Make sure Wi-Fi adapter uses the interrupt allocator so that it won't mess with other peripheral's interrupt. Signed-off-by: Sylvio Alves <[email protected]>
1 parent a7f7bdc commit 85c44ce

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

zephyr/esp32/src/wifi/esp_wifi_adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "wifi/wifi_event.h"
3333
#include "esp_private/adc_share_hw_ctrl.h"
3434
#include "esp_heap_runtime.h"
35+
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
3536

3637
#include <zephyr/logging/log.h>
3738
LOG_MODULE_REGISTER(esp32_wifi_adapter, CONFIG_WIFI_LOG_LEVEL);
@@ -523,8 +524,7 @@ static void clear_intr_wrapper(uint32_t intr_source, uint32_t intr_num)
523524

524525
static void set_isr_wrapper(int32_t n, void *f, void *arg)
525526
{
526-
irq_disable(0);
527-
irq_connect_dynamic(0, n, f, arg, 0);
527+
esp_intr_alloc(n, 0, f, arg, NULL);
528528
}
529529

530530
static void intr_on(unsigned int mask)

zephyr/esp32s2/src/wifi/esp_wifi_adapter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "esp_mac.h"
3737
#include "wifi/wifi_event.h"
3838
#include "esp_heap_runtime.h"
39+
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
3940

4041
#include <zephyr/logging/log.h>
4142
LOG_MODULE_REGISTER(esp32_wifi_adapter, CONFIG_WIFI_LOG_LEVEL);
@@ -523,8 +524,10 @@ static void clear_intr_wrapper(uint32_t intr_source, uint32_t intr_num)
523524

524525
static void set_isr_wrapper(int32_t n, void *f, void *arg)
525526
{
526-
irq_disable(n);
527-
irq_connect_dynamic(n, 1, f, arg, 0);
527+
ARG_UNUSED(n);
528+
529+
esp_intr_alloc(0, 0, f, arg, NULL);
530+
esp_intr_alloc(2, 0, f, arg, NULL);
528531
}
529532

530533
static void intr_on(unsigned int mask)

zephyr/esp32s3/src/wifi/esp_wifi_adapter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "wifi/wifi_event.h"
3737
#include "esp_private/esp_clk.h"
3838
#include "esp_heap_runtime.h"
39+
#include <zephyr/drivers/interrupt_controller/intc_esp32.h>
3940

4041
#include <zephyr/logging/log.h>
4142
LOG_MODULE_REGISTER(esp32_wifi_adapter, CONFIG_WIFI_LOG_LEVEL);
@@ -174,8 +175,10 @@ static void clear_intr_wrapper(uint32_t intr_source, uint32_t intr_num)
174175

175176
static void set_isr_wrapper(int32_t n, void *f, void *arg)
176177
{
177-
irq_disable(0);
178-
irq_connect_dynamic(0, 0, f, arg, 0);
178+
ARG_UNUSED(n);
179+
180+
esp_intr_alloc(0, 0, f, arg, NULL);
181+
esp_intr_alloc(2, 0, f, arg, NULL);
179182
}
180183

181184
static void intr_on(unsigned int mask)

0 commit comments

Comments
 (0)