Skip to content

Commit

Permalink
esp32_serial.c: make up_putc take the critical section
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Nov 6, 2024
1 parent 8ebac3d commit d97f05a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/xtensa/src/esp32/esp32_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -2117,14 +2117,18 @@ void xtensa_serialinit(void)
void up_putc(int ch)
{
#ifdef HAVE_SERIAL_CONSOLE

irqstate_t flags;
uint32_t intena;

flags = enter_critical_section();
esp32_disableallints(CONSOLE_DEV.priv, &intena);

while (!esp32_txready(&CONSOLE_DEV));
esp32_send(&CONSOLE_DEV, ch);

esp32_restoreuartint(CONSOLE_DEV.priv, intena);
leave_critical_section(flags);
#endif
}
#endif /* USE_SERIALDRIVER */

0 comments on commit d97f05a

Please sign in to comment.