mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-25 23:46:04 +08:00
[settings] firmware specific StoreSettings handlers
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE settings SYSTEM "settings.dtd">
|
||||
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_settings NAME="Persistence">
|
||||
<dl_setting var="settings_store_flag" min="1" step="1" max="1" shortname="store" handler="StoreSettings" module="autopilot" values="Store"/>
|
||||
</dl_settings>
|
||||
</dl_settings>
|
||||
</settings>
|
||||
@@ -3,7 +3,7 @@
|
||||
<settings>
|
||||
<dl_settings>
|
||||
<dl_settings NAME="Superbit">
|
||||
<dl_setting var="settings_store_flag" min="1" step="1" max="1" shortname="store" handler="StoreSettings" module="subsystems/settings" values="Store"/>
|
||||
<dl_setting var="settings_store_flag" min="1" step="1" max="1" shortname="store" handler="StoreSettings" module="autopilot" values="Store"/>
|
||||
<dl_setting var="superbitrf.bind_mfg_id32" type="uint32" min="0" step="1" max="4294967295" shortname ="mfg_id" persistent="true" module="subsystems/datalink/superbitrf" handler="set_mfg_id"/>
|
||||
<dl_setting var="superbitrf.num_channels" type="uint8" min="0" step="1" max="14" shortname ="#chan" persistent="true" module="subsystems/datalink/superbitrf"/>
|
||||
<dl_setting var="superbitrf.protocol" type="uint8" min="0" step="1" max="32" shortname ="prot" persistent="true" module="subsystems/datalink/superbitrf" handler="set_protocol"/>
|
||||
|
||||
@@ -145,4 +145,14 @@ extern bool_t power_switch;
|
||||
#define NAVIGATION_FREQUENCY 4
|
||||
#endif
|
||||
|
||||
#include "subsystems/settings.h"
|
||||
|
||||
static inline void autopilot_StoreSettings(float store)
|
||||
{
|
||||
if (kill_throttle && store) {
|
||||
settings_store_flag = store;
|
||||
settings_store();
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* AUTOPILOT_H */
|
||||
|
||||
@@ -30,11 +30,8 @@
|
||||
#define AUTOPILOT_H
|
||||
|
||||
#include "std.h"
|
||||
|
||||
#include "led.h"
|
||||
|
||||
#include "generated/airframe.h"
|
||||
#include "subsystems/ins.h"
|
||||
#include "state.h"
|
||||
|
||||
#define AP_MODE_KILL 0
|
||||
#define AP_MODE_FAILSAFE 1
|
||||
@@ -160,4 +157,14 @@ static inline void DetectGroundEvent(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#include "subsystems/settings.h"
|
||||
|
||||
static inline void autopilot_StoreSettings(float store)
|
||||
{
|
||||
if (kill_throttle && store) {
|
||||
settings_store_flag = store;
|
||||
settings_store();
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* AUTOPILOT_H */
|
||||
|
||||
Reference in New Issue
Block a user