27 return (x <= y) ? x : y;
35 return (x_temp >= saturation) ? (x_temp - saturation) : x_temp;
57 return (write >= read) ? (write - read) : (size - read + write);
62 return size - circ_buf_data_size(write, read, size);
84 return cb_read_data(cb, to, l, off) + cb_read_data(cb, to + l, len - l, 0);
120 (from ==
TD_NULL) ? cb_write_zero : cb_write_data;
122 return action(cb, from, l, off) + action(cb, from + l, len - l, 0);
140 if ((len == 0) || (circ_buf_data_size(*cb->
write, read, cb->
size) < len) ||
141 (circ_buf_read_data(cb, to, len, read) != len)) {
145 *cb->
read = saturate_add(read, len, cb->
size);
154 if ((len == 0) || (circ_buf_write_data(cb, from, len, write) != len)) {
158 *cb->
write = saturate_add(write, len, cb->
size);
178 if (circ_buf_data_size(*cb->
write, read, cb->
size) < len) {
193 len_temp = circ_buf_min(data_size, len);
194 *cb->
read = saturate_add(read, len_temp, cb->
size);
204 if ((len == 0) || (circ_buf_data_size(*cb->
write, read, cb->
size) < len) ||
205 (circ_buf_read_data(cb, to, len, read) != len)) {
217 *cb->
read = saturate_add(read, len, cb->
size);
errno_t memset_s(void *dest, size_t destMax, int c, size_t count)
errno_t memcpy_s(void *dest, size_t destMax, const void *src, size_t count)
#define EOK
Definition securec.h:57
td_u8 * data
Definition circ_buf.h:21
volatile td_u32 * read
Definition circ_buf.h:20
td_u32 size
Definition circ_buf.h:22
volatile td_u32 * write
Definition circ_buf.h:19
unsigned char td_u8
Definition td_type.h:36
void td_void
Definition td_type.h:49
unsigned int td_u32
Definition td_type.h:38
#define TD_NULL
Definition td_type.h:30
Definition hal_uart_v151_regs_def.h:38