代码拉取完成,页面将自动刷新
#include "serial.h"
/** \file
\brief Serial subsystem
Teacup's serial subsystem is a powerful, thoroughly tested and highly modular serial management system.
It uses ringbuffers for both transmit and receive, and intelligently decides whether to wait or drop transmitted characters if the buffer is full.
It also supports XON/XOFF flow control of the receive buffer, to help avoid overruns.
*/
#define TEACUP_C_INCLUDE
#include "serial-avr.c"
#include "serial-arm.c"
#undef TEACUP_C_INCLUDE
/// send a string- look for null byte instead of expecting a length
void serial_writestr(uint8_t *data)
{
uint8_t i = 0, r;
// yes, this is *supposed* to be assignment rather than comparison, so we break when r is assigned zero
while ((r = data[i++]))
serial_writechar(r);
}
/**
Write string from FLASH.
Extensions to output flash memory pointers. This prevents the data to
become part of the .data segment instead of the .code segment. That means
less memory is consumed for multi-character writes.
For single character writes (i.e. '\n' instead of "\n"), using
serial_writechar() directly is the better choice.
*/
void serial_writestr_P(PGM_P data_P)
{
uint8_t r, i = 0;
// yes, this is *supposed* to be assignment rather than comparison, so we break when r is assigned zero
while ((r = pgm_read_byte(&data_P[i++])))
serial_writechar(r);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。