Browse Source

Added add.c

master
badenbergra78621 1 year ago
parent
commit
fb2d609dbc
1 changed files with 15 additions and 1 deletions
  1. 15
    1
      software/signal_processing/add.c

+ 15
- 1
software/signal_processing/add.c View File

@@ -4,7 +4,21 @@

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;
}

Loading…
Cancel
Save