Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5a2a0b8
[crsf] add temperature and RPM telemetry
gismo2004 Sep 14, 2025
710b36e
make the compiler happy
gismo2004 Sep 14, 2025
b39cc96
more compiler warnings
gismo2004 Sep 15, 2025
f8dc0bc
add AirSpeed
gismo2004 Sep 23, 2025
e5bfe79
Fix CRSF telemetry corruption from PR #11025
sensei-hacker Dec 18, 2025
5ee171f
Merge pull request #11451 from iNavFlight/maintenance-9.x
sensei-hacker Mar 22, 2026
ffb14ab
Update branch references from master to maintenance
sensei-hacker Mar 29, 2026
76809d7
Merge pull request #11461 from iNavFlight/sensei-hacker-patch-7
sensei-hacker Mar 29, 2026
216b76c
Add three new MSP2 commands for GCS-initiated flight control
danarrib Mar 29, 2026
25dd9dd
Remove MSP2_INAV_SET_ALT_TARGET (0x2222) — superseded by existing imp…
danarrib Mar 30, 2026
20745ec
Fix MSP-over-telemetry multi-frame request assembly
Apr 5, 2026
b1670bb
Merge pull request #11478 from b14ckyy/fix/msp-over-telemetry-multiframe
b14ckyy Apr 6, 2026
ed06c84
Fix bugs in ICM-45686 IMU driver (#11455)
sensei-hacker Apr 9, 2026
f0f41be
Merge pull request #11462 from danarrib/bulletgcss/msp-set-wp-index-a…
sensei-hacker Apr 9, 2026
9ce0752
Fix MSP_RESULT_NO_REPLY ignored in MSP-over-telemetry passthrough (#1…
b14ckyy Apr 9, 2026
f397f7e
telemetry: fix CRSF airspeed integer truncation and empty RPM/temp fr…
sensei-hacker Apr 10, 2026
0f18cbc
Use single-precision math where double is unnecessary
sensei-hacker Mar 6, 2026
03751bc
Code review fixes for float math flash savings
sensei-hacker Mar 6, 2026
be7a944
Merge pull request #11189 from sensei-hacker/fix-pr11025-crsf-telemetry
sensei-hacker Apr 10, 2026
3d6dc3b
Baro Altitude and Vario, AirSpeed
r1000 Nov 3, 2025
d0d89ec
Fix settings.md
r1000 Nov 5, 2025
e26ea67
docs: regenerate Settings.md from settings.yaml
sensei-hacker Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,16 @@ Blackbox logging rate numerator. Use num/denom settings to decide if a frame sho

---

### crsf_use_legacy_baro_packet

CRSF telemetry: If `ON`, send altitude about start point in GPS telemetry packet. If `OFF`, GPS has ASL altitude, altitude about start point in separate packet. Default: 'OFF'

| Default | Min | Max |
| --- | --- | --- |
| OFF | OFF | ON |

---

### cruise_power

Power draw at cruise throttle used for remaining flight time/distance estimation in 0.01W unit
Expand Down
10 changes: 5 additions & 5 deletions docs/development/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ The main flow for a contributing is as follows:
1. Login to github, go to the INAV repository and press `fork`.
2. Then using the command line/terminal on your computer: `git clone <url to YOUR fork>`
3. `cd inav`
4. `git checkout master`
4. `git checkout maintenance-10.x`
5. `git checkout -b my-new-code`
6. Make changes
7. `git add <files that have changed>`
Expand All @@ -114,13 +114,13 @@ The primary thing to remember is that separate pull requests should be created f

**Important:** Most contributions should target a maintenance branch, not `master`. See the branching section below for guidance on choosing the correct target branch.

Later, you can get the changes from the INAV repo into your `master` branch by adding INAV as a git remote and merging from it as follows:
Later, you can get the changes from the INAV repo into your version branch by adding INAV as a git remote and merging from it as follows:

1. `git remote add upstream https://github.com/iNavFlight/inav.git`
2. `git checkout master`
2. `git checkout maintenance-10.x`
3. `git fetch upstream`
4. `git merge upstream/master`
5. `git push origin master` is an optional step that will update your fork on github
4. `git merge upstream/maintenance-10.x`
5. `git push origin` is an optional step that will update your fork on github


You can also perform the git commands using the git client inside Eclipse. Refer to the Eclipse git manual.
Expand Down
32 changes: 31 additions & 1 deletion docs/development/msp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ For list of enums, see [Enum documentation page](https://github.com/iNavFlight/i
[8722 - MSP2_INAV_GEOZONE_VERTEX](#msp2_inav_geozone_vertex)
[8723 - MSP2_INAV_SET_GEOZONE_VERTEX](#msp2_inav_set_geozone_vertex)
[8724 - MSP2_INAV_SET_GVAR](#msp2_inav_set_gvar)
[8736 - MSP2_INAV_FULL_LOCAL_POSE](#msp2_inav_full_local_pose)
[8736 - MSP2_INAV_FULL_LOCAL_POSE](#msp2_inav_full_local_pose)
[8737 - MSP2_INAV_SET_WP_INDEX](#msp2_inav_set_wp_index)
[8739 - MSP2_INAV_SET_CRUISE_HEADING](#msp2_inav_set_cruise_heading)
[12288 - MSP2_BETAFLIGHT_BIND](#msp2_betaflight_bind)
[12289 - MSP2_RX_BIND](#msp2_rx_bind)

Expand Down Expand Up @@ -4526,6 +4528,34 @@ For list of enums, see [Enum documentation page](https://github.com/iNavFlight/i

**Notes:** All attitude angles are in deci-degrees.

## <a id="msp2_inav_set_wp_index"></a>`MSP2_INAV_SET_WP_INDEX (8737 / 0x2221)`
**Description:** Jumps to a specific waypoint during an active waypoint mission, causing the aircraft to immediately begin navigating toward the new target waypoint.

**Request Payload:**
|Field|C Type|Size (Bytes)|Units|Description|
|---|---|---|---|---|
| `wp_index` | `uint8_t` | 1 | - | 0-based waypoint index to jump to, relative to the mission start waypoint (`posControl.startWpIndex`) |

**Reply Payload:** **None**

**Notes:** Returns error if the aircraft is not armed, `NAV_WP_MODE` is not active, or the index is outside the valid mission range (`startWpIndex` to `startWpIndex + waypointCount - 1`). On success, sets `posControl.activeWaypointIndex` to the requested index and fires `NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP`, transitioning the navigation FSM back to `NAV_STATE_WAYPOINT_PRE_ACTION` so the flight controller re-initialises navigation for the new target.

---

## <a id="msp2_inav_set_cruise_heading"></a>`MSP2_INAV_SET_CRUISE_HEADING (8739 / 0x2223)`
**Description:** Sets the course heading target while Cruise or Course Hold mode is active, causing the aircraft to turn to and maintain the new heading.

**Request Payload:**
|Field|C Type|Size (Bytes)|Units|Description|
|---|---|---|---|---|
| `heading_centidegrees` | `int32_t` | 4 | centidegrees | Target heading in centidegrees (0–35999). Values are wrapped modulo 36000 before being applied. |

**Reply Payload:** **None**

**Notes:** Returns error if the aircraft is not armed or `NAV_COURSE_HOLD_MODE` is not active. On success, sets both `posControl.cruise.course` and `posControl.cruise.previousCourse` to the normalised value, preventing spurious heading adjustments from `getCruiseHeadingAdjustment()` on the next control cycle.

---

## <a id="msp2_betaflight_bind"></a>`MSP2_BETAFLIGHT_BIND (12288 / 0x3000)`
**Description:** Initiates the receiver binding procedure for supported serial protocols (CRSF, SRXL2).

Expand Down
32 changes: 12 additions & 20 deletions src/main/drivers/accgyro/accgyro_icm45686.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ Note: Now implemented only UI Interface with Low-Noise Mode
#define ICM456XX_ACCEL_CONFIG0 0x1B
#define ICM456XX_PWR_MGMT0 0x10
#define ICM456XX_TEMP_DATA1 0x0C
// Register map IPREG_TOP1 (for future use)
// Note: SREG_CTRL register provides endian selection capability.
// Currently not utilized as UI interface reads are in device's native endianness.
// Kept as reference for potential future optimization.
#define ICM456XX_RA_SREG_CTRL 0xA267 // To access: 0xA200 + 0x67

// SREG_CTRL - 0x67 (bits 1:0 select data endianness)
#define ICM456XX_SREG_DATA_ENDIAN_SEL_LITTLE (0 << 1) // Little endian (native)
#define ICM456XX_SREG_DATA_ENDIAN_SEL_BIG (1 << 1) // Big endian (requires IREG write)

// MGMT0 - 0x10 - Gyro
#define ICM456XX_GYRO_MODE_OFF (0x00 << 2)
#define ICM456XX_GYRO_MODE_STANDBY (0x01 << 2)
Expand Down Expand Up @@ -264,6 +254,7 @@ Note: Now implemented only UI Interface with Low-Noise Mode
#define ICM456XX_ACCEL_STARTUP_TIME_MS 10 // Min accel startup from OFF/STANDBY/LP
#define ICM456XX_GYRO_STARTUP_TIME_MS 35 // Min gyro startup from OFF/STANDBY/LP
#define ICM456XX_SENSOR_ENABLE_DELAY_MS 1 // Allow sensors to power on and stabilize
#define ICM456XX_INT_CONFIG_DELAY_MS 15 // Register settle time after interrupt config (matches ICM-426xx convention)
#define ICM456XX_IREG_TIMEOUT_US 5000 // IREG operation timeout (5ms max)

#define ICM456XX_DATA_LENGTH 6 // 3 axes * 2 bytes per axis
Expand Down Expand Up @@ -305,7 +296,7 @@ static bool icm45686WriteIREG(const busDevice_t *dev, uint16_t reg, uint8_t valu
if (misc2 & ICM456XX_BIT_IREG_DONE) {
return true;
}
delay(1);
delayMicroseconds(10);
}

return false; // timeout
Expand Down Expand Up @@ -357,7 +348,7 @@ static bool icm45686ReadTemperature(gyroDev_t *gyro, int16_t * temp)
return false;
}
// From datasheet: Temperature in Degrees Centigrade = (TEMP_DATA / 128) + 25
*temp = ( int16_val_little_endian(data, 0) / 12.8 ) + 250; // Temperature stored as degC*10
*temp = ( int16_val_little_endian(data, 0) / 12.8f ) + 250.0f; // Temperature stored as degC*10

return true;
}
Expand Down Expand Up @@ -398,7 +389,7 @@ static void icm45686AccAndGyroInit(gyroDev_t *gyro)
// Set the Accel UI LPF bandwidth cut-off to ODR/8 (Section 7.3 of datasheet)
if (!icm45686WriteIREG(dev, ICM456XX_ACCEL_UI_LPF_CFG_IREG_ADDR, ICM456XX_ACCEL_UI_LPFBW_ODR_DIV_8)) {
// If LPF configuration fails, fallback to BYPASS
icm45686WriteIREG(dev, ICM456XX_ACCEL_UI_LPF_CFG_IREG_ADDR, ICM456XX_ACCEL_UI_LPFBW_ODR_DIV_8);
icm45686WriteIREG(dev, ICM456XX_ACCEL_UI_LPF_CFG_IREG_ADDR, ICM456XX_ACCEL_UI_LPFBW_BYPASS);
}
// Setup scale and odr values for gyro
busWrite(dev, ICM456XX_GYRO_CONFIG0, ICM456XX_GYRO_FS_SEL_2000DPS | config->gyroConfigValues[1]);
Expand All @@ -409,7 +400,7 @@ static void icm45686AccAndGyroInit(gyroDev_t *gyro)
ICM456XX_INT1_POLARITY_ACTIVE_HIGH);
busWrite(dev, ICM456XX_INT1_CONFIG0, ICM456XX_INT1_STATUS_EN_DRDY);

delay(15);
delay(ICM456XX_INT_CONFIG_DELAY_MS);
busSetSpeed(dev, BUS_SPEED_FAST);
}

Expand All @@ -424,17 +415,18 @@ static bool icm45686DeviceDetect(busDevice_t * dev)
// Perform soft reset directly
// Soft reset
busWrite(dev, ICM456XX_REG_MISC2, ICM456XX_SOFT_RESET);
// Wait for reset to complete (bit 1 of REG_MISC2 becomes 0)
while (1) {
// Poll until soft reset completes (SOFT_RESET bit clears) per datasheet Section 9.4
do {
busRead(dev, ICM456XX_REG_MISC2, &tmp);
if (!(tmp & ICM456XX_SOFT_RESET)) {
break;
}
delay(1);
waitedMs++;
if (waitedMs >= 20) {
return false;
}
} while (waitedMs < 20);

if (tmp & ICM456XX_SOFT_RESET) {
return false;
}
// Initialize power management to a known state after reset
// This ensures sensors are off and ready for proper initialization
Expand Down Expand Up @@ -497,4 +489,4 @@ bool icm45686GyroDetect(gyroDev_t *gyro)
}


#endif
#endif
2 changes: 1 addition & 1 deletion src/main/drivers/accgyro/accgyro_icm45686.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@


bool icm45686AccDetect(accDev_t *acc);
bool icm45686GyroDetect(gyroDev_t *gyro);
bool icm45686GyroDetect(gyroDev_t *gyro);
2 changes: 1 addition & 1 deletion src/main/drivers/accgyro/accgyro_mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ const gyroFilterAndRateConfig_t * mpuChooseGyroConfig(uint8_t desiredLpf, uint16
bool mpuGyroRead(struct gyroDev_s *gyro);
bool mpuGyroReadScratchpad(struct gyroDev_s *gyro);
bool mpuAccReadScratchpad(struct accDev_s *acc);
bool mpuTemperatureReadScratchpad(struct gyroDev_s *gyro, int16_t * data);
bool mpuTemperatureReadScratchpad(struct gyroDev_s *gyro, int16_t * data);
2 changes: 1 addition & 1 deletion src/main/drivers/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,4 @@ bool busWrite(const busDevice_t * busdev, uint8_t reg, uint8_t data);
bool busTransfer(const busDevice_t * dev, uint8_t * rxBuf, const uint8_t * txBuf, int length);
bool busTransferMultiple(const busDevice_t * dev, busTransferDescriptor_t * buffers, int count);

bool busIsBusy(const busDevice_t * dev);
bool busIsBusy(const busDevice_t * dev);
22 changes: 22 additions & 0 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3684,6 +3684,28 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
}
break;

case MSP2_INAV_SET_CRUISE_HEADING:
// Set heading while Cruise / Course Hold is active.
// Payload: I32 heading_centidegrees (0–35999)
if (dataSize == 4) {
int32_t headingCd;
if (sbufReadI32Safe(&headingCd, src) && navSetCruiseHeading(headingCd)) {
break;
}
}
return MSP_RESULT_ERROR;

case MSP2_INAV_SET_WP_INDEX:
// Jump to waypoint N during an active WP mission.
// Payload: U8 wp_index (0-based, relative to mission start waypoint)
if (dataSize == 1) {
uint8_t wpIndex;
if (sbufReadU8Safe(&wpIndex, src) && navSetActiveWaypointIndex(wpIndex)) {
break;
}
}
return MSP_RESULT_ERROR;

default:
return MSP_RESULT_ERROR;
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tables:
- name: alignment
values: ["DEFAULT", "CW0", "CW90", "CW180", "CW270", "CW0FLIP", "CW90FLIP", "CW180FLIP", "CW270FLIP"]
- name: acc_hardware
values: ["NONE", "AUTO", "MPU6000", "MPU6500", "MPU9250", "BMI160", "ICM20689", "BMI088", "ICM42605", "BMI270","LSM6DXX", ICM45686, "FAKE"]
values: ["NONE", "AUTO", "MPU6000", "MPU6500", "MPU9250", "BMI160", "ICM20689", "BMI088", "ICM42605", "BMI270","LSM6DXX", "ICM45686", "FAKE"]
enum: accelerationSensor_e
- name: rangefinder_hardware
values: ["NONE", "SRF10", "VL53L0X", "MSP", "BENEWAKE", "VL53L1X", "US42", "TOF10120_I2C", "FAKE", "TERARANGER_EVO", "USD1_V0", "NRA"]
Expand Down Expand Up @@ -3303,6 +3303,10 @@ groups:
min: 1
max: 255
default_value: 1
- name: crsf_use_legacy_baro_packet
description: "CRSF telemetry: If `ON`, send altitude about start point in GPS telemetry packet. If `OFF`, GPS has ASL altitude, altitude about start point in separate packet. Default: 'OFF'"
default_value: OFF
type: bool

- name: PG_OSD_CONFIG
type: osdConfig_t
Expand Down
3 changes: 3 additions & 0 deletions src/main/msp/msp_protocol_v2_inav.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@
#define MSP2_INAV_SET_GVAR 0x2214

#define MSP2_INAV_FULL_LOCAL_POSE 0x2220

#define MSP2_INAV_SET_WP_INDEX 0x2221 //in message jump to waypoint N during active WP mission; payload: U8 wp_index (0-based, relative to mission start)
#define MSP2_INAV_SET_CRUISE_HEADING 0x2223 //in message set heading while in Cruise/Course Hold mode; payload: I32 heading_centidegrees (0-35999)
68 changes: 68 additions & 0 deletions src/main/navigation/navigation.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_SWITCH_TO_IDLE] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_RTH] = NAV_STATE_RTH_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_FINISHED] = NAV_STATE_WAYPOINT_FINISHED,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP] = NAV_STATE_WAYPOINT_PRE_ACTION, // MSP2_INAV_SET_WP_INDEX
}
},

Expand All @@ -806,6 +807,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING] = NAV_STATE_EMERGENCY_LANDING_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_COURSE_HOLD] = NAV_STATE_COURSE_HOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE] = NAV_STATE_CRUISE_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP] = NAV_STATE_WAYPOINT_PRE_ACTION, // MSP2_INAV_SET_WP_INDEX
}
},

