mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
@@ -115,6 +115,7 @@ enum TipType {
|
||||
};
|
||||
#endif
|
||||
|
||||
uint16_t lookupTipDefaultCalValue(enum TipType tipID);
|
||||
uint16_t getHandleTemperature();
|
||||
uint16_t getTipRawTemp(uint8_t instant);
|
||||
uint16_t getInputVoltageX10(uint16_t divisor);
|
||||
|
||||
@@ -308,9 +308,12 @@ static void MX_TIM2_Init(void) {
|
||||
// in the PWM off time.
|
||||
htim2.Instance = TIM2;
|
||||
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.Period = 122;
|
||||
htim2.Init.Period = 255+56;
|
||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; // 4mhz before divide
|
||||
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
HAL_TIM_Base_Init(&htim2);
|
||||
@@ -326,11 +329,11 @@ static void MX_TIM2_Init(void) {
|
||||
HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig);
|
||||
|
||||
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.
|
||||
* 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.OCFastMode = TIM_OCFAST_ENABLE;
|
||||
|
||||
@@ -117,22 +117,17 @@ const menuitem rootSettingsMenu[]{
|
||||
{ settings_setInputVRange},
|
||||
{ settings_displayInputVRange}}, /*Voltage input*/
|
||||
#else
|
||||
{(const char*)SettingsDescriptions[20],
|
||||
{settings_setInputPRange},
|
||||
{settings_displayInputPRange}}, /*Voltage input*/
|
||||
{ (const char*) SettingsDescriptions[20], { settings_setInputPRange }, {
|
||||
settings_displayInputPRange } }, /*Voltage input*/
|
||||
#endif
|
||||
{(const char*)NULL,
|
||||
{settings_enterSolderingMenu},
|
||||
{settings_displaySolderingMenu}}, /*Soldering*/
|
||||
{(const char*)NULL,
|
||||
{settings_enterPowerMenu},
|
||||
{settings_displayPowerMenu}}, /*Sleep Options Menu*/
|
||||
{(const char*)NULL,
|
||||
{settings_enterUIMenu},
|
||||
{ (const char*) NULL, { settings_enterSolderingMenu }, {
|
||||
settings_displaySolderingMenu } }, /*Soldering*/
|
||||
{ (const char*) NULL, { settings_enterPowerMenu }, {
|
||||
settings_displayPowerMenu } }, /*Sleep Options Menu*/
|
||||
{ (const char*) NULL, { settings_enterUIMenu },
|
||||
{ settings_displayUIMenu } }, /*UI Menu*/
|
||||
{(const char*)NULL,
|
||||
{settings_enterAdvancedMenu},
|
||||
{settings_displayAdvancedMenu}}, /*Advanced Menu*/
|
||||
{ (const char*) NULL, { settings_enterAdvancedMenu }, {
|
||||
settings_displayAdvancedMenu } }, /*Advanced Menu*/
|
||||
{ NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
|
||||
@@ -142,15 +137,12 @@ const menuitem solderingMenu[] = {
|
||||
* Boost Mode Temp
|
||||
* Auto Start
|
||||
*/
|
||||
{(const char*)SettingsDescriptions[8],
|
||||
{settings_setBoostModeEnabled},
|
||||
{settings_displayBoostModeEnabled}}, /*Enable Boost*/
|
||||
{(const char*)SettingsDescriptions[9],
|
||||
{settings_setBoostTemp},
|
||||
{settings_displayBoostTemp}}, /*Boost Temp*/
|
||||
{(const char*)SettingsDescriptions[10],
|
||||
{settings_setAutomaticStartMode},
|
||||
{settings_displayAutomaticStartMode}}, /*Auto start*/
|
||||
{ (const char*) SettingsDescriptions[8], { settings_setBoostModeEnabled }, {
|
||||
settings_displayBoostModeEnabled } }, /*Enable Boost*/
|
||||
{ (const char*) SettingsDescriptions[9], { settings_setBoostTemp }, {
|
||||
settings_displayBoostTemp } }, /*Boost Temp*/
|
||||
{ (const char*) SettingsDescriptions[10], { settings_setAutomaticStartMode }, {
|
||||
settings_displayAutomaticStartMode } }, /*Auto start*/
|
||||
{ NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
const menuitem UIMenu[] = {
|
||||
@@ -161,18 +153,14 @@ const menuitem UIMenu[] = {
|
||||
* Display orientation
|
||||
* Cooldown blink
|
||||
*/
|
||||
{(const char*)SettingsDescriptions[5],
|
||||
{settings_setTempF},
|
||||
{settings_displayTempF}}, /* Temperature units*/
|
||||
{(const char*)SettingsDescriptions[7],
|
||||
{settings_setDisplayRotation},
|
||||
{settings_displayDisplayRotation}}, /*Display Rotation*/
|
||||
{(const char*)SettingsDescriptions[11],
|
||||
{settings_setCoolingBlinkEnabled},
|
||||
{settings_displayCoolingBlinkEnabled}}, /*Cooling blink warning*/
|
||||
{(const char*)SettingsDescriptions[16],
|
||||
{settings_setScrollSpeed},
|
||||
{settings_displayScrollSpeed}}, /*Scroll Speed for descriptions*/
|
||||
{ (const char*) SettingsDescriptions[5], { settings_setTempF }, {
|
||||
settings_displayTempF } }, /* Temperature units*/
|
||||
{ (const char*) SettingsDescriptions[7], { settings_setDisplayRotation }, {
|
||||
settings_displayDisplayRotation } }, /*Display Rotation*/
|
||||
{ (const char*) SettingsDescriptions[11], { settings_setCoolingBlinkEnabled }, {
|
||||
settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/
|
||||
{ (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[] = {
|
||||
@@ -182,18 +170,14 @@ const menuitem PowerMenu[] = {
|
||||
* Shutdown Time
|
||||
* Motion Sensitivity
|
||||
*/
|
||||
{(const char*)SettingsDescriptions[1],
|
||||
{settings_setSleepTemp},
|
||||
{settings_displaySleepTemp}}, /*Sleep Temp*/
|
||||
{(const char*)SettingsDescriptions[2],
|
||||
{settings_setSleepTime},
|
||||
{settings_displaySleepTime}}, /*Sleep Time*/
|
||||
{(const char*)SettingsDescriptions[3],
|
||||
{settings_setShutdownTime},
|
||||
{settings_displayShutdownTime}}, /*Shutdown Time*/
|
||||
{(const char*)SettingsDescriptions[4],
|
||||
{settings_setSensitivity},
|
||||
{settings_displaySensitivity}}, /* Motion Sensitivity*/
|
||||
{ (const char*) SettingsDescriptions[1], { settings_setSleepTemp }, {
|
||||
settings_displaySleepTemp } }, /*Sleep Temp*/
|
||||
{ (const char*) SettingsDescriptions[2], { settings_setSleepTime }, {
|
||||
settings_displaySleepTime } }, /*Sleep Time*/
|
||||
{ (const char*) SettingsDescriptions[3], { settings_setShutdownTime }, {
|
||||
settings_displayShutdownTime } }, /*Shutdown Time*/
|
||||
{ (const char*) SettingsDescriptions[4], { settings_setSensitivity }, {
|
||||
settings_displaySensitivity } }, /* Motion Sensitivity*/
|
||||
{ NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
const menuitem advancedMenu[] = {
|
||||
@@ -206,35 +190,27 @@ const menuitem advancedMenu[] = {
|
||||
* Calibrate Input V
|
||||
* Reset Settings
|
||||
*/
|
||||
{(const char*)SettingsDescriptions[6],
|
||||
{settings_setAdvancedIDLEScreens},
|
||||
{settings_displayAdvancedIDLEScreens}}, /* Advanced idle screen*/
|
||||
{ (const char*) SettingsDescriptions[6], { settings_setAdvancedIDLEScreens }, {
|
||||
settings_displayAdvancedIDLEScreens } }, /* Advanced idle screen*/
|
||||
{ (const char*) SettingsDescriptions[15],
|
||||
{settings_setAdvancedSolderingScreens},
|
||||
{settings_displayAdvancedSolderingScreens}}, /* Advanced soldering screen*/
|
||||
{(const char*)SettingsDescriptions[13],
|
||||
{settings_setResetSettings},
|
||||
{settings_displayResetSettings}}, /*Resets settings*/
|
||||
{(const char*)SettingsDescriptions[17],
|
||||
{settings_setTipModel},
|
||||
{settings_displayTipModel}}, /*Select tip Model */
|
||||
{(const char*)SettingsDescriptions[12],
|
||||
{settings_setCalibrate},
|
||||
{settings_displayCalibrate}}, /*Calibrate tip*/
|
||||
{(const char*)SettingsDescriptions[14],
|
||||
{settings_setCalibrateVIN},
|
||||
{settings_displayCalibrateVIN}}, /*Voltage input cal*/
|
||||
{ settings_setAdvancedSolderingScreens }, {
|
||||
settings_displayAdvancedSolderingScreens } }, /* Advanced soldering screen*/
|
||||
{ (const char*) SettingsDescriptions[13], { settings_setResetSettings }, {
|
||||
settings_displayResetSettings } }, /*Resets settings*/
|
||||
{ (const char*) SettingsDescriptions[17], { settings_setTipModel }, {
|
||||
settings_displayTipModel } }, /*Select tip Model */
|
||||
{ (const char*) SettingsDescriptions[12], { settings_setCalibrate }, {
|
||||
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 char*)SettingsDescriptions[6],
|
||||
{calibration_enterSimpleCal},
|
||||
{calibration_displaySimpleCal}},
|
||||
const menuitem calibrationMenu[] { { (const char*) SettingsDescriptions[6], {
|
||||
calibration_enterSimpleCal }, { calibration_displaySimpleCal } },
|
||||
/* Simple Cal*/
|
||||
{(const char*)SettingsDescriptions[6],
|
||||
{calibration_enterAdvancedCal},
|
||||
{calibration_displayAdvancedCal}}, /* Advanced Cal */
|
||||
{ (const char*) SettingsDescriptions[6], { calibration_enterAdvancedCal }, {
|
||||
calibration_displayAdvancedCal } }, /* Advanced Cal */
|
||||
{ NULL, { NULL }, { NULL } } };
|
||||
|
||||
static void printShortDescriptionSingleLine(uint32_t shortDescIndex) {
|
||||
@@ -282,9 +258,8 @@ static int userConfirmation(const char* message) {
|
||||
bool lcdRefresh = true;
|
||||
|
||||
for (;;) {
|
||||
int16_t messageOffset =
|
||||
((xTaskGetTickCount() - messageStart) /
|
||||
(systemSettings.descriptionScrollSpeed == 1 ? 1 : 2));
|
||||
int16_t messageOffset = ((xTaskGetTickCount() - messageStart)
|
||||
/ (systemSettings.descriptionScrollSpeed == 1 ? 1 : 2));
|
||||
messageOffset %= messageWidth; // Roll around at the end
|
||||
|
||||
if (lastOffset != messageOffset) {
|
||||
@@ -344,8 +319,7 @@ static void settings_setInputPRange(void) {
|
||||
static void settings_displayInputPRange(void) {
|
||||
printShortDescription(0, 5);
|
||||
//0 = 18W, 1=24W
|
||||
switch(systemSettings.cutoutSetting)
|
||||
{
|
||||
switch (systemSettings.cutoutSetting) {
|
||||
case 0:
|
||||
OLED::print("18W");
|
||||
break;
|
||||
@@ -363,10 +337,12 @@ static void settings_setSleepTemp(void) {
|
||||
// If in C, 10 deg, if in F 20 deg
|
||||
if (systemSettings.temperatureInF) {
|
||||
systemSettings.SleepTemp += 20;
|
||||
if (systemSettings.SleepTemp > 580) systemSettings.SleepTemp = 120;
|
||||
if (systemSettings.SleepTemp > 580)
|
||||
systemSettings.SleepTemp = 120;
|
||||
} else {
|
||||
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
|
||||
// F->C == C = ((F-32)*5)/9
|
||||
systemSettings.BoostTemp = ((systemSettings.BoostTemp - 32) * 5) / 9;
|
||||
systemSettings.SolderingTemp =
|
||||
((systemSettings.SolderingTemp - 32) * 5) / 9;
|
||||
systemSettings.SolderingTemp = ((systemSettings.SolderingTemp - 32) * 5)
|
||||
/ 9;
|
||||
systemSettings.SleepTemp = ((systemSettings.SleepTemp - 32) * 5) / 9;
|
||||
}
|
||||
// Rescale both to be multiples of 10
|
||||
@@ -486,8 +462,9 @@ static void settings_setScrollSpeed(void) {
|
||||
}
|
||||
static void settings_displayScrollSpeed(void) {
|
||||
printShortDescription(16, 7);
|
||||
OLED::drawChar((systemSettings.descriptionScrollSpeed) ? SettingFastChar
|
||||
: SettingSlowChar);
|
||||
OLED::drawChar(
|
||||
(systemSettings.descriptionScrollSpeed) ?
|
||||
SettingFastChar : SettingSlowChar);
|
||||
}
|
||||
|
||||
static void settings_setDisplayRotation(void) {
|
||||
@@ -495,10 +472,10 @@ static void settings_setDisplayRotation(void) {
|
||||
systemSettings.OrientationMode = systemSettings.OrientationMode % 3;
|
||||
switch (systemSettings.OrientationMode) {
|
||||
case 0:
|
||||
OLED::setRotation(false);
|
||||
OLED::setRotation(true);
|
||||
break;
|
||||
case 1:
|
||||
OLED::setRotation(true);
|
||||
OLED::setRotation(false);
|
||||
break;
|
||||
case 2:
|
||||
// do nothing on auto
|
||||
@@ -663,14 +640,16 @@ static void settings_displayTipModel(void) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
static void calibration_displaySimpleCal(void) { printShortDescription(18, 5); }
|
||||
static void calibration_displaySimpleCal(void) {
|
||||
printShortDescription(18, 5);
|
||||
}
|
||||
static void dotDelay() {
|
||||
for (uint8_t i = 0; i < 20; i++) {
|
||||
getTipRawTemp(
|
||||
1); // cycle through the filter a fair bit to ensure we're stable.
|
||||
getTipRawTemp(1); // cycle through the filter a fair bit to ensure we're stable.
|
||||
OLED::clearScreen();
|
||||
OLED::setCursor(0, 0);
|
||||
for (uint8_t x = 0; x < i / 4; x++) OLED::print(".");
|
||||
for (uint8_t x = 0; x < i / 4; x++)
|
||||
OLED::print(".");
|
||||
OLED::refresh();
|
||||
osDelay(50);
|
||||
}
|
||||
@@ -685,15 +664,14 @@ static void setTipOffset() {
|
||||
|
||||
int32_t offset = 0;
|
||||
for (uint8_t i = 0; i < 15; i++) {
|
||||
offset += getTipRawTemp(
|
||||
1); // cycle through the filter a fair bit to ensure we're stable.
|
||||
|
||||
offset += getTipRawTemp(1);
|
||||
// cycle through the filter a fair bit to ensure we're stable.
|
||||
OLED::clearScreen();
|
||||
OLED::setCursor(0, 0);
|
||||
|
||||
for (uint8_t x = 0; x < i / 4; x++) OLED::print(".");
|
||||
for (uint8_t x = 0; x < i / 4; x++)
|
||||
OLED::print(".");
|
||||
OLED::refresh();
|
||||
osDelay(200);
|
||||
osDelay(333);
|
||||
}
|
||||
systemSettings.CalibrationOffset = offset / 15;
|
||||
setCalibrationOffset(systemSettings.CalibrationOffset); // store the error
|
||||
@@ -834,7 +812,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) {
|
||||
// Jump to the voltage calibration subscreen
|
||||
@@ -844,9 +824,11 @@ static void settings_setCalibrateVIN(void) {
|
||||
|
||||
for (;;) {
|
||||
OLED::setCursor(0, 0);
|
||||
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10, 2);
|
||||
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10,
|
||||
2);
|
||||
OLED::print(".");
|
||||
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10, 1);
|
||||
OLED::printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10,
|
||||
1);
|
||||
OLED::print("V");
|
||||
|
||||
ButtonState buttons = getButtonState();
|
||||
@@ -901,15 +883,33 @@ static void displayMenu(size_t index) {
|
||||
OLED::drawArea(96 - 16, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index]));
|
||||
}
|
||||
|
||||
static void settings_displayCalibrateVIN(void) { printShortDescription(14, 5); }
|
||||
static void settings_displaySolderingMenu(void) { displayMenu(0); }
|
||||
static void settings_enterSolderingMenu(void) { gui_Menu(solderingMenu); }
|
||||
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); }
|
||||
static void settings_displayCalibrateVIN(void) {
|
||||
printShortDescription(14, 5);
|
||||
}
|
||||
static void settings_displaySolderingMenu(void) {
|
||||
displayMenu(0);
|
||||
}
|
||||
static void settings_enterSolderingMenu(void) {
|
||||
gui_Menu(solderingMenu);
|
||||
}
|
||||
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) {
|
||||
// Draw the settings menu and provide iteration support etc
|
||||
@@ -927,21 +927,23 @@ void gui_Menu(const menuitem* menu) {
|
||||
OLED::setCursor(0, 0);
|
||||
// If the user has hesitated for >=3 seconds, show the long text
|
||||
// Otherwise "draw" the option
|
||||
if ((xTaskGetTickCount() - lastButtonTime < 300) ||
|
||||
menu[currentScreen].description == NULL) {
|
||||
if ((xTaskGetTickCount() - lastButtonTime < 300)
|
||||
|| menu[currentScreen].description == NULL) {
|
||||
OLED::clearScreen();
|
||||
menu[currentScreen].draw.func();
|
||||
lastOffset = -1;
|
||||
lcdRefresh = true;
|
||||
} else {
|
||||
// Draw description
|
||||
if (descriptionStart == 0) descriptionStart = xTaskGetTickCount();
|
||||
if (descriptionStart == 0)
|
||||
descriptionStart = xTaskGetTickCount();
|
||||
// lower the value - higher the speed
|
||||
int16_t descriptionWidth =
|
||||
FONT_12_WIDTH * (strlen(menu[currentScreen].description) + 7);
|
||||
int16_t descriptionOffset =
|
||||
((xTaskGetTickCount() - descriptionStart) /
|
||||
(systemSettings.descriptionScrollSpeed == 1 ? 1 : 2));
|
||||
((xTaskGetTickCount() - descriptionStart)
|
||||
/ (systemSettings.descriptionScrollSpeed == 1 ?
|
||||
1 : 2));
|
||||
descriptionOffset %= descriptionWidth; // Roll around at the end
|
||||
|
||||
if (lastOffset != descriptionOffset) {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
volatile uint16_t PWMSafetyTimer = 0;
|
||||
volatile int16_t CalibrationTempOffset = 0;
|
||||
uint16_t tipGainCalValue = 0;
|
||||
uint16_t lookupTipDefaultCalValue(enum TipType tipID);
|
||||
void setTipType(enum TipType tipType, uint8_t manualCalGain) {
|
||||
if (manualCalGain)
|
||||
tipGainCalValue = manualCalGain;
|
||||
@@ -430,9 +429,10 @@ uint8_t getTipPWM() {
|
||||
void setTipPWM(uint8_t pulse) {
|
||||
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.
|
||||
if (pulse > 100)
|
||||
pulse = 100;
|
||||
|
||||
if (pulse > 255)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -259,12 +259,15 @@ static void gui_drawBatteryIcon() {
|
||||
// User is on a lithium battery
|
||||
// we need to calculate which of the 10 levels they are on
|
||||
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
|
||||
// Range is 42 -> 33 = 9 steps therefore we will use battery 1-10
|
||||
if (cellV < 33) cellV = 33;
|
||||
if (cellV < 33)
|
||||
cellV = 33;
|
||||
cellV -= 33; // Should leave us a number of 0-9
|
||||
if (cellV > 9) cellV = 9;
|
||||
if (cellV > 9)
|
||||
cellV = 9;
|
||||
OLED::drawBattery(cellV + 1);
|
||||
} else
|
||||
OLED::drawSymbol(15); // Draw the DC Logo
|
||||
@@ -309,7 +312,7 @@ static void gui_solderingTempAdjust() {
|
||||
// exit
|
||||
return;
|
||||
break;
|
||||
case BUTTON_F_LONG:
|
||||
case BUTTON_B_LONG:
|
||||
if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration >
|
||||
PRESS_ACCEL_INTERVAL_MAX) {
|
||||
systemSettings.SolderingTemp -= 10; // sub 10
|
||||
@@ -317,7 +320,7 @@ static void gui_solderingTempAdjust() {
|
||||
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
||||
}
|
||||
break;
|
||||
case BUTTON_B_LONG:
|
||||
case BUTTON_F_LONG:
|
||||
if (xTaskGetTickCount() - autoRepeatTimer + autoRepeatAcceleration >
|
||||
PRESS_ACCEL_INTERVAL_MAX) {
|
||||
systemSettings.SolderingTemp += 10;
|
||||
@@ -325,10 +328,10 @@ static void gui_solderingTempAdjust() {
|
||||
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
||||
}
|
||||
break;
|
||||
case BUTTON_B_SHORT:
|
||||
case BUTTON_F_SHORT:
|
||||
systemSettings.SolderingTemp += 10; // add 10
|
||||
break;
|
||||
case BUTTON_F_SHORT:
|
||||
case BUTTON_B_SHORT:
|
||||
systemSettings.SolderingTemp -= 10; // sub 10
|
||||
break;
|
||||
default:
|
||||
@@ -355,7 +358,11 @@ static void gui_solderingTempAdjust() {
|
||||
if (xTaskGetTickCount() - lastChange > 200)
|
||||
return; // exit if user just doesn't press anything for a bit
|
||||
|
||||
#ifdef MODEL_TS80
|
||||
if (!OLED::getRotation())
|
||||
#else
|
||||
if (OLED::getRotation())
|
||||
#endif
|
||||
OLED::drawChar('-');
|
||||
else
|
||||
OLED::drawChar('+');
|
||||
@@ -367,7 +374,11 @@ static void gui_solderingTempAdjust() {
|
||||
else
|
||||
OLED::drawSymbol(1);
|
||||
OLED::drawChar(' ');
|
||||
#ifdef MODEL_TS80
|
||||
if (!OLED::getRotation())
|
||||
#else
|
||||
if (OLED::getRotation())
|
||||
#endif
|
||||
OLED::drawChar('+');
|
||||
else
|
||||
OLED::drawChar('-');
|
||||
@@ -393,7 +404,8 @@ static int gui_SolderingSleepingMode() {
|
||||
|| (xTaskGetTickCount() - lastButtonTime < 100))
|
||||
return 0; // user moved or pressed a button, go back to soldering
|
||||
#ifdef MODEL_TS100
|
||||
if (checkVoltageForExit()) return 1; // return non-zero on error
|
||||
if (checkVoltageForExit())
|
||||
return 1; // return non-zero on error
|
||||
#endif
|
||||
if (systemSettings.temperatureInF) {
|
||||
currentlyActiveTemperatureTarget = ftoTipMeasurement(
|
||||
@@ -724,7 +736,7 @@ void startGUITask(void const *argument __unused) {
|
||||
bool buttonLockout = false;
|
||||
bool tempOnDisplay = false;
|
||||
getTipRawTemp(2); // reset filter
|
||||
OLED::setRotation(systemSettings.OrientationMode & 1);
|
||||
OLED::setRotation(!(systemSettings.OrientationMode & 1));
|
||||
uint32_t ticks = xTaskGetTickCount();
|
||||
ticks += 400; // 4 seconds from now
|
||||
while (xTaskGetTickCount() < ticks) {
|
||||
@@ -1009,7 +1021,7 @@ void startPIDTask(void const *argument __unused) {
|
||||
}
|
||||
#define MOVFilter 8
|
||||
void startMOVTask(void const *argument __unused) {
|
||||
OLED::setRotation(false);
|
||||
OLED::setRotation(true);
|
||||
|
||||
#ifdef MODEL_TS80
|
||||
startQC(systemSettings.voltageDiv);
|
||||
@@ -1022,7 +1034,7 @@ void startMOVTask(void const *argument __unused) {
|
||||
osDelay(250); // wait for accelerometer to stabilize
|
||||
#endif
|
||||
|
||||
OLED::setRotation(systemSettings.OrientationMode & 1);
|
||||
OLED::setRotation(!(systemSettings.OrientationMode & 1));
|
||||
lastMovementTime = 0;
|
||||
int16_t datax[MOVFilter] = { 0 };
|
||||
int16_t datay[MOVFilter] = { 0 };
|
||||
|
||||
@@ -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">
|
||||
<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="MODEL_TS80"/>
|
||||
<listOptionValue builtIn="false" value="STM32F1"/>
|
||||
<listOptionValue builtIn="false" value="STM32"/>
|
||||
<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">
|
||||
<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="MODEL_TS80"/>
|
||||
<listOptionValue builtIn="false" value="STM32F1"/>
|
||||
<listOptionValue builtIn="false" value="STM32"/>
|
||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<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 "${INPUTS}"" 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 "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
||||
Reference in New Issue
Block a user