PowerLimit

This commit is contained in:
firebie
2020-01-08 23:48:54 +02:00
parent 88b64e24c1
commit 358726631f
32 changed files with 5287 additions and 4636 deletions

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
}
}
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -230,6 +230,22 @@
"ve wattech"
],
"desc": "Výkon použítého napájecího adaptéru ve wattech."
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"aufnahme"
],
"desc": "Leistungsaufnahme der verwendeten Spannungsversorgung"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -70,7 +70,7 @@
"Power",
"source"
],
"desc": "Power source. Sets cutoff voltage. <DC 10V> <S 3.3V per cell>"
"desc": "Power source. Sets cutoff voltage. <DC 10V> <S 3.3V per cell, disable power limit>"
},
"SleepTemperature": {
"text": "STMP",
@@ -231,6 +231,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"l'alimentation"
],
"desc": "Puissance de l'alimentation utilisée"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"napajanja"
],
"desc": "Snaga modula za napajanje"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"teljesítmény"
],
"desc": "A tápegység által leadott teljesítmény"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"alimentaz"
],
"desc": "Imposta la potenza massima erogabile dall'alimentatore in uso"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"vatais"
],
"desc": "Maitinimo bloko galia vatais"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Watt"
],
"desc": "Vermogen van de adapter"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattach"
],
"desc": "Moc używanego zasilacza w Watach"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Fonte"
],
"desc": "Potência da fonte usada (Watt)"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -230,6 +230,22 @@
"vira"
],
"desc": "Moč v W napajalnega vira"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"снага"
],
"desc": "Снага напајања у ватима."
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"snaga"
],
"desc": "Snaga napajanja u vatima."
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Wattage"
],
"desc": "Power Wattage of the power adapter used"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"Miktarı(W)"
],
"desc": "Kullanılan adaptörün güç miktarı"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -229,6 +229,22 @@
"дж. живл."
],
"desc": "Потужність джерела живлення в Ватах"
},
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": {
"text": "PLIM",
"text2": [
"Power",
"Limit"
],
"desc": "Maximum power the iron can use <Watts>"
}
}
}

View File

@@ -241,6 +241,16 @@ var def =
"id": "PowerInput",
"maxLen": 8,
"maxLen2": 16
},
{
"id": "PowerLimitEnable",
"maxLen": 6,
"maxLen2": 13
},
{
"id": "PowerLimit",
"maxLen": 5,
"maxLen2": 11
}
]
}

View File

