1 Star 0 Fork 0

zzulilyw/RF24

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
printf.h 957 Bytes
一键复制 编辑 原始数据 按行查看 历史
TMRh20 提交于 2019-05-10 12:51 . Clean up printf.h
/*
Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
/* Galileo support from spaniakos <spaniakos@gmail.com> */
/**
* @file printf.h
*
* Setup necessary to direct stdout to the Arduino Serial library, which
* enables 'printf'
*/
#ifndef __PRINTF_H__
#define __PRINTF_H__
#if defined (ARDUINO_ARCH_AVR) || defined(__ARDUINO_X86__)
int serial_putc( char c, FILE * )
{
Serial.write( c );
return c;
}
#endif
void printf_begin(void)
{
#if defined (ARDUINO_ARCH_AVR)
fdevopen( &serial_putc, 0 );
#elif defined (__ARDUINO_X86__)
//JESUS - For reddirect stdout to /dev/ttyGS0 (Serial Monitor port)
stdout = freopen("/dev/ttyGS0","w",stdout);
delay(500);
printf("redirecting to Serial...");
#endif
}
#endif // __PRINTF_H__
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zzulilyw/RF24.git
git@gitee.com:zzulilyw/RF24.git
zzulilyw
RF24
RF24
master

搜索帮助