Skip to content

Commit ec528f1

Browse files
committed
Whitespace and Tab corrections
1 parent 80c05ea commit ec528f1

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/SparkFun_BNO080_Arduino_Library.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ bool BNO080::dataAvailable(void)
149149
if (digitalRead(_int) == HIGH)
150150
return (false);
151151
}
152-
152+
153153
if (receivePacket() == true)
154154
{
155155
//Check to see if this packet is a sensor reporting its data to us
@@ -163,11 +163,11 @@ bool BNO080::dataAvailable(void)
163163
parseCommandReport(); //This will update responses to commands, calibrationStatus, etc.
164164
return (true);
165165
}
166-
else if(shtpHeader[2] == CHANNEL_GYRO)
167-
{
168-
parseInputReport(); //This will update the rawAccelX, etc variables depending on which feature report is found
169-
return (true);
170-
}
166+
else if(shtpHeader[2] == CHANNEL_GYRO)
167+
{
168+
parseInputReport(); //This will update the rawAccelX, etc variables depending on which feature report is found
169+
return (true);
170+
}
171171
}
172172
return (false);
173173
}
@@ -232,12 +232,12 @@ void BNO080::parseInputReport(void)
232232
int16_t dataLength = ((uint16_t)shtpHeader[1] << 8 | shtpHeader[0]);
233233
dataLength &= ~(1 << 15); //Clear the MSbit. This bit indicates if this package is a continuation of the last.
234234
//Ignore it for now. TODO catch this as an error and exit
235-
235+
236236
dataLength -= 4; //Remove the header bytes from the data count
237237

238238
timeStamp = ((uint32_t)shtpData[4] << (8 * 3)) | ((uint32_t)shtpData[3] << (8 * 2)) | ((uint32_t)shtpData[2] << (8 * 1)) | ((uint32_t)shtpData[1] << (8 * 0));
239239

240-
// The gyro-integrated input reports are sent via the special gyro channel and do no include the usual ID, sequence, and status fields
240+
// The gyro-integrated input reports are sent via the special gyro channel and do no include the usual ID, sequence, and status fields
241241
if(shtpHeader[2] == CHANNEL_GYRO) {
242242
rawQuatI = (uint16_t)shtpData[1] << 8 | shtpData[0];
243243
rawQuatJ = (uint16_t)shtpData[3] << 8 | shtpData[2];
@@ -246,7 +246,7 @@ void BNO080::parseInputReport(void)
246246
rawFastGyroX = (uint16_t)shtpData[9] << 8 | shtpData[8];
247247
rawFastGyroY = (uint16_t)shtpData[11] << 8 | shtpData[10];
248248
rawFastGyroZ = (uint16_t)shtpData[13] << 8 | shtpData[12];
249-
249+
250250
return;
251251
}
252252

@@ -295,8 +295,10 @@ void BNO080::parseInputReport(void)
295295
rawMagY = data2;
296296
rawMagZ = data3;
297297
}
298-
else if (shtpData[5] == SENSOR_REPORTID_ROTATION_VECTOR || shtpData[5] == SENSOR_REPORTID_GAME_ROTATION_VECTOR ||
299-
shtpData[5] == SENSOR_REPORTID_AR_VR_STABILIZED_ROTATION_VECTOR || shtpData[5] == SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR)
298+
else if (shtpData[5] == SENSOR_REPORTID_ROTATION_VECTOR ||
299+
shtpData[5] == SENSOR_REPORTID_GAME_ROTATION_VECTOR ||
300+
shtpData[5] == SENSOR_REPORTID_AR_VR_STABILIZED_ROTATION_VECTOR ||
301+
shtpData[5] == SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR)
300302
{
301303
quatAccuracy = status;
302304
rawQuatI = data1;
@@ -305,7 +307,7 @@ void BNO080::parseInputReport(void)
305307
rawQuatReal = data4;
306308

307309
//Only available on rotation vector and ar/vr stabilized rotation vector,
308-
// not game rot vector and not ar/vr stabilized rotation vector
310+
// not game rot vector and not ar/vr stabilized rotation vector
309311
rawQuatRadianAccuracy = data5;
310312
}
311313
else if (shtpData[5] == SENSOR_REPORTID_STEP_COUNTER)
@@ -1214,13 +1216,13 @@ boolean BNO080::receivePacket(void)
12141216
uint8_t packetMSB = _spiPort->transfer(0);
12151217
uint8_t channelNumber = _spiPort->transfer(0);
12161218
uint8_t sequenceNumber = _spiPort->transfer(0); //Not sure if we need to store this or not
1217-
1219+
12181220
//Store the header info
12191221
shtpHeader[0] = packetLSB;
12201222
shtpHeader[1] = packetMSB;
12211223
shtpHeader[2] = channelNumber;
12221224
shtpHeader[3] = sequenceNumber;
1223-
1225+
12241226
//Calculate the number of data bytes in this packet
12251227
uint16_t dataLength = ((uint16_t)packetMSB << 8 | packetLSB);
12261228
dataLength &= ~(1 << 15); //Clear the MSbit.
@@ -1242,7 +1244,7 @@ boolean BNO080::receivePacket(void)
12421244
}
12431245

12441246
digitalWrite(_cs, HIGH); //Release BNO080
1245-
1247+
12461248
_spiPort->endTransaction();
12471249
//printPacket();
12481250
}

0 commit comments

Comments
 (0)