-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscope.c
More file actions
49 lines (24 loc) · 657 Bytes
/
scope.c
File metadata and controls
49 lines (24 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//---------------------- SCOPE.C ----------------------------
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include "/usr/realtime/include/rtai_shm.h"
#include "parameters.h"
static int end;
static void endme(int dummy) { end=1; }
int main (void)
{
struct enc_str *enc_data;
signal(SIGINT, endme);
enc_data = rtai_malloc (SHMNAM,1);
while (!end) {
printf(" Counter : %d Frequency in RPM: %ld \n", enc_data->count, 60000000000/enc_data->time);
sleep(1);
}
rtai_free (SHMNAM, &enc);
return 0;
}