Merge remote-tracking branch 'upstream/master' into watts

This commit is contained in:
David P Hilton
2018-10-29 07:34:22 -06:00
9 changed files with 1056 additions and 709 deletions

View File

@@ -0,0 +1,232 @@
{
"languageCode": "NL_BE",
"languageLocalName": "Vlaams",
"messages": {
"SettingsCalibrationDone": "Gecalibreerd!",
"SettingsCalibrationWarning": "Zorg vooraf dat de punt op kamertemperatuur is!",
"SettingsResetWarning": "Ben je zeker dat je alle standaardwaarden wil resetten?",
"UVLOWarningString": "Voedingsspanning LAAG",
"UndervoltageString": "Onderspanning",
"InputVoltageString": "Voedingsspanning: ",
"WarningTipTempString": "Punt Temp: ",
"BadTipString": "DEFECT",
"SleepingSimpleString": "Zzz ",
"SleepingAdvancedString": "Slaapstand...",
"WarningSimpleString": "HEET",
"WarningAdvancedString": "!!! PUNT HEET !!!",
"SleepingTipAdvancedString": "Punt:",
"IdleTipString": "Punt:",
"IdleSetString": "Stel in:",
"TipDisconnectedString": "Punt ONTKOPPELD",
"SolderingAdvancedPowerPrompt": "Vermogen: ",
"OffString": "Uit"
},
"characters": {
"SettingRightChar": "R",
"SettingLeftChar": "L",
"SettingAutoChar": "A",
"SettingFastChar": "S",
"SettingSlowChar": "T"
},
"menuGroups": {
"SolderingMenu": {
"text2": [
"Soldeer",
"Instellingen"
],
"desc": "Soldeerinstellingen"
},
"PowerSavingMenu": {
"text2": [
"Slaap",
"standen"
],
"desc": "Batterijspaarstanden"
},
"UIMenu": {
"text2": [
"Gebruikers-",
"Interface"
],
"desc": "Gebruikersinterface Instellingen"
},
"AdvancedMenu": {
"text2": [
"Gevorderde",
"Instellingen"
],
"desc": "Gevorderde Instellingen"
}
},
"menuDouble": true,
"menuOptions": {
"PowerSource": {
"text": "",
"text2": [
"Spannings-",
"bron"
],
"desc": "Spanningsbron. Stelt minimumspanning in. <DC 10V> <S 3.3V per cel>"
},
"SleepTemperature": {
"text": "",
"text2": [
"Slaap",
"temp"
],
"desc": "Temperatuur in slaapstand <°C>"
},
"SleepTimeout": {
"text": "",
"text2": [
"Slaap",
"time-out"
],
"desc": "Slaapstand time-out <Minuten/Seconden>"
},
"ShutdownTimeout": {
"text": "",
"text2": [
"Uitschakel",
"time-out"
],
"desc": "Automatisch afsluiten time-out <Minuten>"
},
"MotionSensitivity": {
"text": "",
"text2": [
"Bewegings-",
"gevoeligheid"
],
"desc": "Bewegingsgevoeligheid <0.uit 1.minst gevoelig 9.meest gevoelig>"
},
"TemperatureUnit": {
"text": "",
"text2": [
"Temperatuur",
"schaal"
],
"desc": "Temperatuurschaal <°C=Celsius °F=Fahrenheit>"
},
"AdvancedIdle": {
"text": "",
"text2": [
"Gedetailleerd",
"slaapscherm"
],
"desc": "Gedetailleerde informatie in een kleiner lettertype in het slaapscherm."
},
"DisplayRotation": {
"text": "",
"text2": [
"Scherm-",
"oriëntatie"
],
"desc": "Schermoriëntatie <A. Automatisch L. Linkshandig R. Rechtshandig>"
},
"BoostEnabled": {
"text": "",
"text2": [
"Temperatuurverhoging",
"ingeschakeld?"
],
"desc": "Temperatuur verhoogt als voorste knop is ingedrukt"
},
"BoostTemperature": {
"text": "",
"text2": [
"Verhogings",
"temp"
],
"desc": "Verhogingstemperatuur"
},
"AutoStart": {
"text": "",
"text2": [
"Auto",
"start"
],
"desc": "Breng de soldeerbout op temperatuur bij het opstarten. T=Soldeertemperatuur, S=Slaapstand-temperatuur, F=Uit"
},
"CooldownBlink": {
"text": "",
"text2": [
"Afkoel",
"knipper"
],
"desc": "Temperatuur knippert in hoofdmenu tijdens afkoeling."
},
"TemperatureCalibration": {
"text": "",
"text2": [
"Calibreer",
"temperatuur?"
],
"desc": "Temperatuur van de punt calibreren."
},
"SettingsReset": {
"text": "",
"text2": [
"Instellingen",
"resetten?"
],
"desc": "Alle instellingen resetten."
},
"VoltageCalibration": {
"text": "",
"text2": [
"Calibreer",
"voedingsspanning?"
],
"desc": "VIN Calibreren. Bevestigen door knoppen lang in te drukken."
},
"AdvancedSoldering": {
"text": "",
"text2": [
"Gedetailleerd",
"soldeerscherm"
],
"desc": "Gedetailleerde informatie in kleiner lettertype in soldeerscherm."
},
"ScrollingSpeed": {
"text": "",
"text2": [
"Scrol",
"snelheid"
],
"desc": "Scrolsnelheid van de tekst."
},
"TipModel": {
"text": "PUNTMO",
"text2": [
"Punt",
"Model"
],
"desc": "Gekozen punt"
},
"SimpleCalibrationMode": {
"text": "SMPCAL",
"text2": [
"Eenvoudige",
"Calibrering"
],
"desc": "Calibrering met heet water"
},
"AdvancedCalibrationMode": {
"text": "ADVCAL",
"text2": [
"Gevorderde",
"Calibrering"
],
"desc": "Calibrering met thermokoppel"
},
"PowerInput": {
"text": "PWRW",
"text2": [
"Vermogen",
"Watt"
],
"desc": "Vermogen van de adapter"
}
}
}

View File

@@ -115,6 +115,7 @@ enum TipType {
}; };
#endif #endif
uint16_t lookupTipDefaultCalValue(enum TipType tipID);
uint16_t getHandleTemperature(); uint16_t getHandleTemperature();
uint16_t getTipRawTemp(uint8_t refresh); uint16_t getTipRawTemp(uint8_t refresh);
uint16_t getInputVoltageX10(uint16_t divisor); uint16_t getInputVoltageX10(uint16_t divisor);

View File

@@ -308,9 +308,12 @@ static void MX_TIM2_Init(void) {
// in the PWM off time. // in the PWM off time.
htim2.Instance = TIM2; htim2.Instance = TIM2;
htim2.Init.Prescaler = htim2.Init.Prescaler =
2000; // pwm out is 10k, we want to run our PWM at around 100hz 785; // pwm out is 10k from tim3, we want to run our PWM at around 10hz or slower on the output stage
// The input is 1mhz after the div/4, so divide this by 785 to give around 4Hz output change rate
//Trade off is the slower the PWM output the slower we can respond and we gain temperature accuracy in settling time,
//But it increases the time delay between the heat cycle and the measurement and calculate cycle
htim2.Init.CounterMode = TIM_COUNTERMODE_UP; htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
htim2.Init.Period = 122; htim2.Init.Period = 255+56;
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; // 4mhz before divide htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; // 4mhz before divide
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
HAL_TIM_Base_Init(&htim2); HAL_TIM_Base_Init(&htim2);
@@ -326,11 +329,11 @@ static void MX_TIM2_Init(void) {
HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig); HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig);
sConfigOC.OCMode = TIM_OCMODE_PWM1; sConfigOC.OCMode = TIM_OCMODE_PWM1;
sConfigOC.Pulse = 118; sConfigOC.Pulse = 255+47; //255 is the largest time period of the drive signal, and the 47 offsets this around 5ms afterwards
/* /*
* It takes 4 milliseconds for output to be stable after PWM turns off. * It takes 4 milliseconds for output to be stable after PWM turns off.
* Assume ADC samples in 0.5ms * Assume ADC samples in 0.5ms
* We need to set this to 100% + 5.5ms * We need to set this to 100% + 4.5ms
* */ * */
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
sConfigOC.OCFastMode = TIM_OCFAST_ENABLE; sConfigOC.OCFastMode = TIM_OCFAST_ENABLE;

View File

