29 #include "generated/settings.h"
30 #include "generated/airframe.h"
31 #include "pprzlink/messages.h"
32 #include "pprzlink/dl_protocol.h"
48 #if USE_PERSISTENT_SETTINGS
53 persistent_settings_load();
62 #if USE_PERSISTENT_SETTINGS
65 persistent_settings_store();
82 #if USE_PERSISTENT_SETTINGS
98 if (DL_SETTING_ac_id(buf) != AC_ID) {
return; }
99 uint8_t sender_id = pprzlink_get_msg_sender_id(buf);
100 uint8_t i = DL_SETTING_index(buf);
101 float var = DL_SETTING_value(buf);
104 struct pprzlink_msg
msg;
107 msg.sender_id = AC_ID;
108 msg.receiver_id = sender_id;
109 msg.component_id = 0;
110 pprzlink_msg_send_DL_VALUE(&
msg, &i, &var);
121 if (DL_GET_SETTING_ac_id(buf) != AC_ID) {
return; }
122 uint8_t sender_id = pprzlink_get_msg_sender_id(buf);
123 uint8_t i = DL_GET_SETTING_index(buf);
124 float val = settings_get_value(i);
126 struct pprzlink_msg
msg;
129 msg.sender_id = AC_ID;
130 msg.receiver_id = sender_id;
131 msg.component_id = 0;
132 pprzlink_msg_send_DL_VALUE(&
msg, &i, &
val);
int32_t persistent_write(void *ptr, uint32_t size)
int32_t persistent_read(void *ptr, uint32_t size)
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
int32_t persistent_clear(void)
void settings_parse_msg_GET_SETTING(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
int32_t settings_clear(void)
clear all persistent settings from flash
void settings_parse_msg_SETTING(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
bool settings_store_flag
flag for setting feedback.
struct PersistentSettings pers_settings
int32_t settings_store(void)
store settings marked as persistent to flash
Persistent settings interface.
static const struct usb_device_descriptor dev
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.