start bbnow and deps

This commit is contained in:
2026-07-19 17:49:47 -05:00
parent 59d038efc2
commit 562b6cea8b
9 changed files with 125 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "blk_box_drivers/radio.hpp"
#include "blk_box_drivers/bbnow.hpp"
#include "esp_wifi.h"
void init_radio() {
// TODO: Do more once we are doing wifi in addition to espnow
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) );
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_AP) );
ESP_ERROR_CHECK( esp_wifi_start());
ESP_ERROR_CHECK( esp_wifi_set_channel(BBNOW_DEFAULT_CHANNEL, WIFI_SECOND_CHAN_NONE));
// enable long range
// ESP_ERROR_CHECK( esp_wifi_set_protocol(ESPNOW_WIFI_IF, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_LR) );
}