Code: Select all
typedef interface lib_startkit_adc {
[[guarded]] void trigger (void);
[[clears_notification]] {unsigned int, unsigned int} read (unsigned short adc_val[4]);
[[notification]] slave void complete (void);
} lib_startkit_adc_client_if;
Code: Select all
typedef struct tag_startkit_adc_user_vals {
// ...
unsigned int adc_cnt;
unsigned int no_adc_cnt;
} t_startkit_adc_user_vals;
[[combinable]]
void lib_startKIT_adc_client (
// ..
server lib_startkit_adc_client_if i_startkit_adc_up)
{
t_startkit_adc_user_vals adc_vals;
while(1){
select{
// Other cases
case i_startkit_adc_up.read (unsigned short return_adc_vals[4]) ->
{int adc_cnt, int no_adc_cnt}: {
// Fill return vals
{adc_cnt = adc_vals.adc_cnt; no_adc_cnt = adc_vals.no_adc_cnt}; // ???
} break;
} // select
} // while
}
Code: Select all
{int, int} swap(int a, int b) {
return {b, a};
}
int x = 5, y = 7;
{x, y} = swap(x, y);
Right now I don't think this is possible. But then I haven't seen that excluded in the XMOS Programming Guide, either. But also, I can't see why it should not be possible?