summaryrefslogtreecommitdiff
path: root/taia.c
blob: 34d53473e5f3c12ffc09bfa1c06a9bc7cdd47fdc (plain)
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
#include <stdbool.h>

#include "taia.h"

static const struct taia tolerance_taia = {
	.sec.x = 0,
	.nano = 700000000ULL,	/* 700ms acceptance window */
	.atto = 0,
};

bool taia_looks_good(struct taia *arr_taia, struct taia *pkt_taia)
{
	bool good = false;
	struct taia tmp;

	if (taia_less(arr_taia, pkt_taia)) {
		taia_sub(&tmp, pkt_taia, arr_taia);
		if (taia_less(&tmp, &tolerance_taia))
			good = true;
	} else {
		taia_sub(&tmp, arr_taia, pkt_taia);
		if (taia_less(&tmp, &tolerance_taia))
			good = true;
	}

	return good;
}
ion value='10'>10space:mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-01-08 08:12:47 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-01-08 08:12:47 -0500
commit44aab3e09ef947e546ee61c5082c41b86dd15e53 (patch)
treea56798afd105c04937d7a45a991c90d18a388ee0 /Documentation/input/gamepad.txt
parent926ea40a7ee294767994b67eebff9fa015562902 (diff)
NFS: Fix a compile warning about unused variable in nfs_generic_pg_pgios()
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'Documentation/input/gamepad.txt')