PlayerEmbedded.h@0:01be2d5eaf72, 2011-10-31 (annotated)
- Committer:
- daan
- Date:
- Mon Oct 31 02:34:13 2011 +0000
- Revision:
- 0:01be2d5eaf72
- Child:
- 2:ce4c7e5ab241
first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
daan | 0:01be2d5eaf72 | 1 | #ifndef PLAYER_EMBEDDED_H |
daan | 0:01be2d5eaf72 | 2 | #define PLAYER_EMBEDDED_H |
daan | 0:01be2d5eaf72 | 3 | |
daan | 0:01be2d5eaf72 | 4 | #include "stdint.h" |
daan | 0:01be2d5eaf72 | 5 | |
daan | 0:01be2d5eaf72 | 6 | #include "PlayerBase.h" |
daan | 0:01be2d5eaf72 | 7 | #include "RingBuffer.h" |
daan | 0:01be2d5eaf72 | 8 | |
daan | 0:01be2d5eaf72 | 9 | // #include <iostream> |
daan | 0:01be2d5eaf72 | 10 | |
daan | 0:01be2d5eaf72 | 11 | namespace olc { |
daan | 0:01be2d5eaf72 | 12 | |
daan | 0:01be2d5eaf72 | 13 | class PlayerEmbedded : public PlayerBase |
daan | 0:01be2d5eaf72 | 14 | { |
daan | 0:01be2d5eaf72 | 15 | public: |
daan | 0:01be2d5eaf72 | 16 | PlayerEmbedded(fou::RingBuffer2k &aBuffer) : mBuffer(aBuffer) {}; |
daan | 0:01be2d5eaf72 | 17 | |
daan | 0:01be2d5eaf72 | 18 | // void setGalvo(uint16_t x, uint16_t y); |
daan | 0:01be2d5eaf72 | 19 | // void setLaserPower(uint16_t power); |
daan | 0:01be2d5eaf72 | 20 | // void wait(uint16_t ms); |
daan | 0:01be2d5eaf72 | 21 | |
daan | 0:01be2d5eaf72 | 22 | protected: |
daan | 0:01be2d5eaf72 | 23 | inline int bytesLeft() { |
daan | 0:01be2d5eaf72 | 24 | // std::cout << "buffer size" << mBuffer.size() << std::endl; |
daan | 0:01be2d5eaf72 | 25 | return mBuffer.size(); |
daan | 0:01be2d5eaf72 | 26 | }; |
daan | 0:01be2d5eaf72 | 27 | inline uint8_t get() { |
daan | 0:01be2d5eaf72 | 28 | uint8_t d = mBuffer.front(); |
daan | 0:01be2d5eaf72 | 29 | mBuffer.popFront(); |
daan | 0:01be2d5eaf72 | 30 | return d; |
daan | 0:01be2d5eaf72 | 31 | }; |
daan | 0:01be2d5eaf72 | 32 | |
daan | 0:01be2d5eaf72 | 33 | fou::RingBuffer2k& mBuffer; |
daan | 0:01be2d5eaf72 | 34 | }; |
daan | 0:01be2d5eaf72 | 35 | |
daan | 0:01be2d5eaf72 | 36 | |
daan | 0:01be2d5eaf72 | 37 | }; // end namespace ol |
daan | 0:01be2d5eaf72 | 38 | |
daan | 0:01be2d5eaf72 | 39 | #endif // PLAYER_BASE_H |