@@ -1214,6 +1214,99 @@ const char* SettingsMenuEntriesDescriptions[4] = {
#endif #endif
#ifdef LANG_NL_BE
// ---- Vlaams ----
const char* SettingsDescriptions[] = {
/* PowerSource */ "Spanningsbron. Stelt minimumspanning in. <DC 10V> <S 3.3V per cel>",
/* SleepTemperature */ "Temperatuur in slaapstand <°C>",
/* SleepTimeout */ "Slaapstand time-out <Minuten/Seconden>",
/* ShutdownTimeout */ "Automatisch afsluiten time-out <Minuten>",
/* MotionSensitivity */ "Bewegingsgevoeligheid <0.uit 1.minst gevoelig 9.meest gevoelig>",
/* TemperatureUnit */ "Temperatuurschaal <°C=Celsius °F=Fahrenheit>",
/* AdvancedIdle */ "Gedetailleerde informatie in een kleiner lettertype in het slaapscherm.",
/* DisplayRotation */ "Schermoriëntatie <A. Automatisch L. Linkshandig R. Rechtshandig>",
/* BoostEnabled */ "Temperatuur verhoogt als voorste knop is ingedrukt",
/* BoostTemperature */ "Verhogingstemperatuur",
/* AutoStart */ "Breng de soldeerbout op temperatuur bij het opstarten. T=Soldeertemperatuur, S=Slaapstand-temperatuur, F=Uit",
/* CooldownBlink */ "Temperatuur knippert in hoofdmenu tijdens afkoeling.",
/* TemperatureCalibration */ "Temperatuur van de punt calibreren.",
/* SettingsReset */ "Alle instellingen resetten.",
/* VoltageCalibration */ "VIN Calibreren. Bevestigen door knoppen lang in te drukken.",
/* AdvancedSoldering */ "Gedetailleerde informatie in kleiner lettertype in soldeerscherm.",
/* ScrollingSpeed */ "Scrolsnelheid van de tekst.",
/* TipModel */ "Gekozen punt",
/* SimpleCalibrationMode */ "Calibrering met heet water",
/* AdvancedCalibrationMode */ "Calibrering met thermokoppel",
/* PowerInput */ "Vermogen van de adapter",
};
const char* SettingsCalibrationDone = "Gecalibreerd!";
const char* SettingsCalibrationWarning = "Zorg vooraf dat de punt op kamertemperatuur is!";
const char* SettingsResetWarning = "Ben je zeker dat je alle standaardwaarden wil resetten?";
const char* UVLOWarningString = "Voedingsspanning LAAG";
const char* UndervoltageString = "Onderspanning";
const char* InputVoltageString = "Voedingsspanning: ";
const char* WarningTipTempString = "Punt Temp: ";
const char* BadTipString = "DEFECT";
const char* SleepingSimpleString = "Zzz ";
const char* SleepingAdvancedString = "Slaapstand...";
const char* WarningSimpleString = "HEET";
const char* WarningAdvancedString = "!!! PUNT HEET !!!";
const char* SleepingTipAdvancedString = "Punt:";
const char* IdleTipString = "Punt:";
const char* IdleSetString = "Stel in:";
const char* TipDisconnectedString = "Punt ONTKOPPELD";
const char* SolderingAdvancedPowerPrompt = "Vermogen: ";
const char* OffString = "Uit";
const char SettingRightChar = 'R';
const char SettingLeftChar = 'L';
const char SettingAutoChar = 'A';
const char SettingFastChar = 'S';
const char SettingSlowChar = 'T';
const enum ShortNameType SettingsShortNameType = SHORT_NAME_DOUBLE_LINE;
const char* SettingsShortNames[][2] = {
/* PowerSource */ { "Spannings-", "bron" },
/* SleepTemperature */ { "Slaap", "temp" },
/* SleepTimeout */ { "Slaap", "time-out" },
/* ShutdownTimeout */ { "Uitschakel", "time-out" },
/* MotionSensitivity */ { "Bewegings-", "gevoeligheid" },
/* TemperatureUnit */ { "Temperatuur", "schaal" },
/* AdvancedIdle */ { "Gedetailleerd", "slaapscherm" },
/* DisplayRotation */ { "Scherm-", "oriëntatie" },
/* BoostEnabled */ { "Temperatuurverhoging", "ingeschakeld?" },
/* BoostTemperature */ { "Verhogings", "temp" },
/* AutoStart */ { "Auto", "start" },
/* CooldownBlink */ { "Afkoel", "knipper" },
/* TemperatureCalibration */ { "Calibreer", "temperatuur?" },
/* SettingsReset */ { "Instellingen", "resetten?" },
/* VoltageCalibration */ { "Calibreer", "voedingsspanning?" },
/* AdvancedSoldering */ { "Gedetailleerd", "soldeerscherm" },
/* ScrollingSpeed */ { "Scrol", "snelheid" },
/* TipModel */ { "Punt", "Model" },
/* SimpleCalibrationMode */ { "Eenvoudige", "Calibrering" },
/* AdvancedCalibrationMode */ { "Gevorderde", "Calibrering" },
/* PowerInput */ { "Vermogen", "Watt" },
};
const char* SettingsMenuEntries[4] = {
/* SolderingMenu */ "Soldeer\nInstellingen",
/* PowerSavingMenu */ "Slaap\nstanden",
/* UIMenu */ "Gebruikers-\nInterface",
/* AdvancedMenu */ "Gevorderde\nInstellingen",
};
const char* SettingsMenuEntriesDescriptions[4] = {
/* SolderingMenu */ "Soldeerinstellingen",
/* PowerSavingMenu */ "Batterijspaarstanden",
/* UIMenu */ "Gebruikersinterface Instellingen",
/* AdvancedMenu */ "Gevorderde Instellingen",
};
#endif
#ifdef LANG_NO #ifdef LANG_NO
// ---- Norsk ---- // ---- Norsk ----

View File

@@ -103,7 +103,7 @@ static void settings_enterAdvancedMenu(void);
* Reset Settings * Reset Settings
* *
*/ */
const menuitem rootSettingsMenu[]{ const menuitem rootSettingsMenu[] {
/* /*
* Power Source * Power Source
* Soldering Menu * Soldering Menu
@@ -113,92 +113,76 @@ const menuitem rootSettingsMenu[]{
* Exit * Exit
*/ */
#ifdef MODEL_TS100 #ifdef MODEL_TS100
{(const char*)SettingsDescriptions[0], { (const char*)SettingsDescriptions[0],
{settings_setInputVRange}, { settings_setInputVRange},
{settings_displayInputVRange}}, /*Voltage input*/ { settings_displayInputVRange}}, /*Voltage input*/
#else #else
{(const char*)SettingsDescriptions[20], { (const char*) SettingsDescriptions[20], { settings_setInputPRange }, {
{settings_setInputPRange}, settings_displayInputPRange } }, /*Voltage input*/
{settings_displayInputPRange}}, /*Voltage input*/
#endif #endif
{(const char*)NULL, { (const char*) NULL, { settings_enterSolderingMenu }, {
{settings_enterSolderingMenu}, settings_displaySolderingMenu } }, /*Soldering*/
{settings_displaySolderingMenu}}, /*Soldering*/ { (const char*) NULL, { settings_enterPowerMenu }, {
{(const char*)NULL, settings_displayPowerMenu } }, /*Sleep Options Menu*/
{settings_enterPowerMenu}, { (const char*) NULL, { settings_enterUIMenu },
{settings_displayPowerMenu}}, /*Sleep Options Menu*/ { settings_displayUIMenu } }, /*UI Menu*/
{(const char*)NULL, { (const char*) NULL, { settings_enterAdvancedMenu }, {
{settings_enterUIMenu}, settings_displayAdvancedMenu } }, /*Advanced Menu*/
{settings_displayUIMenu}}, /*UI Menu*/ { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
{(const char*)NULL,
{settings_enterAdvancedMenu},
{settings_displayAdvancedMenu}}, /*Advanced Menu*/
{NULL, {NULL}, {NULL}} // end of menu marker. DO NOT REMOVE
}; };
const menuitem solderingMenu[] = { const menuitem solderingMenu[] = {
/* /*
* Boost Mode Enabled * Boost Mode Enabled
* Boost Mode Temp * Boost Mode Temp
* Auto Start * Auto Start
*/ */
{(const char*)SettingsDescriptions[8], { (const char*) SettingsDescriptions[8], { settings_setBoostModeEnabled }, {
{settings_setBoostModeEnabled}, settings_displayBoostModeEnabled } }, /*Enable Boost*/
{settings_displayBoostModeEnabled}}, /*Enable Boost*/ { (const char*) SettingsDescriptions[9], { settings_setBoostTemp }, {
{(const char*)SettingsDescriptions[9], settings_displayBoostTemp } }, /*Boost Temp*/
{settings_setBoostTemp}, { (const char*) SettingsDescriptions[10], { settings_setAutomaticStartMode }, {
{settings_displayBoostTemp}}, /*Boost Temp*/ settings_displayAutomaticStartMode } }, /*Auto start*/
{(const char*)SettingsDescriptions[10], { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
{settings_setAutomaticStartMode},
{settings_displayAutomaticStartMode}}, /*Auto start*/
{NULL, {NULL}, {NULL}} // end of menu marker. DO NOT REMOVE
}; };
const menuitem UIMenu[] = { const menuitem UIMenu[] = {
/* /*
// Language // Language
* Scrolling Speed * Scrolling Speed
* Temperature Unit * Temperature Unit
* Display orientation * Display orientation
* Cooldown blink * Cooldown blink
*/ */
{(const char*)SettingsDescriptions[5], { (const char*) SettingsDescriptions[5], { settings_setTempF }, {
{settings_setTempF}, settings_displayTempF } }, /* Temperature units*/
{settings_displayTempF}}, /* Temperature units*/ { (const char*) SettingsDescriptions[7], { settings_setDisplayRotation }, {
{(const char*)SettingsDescriptions[7], settings_displayDisplayRotation } }, /*Display Rotation*/
{settings_setDisplayRotation}, { (const char*) SettingsDescriptions[11], { settings_setCoolingBlinkEnabled }, {
{settings_displayDisplayRotation}}, /*Display Rotation*/ settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/
{(const char*)SettingsDescriptions[11], { (const char*) SettingsDescriptions[16], { settings_setScrollSpeed }, {
{settings_setCoolingBlinkEnabled}, settings_displayScrollSpeed } }, /*Scroll Speed for descriptions*/
{settings_displayCoolingBlinkEnabled}}, /*Cooling blink warning*/ { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
{(const char*)SettingsDescriptions[16],
{settings_setScrollSpeed},
{settings_displayScrollSpeed}}, /*Scroll Speed for descriptions*/
{NULL, {NULL}, {NULL}} // end of menu marker. DO NOT REMOVE
}; };
const menuitem PowerMenu[] = { const menuitem PowerMenu[] = {
/* /*
* Sleep Temp * Sleep Temp
* Sleep Time * Sleep Time
* Shutdown Time * Shutdown Time
* Motion Sensitivity * Motion Sensitivity
*/ */
{(const char*)SettingsDescriptions[1], { (const char*) SettingsDescriptions[1], { settings_setSleepTemp }, {
{settings_setSleepTemp}, settings_displaySleepTemp } }, /*Sleep Temp*/
{settings_displaySleepTemp}}, /*Sleep Temp*/ { (const char*) SettingsDescriptions[2], { settings_setSleepTime }, {
{(const char*)SettingsDescriptions[2], settings_displaySleepTime } }, /*Sleep Time*/
{settings_setSleepTime}, { (const char*) SettingsDescriptions[3], { settings_setShutdownTime }, {
{settings_displaySleepTime}}, /*Sleep Time*/ settings_displayShutdownTime } }, /*Shutdown Time*/
{(const char*)SettingsDescriptions[3], { (const char*) SettingsDescriptions[4], { settings_setSensitivity }, {
{settings_setShutdownTime}, settings_displaySensitivity } }, /* Motion Sensitivity*/
{settings_displayShutdownTime}}, /*Shutdown Time*/ { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
{(const char*)SettingsDescriptions[4],
{settings_setSensitivity},
{settings_displaySensitivity}}, /* Motion Sensitivity*/
{NULL, {NULL}, {NULL}} // end of menu marker. DO NOT REMOVE
}; };
const menuitem advancedMenu[] = { const menuitem advancedMenu[] = {
/* /*
* Detailed IDLE * Detailed IDLE
* Detailed Soldering * Detailed Soldering
* Logo Time * Logo Time
@@ -206,36 +190,28 @@ const menuitem advancedMenu[] = {
* Calibrate Input V * Calibrate Input V
* Reset Settings * Reset Settings
*/ */
{(const char*)SettingsDescriptions[6], { (const char*) SettingsDescriptions[6], { settings_setAdvancedIDLEScreens }, {
{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_displayResetSettings } }, /*Resets settings*/
{settings_setResetSettings}, { (const char*) SettingsDescriptions[17], { settings_setTipModel }, {
{settings_displayResetSettings}}, /*Resets settings*/ settings_displayTipModel } }, /*Select tip Model */
{(const char*)SettingsDescriptions[17], { (const char*) SettingsDescriptions[12], { settings_setCalibrate }, {
{settings_setTipModel}, settings_displayCalibrate } }, /*Calibrate tip*/
{settings_displayTipModel}}, /*Select tip Model */ { (const char*) SettingsDescriptions[14], { settings_setCalibrateVIN }, {
{(const char*)SettingsDescriptions[12], settings_displayCalibrateVIN } }, /*Voltage input cal*/
{settings_setCalibrate}, { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
{settings_displayCalibrate}}, /*Calibrate tip*/
{(const char*)SettingsDescriptions[14],
{settings_setCalibrateVIN},
{settings_displayCalibrateVIN}}, /*Voltage input cal*/
{NULL, {NULL}, {NULL}} // end of menu marker. DO NOT REMOVE
}; };
const menuitem calibrationMenu[]{ const menuitem calibrationMenu[] { { (const char*) SettingsDescriptions[6], {
{(const char*)SettingsDescriptions[6], calibration_enterSimpleCal }, { calibration_displaySimpleCal } },
{calibration_enterSimpleCal}, /* Simple Cal*/
{calibration_displaySimpleCal}}, { (const char*) SettingsDescriptions[6], { calibration_enterAdvancedCal }, {
/* Simple Cal*/ calibration_displayAdvancedCal } }, /* Advanced Cal */
{(const char*)SettingsDescriptions[6], { NULL, { NULL }, { NULL } } };
{calibration_enterAdvancedCal},
{calibration_displayAdvancedCal}}, /* Advanced Cal */
{NULL, {NULL}, {NULL}}};
static void printShortDescriptionSingleLine(uint32_t shortDescIndex) { static void printShortDescriptionSingleLine(uint32_t shortDescIndex) {
OLED::setFont(0); OLED::setFont(0);
@@ -282,9 +258,8 @@ static int userConfirmation(const char* message) {
bool lcdRefresh = true; bool lcdRefresh = true;
for (;;) { for (;;) {
int16_t messageOffset = int16_t messageOffset = ((xTaskGetTickCount() - messageStart)
((xTaskGetTickCount() - messageStart) / / (systemSettings.descriptionScrollSpeed == 1 ? 1 : 2));
(systemSettings.descriptionScrollSpeed == 1 ? 1 : 2));
messageOffset %= messageWidth; // Roll around at the end messageOffset %= messageWidth; // Roll around at the end
if (lastOffset != messageOffset) { if (lastOffset != messageOffset) {
@@ -344,8 +319,7 @@ static void settings_setInputPRange(void) {
static void settings_displayInputPRange(void) { static void settings_displayInputPRange(void) {
printShortDescription(0, 5); printShortDescription(0, 5);
//0 = 18W, 1=24W //0 = 18W, 1=24W
switch(systemSettings.cutoutSetting) switch (systemSettings.cutoutSetting) {
{
case 0: case 0:
OLED::print("18W"); OLED::print("18W");
break; break;
@@ -363,10 +337,12 @@ static void settings_setSleepTemp(void) {
// If in C, 10 deg, if in F 20 deg // If in C, 10 deg, if in F 20 deg
if (systemSettings.temperatureInF) { if (systemSettings.temperatureInF) {
systemSettings.SleepTemp += 20; systemSettings.SleepTemp += 20;
if (systemSettings.SleepTemp > 580) systemSettings.SleepTemp = 120; if (systemSettings.SleepTemp > 580)
systemSettings.SleepTemp = 120;
} else { } else {
systemSettings.SleepTemp += 10; systemSettings.SleepTemp += 10;
if (systemSettings.SleepTemp > 300) systemSettings.SleepTemp = 50; if (systemSettings.SleepTemp > 300)
systemSettings.SleepTemp = 50;
} }
} }
@@ -430,8 +406,8 @@ static void settings_setTempF(void) {
// Change sleep, boost and soldering temps to the C equiv // Change sleep, boost and soldering temps to the C equiv
// F->C == C = ((F-32)*5)/9 // F->C == C = ((F-32)*5)/9
systemSettings.BoostTemp = ((systemSettings.BoostTemp - 32) * 5) / 9; systemSettings.BoostTemp = ((systemSettings.BoostTemp - 32) * 5) / 9;
systemSettings.SolderingTemp = systemSettings.SolderingTemp = ((systemSettings.SolderingTemp - 32) * 5)
((systemSettings.SolderingTemp - 32) * 5) / 9; / 9;
systemSettings.SleepTemp = ((systemSettings.SleepTemp - 32) * 5) / 9; systemSettings.SleepTemp = ((systemSettings.SleepTemp - 32) * 5) / 9;
} }
// Rescale both to be multiples of 10 // Rescale both to be multiples of 10
@@ -486,8 +462,9 @@ static void settings_setScrollSpeed(void) {
} }
static void settings_displayScrollSpeed(void) { static void settings_displayScrollSpeed(void) {
printShortDescription(16, 7); printShortDescription(16, 7);
OLED::drawChar((systemSettings.descriptionScrollSpeed) ? SettingFastChar OLED::drawChar(
: SettingSlowChar); (systemSettings.descriptionScrollSpeed) ?
SettingFastChar : SettingSlowChar);
} }
static void settings_setDisplayRotation(void) { static void settings_setDisplayRotation(void) {
@@ -495,10 +472,10 @@ static void settings_setDisplayRotation(void) {
systemSettings.OrientationMode = systemSettings.OrientationMode % 3; systemSettings.OrientationMode = systemSettings.OrientationMode % 3;
switch (systemSettings.OrientationMode) { switch (systemSettings.OrientationMode) {
case 0: case 0:
OLED::setRotation(false); OLED::setRotation(true);
break; break;
case 1: case 1:
OLED::setRotation(true); OLED::setRotation(false);
break; break;
case 2: case 2:
// do nothing on auto // do nothing on auto
@@ -647,7 +624,7 @@ static void settings_displayTipModel(void) {
#endif #endif
#ifdef MODEL_TS80 #ifdef MODEL_TS80
// only 2 tips atm // only 2 tips atm
switch ((enum TipType)systemSettings.tipType) { switch ((enum TipType) systemSettings.tipType) {
case TS_B02: case TS_B02:
OLED::print(" B02 "); OLED::print(" B02 ");
break; break;
@@ -663,7 +640,9 @@ static void settings_displayTipModel(void) {
} }
#endif #endif
} }
static void calibration_displaySimpleCal(void) { printShortDescription(18, 5); } static void calibration_displaySimpleCal(void) {
printShortDescription(18, 5);
}
static void setTipOffset() { static void setTipOffset() {
setCalibrationOffset(0); // turn off the current offset setCalibrationOffset(0); // turn off the current offset
@@ -671,16 +650,16 @@ static void setTipOffset() {
// equalibrium, then the output should be zero, as there is no temperature // equalibrium, then the output should be zero, as there is no temperature
// differential. // differential.
int32_t offset = 0; uint32_t offset = 0;
for (uint8_t i = 0; i < 15; i++) { for (uint8_t i = 0; i < 15; i++) {
offset += getTipRawTemp(1); offset += getTipRawTemp(1);
// cycle through the filter a fair bit to ensure we're stable.
OLED::clearScreen(); OLED::clearScreen();
OLED::setCursor(0, 0); OLED::setCursor(0, 0);
for (uint8_t x = 0; x < i / 4; x++)
for (uint8_t x = 0; x < i / 4; x++) OLED::print("."); OLED::print(".");
OLED::refresh(); OLED::refresh();
osDelay(200); osDelay(333);
} }
systemSettings.CalibrationOffset = offset / 15; systemSettings.CalibrationOffset = offset / 15;
setCalibrationOffset(systemSettings.CalibrationOffset); // store the error setCalibrationOffset(systemSettings.CalibrationOffset); // store the error
@@ -706,6 +685,7 @@ static void calibration_enterSimpleCal(void) {
OLED::refresh(); OLED::refresh();
osDelay(200); osDelay(200);
waitForButtonPress(); waitForButtonPress();
// Now take the three hot measurements // Now take the three hot measurements
// Assume water is boiling at 100C // Assume water is boiling at 100C
uint32_t RawTipHot = getTipRawTemp(0) * 10; uint32_t RawTipHot = getTipRawTemp(0) * 10;
@@ -751,7 +731,7 @@ static void calibration_enterAdvancedCal(void) {
while (exit == false) { while (exit == false) {
//Set tip to 350C //Set tip to 350C
setTipType(Tip_Custom,systemSettings.customTipGain); setTipType(Tip_Custom, systemSettings.customTipGain);
currentlyActiveTemperatureTarget = ctoTipMeasurement(350); currentlyActiveTemperatureTarget = ctoTipMeasurement(350);
//Check if user has pressed button to change the gain //Check if user has pressed button to change the gain
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
@@ -820,7 +800,9 @@ static void settings_setCalibrate(void) {
} }
} }
static void settings_displayCalibrate(void) { printShortDescription(12, 5); } static void settings_displayCalibrate(void) {
printShortDescription(12, 5);
}
static void settings_setCalibrateVIN(void) { static void settings_setCalibrateVIN(void) {
// Jump to the voltage calibration subscreen // Jump to the voltage calibration subscreen
@@ -830,9 +812,11 @@ static void settings_setCalibrateVIN(void) {
for (;;) { for (;;) {
OLED::setCursor(0, 0); OLED::setCursor(0, 0);
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10, 2); OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10,
2);
OLED::print("."); OLED::print(".");
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10, 1); OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10,
1);
OLED::print("V"); OLED::print("V");
ButtonState buttons = getButtonState(); ButtonState buttons = getButtonState();
@@ -887,15 +871,33 @@ static void displayMenu(size_t index) {
OLED::drawArea(96 - 16, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index])); OLED::drawArea(96 - 16, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index]));
} }
static void settings_displayCalibrateVIN(void) { printShortDescription(14, 5); } static void settings_displayCalibrateVIN(void) {
static void settings_displaySolderingMenu(void) { displayMenu(0); } printShortDescription(14, 5);
static void settings_enterSolderingMenu(void) { gui_Menu(solderingMenu); } }
static void settings_displayPowerMenu(void) { displayMenu(1); } static void settings_displaySolderingMenu(void) {
static void settings_enterPowerMenu(void) { gui_Menu(PowerMenu); } displayMenu(0);
static void settings_displayUIMenu(void) { displayMenu(2); } }
static void settings_enterUIMenu(void) { gui_Menu(UIMenu); } static void settings_enterSolderingMenu(void) {
static void settings_displayAdvancedMenu(void) { displayMenu(3); } gui_Menu(solderingMenu);
static void settings_enterAdvancedMenu(void) { gui_Menu(advancedMenu); } }
static void settings_displayPowerMenu(void) {
displayMenu(1);
}
static void settings_enterPowerMenu(void) {
gui_Menu(PowerMenu);
}
static void settings_displayUIMenu(void) {
displayMenu(2);
}
static void settings_enterUIMenu(void) {
gui_Menu(UIMenu);
}
static void settings_displayAdvancedMenu(void) {
displayMenu(3);
}
static void settings_enterAdvancedMenu(void) {
gui_Menu(advancedMenu);
}
void gui_Menu(const menuitem* menu) { void gui_Menu(const menuitem* menu) {
// Draw the settings menu and provide iteration support etc // Draw the settings menu and provide iteration support etc
@@ -913,21 +915,23 @@ void gui_Menu(const menuitem* menu) {
OLED::setCursor(0, 0); OLED::setCursor(0, 0);
// If the user has hesitated for >=3 seconds, show the long text // If the user has hesitated for >=3 seconds, show the long text
// Otherwise "draw" the option // Otherwise "draw" the option
if ((xTaskGetTickCount() - lastButtonTime < 300) || if ((xTaskGetTickCount() - lastButtonTime < 300)
menu[currentScreen].description == NULL) { || menu[currentScreen].description == NULL) {
OLED::clearScreen(); OLED::clearScreen();
menu[currentScreen].draw.func(); menu[currentScreen].draw.func();
lastOffset = -1; lastOffset = -1;
lcdRefresh = true; lcdRefresh = true;
} else { } else {
// Draw description // Draw description
if (descriptionStart == 0) descriptionStart = xTaskGetTickCount(); if (descriptionStart == 0)
descriptionStart = xTaskGetTickCount();
// lower the value - higher the speed // lower the value - higher the speed
int16_t descriptionWidth = int16_t descriptionWidth =
FONT_12_WIDTH * (strlen(menu[currentScreen].description) + 7); FONT_12_WIDTH * (strlen(menu[currentScreen].description) + 7);
int16_t descriptionOffset = int16_t descriptionOffset =
((xTaskGetTickCount() - descriptionStart) / ((xTaskGetTickCount() - descriptionStart)
(systemSettings.descriptionScrollSpeed == 1 ? 1 : 2)); / (systemSettings.descriptionScrollSpeed == 1 ?
1 : 2));
descriptionOffset %= descriptionWidth; // Roll around at the end descriptionOffset %= descriptionWidth; // Roll around at the end
if (lastOffset != descriptionOffset) { if (lastOffset != descriptionOffset) {

View File

@@ -12,7 +12,6 @@
volatile uint16_t PWMSafetyTimer = 0; volatile uint16_t PWMSafetyTimer = 0;
volatile int16_t CalibrationTempOffset = 0; volatile int16_t CalibrationTempOffset = 0;
uint16_t tipGainCalValue = 0; uint16_t tipGainCalValue = 0;
uint16_t lookupTipDefaultCalValue(enum TipType tipID);
void setTipType(enum TipType tipType, uint8_t manualCalGain) { void setTipType(enum TipType tipType, uint8_t manualCalGain) {
if (manualCalGain) if (manualCalGain)
tipGainCalValue = manualCalGain; tipGainCalValue = manualCalGain;
@@ -133,7 +132,7 @@ uint16_t getInputVoltageX10(uint16_t divisor) {
// Therefore we can divide down from there // Therefore we can divide down from there
// Multiplying ADC max by 4 for additional calibration options, // Multiplying ADC max by 4 for additional calibration options,
// ideal term is 467 // ideal term is 467
#define BATTFILTERDEPTH 64 #define BATTFILTERDEPTH 32
static uint8_t preFillneeded = 1; static uint8_t preFillneeded = 1;
static uint32_t samples[BATTFILTERDEPTH]; static uint32_t samples[BATTFILTERDEPTH];
static uint8_t index = 0; static uint8_t index = 0;
@@ -163,7 +162,7 @@ void seekQC(int16_t Vx10,uint16_t divisor) {
if (QCMode == 0) if (QCMode == 0)
return; // NOT connected to a QC Charger return; // NOT connected to a QC Charger
if (Vx10 < 50) if (Vx10 < 45)
return; return;
if(Vx10>130) if(Vx10>130)
Vx10=130;//Cap max value at 13V Vx10=130;//Cap max value at 13V
@@ -179,15 +178,15 @@ void seekQC(int16_t Vx10,uint16_t divisor) {
int steps = difference / 2; int steps = difference / 2;
if (QCMode == 3) { if (QCMode == 3) {
while (steps < 0) { while (steps < 0) {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET);//D+0.6
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);//D-3.3V
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET);// D-3.3Vs
vTaskDelay(3);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);
vTaskDelay(3); vTaskDelay(3);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);//-0.6V
HAL_Delay(1);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);
HAL_IWDG_Refresh(&hiwdg); HAL_IWDG_Refresh(&hiwdg);
vTaskDelay(3); HAL_Delay(1);
steps++; steps++;
} }
while (steps > 0) { while (steps > 0) {
@@ -198,10 +197,10 @@ void seekQC(int16_t Vx10,uint16_t divisor) {
vTaskDelay(3); vTaskDelay(3);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET);
vTaskDelay(3); HAL_Delay(1);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET);
HAL_IWDG_Refresh(&hiwdg); HAL_IWDG_Refresh(&hiwdg);
vTaskDelay(3); HAL_Delay(1);
steps--; steps--;
} }
} }
@@ -238,7 +237,7 @@ void startQC(uint16_t divisor) {
// negotiating as someone is feeding in hv // negotiating as someone is feeding in hv
uint16_t vin = getInputVoltageX10(divisor); uint16_t vin = getInputVoltageX10(divisor);
if (vin > 150) if (vin > 150)
return; // Over voltage return;// Over voltage
if (vin > 100) { if (vin > 100) {
QCMode = 1; // ALready at ~12V QCMode = 1; // ALready at ~12V
return; return;
@@ -300,7 +299,7 @@ void startQC(uint16_t divisor) {
for (uint8_t i = 0; i < 10; i++) { for (uint8_t i = 0; i < 10; i++) {
if (getInputVoltageX10(divisor) > 80) { if (getInputVoltageX10(divisor) > 80) {
// yay we have at least QC2.0 or QC3.0 // yay we have at least QC2.0 or QC3.0
QCMode = 3; // We have at least QC2, pray for 3 QCMode = 3;// We have at least QC2, pray for 3
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET);
@@ -332,7 +331,7 @@ uint32_t calculateTipR() {
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_RESET); // Set low first HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_RESET);// Set low first
setTipPWM(0); setTipPWM(0);
vTaskDelay(1); vTaskDelay(1);
uint32_t offReading = getTipRawTemp(1); uint32_t offReading = getTipRawTemp(1);
@@ -342,8 +341,8 @@ uint32_t calculateTipR() {
} }
// Turn on // Turn on
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_SET); // Set low first HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_SET);// Set low first
vTaskDelay(1); // delay to allow it to stabilize vTaskDelay(1); // delay to allow it too stabilize
uint32_t onReading = getTipInstantTemperature(); uint32_t onReading = getTipInstantTemperature();
for (uint8_t i = 0; i < 24; i++) { for (uint8_t i = 0; i < 24; i++) {
vTaskDelay(1); // delay to allow it to stabilize vTaskDelay(1); // delay to allow it to stabilize
@@ -357,7 +356,7 @@ uint32_t calculateTipR() {
// 4688 milliohms (Measured using 4 terminal measurement) 25x oversampling // 4688 milliohms (Measured using 4 terminal measurement) 25x oversampling
// reads this as around 47490 Almost perfectly 10x the milliohms value This // reads this as around 47490 Almost perfectly 10x the milliohms value This
// will drift massively with tip temp However we really only need 10x ohms // will drift massively with tip temp However we really only need 10x ohms
return (difference / 10) + 1; // ceil return (difference / 10) + 1;// ceil
} }
static unsigned int sqrt32(unsigned long n) { static unsigned int sqrt32(unsigned long n) {
unsigned int c = 0x8000; unsigned int c = 0x8000;
@@ -386,9 +385,9 @@ int16_t calculateMaxVoltage(uint8_t useHP) {
uint32_t Vx = sqrt32(milliOhms); uint32_t Vx = sqrt32(milliOhms);
if (useHP) if (useHP)
Vx *= 1549; //sqrt(24)*sqrt(1/1000) Vx *= 1549;//sqrt(24)*sqrt(1/1000)
else else
Vx *= 1342; // sqrt(18) * sqrt(1/1000) Vx *= 1342;// sqrt(18) * sqrt(1/1000)
// Round to nearest 200mV, // Round to nearest 200mV,
// So divide by 100 to start, to get in Vxx // So divide by 100 to start, to get in Vxx
@@ -410,9 +409,10 @@ uint8_t getTipPWM() {
void setTipPWM(uint8_t pulse) { void setTipPWM(uint8_t pulse) {
PWMSafetyTimer = 2; // This is decremented in the handler for PWM so that the tip pwm is PWMSafetyTimer = 2; // This is decremented in the handler for PWM so that the tip pwm is
// disabled if the PID task is not scheduled often enough. // disabled if the PID task is not scheduled often enough.
if (pulse > 100) if (pulse > 255)
pulse = 100; pulse = 255;
if (pulse == 0) // Need to have some pulse to keep the PID controller moving forward as these end of cycle completions move the thread along
pulse = 1;
pendingPWM = pulse; pendingPWM = pulse;
} }

View File

@@ -262,12 +262,15 @@ static void gui_drawBatteryIcon() {
// User is on a lithium battery // User is on a lithium battery
// 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;
uint16_t cellV = getInputVoltageX10(systemSettings.voltageDiv) / cellCount; uint16_t cellV = getInputVoltageX10(systemSettings.voltageDiv)
/ 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) cellV = 33; if (cellV < 33)
cellV -= 33;// Should leave us a number of 0-9 cellV = 33;
if (cellV > 9) cellV = 9; cellV -= 33; // Should leave us a number of 0-9
if (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
@@ -276,7 +279,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); uint8_t V = getInputVoltageX10(systemSettings.voltageDiv);
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) {
@@ -312,7 +315,7 @@ static void gui_solderingTempAdjust() {
// exit // exit
return; return;
break; break;
case BUTTON_F_LONG: case BUTTON_B_LONG:
if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration > if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration >
PRESS_ACCEL_INTERVAL_MAX) { PRESS_ACCEL_INTERVAL_MAX) {
systemSettings.SolderingTemp -= 10; // sub 10 systemSettings.SolderingTemp -= 10; // sub 10
@@ -320,7 +323,7 @@ static void gui_solderingTempAdjust() {
autoRepeatAcceleration += PRESS_ACCEL_STEP; autoRepeatAcceleration += PRESS_ACCEL_STEP;
} }
break; break;
case BUTTON_B_LONG: case BUTTON_F_LONG:
if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration > if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration >
PRESS_ACCEL_INTERVAL_MAX) { PRESS_ACCEL_INTERVAL_MAX) {
systemSettings.SolderingTemp += 10; systemSettings.SolderingTemp += 10;
@@ -328,10 +331,10 @@ static void gui_solderingTempAdjust() {
autoRepeatAcceleration += PRESS_ACCEL_STEP; autoRepeatAcceleration += PRESS_ACCEL_STEP;
} }
break; break;
case BUTTON_B_SHORT: case BUTTON_F_SHORT:
systemSettings.SolderingTemp += 10; // add 10 systemSettings.SolderingTemp += 10; // add 10
break; break;
case BUTTON_F_SHORT: case BUTTON_B_SHORT:
systemSettings.SolderingTemp -= 10; // sub 10 systemSettings.SolderingTemp -= 10; // sub 10
break; break;
default: default:
@@ -358,7 +361,11 @@ static void gui_solderingTempAdjust() {
if (xTaskGetTickCount() - lastChange > 200) if (xTaskGetTickCount() - lastChange > 200)
return; // exit if user just doesn't press anything for a bit return; // exit if user just doesn't press anything for a bit
#ifdef MODEL_TS80
if (!OLED::getRotation())
#else
if (OLED::getRotation()) if (OLED::getRotation())
#endif
OLED::drawChar('-'); OLED::drawChar('-');
else else
OLED::drawChar('+'); OLED::drawChar('+');
@@ -370,7 +377,11 @@ static void gui_solderingTempAdjust() {
else else
OLED::drawSymbol(1); OLED::drawSymbol(1);
OLED::drawChar(' '); OLED::drawChar(' ');
#ifdef MODEL_TS80
if (!OLED::getRotation())
#else
if (OLED::getRotation()) if (OLED::getRotation())
#endif
OLED::drawChar('+'); OLED::drawChar('+');
else else
OLED::drawChar('-'); OLED::drawChar('-');
@@ -396,7 +407,8 @@ 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()) return 1; // return non-zero on error if (checkVoltageForExit())
return 1; // return non-zero on error
#endif #endif
if (systemSettings.temperatureInF) { if (systemSettings.temperatureInF) {
currentlyActiveTemperatureTarget = ftoTipMeasurement( currentlyActiveTemperatureTarget = ftoTipMeasurement(
@@ -659,7 +671,7 @@ 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((char *)"V2.06 TS100"); // Print version number OLED::print((char *) "V2.06 TS100"); // Print version number
#else #else
OLED::print((char *) "V2.06 TS80"); // Print version number OLED::print((char *) "V2.06 TS80"); // Print version number
#endif #endif
@@ -729,7 +741,7 @@ void startGUITask(void const *argument __unused) {
bool buttonLockout = false; bool buttonLockout = false;
bool tempOnDisplay = false; bool tempOnDisplay = false;
getTipRawTemp(1); // reset filter getTipRawTemp(1); // reset filter
OLED::setRotation(systemSettings.OrientationMode & 1); OLED::setRotation(!(systemSettings.OrientationMode & 1));
uint32_t ticks = xTaskGetTickCount(); uint32_t ticks = xTaskGetTickCount();
ticks += 400; // 4 seconds from now ticks += 400; // 4 seconds from now
while (xTaskGetTickCount() < ticks) { while (xTaskGetTickCount() < ticks) {
@@ -976,20 +988,20 @@ void startPIDTask(void const *argument __unused) {
#define MOVFilter 8 #define MOVFilter 8
void startMOVTask(void const *argument __unused) { void startMOVTask(void const *argument __unused) {
OLED::setRotation(false); OLED::setRotation(true);
#ifdef MODEL_TS80 #ifdef MODEL_TS80
startQC(systemSettings.voltageDiv); startQC(systemSettings.voltageDiv);
while (idealQCVoltage == 0) while (idealQCVoltage == 0)
osDelay(20); // To ensure we return after idealQCVoltage is setup osDelay(20); // To ensure we return after idealQCVoltage is setup
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
#endif #endif
OLED::setRotation(systemSettings.OrientationMode & 1); OLED::setRotation(!(systemSettings.OrientationMode & 1));
lastMovementTime = 0; lastMovementTime = 0;
int16_t datax[MOVFilter] = { 0 }; int16_t datax[MOVFilter] = { 0 };
int16_t datay[MOVFilter] = { 0 }; int16_t datay[MOVFilter] = { 0 };

View File

@@ -50,6 +50,7 @@
<tool id="com.atollic.truestudio.exe.release.toolchain.gcc.45651038" name="C Compiler" superClass="com.atollic.truestudio.exe.release.toolchain.gcc"> <tool id="com.atollic.truestudio.exe.release.toolchain.gcc.45651038" name="C Compiler" superClass="com.atollic.truestudio.exe.release.toolchain.gcc">
<option id="com.atollic.truestudio.gcc.symbols.defined.1383071182" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined" useByScannerDiscovery="false" valueType="definedSymbols"> <option id="com.atollic.truestudio.gcc.symbols.defined.1383071182" name="Defined symbols" superClass="com.atollic.truestudio.gcc.symbols.defined" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32F103T8Ux"/> <listOptionValue builtIn="false" value="STM32F103T8Ux"/>
<listOptionValue builtIn="false" value="MODEL_TS80"/>
<listOptionValue builtIn="false" value="STM32F1"/> <listOptionValue builtIn="false" value="STM32F1"/>
<listOptionValue builtIn="false" value="STM32"/> <listOptionValue builtIn="false" value="STM32"/>
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/> <listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
@@ -90,6 +91,7 @@
<tool id="com.atollic.truestudio.exe.release.toolchain.gpp.93636755" name="C++ Compiler" superClass="com.atollic.truestudio.exe.release.toolchain.gpp"> <tool id="com.atollic.truestudio.exe.release.toolchain.gpp.93636755" name="C++ Compiler" superClass="com.atollic.truestudio.exe.release.toolchain.gpp">
<option id="com.atollic.truestudio.gpp.symbols.defined.552082963" name="Defined symbols" superClass="com.atollic.truestudio.gpp.symbols.defined" useByScannerDiscovery="false" valueType="definedSymbols"> <option id="com.atollic.truestudio.gpp.symbols.defined.552082963" name="Defined symbols" superClass="com.atollic.truestudio.gpp.symbols.defined" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32F103T8Ux"/> <listOptionValue builtIn="false" value="STM32F103T8Ux"/>
<listOptionValue builtIn="false" value="MODEL_TS80"/>
<listOptionValue builtIn="false" value="STM32F1"/> <listOptionValue builtIn="false" value="STM32F1"/>
<listOptionValue builtIn="false" value="STM32"/> <listOptionValue builtIn="false" value="STM32"/>
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/> <listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>

View File

@@ -4,7 +4,7 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="100391687907069452" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="523641172746736302" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>