This commit is contained in:
parent
ca9842858c
commit
da231d3977
|
@ -3,6 +3,6 @@
|
||||||
############################################################################
|
############################################################################
|
||||||
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications
|
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications
|
||||||
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications/general_functions/list
|
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications/general_functions/list
|
||||||
# CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications/benchmark
|
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications/benchmark
|
||||||
|
|
||||||
include $(wildcard $(APPDIR)/../../../APP_Framework/Applications/*/Make.defs)
|
include $(wildcard $(APPDIR)/../../../APP_Framework/Applications/*/Make.defs)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,16 +1,16 @@
|
||||||
|
|
||||||
# include $(APPDIR)/Application.mk
|
# include $(APPDIR)/Application.mk
|
||||||
ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
|
# ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
|
||||||
include $(APPDIR)/Make.defs
|
# include $(APPDIR)/Make.defs
|
||||||
CSRCS += $(wildcard src/*/*.c) $(wildcard support/*.c)
|
# CSRCS += $(wildcard src/*/*.c) $(wildcard support/*.c)
|
||||||
include $(APPDIR)/Application.mk
|
# include $(APPDIR)/Application.mk
|
||||||
endif
|
# endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
|
# ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
|
||||||
SRC_DIR :=
|
SRC_DIR :=
|
||||||
ifeq ($(CONFIG_APP_BENCHMARK), y)
|
ifeq ($(CONFIG_APP_BENCHMARK), y)
|
||||||
SRC_DIR += src
|
SRC_DIR += src
|
||||||
SRC_DIR += support
|
SRC_DIR += support
|
||||||
endif
|
endif
|
||||||
include $(KERNEL_ROOT)/compiler.mk
|
include $(KERNEL_ROOT)/compiler.mk
|
||||||
endif
|
# endif
|
||||||
|
|
|
@ -33,7 +33,7 @@ typedef struct BenchmarkPair {
|
||||||
benchmark_handle *handle;
|
benchmark_handle *handle;
|
||||||
char name[15];
|
char name[15];
|
||||||
pthread_t task_ptr;
|
pthread_t task_ptr;
|
||||||
float time;
|
clock_t time;
|
||||||
} BenchmarkPair;
|
} BenchmarkPair;
|
||||||
|
|
||||||
BenchmarkPair bmh_list[] = {
|
BenchmarkPair bmh_list[] = {
|
||||||
|
@ -52,7 +52,7 @@ BenchmarkPair bmh_list[] = {
|
||||||
{.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, //
|
{.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, //
|
||||||
{.handle = &primecount_handle, .name = "primecount", .time = 0}, //
|
{.handle = &primecount_handle, .name = "primecount", .time = 0}, //
|
||||||
{.handle = &qrtest_handle, .name = "qrtest", .time = 0}, //
|
{.handle = &qrtest_handle, .name = "qrtest", .time = 0}, //
|
||||||
// {.handle = &combined_handle, .name = "combined", .time = 0}, //
|
{.handle = &combined_handle, .name = "combined", .time = 0}, //
|
||||||
{.handle = &slre_handle, .name = "slre", .time = 0}, //
|
{.handle = &slre_handle, .name = "slre", .time = 0}, //
|
||||||
{.handle = &libst_handle, .name = "libst", .time = 0}, //
|
{.handle = &libst_handle, .name = "libst", .time = 0}, //
|
||||||
{.handle = &statemate_handle, .name = "statemate", .time = 0}, //
|
{.handle = &statemate_handle, .name = "statemate", .time = 0}, //
|
||||||
|
@ -62,13 +62,19 @@ BenchmarkPair bmh_list[] = {
|
||||||
{.handle = NULL, .name = "", .time = 0}, //
|
{.handle = NULL, .name = "", .time = 0}, //
|
||||||
};
|
};
|
||||||
|
|
||||||
float benchmark_time[25];
|
clock_t benchmark_time[25];
|
||||||
|
|
||||||
|
pthread_attr_t case_attr;
|
||||||
|
pthread_t res_thread;
|
||||||
|
int done_cnt = 0;
|
||||||
|
pthread_mutex_t case_mu;
|
||||||
|
sem_t res_mu;
|
||||||
|
|
||||||
// extern benchmark_handle *get_benchmark_list();
|
// extern benchmark_handle *get_benchmark_list();
|
||||||
extern void add_benchmark_handle(benchmark_handle *, benchmark_handle *);
|
extern void add_benchmark_handle(benchmark_handle *, benchmark_handle *);
|
||||||
|
|
||||||
float tmp_diff = 0.0;
|
clock_t tmp_diff = 0.0;
|
||||||
float global_diff = 0.0;
|
clock_t global_diff = 0.0;
|
||||||
void start_trigger(clock_t *start_time) { *start_time = PrivGetTickTime(); }
|
void start_trigger(clock_t *start_time) { *start_time = PrivGetTickTime(); }
|
||||||
void stop_trigger(clock_t *end_time) { *end_time = PrivGetTickTime(); }
|
void stop_trigger(clock_t *end_time) { *end_time = PrivGetTickTime(); }
|
||||||
|
|
||||||
|
@ -82,7 +88,7 @@ void init_benchmark_runset(benchmark_handle *head) {
|
||||||
}
|
}
|
||||||
void organize_result(const benchmark_handle *handle, clock_t start_time,
|
void organize_result(const benchmark_handle *handle, clock_t start_time,
|
||||||
clock_t end_time) {
|
clock_t end_time) {
|
||||||
tmp_diff = (float)(end_time - start_time) / (10 * TICK_PER_SECOND);
|
tmp_diff = (clock_t)(end_time - start_time);
|
||||||
global_diff += tmp_diff;
|
global_diff += tmp_diff;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (bmh_list[i].handle != NULL) {
|
while (bmh_list[i].handle != NULL) {
|
||||||
|
@ -97,7 +103,7 @@ void organize_result(const benchmark_handle *handle, clock_t start_time,
|
||||||
void print_result() {
|
void print_result() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (bmh_list[i].handle != NULL) {
|
while (bmh_list[i].handle != NULL) {
|
||||||
printf("[BENCHMARK] Time Cost: %-15s %.4f\n", bmh_list[i].name,
|
printf("[BENCHMARK] Time Cost: %-15s %7ld\n", bmh_list[i].name,
|
||||||
bmh_list[i].time);
|
bmh_list[i].time);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -109,17 +115,16 @@ void *print_result_asyn() {
|
||||||
stop_trigger(&g_stop_time);
|
stop_trigger(&g_stop_time);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (bmh_list[i].handle != NULL) {
|
while (bmh_list[i].handle != NULL) {
|
||||||
printf("[BENCHMARK] Time Cost: %-15s %.4f\n", bmh_list[i].name,
|
printf("[BENCHMARK] Time Cost: %-15s %7ld\n", bmh_list[i].name,
|
||||||
bmh_list[i].time);
|
bmh_list[i].time);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
printf("[BENCHMARK] Global Time Diff: %f\n",
|
printf("[BENCHMARK] Global Time Diff: %7ld, %d\n",
|
||||||
(float)((g_stop_time - g_start_time) / (10 * TICK_PER_SECOND)));
|
(clock_t)(g_stop_time - g_start_time), done_cnt);
|
||||||
};
|
};
|
||||||
|
|
||||||
int done_cnt = 0;
|
|
||||||
pthread_mutex_t case_mu;
|
|
||||||
void *run_one_example(void *arg) {
|
void *run_one_example(void *arg) {
|
||||||
|
// printf("Case start.\n");
|
||||||
const benchmark_handle *handle = arg;
|
const benchmark_handle *handle = arg;
|
||||||
assert(handle != NULL);
|
assert(handle != NULL);
|
||||||
clock_t start_time = 0, end_time = 0;
|
clock_t start_time = 0, end_time = 0;
|
||||||
|
@ -137,10 +142,14 @@ void *run_one_example(void *arg) {
|
||||||
PrivMutexObtain(&case_mu);
|
PrivMutexObtain(&case_mu);
|
||||||
organize_result(handle, start_time, end_time);
|
organize_result(handle, start_time, end_time);
|
||||||
PrivMutexAbandon(&case_mu);
|
PrivMutexAbandon(&case_mu);
|
||||||
|
done_cnt++;
|
||||||
|
if (done_cnt == 22) {
|
||||||
|
PrivSemaphoreAbandon(&res_mu);
|
||||||
|
printf("res mu release\n");
|
||||||
|
}
|
||||||
|
// printf("Case done. %d\n", done_cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_attr_t case_attr;
|
|
||||||
pthread_t res_thread;
|
|
||||||
void *run_benchmark_parallel(void *args) {
|
void *run_benchmark_parallel(void *args) {
|
||||||
done_cnt = 0;
|
done_cnt = 0;
|
||||||
volatile int result;
|
volatile int result;
|
||||||
|
@ -153,12 +162,20 @@ void *run_benchmark_parallel(void *args) {
|
||||||
init_benchmark_runset(&head);
|
init_benchmark_runset(&head);
|
||||||
printf("[BENCHMARK] Start Benchmark running parallel.\n");
|
printf("[BENCHMARK] Start Benchmark running parallel.\n");
|
||||||
|
|
||||||
|
#ifdef NUTTX
|
||||||
|
case_attr.priority = 64;
|
||||||
|
case_attr.stacksize = 16384;
|
||||||
|
#else
|
||||||
case_attr.schedparam.sched_priority = 25;
|
case_attr.schedparam.sched_priority = 25;
|
||||||
case_attr.stacksize = 16384;
|
case_attr.stacksize = 16384;
|
||||||
PrivMutexCreate(&case_mu, 0);
|
#endif
|
||||||
|
PrivMutexCreate(&case_mu, NULL);
|
||||||
|
PrivSemaphoreCreate(&res_mu, 0, 0);
|
||||||
|
|
||||||
benchmark_handle *cur_handle = head.next;
|
benchmark_handle *cur_handle = head.next;
|
||||||
|
// print_result();
|
||||||
|
|
||||||
|
// printf("Create Start.\n");
|
||||||
start_trigger(&g_start_time);
|
start_trigger(&g_start_time);
|
||||||
while (NULL != cur_handle) {
|
while (NULL != cur_handle) {
|
||||||
assert(cur_handle->handle.magic_number != MAGIC_NUMBER);
|
assert(cur_handle->handle.magic_number != MAGIC_NUMBER);
|
||||||
|
@ -167,9 +184,16 @@ void *run_benchmark_parallel(void *args) {
|
||||||
|
|
||||||
cur_handle = cur_handle->next;
|
cur_handle = cur_handle->next;
|
||||||
}
|
}
|
||||||
|
// printf("Create done.\n");
|
||||||
|
|
||||||
|
PrivSemaphoreObtainWait(&res_mu, NULL);
|
||||||
|
#ifdef NUTTX
|
||||||
|
case_attr.priority = 64;
|
||||||
|
case_attr.stacksize = 16384;
|
||||||
|
#else
|
||||||
case_attr.schedparam.sched_priority = 23;
|
case_attr.schedparam.sched_priority = 23;
|
||||||
case_attr.stacksize = 4096;
|
case_attr.stacksize = 16384;
|
||||||
|
#endif
|
||||||
PrivTaskCreate(&res_thread, &case_attr, print_result_asyn, NULL);
|
PrivTaskCreate(&res_thread, &case_attr, print_result_asyn, NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -209,21 +233,31 @@ void *run_benchmark_sequential(void *args) {
|
||||||
stop_trigger(&s_stop_time);
|
stop_trigger(&s_stop_time);
|
||||||
|
|
||||||
print_result();
|
print_result();
|
||||||
printf("[BENCHMARK] Global Time Diff: %f\n",
|
printf("[BENCHMARK] Global Time Diff: %7ld\n",
|
||||||
(float)((s_stop_time - s_start_time) / (10 * TICK_PER_SECOND)));
|
(clock_t)(s_stop_time - s_start_time));
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_t main_thread;
|
pthread_t main_thread;
|
||||||
static int embenchmark_parallel() {
|
int embenchmark_parallel() {
|
||||||
|
#ifdef NUTTX
|
||||||
|
case_attr.priority = 128;
|
||||||
|
case_attr.stacksize = 16384;
|
||||||
|
#else
|
||||||
case_attr.schedparam.sched_priority = 30;
|
case_attr.schedparam.sched_priority = 30;
|
||||||
case_attr.stacksize = 16384;
|
case_attr.stacksize = 16384;
|
||||||
|
#endif
|
||||||
PrivTaskCreate(&main_thread, &case_attr, run_benchmark_parallel, NULL);
|
PrivTaskCreate(&main_thread, &case_attr, run_benchmark_parallel, NULL);
|
||||||
// run_benchmark_parallel(NULL);
|
// run_benchmark_parallel(NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static int embenchmark_sequential(void) {
|
int embenchmark_sequential(void) {
|
||||||
case_attr.schedparam.sched_priority = 20;
|
#ifdef NUTTX
|
||||||
|
case_attr.priority = 128;
|
||||||
case_attr.stacksize = 16384;
|
case_attr.stacksize = 16384;
|
||||||
|
#else
|
||||||
|
case_attr.schedparam.sched_priority = 30;
|
||||||
|
case_attr.stacksize = 16384;
|
||||||
|
#endif
|
||||||
PrivTaskCreate(&main_thread, &case_attr, run_benchmark_sequential, NULL);
|
PrivTaskCreate(&main_thread, &case_attr, run_benchmark_sequential, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <transform.h>
|
#include <transform.h>
|
||||||
|
|
||||||
#define CPU_MHZ 5
|
#define CPU_MHZ 400
|
||||||
// int CPU_MHZ = 500;
|
// int CPU_MHZ = 500;
|
||||||
|
|
||||||
/* Benchmarks must implement verify_benchmark, which must return -1 if no
|
/* Benchmarks must implement verify_benchmark, which must return -1 if no
|
||||||
|
|
|
@ -1445,6 +1445,10 @@ int nsh_unsetvar(FAR struct nsh_vtbl_s *vtbl, FAR const char *name);
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
int cmd_benchmark_sequential(FAR struct nsh_vtbl_s *vtbl, int argc,
|
||||||
|
char **argv);
|
||||||
|
int cmd_benchmark_parallel(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||||
|
|
||||||
#if defined(CONFIG_NSH_VARS) && !defined(CONFIG_NSH_DISABLE_SET)
|
#if defined(CONFIG_NSH_VARS) && !defined(CONFIG_NSH_DISABLE_SET)
|
||||||
int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
|
|
|
@ -520,3 +520,18 @@ int cmd_cantest(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int embenchmark_sequential(void);
|
||||||
|
int cmd_benchmark_sequential(FAR struct nsh_vtbl_s *vtbl, int argc,
|
||||||
|
char **argv) {
|
||||||
|
nsh_output(vtbl, "Embenchmark Sequential.\n");
|
||||||
|
embenchmark_sequential();
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int embenchmark_parallel(void);
|
||||||
|
int cmd_benchmark_parallel(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) {
|
||||||
|
nsh_output(vtbl, "Embenchmark parallel.\n");
|
||||||
|
embenchmark_parallel();
|
||||||
|
return OK;
|
||||||
|
}
|
|
@ -93,8 +93,7 @@ static int cmd_unrecognized(FAR struct nsh_vtbl_s *vtbl, int argc,
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static const struct cmdmap_s g_cmdmap[] =
|
static const struct cmdmap_s g_cmdmap[] = {
|
||||||
{
|
|
||||||
#if defined(CONFIG_FILE_STREAM) && !defined(CONFIG_NSH_DISABLESCRIPT)
|
#if defined(CONFIG_FILE_STREAM) && !defined(CONFIG_NSH_DISABLESCRIPT)
|
||||||
#ifndef CONFIG_NSH_DISABLE_SOURCE
|
#ifndef CONFIG_NSH_DISABLE_SOURCE
|
||||||
{".", cmd_source, 2, 2, "<script-path>"},
|
{".", cmd_source, 2, 2, "<script-path>"},
|
||||||
|
@ -109,17 +108,22 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
{"?", cmd_help, 1, 1, NULL},
|
{"?", cmd_help, 1, 1, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_ADDROUTE)
|
{"benchmarksequential", cmd_benchmark_sequential, 1, 1,
|
||||||
|
"run benchmark sequentially."},
|
||||||
|
{"benchmarkparallel", cmd_benchmark_parallel, 1, 1,
|
||||||
|
"run benchmark parallel."},
|
||||||
|
|
||||||
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_ADDROUTE)
|
||||||
{"addroute", cmd_addroute, 3, 4, "<target> [<netmask>] <router>"},
|
{"addroute", cmd_addroute, 3, 4, "<target> [<netmask>] <router>"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ARP) && !defined(CONFIG_NSH_DISABLE_ARP)
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_ARP) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_ARP)
|
||||||
#ifdef CONFIG_NETLINK_ROUTE
|
#ifdef CONFIG_NETLINK_ROUTE
|
||||||
{ "arp", cmd_arp, 2, 4,
|
{"arp", cmd_arp, 2, 4, "[-t|-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]"},
|
||||||
"[-t|-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]" },
|
|
||||||
#else
|
#else
|
||||||
{ "arp", cmd_arp, 3, 4,
|
{"arp", cmd_arp, 3, 4, "[-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]"},
|
||||||
"[-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]" },
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -173,7 +177,8 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
"[skip=<sectors>]"},
|
"[skip=<sectors>]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_DELROUTE)
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_DELROUTE)
|
||||||
{"delroute", cmd_delroute, 2, 3, "<target> [<netmask>]"},
|
{"delroute", cmd_delroute, 2, 3, "<target> [<netmask>]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -309,8 +314,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_MB
|
#ifndef CONFIG_NSH_DISABLE_MB
|
||||||
{ "mb", cmd_mb, 2, 3,
|
{"mb", cmd_mb, 2, 3, "<hex-address>[=<hex-value>] [<hex-byte-count>]"},
|
||||||
"<hex-address>[=<hex-value>] [<hex-byte-count>]" },
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5)
|
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5)
|
||||||
|
@ -340,8 +344,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_MKRD
|
#ifndef CONFIG_NSH_DISABLE_MKRD
|
||||||
{ "mkrd", cmd_mkrd, 2, 6,
|
{"mkrd", cmd_mkrd, 2, 6, "[-m <minor>] [-s <sector-size>] <nsectors>"},
|
||||||
"[-m <minor>] [-s <sector-size>] <nsectors>" },
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_SMARTFS) && \
|
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_SMARTFS) && \
|
||||||
|
@ -357,8 +360,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_MH
|
#ifndef CONFIG_NSH_DISABLE_MH
|
||||||
{ "mh", cmd_mh, 2, 3,
|
{"mh", cmd_mh, 2, 3, "<hex-address>[=<hex-value>] [<hex-byte-count>]"},
|
||||||
"<hex-address>[=<hex-value>] [<hex-byte-count>]" },
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
|
#if !defined(CONFIG_DISABLE_MOUNTPOINT)
|
||||||
|
@ -380,8 +382,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_MW
|
#ifndef CONFIG_NSH_DISABLE_MW
|
||||||
{ "mw", cmd_mw, 2, 3,
|
{"mw", cmd_mw, 2, 3, "<hex-address>[=<hex-value>] [<hex-byte-count>]"},
|
||||||
"<hex-address>[=<hex-value>] [<hex-byte-count>]" },
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NET) && \
|
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NET) && \
|
||||||
|
@ -396,8 +397,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
{"nslookup", cmd_nslookup, 2, 2, "<host-name>"},
|
{"nslookup", cmd_nslookup, 2, 2, "<host-name>"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && \
|
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NSH_LOGIN_PASSWD) && \
|
||||||
defined(CONFIG_NSH_LOGIN_PASSWD) && \
|
|
||||||
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
|
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
|
||||||
#ifndef CONFIG_NSH_DISABLE_PASSWD
|
#ifndef CONFIG_NSH_DISABLE_PASSWD
|
||||||
{"passwd", cmd_passwd, 3, 3, "<username> <password>"},
|
{"passwd", cmd_passwd, 3, 3, "<username> <password>"},
|
||||||
|
@ -571,8 +571,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && \
|
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NSH_LOGIN_PASSWD) && \
|
||||||
defined(CONFIG_NSH_LOGIN_PASSWD) && \
|
|
||||||
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
|
!defined(CONFIG_FSUTILS_PASSWD_READONLY)
|
||||||
#ifndef CONFIG_NSH_DISABLE_USERADD
|
#ifndef CONFIG_NSH_DISABLE_USERADD
|
||||||
{"useradd", cmd_useradd, 3, 3, "<username> <password>"},
|
{"useradd", cmd_useradd, 3, 3, "<username> <password>"},
|
||||||
|
@ -616,7 +615,8 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
{"lcd", cmd_Lcd, 1, 1, "[LCD demo cmd.]"},
|
{"lcd", cmd_Lcd, 1, 1, "[LCD demo cmd.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_USER_TEST_SEMC) && !defined(CONFIG_NSH_DISABLE_USER_TEST_SEMC)
|
#if defined(CONFIG_USER_TEST_SEMC) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_USER_TEST_SEMC)
|
||||||
{"sram", cmd_Extsram, 1, 1, "[Extra sdram demo cmd.]"},
|
{"sram", cmd_Extsram, 1, 1, "[Extra sdram demo cmd.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -627,104 +627,139 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
{"tcprecv", cmd_Tcprecv, 1, 2, "[Tcp recv demo cmd.]"},
|
{"tcprecv", cmd_Tcprecv, 1, 2, "[Tcp recv demo cmd.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && !defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS)
|
#if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && \
|
||||||
{ "hcho1os", cmd_Hcho1os, 1, 1, "[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]" },
|
!defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS)
|
||||||
|
{"hcho1os", cmd_Hcho1os, 1, 1,
|
||||||
|
"[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TB600B_TVOC10)
|
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && \
|
||||||
{ "tvoc10", cmd_Tvoc10, 1, 1, "[get the concentration of tvoc with sensor tb600b_tvoc10.]" },
|
!defined(CONFIG_NSH_DISABLE_TB600B_TVOC10)
|
||||||
|
{"tvoc10", cmd_Tvoc10, 1, 1,
|
||||||
|
"[get the concentration of tvoc with sensor tb600b_tvoc10.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_IAQ_TB600B_IAQ10) && !defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
|
#if defined(CONFIG_APPLICATION_SENSOR_IAQ_TB600B_IAQ10) && \
|
||||||
{ "iaq10", cmd_Iaq10, 1, 1, "[get air quality data with sensor Tb600bIaq10.]" },
|
!defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
|
||||||
|
{"iaq10", cmd_Iaq10, 1, 1,
|
||||||
|
"[get air quality data with sensor Tb600bIaq10.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_CH4_AS830) && !defined(CONFIG_NSH_DISABLE_CH4_AS830)
|
#if defined(CONFIG_APPLICATION_SENSOR_CH4_AS830) && \
|
||||||
{ "as830", cmd_As830, 1, 1, "[get the concentration of CH4 with sensor ch4_as830.]" },
|
!defined(CONFIG_NSH_DISABLE_CH4_AS830)
|
||||||
|
{"as830", cmd_As830, 1, 1,
|
||||||
|
"[get the concentration of CH4 with sensor ch4_as830.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_ZG09) && !defined(CONFIG_NSH_DISABLE_CO2ZG09)
|
#if defined(CONFIG_APPLICATION_SENSOR_CO2_ZG09) && \
|
||||||
{ "zg09", cmd_Co2Zg09, 1, 1, "[get the concentration of co2 with sensor ZG09.]" },
|
!defined(CONFIG_NSH_DISABLE_CO2ZG09)
|
||||||
|
{"zg09", cmd_Co2Zg09, 1, 1,
|
||||||
|
"[get the concentration of co2 with sensor ZG09.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
|
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && \
|
||||||
{ "g8s", cmd_Co2G8S, 1, 1, "[get the concentration of co2 with sensor G8S.]" },
|
!defined(CONFIG_NSH_DISABLE_CO2G8S)
|
||||||
|
{"g8s", cmd_Co2G8S, 1, 1,
|
||||||
|
"[get the concentration of co2 with sensor G8S.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
|
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
|
||||||
{"pm1.0", cmd_Pm10Ps5308, 1, 1, "[get pm1.0 with sensor Ps5308.]"},
|
{"pm1.0", cmd_Pm10Ps5308, 1, 1, "[get pm1.0 with sensor Ps5308.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_PM2_5_PS5308) && !defined(CONFIG_NSH_DISABLE_PM2_5PS5308)
|
#if defined(CONFIG_APPLICATION_SENSOR_PM2_5_PS5308) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_PM2_5PS5308)
|
||||||
{"pm2.5", cmd_Pm25Ps5308, 1, 1, "[get pm2.5 with sensor Ps5308.]"},
|
{"pm2.5", cmd_Pm25Ps5308, 1, 1, "[get pm2.5 with sensor Ps5308.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_PM10_PS5308) && !defined(CONFIG_NSH_DISABLE_PM10PS5308)
|
#if defined(CONFIG_APPLICATION_SENSOR_PM10_PS5308) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_PM10PS5308)
|
||||||
{"pm10", cmd_Pm100Ps5308, 1, 1, "[get pm10 with sensor Ps5308.]"},
|
{"pm10", cmd_Pm100Ps5308, 1, 1, "[get pm10 with sensor Ps5308.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_VOICE_D124) && !defined(CONFIG_NSH_DISABLE_VOICED124)
|
#if defined(CONFIG_APPLICATION_SENSOR_VOICE_D124) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_VOICED124)
|
||||||
{"d124", cmd_VoiceD124, 1, 1, "[get decibel of noise with sensor D124.]"},
|
{"d124", cmd_VoiceD124, 1, 1, "[get decibel of noise with sensor D124.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_TEMPERATURE_HS300X) && !defined(CONFIG_NSH_DISABLE_TEMPHS300X)
|
#if defined(CONFIG_APPLICATION_SENSOR_TEMPERATURE_HS300X) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_TEMPHS300X)
|
||||||
{"temp", cmd_TempHs300x, 1, 1, "[get temperature with sensor HS300x.]"},
|
{"temp", cmd_TempHs300x, 1, 1, "[get temperature with sensor HS300x.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_HUMIDITY_HS300X) && !defined(CONFIG_NSH_DISABLE_HUMIHS300X)
|
#if defined(CONFIG_APPLICATION_SENSOR_HUMIDITY_HS300X) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_HUMIHS300X)
|
||||||
{"humi", cmd_HumiHs300x, 1, 1, "[get humidity with sensor HS300x.]"},
|
{"humi", cmd_HumiHs300x, 1, 1, "[get humidity with sensor HS300x.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_WINDDIRECTION_QS_FX) && !defined(CONFIG_NSH_DISABLE_QS_FX)
|
#if defined(CONFIG_APPLICATION_SENSOR_WINDDIRECTION_QS_FX) && \
|
||||||
{ "WindDirectionQsFx", cmd_WindDirectionQsFx, 1, 1, "[get WindDirection with sensor QsFx.]" },
|
!defined(CONFIG_NSH_DISABLE_QS_FX)
|
||||||
|
{"WindDirectionQsFx", cmd_WindDirectionQsFx, 1, 1,
|
||||||
|
"[get WindDirection with sensor QsFx.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_APPLICATION_SENSOR_WINDSPEED_QS_FS) && !defined(CONFIG_NSH_DISABLE_QS_FS)
|
#if defined(CONFIG_APPLICATION_SENSOR_WINDSPEED_QS_FS) && \
|
||||||
{ "WindSpeedQsFs", cmd_WindSpeedQsFs, 1, 1, "[get WindSpeed with sensor QsFs.]" },
|
!defined(CONFIG_NSH_DISABLE_QS_FS)
|
||||||
|
{"WindSpeedQsFs", cmd_WindSpeedQsFs, 1, 1,
|
||||||
|
"[get WindSpeed with sensor QsFs.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_CONNECTION_ADAPTER_ZIGBEE) && !defined(CONFIG_NSH_DISABLE_OPENZIGBEE)
|
#if defined(CONFIG_CONNECTION_ADAPTER_ZIGBEE) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_OPENZIGBEE)
|
||||||
{"openzigbee", cmd_openzigbee, 1, 1, "[open the zigebee device.]"},
|
{"openzigbee", cmd_openzigbee, 1, 1, "[open the zigebee device.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_CONNECTION_ADAPTER_ZIGBEE) && !defined(CONFIG_NSH_DISABLE_SENDZIGBEE)
|
#if defined(CONFIG_CONNECTION_ADAPTER_ZIGBEE) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_SENDZIGBEE)
|
||||||
{"sendzigbee", cmd_sendzigbee, 2, 2, "[sendzigbee <message>]"},
|
{"sendzigbee", cmd_sendzigbee, 2, 2, "[sendzigbee <message>]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_CONNECTION_ADAPTER_ZIGBEE) && !defined(CONFIG_NSH_DISABLE_RECVZIGBEE)
|
#if defined(CONFIG_CONNECTION_ADAPTER_ZIGBEE) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_RECVZIGBEE)
|
||||||
{"recvzigbee", cmd_recvzigbee, 1, 1, "[receive message.]"},
|
{"recvzigbee", cmd_recvzigbee, 1, 1, "[receive message.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(CONFIG_ADAPTER_LORA_SX1278) || defined(CONFIG_ADAPTER_LORA_E220) || defined(CONFIG_ADAPTER_LORA_E22)) && \
|
#if (defined(CONFIG_ADAPTER_LORA_SX1278) || \
|
||||||
|
defined(CONFIG_ADAPTER_LORA_E220) || defined(CONFIG_ADAPTER_LORA_E22)) && \
|
||||||
!defined(CONFIG_NSH_DISABLE_ADAPTER_LORATEST)
|
!defined(CONFIG_NSH_DISABLE_ADAPTER_LORATEST)
|
||||||
{"AdapterLoraTest", cmd_AdapterLoraTest, 1, 1, "[Lora test.]"},
|
{"AdapterLoraTest", cmd_AdapterLoraTest, 1, 1, "[Lora test.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ADAPTER_4G_EC200T) && !defined(CONFIG_NSH_DISABLE_ADAPTER_4GTEST)
|
#if defined(CONFIG_ADAPTER_4G_EC200T) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_ADAPTER_4GTEST)
|
||||||
{"Adapter4GTest", cmd_Adapter4GTest, 1, 1, "[4G ec200t test.]"},
|
{"Adapter4GTest", cmd_Adapter4GTest, 1, 1, "[4G ec200t test.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_RECEIVE)
|
#if defined(CONFIG_ADAPTER_LORA_E220) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_E220_LORA_RECEIVE)
|
||||||
{"E220Receive", cmd_E220LoraReceive, 1, 1, "[e220 lora receive.]"},
|
{"E220Receive", cmd_E220LoraReceive, 1, 1, "[e220 lora receive.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ADAPTER_LORA_E220) && !defined(CONFIG_NSH_DISABLE_E220_LORA_SEND)
|
#if defined(CONFIG_ADAPTER_LORA_E220) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_E220_LORA_SEND)
|
||||||
{"E220Send", cmd_E220LoraSend, 1, 2, "[e220loraSend <message>]"},
|
{"E220Send", cmd_E220LoraSend, 1, 2, "[e220loraSend <message>]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ADAPTER_LORA_E22) && !defined(CONFIG_NSH_DISABLE_E22_LORA_RECEIVE)
|
#if defined(CONFIG_ADAPTER_LORA_E22) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_E22_LORA_RECEIVE)
|
||||||
{"E22Receive", cmd_E22LoraReceive, 1, 1, "[e22 lora receive.]"},
|
{"E22Receive", cmd_E22LoraReceive, 1, 1, "[e22 lora receive.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ADAPTER_LORA_E22) && !defined(CONFIG_NSH_DISABLE_E22_LORA_SEND)
|
#if defined(CONFIG_ADAPTER_LORA_E22) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_E22_LORA_SEND)
|
||||||
{"E22Send", cmd_E22LoraSend, 1, 2, "[e22loraSend <message>]"},
|
{"E22Send", cmd_E22LoraSend, 1, 2, "[e22loraSend <message>]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_ADAPTER_BLUETOOTH_HC08) && !defined(CONFIG_NSH_DISABLE_ADAPTER_BLUETOOTH_TEST)
|
#if defined(CONFIG_ADAPTER_BLUETOOTH_HC08) && \
|
||||||
{ "AdapterBlueToothTest", cmd_AdapterBlueToothTest, 1, 1, "[BlueTooth hc08 test.]" },
|
!defined(CONFIG_NSH_DISABLE_ADAPTER_BLUETOOTH_TEST)
|
||||||
|
{"AdapterBlueToothTest", cmd_AdapterBlueToothTest, 1, 1,
|
||||||
|
"[BlueTooth hc08 test.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(CONFIG_ADAPTER_ESP07S_WIFI) || defined(CONFIG_ADAPTER_ESP8285_WIFI)) && !defined(CONFIG_NSH_DISABLE_ADAPTER_WIFI_TEST)
|
#if (defined(CONFIG_ADAPTER_ESP07S_WIFI) || \
|
||||||
|
defined(CONFIG_ADAPTER_ESP8285_WIFI)) && \
|
||||||
|
!defined(CONFIG_NSH_DISABLE_ADAPTER_WIFI_TEST)
|
||||||
{"wifitest", cmd_AdapterWifiTest, 1, 8, "[WIFI test.]"},
|
{"wifitest", cmd_AdapterWifiTest, 1, 8, "[WIFI test.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -740,8 +775,7 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||||
{"cantest", cmd_cantest, 1, 1, "[test can function.]"},
|
{"cantest", cmd_cantest, 1, 1, "[test can function.]"},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{ NULL, NULL, 1, 1, NULL }
|
{NULL, NULL, 1, 1, NULL}};
|
||||||
};
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
|
|
|
@ -62,6 +62,14 @@ APPPATHS += -I$(APPDIR)/../../../APP_Framework/Framework/connection/zigbee
|
||||||
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Framework/connection/zigbee/e18
|
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Framework/connection/zigbee/e18
|
||||||
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Applications/general_functions/list
|
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Applications/general_functions/list
|
||||||
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Framework/transform_layer/nuttx
|
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Framework/transform_layer/nuttx
|
||||||
|
APPPATHS += -I$(APPDIR)/../../../APP_Framework/Applications/benchmark/support
|
||||||
|
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/support
|
||||||
|
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/cubic \
|
||||||
|
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/picojpeg \
|
||||||
|
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/qrduino \
|
||||||
|
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/sglib-combined \
|
||||||
|
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/slre \
|
||||||
|
-lm
|
||||||
|
|
||||||
export SRC_APP_DIR = ../../../APP_Framework
|
export SRC_APP_DIR = ../../../APP_Framework
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue