| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | #ifndef _ORANGE_H#define _ORANGE_H#include <stdint.h>#include "mbox.h"#include "device.h"#define ORANGE_CMD_SIZE 512#define ORANGE_PROMPT "Orange>>"#define SECTION(x)                  __attribute__((section(x)))typedef struct{	uint8_t echo_mode;	char line[ORANGE_CMD_SIZE];	uint16_t line_position;	Mbox_t rx_mb;/* ½ÓÊÕÊý¾ÝÓÊÏä*/	Dev_t device;}Orange_Shell_t;typedef int (*syscall_func)();/* system call table */typedef struct{	const char*		name;		/* the name of system call */	const char*		desc;		/* description of system call */	syscall_func func;		/* the function address of system call */}Orange_Syscall_t;/** * * This macro exports a system function with an alias name to organge shell. * * @param name the name of function. * @param alias the alias name of function. * @param desc the description of function, which will show in help. */#define ORANGE_FUNCTION_EXPORT(name, alias, desc)		\const char __osym_##alias##_name[] = #alias; 				 \const char __osym_##alias##_desc[] = desc;					 \const Orange_Syscall_t __osym_##alias SECTION("OSymTab")= \{							\	__osym_##alias##_name,	\	__osym_##alias##_desc,	\	(syscall_func)&name 	\};//lint -e102 -e10 -e562 -e505 -e546 -e522 -e533 -e19 -e963, 102 Illegal parameter specification, 10 Expecting ',' or ')', 562 Ellipsis (...) assumedvoid Orange_Printf(const char *fmt, ...);void Orange_SetDev(const char* dev_id);int Orange_Strncmp(const char *str1, const char *str2, int count);void Orange_Shell(void);char *Orange_GetParam(char *src, uint8_t param_no);int Orange_SyscallExcute(char *ch,Orange_Syscall_t ** SysCallResult);#endif  /* _ORANGE_H */
 |