mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 19:50:30 +01:00
esp32: Add support for ESP32-S3 SoCs.
Thanks to Seon Rozenblum aka @UnexpectedMaker for the work. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -45,13 +45,18 @@ void uart_init(void) {
|
||||
// all code executed in ISR must be in IRAM, and any const data must be in DRAM
|
||||
STATIC void IRAM_ATTR uart_irq_handler(void *arg) {
|
||||
volatile uart_dev_t *uart = &UART0;
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
uart->int_clr.rxfifo_full_int_clr = 1;
|
||||
uart->int_clr.rxfifo_tout_int_clr = 1;
|
||||
#else
|
||||
uart->int_clr.rxfifo_full = 1;
|
||||
uart->int_clr.frm_err = 1;
|
||||
uart->int_clr.rxfifo_tout = 1;
|
||||
uart->int_clr.frm_err = 1;
|
||||
#endif
|
||||
while (uart->status.rxfifo_cnt) {
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
uint8_t c = uart->fifo.rw_byte;
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
||||
uint8_t c = READ_PERI_REG(UART_FIFO_AHB_REG(0)); // UART0
|
||||
#endif
|
||||
if (c == mp_interrupt_char) {
|
||||
|
||||
Reference in New Issue
Block a user