Expand All @@ -830,6 +832,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING] = NAV_STATE_EMERGENCY_LANDING_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_COURSE_HOLD] = NAV_STATE_COURSE_HOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE] = NAV_STATE_CRUISE_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP] = NAV_STATE_WAYPOINT_PRE_ACTION, // MSP2_INAV_SET_WP_INDEX
}
},

Expand All @@ -851,6 +854,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING] = NAV_STATE_EMERGENCY_LANDING_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_COURSE_HOLD] = NAV_STATE_COURSE_HOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE] = NAV_STATE_CRUISE_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP] = NAV_STATE_WAYPOINT_PRE_ACTION, // MSP2_INAV_SET_WP_INDEX
}
},

Expand Down Expand Up @@ -909,6 +913,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING] = NAV_STATE_EMERGENCY_LANDING_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_COURSE_HOLD] = NAV_STATE_COURSE_HOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE] = NAV_STATE_CRUISE_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP] = NAV_STATE_WAYPOINT_PRE_ACTION, // MSP2_INAV_SET_WP_INDEX
}
},

Expand Down Expand Up @@ -3876,6 +3881,69 @@ int isGCSValid(void)
(posControl.navState == NAV_STATE_POSHOLD_3D_IN_PROGRESS));
}

/*
* navSetActiveWaypointIndex - MSP2_INAV_SET_WP_INDEX handler
*
* Jumps to a specific waypoint during an active WP mission without interrupting
* navigation mode. 'index' is 0-based and relative to the mission start
* (i.e. the first waypoint in the loaded mission is index 0, regardless of
* startWpIndex).
*
* Returns true on success, false when the preconditions are not met (not armed,
* not in WP mode, or index out of range).
*/
bool navSetActiveWaypointIndex(uint8_t index)
{
// Must be armed and actively executing a WP mission
if (!ARMING_FLAG(ARMED) || !FLIGHT_MODE(NAV_WP_MODE)) {
return false;
}

// Translate user-visible 0-based index to the internal absolute index
int8_t absoluteIndex = (int8_t)index + posControl.startWpIndex;
if (absoluteIndex < posControl.startWpIndex ||
absoluteIndex >= posControl.startWpIndex + posControl.waypointCount) {
return false;
}

posControl.activeWaypointIndex = absoluteIndex;
posControl.wpMissionRestart = false;

// Transition immediately to WAYPOINT_PRE_ACTION so the new WP is set up
// on this navigation tick. navProcessFSMEvents is safe to call here as
// everything runs in the same main-loop task context.
navProcessFSMEvents(NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP);
return true;
}

