Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about asynchronous transfer return value #142

Open
ThomasMGilman opened this issue Jun 2, 2022 · 0 comments
Open

Question about asynchronous transfer return value #142

ThomasMGilman opened this issue Jun 2, 2022 · 0 comments

Comments

@ThomasMGilman
Copy link

Hi, I am trying to take advantage of our systems SG mode by using your library to perform multiple calls on axidma_oneway_transfer with the usage of a callback previously set for the specified Rx channel. I understand that the callback should be immediately called upon the completion of the requested transfer amount. My question is whether or not we are able to retrieve the returned value of the ioctl in the instance of the function being non-blocking; similarly to a std::future? My reasoning is for the cases where the DMA transfer fails and I need to log the failure and perform additional actions on the buffer before it is used again.

So would something such as the below be possible?

//All handled by a separate thread/process
SomeClass::performOneWayTransfer
(uint dmaChannel, dma_transfer* dmaTransfer) {
  future<int> transferResult = async(
  axidma_oneway_transfer, SomeClass::StaticAxidmaHandler.axidmaDev, 
  dmaChannel, dmaTransfer->outputBuf, dmaTransfer->amountToTransfer, false);
  transferResult.wait();
  if((result = transferResult.get()) != 0){
     ...//log the failure and other stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant