diff options
Diffstat (limited to 'src/libs/sig/ops_rand.c')
-rw-r--r-- | src/libs/sig/ops_rand.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libs/sig/ops_rand.c b/src/libs/sig/ops_rand.c new file mode 100644 index 0000000..49954c6 --- /dev/null +++ b/src/libs/sig/ops_rand.c @@ -0,0 +1,16 @@ +#include <assert.h> +#include <stdlib.h> + +#include "sig.h" + + +static float ops_rand_output(void *context, unsigned ticks_ms) +{ + return rand_r(&ticks_ms) * 1.f / (float)RAND_MAX; +} + + +sig_ops_t sig_ops_rand = { + .output = ops_rand_output, +}; + |