/*
* navSetCruiseHeading - MSP2_INAV_SET_CRUISE_HEADING handler
*
* Sets the target heading while Cruise or Course Hold mode is active.
* 'headingCd' is in centidegrees (0-35999), matching the internal
* posControl.cruise.course representation.
*
* Returns true on success, false when the preconditions are not met.
*/
bool navSetCruiseHeading(int32_t headingCd)
{
if (!ARMING_FLAG(ARMED)) {
return false;
}

// Only valid while Cruise or Course Hold is the active navigation mode
if (!FLIGHT_MODE(NAV_COURSE_HOLD_MODE)) {
return false;
}

// Clamp to valid centidegree range
headingCd = ((headingCd % 36000) + 36000) % 36000;

posControl.cruise.course = headingCd;
posControl.cruise.previousCourse = headingCd;
return true;
}

void setWaypoint(uint8_t wpNumber, const navWaypoint_t * wpData)
{
gpsLocation_t wpLLH;
Expand Down
2 changes: 2 additions & 0 deletions src/main/navigation/navigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@ int isGCSValid(void);
void getWaypoint(uint8_t wpNumber, navWaypoint_t * wpData);
void setWaypoint(uint8_t wpNumber, const navWaypoint_t * wpData);
void resetWaypointList(void);
bool navSetActiveWaypointIndex(uint8_t index); // MSP2_INAV_SET_WP_INDEX: jump to WP during active mission
bool navSetCruiseHeading(int32_t headingCd); // MSP2_INAV_SET_CRUISE_HEADING: set cruise/course-hold heading (centidegrees)
bool loadNonVolatileWaypointList(bool clearIfLoaded);
bool saveNonVolatileWaypointList(void);
#ifdef USE_MULTI_MISSION
Expand Down
1 change: 1 addition & 0 deletions src/main/navigation/navigation_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ typedef enum {
NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_HOLD_TIME = NAV_FSM_EVENT_STATE_SPECIFIC_1,
NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_RTH_LAND = NAV_FSM_EVENT_STATE_SPECIFIC_2,
NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_FINISHED = NAV_FSM_EVENT_STATE_SPECIFIC_3,
NAV_FSM_EVENT_SWITCH_TO_WAYPOINT_JUMP = NAV_FSM_EVENT_STATE_SPECIFIC_4, // jump to a different WP index mid-mission
NAV_FSM_EVENT_SWITCH_TO_NAV_STATE_RTH_INITIALIZE = NAV_FSM_EVENT_STATE_SPECIFIC_1,
NAV_FSM_EVENT_SWITCH_TO_NAV_STATE_RTH_TRACKBACK = NAV_FSM_EVENT_STATE_SPECIFIC_2,
NAV_FSM_EVENT_SWITCH_TO_RTH_HEAD_HOME = NAV_FSM_EVENT_STATE_SPECIFIC_3,
Expand Down
Loading
Loading