aboutsummaryrefslogtreecommitdiff
path: root/hid-tmt300rs.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-07-18 19:06:09 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2021-07-18 19:06:09 +0300
commitc6c0c50a442fb943b0c0f9949e54ad4e6c1203d1 (patch)
treeeb847acbf90065d16e045797ffcc8a9a65d3a111 /hid-tmt300rs.h
parent4216aaa61bfb753158be9e719c59626aeb368231 (diff)
downloadhid-tmff2-c6c0c50a442fb943b0c0f9949e54ad4e6c1203d1.tar.gz
hid-tmff2-c6c0c50a442fb943b0c0f9949e54ad4e6c1203d1.zip
Improved periodic effect
Diffstat (limited to 'hid-tmt300rs.h')
-rw-r--r--hid-tmt300rs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/hid-tmt300rs.h b/hid-tmt300rs.h
index 3f5af4e..80146ef 100644
--- a/hid-tmt300rs.h
+++ b/hid-tmt300rs.h
@@ -29,8 +29,8 @@
#define FF_EFFECT_PLAYING 3
#define FF_EFFECT_QUEUE_UPDATE 4
-#define CLAMP_VALUE_U16(x) ((unsigned short)((x) > 0xffff ? 0xffff : (x)))
-#define SCALE_VALUE_U16(x, bits) (CLAMP_VALUE_U16(x) >> (16 - bits))
+#undef fixp_sin16
+#define fixp_sin16(v) (((v % 360) > 180)? -(fixp_sin32((v % 360) - 180) >> 16) : fixp_sin32(v) >> 16)
#define JIFFIES2MS(jiffies) ((jiffies) * 1000 / HZ)
spinlock_t lock;