Add autostart

Adds autostart option.
Only works on first power up, so if the settings wrong you can still easily change it 😄
Fixes #43
This commit is contained in:
Ben V. Brown
2017-08-06 22:21:57 +10:00
parent f1aa331168
commit 48040acbcc
7 changed files with 57 additions and 26 deletions

View File

@@ -36,9 +36,9 @@ typedef enum {
} operatingModeEnum;
//#define PIDTUNING
#ifdef PIDTUNING
#define SETTINGSOPTIONSCOUNT (11+3) /*Number of settings in the settings menu*/
#define SETTINGSOPTIONSCOUNT (12+3) /*Number of settings in the settings menu*/
#else
#define SETTINGSOPTIONSCOUNT (11) /*Number of settings in the settings menu*/
#define SETTINGSOPTIONSCOUNT (12) /*Number of settings in the settings menu*/
#endif
typedef enum {
UVCO = 0,
@@ -53,13 +53,15 @@ typedef enum {
BOOSTMODE,
BOOSTTEMP,
POWERDISPLAY,
AUTOSTART,
#ifdef PIDTUNING
PIDP,
PIDI,
PIDD,
PIDP,
PIDI,
PIDD,
#endif
} settingsPageEnum;
void ProcessUI();
void DrawUI();
extern operatingModeEnum operatingMode;
#endif /* MODES_H_ */

View File

@@ -12,7 +12,7 @@
#include <stdint.h>
#include "stm32f10x_flash.h"
#include "Oled.h"
#define SETTINGSVERSION 14 /*Change this if you change the struct below to prevent people getting out of sync*/
#define SETTINGSVERSION 15 /*Change this if you change the struct below to prevent people getting out of sync*/
//Display Speeds
#define DISPLAYMODE_FAST (0x00)
#define DISPLAYMODE_MEDIUM (0x01)
@@ -34,7 +34,8 @@ typedef struct {
uint8_t powerDisplay:1; //Toggle to swap the arrows with a power readout instead
uint8_t displayTempInF:1; //If we need to convert the C reading to F
uint8_t OrientationMode:2; //If true we want to invert the display for lefties
uint8_t sensitivity:6; //Sensitivity of accelerometer (5 bits)
uint8_t sensitivity:5; //Sensitivity of accelerometer (5 bits)
uint8_t autoStart:1; //Should the unit automatically jump straight into soldering mode when power is applied
uint8_t ShutdownTime:6; //Time until unit shuts down if left alone
uint8_t displayUpdateSpeed:2; //How fast the display updates / temp showing mode
uint8_t temperatureRounding:2; //Rounding mode for the temperature

View File

@@ -12,7 +12,7 @@
#ifndef STRINGS_H_
#define STRINGS_H_
extern const char* SettingsLongNames[12];
extern const char* SettingsShortNames[12];
extern const char* SettingsLongNames[13];
extern const char* SettingsShortNames[13];
#endif /* STRINGS_H_ */