diff --git a/workspace/ts100/inc/Interrupt.h b/workspace/ts100/inc/Interrupt.h index e66cdb0c..70dee58d 100644 --- a/workspace/ts100/inc/Interrupt.h +++ b/workspace/ts100/inc/Interrupt.h @@ -11,7 +11,6 @@ void delayMs(uint32_t ticks); extern volatile uint32_t lastMovement; extern volatile uint8_t rawKeys; - inline uint32_t millis() { return system_Ticks; } diff --git a/workspace/ts100/inc/Settings.h b/workspace/ts100/inc/Settings.h index 15358008..fa178d45 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 15 /*Change this if you change the struct below to prevent people getting out of sync*/ +#define SETTINGSVERSION 16 /*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) diff --git a/workspace/ts100/inc/Strings.h b/workspace/ts100/inc/Strings.h index a8a45408..9a66dc17 100644 --- a/workspace/ts100/inc/Strings.h +++ b/workspace/ts100/inc/Strings.h @@ -14,5 +14,17 @@ extern const char* SettingsLongNames[13]; extern const char* SettingsShortNames[13]; - +extern const char* TempCalStatus[3]; //All fixed 8 chars +extern const char* UVLOWarningString; //Fixed width 8 chars +extern const char* CoolingPromptString; //Fixed width 5 chars +extern const char SettingTrueChar; +extern const char SettingFalseChar; +extern const char SettingFastChar; +extern const char SettingMediumChar; +extern const char SettingSlowChar; +extern const char SettingRightChar; +extern const char SettingLeftChar; +extern const char SettingAutoChar; +extern const char SettingTempCChar; +extern const char SettingTempFChar; #endif /* STRINGS_H_ */ diff --git a/workspace/ts100/src/Interrupt.c b/workspace/ts100/src/Interrupt.c index f3b9f27d..e8b1dfd6 100644 --- a/workspace/ts100/src/Interrupt.c +++ b/workspace/ts100/src/Interrupt.c @@ -24,7 +24,7 @@ uint8_t getButtons() { //We want to check the times for the lat buttons & also the rawKeys state //If a key has just gone down, rawKeys & KEY ==1 uint8_t out = 0; - if (millis() - AkeyChange > 100) { + if (millis() - AkeyChange > 50) { if (LongKeys & BUT_A) { if (rawKeys & BUT_A) { if (millis() - AkeyChange > 800) { @@ -61,7 +61,7 @@ uint8_t getButtons() { } } } - if (millis() - BkeyChange > 100) { + if (millis() - BkeyChange > 50) { if (LongKeys & BUT_B) { if (rawKeys & BUT_B) { if (millis() - BkeyChange > 800) { diff --git a/workspace/ts100/src/Modes.c b/workspace/ts100/src/Modes.c index a92a82c9..6e945f87 100644 --- a/workspace/ts100/src/Modes.c +++ b/workspace/ts100/src/Modes.c @@ -33,6 +33,9 @@ void ProcessUI() { } break; case SOLDERING: + if ((millis() - getLastButtonPress()) < 250) + Buttons = 0; + //^ This is to make the button more delayed in timing for people to find A+B easier //We need to check the buttons if we need to jump out if ((Buttons == BUT_A && !systemSettings.boostModeEnabled) || Buttons == BUT_B) { @@ -151,7 +154,7 @@ void ProcessUI() { operatingMode = STARTUP; //reset back to the startup saveSettings(); //Save the settings } else { - ++settingsPage; //move to the next option + ++settingsPage; //move to the next option } } else if (Buttons & BUT_A) { //B changes the value selected @@ -167,7 +170,7 @@ void ProcessUI() { systemSettings.SleepTemp = 500; //cant sleep higher than 300 or less than 50 break; case SLEEP_TIME: - ++systemSettings.SleepTime; //Go up 1 minute at a time + ++systemSettings.SleepTime; //Go up 1 minute at a time if (systemSettings.SleepTime > 30) systemSettings.SleepTime = 1;//can't set time over 30 mins //Remember that ^ is the time of no movement @@ -473,9 +476,9 @@ void DrawUI() { OLED_DrawChar(' ', 5); } if (systemSettings.displayTempInF) { - OLED_DrawChar('F', 3); + OLED_DrawChar(SettingTempFChar, 3); } else { - OLED_DrawChar('C', 3); + OLED_DrawChar(SettingTempCChar, 3); } //Optionally draw the arrows, or draw the power instead if (systemSettings.powerDisplay) { @@ -565,23 +568,24 @@ void DrawUI() { OLED_DrawTwoNumber(systemSettings.ShutdownTime, 6); break; case TEMPDISPLAY:/*Are we showing in C or F ?*/ + OLED_DrawString(SettingsShortNames[TEMPDISPLAY], 7); if (systemSettings.displayTempInF) - OLED_DrawString("TMPUNT F", 8); + OLED_DrawChar(SettingTempFChar, 7); else - OLED_DrawString("TMPUNT C", 8); + OLED_DrawChar(SettingTempCChar, 7); break; case SCREENROTATION: OLED_DrawString(SettingsShortNames[SCREENROTATION], 7); switch (systemSettings.OrientationMode) { case 0: - OLED_DrawChar('R', 7); + OLED_DrawChar(SettingRightChar, 7); break; case 1: - OLED_DrawChar('L', 7); + OLED_DrawChar(SettingLeftChar, 7); break; case 2: - OLED_DrawChar('A', 7); + OLED_DrawChar(SettingAutoChar, 7); break; } break; @@ -614,13 +618,13 @@ void DrawUI() { OLED_DrawString(SettingsShortNames[DISPUPDATERATE], 7); switch (systemSettings.displayUpdateSpeed) { case DISPLAYMODE_FAST: - OLED_DrawChar('F', 7); + OLED_DrawChar(SettingFastChar, 7); break; case DISPLAYMODE_SLOW: - OLED_DrawChar('S', 7); + OLED_DrawChar(SettingSlowChar, 7); break; case DISPLAYMODE_MEDIUM: - OLED_DrawChar('M', 7); + OLED_DrawChar(SettingMediumChar, 7); break; } @@ -631,10 +635,10 @@ void DrawUI() { switch (systemSettings.boostModeEnabled) { case 1: - OLED_DrawChar('T', 7); + OLED_DrawChar(SettingTrueChar, 7); break; case 0: - OLED_DrawChar('F', 7); + OLED_DrawChar(SettingFalseChar, 7); break; } break; @@ -646,10 +650,10 @@ void DrawUI() { OLED_DrawString(SettingsShortNames[POWERDISPLAY], 7); switch (systemSettings.powerDisplay) { case 1: - OLED_DrawChar('T', 7); + OLED_DrawChar(SettingTrueChar, 7); break; case 0: - OLED_DrawChar('F', 7); + OLED_DrawChar(SettingFalseChar, 7); break; } break; @@ -657,10 +661,10 @@ void DrawUI() { OLED_DrawString(SettingsShortNames[AUTOSTART], 7); switch (systemSettings.autoStart) { case 1: - OLED_DrawChar('T', 7); + OLED_DrawChar(SettingTrueChar, 7); break; case 0: - OLED_DrawChar('F', 7); + OLED_DrawChar(SettingFalseChar, 7); break; } break; @@ -702,12 +706,12 @@ void DrawUI() { break; case COOLING: //We are warning the user the tip is cooling - OLED_DrawString("COOL ", 5); + OLED_DrawString(CoolingPromptString, 5); temp = readIronTemp(0, 1, 0xFFFF); //force temp re-reading drawTemp(temp, 5, systemSettings.temperatureRounding); break; case UVLOWARN: - OLED_DrawString("LOW VOLT", 8); + OLED_DrawString(UVLOWarningString, 8); break; case THERMOMETER: temp = readIronTemp(0, 1, 0xFFFF); //Force a reading as heater is off @@ -733,14 +737,7 @@ void DrawUI() { } break; case TEMPCAL: { - - if (StatusFlags == 0) { - OLED_DrawString("CAL TEMP", 8); - } else if (StatusFlags == 1) { - OLED_DrawString("CAL OK ", 8); - } else if (StatusFlags == 2) { - OLED_DrawString("CAL FAIL", 8); - } + OLED_DrawString(TempCalStatus[StatusFlags], 8); } break; diff --git a/workspace/ts100/src/Strings.c b/workspace/ts100/src/Strings.c index 012bf735..282f5b76 100644 --- a/workspace/ts100/src/Strings.c +++ b/workspace/ts100/src/Strings.c @@ -23,6 +23,20 @@ const char* SettingsLongNames[13] = " Changes the arrows to a power display when soldering", " Automatically starts the iron into soldering on power up." }; +const char* TempCalStatus[3] = { "CAL TEMP", "CAL OK ", "CAL FAIL" }; //All fixed 8 chars +const char* UVLOWarningString = "LOW VOLT"; //Fixed width 8 chars +const char* CoolingPromptString = "COOL "; //Fixed width 5 chars +const char SettingTrueChar = 'T'; +const char SettingFalseChar = 'F'; +const char SettingFastChar = 'F'; +const char SettingMediumChar = 'F'; +const char SettingSlowChar = 'F'; +const char SettingRightChar = 'R'; +const char SettingLeftChar = 'L'; +const char SettingAutoChar = 'A'; +const char SettingTempCChar = 'C'; +const char SettingTempFChar = 'F'; + #endif #ifdef LANG_ES const char* SettingsLongNames[13] = @@ -39,8 +53,21 @@ const char* SettingsLongNames[13] = " 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."}; + " Iniciar directamente modo soldadura en el encendido."}; +const char* TempCalStatus[3] = {"CAL TEMP", "CAL OK ", "CAL FAIL"}; //All fixed 8 chars +const char* UVLOWarningString = "LOW VOLT";//Fixed width 8 chars +const char* CoolingPromptString = "COOL ";//Fixed width 5 chars +const char SettingTrueChar = 'T'; +const char SettingFalseChar = 'F'; +const char SettingFastChar = 'F'; +const char SettingMediumChar = 'F'; +const char SettingSlowChar = 'F'; +const char SettingRightChar = 'R'; +const char SettingLeftChar = 'L'; +const char SettingAutoChar = 'A'; +const char SettingTempCChar = 'C'; +const char SettingTempFChar = 'F'; #endif const char* SettingsShortNames[13] = { "PWRSC ", "STMP ", "SLTME ", "SHTME ",