Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
settings.c
Go to the documentation of this file.
1 #include "subsystems/settings.h"
2 
3 
4 struct PersistentSettings pers_settings;
6 
7 
8 void settings_init(void) {
9 #if USE_PERSISTENT_SETTINGS
10  if (persistent_read((uint32_t)&pers_settings, sizeof(struct PersistentSettings)))
11  return; // return -1 ?
12  persistent_settings_load();
13 #endif
14 }
15 
16 
17 void settings_store(void) {
18 #if USE_PERSISTENT_SETTINGS
19  persistent_settings_store();
20  persistent_write((uint32_t)&pers_settings, sizeof(struct PersistentSettings));
21 #endif
22 }
bool_t settings_store_now
Definition: settings.c:5
void settings_init(void)
Definition: settings.c:8
int32_t persistent_read(uint32_t ptr, uint32_t size)
struct PersistentSettings pers_settings
Definition: settings.c:4
void settings_store(void)
Definition: settings.c:17
unsigned long uint32_t
Definition: types.h:18
int32_t persistent_write(uint32_t ptr, uint32_t size)