28 lines
595 B
C
28 lines
595 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 * config = ( add_config * ) task;
|
|
|
|
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i ) {
|
|
float sinus;
|
|
// & pointer Adresse von sinus
|
|
data_channel_read( config->sources[0], (uint32_t *) & sinus);
|
|
|
|
float cosinus;
|
|
// & pointer Adresse von cosinus
|
|
data_channel_read( config->sources[1], (uint32_t *) & cosinus);
|
|
|
|
float_word result;
|
|
|
|
result.value = sinus + cosinus;
|
|
|
|
data_channel_write( config->sink, result.word);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|