G.U.L.L.S. rebuilt to use PlatformIO
This commit is contained in:
37
include/DecodingBitStream.h
Normal file
37
include/DecodingBitStream.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef DECODINGBITSTREAM_H
|
||||
#define DECODINGBITSTREAM_H
|
||||
|
||||
#include "SD.h"
|
||||
|
||||
class DecodingBitStream
|
||||
{
|
||||
public:
|
||||
DecodingBitStream(File* _stream, uint8_t _bytesAvailable, uint16_t _numberOfBitsInCode) :
|
||||
stream(_stream), bytesAvailable(_bytesAvailable), numberOfBitsInCode(_numberOfBitsInCode),
|
||||
bitBuffer(0), bitsAvailable(0) {}
|
||||
~DecodingBitStream() {}
|
||||
|
||||
void setNumberOfBitsInCode(uint16_t _numberOfBitsInCode) { numberOfBitsInCode = _numberOfBitsInCode; }
|
||||
void setBytesAvailable(uint8_t _bytesAvailable) { bytesAvailable = _bytesAvailable; }
|
||||
|
||||
uint16_t getCode();
|
||||
uint16_t getNumberOfBitsInCode() { return numberOfBitsInCode; }
|
||||
|
||||
bool dataRemainingInBlock() { return bytesAvailable > 0 || bitsAvailable > 0; }
|
||||
|
||||
static uint16_t getNumberOfBitsToRepresentValue(uint16_t value);
|
||||
|
||||
private:
|
||||
void
|
||||
verifyEnoughBits(void);
|
||||
uint16_t
|
||||
bitBuffer;
|
||||
uint8_t
|
||||
bytesAvailable,
|
||||
bitsAvailable,
|
||||
numberOfBitsInCode;
|
||||
File*
|
||||
stream;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user