There is no way that tty can be NULL in uart_put_char() and uart_write(). Eliminate these redundant tests.
Attach a file by drag & drop or click to upload