Skip to content

Commit 837854c

Browse files
committed
add imu disable fault
1 parent 7950bc9 commit 837854c

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

.github/workflows/test_code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: Cache pip
15-
uses: actions/cache@v2
15+
uses: actions/cache@v4
1616
with:
1717
path: ~/.cache/pip
1818
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
1919
restore-keys: ${{ runner.os }}-pip-
2020
- name: Cache PlatformIO
21-
uses: actions/cache@v2
21+
uses: actions/cache@v4
2222
with:
2323
path: ~/.platformio
2424
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

src/Faults.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace fault_groups {
1414
Fault *gyro_y_average = new Fault(0x6009);
1515
Fault *gyro_z_value = new Fault(0x6010);
1616
Fault *gyro_z_average = new Fault(0x6011);
17+
Fault *imu_disable = new Fault(0x6012);
1718
} // namespace imu_faults
1819
namespace power_faults {
1920
Fault *temp_c_value = new Fault(0x6020);

src/Faults.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace fault_groups {
1717
extern Fault *gyro_y_average;
1818
extern Fault *gyro_z_value;
1919
extern Fault *gyro_z_average;
20+
extern Fault *imu_disable;
2021
} // namespace imu_faults
2122
namespace power_faults {
2223
extern Fault *temp_c_value;

src/Monitors/IMUMonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void IMUMonitor::execute()
3636
sfr::imu::power_setting = (uint8_t)sensor_power_mode_type::do_nothing;
3737
}
3838

39-
if (sfr::imu::power_setting == (uint8_t)sensor_power_mode_type::on && sfr::imu::powered == false) {
39+
if (sfr::imu::power_setting == (uint8_t)sensor_power_mode_type::on && sfr::imu::powered == false && !fault_groups::imu_faults::imu_disable->get_base()) {
4040
#ifdef VERBOSE
4141
Serial.println("Turned on IMU");
4242
#endif

0 commit comments

Comments
 (0)