1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00
Commit graph

23 commits

Author SHA1 Message Date
luca
23ef95f17e Failsafe procedure from OSD 2021-03-20 18:37:18 +01:00
Pawel Spychalski (DzikuVx)
4fd2149e2b Drop min_throttle in favor of throttle IDLE percent 2019-12-22 21:33:19 +01:00
Alberto García Hierro
d524d8c8cc Refactor handling of RC input data
- Remove globals rcData and rcRaw
- Use accesor functions to retrieve RX input data
- Refactor rx.c to use an array of structs instead of multiple arrays
- Drop the RC Preview menu from CMS. Implementing this without
globals requires significant flash and the usefulness of this menu
is questionable. If we get complains, we can add it back later.

Flash usage goes down ~250 bytes due to the removed menu. Final
binary is mostly unaffected, since LTO is able to inline the new
accessor functions in most cases.
2019-03-10 21:50:05 +00:00
Alberto García Hierro
3ba770c1e2 Combine BACK and END entries in CMS menus in a single item
As suggested by @hydra. OME_Back and OME_END continue to be valid
items, but we now also have OME_BACK_AND_END which creates a back
entry and indicates the end of the menu, saving an entry. On F3,
this saves 464 bytes of flash.
2019-02-17 22:52:47 +00:00
Alberto García Hierro
f672affa8e Add missing include in CMS menus that reference setting IDs
Header was accidentally included by cms/cms.h
2018-07-02 22:12:05 +01:00
Michel Pastor
6c1bb01437 Remove duplicated battery settings in CMS misc menu 2018-06-16 01:08:39 +02:00
Alberto García Hierro
0c14331305 Reduce RAM usage in CMS
Add support for direct pointers to readonly values rather than using
intermediate OSD_XXX_t types.
Use direct pointers on all readonly values.
Make sure all intermediate value/step holders are in flash rather
than ram, since they're never modified.

This saves another 352 bytes of RAM (mostly on data, a few on bss).
2018-03-06 11:01:33 +00:00
Alberto García Hierro
d6c75bd6f5 Move CMS entries and menus from RAM to FLASH
Use a global array in cms.c to keep track of the dirty elements
that need redrawing. This lets us avoid modifying the entry flags
to keep track of it, so they can now be completely read only. This
in turn lets us also move all the menus to the text section.

This commit saves 6112 bytes of RAM in F3, so we have some room
to play again without resorting to disabling features.
2018-03-06 10:58:43 +00:00
Alberto García Hierro
0131e3e066 Move most CMS entry definitions to macros
This will make the transition to using const values where possible
much easier and cleaner.
2018-03-06 10:55:17 +00:00
Alberto García Hierro
741b6c3242 Use macros for the BACK and END items in CMS menus
Will make future changes cleaner
2018-03-06 10:49:59 +00:00
shellixyz
f00194c167 Improve battery monitoring (#2705)
* increase battery voltage resolution to 10mV
* increase battery voltage resolution to 10mV: update VBATT_HYSTERESIS
* increase battery voltage resolution to 10mV: fix telemetry and other places where vbat calculations needs to be divided by 10
* increase battery voltage resolution to 10mV: revert blackbox data to 100mV resolution because modifying the viewer is not trivial
* increase battery voltage resolution to 10mV: change new MSPv2 frame type names to follow convention

* smartport telemetry: remove wrong and now irrelevant comments

* Improve battery monitoring
* improve battery monitoring: fix/simplify the batteryAdcToVoltage function
* improve battery monitoring: Add OSD voltage decimals setting to OSD MISC menu
* improve battery monitoring: clean the batteryConfig struct
* improve battery monitoring: increase batteryConfig PG group version to 1
* improve battery monitoring: change capacity settings type from uin16_t to uint32_t (65Wh is not very large, it is about 6Ah for a 3S Li-Po)
* improve battery monitoring: rename capacity settings
* improve battery monitoring: improve OSD code
* improve battery monitoring: simplified taskUpdateBattery
* improve battery monitoring: use unfiltered vbat to decide if the battery is full
2018-02-02 12:28:34 +10:00
Alberto García Hierro
7a1491e158 Prepend USE_ prefix to CPP directives for enabling features
Prepended to: 'ACC', 'GYRO', 'BARO', 'MAG', 'LED_STRIP',
'SPEKTRUM_BIND', 'SERIAL_RX', 'BLACKBOX', 'GPS', 'GPS_PROTO_UBLOX',
'TELEMETRY', 'TELEMETRY_LTM', 'TELEMETRY_FRSKY', 'CMS',
'GPS_PROTO_NMEA', 'GPS_PROTO_I2C_NAV', 'GPS_PROTO_NAZA',
'GPS_PROTO_UBLOX_NEO7PLUS', 'GPS_PROTO_MTK', 'TELEMETRY_HOTT',
'TELEMETRY_IBUS', 'TELEMETRY_MAVLINK', 'TELEMETRY_SMARTPORT',
'TELEMETRY_CRSF', 'PWM_DRIVER_PCA9685', 'PITOT', 'OSD',
2017-12-04 13:01:24 +00:00
Martin Budden
a8efd77d73 Made inclusion of CMS guard conditional on debug flag 2017-11-20 09:02:23 +00:00
Alberto García Hierro
f1fb918803 Add support for modifying settings directly in CMS (#2262)
* Add macros for injecting CMS key presses

Useful for testing and debugging

* Add support for CMS elements represented by just a bool function

Function is called for both getting and setting the value. Will
allow simplying the code for several CMS items.

* Use OME_BoolFunc on cms_menu_ledstrip.c

Allows removing a couple of static variables and replacing two
functions with just one.

* Add support for manipulating settings directly in CMS

Allows changing settings without intermediary values/functions,
reducing memory usage. Due to the required code to support this
feature we're using ~250 bytes of flash, but we're saving around
~300 bytes of RAM. However, eventually we should be able to migrate
all CMS code to use the settings API and end up saving flash space.
Also, the memory overhead per memory setting is now way smaller.

* Don't use SETTING_VBAT_* when the target doesn't use the ADC

Fixes build on COLIBRI

* Add support for CMS setting data types

This allows us to format angular rates without introducing a function
pointer for formatting on every CMS setting.

* Remove CMS_INJECTED_KEYS used for debugging

* Fix off-by-one error in setting_get_max() for MODE_LOOKUP values

Maximum value is one less than the number of entries in the table
2017-10-07 13:02:44 +01:00
Martin Budden
5faa723c4a Fixed up CMS to use parameter groups 2017-01-23 10:12:00 +00:00
Martin Budden
54116e0ea4 Removed unnecessary config_proile.h 2017-01-21 16:11:21 +00:00
Martin Budden
9ef884ced6 Minor tidy of PG changes 2017-01-16 11:55:15 +00:00
Martin Budden
7529b45aa4 Replaced config pointers with config PG macros. Tidied #includes 2017-01-15 11:16:09 +00:00
Martin Budden
ec22adcf74 Added batteryConfig parameter group 2017-01-07 13:23:45 +00:00
Martin Budden
d8efe67d64 Added motorConfig parameter group 2017-01-06 17:42:58 +00:00
Martin Budden
0d2d74a259 Renamed config/config.* to fc/config.* 2017-01-01 15:59:45 +00:00
Martin Budden
94ef44a116 Added config macros 2016-12-12 21:56:56 +00:00
jflyper
8dbef28d81 Brute force grafting
Attempt to brutally graft BF3.1’s OSD, CMS, DISPLAYPORT, DASHBOARD,
MSP_DISPLAYPORT onto INAV-1.4.

With this first cut, integrated OSD (based on MAX7456) and CMS over the
OSD is working.
2016-11-09 22:26:56 +09:00