![](/media/cache/profiles/0f0ee3310223fe38a989b2c818709393.50x50_q85.jpg)
Command all jmCLIG modules from serial port
Diff: jmRingBuffer.h
- Revision:
- 0:9112e09912db
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jmRingBuffer.h Sat Feb 12 16:50:25 2011 +0000 @@ -0,0 +1,36 @@ +/************************************************************************* + * @file jmRingBuffer.h + * @brief Command Line Rx Ring Buffer + * + * @date Feb12, 2011 +*/ + +#ifndef jmRingBufferDef + #define jmRingBufferDef 1 + + #define nl 10 // new line + #define WordMaxSize 21 + #define DimRingBuffer 41 + + + // Ring Buffer data structure + extern struct RingBuffer + { unsigned char Buffer[DimRingBuffer]; + unsigned char head; + unsigned char tail; + unsigned char qty; + }Line, *pLine; +#endif + +// Prototypes +bool Full(struct RingBuffer *p); +void Insert(unsigned char c, struct RingBuffer *p); +bool NotEmpty(struct RingBuffer *p); +unsigned char Extract(struct RingBuffer *p); +void FlushRingBuffer(struct RingBuffer *p); +void DelChar(struct RingBuffer *p); +void InitCommandLineRingBuffer(void); +void NextCommand(unsigned char c, struct RingBuffer *p); +void ViewRingBuffer(struct RingBuffer *p); +bool ExtractWord(struct RingBuffer *p, char *param); +bool ExtractUInteger(struct RingBuffer *p, unsigned int *result, unsigned int min, unsigned int max);