loboris / MicroPython_ESP32_psRAM_LoBo

MicroPython for ESP32 with psRAM support
Other
825 stars 342 forks source link

Machine UART deinit() method always returns ValueError exception #294

Open miketeachman opened 5 years ago

miketeachman commented 5 years ago

The UART deinit() method always returns ValueError: Cannot stop UART task

Caused by a bug in the C implementation in function=machine_uart_deinit(), file=machine_uart.c.

Fixed by changing test for tmo With bug:

if (tmo) {
   mp_raise_ValueError("Cannot stop UART task!");
}

With fix:

if (!tmo) {
   mp_raise_ValueError("Cannot stop UART task!");
}

thanks !