Skip to content

Commit e4e43a1

Browse files
xiaoxiang781216GUIDINGLI
authored andcommitted
adb: Don't declare variables in the middle of function
and unify the prefix from ADB to ADBD Signed-off-by: Xiang Xiao <[email protected]>
1 parent db0e0b9 commit e4e43a1

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

system/adb/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,17 @@ config ADBD_FILE_SERVICE
128128

129129
config ADBD_FILE_SYMLINK
130130
bool "File service symlink support"
131-
default n
132131
depends on ADBD_FILE_SERVICE
133132
depends on PSEUDOFS_SOFTLINKS
133+
default PSEUDOFS_SOFTLINKS
134134
---help---
135135
Enable fs symlink support.
136136

137137
config ADBD_SHELL_SERVICE
138138
bool "ADB shell support"
139139
depends on SYSTEM_NSH
140-
select LIBC_EXECFUNCS
141-
select PSEUDOTERM
140+
depends on LIBC_EXECFUNCS
141+
depends on PSEUDOTERM
142142
default n
143143
---help---
144144
Enable "adb shell" feature.

system/adb/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@
2020

2121
include $(APPDIR)/Make.defs
2222

23-
ADBD_URL ?= "https://github.com/spiriou/microADB/archive"
24-
ADBD_VERSION ?= b0bc09a7612000186df723f2fe55705b1c2fe873
23+
ADB_URL ?= "https://github.com/spiriou/microADB/archive"
24+
ADB_VERSION ?= b0bc09a7612000186df723f2fe55705b1c2fe873
2525

2626
ADB_DIR := $(APPDIR)/system/adb
2727
ADB_UNPACKNAME := microADB
2828
ADB_UNPACKDIR := $(ADB_DIR)/$(ADB_UNPACKNAME)
2929

3030
$(ADB_UNPACKDIR):
3131
@echo "Downloading: $(ADB_UNPACKNAME)"
32-
$(Q) curl -O -L $(ADBD_URL)/$(ADBD_VERSION).zip
33-
$(Q) unzip -o $(ADBD_VERSION).zip
34-
$(call DELFILE, $(ADBD_VERSION).zip)
35-
$(call MOVEFILE, $(ADB_UNPACKNAME)-$(ADBD_VERSION), $(ADB_UNPACKDIR))
32+
$(Q) curl -O -L $(ADB_URL)/$(ADB_VERSION).zip
33+
$(Q) unzip -o $(ADB_VERSION).zip
34+
$(call DELFILE, $(ADB_VERSION).zip)
35+
$(call MOVEFILE, $(ADB_UNPACKNAME)-$(ADB_VERSION), $(ADB_UNPACKDIR))
3636

3737
# adb server app
3838

3939
PROGNAME := $(CONFIG_ADBD_PROGNAME)
4040
PRIORITY := $(CONFIG_ADBD_PRIORITY)
4141
STACKSIZE := $(CONFIG_ADBD_STACKSIZE)
42-
MODULE := $(CONFIG_ADB_SERVER)
42+
MODULE := $(CONFIG_SYSTEM_ADBD)
4343

4444
# Files
4545

system/adb/adb_main.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#endif
3434

3535
#ifdef CONFIG_ADBD_NET_INIT
36-
#include "netutils/netinit.h"
36+
# include "netutils/netinit.h"
3737
#endif
3838

3939
/****************************************************************************
@@ -70,7 +70,7 @@ void adb_log_impl(int priority, FAR const char *func, int line,
7070
va_end(ap);
7171
}
7272

73-
void adb_reboot_impl(const char *target)
73+
void adb_reboot_impl(FAR const char *target)
7474
{
7575
#ifdef CONFIG_BOARDCTL_RESET
7676
if (strcmp(target, "recovery") == 0)
@@ -94,6 +94,17 @@ int main(int argc, FAR char **argv)
9494
{
9595
adb_context_t *ctx;
9696

97+
#ifdef CONFIG_ADBD_USB_BOARDCTL
98+
struct boardioc_usbdev_ctrl_s ctrl;
99+
# ifdef CONFIG_USBDEV_COMPOSITE
100+
uint8_t usbdev = BOARDIOC_USBDEV_COMPOSITE;
101+
# else
102+
uint8_t usbdev = BOARDIOC_USBDEV_ADB;
103+
# endif
104+
FAR void *handle;
105+
int ret;
106+
#endif
107+
97108
#ifdef CONFIG_ADBD_BOARD_INIT
98109
boardctl(BOARDIOC_INIT, 0);
99110
#endif /* CONFIG_ADBD_BOARD_INIT */
@@ -102,15 +113,6 @@ int main(int argc, FAR char **argv)
102113

103114
/* Setup USBADB device */
104115

105-
struct boardioc_usbdev_ctrl_s ctrl;
106-
#ifdef CONFIG_USBDEV_COMPOSITE
107-
uint8_t usbdev = BOARDIOC_USBDEV_COMPOSITE;
108-
#else
109-
uint8_t usbdev = BOARDIOC_USBDEV_ADB;
110-
#endif
111-
FAR void *handle;
112-
int ret;
113-
114116
/* Perform architecture-specific initialization */
115117

116118
ctrl.usbdev = usbdev;
@@ -151,7 +153,7 @@ int main(int argc, FAR char **argv)
151153
ctx = adb_hal_create_context();
152154
if (!ctx)
153155
{
154-
return -1;
156+
return 1;
155157
}
156158

157159
adb_hal_run(ctx);

0 commit comments

Comments
 (0)