Backend work for supporting adjusting movement sensitivity

This commit is contained in:
Ben V. Brown
2017-05-15 23:00:42 +10:00
parent fceb81287e
commit 9b51750a1d
7 changed files with 37 additions and 31 deletions

View File

@@ -15,7 +15,7 @@
#define __MMA8652FC__H
void StartUp_Accelerometer(void);//This is the only function we expose
void StartUp_Accelerometer(uint8_t sensitivity);//This is the only function we expose
//--------------MMA8652 Device ID----------------------------------------------//

View File

@@ -11,20 +11,22 @@
#define SETTINGS_H_
#include <stdint.h>
#include "stm32f10x_flash.h"
#define SETTINGSVERSION 0x02 /*Change this if you change the struct below to prevent people getting out of sync*/
#define SETTINGSVERSION 0x03 /*Change this if you change the struct below to prevent people getting out of sync*/
#define SETTINGSOPTIONSCOUNT 5 /*Number of settings in the settings menu*/
/*
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
*/
struct {
uint32_t SolderingTemp; //current setpoint for the iron
uint32_t SleepTemp; //temp to drop to in sleep
uint8_t version; //Used to track if a reset is needed on firmware upgrade
uint8_t SleepTime; //minutes timeout to sleep
uint8_t cutoutVoltage; //The voltage we cutout at for undervoltage
uint8_t movementEnabled; //If movement is enabled
uint8_t displayTempInF; //If we need to convert the C reading to F
uint8_t flipDisplay; //If true we want to invert the display for lefties
uint32_t SolderingTemp; //current setpoint for the iron
uint32_t SleepTemp; //temp to drop to in sleep
uint8_t version; //Used to track if a reset is needed on firmware upgrade
uint8_t SleepTime; //minutes timeout to sleep
uint8_t cutoutVoltage:1; //The voltage we cutout at for undervoltage
uint8_t movementEnabled:1; //If movement is enabled
uint8_t displayTempInF:1; //If we need to convert the C reading to F
uint8_t flipDisplay:1; //If true we want to invert the display for lefties
uint8_t sensitivity:7; //Sensitivity of accelerometer
uint16_t tempCalibration; // Temperature calibration value
} systemSettings;
void saveSettings();