JM Badge Board Applications - small mistake

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

JM Badge Board Applications - small mistake

1,604 次查看
AndreiBoeru
Contributor I
I found a little mistake in the demo Applications. In the file accelerometer.c starting from line 486, the original code is:
switch(sensitivity)
  {
    case Range15g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;
    case Range2g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 1;
      break;
    case Range4g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 0;
      break;
    case Range6g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 1;
      break;
    default:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;                 
  }

The problem is that Range2g and Range4g are misplaced. So the correct code would be
switch(sensitivity)
  {
    case Range15g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;
    case Range4g:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 1;
      break;
    case Range2g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 0;
      break;
    case Range6g:
      PTCD_PTCD4 = 1; 
      PTCD_PTCD5 = 1;
      break;
    default:
      PTCD_PTCD4 = 0; 
      PTCD_PTCD5 = 0;
      break;                 
  }

Happy coding!


Message Edited by Andrei Boeru on 2008-12-27 01:00 AM
标签 (1)
0 项奖励
回复
1 回复

679 次查看
anthony_huereca
NXP Employee
NXP Employee
Thanks for catching that! The change will be uploaded to the website soon.
0 项奖励
回复