Store the configuration on the SD card

This commit is contained in:
2015-08-13 14:10:09 +00:00
parent 53a8072424
commit d0f9f46f9c
16 changed files with 271 additions and 26 deletions

36
config.h Normal file
View File

@@ -0,0 +1,36 @@
/* config.h */
#ifndef __CONFIG_H
#define __CONFIG_H
#include "types.h"
#define CONFIG_VERSION 0
#define CONFIG_MAGIC 0xc07f18
struct config {
struct {
pid_params rollpitch;
pid_params yaw;
} pid;
struct {
struct {
stick_timing x, y, z, throttle;
} timing;
struct {
stick_sensitivity x, y, z;
} sensitivity;
} stick;
struct {
unsigned int gyro_sensitivity;
unsigned int accel_sensitivity;
} mpu6050;
/* Magnetometer calibration */
};
extern struct config config;
extern bool config_valid;
void config_init(char *buffer);
#endif /* __CONFIG_H */