Adding helper text & re-enable ts80 pulse
This commit is contained in:
@@ -273,13 +273,6 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
|
|
||||||
f.write(to_unicode("// ---- " + langName + " ----\n\n"))
|
f.write(to_unicode("// ---- " + langName + " ----\n\n"))
|
||||||
|
|
||||||
try:
|
|
||||||
cyrillic = lang['cyrillicGlyphs']
|
|
||||||
except KeyError:
|
|
||||||
cyrillic = False
|
|
||||||
|
|
||||||
if cyrillic:
|
|
||||||
f.write(to_unicode("#define CYRILLIC_GLYPHS\n\n"))
|
|
||||||
|
|
||||||
# ----- Writing SettingsDescriptions
|
# ----- Writing SettingsDescriptions
|
||||||
obj = lang['menuOptions']
|
obj = lang['menuOptions']
|
||||||
@@ -294,7 +287,7 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
f.write(
|
f.write(
|
||||||
to_unicode("\"" +
|
to_unicode("\"" +
|
||||||
convStr(symbolConversionTable, (obj[eid]['desc'])) +
|
convStr(symbolConversionTable, (obj[eid]['desc'])) +
|
||||||
"\",\n"))
|
"\"," + "//{} \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"))
|
||||||
|
|
||||||
@@ -309,11 +302,11 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
if eid not in obj:
|
if eid not in obj:
|
||||||
f.write(
|
f.write(
|
||||||
to_unicode("const char* " + eid + " = \"" +
|
to_unicode("const char* " + eid + " = \"" +
|
||||||
convStr(symbolConversionTable, (mod['default'])) + "\";\n"))
|
convStr(symbolConversionTable, (mod['default'])) + "\";"+ "//{} \n".format(mod['default'])))
|
||||||
else:
|
else:
|
||||||
f.write(
|
f.write(
|
||||||
to_unicode("const char* " + eid + " = \"" +
|
to_unicode("const char* " + eid + " = \"" +
|
||||||
convStr(symbolConversionTable, (obj[eid])) + "\";\n"))
|
convStr(symbolConversionTable, (obj[eid])) + "\";"+ "//{} \n".format(obj[eid])))
|
||||||
|
|
||||||
f.write(to_unicode("\n"))
|
f.write(to_unicode("\n"))
|
||||||
|
|
||||||
@@ -325,7 +318,7 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
eid = mod['id']
|
eid = mod['id']
|
||||||
f.write(
|
f.write(
|
||||||
to_unicode("const char* " + eid + " = \"" +
|
to_unicode("const char* " + eid + " = \"" +
|
||||||
convStr(symbolConversionTable, obj[eid]) + "\";\n"))
|
convStr(symbolConversionTable, obj[eid]) + "\";"+ "//{} \n".format(obj[eid])))
|
||||||
|
|
||||||
f.write(to_unicode("\n"))
|
f.write(to_unicode("\n"))
|
||||||
|
|
||||||
@@ -334,7 +327,7 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
for x in constants:
|
for x in constants:
|
||||||
f.write(
|
f.write(
|
||||||
to_unicode("const char* " + x[0] + " = \"" +
|
to_unicode("const char* " + x[0] + " = \"" +
|
||||||
convStr(symbolConversionTable, x[1]) + "\";\n"))
|
convStr(symbolConversionTable, x[1]) + "\";"+ "//{} \n".format(x[1])))
|
||||||
|
|
||||||
f.write(to_unicode("\n"))
|
f.write(to_unicode("\n"))
|
||||||
# Write out tip model strings
|
# Write out tip model strings
|
||||||
@@ -342,10 +335,10 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
f.write(to_unicode("const char* TipModelStrings[] = {\n"))
|
f.write(to_unicode("const char* TipModelStrings[] = {\n"))
|
||||||
f.write(to_unicode("#ifdef MODEL_TS100\n"))
|
f.write(to_unicode("#ifdef MODEL_TS100\n"))
|
||||||
for c in getTipModelEnumTS100():
|
for c in getTipModelEnumTS100():
|
||||||
f.write(to_unicode("\t \"" + convStr(symbolConversionTable, c) + "\",\n"))
|
f.write(to_unicode("\t \"" + convStr(symbolConversionTable, c) + "\","+ "//{} \n".format(c)))
|
||||||
f.write(to_unicode("#else\n"))
|
f.write(to_unicode("#else\n"))
|
||||||
for c in getTipModelEnumTS80():
|
for c in getTipModelEnumTS80():
|
||||||
f.write(to_unicode("\t \"" + convStr(symbolConversionTable, c) + "\",\n"))
|
f.write(to_unicode("\t \"" + convStr(symbolConversionTable, c) + "\","+ "//{} \n".format(c)))
|
||||||
f.write(to_unicode("#endif\n"))
|
f.write(to_unicode("#endif\n"))
|
||||||
|
|
||||||
f.write(to_unicode("};\n\n"))
|
f.write(to_unicode("};\n\n"))
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ int main(void) {
|
|||||||
#ifdef LOCAL_BUILD
|
#ifdef LOCAL_BUILD
|
||||||
//Test that there was enough ram in the FreeRToS pool to allocate all the tasks
|
//Test that there was enough ram in the FreeRToS pool to allocate all the tasks
|
||||||
if (MOVTaskHandle == 0)
|
if (MOVTaskHandle == 0)
|
||||||
asm("bkpt");
|
asm("bkpt");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -271,36 +271,36 @@ static void gui_drawBatteryIcon() {
|
|||||||
// we need to calculate which of the 10 levels they are on
|
// we need to calculate which of the 10 levels they are on
|
||||||
uint8_t cellCount = systemSettings.cutoutSetting + 2;
|
uint8_t cellCount = systemSettings.cutoutSetting + 2;
|
||||||
uint32_t cellV = getInputVoltageX10(systemSettings.voltageDiv, 0)
|
uint32_t cellV = getInputVoltageX10(systemSettings.voltageDiv, 0)
|
||||||
/ cellCount;
|
/ cellCount;
|
||||||
// Should give us approx cell voltage X10
|
// Should give us approx cell voltage X10
|
||||||
// Range is 42 -> 33 = 9 steps therefore we will use battery 1-10
|
// Range is 42 -> 33 = 9 steps therefore we will use battery 1-10
|
||||||
if (cellV < 33)
|
if (cellV < 33)
|
||||||
cellV = 33;
|
cellV = 33;
|
||||||
cellV -= 33; // Should leave us a number of 0-9
|
cellV -= 33;// Should leave us a number of 0-9
|
||||||
if (cellV > 9)
|
if (cellV > 9)
|
||||||
cellV = 9;
|
cellV = 9;
|
||||||
OLED::drawBattery(cellV + 1);
|
OLED::drawBattery(cellV + 1);
|
||||||
} else
|
} else
|
||||||
OLED::drawSymbol(15); // Draw the DC Logo
|
OLED::drawSymbol(15); // Draw the DC Logo
|
||||||
#else
|
#else
|
||||||
// On TS80 we replace this symbol with the voltage we are operating on
|
// On TS80 we replace this symbol with the voltage we are operating on
|
||||||
// If <9V then show single digit, if not show duals
|
// If <9V then show single digit, if not show duals
|
||||||
uint8_t V = getInputVoltageX10(systemSettings.voltageDiv, 0);
|
uint8_t V = getInputVoltageX10(systemSettings.voltageDiv, 0);
|
||||||
if (V % 10 >= 5)
|
if (V % 10 >= 5)
|
||||||
V = V / 10 + 1;// round up
|
V = V / 10 + 1; // round up
|
||||||
else
|
else
|
||||||
V = V / 10;
|
V = V / 10;
|
||||||
if (V >= 10) {
|
if (V >= 10) {
|
||||||
int16_t xPos = OLED::getCursorX();
|
int16_t xPos = OLED::getCursorX();
|
||||||
OLED::setFont(1);
|
OLED::setFont(1);
|
||||||
OLED::printNumber(1, 1);
|
OLED::printNumber(1, 1);
|
||||||
OLED::setCursor(xPos, 8);
|
OLED::setCursor(xPos, 8);
|
||||||
OLED::printNumber(V % 10, 1);
|
OLED::printNumber(V % 10, 1);
|
||||||
OLED::setFont(0);
|
OLED::setFont(0);
|
||||||
OLED::setCursor(xPos + 12, 0); // need to reset this as if we drew a wide char
|
OLED::setCursor(xPos + 12, 0); // need to reset this as if we drew a wide char
|
||||||
} else {
|
} else {
|
||||||
OLED::printNumber(V, 1);
|
OLED::printNumber(V, 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static void gui_solderingTempAdjust() {
|
static void gui_solderingTempAdjust() {
|
||||||
@@ -372,7 +372,7 @@ static void gui_solderingTempAdjust() {
|
|||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
if (!OLED::getRotation())
|
if (!OLED::getRotation())
|
||||||
#else
|
#else
|
||||||
if (OLED::getRotation())
|
if (OLED::getRotation())
|
||||||
#endif
|
#endif
|
||||||
OLED::print(SymbolMinus);
|
OLED::print(SymbolMinus);
|
||||||
else
|
else
|
||||||
@@ -388,7 +388,7 @@ static void gui_solderingTempAdjust() {
|
|||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
if (!OLED::getRotation())
|
if (!OLED::getRotation())
|
||||||
#else
|
#else
|
||||||
if (OLED::getRotation())
|
if (OLED::getRotation())
|
||||||
#endif
|
#endif
|
||||||
OLED::print(SymbolPlus);
|
OLED::print(SymbolPlus);
|
||||||
else
|
else
|
||||||
@@ -415,7 +415,7 @@ static int gui_SolderingSleepingMode() {
|
|||||||
|| (xTaskGetTickCount() - lastButtonTime < 100))
|
|| (xTaskGetTickCount() - lastButtonTime < 100))
|
||||||
return 0; // user moved or pressed a button, go back to soldering
|
return 0; // user moved or pressed a button, go back to soldering
|
||||||
#ifdef MODEL_TS100
|
#ifdef MODEL_TS100
|
||||||
if (checkVoltageForExit())
|
if (checkVoltageForExit())
|
||||||
return 1; // return non-zero on error
|
return 1; // return non-zero on error
|
||||||
#endif
|
#endif
|
||||||
if (systemSettings.temperatureInF) {
|
if (systemSettings.temperatureInF) {
|
||||||
@@ -556,7 +556,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
|
|||||||
OLED::setFont(0);
|
OLED::setFont(0);
|
||||||
uint16_t tipTemp = getTipRawTemp(0);
|
uint16_t tipTemp = getTipRawTemp(0);
|
||||||
if (tipTemp > 32700) {
|
if (tipTemp > 32700) {
|
||||||
badTipCounter++;// Use a counter so that error has to persist for > 1 second continious so that peak errors dont trip it
|
badTipCounter++; // Use a counter so that error has to persist for > 1 second continious so that peak errors dont trip it
|
||||||
} else {
|
} else {
|
||||||
badTipCounter = 0;
|
badTipCounter = 0;
|
||||||
}
|
}
|
||||||
@@ -683,7 +683,7 @@ __DATE__, "Heap: ", "HWMG: ", "HWMP: ", "HWMM: ", "Time: ", "Move: ", "RTip: ",
|
|||||||
"Tm ", "Ralim-",
|
"Tm ", "Ralim-",
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void showVersion(void) {
|
void showVersion(void) {
|
||||||
uint8_t screen = 0;
|
uint8_t screen = 0;
|
||||||
@@ -693,9 +693,9 @@ void showVersion(void) {
|
|||||||
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
|
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
|
||||||
OLED::setFont(1); // small font
|
OLED::setFont(1); // small font
|
||||||
#ifdef MODEL_TS100
|
#ifdef MODEL_TS100
|
||||||
OLED::print(SymbolVersionNumber); // Print version number
|
|
||||||
#else
|
|
||||||
OLED::print(SymbolVersionNumber); // Print version number
|
OLED::print(SymbolVersionNumber); // Print version number
|
||||||
|
#else
|
||||||
|
OLED::print(SymbolVersionNumber); // Print version number
|
||||||
#endif
|
#endif
|
||||||
OLED::setCursor(0, 8); // second line
|
OLED::setCursor(0, 8); // second line
|
||||||
OLED::print(HEADERS[screen]);
|
OLED::print(HEADERS[screen]);
|
||||||
@@ -882,7 +882,7 @@ void startGUITask(void const *argument __unused) {
|
|||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
if (!OLED::getRotation()) {
|
if (!OLED::getRotation()) {
|
||||||
#else
|
#else
|
||||||
if (OLED::getRotation()) {
|
if (OLED::getRotation()) {
|
||||||
#endif
|
#endif
|
||||||
OLED::drawArea(12, 0, 84, 16, idleScreenBG);
|
OLED::drawArea(12, 0, 84, 16, idleScreenBG);
|
||||||
OLED::setCursor(0, 0);
|
OLED::setCursor(0, 0);
|
||||||
@@ -903,7 +903,7 @@ void startGUITask(void const *argument __unused) {
|
|||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
if (!OLED::getRotation()) {
|
if (!OLED::getRotation()) {
|
||||||
#else
|
#else
|
||||||
if (OLED::getRotation()) {
|
if (OLED::getRotation()) {
|
||||||
#endif
|
#endif
|
||||||
// in right handed mode we want to draw over the first part
|
// in right handed mode we want to draw over the first part
|
||||||
OLED::fillArea(55, 0, 41, 16, 0); // clear the area for the temp
|
OLED::fillArea(55, 0, 41, 16, 0); // clear the area for the temp
|
||||||
@@ -932,14 +932,14 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
*/
|
*/
|
||||||
setTipMilliWatts(0); // disable the output driver if the output is set to be off
|
setTipMilliWatts(0); // disable the output driver if the output is set to be off
|
||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
idealQCVoltage = calculateMaxVoltage(systemSettings.cutoutSetting);
|
idealQCVoltage = calculateMaxVoltage(systemSettings.cutoutSetting);
|
||||||
#endif
|
#endif
|
||||||
uint8_t rawC = ctoTipMeasurement(101) - ctoTipMeasurement(100); // 1*C change in raw.
|
uint8_t rawC = ctoTipMeasurement(101) - ctoTipMeasurement(100); // 1*C change in raw.
|
||||||
|
|
||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
//Set power management code to the tip resistance in ohms * 10
|
//Set power management code to the tip resistance in ohms * 10
|
||||||
setupPower(calculateTipR() / 100);
|
setupPower(calculateTipR() / 100);
|
||||||
//size_t lastPowerPulse = 0;
|
TickType_t lastPowerPulse = 0;
|
||||||
#else
|
#else
|
||||||
setupPower(85);
|
setupPower(85);
|
||||||
|
|
||||||
@@ -1013,18 +1013,16 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
|
|
||||||
#ifdef MODEL_TS80
|
#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 its a TS80, we want to have the option of using an occasional pulse to keep the power bank on
|
||||||
//~200ms @ a low wattage
|
// This is purely guesswork :'( as everyone implements stuff differently
|
||||||
//Doesnt keep all power banks awake but helps with some
|
if (xTaskGetTickCount() - lastPowerPulse < 10) {
|
||||||
/*if (xTaskGetTickCount() - lastPowerPulse < 20) {
|
// for the first 100mS turn on for a bit
|
||||||
// for the first 200mS turn on for a bit
|
setTipMilliWatts(5000); // typically its around 5W to hold the current temp, so this wont raise temp much
|
||||||
setTipMilliWatts(4000); // typically its around 5W to hold the current temp, so this wont raise temp much
|
} else
|
||||||
} else
|
setTipMilliWatts(0);
|
||||||
setTipMilliWatts(0);
|
//Then wait until the next 0.5 seconds
|
||||||
//Then wait until the next second
|
if (xTaskGetTickCount() - lastPowerPulse > 50) {
|
||||||
if (xTaskGetTickCount() - lastPowerPulse > 100) {
|
lastPowerPulse = xTaskGetTickCount();
|
||||||
lastPowerPulse = xTaskGetTickCount();
|
}
|
||||||
}*/
|
|
||||||
setTipMilliWatts(0);
|
|
||||||
#else
|
#else
|
||||||
setTipMilliWatts(0);
|
setTipMilliWatts(0);
|
||||||
#endif
|
#endif
|
||||||
@@ -1048,9 +1046,9 @@ void startMOVTask(void const *argument __unused) {
|
|||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
startQC(systemSettings.voltageDiv);
|
startQC(systemSettings.voltageDiv);
|
||||||
while (pidTaskNotification == 0)
|
while (pidTaskNotification == 0)
|
||||||
osDelay(20); // To ensure we return after idealQCVoltage/tip resistance
|
osDelay(30); // To ensure we return after idealQCVoltage/tip resistance
|
||||||
|
|
||||||
seekQC(idealQCVoltage, systemSettings.voltageDiv);// this will move the QC output to the preferred voltage to start with
|
seekQC(idealQCVoltage, systemSettings.voltageDiv); // this will move the QC output to the preferred voltage to start with
|
||||||
|
|
||||||
#else
|
#else
|
||||||
osDelay(250); // wait for accelerometer to stabilize
|
osDelay(250); // wait for accelerometer to stabilize
|
||||||
@@ -1103,29 +1101,6 @@ void startMOVTask(void const *argument __unused) {
|
|||||||
|
|
||||||
// Sum the deltas
|
// Sum the deltas
|
||||||
int32_t error = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz));
|
int32_t error = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz));
|
||||||
|
|
||||||
#if ACCELDEBUG
|
|
||||||
// Debug for Accel
|
|
||||||
|
|
||||||
OLED::setFont(1);
|
|
||||||
OLED::setCursor(0, 0);
|
|
||||||
OLED::printNumber(abs(avgx - (int32_t)tx), 5);
|
|
||||||
OLED::print(" ");
|
|
||||||
OLED::printNumber(abs(avgy - (int32_t)ty), 5);
|
|
||||||
if (error > max) {
|
|
||||||
max = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz));
|
|
||||||
}
|
|
||||||
OLED::setCursor(0, 8);
|
|
||||||
OLED::printNumber(max, 5);
|
|
||||||
OLED::print(" ");
|
|
||||||
|
|
||||||
OLED::printNumber((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)), 5);
|
|
||||||
OLED::refresh();
|
|
||||||
if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET) {
|
|
||||||
max = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// So now we have averages, we want to look if these are different by more
|
// So now we have averages, we want to look if these are different by more
|
||||||
// than the threshold
|
// than the threshold
|
||||||
|
|
||||||
@@ -1136,9 +1111,9 @@ void startMOVTask(void const *argument __unused) {
|
|||||||
|
|
||||||
osDelay(100); // Slow down update rate
|
osDelay(100); // Slow down update rate
|
||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
if (currentlyActiveTemperatureTarget) {
|
if (currentlyActiveTemperatureTarget) {
|
||||||
seekQC(idealQCVoltage, systemSettings.voltageDiv); // Run the QC seek again to try and compensate for cable V drop
|
seekQC(idealQCVoltage, systemSettings.voltageDiv); // Run the QC seek again to try and compensate for cable V drop
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user