initial shell implement
This commit is contained in:
		
							
								
								
									
										14
									
								
								source/firmware/kernel/interface/shell.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								source/firmware/kernel/interface/shell.h
									
									
									
									
									
										Normal 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_ */
 | 
			
		||||
							
								
								
									
										34
									
								
								source/firmware/kernel/shell.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								source/firmware/kernel/shell.c
									
									
									
									
									
										Normal 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;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user