Navigation Menu

Skip to content

Commit

Permalink
remove sc
Browse files Browse the repository at this point in the history
  • Loading branch information
rs2k committed Apr 25, 2016
1 parent 08466dd commit 0b85da1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/drivers/accgyro_mpu.c
Expand Up @@ -321,12 +321,13 @@ bool mpuGyroRead(int16_t *gyroADC)

int count;
for (count=0; count < 3; count++) {
if ( (last_data0[count] - current_data[count]) <= -32000) {
current_data[count] = -32677;
} else
if ( (-last_data0[count] + current_data[count]) <= -32000) {
current_data[count] = 32677;
}
//Overflow sanity check. Not working right yet.
//if ( (last_data0[count] - current_data[count]) <= -32000) {
// current_data[count] = -32677;
//} else
//if ( (-last_data0[count] + current_data[count]) <= -32000) {
// current_data[count] = 32677;
//}
gyroADC[count] = (int16_t)((current_data[count] + last_data0[count] + last_data1[count]) / 3);
last_data1[count] = last_data0[count];
last_data0[count] = current_data[count];
Expand Down

0 comments on commit 0b85da1

Please sign in to comment.