Skip to content

Commit a48f1e2

Browse files
Merge pull request #154 from ShimmerEngineering/DEV-81
DEV-81
2 parents a25c40b + fdf5d81 commit a48f1e2

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

Shimmer32FeetAPI/ShimmerSDBT32Feet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ public void SdConfigWrite()
890890
file.WriteLine("gs_range=" + GetGSRRange());
891891
file.WriteLine("exp_power=" + (GetExpPower() ? 1 : 0));
892892
file.WriteLine("gyro_range=" + GetGyroRange());
893-
file.WriteLine("gyro_samplingrate=" + GetMpu9150SamplingRate());
893+
file.WriteLine("gyro_samplingrate=" + GetGyroSamplingRate());
894894
file.WriteLine("acc_range=" + GetAccelRange());
895895
file.WriteLine("acc_lpm=" + GetAccelLPBit());
896896
file.WriteLine("acc_hrm=" + GetAccelHRBit());

ShimmerAPI/ShimmerAPI/ShimmerBluetooth.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public abstract class ShimmerBluetooth : ShimmerDevice
129129
protected int MagGain;
130130
protected int LNAccelRange;
131131
protected int AccelSamplingRate;
132-
protected int Mpu9150SamplingRate;
132+
protected int GyroSamplingRate;
133133
protected int AltAccelSamplingRate;
134134
protected int AltMagSamplingRate;
135135
protected long ConfigSetupByte0; // for Shimmer2
@@ -2239,7 +2239,7 @@ public void InterpretInquiryResponseShimmer3R(List<byte> packet)
22392239
GyroRange = (int)((ConfigSetupByte0 >> 16) & 0x03);
22402240
MagGain = (int)((ConfigSetupByte0 >> 21) & 0x07);
22412241
AccelSamplingRate = (int)((ConfigSetupByte0 >> 4) & 0xF);
2242-
Mpu9150SamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
2242+
GyroSamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
22432243
magSamplingRate = (int)((ConfigSetupByte0 >> 18) & 0x07);
22442244
PressureResolution = (int)((ConfigSetupByte0 >> 28) & 0x03);
22452245
GSRRange = (int)((ConfigSetupByte0 >> 25) & 0x07);
@@ -2275,10 +2275,14 @@ public void InterpretInquiryResponseShimmer3R(List<byte> packet)
22752275
{
22762276
LowPowerAccelEnabled = true;
22772277
}
2278-
2279-
}
2280-
2278+
2279+
if (GyroSamplingRate == 0x01)
2280+
{
2281+
LowPowerGyroEnabled = true;
2282+
}
22812283

2284+
}
2285+
22822286
NumberofChannels = (int)packet[6 + 3];
22832287
BufferSize = (int)packet[7 + 3];
22842288
ListofSensorChannels.Clear();
@@ -2308,7 +2312,7 @@ public void InterpretInquiryResponseShimmer3(List<byte> packet)
23082312
GyroRange = (int)((ConfigSetupByte0 >> 16) & 0x03);
23092313
MagGain = (int)((ConfigSetupByte0 >> 21) & 0x07);
23102314
AccelSamplingRate = (int)((ConfigSetupByte0 >> 4) & 0xF);
2311-
Mpu9150SamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
2315+
GyroSamplingRate = (int)((ConfigSetupByte0 >> 8) & 0xFF);
23122316
magSamplingRate = (int)((ConfigSetupByte0 >> 18) & 0x07);
23132317
PressureResolution = (int)((ConfigSetupByte0 >> 28) & 0x03);
23142318
GSRRange = (int)((ConfigSetupByte0 >> 25) & 0x07);
@@ -2327,13 +2331,12 @@ public void InterpretInquiryResponseShimmer3(List<byte> packet)
23272331
LowPowerAccelEnabled = true;
23282332
}
23292333

2330-
if ((Mpu9150SamplingRate == 0xFF && ADCRawSamplingRateValue < 3200))
2334+
if ((GyroSamplingRate == 0xFF && ADCRawSamplingRateValue < 3200))
23312335
{
23322336
LowPowerGyroEnabled = true;
23332337
}
23342338
}
23352339

2336-
23372340
NumberofChannels = (int)packet[6];
23382341
BufferSize = (int)packet[7];
23392342
ListofSensorChannels.Clear();
@@ -5392,9 +5395,9 @@ public int GetMpu9150AccelRange()
53925395
{
53935396
return Mpu9150AccelRange;
53945397
}
5395-
public int GetMpu9150SamplingRate()
5398+
public int GetGyroSamplingRate()
53965399
{
5397-
return Mpu9150SamplingRate;
5400+
return GyroSamplingRate;
53985401
}
53995402

54005403
public int GetAccelRange()
@@ -6354,7 +6357,7 @@ protected void WriteGyroSamplingRate(int rate)
63546357
{
63556358
if (HardwareVersion == (int)ShimmerVersion.SHIMMER3 || HardwareVersion == (int)ShimmerVersion.SHIMMER3R)
63566359
{
6357-
Mpu9150SamplingRate = rate;
6360+
GyroSamplingRate = rate;
63586361
mTempIntValue = rate;
63596362
WriteBytes(new byte[2] { (byte)PacketTypeShimmer3.SET_MPU9150_SAMPLING_RATE_COMMAND, (byte)rate }, 0, 2);
63606363
System.Threading.Thread.Sleep(200);

ShimmerAPI/ShimmerAPI/ShimmerLogAndStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ public void SdConfigWrite()
12071207
file.WriteLine("gs_range=" + GetGSRRange());
12081208
file.WriteLine("exp_power=" + (GetExpPower() ? 1 : 0));
12091209
file.WriteLine("gyro_range=" + GetGyroRange());
1210-
file.WriteLine("gyro_samplingrate=" + GetMpu9150SamplingRate());
1210+
file.WriteLine("gyro_samplingrate=" + GetGyroSamplingRate());
12111211
file.WriteLine("acc_range=" + GetAccelRange());
12121212
file.WriteLine("acc_lpm=" + GetAccelLPBit());
12131213
file.WriteLine("acc_hrm=" + GetAccelHRBit());

ShimmerAPI/ShimmerAPI/ShimmerSDBT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ public void SdConfigWrite()
976976
file.WriteLine("gs_range=" + GetGSRRange());
977977
file.WriteLine("exp_power=" + (GetExpPower() ? 1 : 0));
978978
file.WriteLine("gyro_range=" + GetGyroRange());
979-
file.WriteLine("gyro_samplingrate=" + GetMpu9150SamplingRate());
979+
file.WriteLine("gyro_samplingrate=" + GetGyroSamplingRate());
980980
file.WriteLine("acc_range=" + GetAccelRange());
981981
file.WriteLine("acc_lpm=" + GetAccelLPBit());
982982
file.WriteLine("acc_hrm=" + GetAccelHRBit());

0 commit comments

Comments
 (0)