mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
add: Kconfig assert or errorcode option
add: private include header add: macro encapsulation for assertion or error check add: ESP_FAIL return code documentation in public headers change: replaced all assertions by NVS_ASSERT_OR_RETURN macro change: few internal function return values from void to esp_err_t change: ESP_ERR_NVS_VALUE_TOO_LONG macro comment
This commit is contained in:

committed by
Martin Vychodil

parent
1f6fad6f48
commit
58cca07104
18
components/nvs_flash/private_include/nvs_internal.h
Normal file
18
components/nvs_flash/private_include/nvs_internal.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#ifndef NVS_INTERNAL_H
|
||||
#define NVS_INTERNAL_H
|
||||
|
||||
#if CONFIG_NVS_ASSERT_ERROR_CHECK
|
||||
#define NVS_ASSERT_OR_RETURN(condition, retcode) assert(condition);
|
||||
#else
|
||||
#define NVS_ASSERT_OR_RETURN(condition, retcode) \
|
||||
if (!(condition)) { \
|
||||
return retcode; \
|
||||
}
|
||||
#endif // CONFIG_NVS_ASSERT_ERROR_CHECK
|
||||
|
||||
#endif // NVS_INTERNAL_H
|
Reference in New Issue
Block a user