📄 auxecho.c
字号:
/*
Project must include
commplus.c
infrared.c
cplib.lib */
#include "commplus.h"
#include <stdio.h>
int ESCpressed();
int ESCpressed()
{
int result=0;
asm {
mov ah, 1
int 16h
jz Retit
xor ah, ah
int 16h
cmp ax, 011bh
jnz Retit
not result
}
Retit:
return(result);
}
main()
{
unsigned char ascch, auxb, auxstat;
int exitloop=0;
unsigned char workmode, commport;
unsigned int baudrate;
GetCommMode(&workmode, &commport, &baudrate);
SetCommMode(3, commport, baudrate);
EnableRx(0);
for (ascch=0; (!exitloop); ascch++) {
PutAuxByte(ascch);
do
exitloop=ESCpressed();
while (!ExistAuxBGot(&auxb, &auxstat) && (!exitloop));
if (!exitloop)
if (auxb==ascch)
printf("ASCII code %X echoed OK!\n", (unsigned int)ascch);
else
printf("ASCII code %X echoed error by %X!\n", (unsigned int)ascch,
(unsigned int)auxb);
}
DisableRx();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -