Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface WebSocketClient mbed-rtos mbed
Queue.h
00001 #include <stdio.h> 00002 #include <stdarg.h> 00003 #include <stdint.h> 00004 00005 #ifndef QUEUE_H_ 00006 #define QUEUE_H_ 00007 00008 00009 typedef struct { 00010 00011 uint16_t ReadPtr; 00012 uint16_t WritePtr; 00013 uint16_t QueueSize; 00014 uint8_t *QueueStorage; 00015 00016 } ByteQueue; 00017 00018 #define QUEUE_FULL -1 00019 #define QUEUE_EMPTY -2 00020 #define QUEUE_OK 0 00021 00022 00023 void InitByteQueue(ByteQueue *BQ,uint16_t Size,uint8_t * Storage); 00024 uint16_t BytesInQueue(ByteQueue *BQ); 00025 int16_t ByteEnqueue(ByteQueue *BQ,uint8_t Val); 00026 int16_t ByteArrayEnqueue(ByteQueue *BQ,uint8_t *Buf,uint16_t); 00027 int16_t ByteDequeue(ByteQueue *BQ,uint8_t *Val); 00028 uint8_t ForcedByteDequeue(ByteQueue *BQ); 00029 int16_t Qprintf(ByteQueue *BQ, const char *FormatString,...); 00030 00031 00032 00033 00034 #endif /* TFC_QUEUE_H_ */
Generated on Tue Jul 12 2022 19:25:59 by
1.7.2