summaryrefslogtreecommitdiff
path: root/docs/src/hal/rand.comp
blob: 715ef89c1ea5ecdfba9cd2d2a369db9c6800bd8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
component rand;
option userspace;

pin out float out;
license "GPL";
;;
#include <unistd.h>

void user_mainloop(void) {
    while(1) {
        usleep(1000);
        FOR_ALL_INSTS() out = drand48();
    }
}