Skip to content

Commit

Permalink
runtime/pyexec: Remove legacy usb irq enable code.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
pi-anl committed Aug 23, 2024
1 parent 6c3dc0c commit 5fbc654
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions shared/runtime/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
#include "py/gc.h"
#include "py/frozenmod.h"
#include "py/mphal.h"
#if MICROPY_HW_ENABLE_USB
#include "irq.h"
#include "usb.h"
#endif
#include "shared/readline/readline.h"
#include "shared/runtime/pyexec.h"
#include "genhdr/mpversion.h"
Expand Down Expand Up @@ -582,20 +578,6 @@ int pyexec_friendly_repl(void) {

for (;;) {
input_restart:

#if MICROPY_HW_ENABLE_USB
if (usb_vcp_is_enabled()) {
// If the user gets to here and interrupts are disabled then
// they'll never see the prompt, traceback etc. The USB REPL needs
// interrupts to be enabled or no transfers occur. So we try to
// do the user a favor and re-enable interrupts.
if (query_irq() == IRQ_STATE_DISABLED) {
enable_irq(IRQ_STATE_ENABLED);
mp_hal_stdout_tx_str("MPY: enabling IRQs\r\n");
}
}
#endif

// If the GC is locked at this point there is no way out except a reset,
// so force the GC to be unlocked to help the user debug what went wrong.
if (MP_STATE_THREAD(gc_lock_depth) != 0) {
Expand Down

0 comments on commit 5fbc654

Please sign in to comment.