Permalink
Browse files

Fix motionplus message decoding (#93)

git-svn-id: http://abstrakraft.org/cwiid/svn/trunk@201 918edb2d-ff29-0410-9de2-eb38e7f22bc7
  • Loading branch information...
1 parent c12d0e1 commit 16742777c2b8e433fce5cfdc45be41194061aa86 @abstrakraft committed Jul 16, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 libcwiid/process.c
View
@@ -243,11 +243,11 @@ int process_ext(struct wiimote *wiimote, unsigned char *data,
if (wiimote->state.rpt_mode & CWIID_RPT_MOTIONPLUS) {
motionplus_mesg = &ma->array[ma->count++].motionplus_mesg;
motionplus_mesg->type = CWIID_MESG_MOTIONPLUS;
- motionplus_mesg->angle_rate[CWIID_PHI] = ((uint16_t)data[5] & 0xFA)<<6 |
+ motionplus_mesg->angle_rate[CWIID_PHI] = ((uint16_t)data[5] & 0xFC)<<6 |
(uint16_t)data[2];
- motionplus_mesg->angle_rate[CWIID_THETA] = ((uint16_t)data[4] & 0xFA)<<6 |
+ motionplus_mesg->angle_rate[CWIID_THETA] = ((uint16_t)data[4] & 0xFC)<<6 |
(uint16_t)data[1];
- motionplus_mesg->angle_rate[CWIID_PSI] = ((uint16_t)data[3] & 0xFA)<<6 |
+ motionplus_mesg->angle_rate[CWIID_PSI] = ((uint16_t)data[3] & 0xFC)<<6 |
(uint16_t)data[0];
}
break;

0 comments on commit 1674277

Please sign in to comment.