[New Feature] I2C position encoder support (#6946)

* [New Feature] I2C position encoder support

I plan to continue improving/cleaning this up, as there areas that need work.

* let the cleanups begin.

* progress

* more progress

* comments, rename files, etc.

* clean

* Cleanups per thinkyhead

* a few more cleanups

* cleanups, bugfixes, etc.

* remove unnecessary passes_test(), additional cleanups/optimizations

* cleanups

* misc.

* Fix up I2CPEM.init() and a few other things.

* organize, fix, rename, etc.

* more optimization

* a few more tweaks
This commit is contained in:
bgort
2017-06-09 08:06:23 -04:00
committed by GitHub
parent f7dacd1f50
commit 2f55870edb
8 changed files with 1684 additions and 17 deletions

View File

@ -108,6 +108,8 @@
#define HYPOT2(x,y) (sq(x)+sq(y))
#define HYPOT(x,y) sqrt(HYPOT2(x,y))
#define SIGN(a) ((a>0)-(a<0))
// Macros to contrain values
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
#define NOMORE(v,n) do{ if (v > n) v = n; }while(0)