⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 auxecho.c

📁 HT系列掌机部分功能测试程序(含源码)
💻 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 + -