1
0
forked from me/IronOS

Adding helper text & re-enable ts80 pulse

This commit is contained in:
Ben V. Brown
2019-06-18 18:03:26 +10:00
parent 9a2dc5c524
commit d5eee5f69b
2 changed files with 59 additions and 91 deletions

View File

@@ -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"))

View File

@@ -276,7 +276,7 @@ static void gui_drawBatteryIcon() {
// 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);
@@ -287,7 +287,7 @@ static void gui_drawBatteryIcon() {
// 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) {
@@ -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;
} }
@@ -939,7 +939,7 @@ void startPIDTask(void const *argument __unused) {
#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 second //Then wait until the next 0.5 seconds
if (xTaskGetTickCount() - lastPowerPulse > 100) { if (xTaskGetTickCount() - lastPowerPulse > 50) {
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