[app] convert the existing apps to the app modules, add new shell app to
contain the console
This commit is contained in:
7
app/shell/rules.mk
Normal file
7
app/shell/rules.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
LOCAL_DIR := $(GET_LOCAL_DIR)
|
||||
|
||||
MODULES += \
|
||||
lib/console
|
||||
|
||||
OBJS += \
|
||||
$(LOCAL_DIR)/shell.o
|
||||
37
app/shell/shell.c
Normal file
37
app/shell/shell.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Travis Geiselbrecht
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files
|
||||
* (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge,
|
||||
* publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
* and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <app.h>
|
||||
#include <debug.h>
|
||||
#include <lib/console.h>
|
||||
|
||||
static void shell_init(const struct _app_descriptor *app, void *args)
|
||||
{
|
||||
console_init();
|
||||
console_start();
|
||||
}
|
||||
|
||||
APP_START(shell)
|
||||
.entry = shell_init,
|
||||
.flags = APP_FLAG_BOOT_START | APP_FLAG_THREAD,
|
||||
APP_END
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <debug.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <app.h>
|
||||
#include <platform.h>
|
||||
#include <kernel/thread.h>
|
||||
|
||||
@@ -243,3 +244,8 @@ STATIC_COMMAND_END(stringtests);
|
||||
|
||||
#endif
|
||||
|
||||
APP_START(stringtests)
|
||||
.entry = 0,
|
||||
.flags = 0,
|
||||
APP_END
|
||||
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
#ifndef __APP_TESTS_H
|
||||
#define __APP_TESTS_H
|
||||
|
||||
void tests_init(void);
|
||||
|
||||
int thread_tests(void);
|
||||
void printf_tests(void);
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include <app.h>
|
||||
#include <debug.h>
|
||||
#include <app/tests.h>
|
||||
#include <compiler.h>
|
||||
|
||||
@@ -33,7 +35,12 @@ STATIC_COMMAND_END(tests);
|
||||
|
||||
#endif
|
||||
|
||||
void tests_init(void)
|
||||
static void tests_init(const struct _app_descriptor *app, void *args)
|
||||
{
|
||||
}
|
||||
|
||||
APP_START(tests)
|
||||
.entry = tests_init,
|
||||
.flags = APP_FLAG_BOOT_START,
|
||||
APP_END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user