Isolates and prevents changes to runtime active features. Any changes to enabled features are deferred until after a save/reboot. Simplifies the previous logic.
Prevents potential failures when features are changed at runtime but the underlying code is not capabile of dynamic reconfiguration.
If the `vtxDevice` was not valid then the `vtxStatus` variable never got initialized but was still used in the pit mode flag determination - leading to random behavior.
Adds the RPM (ESC sensor or DSHOT telemetry), invalid packet stats (DSHOT telemetry), and ESC temperature (ESC sensor) for each motor to MSP.
Adds controlling flags and `motor_poles` to `MSP_MOTOR_CONFIG`.
Added to the MSP_MOTOR_CONFIG message:
U8 configured motor count
U8 motor poles
U8 dshot telemetry enabled (boolean)
U8 esc sensor enabled (boolean)
New MSP_MOTOR_DSHOT_TELEMETRY message
U8 motor_count - number of active motors for which data will follow
Loop for motor_count
U32 motor_rpm
U16 invalid_packet_percent - 2 decimal places. So 10000 is 100.00%
U8 esc temperature (degrees celcius)
U16 esc voltage (0.01V per unit)
U16 esc current (0.01A per unit)
U16 esc mAh consumption
The original implementation:
* removed the old 'alignment' variable
* did not require 'ALIGN_CUSTOM'
* always used rotation matrix
* had no additional per-pid-loop conditional logic.
Extract currently unused code into tests.
In preparation for either deleting or re-using in validateAndFixConfig.
Fix code style of some old boardalignment code.
De-duplicate vector rotation code.
Now that rotation code is exacted from `alignBoard` and now doesn't use
`boardRotation` some if it was similar to the code in `rotateV` in
maths.c
Use DECIDEGREES for mag and gyro/acc custom alignments.
Use unnamed structure instead of `values`.
Redefine what 'custom' orientation means.
Move alignment test-only code into the tests.
Ensure gyro/mag custom alignment settings follow the enum variations.
This can't be applied to ALIGN_DEFAULT because, in the case of the MAG,
the default isn't actually known until the gyro is detected, see
`compassDetect`.
OMNIBUSF4/F7 - Don't use ALIGN_DEFAULT in target.h,
common_defaults_post.h does this now.
Comment cleanup.
Delete unused alignment code left from various tests/refactoring
efforts.
* Please do not squash this commit.
Fix SITL build by avoiding structure assignment with anonymous inner
struct.
The error from the build server was as follows:
```./src/main/common/sensor_alignment.c:49:5: error: missing initializer
for field ‘yaw’ of ‘struct <anonymous>’
[-Werror=missing-field-initializers]
*sensorAlignment = CUSTOM_ALIGN_CW0_DEG;
^
In file included from ./src/main/common/sensor_alignment.c:27:0:
./src/main/common/sensor_alignment.h:80:17: note: ‘yaw’ declared here
int16_t yaw;
^
```
Cleanup sensor_alignment API.