123456789101112131415161718192021222324252627 |
- #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;
-
- float_word f;
-
- for (uint32_t i = 0; i < DATA_CHANNEL_DEPTH; i++)
- {
- float a;
- data_channel_read(config->sources[0], (uint32_t *) & a);
-
- float b;
- data_channel_read(config->sources[1], (uint32_t *) & b);
-
- float_word c;
- c.value = a + b;
- f.value = c.value;
- data_channel_write(config->sink, c.word);
- }
-
- return 0;
- }
|