Collapse power limiter into one menu option

Work for #642
This commit is contained in:
Ben V. Brown
2020-09-06 15:31:23 +10:00
parent 5459d437e4
commit feec35be7a
33 changed files with 37 additions and 291 deletions

1
.gitignore vendored
View File

@@ -190,3 +190,4 @@ fabric.properties
.idea/httpRequests .idea/httpRequests
CoreCompileInputs.cache CoreCompileInputs.cache
.vscode/settings.json

View File

@@ -125,27 +125,6 @@ def getConstants():
return consants return consants
def getTipModelEnumTS80():
constants = []
constants.append("B02")
constants.append("D25")
constants.append("TS80") # end of miniware
constants.append("User") # User
return constants
def getTipModelEnumTS100():
constants = []
constants.append("B02")
constants.append("D24")
constants.append("BC2")
constants.append(" C1")
constants.append("TS100") # end of miniware
constants.append("BC2")
constants.append("Hakko") # end of hakko
constants.append("User")
return constants
def getDebugMenu(): def getDebugMenu():
constants = [] constants = []
@@ -207,8 +186,6 @@ def getLetterCounts(defs, lang):
constants = getConstants() constants = getConstants()
for x in constants: for x in constants:
textList.append(x[1]) textList.append(x[1])
textList.extend(getTipModelEnumTS100())
textList.extend(getTipModelEnumTS80())
textList.extend(getDebugMenu()) textList.extend(getDebugMenu())
# collapse all strings down into the composite letters and store totals for these # collapse all strings down into the composite letters and store totals for these
@@ -329,17 +306,19 @@ def writeLanguage(languageCode, defs, f):
f.write(to_unicode("const char* SettingsDescriptions[] = {\n")) f.write(to_unicode("const char* SettingsDescriptions[] = {\n"))
maxLen = 25 maxLen = 25
index =0
for mod in defs['menuOptions']: for mod in defs['menuOptions']:
eid = mod['id'] eid = mod['id']
if 'feature' in mod: if 'feature' in mod:
f.write(to_unicode("#ifdef " + mod['feature'] + "\n")) f.write(to_unicode("#ifdef " + mod['feature'] + "\n"))
f.write(to_unicode(" /* " + eid.ljust(maxLen)[:maxLen] + " */ ")) f.write(to_unicode(" /* ["+"{:02d}".format(index)+"] " + eid.ljust(maxLen)[:maxLen] + " */ "))
f.write( f.write(
to_unicode("\"" + to_unicode("\"" +
convStr(symbolConversionTable, (obj[eid]['desc'])) + convStr(symbolConversionTable, (obj[eid]['desc'])) +
"\"," + "//{} \n".format(obj[eid]['desc']))) "\"," + "//{} \n".format(obj[eid]['desc'])))
if 'feature' in mod: if 'feature' in mod:
f.write(to_unicode("#endif\n")) f.write(to_unicode("#endif\n"))
index=index+1
f.write(to_unicode("};\n\n")) f.write(to_unicode("};\n\n"))
@@ -381,20 +360,6 @@ def writeLanguage(languageCode, defs, f):
convStr(symbolConversionTable, x[1]) + "\";" + "//{} \n".format(x[1]))) convStr(symbolConversionTable, x[1]) + "\";" + "//{} \n".format(x[1])))
f.write(to_unicode("\n")) f.write(to_unicode("\n"))
# Write out tip model strings
f.write(to_unicode("const char* TipModelStrings[] = {\n"))
f.write(to_unicode("#ifdef MODEL_TS100\n"))
for c in getTipModelEnumTS100():
f.write(to_unicode("\t \"" + convStr(symbolConversionTable,
c) + "\"," + "//{} \n".format(c)))
f.write(to_unicode("#else\n"))
for c in getTipModelEnumTS80():
f.write(to_unicode("\t \"" + convStr(symbolConversionTable,
c) + "\"," + "//{} \n".format(c)))
f.write(to_unicode("#endif\n"))
f.write(to_unicode("};\n\n"))
# Debug Menu # Debug Menu
f.write(to_unicode("const char* DebugMenu[] = {\n")) f.write(to_unicode("const char* DebugMenu[] = {\n"))
@@ -417,11 +382,12 @@ def writeLanguage(languageCode, defs, f):
f.write(to_unicode("const char* SettingsShortNames[][2] = {\n")) f.write(to_unicode("const char* SettingsShortNames[][2] = {\n"))
maxLen = 25 maxLen = 25
index = 0
for mod in defs['menuOptions']: for mod in defs['menuOptions']:
eid = mod['id'] eid = mod['id']
if 'feature' in mod: if 'feature' in mod:
f.write(to_unicode("#ifdef " + mod['feature'] + "\n")) f.write(to_unicode("#ifdef " + mod['feature'] + "\n"))
f.write(to_unicode(" /* " + eid.ljust(maxLen)[:maxLen] + " */ ")) f.write(to_unicode(" /* ["+"{:02d}".format(index)+"] " + eid.ljust(maxLen)[:maxLen] + " */ "))
if lang['menuDouble']: if lang['menuDouble']:
f.write( f.write(
to_unicode( to_unicode(
@@ -437,6 +403,7 @@ def writeLanguage(languageCode, defs, f):
"\" }," + "//{} \n".format(obj[eid]['text']))) "\" }," + "//{} \n".format(obj[eid]['text'])))
if 'feature' in mod: if 'feature' in mod:
f.write(to_unicode("#endif\n")) f.write(to_unicode("#endif\n"))
index = index + 1
f.write(to_unicode("};\n\n")) f.write(to_unicode("};\n\n"))

View File

@@ -236,14 +236,6 @@
], ],
"desc": "Мощност на избраното захранване" "desc": "Мощност на избраното захранване"
}, },
"PowerLimitEnable": {
"text": "",
"text2": [
"Вкл. лимит",
"на мощност?"
],
"desc": "Включване на лимит на мощност"
},
"PowerLimit": { "PowerLimit": {
"text": "", "text": "",
"text2": [ "text2": [

View File

@@ -236,14 +236,6 @@
], ],
"desc": "Výkon použítého napájecího adaptéru ve wattech." "desc": "Výkon použítého napájecího adaptéru ve wattech."
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Omez. výk.",
"Aktivovat"
],
"desc": "Aktivovat omezení výkonu"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Power Wattage of the power adapter used" "desc": "Power Wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -237,14 +237,6 @@
], ],
"desc": "Leistungsaufnahme der verwendeten Spannungsversorgung" "desc": "Leistungsaufnahme der verwendeten Spannungsversorgung"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Leistungs-",
"Limit An"
],
"desc": "Leistungslimit aktivieren"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -237,14 +237,6 @@
], ],
"desc": "Power wattage of the power adapter used" "desc": "Power wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Enable power",
"limit"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -236,14 +236,6 @@
], ],
"desc": "Potencia en vatios del adaptador de corriente utilizado." "desc": "Potencia en vatios del adaptador de corriente utilizado."
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Limitar la",
"potenc. máx."
],
"desc": "Activa el límite de potencia máxima."
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Power Wattage of the power adapter used" "desc": "Power Wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Puissance de l'alimentation utilisée" "desc": "Puissance de l'alimentation utilisée"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Activer?"
],
"desc": "Activer la limite de puissance"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Snaga modula za napajanje" "desc": "Snaga modula za napajanje"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "A tápegység által leadott teljesítmény" "desc": "A tápegység által leadott teljesítmény"
}, },
"PowerLimitEnable": {
"text": "TELJH",
"text2": [
"Telj H",
"Bekapcsolva"
],
"desc": "Bemeneti teljesitmény korlátozása"
},
"PowerLimit": { "PowerLimit": {
"text": "TELJM", "text": "TELJM",
"text2": [ "text2": [

View File

@@ -236,14 +236,6 @@
], ],
"desc": "Imposta la potenza massima erogabile dall'alimentatore in uso" "desc": "Imposta la potenza massima erogabile dall'alimentatore in uso"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Limitatore",
"di potenza"
],
"desc": "Abilita un limitatore per la potenza massima erogabile al saldatore"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Maitinimo bloko galia vatais" "desc": "Maitinimo bloko galia vatais"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Power Wattage of the power adapter used" "desc": "Power Wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Vermogen van de adapter" "desc": "Vermogen van de adapter"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Power Wattage of the power adapter used" "desc": "Power Wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -237,14 +237,6 @@
], ],
"desc": "Moc używanego zasilacza w Wattach" "desc": "Moc używanego zasilacza w Wattach"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Włącz limit",
"mocy"
],
"desc": "Włącza limit mocy"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Potência da fonte usada (Watt)" "desc": "Potência da fonte usada (Watt)"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -236,14 +236,6 @@
], ],
"desc": "Мощность используемого источника питания" "desc": "Мощность используемого источника питания"
}, },
"PowerLimitEnable": {
"text": "ВклЛимW",
"text2": [
"Ограничение",
"мощности"
],
"desc": "Включить лимит потребляемой мощности"
},
"PowerLimit": { "PowerLimit": {
"text": "ЗначЛимW", "text": "ЗначЛимW",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Power Wattage of the power adapter used" "desc": "Power Wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -235,14 +235,6 @@
], ],
"desc": "Moč v W napajalnega vira" "desc": "Moč v W napajalnega vira"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Снага напајања у ватима." "desc": "Снага напајања у ватима."
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Snaga napajanja u vatima." "desc": "Snaga napajanja u vatima."
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Power Wattage of the power adapter used" "desc": "Power Wattage of the power adapter used"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -234,14 +234,6 @@
], ],
"desc": "Kullanılan adaptörün güç miktarı" "desc": "Kullanılan adaptörün güç miktarı"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"P Limit",
"Enable"
],
"desc": "Enable power limit"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

