Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
settings.h File Reference

Persistent settings interface. More...

#include "std.h"
#include "pprzlink/pprzlink_device.h"
#include "pprzlink/pprzlink_transport.h"
+ Include dependency graph for settings.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define settings_StoreSettings(_v)   { settings_store_flag = _v; settings_store(); }
 
#define settings_ClearSettings(_v)   { settings_clear_flag = _v; settings_clear(); }
 

Functions

void settings_init (void)
 
int32_t settings_store (void)
 store settings marked as persistent to flash More...
 
int32_t settings_clear (void)
 clear all persistent settings from flash More...
 
void settings_parse_msg_SETTING (struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
 
void settings_parse_msg_GET_SETTING (struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
 
int32_t persistent_write (void *ptr, uint32_t size)
 
int32_t persistent_read (void *ptr, uint32_t size)
 
int32_t persistent_clear (void)
 

Variables

bool settings_store_flag
 flag for setting feedback. More...
 
bool settings_clear_flag
 

Detailed Description

Persistent settings interface.

Definition in file settings.h.

Macro Definition Documentation

◆ settings_ClearSettings

#define settings_ClearSettings (   _v)    { settings_clear_flag = _v; settings_clear(); }

Definition at line 45 of file settings.h.

◆ settings_StoreSettings

#define settings_StoreSettings (   _v)    { settings_store_flag = _v; settings_store(); }

Definition at line 44 of file settings.h.

Function Documentation

◆ persistent_clear()

int32_t persistent_clear ( void  )

Definition at line 74 of file settings_arch.c.

References flash_detect(), PERSISTENT_SETTINGS_FILE, and pflash_erase().

Referenced by settings_clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ persistent_read()

int32_t persistent_read ( void *  ptr,
uint32_t  size 
)

Definition at line 38 of file settings_arch.c.

References FlashInfo::addr, FCHK, flash_detect(), FSIZ, FlashInfo::page_size, PERSISTENT_SETTINGS_FILE, and pflash_checksum().

Referenced by settings_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ persistent_write()

int32_t persistent_write ( void *  ptr,
uint32_t  size 
)

Definition at line 33 of file settings_arch.c.

References flash_detect(), FSIZ, FlashInfo::page_size, PERSISTENT_SETTINGS_FILE, pflash_checksum(), and pflash_program_bytes().

Referenced by settings_store().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings_clear()

int32_t settings_clear ( void  )

clear all persistent settings from flash

Returns
0 on success

Definition at line 80 of file settings.c.

References persistent_clear(), and settings_clear_flag.

Referenced by autopilot_clear_settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings_init()

void settings_init ( void  )

Definition at line 46 of file settings.c.

References pers_settings, and persistent_read().

Referenced by cc2500_settings_init(), and main_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings_parse_msg_GET_SETTING()

void settings_parse_msg_GET_SETTING ( struct link_device *  dev,
struct transport_tx *  trans,
uint8_t buf 
)

Definition at line 118 of file settings.c.

References dev, msg, and val.

◆ settings_parse_msg_SETTING()

void settings_parse_msg_SETTING ( struct link_device *  dev,
struct transport_tx *  trans,
uint8_t buf 
)

Definition at line 95 of file settings.c.

References dev, and msg.

◆ settings_store()

int32_t settings_store ( void  )

store settings marked as persistent to flash

Returns
0 on success

Definition at line 60 of file settings.c.

References pers_settings, persistent_write(), and settings_store_flag.

Referenced by autopilot_store_settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ settings_clear_flag

bool settings_clear_flag
extern

Definition at line 43 of file settings.c.

Referenced by autopilot_clear_settings(), and settings_clear().

◆ settings_store_flag

bool settings_store_flag
extern

flag for setting feedback.

if TRUE, was stored sucessfully. Also settings still need a variable, pure function call not possible yet.

Definition at line 41 of file settings.c.

Referenced by autopilot_store_settings(), and settings_store().