From aec019a29b0e6f3fd5e2768517bd8806a02b5a9d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 3 Jul 2019 04:55:45 +0200 Subject: [PATCH] ORS improvement --- control.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/control.cpp b/control.cpp index 58ca609d..76c88bed 100644 --- a/control.cpp +++ b/control.cpp @@ -1078,7 +1078,7 @@ string choices[3] = {"OFF", "relative", "absolute"}; #if CAP_ORIENTATION transmatrix getOrientation() { - return MirrorX * MirrorZ * hr::getOrientation() * MirrorX * MirrorZ; + return MirrorX * hr::getOrientation() * MirrorX; } #endif @@ -1186,10 +1186,16 @@ void rerotate(transmatrix& T) { if(mode == 1) T = (relative_matrix) * T; } +int first_check, last_check; + void check_orientation() { #if CAP_ORIENTATION if(!mode) return; - if(ticks < when_enabled + 500) { + + if(ticks > last_check + 2000) first_check = ticks; + last_check = ticks; + + if(ticks < first_check + 500) { last_orientation = getOrientation(); return; }