uartEnd: Unlock mutex before detaching rx and tx (#554)

* uartEnd: Unlock mutex before detaching rx and tx

This should solve the device freezing issue when Serial.end() is called

* Unlock UART MUTEX only for detaching Rx and Tx

* Thanks to @me-no-dev for pointing it out that
   uart->dev->conf0.val can be inside mutex lock
This commit is contained in:
Pranav Cherukupalli 2017-08-04 14:30:51 +05:30 committed by Me No Dev
parent 9618eec19e
commit 41e36a72f3

View File

@ -228,11 +228,12 @@ void uartEnd(uart_t* uart)
vQueueDelete(uart->queue); vQueueDelete(uart->queue);
} }
uart->dev->conf0.val = 0;
UART_MUTEX_UNLOCK();
uartDetachRx(uart); uartDetachRx(uart);
uartDetachTx(uart); uartDetachTx(uart);
uart->dev->conf0.val = 0;
UART_MUTEX_UNLOCK();
} }
uint32_t uartAvailable(uart_t* uart) uint32_t uartAvailable(uart_t* uart)
@ -419,4 +420,3 @@ int log_printf(const char *format, ...)
} }
return len; return len;
} }