diff --git a/workspace/ts100/inc/Modes.h b/workspace/ts100/inc/Modes.h index c36aaa76..26542b48 100644 --- a/workspace/ts100/inc/Modes.h +++ b/workspace/ts100/inc/Modes.h @@ -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_ */ diff --git a/workspace/ts100/inc/Settings.h b/workspace/ts100/inc/Settings.h index 16dc47b6..15358008 100644 --- a/workspace/ts100/inc/Settings.h +++ b/workspace/ts100/inc/Settings.h @@ -12,7 +12,7 @@ #include #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 diff --git a/workspace/ts100/inc/Strings.h b/workspace/ts100/inc/Strings.h index 5a704f12..a8a45408 100644 --- a/workspace/ts100/inc/Strings.h +++ b/workspace/ts100/inc/Strings.h @@ -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_ */ diff --git a/workspace/ts100/src/Main.c b/workspace/ts100/src/Main.c index c257a76b..a1867e81 100644 --- a/workspace/ts100/src/Main.c +++ b/workspace/ts100/src/Main.c @@ -14,6 +14,8 @@ void setup(); int main(void) { setup();/*Setup the system*/ + if(systemSettings.autoStart) + operatingMode = SOLDERING; while (1) { Clear_Watchdog(); //reset the Watch dog timer ProcessUI(); diff --git a/workspace/ts100/src/Modes.c b/workspace/ts100/src/Modes.c index e1d5d4a5..a92a82c9 100644 --- a/workspace/ts100/src/Modes.c +++ b/workspace/ts100/src/Modes.c @@ -215,6 +215,9 @@ void ProcessUI() { case POWERDISPLAY: systemSettings.powerDisplay = !systemSettings.powerDisplay; break; + case AUTOSTART: + systemSettings.autoStart = !systemSettings.autoStart; + break; #ifdef PIDTUNING case PIDP: pidSettings.kp++; @@ -650,6 +653,17 @@ void DrawUI() { break; } break; + case AUTOSTART: + OLED_DrawString(SettingsShortNames[AUTOSTART], 7); + switch (systemSettings.autoStart) { + case 1: + OLED_DrawChar('T', 7); + break; + case 0: + OLED_DrawChar('F', 7); + break; + } + break; #ifdef PIDTUNING case PIDP: OLED_DrawString("PIDP ", 5); diff --git a/workspace/ts100/src/Settings.c b/workspace/ts100/src/Settings.c index 71bd81d6..7bddc8d9 100644 --- a/workspace/ts100/src/Settings.c +++ b/workspace/ts100/src/Settings.c @@ -65,7 +65,7 @@ void resetSettings() { systemSettings.version = SETTINGSVERSION;//Store the version number to allow for easier upgrades systemSettings.displayTempInF = 0; //default to C systemSettings.OrientationMode = 2; //Default to automatic - systemSettings.sensitivity = 6; //Default high sensitivity + systemSettings.sensitivity = 7; //Default high sensitivity systemSettings.tempCalibration = 239; //Default to their calibration value systemSettings.voltageDiv = 144; //Default divider from schematic systemSettings.ShutdownTime = 30;//How many minutes until the unit turns itself off @@ -74,6 +74,7 @@ void resetSettings() { systemSettings.boostModeEnabled = 0;//Default to safe, with no boost mode systemSettings.BoostTemp = 4000; //default to 400C systemSettings.powerDisplay = 0; //default to power display being off + systemSettings.autoStart=0; //Auto start off for safety } void showBootLogoIfavailable() { diff --git a/workspace/ts100/src/Strings.c b/workspace/ts100/src/Strings.c index 8d0e5b69..012bf735 100644 --- a/workspace/ts100/src/Strings.c +++ b/workspace/ts100/src/Strings.c @@ -5,7 +5,9 @@ * Author: Ben V. Brown */ #include "Strings.h" -const char* SettingsLongNames[12] = +#define LANG_EN +#ifdef LANG_EN +const char* SettingsLongNames[13] = { /*These are all the help text for all the settings.*/ /*All must start with 6 spaces so they come on screen nicely.*/ @@ -18,20 +20,29 @@ const char* SettingsLongNames[12] = " Display Orientation ", " Enable front key boost 450C mode when soldering", " Temperature when in boost mode", - " Changes the arrows to a power display when soldering" }; + " Changes the arrows to a power display when soldering", + " Automatically starts the iron into soldering on power up." }; -const char* SettingsShortNames[12]= +#endif +#ifdef LANG_ES +const char* SettingsLongNames[13] = { - "PWRSC ", - "STMP ", - "SLTME ", - "SHTME ", - "MSENSE ", - "TMPUNT ", - "TMPRND ", - "TMPSPD ", - "DSPROT ", - "BOOST ", - "BTMP ", - "PWRDSP ", -}; + /*These are all the help text for all the settings.*/ + /*All must start with 6 spaces so they come on screen nicely.*/ + " Fuente de energia. Ajusta el limite inferior de voltaje. ", + " Temperatura en reposo. ", " Tiempo hasta activar reposo. ", + " Tiempo hasta apagado. ", + " Sensibilidad del movimiento. <0.Apagado 1.El menos sensible 9.El mas sensible>", + " Unidad de temperatura.", " Cantidad de redondeo de la temperatura.", + " Tasa de actualización de la temperatura.", + " Orientacion de la pantalla ", + " Activar el boton en modo soldadura.", + " Temperatura en modo .", + " Cambiar las flechas en pantalla por indicador de potencia en modo soldadura.", + " Automatically starts the iron into soldering on power up."}; + +#endif + +const char* SettingsShortNames[13] = { "PWRSC ", "STMP ", "SLTME ", "SHTME ", + "MSENSE ", "TMPUNT ", "TMPRND ", "TMPSPD ", "DSPROT ", "BOOST ", + "BTMP ", "PWRDSP ", "ASTART " };