Fixes a problem with dynamic idle not checking for bidirectional DSHOT being enabled. So the code would run but have no RPM data available leading to elevated motor idle.
Fixes a problem with dynamic idle not resetting accumulated static variables that continue to be used when dynamic idle is switched off via a PID profile change. Depending on the state of the variables this could cause excessive motor idle speed. In some cases enough to cause the quad to spontaneously take off on arming or be unable to descend in flight.
Fixes a problem with dynamic idle inappropriately modifying the static `motorOutputLow` that is set based on the chosen motor protocol. Downstream code that relies on this value to determine the acutal motor output range was adversely affected.
Motor and DSHOT refactoring broke blocking DSHOT commands as the check for commands being enabled was not taking into account that "blocking" type commands need to operate only when the motors are not enabled.
Fixes the CLI `dshotprog` command.
Most people who have tested IllusionFPV's expo on the dynamic D lowpass filter have found it to improve propwash without adverse effects.
It achieves this reducing D lowpass delay more quickly on throttling up.
This allows us to retain, at idle, the strong lowpass filtering we currently have, but quickly reduce lowpass delay and improve propwash by mid throttle.
A value of 5-7 is OK I'm proposing 5 as a conservative start.
I know this is a new feature but it is really good . It would be great if it could be made active by default, if possible, in 4.2.
Since tickerCharacters is a char pointer rather than a char array the
result is: sizeof(8) / sizeof(1).
However, desired
result is: sizeof(5) / sizeof(1).
See also following example:
const char *tickerCharacters = "|/-\\";
const char _tickerCharacters[] = "|/-\\";
int main(void)
{
printf("%zu\n", (sizeof(tickerCharacters) / sizeof(char)));
printf("%zu\n", (sizeof(_tickerCharacters) / sizeof(char)));
return 0;
}
> gcc test.c -o test && ./test
8
5
Previously the task was always enabled and there's no reason for it to be running if there are no boxID associations.
Saves a few cycles by not running. But has a bigger effect on the scheduler by minimizing the number of active tasks when possible.
Now with the motor protocol defaulting to DISABLED we can reimplement this.
Remove dependence on gyro type and base on MCU type.
The previous logic was based on expecting an 8K sampling gyro and would set an inappropriate loop time for other gyro types.
Change the logic to be based on the capabilities of the MCU which is more appropriate. We set the pid_process_denom default to the maximum recommended value for a given MCU.
The `pid_process_denom` will be defaulted as follows (assuming a 8khz gyro) based on MCU type:
MCU `pid_process_denom`
F1: 8 (1khz)
F3: 4 (2khz)
F411: 2 (4khz)
Others: 1 (8khz)
Of course the final PID loop rate will be based on the native sample rate of the gyro.
The CMS task was configured to run at 60hz but there was limiting logic in place to restrict it to every 50ms (20hz). Remove the extra logic and simply run the task at 20hz.
There was incorrect logic that checked if `(cmsDeviceCount < 0)` to not run the task. Firstly `cmsDeviceCount` can never be < 0, and secondly the task should not run when it is 0 as that means there are no registered `displayPort` devices. Generally fix the logic to used `unsigned` for `cmsDeviceCount`. It can only ever be increaded (new device registered) and there is no mechanism to "unregister" a device.
Lots of coding style cleanup.
Fix out of bounds buffer problems caused by employing incorrect sizes
VOL_LABEL_LEN != 12 in bs->volume_label
FILE_NAME_SHRT_LEN + FILE_NAME_EXTN_LEN != 8 in entry->name