Fix RIP bugs, add in UART

This commit is contained in:
Johnathon Slightham
2026-03-31 14:26:37 -04:00
committed by Johnathon Slightham
parent d4602012f1
commit 548e8db484
26 changed files with 704 additions and 434 deletions

View File

@@ -275,15 +275,11 @@ esp_err_t DataLinkManager::scheduler_send(uint8_t channel){
esp_err_t DataLinkManager::scheduler_send_rmt(uint8_t channel, SchedulerMetadata frame, uint8_t* send_data, size_t frame_size, bool wait_for_tx_done){
esp_err_t res;
uint8_t channel_to_route = MAX_CHANNELS;
rmt_transmit_config_t config = {
.loop_count = 0,
.flags = {
.eot_level = 0, // typically 0 or 1, depending on your output idle level
}
};
// config is physical-layer specific; each IPhysicalLayer implementation
// uses its own internal configuration set at init time, so nullptr is fine.
if (frame.header.receiver_id == BROADCAST_ADDR){
// printf("Sending on channel %d\n", i);
res = phys_comms->send(send_data, frame_size, &config, channel);
res = phys_comms->send(send_data, frame_size, nullptr, channel);
} else {
res = route_frame(frame.header.receiver_id, &channel_to_route);
@@ -291,18 +287,12 @@ esp_err_t DataLinkManager::scheduler_send_rmt(uint8_t channel, SchedulerMetadata
ESP_LOGE(DEBUG_LINK_TAG, "Failed to find entry for %d", frame.header.receiver_id);
return ESP_FAIL;
}
// ESP_LOGI(DEBUG_LINK_TAG, "Sending frame %d on channel %d to board %d frag_info 0x%X", frame.header.seq_num, channel, frame.header.receiver_id, frame.header.frag_info);
res = phys_comms->send(send_data, frame_size, &config, channel_to_route);
// if (wait_for_tx_done){
// phys_comms->wait_until_send_complete(channel_to_route);
// }
res = phys_comms->send(send_data, frame_size, nullptr, channel_to_route);
}
if (res != ESP_OK){
ESP_LOGE(DEBUG_LINK_TAG, "Failed to send message");
return ESP_FAIL;
} else{
// ESP_LOGI(DEBUG_LINK_TAG, "Sent frame %d frag_info 0x%X", frame.header.seq_num, frame.header.frag_info);
}
return ESP_OK;