25 lines
627 B
C
Raw Normal View History

2023-10-31 07:47:27 +01:00
#include "system/task_add.h"
#include "system/data_channel.h"
#include "system/float_word.h"
2024-12-04 08:58:18 +01:00
int task_add_run( void * task )
{
add_config * config = (add_config * ) task;
2023-10-31 07:47:27 +01:00
2024-12-04 08:58:18 +01:00
// Nachfolgende Antworten Lesen den FIFO der ersten und zweiten Datenquelle aus
// den jeweils gelesenen Wert mit 4 und speichern das Ergebnis in der Datensenke
for (uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i)
{
float a, b;
data_channel_read( config->sources[0], (uint32_t *) & a );
data_channel_read( config->sources[1], (uint32_t *) & b );
2023-10-31 07:47:27 +01:00
2024-12-04 08:58:18 +01:00
float_word c;
c.value = a + b;
data_channel_write( config->sink, c.word );
}
return 0;
2023-10-31 07:47:27 +01:00
2024-12-04 08:58:18 +01:00
}