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.
jmRingBuffer.h
00001 /************************************************************************* 00002 * @file jmRingBuffer.h 00003 * @brief Command Line Rx Ring Buffer 00004 * 00005 * @date Feb12, 2011 00006 */ 00007 00008 #ifndef jmRingBufferDef 00009 #define jmRingBufferDef 1 00010 00011 #define nl 10 // new line 00012 #define WordMaxSize 21 00013 #define DimRingBuffer 41 00014 00015 00016 // Ring Buffer data structure 00017 extern struct RingBuffer 00018 { unsigned char Buffer[DimRingBuffer]; 00019 unsigned char head; 00020 unsigned char tail; 00021 unsigned char qty; 00022 }Line, *pLine; 00023 #endif 00024 00025 // Prototypes 00026 bool Full(struct RingBuffer *p); 00027 void Insert(unsigned char c, struct RingBuffer *p); 00028 bool NotEmpty(struct RingBuffer *p); 00029 unsigned char Extract(struct RingBuffer *p); 00030 void FlushRingBuffer(struct RingBuffer *p); 00031 void DelChar(struct RingBuffer *p); 00032 void InitCommandLineRingBuffer(void); 00033 void NextCommand(unsigned char c, struct RingBuffer *p); 00034 void ViewRingBuffer(struct RingBuffer *p); 00035 bool ExtractWord(struct RingBuffer *p, char *param); 00036 bool ExtractUInteger(struct RingBuffer *p, unsigned int *result, unsigned int min, unsigned int max);
Generated on Tue Jul 12 2022 18:42:56 by
