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

📄 byte_fifo.h

📁 专业汽车级嵌入式操作系统OSEK的源代码
💻 H
字号:
/* Byte FIFO queue implementation. * * Implements a simple byte FIFO on top of a data buffer, that lets * you enqueue and dequeue single bytes. */#ifndef __BFIFO_H__#  define __BFIFO_H__#  include "mytypes.h"/* The byte fifo control structure. */struct byte_fifo {  /* The buffer containing the fifo. */  U8 *buffer;  /* Pointer to the end of the buffer. */  U8 *buffer_end;  /* Size in bytes of the buffer. */  U32 buffer_size;  /* Current head (freshest data) of the fifo in the buffer. */  U8 *head;  /* Current tail (oldest data) of the fifo in the buffer. */  U8 *tail;  /* Number of bytes currently enqueued in the fifo. */  U32 holding;};void byte_fifo_clear(struct byte_fifo *f);void byte_fifo_init(struct byte_fifo *f, U8 *buffer, U32 buff_size);int byte_fifo_put(struct byte_fifo *f, U32 force, U8 b);int byte_fifo_get(struct byte_fifo *f, U8 *b);#endif

⌨️ 快捷键说明

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