1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/projects/test_shell/test_shell.c

51 lines
965 B
C
Raw Normal View History

2010-09-22 17:25:19 +02:00
/*
* Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de>
*/
#include <stdio.h>
#include <string.h>
#include <malloc.h>
2010-09-24 16:28:34 +02:00
#include <uart0.h>
#include <posix_io.h>
2010-09-22 17:25:19 +02:00
#include <shell.h>
void print_teststart(char* str) {
printf("[TEST_START]\n");
}
void print_testend(char* str) {
printf("[TEST_END]\n");
}
2010-09-24 16:28:34 +02:00
//extern int uart0_init();
//extern int uart0_handler_pid;
int shell_readc() {
char c = 0;
posix_read(uart0_handler_pid, &c, 1);
return c;
}
2010-09-22 17:25:19 +02:00
int main(void) {
//printf("Moin. build on %s %s SVN-Revision: %s\n", kernel_builddate, kernel_buildtime, kernel_svnrevision);
printf("test_shell.\n");
uart0_init();
2010-09-24 16:28:34 +02:00
posix_open(uart0_handler_pid, 0);
2010-09-22 17:25:19 +02:00
shell_t shell;
2010-09-24 16:28:34 +02:00
shell_init(&shell, shell_readc);
2010-09-28 13:39:59 +02:00
shell_auto_init(&shell);
2010-09-22 17:25:19 +02:00
shell_register_cmd(&shell, "start_test", print_teststart);
shell_register_cmd(&shell, "end_test", print_testend);
2010-09-24 16:28:34 +02:00
2010-09-22 17:25:19 +02:00
shell_run(&shell);
return 0;
}