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 530B

1234567891011121314151617181920212223
  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. // Nachfolgende Antworten lesen..
  8. for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; i++) {
  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. data_channel_write( config->sink, c.word );
  16. }
  17. return 0;
  18. }