|
@@ -87,7 +87,7 @@ void serial_reinit()
|
|
|
wordlen = 8;
|
|
|
break;
|
|
|
}
|
|
|
- uart_hw_init(RS485_USART, sSettings.sPortGw.baud, wordlen, parity, stop);
|
|
|
+ uart_config_reinit(RS485_USART, sSettings.sPortGw.baud, wordlen, parity, stop);
|
|
|
}
|
|
|
|
|
|
/* Stop server */
|
|
@@ -576,7 +576,7 @@ void portgw_thread(void *arg)
|
|
|
stop_server();
|
|
|
}
|
|
|
|
|
|
- if (enabled && xSemaphoreTake(rs485mutex, portMAX_DELAY) == pdTRUE) {
|
|
|
+ if (enabled) {
|
|
|
/* (Re)start server */
|
|
|
if (!start_server(transtype, port)) {
|
|
|
DBG printf("Server start error\n");
|
|
@@ -592,7 +592,6 @@ void portgw_thread(void *arg)
|
|
|
if (uxQueueMessagesWaiting(rs485RxQ) > 0) {
|
|
|
xQueueReset(rs485RxQ);
|
|
|
}
|
|
|
- xSemaphoreGive(rs485mutex);
|
|
|
vTaskDelay(5000);
|
|
|
continue;
|
|
|
}
|
|
@@ -615,7 +614,6 @@ void portgw_thread(void *arg)
|
|
|
}
|
|
|
|
|
|
if (!enabled) {
|
|
|
- xSemaphoreGive(rs485mutex);
|
|
|
vTaskDelay(5000);
|
|
|
continue;
|
|
|
}
|