Skip to content

Commit d57fd6a

Browse files
committed
cpu/esp32/stdio_usb_serial_jtag: migration to ESP-IDF v5.4
1 parent fe0f137 commit d57fd6a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cpu/esp32/stdio_usb_serial_jtag/usb_serial_jtag.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626

2727
#include "irq_arch.h"
2828
#include "esp_attr.h"
29-
#include "hal/interrupt_controller_types.h"
30-
#include "hal/interrupt_controller_ll.h"
29+
#include "esp_cpu.h"
3130
#include "hal/usb_serial_jtag_ll.h"
3231
#include "soc/periph_defs.h"
3332
#include "rom/ets_sys.h"
3433

34+
#define USB_SERIAL_JTAG_PACKET_SZ_BYTES 64
35+
3536
static tsrb_t serial_tx_rb;
3637
static uint8_t serial_tx_rb_buf[USB_SERIAL_JTAG_PACKET_SZ_BYTES];
3738

@@ -98,18 +99,18 @@ static void _init(void)
9899
intr_matrix_set(PRO_CPU_NUM, ETS_USB_SERIAL_JTAG_INTR_SOURCE, CPU_INUM_SERIAL_JTAG);
99100

100101
/* enable the CPU interrupt */
101-
intr_cntrl_ll_set_int_handler(CPU_INUM_SERIAL_JTAG, _serial_intr_handler, NULL);
102-
intr_cntrl_ll_enable_interrupts(BIT(CPU_INUM_SERIAL_JTAG));
102+
esp_cpu_intr_set_handler(CPU_INUM_SERIAL_JTAG, _serial_intr_handler, NULL);
103+
esp_cpu_intr_enable(BIT(CPU_INUM_SERIAL_JTAG));
103104

104105
#ifdef SOC_CPU_HAS_FLEXIBLE_INTC
105106
/* set interrupt level */
106-
intr_cntrl_ll_set_int_level(CPU_INUM_SERIAL_JTAG, 1);
107+
esp_cpu_intr_set_priority(CPU_INUM_SERIAL_JTAG, 1);
107108
#endif
108109
}
109110

110111
static void _detach(void)
111112
{
112-
intr_cntrl_ll_disable_interrupts(BIT(CPU_INUM_SERIAL_JTAG));
113+
esp_cpu_intr_disable(BIT(CPU_INUM_SERIAL_JTAG));
113114
}
114115

115116
STDIO_PROVIDER(STDIO_ESP32_SERIAL_JTAG, _init, _detach, _write)

0 commit comments

Comments
 (0)