some tweaks for busy handling
This commit is contained in:
@ -44,16 +44,23 @@ void PapbVcInterface::endPacketTransfer() { *vcBaseReg = CONFIG_END; }
|
||||
ReturnValue_t PapbVcInterface::pollPapbBusySignal() const {
|
||||
gpio::Levels papbBusyState = gpio::Levels::LOW;
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
uint32_t busyIdx = 0;
|
||||
|
||||
/** Check if PAPB interface is ready to receive data */
|
||||
result = gpioComIF->readGpio(papbBusyId, papbBusyState);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "PapbVcInterface::pollPapbBusySignal: Failed to read papb busy signal"
|
||||
<< std::endl;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (papbBusyState == gpio::Levels::LOW) {
|
||||
return PAPB_BUSY;
|
||||
while (true) {
|
||||
/** Check if PAPB interface is ready to receive data */
|
||||
result = gpioComIF->readGpio(papbBusyId, papbBusyState);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::warning << "PapbVcInterface::pollPapbBusySignal: Failed to read papb busy signal"
|
||||
<< std::endl;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (papbBusyState == gpio::Levels::HIGH) {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
if (busyIdx == 100) {
|
||||
return PAPB_BUSY;
|
||||
}
|
||||
busyIdx++;
|
||||
}
|
||||
|
||||
return returnvalue::OK;
|
||||
|
Reference in New Issue
Block a user