JM Badge Board Applications - small mistake

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

JM Badge Board Applications - small mistake

1,668件の閲覧回数
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 返信

743件の閲覧回数
anthony_huereca
NXP Employee
NXP Employee
Thanks for catching that! The change will be uploaded to the website soon.
0 件の賞賛
返信