[app] tweak app start to only run apps with entry points defined

Also remove a few empty extraneous app structs that are not doing
anything currently.
This commit is contained in:
Travis Geiselbrecht
2022-04-29 20:38:15 -07:00
parent 914c9c2a2f
commit 9a39da5651
3 changed files with 5 additions and 13 deletions

View File

@@ -45,6 +45,11 @@ static int app_thread_entry(void *arg) {
}
static void start_app(const struct app_descriptor *app, bool detach) {
/* dont start an app that has no entry point */
if (app->entry == NULL) {
return;
}
uint32_t stack_size = (app->flags & APP_FLAG_CUSTOM_STACK_SIZE) ? app->stack_size : DEFAULT_STACK_SIZE;
printf("starting app %s\n", app->name);

View File

@@ -324,7 +324,3 @@ out:
STATIC_COMMAND_START
STATIC_COMMAND("string", "memcpy tests", &string_tests)
STATIC_COMMAND_END(stringtests);
APP_START(stringtests)
APP_END

View File

@@ -23,12 +23,3 @@ STATIC_COMMAND("fibo", "threaded fibonacci", &fibo)
STATIC_COMMAND("spinner", "create a spinning thread", &spinner)
STATIC_COMMAND("cbuf_tests", "test lib/cbuf", &cbuf_tests)
STATIC_COMMAND_END(tests);
static void tests_init(const struct app_descriptor *app) {
}
APP_START(tests)
.init = tests_init,
.flags = 0,
APP_END