From 9e7236de42b28d3adbdf12e6a2edf340cd243290 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sun, 12 Jul 2026 19:10:14 +0300 Subject: [PATCH] style: updated error macros --- zh_aht.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zh_aht.c b/zh_aht.c index 1892797..fdf9b3f 100644 --- a/zh_aht.c +++ b/zh_aht.c @@ -13,6 +13,14 @@ static const char *TAG = "zh_aht"; return err; \ } +#define ZH_ERROR_CHECK_VOID(cond, cleanup, msg, ...) \ + if (!(cond)) \ + { \ + ZH_LOGE(msg, ESP_FAIL, ##__VA_ARGS__); \ + cleanup; \ + return; \ + } + /** * @brief Opaque handle structure for the AHT family sensor (AHT10/AHT15/AHT20/AHT21/AHT25/AHT30/AHT40). *