mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Driver: Add general predicate parameter for waitForRx
This commit is contained in:
@@ -190,7 +190,7 @@ void CDCACM::readTask() {
|
||||
}
|
||||
std::cout << std::dec << std::endl;
|
||||
#endif
|
||||
writeToReadBuffer(readbuf, bytesRead);
|
||||
pushRx(readbuf, bytesRead);
|
||||
} else {
|
||||
if(modeChanging) {
|
||||
// We were expecting a disconnect for reenumeration
|
||||
|
||||
@@ -242,7 +242,7 @@ void FirmIO::readTask() {
|
||||
|
||||
// Translate the physical address back to our virtual address space
|
||||
uint8_t* addr = reinterpret_cast<uint8_t*>(msg.payload.data.addr - PHY_ADDR_BASE + vbase);
|
||||
while (!writeToReadBuffer(addr, msg.payload.data.len)) {
|
||||
while (!pushRx(addr, msg.payload.data.len)) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // back-off so reading thread can empty the buffer
|
||||
if (closing || isDisconnected()) {
|
||||
break;
|
||||
|
||||
@@ -213,7 +213,7 @@ void FTDI::readTask() {
|
||||
} else
|
||||
report(APIEvent::Type::FailedToRead, APIEvent::Severity::EventWarning);
|
||||
} else
|
||||
writeToReadBuffer(readbuf, readBytes);
|
||||
pushRx(readbuf, readBytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ void PCAP::readTask() {
|
||||
PCAP* driver = reinterpret_cast<PCAP*>(obj);
|
||||
if(driver->ethPacketizer.inputUp({data, data + header->caplen})) {
|
||||
const auto bytes = driver->ethPacketizer.outputUp();
|
||||
driver->writeToReadBuffer(bytes.data(), bytes.size());
|
||||
driver->pushRx(bytes.data(), bytes.size());
|
||||
}
|
||||
}, (uint8_t*)this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user