Studentenversion des ESY6/A Praktikums "signal_processing".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 year ago
1 year ago
1234567891011121314151617181920
  1. #include "system/task_add.h"
  2. #include "system/data_channel.h"
  3. #include "system/float_word.h"
  4. int task_add_run( void * task ) {
  5. // TODO
  6. add_config* config = (add_config*) task;
  7. for(uint32_t i = 0; i < DATA_CHANNEL_DEPTH; i++)
  8. {
  9. float a, b;
  10. float_word c;
  11. data_channel_read(config->sources[0], (uint32_t*)&a);
  12. data_channel_read(config->sources[1], (uint32_t*)&b);
  13. c.value = a + b;
  14. data_channel_write(config->sink, c.word);
  15. }
  16. return 0;
  17. }