![](/media/cache/profiles/0f0ee3310223fe38a989b2c818709393.50x50_q85.jpg)
Control up to 4 steppers axis with limit switch logic from serial port
jmRingBuffer.h@0:3e676fcd9c71, 2011-02-12 (annotated)
- Committer:
- jm
- Date:
- Sat Feb 12 16:49:03 2011 +0000
- Revision:
- 0:3e676fcd9c71
jmStepperAxis Command Line Interface Module
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jm | 0:3e676fcd9c71 | 1 | /************************************************************************* |
jm | 0:3e676fcd9c71 | 2 | * @file jmRingBuffer.h |
jm | 0:3e676fcd9c71 | 3 | * @brief Command Line Rx Ring Buffer |
jm | 0:3e676fcd9c71 | 4 | * |
jm | 0:3e676fcd9c71 | 5 | * @date Feb12, 2011 |
jm | 0:3e676fcd9c71 | 6 | */ |
jm | 0:3e676fcd9c71 | 7 | |
jm | 0:3e676fcd9c71 | 8 | #ifndef jmRingBufferDef |
jm | 0:3e676fcd9c71 | 9 | #define jmRingBufferDef 1 |
jm | 0:3e676fcd9c71 | 10 | |
jm | 0:3e676fcd9c71 | 11 | #define nl 10 // new line |
jm | 0:3e676fcd9c71 | 12 | #define WordMaxSize 21 |
jm | 0:3e676fcd9c71 | 13 | #define DimRingBuffer 41 |
jm | 0:3e676fcd9c71 | 14 | |
jm | 0:3e676fcd9c71 | 15 | |
jm | 0:3e676fcd9c71 | 16 | // Ring Buffer data structure |
jm | 0:3e676fcd9c71 | 17 | extern struct RingBuffer |
jm | 0:3e676fcd9c71 | 18 | { unsigned char Buffer[DimRingBuffer]; |
jm | 0:3e676fcd9c71 | 19 | unsigned char head; |
jm | 0:3e676fcd9c71 | 20 | unsigned char tail; |
jm | 0:3e676fcd9c71 | 21 | unsigned char qty; |
jm | 0:3e676fcd9c71 | 22 | }Line, *pLine; |
jm | 0:3e676fcd9c71 | 23 | #endif |
jm | 0:3e676fcd9c71 | 24 | |
jm | 0:3e676fcd9c71 | 25 | // Prototypes |
jm | 0:3e676fcd9c71 | 26 | bool Full(struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 27 | void Insert(unsigned char c, struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 28 | bool NotEmpty(struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 29 | unsigned char Extract(struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 30 | void FlushRingBuffer(struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 31 | void DelChar(struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 32 | void InitCommandLineRingBuffer(void); |
jm | 0:3e676fcd9c71 | 33 | void NextCommand(unsigned char c, struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 34 | void ViewRingBuffer(struct RingBuffer *p); |
jm | 0:3e676fcd9c71 | 35 | bool ExtractWord(struct RingBuffer *p, char *param); |
jm | 0:3e676fcd9c71 | 36 | bool ExtractUInteger(struct RingBuffer *p, unsigned int *result, unsigned int min, unsigned int max); |