~foura/uxn900

4154f6ad4c3778c28490c44b51af6e52535d6044 — james palmer 1 year, 10 months ago 8a42825
dev/mouse: calculate pressure in one go.

this worked when it was a local, now it does not, so do it all in one go.
ask the compiler.
1 files changed, 1 insertions(+), 2 deletions(-)

M src/dev/mouse.c
M src/dev/mouse.c => src/dev/mouse.c +1 -2
@@ 62,8 62,7 @@ mouse_poll(dev_mouse_t *dev, Uxn *u)
	/* Calculate pressure using equation one,then scale down to 0-128.
	 * See the TSC2005 Datasheet. The value 280 below is the x plate resistance,
	 * sourced from the linux device tree. */
	dev->pressure = tx * (tz2 - tz1) / tz1;
	dev->pressure = dev->pressure * 280 / 4096 / 8;
	dev->pressure = (tx * (tz2 - tz1) / tz1) * 280 / 4096 / 8;

	/* This code is a bit of a bodge and probably has bugs.
	 * It is here to get touchscreen input to map nicely into uxn. */