Skip to content

Commit d91aa1a

Browse files
committed
Fix panic loggers
1 parent b213ffb commit d91aa1a

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

include/Logging.h

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,23 @@ constexpr const char* openshockPathToFileName(const char (&path)[N]) {
6969

7070
#define OS_PANIC_PRINT(TAG, format, ...) OS_LOGE(TAG, "PANIC: " format, ##__VA_ARGS__)
7171

72-
#define OS_PANIC(TAG, format, ...) \
73-
OS_PANIC_PRINT(TAG, format ", restarting in 5 seconds...", ##__VA_ARGS__); \
74-
vTaskDelay(pdMS_TO_TICKS(5000)); \
75-
esp_restart()
76-
77-
#define OS_PANIC_OTA(TAG, format, ...) \
78-
OS_PANIC_PRINT(TAG, format ", invalidating update partition and restarting in 5 seconds...", ##__VA_ARGS__); \
79-
vTaskDelay(pdMS_TO_TICKS(5000)); \
80-
esp_ota_mark_app_invalid_rollback_and_reboot(); \
81-
esp_restart()
82-
83-
#define OS_PANIC_INSTANT(TAG, format, ...) \
84-
OS_PANIC_PRINT(TAG, format, ##__VA_ARGS__); \
85-
esp_restart()
72+
#define OS_PANIC(TAG, format, ...) \
73+
{ \
74+
OS_PANIC_PRINT(TAG, format ", restarting in 5 seconds...", ##__VA_ARGS__); \
75+
vTaskDelay(pdMS_TO_TICKS(5000)); \
76+
esp_restart(); \
77+
}
78+
79+
#define OS_PANIC_OTA(TAG, format, ...) \
80+
{ \
81+
OS_PANIC_PRINT(TAG, format ", invalidating update partition and restarting in 5 seconds...", ##__VA_ARGS__); \
82+
vTaskDelay(pdMS_TO_TICKS(5000)); \
83+
esp_ota_mark_app_invalid_rollback_and_reboot(); \
84+
esp_restart(); \
85+
}
86+
87+
#define OS_PANIC_INSTANT(TAG, format, ...) \
88+
{ \
89+
OS_PANIC_PRINT(TAG, format, ##__VA_ARGS__); \
90+
esp_restart(); \
91+
}

0 commit comments

Comments
 (0)