Skip to content

Commit

Permalink
refactor(quality control): Use an isolated version of `CFA_Config.hpp…
Browse files Browse the repository at this point in the history
…` for Defect Detector environment. (#117)
  • Loading branch information
ZZ-Cat authored Apr 19, 2024
1 parent 5b5a898 commit 406c8b6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SerialReceiver/CRSF/CRSFProtocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

#pragma once

#ifndef ENV_DEFECT_DETECTOR
#include "../../CFA_Config.hpp"
#endif

namespace crsfProtocol
{
Expand Down
1 change: 1 addition & 0 deletions src/SerialReceiver/SerialReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ namespace serialReceiverLayer
_flightModes[i].min = serialReceiver._flightModes[i].min;
_flightModes[i].max = serialReceiver._flightModes[i].max;
}
_flightModeCallback = serialReceiver._flightModeCallback;
#endif

#if CRSF_LINK_STATISTICS_ENABLED > 0
Expand Down
2 changes: 2 additions & 0 deletions src/SerialReceiver/SerialReceiver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

#pragma once

#ifndef ENV_DEFECT_DETECTOR
#include "../CFA_Config.hpp"
#endif
#include "Arduino.h"
#include "CRSF/CRSF.hpp"
#include "Telemetry/Telemetry.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/SerialReceiver/Telemetry/Telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
*/

#include "Telemetry.hpp"
#ifndef ENV_DEFECT_DETECTOR
#include "CFA_Config.hpp"
#endif

using namespace crsfProtocol;

Expand Down
2 changes: 2 additions & 0 deletions src/hal/CompatibilityTable/CompatibilityTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
*/

#include "CompatibilityTable.hpp"
#ifndef ENV_DEFECT_DETECTOR
#include "../../CFA_Config.hpp"
#endif
#include "Arduino.h"

namespace hal
Expand Down
30 changes: 30 additions & 0 deletions targets/quality_control.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
[env:defect_detector]
board = adafruit_metro_m4
build_flags =
; An isolated configuration from CFA_Config.hpp is used here to test EVERY possible
; configuration, and ensure that defects (if any) are picked up.
; The `ENV_DEFECT_DETECTOR` define configures CRSF for Arduino for use with the Defect Detector.
-DENV_DEFECT_DETECTOR

-DCRSF_FAILSAFE_LQI_THRESHOLD=80
-DCRSF_FAILSAFE_RSSI_THRESHOLD=105

-DCRSF_RC_ENABLED=1
-DCRSF_RC_MAX_CHANNELS=16
-DCRSF_RC_CHANNEL_MIN=172
-DCRSF_RC_CHANNEL_MAX=1811
-DCRSF_RC_CHANNEL_CENTER=992
-DCRSF_RC_INITIALISE_CHANNELS=1
-DCRSF_RC_INITIALISE_ARMCHANNEL=1
-DCRSF_RC_INITIALISE_THROTTLECHANNEL=1

-DCRSF_FLIGHTMODES_ENABLED=1
-DCRSF_CUSTOM_FLIGHT_MODES_ENABLED=1

-DCRSF_TELEMETRY_ENABLED=1
-DCRSF_TELEMETRY_ATTITUDE_ENABLED=1
-DCRSF_TELEMETRY_BAROALTITUDE_ENABLED=1
-DCRSF_TELEMETRY_BATTERY_ENABLED=1
-DCRSF_TELEMETRY_FLIGHTMODE_ENABLED=1
-DCRSF_TELEMETRY_GPS_ENABLED=1

-DCRSF_LINK_STATISTICS_ENABLED=1

build_src_filter =
+<../examples/platformio/main.cpp>
+<*/*/*.cpp>
Expand Down

0 comments on commit 406c8b6

Please sign in to comment.