mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 01:05:21 +03:00
add BB wp number
This commit is contained in:
parent
3740682352
commit
b4847bd362
3 changed files with 11 additions and 1 deletions
|
@ -436,6 +436,7 @@ static const blackboxSimpleFieldDefinition_t blackboxSlowFields[] = {
|
||||||
{"escTemperature", -1, SIGNED, PREDICT(PREVIOUS), ENCODING(SIGNED_VB)},
|
{"escTemperature", -1, SIGNED, PREDICT(PREVIOUS), ENCODING(SIGNED_VB)},
|
||||||
#endif
|
#endif
|
||||||
{"rxUpdateRate", -1, UNSIGNED, PREDICT(PREVIOUS), ENCODING(UNSIGNED_VB)},
|
{"rxUpdateRate", -1, UNSIGNED, PREDICT(PREVIOUS), ENCODING(UNSIGNED_VB)},
|
||||||
|
{"activeWpNumber", -1, UNSIGNED, PREDICT(0), ENCODING(UNSIGNED_VB)},
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum BlackboxState {
|
typedef enum BlackboxState {
|
||||||
|
@ -554,6 +555,7 @@ typedef struct blackboxSlowState_s {
|
||||||
int8_t escTemperature;
|
int8_t escTemperature;
|
||||||
#endif
|
#endif
|
||||||
uint16_t rxUpdateRate;
|
uint16_t rxUpdateRate;
|
||||||
|
uint8_t activeWpNumber;
|
||||||
} __attribute__((__packed__)) blackboxSlowState_t; // We pack this struct so that padding doesn't interfere with memcmp()
|
} __attribute__((__packed__)) blackboxSlowState_t; // We pack this struct so that padding doesn't interfere with memcmp()
|
||||||
|
|
||||||
//From rc_controls.c
|
//From rc_controls.c
|
||||||
|
@ -1291,6 +1293,7 @@ static void writeSlowFrame(void)
|
||||||
blackboxWriteSignedVB(slowHistory.escTemperature);
|
blackboxWriteSignedVB(slowHistory.escTemperature);
|
||||||
#endif
|
#endif
|
||||||
blackboxWriteUnsignedVB(slowHistory.rxUpdateRate);
|
blackboxWriteUnsignedVB(slowHistory.rxUpdateRate);
|
||||||
|
blackboxWriteUnsignedVB(slowHistory.activeWpNumber);
|
||||||
|
|
||||||
blackboxSlowFrameIterationTimer = 0;
|
blackboxSlowFrameIterationTimer = 0;
|
||||||
}
|
}
|
||||||
|
@ -1368,6 +1371,7 @@ static void loadSlowState(blackboxSlowState_t *slow)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
slow->rxUpdateRate = getRcUpdateFrequency();
|
slow->rxUpdateRate = getRcUpdateFrequency();
|
||||||
|
slow->activeWpNumber = getActiveWpNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4583,3 +4583,8 @@ int8_t navCheckActiveAngleHoldAxis(void)
|
||||||
|
|
||||||
return activeAxis;
|
return activeAxis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t getActiveWpNumber(void)
|
||||||
|
{
|
||||||
|
return NAV_Status.activeWpNumber;
|
||||||
|
}
|
||||||
|
|
|
@ -595,7 +595,7 @@ bool isFixedWingAutoThrottleManuallyIncreased(void);
|
||||||
bool navigationIsFlyingAutonomousMode(void);
|
bool navigationIsFlyingAutonomousMode(void);
|
||||||
bool navigationIsExecutingAnEmergencyLanding(void);
|
bool navigationIsExecutingAnEmergencyLanding(void);
|
||||||
bool navigationIsControllingAltitude(void);
|
bool navigationIsControllingAltitude(void);
|
||||||
/* Returns true iff navConfig()->general.flags.rth_allow_landing is NAV_RTH_ALLOW_LANDING_ALWAYS
|
/* Returns true if navConfig()->general.flags.rth_allow_landing is NAV_RTH_ALLOW_LANDING_ALWAYS
|
||||||
* or if it's NAV_RTH_ALLOW_LANDING_FAILSAFE and failsafe mode is active.
|
* or if it's NAV_RTH_ALLOW_LANDING_FAILSAFE and failsafe mode is active.
|
||||||
*/
|
*/
|
||||||
bool navigationRTHAllowsLanding(void);
|
bool navigationRTHAllowsLanding(void);
|
||||||
|
@ -628,6 +628,7 @@ void checkManualEmergencyLandingControl(bool forcedActivation);
|
||||||
float updateBaroAltitudeRate(float newBaroAltRate, bool updateValue);
|
float updateBaroAltitudeRate(float newBaroAltRate, bool updateValue);
|
||||||
|
|
||||||
int8_t navCheckActiveAngleHoldAxis(void);
|
int8_t navCheckActiveAngleHoldAxis(void);
|
||||||
|
uint8_t getActiveWpNumber(void);
|
||||||
|
|
||||||
/* Returns the heading recorded when home position was acquired.
|
/* Returns the heading recorded when home position was acquired.
|
||||||
* Note that the navigation system uses deg*100 as unit and angles
|
* Note that the navigation system uses deg*100 as unit and angles
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue