Skip to content

Commit b4bf799

Browse files
fixup! added an example for lzss decoder
1 parent 4c4a6f9 commit b4bf799

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

Diff for: src/lzss/decoder.h

+10-16
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515

1616
namespace arduino { namespace lzss {
1717

18-
enum status: uint8_t {
19-
DONE,
20-
IN_PROGRESS,
21-
NOT_COMPLETED
22-
};
23-
2418
constexpr int DefaultEI = 11; /* typically 10..13 */
2519
constexpr int DefaultEJ = 4; /* typically 4..5 */
2620
constexpr int DefaultN = (1 << DefaultEI); /* buffer size */
@@ -46,16 +40,16 @@ namespace arduino { namespace lzss {
4640
GenericDecoder(std::function<int()> getc_cbk, std::function<void(const uint8_t)> putc_cbk);
4741

4842
/**
49-
* this enum describes the result of the computation of a single FSM computation
50-
* DONE: the decompression is completed
51-
* IN_PROGRESS: the decompression cycle completed successfully, ready to compute next
52-
* NOT_COMPLETED: the current cycle didn't complete because the available data is not enough
53-
*/
54-
// enum status: uint8_t {
55-
// DONE,
56-
// IN_PROGRESS,
57-
// NOT_COMPLETED
58-
// };
43+
* this enum describes the result of the computation of a single FSM computation for LZSS decoder
44+
* DONE: the decompression is completed
45+
* IN_PROGRESS: the decompression cycle completed successfully, ready to compute next
46+
* NOT_COMPLETED: the current cycle didn't complete because the available data is not enough
47+
*/
48+
enum status: uint8_t {
49+
DONE,
50+
IN_PROGRESS,
51+
NOT_COMPLETED
52+
};
5953

6054
/**
6155
* decode the provided buffer until buffer ends, then pause the process

Diff for: src/lzss/decoder.ipp

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ GenericDecoder<EI, EJ, N, F>::GenericDecoder(std::function<void(const uint8_t)>
4646
}
4747

4848
template<int EI, int EJ, int N, int F>
49-
status GenericDecoder<EI, EJ, N, F>::handle_state() {
49+
typename GenericDecoder<EI, EJ, N, F>::status GenericDecoder<EI, EJ, N, F>::handle_state() {
5050
status res = IN_PROGRESS;
5151

5252
int c = getbit(bits_required(this->state));
@@ -102,7 +102,7 @@ status GenericDecoder<EI, EJ, N, F>::handle_state() {
102102
}
103103

104104
template<int EI, int EJ, int N, int F>
105-
status GenericDecoder<EI, EJ, N, F>::decompress(uint8_t* const buffer, uint32_t size) {
105+
typename GenericDecoder<EI, EJ, N, F>::status GenericDecoder<EI, EJ, N, F>::decompress(uint8_t* const buffer, uint32_t size) {
106106
if(!get_char_cbk) {
107107
this->in_buffer = buffer;
108108
this->available += size;

0 commit comments

Comments
 (0)