Versión de Firmware con funciones de RAM incorporadas.
Dependencies: mbed
Fork of VmRecorderV1dot1 by
RingBuffer/Buffering.h@2:e818c80e6d5c, 2015-07-14 (annotated)
- Committer:
- JuanManuelAmador
- Date:
- Tue Jul 14 08:34:11 2015 +0000
- Revision:
- 2:e818c80e6d5c
- Parent:
- 0:3d456b8ce449
Funciones de memoria RAM introducidas.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JuanManuelAmador | 0:3d456b8ce449 | 1 | #ifndef BUFFERING_H |
JuanManuelAmador | 0:3d456b8ce449 | 2 | #define BUFFERING_H |
JuanManuelAmador | 0:3d456b8ce449 | 3 | |
JuanManuelAmador | 0:3d456b8ce449 | 4 | #include "mbed.h" |
JuanManuelAmador | 0:3d456b8ce449 | 5 | |
JuanManuelAmador | 0:3d456b8ce449 | 6 | #define BUFFERSIZE 600 |
JuanManuelAmador | 0:3d456b8ce449 | 7 | // Buffering de datos tipo float |
JuanManuelAmador | 0:3d456b8ce449 | 8 | class Buffering |
JuanManuelAmador | 0:3d456b8ce449 | 9 | { |
JuanManuelAmador | 0:3d456b8ce449 | 10 | private: |
JuanManuelAmador | 0:3d456b8ce449 | 11 | int16_t data[BUFFERSIZE]; |
JuanManuelAmador | 0:3d456b8ce449 | 12 | unsigned int windex; |
JuanManuelAmador | 0:3d456b8ce449 | 13 | unsigned int rindex; |
JuanManuelAmador | 0:3d456b8ce449 | 14 | bool full; |
JuanManuelAmador | 0:3d456b8ce449 | 15 | bool empty; |
JuanManuelAmador | 0:3d456b8ce449 | 16 | unsigned int bufSize; |
JuanManuelAmador | 0:3d456b8ce449 | 17 | public: |
JuanManuelAmador | 0:3d456b8ce449 | 18 | Buffering(); |
JuanManuelAmador | 0:3d456b8ce449 | 19 | void put(int16_t val); |
JuanManuelAmador | 0:3d456b8ce449 | 20 | int16_t get(); |
JuanManuelAmador | 0:3d456b8ce449 | 21 | int getSize(); |
JuanManuelAmador | 0:3d456b8ce449 | 22 | bool isFull(); |
JuanManuelAmador | 0:3d456b8ce449 | 23 | bool isEmpty(); |
JuanManuelAmador | 0:3d456b8ce449 | 24 | unsigned int getWritingIndex(); |
JuanManuelAmador | 0:3d456b8ce449 | 25 | unsigned int getReadingIndex(); |
JuanManuelAmador | 0:3d456b8ce449 | 26 | unsigned int getDif(); |
JuanManuelAmador | 0:3d456b8ce449 | 27 | }; |
JuanManuelAmador | 0:3d456b8ce449 | 28 | |
JuanManuelAmador | 0:3d456b8ce449 | 29 | #endif // BUFFERING_H |
JuanManuelAmador | 0:3d456b8ce449 | 30 |