- unfortunately we can't depend on the system field due to potential
external binding and non-genuine Spektrum equipment
- reject any DSM frame with duplicate channels
- add 16 channel mask
- tighten valid PWM range 990-2010us (±100% travel is 1102-1898µs)
- update RCTest rejected frame count
- always check system field for validity
- reject any data outside of "servo position" valid range from Spektrum specification
- properly support XPlus channels (12+)
- debug message if channel count changes
Fixes these invalid format strings:
- A `%d` for a pointer (replaced it by `%p`)
- A 0x%08x (and a 0x%0x8!) for a pointer (replaced by %p)
- 2 cases of `%d` for a `ssize_t` (replaced it by `%zi`)
- 1 case of a %u for an `int` (replaced by %i)
- 3 cases of %d for a `long` (replaced by %ld)
- 19 cases of `%d`, `%i`, `%u` or `%lu` for a `size_t` (replaced it by `%zu`)
- An unused formatting argument (removed it)
- A missing `%d` (added it)
- A missing `%s` (added it)
- 2 cases of `%llu` for a `uint64_t` (replaced it by `"%" PRIu64`)
- 6 cases of giving a string directly as format string (replaced it by `("%s", string)`)
- 2 cases of %*-s, which should probably have been %-*s.
(Looks like NuttX accepts (the invalid) %*-s, but other platforms don't.)
- A %04x for a `uint32_t` (replaced by "%04" PRIx32)
On SPM4649T receivers with firmware versions at least 1.1RC9, the
serial data will contain an rssi value in dbm, as outlined in the
Remote Receiver Interfacing document section 8.3.1.
If the value received is greater than or equal to zero, the receiver
does not support rssi data, and the incoming value will be ignored.
However, if the value is negative, we can use the rssi value.
When we have a valid rssi, it gets mapped to a percentage from 0 to
100 as expected by mavlink. This mapping is constructed as a
logarithmic function over Spektrum's published minimum and maximum
rssi values, -92dBm to -42dBm as 0 to 100:
100 Log10[1 + (x - min) * (9 / (max - min))]
This change updates all calls to the dsm input rountes to return
the rssi value.
Note that one place this doesn't work with the px4io enabled.
There is a comment left in the absence of analog rssi that:
"we do not actually get digital RSSI regs[PX4IO_P_RAW_RC_NRSSI]".
This restriction has been left in place, as removing it exposes a
problem where the frequency of the control tick is greater than
that of valid dsm frames so the rssi isn't valid every cycle.
* For some reason cppcheck complains with `fp != nullptr` but accepts truthiness
of handle by itself.
* Note that the expressions are equivalent according to the C++ standard ("A
prvalue of arithmetic, unscoped enumeration, pointer, or pointer to member
type can be converted to a prvalue of type bool. A zero value, null pointer
value, or null member pointer value is converted to false; any other value is
converted to true. A prvalue of type std::nullptr_t can be converted to a
prvalue of type bool; the resulting value is false.")
* Low impact changes from path_cleanup branch.
This is a step towards minimizing the diff with path_cleanup branch.
* Update ecl.
* Revert matrix update.
* Revert ecl and matrix.
* Update sitl gazebo.
* Revert sitl_gazebo and matrix changes.