1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-02 10:53:01 +02:00

Fixed little bug

This commit is contained in:
Stefan de Bruijn
2020-10-24 11:39:38 +02:00
parent 10151863d7
commit dcea7bcc17
2 changed files with 5 additions and 1 deletions

View File

@@ -65,6 +65,8 @@ namespace PinUsers {
// TODO FIXME: We should set the UART mode somewhere better suited than here:
if (uart_set_mode(uartPort_, UART_MODE_RS485_HALF_DUPLEX) != ESP_OK) {
uart_driver_delete(uartPort_);
UartResources().release(int(uartPort_) - 1);
uartPort_ = UART_NUM_MAX;
Assert(false, "UART set mode failed");
@@ -86,6 +88,8 @@ namespace PinUsers {
// Tear down the uart, give back all resources.
if (uartPort_ != UART_NUM_MAX) {
uart_driver_delete(uartPort_);
UartResources().release(int(uartPort_) - 1);
}
}
};

View File

@@ -30,7 +30,7 @@ namespace PinUsers {
// Writes a buffer to the uart. Returns the number of _bytes_ written
template <typename T>
int writePartial(const T& buffer, int byteOffset = 0) {
writePartial(&buffer, 1, byteOffset);
return writePartial(&buffer, 1, byteOffset);
}
// Writes a buffer to the uart. Returns the number of _bytes_ written