You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/11/12 23:17:11 UTC

[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4822: risc-v/esp32c3: Fix reset triggering crash nested when crash

gustavonihei commented on a change in pull request #4822:
URL: https://github.com/apache/incubator-nuttx/pull/4822#discussion_r748636159



##########
File path: boards/risc-v/esp32c3/esp32c3-devkit/src/esp32c3_reset.c
##########
@@ -55,6 +58,23 @@
 
 int board_reset(int status)
 {
+#ifdef CONFIG_BOARD_ASSERT_RESET_VALUE
+  syslog(LOG_INFO, "reboot status=%d\n", status);
+
+  switch (status)
+    {
+      case EXIT_SUCCESS:
+        up_shutdown_handler();
+        break;
+      case CONFIG_BOARD_ASSERT_RESET_VALUE:
+        break;
+      default:
+        break;
+    }
+#else
+  up_shutdown_handler();
+#endif

Review comment:
       ```suggestion
     syslog(LOG_INFO, "reboot status=%d\n", status);
   
     switch (status)
       {
         case EXIT_SUCCESS:
           up_shutdown_handler();
           break;
         case CONFIG_BOARD_ASSERT_RESET_VALUE:
           break;
         default:
           break;
       }
   #endif
   ```
   `BOARD_ASSERT_RESET_VALUE` depends on `BOARDCTL_RESET`, so the `#else` clause will never really happen and can be removed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org