Compare commits

...
3 Commits
Author SHA1 Message Date
badenbergra78621 903c139097 verschönert 2023-11-28 11:12:37 +01:00
badenbergra78621 cc653b9c70 verschönert 2023-11-28 11:12:06 +01:00
badenbergra78621 fb2d609dbc Added add.c 2023-11-21 11:17:43 +01:00
2 changed files with 35 additions and 1 deletions

No files matched your search

+15 -1
View File
@@ -4,7 +4,21 @@
int task_add_run( void * task ) {
// TODO
add_config * addiere = ( add_config * ) task;
uint32_t data_channel_base = addiere->sink;
data_channel_clear( data_channel_base );
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i )
{
float_word res;
float_word sin_val;
float_word cos_val;
data_channel_read(addiere->sources[0], &sin_val.value);
data_channel_read(addiere->sources[1], &cos_val.value);
res.value = sin_val.value + cos_val.value;
data_channel_write( data_channel_base, res.word );
}
return 0;
}
+20
View File
@@ -1,11 +1,31 @@
#include "system/task_crc.h"
#include "system/data_channel.h"
#include "system/float_word.h"
#include <zlib.h> /* c-library for crc32() */
int task_crc_run( void * task ) {
// TODO
crc_config * crc = ( crc_config * ) task;
uint32_t data_channel_base = crc->base.sink;
data_channel_clear( data_channel_base);
float_word crc_res;
float_word crc_input;
for ( uint32_t i = 0; i < DATA_CHANNEL_DEPTH; ++i )
{
data_channel_read(crc->base.sources[0], &crc_input.value);
crc_res.value = crc32(0, (const void*)crc_input.value, sizeof(crc_input.value));
}
data_channel_write( data_channel_base, crc_res.word );
return 0;
}