Interface to access to Avago ADNS-9500 laser mouse sensors.
Fork of ADNS9500 by
Diff: adns9500.hpp
- Revision:
- 7:1771f1c89df6
- Parent:
- 3:898ed1944119
- Child:
- 10:bbf9ff378632
--- a/adns9500.hpp Wed Jun 13 23:59:47 2012 +0000 +++ b/adns9500.hpp Mon Jun 25 16:33:14 2012 +0000 @@ -33,8 +33,8 @@ #define ADNS9500_IF_RUNNING_SROM_CODE(x) (bool)(x & 0x80) #define ADNS9500_IF_FRAME_FIRST_PIXEL(x) (bool)(x & 0x01) #define ADNS9500_IF_OBSERVATION_TEST(x) (bool)(x & ADNS9500_OBSERVATION_CHECK_BITS) -#define ADNS9500_UINT16(ub, lb) (((uint16_t)ub << 8) + (uint16_t)lb) -#define ADNS9500_INT16(ub, lb) ((((int16_t)(int8_t)ub) << 8) + (int16_t)lb) +#define ADNS9500_UINT16(ub, lb) (uint16_t)(((ub & 0xff) << 8) | (lb & 0xff)) +#define ADNS9500_INT16(ub, lb) (int16_t)(((ub & 0xff) << 8) | (lb & 0xff)) namespace adns9500 {