bugfixes for PAPB IF
This commit is contained in:
parent
ffe1281eb9
commit
99192606a2
@ -37,7 +37,7 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size, size_t& w
|
||||
abortPacketTransfer();
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return finishWritePartialOpt(data, size, true);
|
||||
return finishWriteInternal(data, size, writtenSize);
|
||||
}
|
||||
|
||||
void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) {
|
||||
@ -53,11 +53,20 @@ bool PapbVcInterface::pollReadyForPacket() const {
|
||||
return (reg >> 6) & 0b1;
|
||||
}
|
||||
|
||||
ReturnValue_t PapbVcInterface::finishWritePartialOpt(const uint8_t* data, size_t remainingSize,
|
||||
bool handlePartial) {
|
||||
ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t remainingSize) {
|
||||
if (not pollReadyForPacket()) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
size_t dummy = 0;
|
||||
return finishWriteInternal(data, remainingSize, dummy);
|
||||
}
|
||||
|
||||
ReturnValue_t PapbVcInterface::finishWriteInternal(const uint8_t* data, size_t remainingSize,
|
||||
size_t& writtenSize) {
|
||||
for (size_t idx = 0; idx < remainingSize; idx++) {
|
||||
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
|
||||
if (not pollReadyForPacket()) {
|
||||
writtenSize = idx;
|
||||
return PARTIALLY_WRITTEN;
|
||||
}
|
||||
abortPacketTransfer();
|
||||
@ -109,8 +118,4 @@ inline bool PapbVcInterface::pollReadyForOctet(uint32_t maxCycles) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReturnValue_t PapbVcInterface::finishWrite(const uint8_t* data, size_t remainingSize) {
|
||||
return finishWritePartialOpt(data, remainingSize, false);
|
||||
}
|
||||
|
||||
void PapbVcInterface::abortPacketTransfer() { *vcBaseReg = CONFIG_ABORT; }
|
||||
|
@ -43,8 +43,7 @@ class PapbVcInterface : public VirtualChannelIF {
|
||||
ReturnValue_t write(const uint8_t* data, size_t size, size_t& writtenSize) override;
|
||||
|
||||
ReturnValue_t finishWrite(const uint8_t* data, size_t remainingSize) override;
|
||||
ReturnValue_t finishWritePartialOpt(const uint8_t* data, size_t remainingSize,
|
||||
bool handlePartial);
|
||||
ReturnValue_t finishWriteInternal(const uint8_t* data, size_t remainingSize, size_t& writtenSize);
|
||||
|
||||
void cancelTransfer() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user