fix: start only enabled links and move config buffers off stack
This commit is contained in:
@@ -192,6 +192,7 @@ static void uart_send_tcp_msg_to_uarts(route_msg_t *msg)
|
||||
|
||||
static void uart_route_mux_frame(uart_channel_t source_channel, const uart_mux_frame_t *frame)
|
||||
{
|
||||
const device_config_t *cfg = config_get();
|
||||
uint32_t i;
|
||||
uint8_t source_conn = (source_channel == UART_CHANNEL_U1) ? ROUTE_CONN_UART3 : ROUTE_CONN_UART2;
|
||||
uint8_t out_frame[ROUTE_MSG_MAX_PAYLOAD + 6u];
|
||||
@@ -209,6 +210,9 @@ static void uart_route_mux_frame(uart_channel_t source_channel, const uart_mux_f
|
||||
}
|
||||
|
||||
for (i = 0; i < CONFIG_LINK_COUNT; ++i) {
|
||||
if (cfg->links[i].enabled == 0u) {
|
||||
continue;
|
||||
}
|
||||
uint8_t endpoint = config_link_index_to_endpoint((uint8_t)i);
|
||||
if ((frame->dst_mask & endpoint) != 0u) {
|
||||
(void)route_send(xLinkTxQueues[i], frame->src_id, endpoint, source_conn, frame->payload, frame->payload_len, pdMS_TO_TICKS(10));
|
||||
|
||||
Reference in New Issue
Block a user