mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Fix RIP bugs, add in UART
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "BlockingQueue.h"
|
||||
#include "Frames.h"
|
||||
#include "RMTManager.h"
|
||||
#include "SoftUARTManager.h"
|
||||
#include "esp_log.h"
|
||||
#include "nvs_flash.h"
|
||||
#include <memory>
|
||||
@@ -13,9 +14,15 @@
|
||||
*
|
||||
* @param board_id Board ID of the current board. Will be written to the NVM under key "board" if not already written.
|
||||
*/
|
||||
DataLinkManager::DataLinkManager(uint8_t board_id, uint8_t num_channels = MAX_CHANNELS){
|
||||
DataLinkManager::DataLinkManager(uint8_t board_id, uint8_t num_channels, PhysicalLayerType phy_type){
|
||||
//init table for this board and set up link layer priority queue
|
||||
phys_comms = std::make_unique<RMTManager>(num_channels);
|
||||
if (phy_type == PhysicalLayerType::SOFT_UART){
|
||||
phys_comms = std::make_unique<SoftUARTManager>(num_channels);
|
||||
ESP_LOGI(DEBUG_LINK_TAG, "Using SoftUART physical layer");
|
||||
} else {
|
||||
phys_comms = std::make_unique<RMTManager>(num_channels);
|
||||
ESP_LOGI(DEBUG_LINK_TAG, "Using RMT physical layer");
|
||||
}
|
||||
if (phys_comms == nullptr){
|
||||
ESP_LOGE(DEBUG_LINK_TAG, "RMT object was not created. Link layer communications will not function.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user