You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/01/29 11:44:49 UTC

[incubator-nuttx-apps] branch master updated (41c8342 -> f6f4bbf)

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

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


    from 41c8342  examples/lvgldemo: bugfix typos and enable GRAPHICS_LVGL
     new 53cd8cd  system/adb: Support reset to bootloader and recovery mode
     new f6f4bbf  Replace EXIT_SUCCESS with 0 for BOARDIOC_[POWEROFF|RESET]

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 boot/mcuboot/mcuboot_agent_main.c |  2 +-
 nshlib/nsh_syscmds.c              | 12 ++++++------
 system/adb/Kconfig                | 22 ++++++++++++++++------
 system/adb/adb_main.c             | 13 ++++++++++++-
 4 files changed, 35 insertions(+), 14 deletions(-)

[incubator-nuttx-apps] 01/02: system/adb: Support reset to bootloader and recovery mode

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 53cd8cda1f06d040188877656384a6c9cf6eb765
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Jan 23 17:45:35 2022 +0800

    system/adb: Support reset to bootloader and recovery mode
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 system/adb/Kconfig    | 22 ++++++++++++++++------
 system/adb/adb_main.c | 13 ++++++++++++-
 2 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/system/adb/Kconfig b/system/adb/Kconfig
index c9f13e9..87fa0b6 100644
--- a/system/adb/Kconfig
+++ b/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
+
+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"
@@ -148,11 +158,11 @@ config ADBD_BOARD_INIT
 		Setup board before running adb daemon.
 
 config ADBD_NET_INIT
-    bool "Network initialization"
-    default n
-    depends on NET
-    select NETUTILS_NETINIT
-    ---help---
-        This option enables/disables all network initialization in ADB server.
+	bool "Network initialization"
+	default n
+	depends on NET
+	select NETUTILS_NETINIT
+	---help---
+		This option enables/disables all network initialization in ADB server.
 
 endif # SYSTEM_ADBD
diff --git a/system/adb/adb_main.c b/system/adb/adb_main.c
index ca658fc..ff6c16a 100644
--- a/system/adb/adb_main.c
+++ b/system/adb/adb_main.c
@@ -54,7 +54,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);
+    }
 #else
   adb_log("reboot not implemented\n");
 #endif

[incubator-nuttx-apps] 02/02: Replace EXIT_SUCCESS with 0 for BOARDIOC_[POWEROFF|RESET]

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f6f4bbff3ae88eb779ef4c7f45e0cf7b4e6beb6b
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Jan 29 01:21:53 2022 +0800

    Replace EXIT_SUCCESS with 0 for BOARDIOC_[POWEROFF|RESET]
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 boot/mcuboot/mcuboot_agent_main.c |  2 +-
 nshlib/nsh_syscmds.c              | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/boot/mcuboot/mcuboot_agent_main.c b/boot/mcuboot/mcuboot_agent_main.c
index 6d8a100..0a33b08 100644
--- a/boot/mcuboot/mcuboot_agent_main.c
+++ b/boot/mcuboot/mcuboot_agent_main.c
@@ -285,7 +285,7 @@ int main(int argc, FAR char *argv[])
 
   usleep(1000);
 
-  boardctl(BOARDIOC_RESET, EXIT_SUCCESS);
+  boardctl(BOARDIOC_RESET, 0);
 
   return OK;
 }
diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c
index c6cdf5b..c68c1c1 100644
--- a/nshlib/nsh_syscmds.c
+++ b/nshlib/nsh_syscmds.c
@@ -112,7 +112,7 @@ int cmd_shutdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
        * reset the board due to some constraints.
        */
 
-      boardctl(BOARDIOC_RESET, EXIT_SUCCESS);
+      boardctl(BOARDIOC_RESET, 0);
     }
   else
     {
@@ -121,7 +121,7 @@ int cmd_shutdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
        * to power-off the* board due to some constraints.
        */
 
-      boardctl(BOARDIOC_POWEROFF, EXIT_SUCCESS);
+      boardctl(BOARDIOC_POWEROFF, 0);
     }
 
 #elif defined(CONFIG_BOARDCTL_RESET)
@@ -142,7 +142,7 @@ int cmd_shutdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
    * reset the board due to some constraints.
    */
 
-  boardctl(BOARDIOC_RESET, EXIT_SUCCESS);
+  boardctl(BOARDIOC_RESET, 0);
 
 #else
   /* Only the reset behavior is supported and we already know that there is
@@ -154,7 +154,7 @@ int cmd_shutdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
    * off the board due to some constraints.
    */
 
-  boardctl(BOARDIOC_POWEROFF, EXIT_SUCCESS);
+  boardctl(BOARDIOC_POWEROFF, 0);
 #endif
 
   /* boardctl() will not return in any case.  It if does, it means that
@@ -277,7 +277,7 @@ int cmd_poweroff(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
     }
   else
     {
-      boardctl(BOARDIOC_POWEROFF, EXIT_SUCCESS);
+      boardctl(BOARDIOC_POWEROFF, 0);
     }
 
   /* boardctl() will not return in any case.  It if does, it means that
@@ -307,7 +307,7 @@ int cmd_reboot(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
     }
   else
     {
-      boardctl(BOARDIOC_RESET, EXIT_SUCCESS);
+      boardctl(BOARDIOC_RESET, 0);
     }
 
   /* boardctl() will not return in this case.  It if does, it means that