mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Force settings reset for 2.04
Also updates FI to #267 but wont be built in releases until string lengths fit.
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
#define SETTINGS_H_
|
#define SETTINGS_H_
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "stm32f1xx_hal.h"
|
#include "stm32f1xx_hal.h"
|
||||||
#define SETTINGSVERSION 0x12 /*Change this if you change the struct below to prevent people getting out of sync*/
|
#define SETTINGSVERSION 0x13 /*Change this if you change the struct below to prevent people getting out of sync*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
|
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
|
||||||
|
|||||||
@@ -396,26 +396,26 @@ const char* SettingsDescriptions[17] = {
|
|||||||
// These are all the help text for all the settings.
|
// These are all the help text for all the settings.
|
||||||
// No requirements on spacing or length.
|
// No requirements on spacing or length.
|
||||||
/* Power source (DC or batt) */ "Käytettävä virtalähde. Asettaa katkaisujänniteen. <DC 10V, 3S=9.9V, 4S=13.2V, 5S=16.5V, 6S=19.8V>",
|
/* Power source (DC or batt) */ "Käytettävä virtalähde. Asettaa katkaisujänniteen. <DC 10V, 3S=9.9V, 4S=13.2V, 5S=16.5V, 6S=19.8V>",
|
||||||
/* Sleep temperature */ "Lepolämpötila <C>",
|
/* Sleep temperature */ "Lepotilan lämpötila <C>", //"Lepolämpötila <C>",
|
||||||
/* Sleep timeout */ "Lepoviive <minuuttia/sekuntia>",
|
/* Sleep timeout */ "Lepotilan viive <minuuttia/sekuntia>",//"Lepoviive <minuuttia/sekuntia>",
|
||||||
/* Shutdown timeout */ "Sammutuksen aikaviive <minuuttia>",
|
/* Shutdown timeout */ "Sammutuksen aikaviive <minuuttia>",
|
||||||
/* Motion sensitivity level */ "Liikeherkkyys <0=pois, 1=epäherkin, 9=herkin>",
|
/* Motion sensitivity level */ "Liikkeentunnistuksen herkkyys <0=pois, 1=epäherkin, 9=herkin>", //"Liikeherkkyys <0=pois, 1=epäherkin, 9=herkin>",
|
||||||
/* Temperature in F and C */ "Lämpötilan yksikkö <C=celsius, F=fahrenheit>",
|
/* Temperature in F and C */ "Lämpötilan yksikkö <C=celsius, F=fahrenheit>",
|
||||||
/* Advanced idle display mode enabled */ "Näyttää tarkemmat tiedot leponäytössä",
|
/* Advanced idle display mode enabled */ "Näytä yksityiskohtaiset tiedot lepotilassa", //"Näyttää tarkemmat tiedot leponäytössä",
|
||||||
/* Display rotation mode */ "Näytön suunta <A=automaattinen O=oikeakätinen V=vasenkätinen>",
|
/* Display rotation mode */ "Näytön kierto <A=automaattinen O=oikeakätinen V=vasenkätinen>", //"Näytön suunta <A=automaattinen O=oikeakätinen V=vasenkätinen>",
|
||||||
/* Boost enabled */ "Etupainikeella siirrytään juotettaessa tehostustilaan ",
|
/* Boost enabled */ "Etupainikeella siirrytään juotettaessa tehostustilaan ",
|
||||||
/* Boost temperature */ "Tehostuksen lämpötila kun käytetään tehostustilaa",
|
/* Boost temperature */ "Tehostustilan lämpötila", //"Tehostuksen lämpötila kun käytetään tehostustilaa",
|
||||||
/* Automatic start mode */ "Lämmitys käynnistyy automaattisesti kun virrat kytketään. T=juottamiseen, S=lepotilaan, F=ei käytössä",
|
/* Automatic start mode */ "Aloittaa lämmityksen automaattisesti kun virrat kytketään. T=juotostila, S=Lepotila, F=Ei käytössä", //"Lämmitys käynnistyy automaattisesti kun virrat kytketään. T=juottamiseen, S=lepotilaan, F=ei käytössä",
|
||||||
/* Cooldown blink */ "Vilkutetaan näytössä lämpötilaa kun juotoskärki jäähtyy, mutta on yhä kuuma",
|
/* Cooldown blink */ "Vilkutetaan näytössä lämpötilaa kun juotoskärki jäähtyy, mutta on yhä kuuma",
|
||||||
/* Temperature calibration enter menu */ "Kalibroidaan juotoskärjen lämpötilaero",
|
/* Temperature calibration enter menu */ "Kalibroi kärjen lämpötilaero", //"Kalibroidaan juotoskärjen lämpötilaero",
|
||||||
/* Settings reset command */ "Palautetaan kaikki asetukset alkuperäisiksi",
|
/* Settings reset command */ "Palauta kaikki asetukset oletusarvoihin" //"Palautetaan kaikki asetukset alkuperäisiksi",
|
||||||
/* Calibrate input voltage */ "Tulojännitten kalibrointi (VIN). Painikkeilla säädetään ja pitkään painamalla poistutaan",
|
/* Calibrate input voltage */ "Tulojännitten kalibrointi (VIN). Painikkeilla säädetään ja pitkään painamalla poistutaan",
|
||||||
/* Advanced soldering screen enabled */ "Näytetään tarkemmat tiedot juottamisen aikana",
|
/* Advanced soldering screen enabled */ "Näytä yksityiskohtaiset tiedot juotostilassa", //"Näytetään tarkemmat tiedot juottamisen aikana",
|
||||||
/* Description Scroll Speed */ "Tekstin vieritysnopeus näytöllä",
|
/* Description Scroll Speed */ "Näiden ohjetekstien vieritysnopeus" ,//"Tekstin vieritysnopeus näytöllä",
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* SettingsCalibrationWarning = "Älä jatka ennen kuin kärki on jäähtynyt!";
|
const char* SettingsCalibrationWarning = "Varmista että kärki on huoneenlämpöinen ennen jatkamista!"; //"Älä jatka ennen kuin kärki on jäähtynyt!";
|
||||||
const char* SettingsResetWarning = "Haluatko palauttaa oletusarvot?";
|
const char* SettingsResetWarning = "Haluatko varmasti palauttaa oletusarvot?"; //"Haluatko palauttaa oletusarvot?";
|
||||||
const char* UVLOWarningString = "DC LOW"; // <=8 chars
|
const char* UVLOWarningString = "DC LOW"; // <=8 chars
|
||||||
const char* UndervoltageString = "Alijännite"; // <=16 chars
|
const char* UndervoltageString = "Alijännite"; // <=16 chars
|
||||||
const char* InputVoltageString = "Jännite: "; // <=11 chars, preferably end with a space
|
const char* InputVoltageString = "Jännite: "; // <=11 chars, preferably end with a space
|
||||||
@@ -424,7 +424,7 @@ const char* BadTipString = "VIKATILA"; // <=8 chars
|
|||||||
const char* SleepingSimpleString = "Zzz"; // Must be <= 4 chars
|
const char* SleepingSimpleString = "Zzz"; // Must be <= 4 chars
|
||||||
const char* SleepingAdvancedString = "Lepotila..."; // <=16 chars
|
const char* SleepingAdvancedString = "Lepotila..."; // <=16 chars
|
||||||
const char* WarningSimpleString = "HOT"; // Must be <= 4 chars
|
const char* WarningSimpleString = "HOT"; // Must be <= 4 chars
|
||||||
const char* WarningAdvancedString = "KUUMA KÄRKI"; // <=16 chars
|
const char* WarningAdvancedString = " ! KÄRKI KUUMA !"; //"KUUMA KÄRKI"; // <=16 chars
|
||||||
const char* SleepingTipAdvancedString = "Kärki:"; // <=6 chars
|
const char* SleepingTipAdvancedString = "Kärki:"; // <=6 chars
|
||||||
const char* IdleTipString = "Kärki:"; // IdleTipString+IdleSetString <= 10
|
const char* IdleTipString = "Kärki:"; // IdleTipString+IdleSetString <= 10
|
||||||
const char* IdleSetString = " Asetus:"; // preferably start with a space; IdleTipString+IdleSetString <= 10
|
const char* IdleSetString = " Asetus:"; // preferably start with a space; IdleTipString+IdleSetString <= 10
|
||||||
@@ -436,36 +436,36 @@ const char SettingRightChar = 'O';
|
|||||||
const char SettingLeftChar = 'V';
|
const char SettingLeftChar = 'V';
|
||||||
const char SettingAutoChar = 'A';
|
const char SettingAutoChar = 'A';
|
||||||
|
|
||||||
const char SettingFastChar = 'F';
|
const char SettingFastChar = 'N'; //'F';
|
||||||
const char SettingSlowChar = 'S';
|
const char SettingSlowChar = 'H'; //'S';
|
||||||
|
|
||||||
const enum ShortNameType SettingsShortNameType = SHORT_NAME_DOUBLE_LINE;
|
const enum ShortNameType SettingsShortNameType = SHORT_NAME_DOUBLE_LINE;
|
||||||
const char* SettingsShortNames[17][2] = {
|
const char* SettingsShortNames[17][2] = {
|
||||||
/* (<= 11) Power source (DC or batt) */ {"Virtalähde", "DC"},
|
/* (<= 11) Power source (DC or batt) */ {"Virtalähde", "DC"},
|
||||||
/* (<= 9) Sleep temperature */ {"Lepotilan", "lämpötila"},
|
/* (<= 9) Sleep temperature */ {"Lepotilan", "lämpötila"},
|
||||||
/* (<= 9) Sleep timeout */ {"Lepotilan", "viive"},
|
/* (<= 9) Sleep timeout */ {"Lepotilan", "viive"},
|
||||||
/* (<= 10) Shutdown timeout */ {"Sammutuksen", "viive"},
|
/* (<= 10) Shutdown timeout */ {"Sammutuksen", "viive"}, // Too long
|
||||||
/* (<= 13) Motion sensitivity level */ {"Liikkeen", "herkkyys"},
|
/* (<= 13) Motion sensitivity level */ {"Liikkeen", "herkkyys"},
|
||||||
/* (<= 13) Temperature in F and C */ {"Lämpötilan", "yksikkö"},
|
/* (<= 13) Temperature in F and C */ {"Lämpötilan", "yksikkö"},
|
||||||
/* (<= 13) Advanced idle display mode enabled */ {"Tarkemmat tiedot", "lepotilassa"},
|
/* (<= 13) Advanced idle display mode enabled */ {"Tarkemmat tiedot", "lepotilassa"}, // Too long
|
||||||
/* (<= 13) Display rotation mode */ {"Näytön", "esityssuunta"},
|
/* (<= 13) Display rotation mode */ {"Näytön", "esityssuunta"},
|
||||||
/* (<= 13) Boost enabled */ {"Tehostus", "käytössä"},
|
/* (<= 13) Boost enabled */ {"Tehostus", "käytössä"},
|
||||||
/* (<= 9) Boost temperature */ {"Tehostus", "lämpötila"},
|
/* (<= 9) Boost temperature */ {"Tehostus", "lämpötila"},
|
||||||
/* (<= 13) Automatic start mode */ {"Automattinen", "käynnistyminen"},
|
/* (<= 13) Automatic start mode */ {"Automattinen", "käynnistyminen"}, // Too long
|
||||||
/* (<= 13) Cooldown blink */ {"Jäähdytyksen", "vilkutus"},
|
/* (<= 13) Cooldown blink */ {"Jäähdytyksen", "vilkutus"},
|
||||||
/* (<= 16) Temperature calibration enter menu */ {"Kalibroidaanko", "lämpötila?"},
|
/* (<= 16) Temperature calibration enter menu */ {"Kalibroidaanko", "lämpötila?"},
|
||||||
/* (<= 16) Settings reset command */ {"Palautetaanko", "tehdasasetukset?"},
|
/* (<= 16) Settings reset command */ {"Palautetaanko", "tehdasasetukset?"},
|
||||||
/* (<= 16) Calibrate input voltage */ {"Kalibroidaanko", "tulojännite?"},
|
/* (<= 16) Calibrate input voltage */ {"Kalibroidaanko", "tulojännite?"},
|
||||||
/* (<= 13) Advanced soldering screen enabled */ {"Monipuolisempi", "juotosnäyttö"},
|
/* (<= 13) Advanced soldering screen enabled */ {"Monipuolisempi", "juotosnäyttö"}, // Too long
|
||||||
/* (<= 11) Display Help Text Scroll Speed */ {"Selitteiden","näyttönopeus"},
|
/* (<= 11) Display Help Text Scroll Speed */ {"Selitteiden","näyttönopeus"}, // Too long
|
||||||
};
|
};
|
||||||
|
|
||||||
// SettingsMenuEntries lengths <= 13 per line (\n starts second line)
|
// SettingsMenuEntries lengths <= 13 per line (\n starts second line)
|
||||||
const char* SettingsMenuEntries[4] = {
|
const char* SettingsMenuEntries[4] = {
|
||||||
/* Soldering Menu */ "Juotos\nasetukset",
|
/* Soldering Menu */ "Juotos-\nasetukset" ,//"Juotos\nasetukset",
|
||||||
/* Power Saving Menu */ "Lepo\ntila",
|
/* Power Saving Menu */ "Lepotilan\nasetukset", // "Lepo\ntila",
|
||||||
/* UI Menu */ "Käyttö\nliittymä",
|
/* UI Menu */ "Käyttö-\nliittymä", //"Käyttö\nliittymä",
|
||||||
/* Advanced Menu */ "Lisä\nasetukset",
|
/* Advanced Menu */ "Lisäasetukset", // "Lisä\nasetukset",
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* SettingsMenuEntriesDescriptions[4] = {
|
const char* SettingsMenuEntriesDescriptions[4] = {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ uint16_t getTipInstantTemperature() {
|
|||||||
uint16_t getTipRawTemp(uint8_t instant) {
|
uint16_t getTipRawTemp(uint8_t instant) {
|
||||||
#define filterDepth1 1
|
#define filterDepth1 1
|
||||||
/*Pre filter used before PID*/
|
/*Pre filter used before PID*/
|
||||||
#define filterDepth2 64
|
#define filterDepth2 48
|
||||||
/*Post filter used for UI display*/
|
/*Post filter used for UI display*/
|
||||||
static uint16_t filterLayer1[filterDepth1];
|
static uint16_t filterLayer1[filterDepth1];
|
||||||
static uint16_t filterLayer2[filterDepth2];
|
static uint16_t filterLayer2[filterDepth2];
|
||||||
|
|||||||
@@ -847,6 +847,8 @@ void startPIDTask(void const *argument) {
|
|||||||
* struct
|
* struct
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
setTipPWM(0); // disable the output driver if the output is set to be off
|
||||||
|
osDelay(500);
|
||||||
int32_t integralCount = 0;
|
int32_t integralCount = 0;
|
||||||
int32_t derivativeLastValue = 0;
|
int32_t derivativeLastValue = 0;
|
||||||
int32_t kp, ki, kd;
|
int32_t kp, ki, kd;
|
||||||
@@ -856,6 +858,11 @@ void startPIDTask(void const *argument) {
|
|||||||
// REMEBER ^^^^ These constants are backwards
|
// REMEBER ^^^^ These constants are backwards
|
||||||
// They act as dividers, so to 'increase' a P term, you make the number
|
// They act as dividers, so to 'increase' a P term, you make the number
|
||||||
// smaller.
|
// smaller.
|
||||||
|
if(getInputVoltageX10(systemSettings.voltageDiv) < 150)
|
||||||
|
{
|
||||||
|
//Boot P term if < 15 Volts
|
||||||
|
kp=30;
|
||||||
|
}
|
||||||
const int32_t itermMax = 100;
|
const int32_t itermMax = 100;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
uint16_t rawTemp = getTipRawTemp(1); // get instantaneous reading
|
uint16_t rawTemp = getTipRawTemp(1); // get instantaneous reading
|
||||||
|
|||||||
Reference in New Issue
Block a user