Skip to content

Commit

Permalink
adb: Don't declare variables in the middle of function
Browse files Browse the repository at this point in the history
and unify the prefix from ADB to ADBD

Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 authored and GUIDINGLI committed Jan 15, 2024
1 parent db0e0b9 commit e4e43a1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
6 changes: 3 additions & 3 deletions system/adb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ config ADBD_FILE_SERVICE

config ADBD_FILE_SYMLINK
bool "File service symlink support"
default n
depends on ADBD_FILE_SERVICE
depends on PSEUDOFS_SOFTLINKS
default PSEUDOFS_SOFTLINKS
---help---
Enable fs symlink support.

config ADBD_SHELL_SERVICE
bool "ADB shell support"
depends on SYSTEM_NSH
select LIBC_EXECFUNCS
select PSEUDOTERM
depends on LIBC_EXECFUNCS
depends on PSEUDOTERM
default n
---help---
Enable "adb shell" feature.
Expand Down
14 changes: 7 additions & 7 deletions system/adb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@

include $(APPDIR)/Make.defs

ADBD_URL ?= "https://github.com/spiriou/microADB/archive"
ADBD_VERSION ?= b0bc09a7612000186df723f2fe55705b1c2fe873
ADB_URL ?= "https://github.com/spiriou/microADB/archive"
ADB_VERSION ?= b0bc09a7612000186df723f2fe55705b1c2fe873

ADB_DIR := $(APPDIR)/system/adb
ADB_UNPACKNAME := microADB
ADB_UNPACKDIR := $(ADB_DIR)/$(ADB_UNPACKNAME)

$(ADB_UNPACKDIR):
@echo "Downloading: $(ADB_UNPACKNAME)"
$(Q) curl -O -L $(ADBD_URL)/$(ADBD_VERSION).zip
$(Q) unzip -o $(ADBD_VERSION).zip
$(call DELFILE, $(ADBD_VERSION).zip)
$(call MOVEFILE, $(ADB_UNPACKNAME)-$(ADBD_VERSION), $(ADB_UNPACKDIR))
$(Q) curl -O -L $(ADB_URL)/$(ADB_VERSION).zip
$(Q) unzip -o $(ADB_VERSION).zip
$(call DELFILE, $(ADB_VERSION).zip)
$(call MOVEFILE, $(ADB_UNPACKNAME)-$(ADB_VERSION), $(ADB_UNPACKDIR))

# adb server app

PROGNAME := $(CONFIG_ADBD_PROGNAME)
PRIORITY := $(CONFIG_ADBD_PRIORITY)
STACKSIZE := $(CONFIG_ADBD_STACKSIZE)
MODULE := $(CONFIG_ADB_SERVER)
MODULE := $(CONFIG_SYSTEM_ADBD)

# Files

Expand Down
26 changes: 14 additions & 12 deletions system/adb/adb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#endif

#ifdef CONFIG_ADBD_NET_INIT
#include "netutils/netinit.h"
# include "netutils/netinit.h"
#endif

/****************************************************************************
Expand Down Expand Up @@ -70,7 +70,7 @@ void adb_log_impl(int priority, FAR const char *func, int line,
va_end(ap);
}

void adb_reboot_impl(const char *target)
void adb_reboot_impl(FAR const char *target)
{
#ifdef CONFIG_BOARDCTL_RESET
if (strcmp(target, "recovery") == 0)
Expand All @@ -94,6 +94,17 @@ int main(int argc, FAR char **argv)
{
adb_context_t *ctx;

#ifdef CONFIG_ADBD_USB_BOARDCTL
struct boardioc_usbdev_ctrl_s ctrl;
# ifdef CONFIG_USBDEV_COMPOSITE
uint8_t usbdev = BOARDIOC_USBDEV_COMPOSITE;
# else
uint8_t usbdev = BOARDIOC_USBDEV_ADB;
# endif
FAR void *handle;
int ret;
#endif

#ifdef CONFIG_ADBD_BOARD_INIT
boardctl(BOARDIOC_INIT, 0);
#endif /* CONFIG_ADBD_BOARD_INIT */
Expand All @@ -102,15 +113,6 @@ int main(int argc, FAR char **argv)

/* Setup USBADB device */

struct boardioc_usbdev_ctrl_s ctrl;
#ifdef CONFIG_USBDEV_COMPOSITE
uint8_t usbdev = BOARDIOC_USBDEV_COMPOSITE;
#else
uint8_t usbdev = BOARDIOC_USBDEV_ADB;
#endif
FAR void *handle;
int ret;

/* Perform architecture-specific initialization */

ctrl.usbdev = usbdev;
Expand Down Expand Up @@ -151,7 +153,7 @@ int main(int argc, FAR char **argv)
ctx = adb_hal_create_context();
if (!ctx)
{
return -1;
return 1;
}

adb_hal_run(ctx);
Expand Down

0 comments on commit e4e43a1

Please sign in to comment.