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

📄 putchar.c

📁 proteus 仿真实例
💻 C
字号:
 /*                     - PUTCHAR.C -

  $Id: putchar.c 1.2 1997/09/23 15:12:31 dan Exp $

  The ANSI "putchar" function delivered here is supposed to be tailored
  for the actual target hardware.  This version of putchar writes
  the argument character to a port assumed to be initiated elsewhere.
*/


#include <io6811.h>


/*
 * Use built-in serial port SCI:
 */

#define TDRE            (0x80) /* TX data empty */


/*
 * This routine must be tailored to suit the specific hardware.
 */

static int _low_level_putc(int c)
 { if (c == '\n')
      c = '\r';     

  while ((SCSR & TDRE) == 0)
    ;
  SCDR = (char) c;
  return(c);
}

/*
 * The putchar routine:
 */


int putchar(int value)
  {
    return(_low_level_putc(value));
  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -