哪位AVR编程高手解决一下小弟问题,谢谢了,使用GCC编译器
#include<stdio.h>staticintuart_putchar(charc,FILE*stream);staticFILEmystdout=FDEV_SET...
#include <stdio.h>
static int uart_putchar(char c, FILE *stream);
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,_FDEV_SETUP_WRITE);//这句话究竟是定义了什么,C语言语法里面有这一项吗
static int uart_putchar(char c, FILE *stream)
{
if (c == ’\n’)
uart_putchar(’\r’, stream);
loop_until_bit_is_set(UCSRA, UDRE);
UDR = c;
return 0;
}
int main(void)
{
init_uart();
stdout = &mystdout;
printf("Hello, world!\n");
return 0;
} 展开
static int uart_putchar(char c, FILE *stream);
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,_FDEV_SETUP_WRITE);//这句话究竟是定义了什么,C语言语法里面有这一项吗
static int uart_putchar(char c, FILE *stream)
{
if (c == ’\n’)
uart_putchar(’\r’, stream);
loop_until_bit_is_set(UCSRA, UDRE);
UDR = c;
return 0;
}
int main(void)
{
init_uart();
stdout = &mystdout;
printf("Hello, world!\n");
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询