From: svnhieber Date: Tue, 11 Jan 2011 17:04:23 +0000 (+0000) Subject: fix compile error X-Git-Url: https://git.rohieb.name/bachelor-thesis/roomba_tests.git/commitdiff_plain/e269ea78a9b6ecae6e4948f7b1a3ad6938a5adfd fix compile error git-svn-id: https://svn.itm.uni-luebeck.de/wisebed/wiselib/trunk/pc_apps/roomba_tests@4002 f8795833-4959-0410-8ae9-8bcb0cfab428 --- diff --git a/main.cc b/main.cc index 3eb6874..09bf40b 100644 --- a/main.cc +++ b/main.cc @@ -88,10 +88,10 @@ struct SensorData { int nearest_diff(unsigned short last, unsigned short current) { int d = current - last; if(d < -0x8000) { // overflow in positive direction - d = (0x10000 - last_i + this_i); + d = (0x10000 - last + current); } if(d >= 0x8000) { // overflow in negative direction - d = -(0x10000 - this_i + last_i); + d = -(0x10000 - current + last); } }