Rev 7123 | Rev 7968 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7123 | Rev 7216 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | 34 | ||
35 | #pragma once
|
35 | #pragma once
|
36 | 36 | ||
37 | #ifndef control_private_h_
|
37 | #ifndef control_private_h_
|
38 | #define control_private_h_
|
38 | #define control_private_h_
|
- | 39 | ||
- | 40 | #include "compat.h"
|
|
- | 41 | #include "keyboard.h"
|
|
- | 42 | ||
39 | #ifdef __cplusplus
|
43 | #ifdef __cplusplus
|
40 | extern "C" { |
44 | extern "C" { |
41 | #endif
|
45 | #endif
|
42 | 46 | ||
43 | 47 | ||
Line 83... | Line 87... | ||
83 | // NORMAL axis scale
|
87 | // NORMAL axis scale
|
84 | #define NORMALAXISSCALE 65536
|
88 | #define NORMALAXISSCALE 65536
|
85 | 89 | ||
86 | #define BUTTONSET(x, value) (CONTROL_ButtonState |= ((uint64_t)value << ((uint64_t)(x))))
|
90 | #define BUTTONSET(x, value) (CONTROL_ButtonState |= ((uint64_t)value << ((uint64_t)(x))))
|
87 | #define BUTTONCLEAR(x) (CONTROL_ButtonState &= ~((uint64_t)1 << ((uint64_t)(x))))
|
91 | #define BUTTONCLEAR(x) (CONTROL_ButtonState &= ~((uint64_t)1 << ((uint64_t)(x))))
|
88 | - | ||
89 | #define BUTTONHELDSET(x, value) (CONTROL_ButtonHeldState |= (uint64_t)(value << ((uint64_t)(x))))
|
92 | #define BUTTONHELDSET(x, value) (CONTROL_ButtonHeldState |= (uint64_t)(value << ((uint64_t)(x))))
|
90 | - | ||
91 | #define LIMITCONTROL(x) \
|
- | |
92 | { \
|
- | |
93 | if ((*x) > MAXCONTROLVALUE) \
|
- | |
94 | { \
|
- | |
95 | (*x) = MAXCONTROLVALUE; \
|
- | |
96 | } \
|
- | |
97 | if ((*x) < -MAXCONTROLVALUE) \
|
- | |
98 | { \
|
- | |
99 | (*x) = -MAXCONTROLVALUE; \
|
- | |
100 | } \
|
- | |
101 | }
|
- | |
102 | #define SGN(x) (((x) > 0) ? 1 : ((x) < 0) ? -1 : 0)
|
93 | #define LIMITCONTROL(x) (*x = clamp(*x, -MAXCONTROLVALUE, MAXCONTROLVALUE))
|
103 | 94 | ||
104 | //****************************************************************************
|
95 | //****************************************************************************
|
105 | //
|
96 | //
|
106 | // TYPEDEFS
|
97 | // TYPEDEFS
|
107 | //
|
98 | //
|