1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00
Commit graph

571 commits

Author SHA1 Message Date
Alberto García Hierro
df72de9d50 Fix VTX device type reported via MSP
When a VTX was configured, the reported type via MSP was always
zero.

Also, update comment regarding the MSP message format in Betaflight

Thanks to @mikeller for the heads up.
2018-06-24 18:50:05 +01:00
Alberto García Hierro
f36fe2386d Teach settings how to handle strings, make craft name a setting
Add a new type for settings to be able to handle strings. This makes
it easier to add more settings of this type and removes the need to
handle them with dedicated CLI commands.

Replace the `name` CLI command with a setting called `name`.

Saves 8 bytes of FLASH on OMNIBUS
2018-06-24 18:38:10 +01:00
Alberto García Hierro
2227580965 Rename settings related functions from snake_case to camelCase
Fits better with INAV code conventions

Renamed functions:
    - setting_get_name -> settingGetName
    - setting_name_contains -> settingNameContains
    - setting_name_exact_match -> settingNameIsExactMatch
    - setting_find -> settingFind
    - setting_get_value_size -> settingGetValueSize
    - setting_get_pgn -> settingGetPgn
    - setting_get_value_pointer -> settingGetValuePointer
    - setting_get_copy_value_pointer -> settingGetCopyValuePointer
    - setting_get_min -> settingGetMin
    - setting_get_max -> settingGetMax
2018-06-23 18:52:38 +01:00
Alberto García Hierro
414cd2f7ec Separate OSD layout responses over MSP by layout
Since sending the whole layouts over MSP was making the layouts
response too big (bigger than the default 512 bytes MSP TX buffer),
each OSD layout is now sent separately via by making
MSP2_INAV_OSD_LAYOUTS an in/out message.

Also, all 5 in/out messages have now been moved to a function which
handles all of them (mspFCProcessInOutCommand()).

