mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
wifi_prov_mgr: Fix provisioning not stopping in release mode
- For the wifi_prov_mgr example in release mode (with NDEBUG defined - assertions disabled), the task to stop provisioning is never started as it is voided by the assert function it is called in. Closes https://github.com/espressif/esp-idf/issues/8309
This commit is contained in:
@ -1,16 +1,8 @@
|
|||||||
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
|
/*
|
||||||
//
|
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
*
|
||||||
// you may not use this file except in compliance with the License.
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
// You may obtain a copy of the License at
|
*/
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -621,8 +613,10 @@ static bool wifi_prov_mgr_stop_service(bool blocking)
|
|||||||
* released - some duration after - returning from a call to
|
* released - some duration after - returning from a call to
|
||||||
* wifi_prov_mgr_stop_provisioning(), like when it is called
|
* wifi_prov_mgr_stop_provisioning(), like when it is called
|
||||||
* inside a protocomm handler */
|
* inside a protocomm handler */
|
||||||
assert(xTaskCreate(prov_stop_task, "prov_stop_task", 4096, (void *)1,
|
if (xTaskCreate(prov_stop_task, "prov_stop_task", 4096, (void *)1, tskIDLE_PRIORITY, NULL) != pdPASS) {
|
||||||
tskIDLE_PRIORITY, NULL) == pdPASS);
|
ESP_LOGE(TAG, "Failed to create prov_stop_task!");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
ESP_LOGD(TAG, "Provisioning scheduled for stopping");
|
ESP_LOGD(TAG, "Provisioning scheduled for stopping");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user