@@ -236,14 +236,6 @@
], ],
"desc": "Потужність джерела живлення в Ватах" "desc": "Потужність джерела живлення в Ватах"
}, },
"PowerLimitEnable": {
"text": "PLIMEN",
"text2": [
"Ліміт",
"потужності"
],
"desc": "Вмикає обмеження потужності споживання"
},
"PowerLimit": { "PowerLimit": {
"text": "PLIM", "text": "PLIM",
"text2": [ "text2": [

View File

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

View File

@@ -49,7 +49,6 @@ typedef struct {
uint16_t CalibrationOffset; // This stores the temperature offset for this tip uint16_t CalibrationOffset; // This stores the temperature offset for this tip
// in the iron. // in the iron.
uint8_t powerLimitEnable; // Allow toggling of power limit without changing value
uint8_t powerLimit; // Maximum power iron allowed to output uint8_t powerLimit; // Maximum power iron allowed to output
uint16_t TipGain; // uV/C * 10, it can be used to convert tip thermocouple voltage to temperateture TipV/TipGain = TipTemp uint16_t TipGain; // uV/C * 10, it can be used to convert tip thermocouple voltage to temperateture TipV/TipGain = TipTemp

View File

@@ -71,7 +71,6 @@ void resetSettings() {
systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0 systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0
#endif #endif
systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow 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.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV
systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit
systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; // systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; //

View File

@@ -42,8 +42,6 @@ static bool settings_setAdvancedIDLEScreens(void);
static void settings_displayAdvancedIDLEScreens(void); static void settings_displayAdvancedIDLEScreens(void);
static bool settings_setScrollSpeed(void); static bool settings_setScrollSpeed(void);
static void settings_displayScrollSpeed(void); static void settings_displayScrollSpeed(void);
static bool settings_setPowerLimitEnable(void);
static void settings_displayPowerLimitEnable(void);
static bool settings_setPowerLimit(void); static bool settings_setPowerLimit(void);
static void settings_displayPowerLimit(void); static void settings_displayPowerLimit(void);
static bool settings_setDisplayRotation(void); static bool settings_setDisplayRotation(void);
@@ -137,13 +135,11 @@ const menuitem rootSettingsMenu[] {
#endif #endif
{ (const char*) NULL, settings_enterSolderingMenu, { (const char*) NULL, settings_enterSolderingMenu,
settings_displaySolderingMenu }, /*Soldering*/ settings_displaySolderingMenu }, /*Soldering*/
{ (const char*) NULL, settings_enterPowerMenu, { (const char*) NULL, settings_enterPowerMenu, settings_displayPowerMenu }, /*Sleep Options Menu*/
settings_displayPowerMenu }, /*Sleep Options Menu*/ { (const char*) NULL, settings_enterUIMenu, settings_displayUIMenu }, /*UI Menu*/
{ (const char*) NULL, settings_enterUIMenu,
settings_displayUIMenu }, /*UI Menu*/
{ (const char*) NULL, settings_enterAdvancedMenu, { (const char*) NULL, settings_enterAdvancedMenu,
settings_displayAdvancedMenu }, /*Advanced Menu*/ settings_displayAdvancedMenu }, /*Advanced Menu*/
{ NULL, NULL , NULL } // end of menu marker. DO NOT REMOVE { NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE
}; };
const menuitem solderingMenu[] = { const menuitem solderingMenu[] = {
@@ -160,9 +156,9 @@ const menuitem solderingMenu[] = {
settings_displayBoostTemp }, /*Boost Temp*/ settings_displayBoostTemp }, /*Boost Temp*/
{ (const char*) SettingsDescriptions[10], settings_setAutomaticStartMode, { (const char*) SettingsDescriptions[10], settings_setAutomaticStartMode,
settings_displayAutomaticStartMode }, /*Auto start*/ settings_displayAutomaticStartMode }, /*Auto start*/
{ (const char*) SettingsDescriptions[24], settings_setTempChangeShortStep, { (const char*) SettingsDescriptions[23], settings_setTempChangeShortStep,
settings_displayTempChangeShortStep }, /*Temp change short step*/ settings_displayTempChangeShortStep }, /*Temp change short step*/
{ (const char*) SettingsDescriptions[25], settings_setTempChangeLongStep, { (const char*) SettingsDescriptions[24], settings_setTempChangeLongStep,
settings_displayTempChangeLongStep }, /*Temp change long step*/ settings_displayTempChangeLongStep }, /*Temp change long step*/
{ NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE { NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE
}; };
@@ -179,15 +175,14 @@ const menuitem UIMenu[] = {
{ (const char*) SettingsDescriptions[5], settings_setTempF, { (const char*) SettingsDescriptions[5], settings_setTempF,
settings_displayTempF }, /* Temperature units*/ settings_displayTempF }, /* Temperature units*/
#endif #endif
{ (const char*) SettingsDescriptions[7], { (const char*) SettingsDescriptions[7], settings_setDisplayRotation,
settings_setDisplayRotation, settings_displayDisplayRotation }, /*Display Rotation*/
settings_displayDisplayRotation }, /*Display Rotation*/
{ (const char*) SettingsDescriptions[11], { (const char*) SettingsDescriptions[11],
settings_setCoolingBlinkEnabled, settings_setCoolingBlinkEnabled,
settings_displayCoolingBlinkEnabled }, /*Cooling blink warning*/ settings_displayCoolingBlinkEnabled }, /*Cooling blink warning*/
{ (const char*) SettingsDescriptions[16], settings_setScrollSpeed, { (const char*) SettingsDescriptions[16], settings_setScrollSpeed,
settings_displayScrollSpeed }, /*Scroll Speed for descriptions*/ settings_displayScrollSpeed }, /*Scroll Speed for descriptions*/
{ (const char*) SettingsDescriptions[23], { (const char*) SettingsDescriptions[22],
settings_setReverseButtonTempChangeEnabled, settings_setReverseButtonTempChangeEnabled,
settings_displayReverseButtonTempChangeEnabled }, /* Reverse Temp change buttons + - */ settings_displayReverseButtonTempChangeEnabled }, /* Reverse Temp change buttons + - */
{ NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE { NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE
@@ -212,7 +207,6 @@ const menuitem PowerMenu[] = {
const menuitem advancedMenu[] = { const menuitem advancedMenu[] = {
/* /*
* Power limit enable
* Power limit * Power limit
* Detailed IDLE * Detailed IDLE
* Detailed Soldering * Detailed Soldering
@@ -221,24 +215,21 @@ const menuitem advancedMenu[] = {
* Reset Settings * Reset Settings
* Power Pulse * Power Pulse
*/ */
{ (const char*) SettingsDescriptions[21], settings_setPowerLimitEnable, { (const char*) SettingsDescriptions[21], settings_setPowerLimit,
settings_displayPowerLimitEnable }, /*Power limit enable*/
{ (const char*) SettingsDescriptions[22], settings_setPowerLimit,
settings_displayPowerLimit }, /*Power limit*/ settings_displayPowerLimit }, /*Power limit*/
{ (const char*) SettingsDescriptions[6], settings_setAdvancedIDLEScreens, { (const char*) SettingsDescriptions[6], settings_setAdvancedIDLEScreens,
settings_displayAdvancedIDLEScreens }, /* Advanced idle screen*/ settings_displayAdvancedIDLEScreens }, /* Advanced idle screen*/
{ (const char*) SettingsDescriptions[15], { (const char*) SettingsDescriptions[15], settings_setAdvancedSolderingScreens,
settings_setAdvancedSolderingScreens, settings_displayAdvancedSolderingScreens }, /* Advanced soldering screen*/
settings_displayAdvancedSolderingScreens }, /* Advanced soldering screen*/
{ (const char*) SettingsDescriptions[13], settings_setResetSettings, { (const char*) SettingsDescriptions[13], settings_setResetSettings,
settings_displayResetSettings }, /*Resets settings*/ settings_displayResetSettings }, /*Resets settings*/
{ (const char*) SettingsDescriptions[12], settings_setCalibrate, { (const char*) SettingsDescriptions[12], settings_setCalibrate,
settings_displayCalibrate }, /*Calibrate tip*/ settings_displayCalibrate }, /*Calibrate tip*/
{ (const char*) SettingsDescriptions[14], settings_setCalibrateVIN, { (const char*) SettingsDescriptions[14], settings_setCalibrateVIN,
settings_displayCalibrateVIN }, /*Voltage input cal*/ settings_displayCalibrateVIN }, /*Voltage input cal*/
{ (const char*) SettingsDescriptions[26], settings_setPowerPulse, { (const char*) SettingsDescriptions[25], settings_setPowerPulse,
settings_displayPowerPulse }, /*Power Pulse adjustment */ settings_displayPowerPulse }, /*Power Pulse adjustment */
{ (const char*) SettingsDescriptions[27], settings_setTipGain, { (const char*) SettingsDescriptions[26], settings_setTipGain,
settings_displayTipGain }, /*TipGain*/ settings_displayTipGain }, /*TipGain*/
{ NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE { NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE
}; };
@@ -332,7 +323,7 @@ static int userConfirmation(const char *message) {
static bool settings_setInputVRange(void) { static bool settings_setInputVRange(void) {
systemSettings.cutoutSetting = (systemSettings.cutoutSetting + 1) % 5; systemSettings.cutoutSetting = (systemSettings.cutoutSetting + 1) % 5;
if (systemSettings.cutoutSetting) if (systemSettings.cutoutSetting)
systemSettings.powerLimitEnable = 0; // disable power limit if switching to a lipo power source systemSettings.powerLimit = 0; // disable power limit if switching to a lipo power source
return systemSettings.cutoutSetting == 4; return systemSettings.cutoutSetting == 4;
} }
@@ -506,27 +497,21 @@ static void settings_displayAdvancedIDLEScreens(void) {
OLED::drawCheckbox(systemSettings.detailedIDLE); OLED::drawCheckbox(systemSettings.detailedIDLE);
} }
static bool settings_setPowerLimitEnable(void) {
systemSettings.powerLimitEnable = !systemSettings.powerLimitEnable;
return false;
}
static void settings_displayPowerLimitEnable(void) {
printShortDescription(21, 7);
OLED::drawCheckbox(systemSettings.powerLimitEnable);
}
static bool settings_setPowerLimit(void) { static bool settings_setPowerLimit(void) {
systemSettings.powerLimit += POWER_LIMIT_STEPS; systemSettings.powerLimit += POWER_LIMIT_STEPS;
if (systemSettings.powerLimit > MAX_POWER_LIMIT) if (systemSettings.powerLimit > MAX_POWER_LIMIT)
systemSettings.powerLimit = POWER_LIMIT_STEPS; systemSettings.powerLimit = 0;
return systemSettings.powerLimit + POWER_LIMIT_STEPS > MAX_POWER_LIMIT; return systemSettings.powerLimit + POWER_LIMIT_STEPS > MAX_POWER_LIMIT;
} }
static void settings_displayPowerLimit(void) { static void settings_displayPowerLimit(void) {
printShortDescription(22, 5); printShortDescription(21, 5);
OLED::printNumber(systemSettings.powerLimit, 2); if (systemSettings.powerLimit == 0) {
OLED::print(SymbolWatts); OLED::print(OffString);
} else {
OLED::printNumber(systemSettings.powerLimit, 2);
OLED::print(SymbolWatts);
}
} }
static bool settings_setScrollSpeed(void) { static bool settings_setScrollSpeed(void) {
@@ -824,7 +809,7 @@ static bool settings_setTipGain(void) {
} }
static void settings_displayTipGain(void) { static void settings_displayTipGain(void) {
printShortDescription(27, 5); printShortDescription(26, 5);
} }
static bool settings_setReverseButtonTempChangeEnabled(void) { static bool settings_setReverseButtonTempChangeEnabled(void) {
@@ -834,7 +819,7 @@ static bool settings_setReverseButtonTempChangeEnabled(void) {
} }
static void settings_displayReverseButtonTempChangeEnabled(void) { static void settings_displayReverseButtonTempChangeEnabled(void) {
printShortDescription(23, 7); printShortDescription(22, 7);
OLED::drawCheckbox(systemSettings.ReverseButtonTempChangeEnabled); OLED::drawCheckbox(systemSettings.ReverseButtonTempChangeEnabled);
} }
@@ -847,7 +832,7 @@ static bool settings_setTempChangeShortStep(void) {
} }
static void settings_displayTempChangeShortStep(void) { static void settings_displayTempChangeShortStep(void) {
printShortDescription(24, 6); printShortDescription(23, 6);
OLED::printNumber(systemSettings.TempChangeShortStep, 2); OLED::printNumber(systemSettings.TempChangeShortStep, 2);
} }
@@ -860,7 +845,7 @@ static bool settings_setTempChangeLongStep(void) {
} }
static void settings_displayTempChangeLongStep(void) { static void settings_displayTempChangeLongStep(void) {
printShortDescription(25, 6); printShortDescription(24, 6);
OLED::printNumber(systemSettings.TempChangeLongStep, 2); OLED::printNumber(systemSettings.TempChangeLongStep, 2);
} }
@@ -871,7 +856,7 @@ static bool settings_setPowerPulse(void) {
return systemSettings.KeepAwakePulse == POWER_PULSE_MAX - 1; return systemSettings.KeepAwakePulse == POWER_PULSE_MAX - 1;
} }
static void settings_displayPowerPulse(void) { static void settings_displayPowerPulse(void) {
printShortDescription(26, 5); printShortDescription(25, 5);
if (systemSettings.KeepAwakePulse) { if (systemSettings.KeepAwakePulse) {
OLED::printNumber(systemSettings.KeepAwakePulse / 10, 1); OLED::printNumber(systemSettings.KeepAwakePulse / 10, 1);
OLED::print(SymbolDot); OLED::print(SymbolDot);
@@ -1042,7 +1027,8 @@ void gui_Menu(const menuitem *menu) {
descriptionStart = 0; descriptionStart = 0;
break; break;
case BUTTON_F_LONG: case BUTTON_F_LONG:
if ((int)(xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration) > if ((int) (xTaskGetTickCount() - autoRepeatTimer
+ autoRepeatAcceleration) >
PRESS_ACCEL_INTERVAL_MAX) { PRESS_ACCEL_INTERVAL_MAX) {
if ((lastValue = menu[currentScreen].incrementHandler())) if ((lastValue = menu[currentScreen].incrementHandler()))
autoRepeatTimer = 1000; autoRepeatTimer = 1000;

View File

@@ -112,7 +112,7 @@ void startPIDTask(void const *argument __unused) {
if (getTipRawTemp(0) > (0x7FFF - 150)) { if (getTipRawTemp(0) > (0x7FFF - 150)) {
x10WattsOut = 0; x10WattsOut = 0;
} }
if (systemSettings.powerLimitEnable if (systemSettings.powerLimit
&& x10WattsOut > (systemSettings.powerLimit * 10)) { && x10WattsOut > (systemSettings.powerLimit * 10)) {
setTipX10Watts(systemSettings.powerLimit * 10); setTipX10Watts(systemSettings.powerLimit * 10);
} else { } else {

View File

@@ -80,7 +80,6 @@
#define CUT_OUT_SETTING 0 // default to no cut-off voltage (or 18W for TS80) #define CUT_OUT_SETTING 0 // default to no cut-off voltage (or 18W for TS80)
#define TEMPERATURE_INF 0 // default to 0 #define TEMPERATURE_INF 0 // default to 0
#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow #define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow
#define POWER_LIMIT_ENABLE 0 // 0: Disable 1: Enable - Default disabled power limit
#define TIP_GAIN 210 // 21 uV/C * 10, uV per deg C constant of the tip, Tip uV * 10 / coeff = tip temp #define TIP_GAIN 210 // 21 uV/C * 10, uV per deg C constant of the tip, Tip uV * 10 / coeff = tip temp