From d9805d38e2b98e75b3f03335ca6c5f9332ec2fcb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 21 May 2017 12:12:45 -0600 Subject: [PATCH] apps/system/ramtest: Make stacksize and priority conigurable. --- system/ramtest/Kconfig | 20 ++++++++++++++++++++ system/ramtest/Makefile | 22 +++++++++++++--------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/system/ramtest/Kconfig b/system/ramtest/Kconfig index b02a9bcdb..7c78efbb9 100644 --- a/system/ramtest/Kconfig +++ b/system/ramtest/Kconfig @@ -8,3 +8,23 @@ config SYSTEM_RAMTEST default n ---help--- Enable a simple RAM test. + +if SYSTEM_RAMTEST + +config SYSTEM_RAMTEST_PROGNAME + string "Program name" + default "ramtest" + depends on BUILD_KERNEL + ---help--- + This is the name of the program that will be use when the NSH ELF + program is installed. + +config SYSTEM_RAMTEST_PRIORITY + int "RAM test task priority" + default 100 + +config SYSTEM_RAMTEST_STACKSIZE + int "RAM test stack size" + default 1024 + +endif diff --git a/system/ramtest/Makefile b/system/ramtest/Makefile index a771e57bc..bdace6b1a 100644 --- a/system/ramtest/Makefile +++ b/system/ramtest/Makefile @@ -1,7 +1,7 @@ ############################################################################ # apps/system/ramtest/Makefile # -# Copyright (C) 2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -39,8 +39,15 @@ include $(APPDIR)/Make.defs # RAM test -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 768 +CONFIG_SYSTEM_RAMTEST_PRIORITY ?= SCHED_PRIORITY_DEFAULT +CONFIG_SYSTEM_RAMTEST_STACKSIZE ?= 1024 + +APPNAME = ramtest +PRIORITY = $(CONFIG_SYSTEM_RAMTEST_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_RAMTEST_STACKSIZE) + +CONFIG_SYSTEM_RAMTEST_PROGNAME ?= ramtest$(EXEEXT) +PROGNAME = $(CONFIG_SYSTEM_RAMTEST_PROGNAME) ASRCS = CSRCS = @@ -73,9 +80,6 @@ else INSTALL_DIR = $(BIN_DIR) endif -CONFIG_XYZ_PROGNAME ?= ramtest$(EXEEXT) -PROGNAME = $(CONFIG_XYZ_PROGNAME) - ROOTDEPPATH = --dep-path . # Common build @@ -111,10 +115,10 @@ endif # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)ramtest.bdat: $(DEPCONFIG) Makefile - $(call REGISTER,"ramtest",$(PRIORITY),$(STACKSIZE),ramtest_main) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME).bdat: $(DEPCONFIG) Makefile + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -context: $(BUILTIN_REGISTRY)$(DELIM)ramtest.bdat +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME).bdat else context: endif