diff options
author | Ben V. Brown <[email protected]> | 2020-05-24 18:21:46 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-24 18:21:46 +1000 |
commit | c5397b843fcdc84afee03ee748b066b05cce77a0 (patch) | |
tree | 14a2f4274b1b2f2d5cebe81f656af0cf33f33fe3 | |
parent | 643120d9cafdb989ced7fa1101653df87ee8038a (diff) | |
parent | f90d33f350fe899f0e685edc43d00746e612c220 (diff) | |
download | IronOS-c5397b843fcdc84afee03ee748b066b05cce77a0.tar.gz IronOS-c5397b843fcdc84afee03ee748b066b05cce77a0.zip |
Merge pull request #632 from Ralim/feat/power-pulse-for-all
Enable Power Pulse for all models
32 files changed, 345 insertions, 110 deletions
diff --git a/Translation Editor/translation_bg.json b/Translation Editor/translation_bg.json index 0efd7432..5d1c5999 100644 --- a/Translation Editor/translation_bg.json +++ b/Translation Editor/translation_bg.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_cs.json b/Translation Editor/translation_cs.json index a4ff9ba3..c656d8df 100644 --- a/Translation Editor/translation_cs.json +++ b/Translation Editor/translation_cs.json @@ -274,6 +274,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_da.json b/Translation Editor/translation_da.json index 57910eb9..7f49b8f1 100644 --- a/Translation Editor/translation_da.json +++ b/Translation Editor/translation_da.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_de.json b/Translation Editor/translation_de.json index 5097547f..f9b8f1fe 100644 --- a/Translation Editor/translation_de.json +++ b/Translation Editor/translation_de.json @@ -277,6 +277,14 @@ "Taste Lang?" ], "desc": "Temperaturwechselschritte bei langem Tastendruck!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_en.json b/Translation Editor/translation_en.json index 70b66bc0..4615b68e 100644 --- a/Translation Editor/translation_en.json +++ b/Translation Editor/translation_en.json @@ -276,6 +276,14 @@ "long"
],
"desc": "Temperature change steps on long button press"
+ },
+ "PowerPulsePower":{
+ "text": "POWPLS",
+ "text2": [
+ "Power",
+ "Pulse W"
+ ],
+ "desc": "Keep awake pulse power intensity"
}
}
}
diff --git a/Translation Editor/translation_es.json b/Translation Editor/translation_es.json index 07f19835..8514667e 100644 --- a/Translation Editor/translation_es.json +++ b/Translation Editor/translation_es.json @@ -275,6 +275,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_fi.json b/Translation Editor/translation_fi.json index bbeaa8ed..089959d8 100644 --- a/Translation Editor/translation_fi.json +++ b/Translation Editor/translation_fi.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_fr.json b/Translation Editor/translation_fr.json index 98fd92dd..b4e6707b 100644 --- a/Translation Editor/translation_fr.json +++ b/Translation Editor/translation_fr.json @@ -273,6 +273,14 @@ "Long?" ], "desc": "Incrément de changement de température sur appui long." + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } } diff --git a/Translation Editor/translation_hr.json b/Translation Editor/translation_hr.json index a6839354..e4dbf726 100644 --- a/Translation Editor/translation_hr.json +++ b/Translation Editor/translation_hr.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_hu.json b/Translation Editor/translation_hu.json index a9b770c2..89e88663 100644 --- a/Translation Editor/translation_hu.json +++ b/Translation Editor/translation_hu.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_it.json b/Translation Editor/translation_it.json index 1c0f7562..5793cb1c 100644 --- a/Translation Editor/translation_it.json +++ b/Translation Editor/translation_it.json @@ -275,6 +275,14 @@ "pressione lunga" ], "desc": "Varia la temperatura della punta attraverso una lunga pressione dei tasti" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } } diff --git a/Translation Editor/translation_lt.json b/Translation Editor/translation_lt.json index ec891f64..38608dab 100644 --- a/Translation Editor/translation_lt.json +++ b/Translation Editor/translation_lt.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_nl.json b/Translation Editor/translation_nl.json index efbc0d5e..afb7ea31 100644 --- a/Translation Editor/translation_nl.json +++ b/Translation Editor/translation_nl.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_nl_be.json b/Translation Editor/translation_nl_be.json index 37bd4f57..c79e34fb 100644 --- a/Translation Editor/translation_nl_be.json +++ b/Translation Editor/translation_nl_be.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_no.json b/Translation Editor/translation_no.json index ac7917fb..8b8fad56 100644 --- a/Translation Editor/translation_no.json +++ b/Translation Editor/translation_no.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_pl.json b/Translation Editor/translation_pl.json index 6959da7a..acad6316 100644 --- a/Translation Editor/translation_pl.json +++ b/Translation Editor/translation_pl.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_pt.json b/Translation Editor/translation_pt.json index aca5d524..c0d43e86 100644 --- a/Translation Editor/translation_pt.json +++ b/Translation Editor/translation_pt.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_ru.json b/Translation Editor/translation_ru.json index c7026a31..66b6843e 100644 --- a/Translation Editor/translation_ru.json +++ b/Translation Editor/translation_ru.json @@ -275,6 +275,14 @@ "длин. наж." ], "desc": "Шаг изменения температуры при длинном нажатии кнопок" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_sk.json b/Translation Editor/translation_sk.json index fe2e03af..2eb45bf6 100644 --- a/Translation Editor/translation_sk.json +++ b/Translation Editor/translation_sk.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_sl.json b/Translation Editor/translation_sl.json index 6c3ef9a5..87b8ef40 100644 --- a/Translation Editor/translation_sl.json +++ b/Translation Editor/translation_sl.json @@ -274,6 +274,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_sr_cyrl.json b/Translation Editor/translation_sr_cyrl.json index 6497b7a5..000d3882 100644 --- a/Translation Editor/translation_sr_cyrl.json +++ b/Translation Editor/translation_sr_cyrl.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_sr_latn.json b/Translation Editor/translation_sr_latn.json index e612cf06..cc1009ea 100644 --- a/Translation Editor/translation_sr_latn.json +++ b/Translation Editor/translation_sr_latn.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_sv.json b/Translation Editor/translation_sv.json index 6b965a17..7af2ab00 100644 --- a/Translation Editor/translation_sv.json +++ b/Translation Editor/translation_sv.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_tr.json b/Translation Editor/translation_tr.json index 76e6cce7..9c818c1d 100644 --- a/Translation Editor/translation_tr.json +++ b/Translation Editor/translation_tr.json @@ -273,6 +273,14 @@ "long?" ], "desc": "Temperature change steps on long button press!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } }
\ No newline at end of file diff --git a/Translation Editor/translation_uk.json b/Translation Editor/translation_uk.json index f072938c..9f9bbf98 100644 --- a/Translation Editor/translation_uk.json +++ b/Translation Editor/translation_uk.json @@ -273,6 +273,14 @@ "довго?" ], "desc": "Змінювати температуру при довгому натисканні!" + }, + "PowerPulsePower":{ + "text": "POWPLS", + "text2": [ + "Power", + "Pulse W" + ], + "desc": "Keep awake pulse power intensity" } } } diff --git a/Translation Editor/translations_def.js b/Translation Editor/translations_def.js index 93646e1f..8c11a4bd 100644 --- a/Translation Editor/translations_def.js +++ b/Translation Editor/translations_def.js @@ -282,6 +282,11 @@ var def = "id": "TempChangeLongStep",
"maxLen": 6,
"maxLen2": 16
+ },
+ {
+ "id": "PowerPulsePower",
+ "maxLen": 6,
+ "maxLen2": 16
}
]
}
diff --git a/workspace/TS100/Core/Inc/Settings.h b/workspace/TS100/Core/Inc/Settings.h index f79b3fe5..604ca1b9 100644 --- a/workspace/TS100/Core/Inc/Settings.h +++ b/workspace/TS100/Core/Inc/Settings.h @@ -12,7 +12,7 @@ #include <stdint.h> #include "stm32f1xx_hal.h" #include "unit.h" -#define SETTINGSVERSION ( 0x1E ) +#define SETTINGSVERSION ( 0x1F ) /*Change this if you change the struct below to prevent people getting \ out of sync*/ @@ -21,6 +21,8 @@ * flash in uint16_t chunks */ typedef struct { + uint8_t version; // Used to track if a reset is needed on firmware upgrade + uint16_t SolderingTemp; // current set point for the iron uint16_t SleepTemp; // temp to drop to in sleep uint8_t SleepTime; // minutes timeout to sleep @@ -37,25 +39,26 @@ typedef struct { uint8_t detailedIDLE :1; // Detailed idle screen uint8_t detailedSoldering :1; // Detailed soldering screens #ifdef ENABLED_FAHRENHEIT_SUPPORT - uint8_t temperatureInF; // Should the temp be in F or C (true is F) + uint8_t temperatureInF :1; // Should the temp be in F or C (true is F) #endif uint8_t descriptionScrollSpeed :1; // Description scroll speed + uint8_t KeepAwakePulse; // Keep Awake pulse power in 0.1 watts (10 = 1Watt) + uint16_t voltageDiv; // Voltage divisor factor uint16_t BoostTemp; // Boost mode set point for the iron uint16_t CalibrationOffset; // This stores the temperature offset for this tip // in the iron. - uint8_t pidPowerLimit; - uint8_t powerLimitEnable; // Allow toggling of power limit without changing value uint8_t powerLimit; // Maximum power iron allowed to output - uint8_t version; // Used to track if a reset is needed on firmware upgrade + uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment + uint16_t TempChangeLongStep; // Change the plus and minus button assigment + uint16_t TempChangeShortStep; // Change the plus and minus button assigment + uint32_t padding; // This is here for in case we are not an even divisor so // that nothing gets cut off - uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment - uint16_t TempChangeLongStep; // Change the plus and minus button assigment - uint16_t TempChangeShortStep; // Change the plus and minus button assigment + //MUST BE LAST } systemSettingsType; diff --git a/workspace/TS100/Core/Inc/Translation.h b/workspace/TS100/Core/Inc/Translation.h index e3f5f167..74c01e20 100644 --- a/workspace/TS100/Core/Inc/Translation.h +++ b/workspace/TS100/Core/Inc/Translation.h @@ -19,8 +19,8 @@ extern const uint8_t USER_FONT_6x8[]; * use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
*/
extern const enum ShortNameType SettingsShortNameType;
-extern const char *SettingsShortNames[26][2];
-extern const char *SettingsDescriptions[26];
+extern const char *SettingsShortNames[27][2];
+extern const char *SettingsDescriptions[27];
extern const char *SettingsMenuEntries[4];
extern const char *SettingsCalibrationDone;
diff --git a/workspace/TS100/Core/Src/Settings.cpp b/workspace/TS100/Core/Src/Settings.cpp index d8a36049..7f0b84a5 100644 --- a/workspace/TS100/Core/Src/Settings.cpp +++ b/workspace/TS100/Core/Src/Settings.cpp @@ -101,10 +101,10 @@ void resetSettings() { systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow systemSettings.powerLimitEnable = POWER_LIMIT_ENABLE; // Default to no power limit systemSettings.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV - systemSettings.pidPowerLimit = PID_POWER_LIMIT; // Sets the max pwm power limit systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; // systemSettings.TempChangeShortStep = TEMP_CHANGE_SHORT_STEP; // systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; // + systemSettings.KeepAwakePulse= POWER_PULSE_DEFAULT; saveSettings(); // Save defaults } diff --git a/workspace/TS100/Core/Src/gui.cpp b/workspace/TS100/Core/Src/gui.cpp index a38aae4d..dfa4ebfc 100644 --- a/workspace/TS100/Core/Src/gui.cpp +++ b/workspace/TS100/Core/Src/gui.cpp @@ -18,11 +18,11 @@ extern uint32_t lastButtonTime; void gui_Menu(const menuitem *menu); #ifdef MODEL_TS100 - static void settings_setInputVRange(void); - static void settings_displayInputVRange(void); +static void settings_setInputVRange(void); +static void settings_displayInputVRange(void); #else - static void settings_setInputPRange(void); - static void settings_displayInputPRange(void); +static void settings_setInputPRange(void); +static void settings_displayInputPRange(void); #endif static void settings_setSleepTemp(void); static void settings_displaySleepTemp(void); @@ -68,6 +68,8 @@ static void settings_displayTempChangeShortStep(void); static void settings_setTempChangeShortStep(void); static void settings_displayTempChangeLongStep(void); static void settings_setTempChangeLongStep(void); +static void settings_displayPowerPulse(void); +static void settings_setPowerPulse(void); // Menu functions static void settings_displaySolderingMenu(void); @@ -116,14 +118,14 @@ static void settings_enterAdvancedMenu(void); * */ const menuitem rootSettingsMenu[] { - /* - * Power Source - * Soldering Menu - * Power Saving Menu - * UI Menu - * Advanced Menu - * Exit - */ +/* + * Power Source + * Soldering Menu + * Power Saving Menu + * UI Menu + * Advanced Menu + * Exit + */ #ifdef MODEL_TS100 { (const char*) SettingsDescriptions[0], { settings_setInputVRange }, { settings_displayInputVRange } }, /*Voltage input*/ @@ -157,9 +159,9 @@ const menuitem solderingMenu[] = { { (const char*) SettingsDescriptions[10], { settings_setAutomaticStartMode }, { settings_displayAutomaticStartMode } }, /*Auto start*/ { (const char*) SettingsDescriptions[24], { settings_setTempChangeShortStep }, { - settings_displayTempChangeShortStep } }, /*Temp change short step*/ + settings_displayTempChangeShortStep } }, /*Temp change short step*/ { (const char*) SettingsDescriptions[25], { settings_setTempChangeLongStep }, { - settings_displayTempChangeLongStep } }, /*Temp change long step*/ + settings_displayTempChangeLongStep } }, /*Temp change long step*/ { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE }; const menuitem UIMenu[] = { @@ -172,18 +174,21 @@ const menuitem UIMenu[] = { * Reverse Temp change buttons + - */ #ifdef ENABLED_FAHRENHEIT_SUPPORT -{ (const char*) SettingsDescriptions[5], { settings_setTempF }, { - settings_displayTempF } }, /* Temperature units*/ + { (const char*) SettingsDescriptions[5], { settings_setTempF }, { + settings_displayTempF } }, /* Temperature units*/ #endif -{ (const char*) SettingsDescriptions[7], { settings_setDisplayRotation }, { - settings_displayDisplayRotation } }, /*Display Rotation*/ -{ (const char*) SettingsDescriptions[11], { settings_setCoolingBlinkEnabled }, { - settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/ -{ (const char*) SettingsDescriptions[16], { settings_setScrollSpeed }, { - settings_displayScrollSpeed } }, /*Scroll Speed for descriptions*/ -{ (const char*) SettingsDescriptions[23], { settings_setReverseButtonTempChangeEnabled }, { - settings_displayReverseButtonTempChangeEnabled } }, /* Reverse Temp change buttons + - */ -{ NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE + { (const char*) SettingsDescriptions[7], + { settings_setDisplayRotation }, { + settings_displayDisplayRotation } }, /*Display Rotation*/ + { (const char*) SettingsDescriptions[11], { + settings_setCoolingBlinkEnabled }, { + settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/ + { (const char*) SettingsDescriptions[16], { settings_setScrollSpeed }, { + settings_displayScrollSpeed } }, /*Scroll Speed for descriptions*/ + { (const char*) SettingsDescriptions[23], { + settings_setReverseButtonTempChangeEnabled }, { + settings_displayReverseButtonTempChangeEnabled } }, /* Reverse Temp change buttons + - */ + { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE }; const menuitem PowerMenu[] = { /* @@ -212,6 +217,7 @@ const menuitem advancedMenu[] = { * Calibrate Temperature * Calibrate Input V * Reset Settings + * Power Pulse */ { (const char*) SettingsDescriptions[21], { settings_setPowerLimitEnable }, { settings_displayPowerLimitEnable } }, /*Power limit enable*/ @@ -228,6 +234,8 @@ const menuitem advancedMenu[] = { settings_displayCalibrate } }, /*Calibrate tip*/ { (const char*) SettingsDescriptions[14], { settings_setCalibrateVIN }, { settings_displayCalibrateVIN } }, /*Voltage input cal*/ +{ (const char*) SettingsDescriptions[26], { settings_setPowerPulse }, { + settings_displayPowerPulse } }, /*Power Pulse adjustment */ { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE }; @@ -366,8 +374,7 @@ static void settings_setSleepTemp(void) { systemSettings.SleepTemp += 20; if (systemSettings.SleepTemp > 580) systemSettings.SleepTemp = 120; - } - else + } else #endif { systemSettings.SleepTemp += 10; @@ -487,12 +494,12 @@ static void settings_displayAdvancedIDLEScreens(void) { } static void settings_setPowerLimitEnable(void) { - systemSettings.powerLimitEnable = !systemSettings.powerLimitEnable; + systemSettings.powerLimitEnable = !systemSettings.powerLimitEnable; } static void settings_displayPowerLimitEnable(void) { - printShortDescription(21, 7); - OLED::drawCheckbox(systemSettings.powerLimitEnable); + printShortDescription(21, 7); + OLED::drawCheckbox(systemSettings.powerLimitEnable); } static void settings_setPowerLimit(void) { @@ -503,9 +510,9 @@ static void settings_setPowerLimit(void) { } static void settings_displayPowerLimit(void) { - printShortDescription(22, 5); - OLED::printNumber(systemSettings.powerLimit, 2); - OLED::print(SymbolWatts); + printShortDescription(22, 5); + OLED::printNumber(systemSettings.powerLimit, 2); + OLED::print(SymbolWatts); } static void settings_setScrollSpeed(void) { @@ -575,7 +582,7 @@ static void settings_setBoostTemp(void) { if (systemSettings.BoostTemp > 850) { systemSettings.BoostTemp = 480; // loop back at 250 } - } else + } else #endif { systemSettings.BoostTemp += 10; // Go up 10C at a time @@ -746,46 +753,64 @@ static void settings_setCalibrateVIN(void) { } static void settings_setReverseButtonTempChangeEnabled(void) { - systemSettings.ReverseButtonTempChangeEnabled = !systemSettings.ReverseButtonTempChangeEnabled; + systemSettings.ReverseButtonTempChangeEnabled = + !systemSettings.ReverseButtonTempChangeEnabled; } -static void settings_displayReverseButtonTempChangeEnabled(void){ - printShortDescription(23, 7); - OLED::drawCheckbox(systemSettings.ReverseButtonTempChangeEnabled); +static void settings_displayReverseButtonTempChangeEnabled(void) { + printShortDescription(23, 7); + OLED::drawCheckbox(systemSettings.ReverseButtonTempChangeEnabled); } static void settings_setTempChangeShortStep(void) { - systemSettings.TempChangeShortStep += TEMP_CHANGE_SHORT_STEP; - if (systemSettings.TempChangeShortStep > TEMP_CHANGE_SHORT_STEP_MAX) { - systemSettings.TempChangeShortStep = TEMP_CHANGE_SHORT_STEP; // loop back at TEMP_CHANGE_SHORT_STEP_MAX - } + systemSettings.TempChangeShortStep += TEMP_CHANGE_SHORT_STEP; + if (systemSettings.TempChangeShortStep > TEMP_CHANGE_SHORT_STEP_MAX) { + systemSettings.TempChangeShortStep = TEMP_CHANGE_SHORT_STEP; // loop back at TEMP_CHANGE_SHORT_STEP_MAX + } } static void settings_displayTempChangeShortStep(void) { - printShortDescription(24, 5); - OLED::printNumber(systemSettings.TempChangeShortStep, 3); + printShortDescription(24, 5); + OLED::printNumber(systemSettings.TempChangeShortStep, 3); } static void settings_setTempChangeLongStep(void) { - systemSettings.TempChangeLongStep += TEMP_CHANGE_LONG_STEP; - if (systemSettings.TempChangeLongStep > TEMP_CHANGE_LONG_STEP_MAX) { - systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; // loop back at TEMP_CHANGE_LONG_STEP_MAX - } + systemSettings.TempChangeLongStep += TEMP_CHANGE_LONG_STEP; + if (systemSettings.TempChangeLongStep > TEMP_CHANGE_LONG_STEP_MAX) { + systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; // loop back at TEMP_CHANGE_LONG_STEP_MAX + } } static void settings_displayTempChangeLongStep(void) { - printShortDescription(25, 5); - OLED::printNumber(systemSettings.TempChangeLongStep, 3); + printShortDescription(25, 5); + OLED::printNumber(systemSettings.TempChangeLongStep, 3); } +static void settings_setPowerPulse(void) { + systemSettings.KeepAwakePulse += POWER_PULSE_INCREMENT; + systemSettings.KeepAwakePulse %= POWER_PULSE_MAX; + +} +static void settings_displayPowerPulse(void) { + printShortDescription(26, 5); + if (systemSettings.KeepAwakePulse) { + OLED::printNumber(systemSettings.KeepAwakePulse / 10, 1); + OLED::print(SymbolDot); + OLED::printNumber(systemSettings.KeepAwakePulse % 10, 1); + } else { + OLED::drawCheckbox(false); + } + +} static void displayMenu(size_t index) { - // Call into the menu +// Call into the menu OLED::setFont(1); OLED::setCursor(0, 0); - // Draw title +// Draw title OLED::print(SettingsMenuEntries[index]); - // Draw symbol - // 16 pixel wide image - // 2 pixel wide scrolling indicator - OLED::drawArea(96 - 16 - 2, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index])); +// Draw symbol +// 16 pixel wide image +// 2 pixel wide scrolling indicator + OLED::drawArea(96 - 16 - 2, 0, 16, 16, + (&SettingsMenuIcons[(16 * 2) * index])); } static void settings_displayCalibrateVIN(void) { @@ -817,7 +842,7 @@ static void settings_enterAdvancedMenu(void) { } void gui_Menu(const menuitem *menu) { - // Draw the settings menu and provide iteration support etc +// Draw the settings menu and provide iteration support etc uint8_t currentScreen = 0; uint32_t autoRepeatTimer = 0; uint8_t autoRepeatAcceleration = 0; @@ -834,7 +859,7 @@ void gui_Menu(const menuitem *menu) { scrollContentSize += 1; } - // Animated menu opening. +// Animated menu opening. if (menu[currentScreen].draw.func != NULL) { // This menu is drawn in a secondary framebuffer. // Then we play a transition from the current primary @@ -874,7 +899,7 @@ void gui_Menu(const menuitem *menu) { ((xTaskGetTickCount() - descriptionStart) / (systemSettings.descriptionScrollSpeed == 1 ? 1 : 2)); - descriptionOffset %= descriptionWidth; // Roll around at the end + descriptionOffset %= descriptionWidth; // Roll around at the end if (lastOffset != descriptionOffset) { OLED::clearScreen(); OLED::setCursor((OLED_WIDTH - descriptionOffset), 0); diff --git a/workspace/TS100/Core/Src/main.cpp b/workspace/TS100/Core/Src/main.cpp index 85a734a7..ad952611 100644 --- a/workspace/TS100/Core/Src/main.cpp +++ b/workspace/TS100/Core/Src/main.cpp @@ -36,16 +36,13 @@ uint32_t MOVTaskBuffer[MOVTaskStackSize]; osStaticThreadDef_t MOVTaskControlBlock; static TaskHandle_t pidTaskNotification = NULL; - +static TickType_t powerPulseRate = 1000; +static TickType_t powerPulseDuration = 50; void startGUITask(void const *argument); void startPIDTask(void const *argument); void startMOVTask(void const *argument); // End FreeRTOS -static const int maxPowerIdleTicks = 1000; -static const int powerPulseTicks = 50; -static const int x10PowerPulseWatts = 3; - // Main sets up the hardware then hands over to the FreeRTOS kernel int main(void) { /* Reset of all peripherals, Initializes the Flash interface and the Systick. @@ -113,14 +110,9 @@ void startPIDTask(void const *argument __unused) { * control PWM. */ setTipX10Watts(0); // disable the output driver if the output is set to be off + TickType_t lastPowerPulseStart = 0; + TickType_t lastPowerPulseEnd = 0; -#ifdef MODEL_TS80 - //Set power management code to the tip resistance in ohms * 10 - - TickType_t lastPowerPulse = 0; -#else - -#endif history<int32_t, PID_TIM_HZ> tempError = { { 0 }, 0, 0 }; currentTempTargetDegC = 0; // Force start with no output (off). If in sleep / soldering this will // be over-ridden rapidly @@ -183,18 +175,23 @@ void startPIDTask(void const *argument __unused) { // Unfortunately, our temp signal is too noisy to really help. } -#ifdef MODEL_TS80 - //If its a TS80, we want to have the option of using an occasional pulse to keep the power bank on - if (((xTaskGetTickCount() - lastPowerPulse) > maxPowerIdleTicks) - && (x10WattsOut < x10PowerPulseWatts)) { - x10WattsOut = x10PowerPulseWatts; - } - if (((xTaskGetTickCount() - lastPowerPulse) - > (maxPowerIdleTicks + powerPulseTicks)) - && (x10WattsOut >= x10PowerPulseWatts)) { - lastPowerPulse = xTaskGetTickCount(); + //If the user turns on the option of using an occasional pulse to keep the power bank on + if (systemSettings.KeepAwakePulse) { + + if (xTaskGetTickCount() - lastPowerPulseStart + > powerPulseRate) { + lastPowerPulseStart = xTaskGetTickCount(); + lastPowerPulseEnd = lastPowerPulseStart + + powerPulseDuration; + } + + //If current PID is less than the pulse level, check if we want to constrain to the pulse as the floor + if (x10WattsOut < systemSettings.KeepAwakePulse + && xTaskGetTickCount() < lastPowerPulseEnd) { + x10WattsOut = systemSettings.KeepAwakePulse; + } } -#endif + //Secondary safety check to forcefully disable header when within ADC noise of top of ADC if (getTipRawTemp(0) > (0x7FFF - 150)) { x10WattsOut = 0; @@ -263,8 +260,7 @@ void startMOVTask(void const *argument __unused) { datax[currentPointer] = (int32_t) tx; datay[currentPointer] = (int32_t) ty; dataz[currentPointer] = (int32_t) tz; - if (!accelInit) - { + if (!accelInit) { for (uint8_t i = currentPointer + 1; i < MOVFilter; i++) { datax[i] = (int32_t) tx; datay[i] = (int32_t) ty; @@ -304,19 +300,20 @@ void startMOVTask(void const *argument __unused) { // Second last page of flash set aside for logo image. #define FLASH_LOGOADDR (0x8000000 | 0xF800) - + // Logo header signature. #define LOGO_HEADER_VALUE 0xF00DAA55 bool showBootLogoIfavailable() { - // Do not show logo data if signature is not found. - if (LOGO_HEADER_VALUE != *(reinterpret_cast<const uint32_t *>(FLASH_LOGOADDR))) { - return false; - } - - OLED::drawAreaSwapped(0, 0, 96, 16, (uint8_t*) (FLASH_LOGOADDR + 4)); - OLED::refresh(); - return true; +// Do not show logo data if signature is not found. + if (LOGO_HEADER_VALUE + != *(reinterpret_cast<const uint32_t*>(FLASH_LOGOADDR))) { + return false; + } + + OLED::drawAreaSwapped(0, 0, 96, 16, (uint8_t*) (FLASH_LOGOADDR + 4)); + OLED::refresh(); + return true; } /* @@ -344,12 +341,10 @@ void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { FRToSI2C::CpltCallback(); } void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) { - asm("bkpt"); FRToSI2C::CpltCallback(); } void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) { - //asm("bkpt"); FRToSI2C::CpltCallback(); } @@ -358,7 +353,7 @@ void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) { } void vApplicationStackOverflowHook(xTaskHandle *pxTask __unused, signed portCHAR *pcTaskName __unused) { - asm("bkpt"); - // We dont have a good way to handle a stack overflow at this point in time + +// We dont have a good way to handle a stack overflow at this point in time NVIC_SystemReset(); } diff --git a/workspace/TS100/configuration.h b/workspace/TS100/configuration.h index d56f4f83..8dc1212f 100644 --- a/workspace/TS100/configuration.h +++ b/workspace/TS100/configuration.h @@ -54,7 +54,14 @@ #define TEMP_CHANGE_SHORT_STEP_MAX 50 // Temp change short step MAX value #define TEMP_CHANGE_LONG_STEP_MAX 100 // Temp change long step MAX value - +/* Power pulse for keeping power banks awake*/ +#define POWER_PULSE_INCREMENT 1 +#define POWER_PULSE_MAX 50 // x10 max watts +#ifdef MODEL_TS100 +#define POWER_PULSE_DEFAULT 0 +#else +#define POWER_PULSE_DEFAULT 5 +#endif /** * OLED Orientation Sensitivity on Automatic mode! * Motion Sensitivity <0=Off 1=Least Sensitive 9=Most Sensitive> @@ -105,4 +112,4 @@ #define OP_AMP_Rf 180*1000 // 180 Kilo-ohms -> From schematic, R6 #define OP_AMP_Rin 2000 // 2.0 Kilo-ohms -> From schematic, R3 #define TIP_GAIN 115 -#endif
\ No newline at end of file +#endif |