Checking for data availability in a channel?

New to XMOS and XCore? Get started here.
Treczoks
Active Member
Posts: 38
Joined: Thu Mar 21, 2013 11:18 am

Checking for data availability in a channel?

Postby Treczoks » Tue Jun 11, 2013 10:57 am

Hi!

I've got a chanend where data might come to. Might. So I could use something like this:

Code: Select all

select {
  case MyChan :> Data:
    DataReceived = 1;
    break;
  default:
    DataReceived = 0;
    break;
}
This strikes me as being a bit bulky - is there no simple way just to ask a chanend if there is something available?

Yours, Christian Treczoks
User avatar
Ross
XCore Expert
Posts: 768
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Sun Sep 08, 2013 6:28 pm

This would be the recommended way.

Who is online

Users browsing this forum: No registered users and 0 guests