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.

add.c 517B

1 year ago
1 year ago
123456789101112131415161718192021222324252627
  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. add_config * config = (add_config *) task;
  6. float_word f;
  7. for (uint32_t i = 0; i < DATA_CHANNEL_DEPTH; i++)
  8. {
  9. float a;
  10. data_channel_read(config->sources[0], (uint32_t *) & a);
  11. float b;
  12. data_channel_read(config->sources[1], (uint32_t *) & b);
  13. float_word c;
  14. c.value = a + b;
  15. f.value = c.value;
  16. data_channel_write(config->sink, c.word);
  17. }
  18. return 0;
  19. }