|
123456789101112131415161718192021 |
- #include "system/task_add.h"
- #include "system/data_channel.h"
- #include "system/float_word.h"
-
- int task_add_run( void * task ) {
- add_config* taskConfig = (add_config*) task;
-
- for(uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i) {
- float chnl1, chnl2;
- data_channel_read(taskConfig->sources[0], (uint32_t*) &chnl1);
- data_channel_read(taskConfig->sources[1], (uint32_t*) &chnl2);
-
- float_word result;
- result.value = chnl1 + chnl2;
-
- data_channel_write(taskConfig->sink, result.word);
- }
-
- return 0;
- }
-
|