This commit is contained in:
Ryzerth
2021-08-04 00:14:55 +02:00
parent 604a559b54
commit 2a6c742a51
8 changed files with 39 additions and 13 deletions

View File

@ -53,7 +53,7 @@ namespace dsp {
}
_in->flush();
if (!out.swap(outCount)) { return -1; }
if (outCount > 0 && !out.swap(outCount)) { return -1; }
return count;
}
@ -217,7 +217,7 @@ namespace dsp {
memcpy(delay, &_in->readBuf[count - 7], 7 * sizeof(T));
_in->flush();
if (!out.swap(outCount)) { return -1; }
if (outCount > 0 && !out.swap(outCount)) { return -1; }
return count;
}

View File

@ -64,7 +64,7 @@ namespace dsp {
if (bitsRead >= _frameLen) {
if (!out.swap((bitsRead / 8) + ((bitsRead % 8) > 0))) { return -1; }
bitsRead = -1;
nextBitIsStartOfFrame = true;
if (allowSequential) { nextBitIsStartOfFrame = true; }
}
continue;
@ -100,12 +100,14 @@ namespace dsp {
memcpy(buffer, &_in->readBuf[count - _syncLen], _syncLen);
//printf("Block processed\n");
callcount++;
callcount++;
_in->flush();
return count;
}
bool allowSequential = true;
stream<uint8_t> out;
private:

View File

@ -396,6 +396,11 @@ namespace dsp {
generic_hier_block<MSKDemod>::_block_init = true;
}
void setInput(stream<complex_t>* input) {
assert((generic_hier_block<MSKDemod>::_block_init));
demod.setInput(input);
}
void setSampleRate(float sampleRate) {
assert(generic_hier_block<MSKDemod>::_block_init);
generic_hier_block<MSKDemod>::tempStop();