Fixes crash when retriving the OSD layouts via MSP.
2018-06-23 18:41:23 +01:00
Alberto García Hierro
5ed9236f75
Merge pull request #3401 from iNavFlight/agh_vtx_settings
Port new VTX API and settings from Betaflight
2018-06-22 09:20:24 +01:00
Alberto García Hierro
7b223eb215 Port new VTX API and settings from Betaflight
- VTX with support for FC control are now totally managed from the
FC. The FC will store the VTX configuration and override any changes
made manually (e.g. with a button). Users can disable VTX control
to manage channels manually.
- OSD VTX item now shows the power level too.
- Added new parameters for VTX configuration: vtx_band, vtx_channel,
vtx_freq, vtx_halfduplex, vtx_low_power_disarm, vtx_pit_mode_freq
and vtx_power.
- Added support for automatically switching the VTX power when
arming (fixes #3112).

Note that there are a several changes from the BF code. We do support
an additional setting for the low power during disarm option and
the MSP messages contain more data to allow users to configure the
VTX channel/power from the configurator. Our MSP messages also work
when the VTX is offline (the settings are stored in the FC and applied
later once the VTX is powered up).

Thanks to Matek (http://www.mateksys.com) for providing an FCHUB-VTX
to test the Tramp protocol.

Thanks to AKK (https://www.akktek.com) for providing an X2-ultimate
to test SmartAudio.
2018-06-20 17:30:54 +01:00
Michel Pastor
ac09105484 Add voltage source setting to MSP2_INAV_MISC and MSP2_INAV_BATTERY_CONFIG messages 2018-06-16 04:04:46 +02:00
Michel Pastor
4c2ffa6021 Add cell count setting to MSP2_INAV_MISC and MSP2_INAV_BATTERY_CONFIG messages 2018-06-16 03:59:17 +02:00
Michel Pastor
adc2802f95 Fix small mistake in battery profiles PR 2018-06-14 02:30:28 +02:00
Michel Pastor
ce8621ee8f Add battery profiles feature 2018-06-13 15:58:38 +02:00
Pawel Spychalski (DzikuVx)
46ff1e31e6 MSP frame for braking settings 2018-06-13 15:45:27 +02:00
Konstantin (DigitalEntity) Sharlaimov
d452344c04 Remove MIDRC setting 2018-06-03 20:15:57 +02:00
Konstantin Sharlaimov
9e6e2b3f65
Timer driver refactoring (#3120)
* Initial cut on timer cleanup and refactoring
* Remove unused code
* Dynamic timer state allocation
* Remove USABLE_TIMER_CHANNEL_COUNT and USED_TIMERS definitions
2018-05-23 16:44:30 +10:00
Pawel Spychalski (DzikuVx)
7cee94363c Acc notch and gyro stage2 in MSP 2018-05-13 10:30:12 +02:00
Konstantin Sharlaimov (DigitalEntity)
d8288f6821 Change MPU/ICM gyro drivers to use 16G acceleration scale 2018-05-12 22:12:41 +10:00
Pawel Spychalski (DzikuVx)
969825f53d Gimbal mode removed. If needed, this can be recreated using mixer itself 2018-05-09 08:20:12 +02:00
Paweł Spychalski
2aac86663d
Merge pull request #3119 from iNavFlight/dzikuvx-channel-forwarding-removed
Remove feature channel forwarding
2018-05-08 10:10:20 +02:00
Konstantin Sharlaimov
d5f3309fb7
Merge pull request #3167 from shellixyz/update_msp_output_mapping
Update MSP2_INAV_OUTPUT_MAPPING to exclude inputs
2018-05-08 15:22:41 +10:00
Konstantin Sharlaimov
81dd2f3c0e
MSP opflow and rangefinder drivers (#3164)
* Add MSP optic flow and MSP rangefinder sensors
* Relax condition to lock on flow
* Opflow alignment support
2018-05-07 21:49:41 +10:00
Michel Pastor
ae6896c519 Update MSP2_INAV_OUTPUT_MAPPING to exclude inputs 2018-05-06 02:34:28 +02:00
Michel Pastor
49b3444088 Replace vbat_max_cell_voltage by the new vbat_cell_detect_voltage setting for detecting number of battery cells 2018-05-06 01:56:14 +02:00
Michel Pastor
532df040d2 Export output mapping through MSP 2018-05-03 23:10:20 +02:00
Konstantin Sharlaimov
e3dafbf516
Merge pull request #2955 from iNavFlight/agh_osd_layouts
Add support for multiple OSD layouts
2018-04-26 20:27:15 +10:00
Pawel Spychalski (DzikuVx)
2fc0717548 remaining elements of channel forwarding removed 2018-04-25 11:34:03 +02:00
Michel Pastor
b26f870f22 Replace PWM_RANGE_ZERO with PWM_RANGE_MIN 2018-04-24 01:45:12 +02:00
Alberto García Hierro
c5401d74d2 Initial support for multiple OSD layouts
- Add 3 new boxes that can be controlled by a switch to toggle
between the default and 3 alternate layouts.
- Add new MSP cmds to retrieve/set the whole layouts, the OSD alarms
and the preferences.
- For now, CMS and settings just see the default layout. This
will be addressed on future commits.
2018-04-23 11:28:04 +01:00
Konstantin Sharlaimov
ff06f6c53d
Merge pull request #2893 from iNavFlight/de_pid_improvements
MC PID improvements
2018-04-22 09:44:35 +10:00
Konstantin Sharlaimov (DigitalEntity)
477724a239 Deprecate itermRateIgnore. Port BF's iterm_windup based on mixrange
Apply anti-windup scaler to both kI and kT
2018-04-19 14:04:33 +10:00
Pawel Spychalski (DzikuVx)
6859e8c6fd Merge remote-tracking branch 'origin/development' into dzikuvx-mixer-rework 2018-04-17 14:08:30 +02:00
Konstantin Sharlaimov (DigitalEntity)
a0b790d6ca Make settings and MSP ranges consistent for min_command and min/maxthrottle 2018-04-12 15:44:10 +10:00
Pawel Spychalski (DzikuVx)
cdfe1d3a46 increased range for MSP motor rules roll/pitch/yaw to -2/2 2018-04-11 09:08:57 +02:00
Pawel Spychalski (DzikuVx)
5ad1396ff8 MIXER frame extended to send information about number of motors and servos 2018-04-04 19:23:27 +02:00
Pawel Spychalski (DzikuVx)
d2ecaedc4b MSP2 frame for getting and setting new mixer properties 2018-04-04 18:59:53 +02:00
Pawel Spychalski (DzikuVx)
9df8e5cfea mixerMode removed 2018-04-04 18:59:53 +02:00
Pawel Spychalski (DzikuVx)
e5f2abd770 USE_SERVO assumed always true (since it is) and removed 2018-04-04 18:59:53 +02:00
Pawel Spychalski (DzikuVx)
1d3c6c9195 USE_QUAD_MIXER_ONLY define removed from codebase 2018-04-04 18:59:53 +02:00
Michel Pastor
441bf681b2 Fix mistake in 9bf11ec59 2018-03-26 18:43:16 +02:00
Konstantin Sharlaimov
c60386f97d
Merge pull request #2958 from iNavFlight/de_gyro_sync_rework
Deprecate gyro sync
2018-03-23 20:47:50 +10:00
Konstantin Sharlaimov (DigitalEntity)
6ce5940e75 Deprecate gyro_sync_denom, gyro driver will make a decision about sampling rate at init 2018-03-23 00:57:08 +10:00
Michel Pastor
0a73cd1f11 Fix bug when saving servo params causing the servos not to move as configured 2018-03-22 14:06:14 +01:00
Michel Pastor
5260f97e1e MSP SET messages read ops protection: change dataSize == to dataSize <= for MSPv1 (compat) 2018-03-21 16:20:39 +01:00
Michel Pastor
9bf11ec591 MSP: protect all read operations and add some value checks 2018-03-19 19:05:12 +01:00
Alberto García Hierro
3022df24f5 Make MSP_SET_TX_INFO not crash on malformed MSP messages
Since it will be used while the machine is armed and over telemetry,
we need to make sure a malformed request doesn't crash the FC.

Also, rename setRSSIMsp() to setRSSIFromMSP()
2018-03-16 20:14:59 +00:00
Alberto García Hierro
f4db6341a8 Use new RSSI system to handle all RSSI sources 2018-03-16 19:52:22 +00:00
Alberto García Hierro
a9c91b6e07 Add FPort support
FPort code is mostly imported from Betaflight. To make future RX
updates easier, a few more changes have been done to make the
RX/Telemetry code in BF and INAV a bit closer.

- Imported RSSI handling code from BF with some changes
- frsky_vfas_cell_voltage setting renamed to report_cell_voltage
- Added telemetry_halfduplex setting
- sbus_inversion renamed to serialrx_inverted, should apply to all
protocols eventually
- New MSP cmds MSP_TX_INFO/MSP_SET_TX_INFO now allow setting the RSSI
via MSP, thus RX_MSP doesn't need to use an extra channel anymore.
2018-03-16 12:50:23 +00:00
Alberto García Hierro
c661d0676b Add accessors for battery functions
Implement functions for accessing battery/current state rather
than accessing global variables directly. This will let us reuse
the RX/telemetry code from BF minimizing the required changes.
Thanks to LTO, this only adds a small ~20 byte overhead in flash.
2018-03-13 12:46:50 +00:00
Konstantin Sharlaimov
66a9fa2736
Merge pull request #2853 from shellixyz/msp_air_speed_message
Add MSP message for reading air speed
2018-03-07 17:09:17 +10:00
Konstantin Sharlaimov
9ad2b480f5
Merge pull request #2865 from shellixyz/fix_midrc_msp_minmax
Fix midrc MSP min/max checks
2018-03-03 13:28:40 +10:00
Michel Pastor
6c9457e5b3 Fix MSP syntax error 2018-03-02 23:36:49 +01:00
Michel Pastor
aaed7bd9aa Fix midrc MSP min/max checks 2018-03-02 23:30:46 +01:00