26 lines
629 B
C
26 lines
629 B
C
#include "system/task_add.h"
|
|
#include "system/data_channel.h"
|
|
#include "system/float_word.h"
|
|
|
|
int task_add_run( void * task ) {
|
|
|
|
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;
|
|
}
|
|
|