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 2022/01/23 18:33:17 UTC

[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a change in pull request #977: system/adb: Support reset to bootloader and recovery mode

pkarashchenko commented on a change in pull request #977:
URL: https://github.com/apache/incubator-nuttx-apps/pull/977#discussion_r790313522



##########
File path: system/adb/adb_main.c
##########
@@ -49,7 +49,18 @@ void adb_log_impl(FAR const char *func, int line, FAR const char *fmt, ...)
 void adb_reboot_impl(const char *target)
 {
 #ifdef CONFIG_BOARDCTL_RESET
-  boardctl(BOARDIOC_RESET, 0);
+  if (strcmp(target, "recovery") == 0)
+    {
+      boardctl(BOARDIOC_RESET, CONFIG_ADBD_RESET_RECOVERY);
+    }
+  else if (strcmp(target, "bootloader") == 0)
+    {
+      boardctl(BOARDIOC_RESET, CONFIG_ADBD_RESET_BOOTLOADER);
+    }
+  else
+    {
+      boardctl(BOARDIOC_RESET, 0);

Review comment:
       Should we `boardctl(BOARDIOC_RESET, EXIT_SUCCESS);` or keep `0`?

##########
File path: system/adb/Kconfig
##########
@@ -49,6 +49,16 @@ config ADBD_TOKEN_SIZE
 
 endif # ADBD_AUTHENTICATION
 
+if BOARDCTL_RESET
+config ADBD_RESET_RECOVERY
+	int "Reset argument for recovery"
+	default 1

Review comment:
       `1` is reserved for `EXIT_FAILURE`. Should we default `ADBD_RESET_RECOVERY` to `2` and `ADBD_RESET_BOOTLOADER` to `3`?




-- 
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