Skip to content

Commit

Permalink
work around QMI8658 issue [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 31, 2023
1 parent 44a6840 commit 8dee180
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
44 changes: 43 additions & 1 deletion software/firmware/source/SoftRF/src/platform/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,39 @@ static void ESP32_setup()
// selfTest enable
true);

imu_qmi8658.configGyroscope(
/*
* GYR_RANGE_16DPS
* GYR_RANGE_32DPS
* GYR_RANGE_64DPS
* GYR_RANGE_128DPS
* GYR_RANGE_256DPS
* GYR_RANGE_512DPS
* GYR_RANGE_1024DPS
* */
SensorQMI8658::GYR_RANGE_64DPS,
/*
* GYR_ODR_7174_4Hz
* GYR_ODR_3587_2Hz
* GYR_ODR_1793_6Hz
* GYR_ODR_896_8Hz
* GYR_ODR_448_4Hz
* GYR_ODR_224_2Hz
* GYR_ODR_112_1Hz
* GYR_ODR_56_05Hz
* GYR_ODR_28_025H
* */
SensorQMI8658::GYR_ODR_896_8Hz,
/*
* LPF_MODE_0 //2.66% of ODR
* LPF_MODE_1 //3.63% of ODR
* LPF_MODE_2 //5.39% of ODR
* LPF_MODE_3 //13.37% of ODR
* */
SensorQMI8658::LPF_MODE_3,
// selfTest enable
true);

// In 3DOF mode,
imu_qmi8658.enableAccelerometer();

Expand Down Expand Up @@ -1303,7 +1336,16 @@ static void ESP32_loop()
if (imu_qmi8658.getDataReady()) {
float a_x, a_y, a_z;
if (imu_qmi8658.getAccelerometer(a_x, a_y, a_z)) {
IMU_g_x10 = (int) (sqrtf(a_x*a_x + a_y*a_y + a_z*a_z) * 4 * 10);
#if 0
Serial.print("{ACCEL: ");
Serial.print(a_x);
Serial.print(",");
Serial.print(a_y);
Serial.print(",");
Serial.print(a_z);
Serial.println("}");
#endif
IMU_g_x10 = (int) (sqrtf(a_x*a_x + a_y*a_y + a_z*a_z) * 10);
}
}
break;
Expand Down
1 change: 0 additions & 1 deletion software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,6 @@ static nRF52_display_id nRF52_EPD_ident()
* 00 00 00 00 00 FF 40 00 00 00 01 - D67 SYX 1942
* 00 00 00 FF 00 00 40 01 00 00 00 - D67 SYX 2118
* 00 00 00 FF 00 00 40 01 00 00 00 - D67 SYX 2129

*
* 0x2E:
* 00 00 00 00 00 00 00 00 00 00 - C1
Expand Down
6 changes: 3 additions & 3 deletions software/firmware/source/libraries/OGN/freqplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class FreqPlan
switch (Protocol)
{
case RF_PROTOCOL_P3I:
{ BaseFreq=869525000; ChanSepar= 200000; Channels= 1; MaxTxPower = 27; }
{ BaseFreq= 869525000; ChanSepar= 200000; Channels= 1; MaxTxPower = 27; }
break;
case RF_PROTOCOL_ADSB_1090:
{ BaseFreq=869525000; ChanSepar=2000000; Channels= 1; MaxTxPower = -10; }
{ BaseFreq=1090000000; ChanSepar=2000000; Channels= 1; MaxTxPower = -10; }
break;
case RF_PROTOCOL_ADSB_UAT:
{ BaseFreq=978000000; ChanSepar=2000000; Channels= 1; MaxTxPower = -10; }
{ BaseFreq= 978000000; ChanSepar=2000000; Channels= 1; MaxTxPower = -10; }
break;
case RF_PROTOCOL_FANET:
switch (Plan)
Expand Down

0 comments on commit 8dee180

Please sign in to comment.