mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 09:37:21 +02:00
Update code for demo
This commit is contained in:
@@ -50,8 +50,9 @@ DataLinkManager::DataLinkManager(uint8_t board_id, uint8_t num_channels = MAX_CH
|
|||||||
init_rip();
|
init_rip();
|
||||||
init_scheduler();
|
init_scheduler();
|
||||||
|
|
||||||
// Start the periodic LUT flush task
|
// Start the periodic LUT flush task (priority 1 – below all other link-layer tasks
|
||||||
xTaskCreate(lut_flush_task, "lut_flush", 2048, this, 2, &lut_flush_task_handle);
|
// to avoid preempting tasks that hold internal C++ or FreeRTOS locks)
|
||||||
|
xTaskCreate(lut_flush_task, "lut_flush", 2048, this, 1, &lut_flush_task_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -319,7 +320,6 @@ void DataLinkManager::lut_insert(uint32_t hash, const uint8_t* message, size_t m
|
|||||||
*/
|
*/
|
||||||
void DataLinkManager::lut_flush(){
|
void DataLinkManager::lut_flush(){
|
||||||
if (xSemaphoreTake(control_frame_lut_mutex, pdMS_TO_TICKS(SEQUENCE_NUM_MAP_MUTEX_MAX_WAIT_MS)) != pdTRUE){
|
if (xSemaphoreTake(control_frame_lut_mutex, pdMS_TO_TICKS(SEQUENCE_NUM_MAP_MUTEX_MAX_WAIT_MS)) != pdTRUE){
|
||||||
ESP_LOGW(DEBUG_LINK_TAG, "LUT flush: could not acquire mutex, skipping");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +330,6 @@ void DataLinkManager::lut_flush(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
xSemaphoreGive(control_frame_lut_mutex);
|
xSemaphoreGive(control_frame_lut_mutex);
|
||||||
ESP_LOGI(DEBUG_LINK_TAG, "Control-frame LUT flushed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ esp_err_t DataLinkManager::scheduler_send(uint8_t channel){
|
|||||||
size_t frame_size = isControlFrame ? sizeof(ControlFrame) : sizeof(GenericFrame);
|
size_t frame_size = isControlFrame ? sizeof(ControlFrame) : sizeof(GenericFrame);
|
||||||
uint8_t send_data[frame_size];
|
uint8_t send_data[frame_size];
|
||||||
|
|
||||||
ESP_LOGI(DEBUG_LINK_TAG, "Sending frame on channel %d, type: %s", channel, isControlFrame ? "Control" : "Generic");
|
// ESP_LOGI(DEBUG_LINK_TAG, "Sending frame on channel %d, type: %s", channel, isControlFrame ? "Control" : "Generic");
|
||||||
|
|
||||||
if (isControlFrame){
|
if (isControlFrame){
|
||||||
//control frame
|
//control frame
|
||||||
@@ -291,7 +291,7 @@ 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);
|
ESP_LOGE(DEBUG_LINK_TAG, "Failed to find entry for %d", frame.header.receiver_id);
|
||||||
return ESP_FAIL;
|
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);
|
// 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);
|
res = phys_comms->send(send_data, frame_size, &config, channel_to_route);
|
||||||
// if (wait_for_tx_done){
|
// if (wait_for_tx_done){
|
||||||
// phys_comms->wait_until_send_complete(channel_to_route);
|
// phys_comms->wait_until_send_complete(channel_to_route);
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ std::string RemoteDebugging::get_task_manager() {
|
|||||||
|
|
||||||
std::string RemoteDebugging::get_logs() {
|
std::string RemoteDebugging::get_logs() {
|
||||||
std::string out;
|
std::string out;
|
||||||
for (const auto& log : log_buffer->peek_drain()) {
|
auto logs = log_buffer->peek_drain();
|
||||||
out.append(log);
|
for (auto it = logs.rbegin(); it != logs.rend(); ++it) {
|
||||||
|
out.append(*it);
|
||||||
}
|
}
|
||||||
out.resize(800);
|
out.resize(800);
|
||||||
return out;
|
return out;
|
||||||
|
|||||||
Reference in New Issue
Block a user