@@ -11,7 +11,7 @@
#define SETTINGS_H_
#include <stdint.h>
#include "stm32f1xx_hal.h"
#define SETTINGSVERSION ( 0x1B )
#define SETTINGSVERSION ( 0x1C )
/*Change this if you change the struct below to prevent people getting \
out of sync*/
@@ -42,9 +42,11 @@ typedef struct {
uint16_t CalibrationOffset; // This stores the temperature offset for this tip
// in the iron.
uint8_t customTipGain; // Tip gain value if custom tuned, or 0 if using a
// tipType param
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
uint32_t padding; // This is here for in case we are not an even divisor so
// that nothing gets cut off

View File

@@ -18,8 +18,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[21][2];
extern const char* SettingsDescriptions[21];
extern const char* SettingsShortNames[23][2];
extern const char* SettingsDescriptions[23];
extern const char* SettingsMenuEntries[4];
extern const char* SettingsCalibrationDone;

View File

@@ -101,16 +101,16 @@ void resetSettings() {
systemSettings.coolingTempBlink = 0; // Blink the temperature on the cooling screen when its > 50C
systemSettings.temperatureInF = 0; // default to 0
systemSettings.descriptionScrollSpeed = 0; // default to slow
systemSettings.powerLimitEnable = 0; // Default to no power limit
#ifdef MODEL_TS100
systemSettings.CalibrationOffset = 900; // the adc offset in uV
systemSettings.pidPowerLimit=70; // Sets the max pwm power limit
systemSettings.CalibrationOffset = 900; // the adc offset in uV
systemSettings.pidPowerLimit = 70; // Sets the max pwm power limit
systemSettings.powerLimit = 30; // 30 watts default limit
#endif
#ifdef MODEL_TS80
systemSettings.pidPowerLimit = 24; // Sets the max pwm power limit
systemSettings.CalibrationOffset = 900; // the adc offset in uV
systemSettings.powerLimit = 24; // 24 watts default power limit
#endif
saveSettings(); // Save defaults
}

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,10 @@ static void settings_setAdvancedIDLEScreens(void);
static void settings_displayAdvancedIDLEScreens(void);
static void settings_setScrollSpeed(void);
static void settings_displayScrollSpeed(void);
static void settings_setPowerLimitEnable(void);
static void settings_displayPowerLimitEnable(void);
static void settings_setPowerLimit(void);
static void settings_displayPowerLimit(void);
static void settings_setDisplayRotation(void);
static void settings_displayDisplayRotation(void);
static void settings_setBoostModeEnabled(void);
@@ -87,6 +90,8 @@ static void settings_enterAdvancedMenu(void);
* Cooldown blink
*
* Advanced
* Enable Power Limit
* Power Limit
* Detailed IDLE
* Detailed Soldering
* Logo Time
@@ -174,13 +179,18 @@ const menuitem PowerMenu[] = {
const menuitem advancedMenu[] = {
/*
* Detailed IDLE
* Power limit enable
* Power limit
* Detailed IDLE
* Detailed Soldering
* Logo Time
* Calibrate Temperature
* Calibrate Input V
* Reset Settings
*/
{ (const char*) SettingsDescriptions[21], { settings_setPowerLimitEnable }, {
settings_displayPowerLimitEnable } }, /*Power limit enable*/
{ (const char*) SettingsDescriptions[22], { settings_setPowerLimit }, {
settings_displayPowerLimit } }, /*Power limit*/
{ (const char*) SettingsDescriptions[6], { settings_setAdvancedIDLEScreens }, {
settings_displayAdvancedIDLEScreens } }, /* Advanced idle screen*/
{ (const char*) SettingsDescriptions[15],
@@ -281,6 +291,8 @@ static int userConfirmation(const char *message) {
#ifdef MODEL_TS100
static void settings_setInputVRange(void) {
systemSettings.cutoutSetting = (systemSettings.cutoutSetting + 1) % 5;
if (systemSettings.cutoutSetting)
systemSettings.powerLimitEnable = 0; // disable power limit if switching to a lipo power source
}
static void settings_displayInputVRange(void) {
@@ -440,6 +452,37 @@ static void settings_displayAdvancedIDLEScreens(void) {
OLED::drawCheckbox(systemSettings.detailedIDLE);
}
static void settings_setPowerLimitEnable(void) {
systemSettings.powerLimitEnable = !systemSettings.powerLimitEnable;
}
static void settings_displayPowerLimitEnable(void) {
printShortDescription(21, 7);
OLED::drawCheckbox(systemSettings.powerLimitEnable);
}
static void settings_setPowerLimit(void) {
#ifdef MODEL_TS100
if (systemSettings.powerLimit >= 65)
systemSettings.powerLimit = 5;
else
systemSettings.powerLimit += 5;
#endif
#ifdef MODEL_TS80
if(systemSettings.powerLimit >= 30)
systemSettings.powerLimit = 2;
else
systemSettings.powerLimit += 2;
#endif
}
static void settings_displayPowerLimit(void) {
printShortDescription(22, 5);
OLED::printNumber(systemSettings.powerLimit, 2);
OLED::print(SymbolWatts);
}
static void settings_setScrollSpeed(void) {
if (systemSettings.descriptionScrollSpeed == 0)
systemSettings.descriptionScrollSpeed = 1;

View File

@@ -189,7 +189,11 @@ void startPIDTask(void const *argument __unused) {
lastPowerPulse = xTaskGetTickCount();
}
#endif
setTipX10Watts(x10WattsOut);
if (systemSettings.powerLimitEnable && x10WattsOut > (systemSettings.powerLimit * 10))
setTipX10Watts(systemSettings.powerLimit * 10);
else
setTipX10Watts(x10WattsOut);
HAL_IWDG_Refresh(&hiwdg);
} else {