Kore
Loading...
Searching...
No Matches
acceleration.h
Go to the documentation of this file.
1#pragma once
2
3#include <kinc/global.h>
4
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
17KINC_FUNC void kinc_acceleration_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/));
18
19void kinc_internal_on_acceleration(float x, float y, float z);
20
21#ifdef KINC_IMPLEMENTATION_INPUT
22#define KINC_IMPLEMENTATION
23#endif
24
25#ifdef KINC_IMPLEMENTATION
26
27#include <memory.h>
28#include <stddef.h>
29
30void (*acceleration_callback)(float /*x*/, float /*y*/, float /*z*/) = NULL;
31
32void kinc_acceleration_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/)) {
33 acceleration_callback = value;
34}
35
36void kinc_internal_on_acceleration(float x, float y, float z) {
37 if (acceleration_callback != NULL) {
38 acceleration_callback(x, y, z);
39 }
40}
41
42#endif
43
44#ifdef __cplusplus
45}
46#endif
KINC_FUNC void kinc_acceleration_set_callback(void(*value)(float, float, float))
Sets the acceleration-callback which is called with measured acceleration-data in three dimensions.
Provides basic functionality that's used all over the place. There's usually no need to manually incl...