📄 51main.c
字号:
//********http://www.arm88.com*********//
#include<stdio.h>
#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"
#define prompt() Uart_Printf("\n\\>")
#define ENTER_KEY 0x0d
char * py_ime(char *);
char input_string[6];
unsigned char key,i = 0;
void Main(void)
{
rSYSCFG=CACHECFG; // Using 8KB Cache//
Port_Init();
Uart_Init(0,57600);
Delay(10);
Uart_Select(0); //Select UART0
Uart_Printf("\n请输入拼音字母 **按回车键结束!");
prompt();
i = 0;
for(;;)
{
if(kbhit())
{
key =Uart_GetKey ();
if(key == ENTER_KEY)
{
input_string[i] = 0;
prompt();
Uart_Printf("%s",py_ime(input_string));
prompt();
i = 0;
}
else
{
if(i<7)
{
input_string[i++] = key;
Uart_SendByte(key);
}
else
{
Uart_Printf("\n@@@@@@输入有误!");
prompt();
i = 0;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -