-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunion.h
48 lines (40 loc) · 952 Bytes
/
union.h
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <sys/mman.h>
#include "hwlib.h"
#include "socal/socal.h"
#include "socal/hps.h"
#include "socal/alt_gpio.h"
#include "../hps_0.h"
#define DATA_SIZE 65535
#define TRIGGER_LEVEL 13
#define ZERO_TRIGGER_LEVEL 6
#define BOOSTED_TRIGGER_LEVEL 20
#define JUDGE_LEVEL 30
#define HW_REGS_BASE (ALT_STM_OFST)
#define HW_REGS_SPAN (0x04000000)
#define HW_REGS_MASK (HW_REGS_SPAN - 1)
int num; // 8 bits will be the limit
int limit;
int notify_changed;
int end_flag;
int init_num(int n,int l);
int get_num();
int in();
int out();
FILE *fn;
FILE *fs;
void for_sync();
void notify();
int get_sync();
int get_total();
void reset_sync();
int __judge(float ap1, float ap2, float ap3);
int _judge(float ap1, float ap2, float ap3);
void clear(int data[DATA_SIZE]);
int judge(int data[DATA_SIZE], int count, int opt);