more testing
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-cfdp-source-handler This commit looks good

This commit is contained in:
2023-10-18 12:24:22 +02:00
parent e194071936
commit ace75919ca
4 changed files with 16 additions and 10 deletions

View File

@ -34,6 +34,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w
}
// The user must call advance until completion before starting a new packet transfer.
if (writeActiveStatus) {
sif::debug << "is busy with writing" << std::endl;
return IS_BUSY;
}
if (size > packetBuf.capacity()) {
@ -47,12 +48,9 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w
if (pollReadyForPacket()) {
startPacketTransfer(ByteWidthCfg::ONE);
} else {
sif::debug << "is busy can not even start" << std::endl;
return DirectTmSinkIF::IS_BUSY;
}
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
abortPacketTransfer();
return returnvalue::FAILED;
}
return advanceWrite(writtenSize);
}
@ -75,15 +73,16 @@ ReturnValue_t PapbVcInterface::advanceWrite(size_t& writtenSize) {
if (not pollReadyForPacket()) {
return IS_BUSY;
}
for (size_t idx = currentPacketIndex; idx < currentPacketSize; idx++) {
while (currentPacketIndex < currentPacketSize) {
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
if (not pollReadyForPacket()) {
return PARTIALLY_WRITTEN;
}
sif::debug << "aborting unexpectedly" << std::endl;
abortPacketTransfer();
return returnvalue::FAILED;
}
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(packetBuf[currentPacketIndex]);
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(packetBuf[currentPacketIndex++]);
writtenSize++;
}
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {