• Damien George's avatar
    mimxrt: Fix USB CDC handling so it works reliably. · f31c6b48
    Damien George authored
    On i.MX the SysTick IRQ cannot wake the CPU from a WFI so the CPU was
    blocked on WFI waiting for USB data in mp_hal_stdin_rx_chr() even though it
    had already arrived (because it may arrive just after calling the check
    tud_cdc_available()).  This commit fixes this problem by using SEV/WFE to
    indicate that there has been a USB event.
    
    The mp_hal_stdout_tx_strn() function is also fixed so that it doesn't
    overflow the USB buffers.
    Signed-off-by: default avatarDamien George <damien@micropython.org>
    f31c6b48
mphalport.c 2.96 KB