Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 cosole配置bug与wifi连接bug (AUD-1792) #396

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/esp_peripherals/periph_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct periph_console {
char *buffer;
int total_bytes;
bool run;
const periph_console_cmd_t *commands;
periph_console_cmd_t *commands;
int command_num;
EventGroupHandle_t state_event_bits;
int task_stack;
Expand Down Expand Up @@ -202,6 +202,7 @@ static esp_err_t _console_destroy(esp_periph_handle_t self)
if (console->prompt_string) {
free(console->prompt_string);
}
free(console->commands);
free(console->buffer);
free(console);
return ESP_OK;
Expand Down Expand Up @@ -304,7 +305,9 @@ esp_periph_handle_t periph_console_init(periph_console_cfg_t *config)
AUDIO_MEM_CHECK(TAG, periph, return NULL);
periph_console_t *console = calloc(1, sizeof(periph_console_t));
AUDIO_MEM_CHECK(TAG, console, return NULL);
console->commands = config->commands;
periph_console_cmd_t* commands = malloc(sizeof(periph_console_cmd_t)*config->command_num);
memcpy(commands, config->commands, sizeof(periph_console_cmd_t)*config->command_num);
console->commands = commands;
console->command_num = config->command_num;
console->task_stack = CONSOLE_DEFAULT_TASK_STACK;
console->task_prio = CONSOLE_DEFAULT_TASK_PRIO;
Expand Down
1 change: 1 addition & 0 deletions components/esp_peripherals/periph_wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ static esp_err_t _wifi_init(esp_periph_handle_t self)
ESP_ERROR_CHECK(esp_wifi_init(&cfg));

memset(&wifi_config, 0x00, sizeof(wifi_config_t));
wifi_config.sta.scan_method = WIFI_ALL_CHANNEL_SCAN;
if (periph_wifi->ssid) {
strcpy((char *)wifi_config.sta.ssid, periph_wifi->ssid);
ESP_LOGD(TAG, "WIFI_SSID=%s", wifi_config.sta.ssid);
Expand Down