* LED Dimmer
Build with EXTRA_FLAGS=-DUSE_LED_STRIP
Tested on SpeedyBeeF7V3
Added adjrange to update the ledstrip_brightness variable. This allows for easy changing of LEDs without having to connect to the configurator.
* Added Unit Tests, Space to Tab
Added unit tests into rx_controls_unittest.cc. The LED brightness is returned as 50 for testing purposes.
Changed tabs in ledstrip.c & .h and rc_adjustments.c to 4 spaces for coding standards.
* Update src/main/fc/rc_adjustments.h
Missed a tab in rc_adjustments.h
Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>
* Update src/main/fc/rc_adjustments.c
Removal of empty line
Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>
* Update rc_adjustments.c
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
* Update src/main/io/ledstrip.c
* Update src/main/io/ledstrip.h
* Update src/test/unit/rc_controls_unittest.cc
---------
Co-authored-by: nerdCopter <56646290+nerdCopter@users.noreply.github.com>
Co-authored-by: Jay Blackman <blckmn@users.noreply.github.com>
Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
* RX task update rate to 22Hz, to improve 25Hz link stability
* modified Rx code
* add LQ to debug
* use max of frameAge or FrameDelta
* Require a dropouit of 200ms, not 100ms, before RXLOSS
* remove FrameAge, use 150ms timeout 50ms checks
* fix tests and tidy up the comments
* Handle NULL input as before, log frame time
* possible solutions to review comment about names
* Remove rxFrameTimeUs
- prepare for direct use of lastRcFrameTimeUs
- refactor rx_spi callback
* remove global currentRxRateHz
* simplify updateRcRefreshRate
* re-name to recheck interval, return frame time debug
* Calculate RxRate only once
* use rxReceivingSignal for consistency
* use signalReceived not rxDataReceived for consistency
* suggestions from review PL
* move defines, thanks K
* fixes from review, thanks MH
* review changes, undo task interval change
rename bool rxIsReceivingSignal to isRxReceivingSignal
thanks Steve for resolving that tasks changes are not needed
thanks PL for your feedback also
---------
Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
* rename dMin, remove D_MIN_GAIN_MAX
* rename vars
* fix logic
* fix logic
* Revert "fix tests"
This reverts commit c518c9c444.
* Revert "add yaw and other adjustment cases"
This reverts commit 2cacd4b360.
* Revert "fix unit test"
This reverts commit 3d88f4158a.
* Revert "fix D adjustments change dmax instead of D"
This reverts commit 7ee4e7f8af.
* Revert "Fix telemetry for Spektrum/SRXL (#13814)"
This reverts commit 04fe4b4461.
* review adjustments and test fixes
* Reapply "Fix telemetry for Spektrum/SRXL (#13814)"
This reverts commit eb7f8ee0fd.
* fix logic
* Apply suggestions from code review
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
* fix d_max slider
---------
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
* unittest - fix duplicate symbols in unittests
Some symbols were declared again
With clang -fcommon, this resulted in allocatin in common segment and
prevented error.
(tentative definitions in C standard).
-fno-common (now default in clang https://reviews.llvm.org/D75056)
causes compilation errors.
Declarations are now marked extern.
* unittest - fix scheduler array size for unittest
Unittest needs extra space for canary
* unittest - fix missing include (needed for clang-16)
* unittest - remove unused varibles
-Werror in clang 15+
* unittest - increase max supported version to clang-16
* unittest - conditionaly disable useless output in unittests
* unittest - C++11 version of STATIC_ASSERT
* unittest - fix initializers for g++
- Change order of initializers to match order in struct
- make valueTable initializion consistent (necessary for C++)
- adapt controlRateConfig
* unittest - adapt scheduler_unitest for g++
scheduler_stubs.c is necessary to initialize task_attributes
* unittest - fix ledstrip unittest
only part of config was zeroed
* unittest - fix g++ warnings
- memcpy when length is known and \0 is not copied
- isError is local stub, no extern
- serialReadStub - don't memcpy into object, use initializer
* cli - cleanup cliGetSettingIndex
- compare only passed bytes (old version may read data after
name)
- input string is const
* unittest - fix ld warning from PG sections
move pg data sections after .rodata. Sections were marked as writable
due to relocation (!?). That marked .text output section
(containing .pg_data) as writable too and linker correctly complained
that executable section is writable.
* unittest - cleanup
* unittest - adapt after code cleanup, add gcc
- remove clang flags that are not necessary now (tested on clang-11
and clang-16)
- add support for gcc ( make test CC=gcc CXX=g++ )
- add suport for different optimization level (detects some code
problems) : make test OPTIMIZE=-O2
- fallback to clang on Linux too
* fixup! unittest - conditionaly disable useless output in unittests
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.
Analyze the rc modes activation conditions and only process configured entries. Previously the entire possible list was processed even though typically only a handful are configured.
Reduces the RX task processing time by about 25% (~44us to ~33us) with an average setup of 3 modes configured (F405, SBUS). Processing time savings will diminish as the user configures more modes. But typically far fewer than the maximum of 20 will be configured.
On bootup aux channels start out at default and allow sticky modes right away,
although they should only be allowed once they are actually not active.
_Legal disclaimer: I am making my contributions/submissions to this project solely in my personal capacity and am not conveying any rights to any intellectual property of any third parties._
Tries to prevent DSHOT beacon commands from interfering with commands to set the motor direction.
Adds a 2 second delay after disarming before DSHOT beacon commands will be sent. This attempts to prevent the beacon commands from interfering with the motor direction reset that happens after using crash flip mode.
During arming if a DSHOT beacon command has been sent within 2 seconds the arming will be delayed until the 2 seconds have passed. This attempts to prevent interference with the motor direction commands sent at arming.
Since we currently don't have per gyro configuration, trying to use two different gyro types simultaneously may not provide good results or lead to other unforeseen situations like attempting to initialize with settings not applicable to both hardware types.
This logic looks at the detected gyro types and resets to use only the first one if the user selected "BOTH" and they're different hardware types.
Addresses the rare possibility that if runway takeoff triggers and disarms while the pilot has the sticks in some valid stick command configuration. Prevents the stick command from processing until the craft is disarmed and the ARMING_DISABLED_RUNAWAY_TAKEOFF condition is cleared.
For example, if the pilot was mid throttle and went full yaw right and runway takeoff triggered, then camera control would have be entered.
Detects runaway pidSum values on takeoff and auto-disarms to prevent the "Tasmanian Devil" caused by incorrect props, wrong motor order/direction, incorrect flight controller orientation, etc. After a successful takeoff and normal flight is detected the feature is disabled for the remainder of the battery.