Fix reading of balance board data

This commit is contained in:
Ryan Pavlik
2011-05-02 13:47:39 -05:00
parent 1b3597250b
commit 9666e7a930
2 changed files with 20 additions and 26 deletions

View File

@@ -85,6 +85,10 @@ extern FILE* logtarget[];
#define BIG_ENDIAN_LONG(i) (htonl(i))
#define BIG_ENDIAN_SHORT(i) (htons(i))
/* Convert from big endian */
#define FROM_BIG_ENDIAN_LONG(i) (ntohl(i))
#define FROM_BIG_ENDIAN_SHORT(i) (ntohs(i))
#define absf(x) ((x >= 0) ? (x) : (x * -1.0f))
#define diff_f(x, y) ((x >= y) ? (absf(x - y)) : (absf(y - x)))