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

📄 putchar.c

📁 Compact Flash library for AVR
💻 C
字号:
/*              PUTCHAR.C

   The ANSI "putchar" function.

   The putchar function writes the character c to the
   output-stream pointed to by stream. 
   The function returns the character written. If an writing 
   error  occurs the putchar shall return EOF.

   $Name: V3_34O V3_34N Spiff7 V3_34M V3_34L V3_34K V3_34J V3_34I V3_34H V3_34G $    

   Copyright 1986 - 1999 IAR Systems. All rights reserved.
*/


//#include <stdio.h>
#include <iom128.h>

int putchar(int ch)
{
   while (!(UCSR0A & 0x20))
      ;    //wait xmit ready
   UDR0 = (unsigned char) ch;
   return (ch);                 //send the character
}

/*
int putchar1(int ch)
{
   while (!(UCSR1A & 0x20))
      ;    //wait xmit ready
   UDR1 = (unsigned char) ch;
   return (ch);                 //send the character
}
*/

⌨️ 快捷键说明

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