initial shell implement

This commit is contained in:
tkl 2016-08-01 16:53:06 +02:00
parent a6ba2f7429
commit a2cddd208f
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,14 @@
/*
* shell.h
*
* Created on: Aug 1, 2016
* Author: tkl
*/
#ifndef SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_
#define SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_
int shell_init(const struct driver *shell_device);
int shell_add_command(const char *command, const void *callback, const void *param);
#endif /* SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_ */

View File

@ -0,0 +1,34 @@
/*
* shell.c
*
* Created on: Aug 1, 2016
* Author: tkl
*/
#include <stddef.h>
#include <stdbool.h>
#include "stack.h"
#include "queue.h"
#include "driver.h"
#include "kernel.h"
#define RX_STACK_SIZE 256
stack_t rx_stack[RX_STACK_SIZE];
struct thread_context rx_thread;
void rx_func(void *arg)
{
}
int shell_init(const struct driver *shell_device)
{
thread_create(&rx_thread, rx_stack, RX_STACK_SIZE, rx_func, NULL, THREAD_PRIO_LOW);
return -1;
}
int shell_add_command(const char *command, const void *callback, const void *param)
{
return -1;
}