Merge branch 'bugfix/suppress_compiler_warning_silent_reboot_is_enabled_v5.0' into 'release/v5.0'

fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled (backport v5.0)

See merge request espressif/esp-idf!26037
This commit is contained in:
Jiang Jiang Jian
2023-10-07 14:28:52 +08:00
3 changed files with 11 additions and 4 deletions

View File

@@ -46,6 +46,10 @@ extern "C" {
#define CHOOSE_MACRO_VA_ARG(MACRO_WITH_ARGS, MACRO_WITH_NO_ARGS, ...) CHOOSE_MACRO_VA_ARG_INN(0, ##__VA_ARGS__, MACRO_WITH_ARGS, MACRO_WITH_NO_ARGS, 0)
#endif
#ifndef ESP_UNUSED
#define ESP_UNUSED(x) ((void)(x))
#endif
/* test macros */
#define foo_args(...) 1
#define foo_no_args() 2

View File

@@ -9,6 +9,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "esp_macros.h"
#include "soc/soc_caps.h"
#include "sdkconfig.h"
@@ -62,10 +63,10 @@ void panic_print_str(const char *str);
void panic_print_dec(int d);
void panic_print_hex(int h);
#else
#define panic_print_char(c)
#define panic_print_str(str)
#define panic_print_dec(d)
#define panic_print_hex(h)
#define panic_print_char(c) ESP_UNUSED(c)
#define panic_print_str(str) ESP_UNUSED(str)
#define panic_print_dec(d) ESP_UNUSED(d)
#define panic_print_hex(h) ESP_UNUSED(h)
#endif
void __attribute__((__noreturn__)) panic_abort(const char *details);

View File

@@ -0,0 +1,2 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y