From 94a032e7636250289c48483dbd6ac2f6c6432a1d Mon Sep 17 00:00:00 2001 From: geekxw Date: Sun, 17 May 2020 22:09:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dconsole=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E4=BD=9C=E7=94=A8=E5=9F=9F=E7=9A=84=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/esp_peripherals/periph_console.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/esp_peripherals/periph_console.c b/components/esp_peripherals/periph_console.c index cc51444a8..c6955a4c4 100644 --- a/components/esp_peripherals/periph_console.c +++ b/components/esp_peripherals/periph_console.c @@ -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; @@ -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; @@ -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; From b4d4bae98c538a12725c5c2c1c5886379a9282aa Mon Sep 17 00:00:00 2001 From: geekxw Date: Sun, 17 May 2020 22:14:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8CSSID=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=A4=9A=E4=B8=AABSSID=E6=97=B6=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E4=BF=A1=E5=8F=B7=E6=9C=80=E5=A5=BD=E7=9A=84?= =?UTF-8?q?BSSID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/esp_peripherals/periph_wifi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp_peripherals/periph_wifi.c b/components/esp_peripherals/periph_wifi.c index 93a0805e6..7038a3368 100644 --- a/components/esp_peripherals/periph_wifi.c +++ b/components/esp_peripherals/periph_wifi.c @@ -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);