?? commands.c
字號:
/*
* commands.c
* the genie shell command part for ucosII
* under skyeye
*
* Bugs report: Yang Ye ( yangye@163.net )
* Last modified: 2003-02-19
* changed by: wenjia
*/
#include "includes.h"
#include "commands.h"
command ShellComms[MAX_COMMAND_NUM];
INT8U InitCommands()
{
ShellComms[0].num = 0;
ShellComms[0].name = "hello";
ShellComms[0].CommandFunc = HelloFunc;
ShellComms[1].num = 1;
ShellComms[1].name = "hostname";
ShellComms[1].CommandFunc = HostNameFunc;
return 0;
}
INT8U HelloFunc(INT8U argc,char **argv)
{
int i;
OS_ENTER_CRITICAL();
printf("\n\rHello! I am genie");
printf("\n\ryour argv is :");
OS_ENTER_CRITICAL();
if(argc>0){
for(i=0;i<argc;i++){
OS_ENTER_CRITICAL();
printf("\n\r");
printf(argv[i]);
OS_ENTER_CRITICAL();
}
}
return 0;
}
INT8U HostNameFunc(INT8U argc,char **argv)
{
OS_ENTER_CRITICAL();
printf("\n\rHostname is genies");
OS_ENTER_CRITICAL();
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -