This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 281ab833097c0472063728e13732c3b44fef4eb9
Author: Tiago Medicci Serrano <[email protected]>
AuthorDate: Mon Aug 14 10:17:40 2023 -0300

    esp32s3: Use `PANIC()` instead of `assert(0)`
    
    Considering kernel code, it's reasonable to use `PANIC()` instead
    of `assert(0)` to handle with situations that require abort. Unlike
    `assert`, `PANIC()` doesn't dependent on `NDEBUG`.
---
 arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c  | 2 +-
 arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c 
b/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c
index 1e5c0c2cda..520dc9e938 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_ble_adapter.c
@@ -2317,7 +2317,7 @@ int esp32s3_bt_controller_init(void)
       else
         {
           wlerr("Internal 150kHz RC oscillator not detected.");
-          assert(0);
+          PANIC();
         }
 #endif
 
diff --git a/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c 
b/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
index 4168a7cf77..b794f6b203 100644
--- a/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
+++ b/arch/xtensa/src/esp32s3/esp32s3_wifi_adapter.c
@@ -802,7 +802,7 @@ static void esp_set_isr(int32_t n, void *f, void *arg)
   if (!adapter)
     {
       wlerr("Failed to alloc %d memory\n", tmp);
-      assert(0);
+      PANIC();
       return;
     }
 
@@ -813,7 +813,7 @@ static void esp_set_isr(int32_t n, void *f, void *arg)
   if (ret)
     {
       wlerr("Failed to attach IRQ %d\n", irq);
-      assert(0);
+      PANIC();
       return;
     }
 
@@ -821,7 +821,7 @@ static void esp_set_isr(int32_t n, void *f, void *arg)
   if (ret)
     {
       wlerr("Failed to attach IRQ %d\n", irq);
-      assert(0);
+      PANIC();
       return;
     }
 }

Reply via email to