mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 17:25:18 +03:00
Fix MSP
This commit is contained in:
parent
7322fbedc8
commit
0598080dc7
2 changed files with 11 additions and 11 deletions
|
@ -1580,7 +1580,7 @@ static void mspFcWaypointOutCommand(sbuf_t *dst, sbuf_t *src)
|
|||
{
|
||||
const uint8_t msp_wp_no = sbufReadU8(src); // get the wp number
|
||||
navWaypoint_t msp_wp;
|
||||
getWaypoint(msp_wp_no + wpMissionStartIndex, &msp_wp);
|
||||
getWaypoint(msp_wp_no, &msp_wp);
|
||||
sbufWriteU8(dst, msp_wp_no); // wp_no
|
||||
sbufWriteU8(dst, msp_wp.action); // action (WAYPOINT)
|
||||
sbufWriteU32(dst, msp_wp.lat); // lat
|
||||
|
|
|
@ -3072,8 +3072,8 @@ void getWaypoint(uint8_t wpNumber, navWaypoint_t * wpData)
|
|||
}
|
||||
// WP #1 - #60 - common waypoints - pre-programmed mission
|
||||
else if ((wpNumber >= 1) && (wpNumber <= NAV_MAX_WAYPOINTS)) {
|
||||
if (wpNumber <= posControl.waypointCount + wpMissionStartIndex) {
|
||||
*wpData = posControl.waypointList[wpNumber - 1];
|
||||
if (wpNumber <= posControl.waypointCount) {
|
||||
*wpData = posControl.waypointList[wpNumber + wpMissionStartIndex - 1];
|
||||
if(wpData->action == NAV_WP_ACTION_JUMP) {
|
||||
wpData->p1 += 1; // make WP # (vice index)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue