mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 10:52:44 +01:00
* initial import of default project
This commit is contained in:
parent
9a0725369d
commit
2e94065cd9
11
projects/default/Jamfile
Normal file
11
projects/default/Jamfile
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# ukleos default project. Consists of a shell.
|
||||
#
|
||||
# Copyright (C) 2008, 2009 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
#
|
||||
|
||||
SubDir TOP projects default ;
|
||||
|
||||
Module default_project : main.c : shell posix_io uart0 shell_commands ps ;
|
||||
|
||||
UseModule default_project ;
|
38
projects/default/main.c
Normal file
38
projects/default/main.c
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <posix_io.h>
|
||||
#include <shell.h>
|
||||
#include <shell_commands.h>
|
||||
#include <board_uart0.h>
|
||||
|
||||
int shell_readc() {
|
||||
char c = 0;
|
||||
posix_read(uart0_handler_pid, &c, 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
void shell_putchar(int c) {
|
||||
putchar(c);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
puts("Welcome to ukleos!");
|
||||
|
||||
board_uart0_init();
|
||||
|
||||
posix_open(uart0_handler_pid, 0);
|
||||
|
||||
shell_t shell;
|
||||
shell_init(&shell, _shell_command_list, shell_readc, shell_putchar);
|
||||
|
||||
shell_run(&shell);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user