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

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


The following commit(s) were added to refs/heads/master by this push:
     new fe1d701b7 system/adb: Replace adb special reset cause with 
boardctl.h's value
fe1d701b7 is described below

commit fe1d701b71aa0e648085433477c30d1b0c1a958b
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sat Apr 1 19:35:42 2023 +0800

    system/adb: Replace adb special reset cause with boardctl.h's value
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 system/adb/Kconfig    | 13 +------------
 system/adb/adb_main.c |  6 +++---
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/system/adb/Kconfig b/system/adb/Kconfig
index 524d99029..e5cf32437 100644
--- a/system/adb/Kconfig
+++ b/system/adb/Kconfig
@@ -50,21 +50,10 @@ config ADBD_TOKEN_SIZE
 
 endif # ADBD_AUTHENTICATION
 
-if BOARDCTL_RESET
-config ADBD_RESET_RECOVERY
-       int "Reset argument for recovery"
-       default 1
-
-config ADBD_RESET_BOOTLOADER
-       int "Reset argument for bootloader"
-       default 2
-endif # BOARDCTL_RESET
-
-if !BOARDCTL_UNIQUEID
 config ADBD_DEVICE_ID
        string "Default adb device id"
+       depends on !BOARDCTL_UNIQUEID
        default ""
-endif # BOARDCTL_UNIQUEID
 
 config ADBD_PRODUCT_NAME
        string "Default adb product name"
diff --git a/system/adb/adb_main.c b/system/adb/adb_main.c
index ff6c16a46..6401789f8 100644
--- a/system/adb/adb_main.c
+++ b/system/adb/adb_main.c
@@ -56,15 +56,15 @@ void adb_reboot_impl(const char *target)
 #ifdef CONFIG_BOARDCTL_RESET
   if (strcmp(target, "recovery") == 0)
     {
-      boardctl(BOARDIOC_RESET, CONFIG_ADBD_RESET_RECOVERY);
+      boardctl(BOARDIOC_RESET, BOARDIOC_SOFTRESETCAUSE_ENTER_RECOVERY);
     }
   else if (strcmp(target, "bootloader") == 0)
     {
-      boardctl(BOARDIOC_RESET, CONFIG_ADBD_RESET_BOOTLOADER);
+      boardctl(BOARDIOC_RESET, BOARDIOC_SOFTRESETCAUSE_ENTER_BOOTLOADER);
     }
   else
     {
-      boardctl(BOARDIOC_RESET, 0);
+      boardctl(BOARDIOC_RESET, BOARDIOC_SOFTRESETCAUSE_USER_REBOOT);
     }
 #else
   adb_log("reboot not implemented\n");

Reply via email to