|
|
|
|
|
|
|
|
|
|
|
|
|
|
int task_add_run( void * task ) { |
|
|
int task_add_run( void * task ) { |
|
|
|
|
|
|
|
|
// TODO |
|
|
|
|
|
|
|
|
add_config * addiere = ( add_config * ) task; |
|
|
|
|
|
uint32_t data_channel_base = addiere->sink; |
|
|
|
|
|
data_channel_clear( data_channel_base ); |
|
|
|
|
|
|
|
|
|
|
|
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i) |
|
|
|
|
|
{ |
|
|
|
|
|
float_word res; |
|
|
|
|
|
float_word sin_val; |
|
|
|
|
|
float_word cos_val; |
|
|
|
|
|
data_channel_read(addiere->sources[0], &sin_val.value); |
|
|
|
|
|
data_channel_read(addiere->sources[1], &cos_val.value); |
|
|
|
|
|
res.value = sin_val.value + cos_val.value; |
|
|
|
|
|
|
|
|
|
|
|
data_channel_write( data_channel_base, res.word ); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |