Skip to content

Commit 3c70959

Browse files
Merge branch 'maintenance-10.x' into msp_versioning
2 parents 9c70040 + 94fd8cb commit 3c70959

14 files changed

Lines changed: 104 additions & 22 deletions

File tree

docs/Programming Framework.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ for complete documentation on using JavaScript to program your flight controller
119119
| 54 | Mag calibration | Trigger a magnetometer calibration. |
120120
| 55 | Set Gimbal Sensitivity | Scales `Operand A` from [`-16` : `15`]
121121
| 56 | Override Minimum Ground Speed | When active, sets the minimum ground speed to the value specified in `Operand A` [m/s]. Minimum allowed value is set in `nav_min_ground_speed`. Maximum value is `150` |
122+
| 58 | Trigonometry: ACos | Computes ACOS of (`Operand A` / `Operand B`) using the fast approximation. If `Operand B` is `0`, `1000` is used. Input is clamped to [-1, 1] and the result is returned in degrees. |
123+
| 59 | Trigonometry: ASin | Computes ASIN of (`Operand A` / `Operand B`) using the fast approximation. If `Operand B` is `0`, `1000` is used. Input is clamped to [-1, 1] and the result is returned in degrees. |
124+
| 60 | Trigonometry: ATan2 | Computes ATAN2 using `Operand A` as Y and `Operand B` as X with the fast approximation. Returns a signed angle in degrees in `(-180, 180]`. |
122125

123126
### Operands
124127

docs/Settings.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5056,6 +5056,16 @@ Force OSD to work in grid mode even if the OSD device supports pixel level acces
50565056

50575057
---
50585058

5059+
### osd_framerate_hz
5060+
5061+
Target refresh rate for OSD elements in Hz. Each element is redrawn at approximately this rate. Values above 10 Hz provide no visible improvement for typical flight data but increase CPU load. Artificial horizon and telemetry are always updated every cycle regardless of this setting. Set to -1 for legacy behavior (one element per frame).
5062+
5063+
| Default | Min | Max |
5064+
| --- | --- | --- |
5065+
| -1 | -1 | 15 |
5066+
5067+
---
5068+
50595069
### osd_gforce_alarm
50605070

50615071
Value above which the OSD g force indicator will blink (g)

docs/development/msp/inav_enums.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"build": {
33
"fc_version": {
4-
"major": 9,
4+
"major": 10,
55
"minor": 0,
6-
"patch": 1
6+
"patch": 0
77
}
88
},
99
"enums": {
@@ -1870,8 +1870,7 @@
18701870
"LED_MODE_ANGLE": "3",
18711871
"LED_MODE_MAG": "4",
18721872
"LED_MODE_BARO": "5",
1873-
"LED_MODE_LOITER": "6",
1874-
"LED_SPECIAL": "7"
1873+
"LED_SPECIAL": "6"
18751874
},
18761875
"ledOverlayId_e": {
18771876
"_source": "inav/src/main/io/ledstrip.h",
@@ -2064,7 +2063,10 @@
20642063
"LOGIC_CONDITION_SET_GIMBAL_SENSITIVITY": "55",
20652064
"LOGIC_CONDITION_OVERRIDE_MIN_GROUND_SPEED": "56",
20662065
"LOGIC_CONDITION_SET_ALTITUDE_TARGET": "57",
2067-
"LOGIC_CONDITION_LAST": "58"
2066+
"LOGIC_CONDITION_ACOS": "58",
2067+
"LOGIC_CONDITION_ASIN": "59",
2068+
"LOGIC_CONDITION_ATAN2": "60",
2069+
"LOGIC_CONDITION_LAST": "61"
20682070
},
20692071
"logicWaypointOperands_e": {
20702072
"_source": "inav/src/main/programming/logic_condition.h",
@@ -2336,7 +2338,8 @@
23362338
"MULTI_FUNC_3": "3",
23372339
"MULTI_FUNC_4": "4",
23382340
"MULTI_FUNC_5": "5",
2339-
"MULTI_FUNC_END": "6"
2341+
"MULTI_FUNC_6": "6",
2342+
"MULTI_FUNC_END": "7"
23402343
},
23412344
"multiFunctionFlags_e": {
23422345
"_source": "inav/src/main/fc/multifunction.h",
@@ -3301,8 +3304,9 @@
33013304
"_source": "inav/src/main/io/displayport_msp_osd.c",
33023305
"SD_3016": "0",
33033306
"HD_5018": "1",
3304-
"HD_6022": "2",
3305-
"HD_5320": "3"
3307+
"HD_3016": "2",
3308+
"HD_6022": "3",
3309+
"HD_5320": "4"
33063310
},
33073311
"resourceOwner_e": {
33083312
"_source": "inav/src/main/drivers/resource.h",
@@ -3838,7 +3842,7 @@
38383842
"THR_HI": "(2 << (2 * THROTTLE))"
38393843
},
38403844
"systemState_e": {
3841-
"_source": "inav/src/main/fc/fc_init.h",
3845+
"_source": "inav/src/main/fc/fc_init.c",
38423846
"SYSTEM_STATE_INITIALISING": "0",
38433847
"SYSTEM_STATE_CONFIG_LOADED": "(1 << 0)",
38443848
"SYSTEM_STATE_SENSORS_READY": "(1 << 1)",

docs/development/msp/inav_enums_ref.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3156,7 +3156,10 @@
31563156
| `LOGIC_CONDITION_SET_GIMBAL_SENSITIVITY` | 55 | |
31573157
| `LOGIC_CONDITION_OVERRIDE_MIN_GROUND_SPEED` | 56 | |
31583158
| `LOGIC_CONDITION_SET_ALTITUDE_TARGET` | 57 | |
3159-
| `LOGIC_CONDITION_LAST` | 58 | |
3159+
| `LOGIC_CONDITION_ACOS` | 58 | |
3160+
| `LOGIC_CONDITION_ASIN` | 59 | |
3161+
| `LOGIC_CONDITION_ATAN2` | 60 | |
3162+
| `LOGIC_CONDITION_LAST` | 61 | |
31603163

31613164
---
31623165
## <a id="enum-logicwaypointoperands_e"></a>`logicWaypointOperands_e`

docs/javascript_programming/OPERATIONS_REFERENCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All INAV logic condition operations supported by the firmware are now fully impl
1111
**Arithmetic**: ADD, SUB, MUL, DIV, MODULUS (via +, -, *, /, %)
1212
**Comparisons**: EQUAL, GREATER_THAN, LOWER_THAN, APPROX_EQUAL (via ===, >, <, approxEqual())
1313
**Logical**: AND, OR, NOT, XOR, NAND, NOR (via &&, ||, !, xor(), nand(), nor())
14-
**Math**: MIN, MAX, SIN, COS, TAN, ABS (via Math.min/max/sin/cos/tan/abs)
14+
**Math**: MIN, MAX, SIN, COS, TAN, ACOS, ASIN, ATAN2, ABS (via Math.min/max/sin/cos/tan/acos/asin/atan2/abs)
1515
**Scaling**: MAP_INPUT, MAP_OUTPUT (via mapInput(), mapOutput())
1616
**Flow control**: STICKY, EDGE, DELAY, TIMER, DELTA (via on.* and helper functions)
1717
**Variables**: GVAR_SET, GVAR_INC, GVAR_DEC (via assignments, ++, --)
@@ -101,7 +101,7 @@ if (inav.rc[0].low && inav.rc[1].mid && inav.rc[2].high) {
101101

102102
- RC channels: `rc[0]` through `rc[17]` (18 channels)
103103
- RC channel properties: `.value` (1000-2000us), `.low` (<1333us), `.mid` (1333-1666us), `.high` (>1666us)
104-
- All trig functions (sin/cos/tan) take degrees, not radians
104+
- Trig functions: sin/cos/tan take degrees; acos/asin use ratios (-1..1) and atan2 returns a signed angle in (-180, 180] degrees from y/x inputs
105105
- MODULUS operator bug fixed: `%` now correctly generates MODULUS operation
106106
- MAP_INPUT normalizes to [0:1000], MAP_OUTPUT scales from [0:1000]
107107

docs/javascript_programming/api_definitions_summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Waypoint mission data:
7272

7373
Math functions:
7474
- **Basic**: min, max, abs
75-
- **Trig**: sin, cos, tan (degrees)
75+
- **Trig**: sin, cos, tan (degrees), acos/asin (ratio inputs), atan2 (y, x -> degrees)
7676
- **Mapping**: mapInput, mapOutput
7777
- **Arithmetic**: add, sub, mul, div, mod (operators)
7878

docs/javascript_programming/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Comprehensive guide to all INAV logic condition operations:
6565
- ✅ Arithmetic: `+`, `-`, `*`, `/`, `%`
6666
- ✅ Comparisons: `===`, `>`, `<`, `approxEqual()`
6767
- ✅ Logical: `&&`, `||`, `!`, `xor()`, `nand()`, `nor()`
68-
- ✅ Math: `Math.min()`, `Math.max()`, `Math.sin()`, `Math.cos()`, `Math.tan()`, `Math.abs()`
68+
- ✅ Math: `Math.min()`, `Math.max()`, `Math.sin()`, `Math.cos()`, `Math.tan()`, `Math.acos()`, `Math.asin()`, `Math.atan2()`, `Math.abs()`
6969
- ✅ Scaling: `mapInput()`, `mapOutput()`
7070
- ✅ Flow control: `edge()`, `sticky()`, `delay()`, `timer()`, `whenChanged()`
7171
- ✅ Variables: `gvar[0-7]`, `let`, `var`

src/main/build/debug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ typedef enum {
7979
DEBUG_GPS,
8080
DEBUG_LULU,
8181
DEBUG_SBUS2,
82+
DEBUG_OSD_REFRESH,
8283
DEBUG_COUNT // also update debugModeNames in cli.c
8384
} debugType_e;
8485

src/main/fc/cli.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ static const char *debugModeNames[DEBUG_COUNT] = {
222222
"HEADTRACKER",
223223
"GPS",
224224
"LULU",
225-
"SBUS2"
225+
"SBUS2",
226+
"OSD_REFRESH"
226227
};
227228

228229
/* Sensor names (used in lookup tables for *_hardware settings and in status

src/main/fc/settings.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ tables:
8484
"VIBE", "CRUISE", "REM_FLIGHT_TIME", "SMARTAUDIO", "ACC",
8585
"NAV_YAW", "PCF8574", "DYN_GYRO_LPF", "AUTOLEVEL", "ALTITUDE",
8686
"AUTOTRIM", "AUTOTUNE", "RATE_DYNAMICS", "LANDING", "POS_EST",
87-
"ADAPTIVE_FILTER", "HEADTRACKER", "GPS", "LULU", "SBUS2"]
87+
"ADAPTIVE_FILTER", "HEADTRACKER", "GPS", "LULU", "SBUS2", "OSD_REFRESH"]
8888
- name: aux_operator
8989
values: ["OR", "AND"]
9090
enum: modeActivationOperator_e
@@ -3334,6 +3334,13 @@ groups:
33343334
max: 600
33353335
type: int16_t
33363336
field: msp_displayport_fullframe_interval
3337+
- name: osd_framerate_hz
3338+
description: "Target refresh rate for OSD elements in Hz. Each element is redrawn at approximately this rate. Values above 10 Hz provide no visible improvement for typical flight data but increase CPU load. Artificial horizon and telemetry are always updated every cycle regardless of this setting. Set to -1 for legacy behavior (one element per frame)."
3339+
default_value: -1
3340+
min: -1
3341+
max: 15
3342+
type: int8_t
3343+
field: osd_framerate_hz
33373344
- name: osd_units
33383345
description: "IMPERIAL, METRIC, UK"
33393346
default_value: "METRIC"

0 commit comments

Comments
 (0)