@@ -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 instant);
|
uint16_t getTipRawTemp(uint8_t instant);
|
||||||
uint16_t getInputVoltageX10(uint16_t divisor);
|
uint16_t getInputVoltageX10(uint16_t divisor);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||||
@@ -171,14 +170,14 @@ uint8_t QCMode = 0;
|
|||||||
uint8_t QCTries = 0;
|
uint8_t QCTries = 0;
|
||||||
void seekQC(int16_t Vx10,uint16_t divisor) {
|
void seekQC(int16_t Vx10,uint16_t divisor) {
|
||||||
if (QCMode == 5)
|
if (QCMode == 5)
|
||||||
startQC(divisor);
|
startQC(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 < 50)
|
||||||
return;
|
return;
|
||||||
if(Vx10>130)
|
if(Vx10>130)
|
||||||
Vx10=130;//Cap max value at 13V
|
Vx10=130;//Cap max value at 13V
|
||||||
// Seek the QC to the Voltage given if this adapter supports continuous mode
|
// Seek the QC to the Voltage given if this adapter supports continuous mode
|
||||||
// try and step towards the wanted value
|
// try and step towards the wanted value
|
||||||
|
|
||||||
@@ -250,7 +249,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;
|
||||||
@@ -292,7 +291,7 @@ void startQC(uint16_t divisor) {
|
|||||||
}
|
}
|
||||||
// Check if D- is low to spot a QC charger
|
// Check if D- is low to spot a QC charger
|
||||||
if (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == GPIO_PIN_RESET)
|
if (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_11) == GPIO_PIN_RESET)
|
||||||
enteredQC = 1;
|
enteredQC = 1;
|
||||||
if (enteredQC) {
|
if (enteredQC) {
|
||||||
// We have a QC capable charger
|
// We have a QC capable charger
|
||||||
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_3, GPIO_PIN_SET);
|
||||||
@@ -312,7 +311,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);
|
||||||
@@ -323,14 +322,14 @@ void startQC(uint16_t divisor) {
|
|||||||
QCMode = 5;
|
QCMode = 5;
|
||||||
QCTries++;
|
QCTries++;
|
||||||
if (QCTries > 10) // 10 goes to get it going
|
if (QCTries > 10) // 10 goes to get it going
|
||||||
QCMode = 0;
|
QCMode = 0;
|
||||||
} else {
|
} else {
|
||||||
// no QC
|
// no QC
|
||||||
QCMode = 0;
|
QCMode = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (QCTries > 10)
|
if (QCTries > 10)
|
||||||
QCMode = 0;
|
QCMode = 0;
|
||||||
}
|
}
|
||||||
// Get tip resistance in milliohms
|
// Get tip resistance in milliohms
|
||||||
uint32_t calculateTipR(uint8_t useFilter) {
|
uint32_t calculateTipR(uint8_t useFilter) {
|
||||||
@@ -344,7 +343,7 @@ uint32_t calculateTipR(uint8_t useFilter) {
|
|||||||
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 = getTipInstantTemperature();
|
uint32_t offReading = getTipInstantTemperature();
|
||||||
@@ -358,8 +357,8 @@ uint32_t calculateTipR(uint8_t useFilter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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 too 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++) {
|
||||||
if (useFilter == 0) {
|
if (useFilter == 0) {
|
||||||
@@ -377,7 +376,7 @@ uint32_t calculateTipR(uint8_t useFilter) {
|
|||||||
// 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;
|
||||||
@@ -385,10 +384,10 @@ static unsigned int sqrt32(unsigned long n) {
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (g * g > n)
|
if (g * g > n)
|
||||||
g ^= c;
|
g ^= c;
|
||||||
c >>= 1;
|
c >>= 1;
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
return g;
|
return g;
|
||||||
g |= c;
|
g |= c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -399,26 +398,26 @@ int16_t calculateMaxVoltage(uint8_t useFilter, uint8_t useHP) {
|
|||||||
uint32_t milliOhms = calculateTipR(useFilter);
|
uint32_t milliOhms = calculateTipR(useFilter);
|
||||||
// Check no tip
|
// Check no tip
|
||||||
if (milliOhms > 10000)
|
if (milliOhms > 10000)
|
||||||
return -1;
|
return -1;
|
||||||
//
|
//
|
||||||
// V = sqrt(18W*R)
|
// V = sqrt(18W*R)
|
||||||
// Convert this to sqrt(18W)*sqrt(milli ohms)*sqrt(1/1000)
|
// Convert this to sqrt(18W)*sqrt(milli ohms)*sqrt(1/1000)
|
||||||
|
|
||||||
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
|
||||||
Vx /= 100;
|
Vx /= 100;
|
||||||
if (Vx % 10 >= 5)
|
if (Vx % 10 >= 5)
|
||||||
Vx += 10;
|
Vx += 10;
|
||||||
Vx /= 10;
|
Vx /= 10;
|
||||||
// Round to nearest increment of 2
|
// Round to nearest increment of 2
|
||||||
if (Vx % 2 == 1)
|
if (Vx % 2 == 1)
|
||||||
Vx++;
|
Vx++;
|
||||||
return Vx;
|
return Vx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,9 +429,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -259,34 +259,37 @@ 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
|
||||||
#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);
|
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) {
|
||||||
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() {
|
||||||
@@ -309,7 +312,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
|
||||||
@@ -317,7 +320,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;
|
||||||
@@ -325,10 +328,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:
|
||||||
@@ -355,7 +358,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('+');
|
||||||
@@ -367,7 +374,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('-');
|
||||||
@@ -393,7 +404,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(
|
||||||
@@ -654,9 +666,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((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
|
||||||
OLED::setCursor(0, 8); // second line
|
OLED::setCursor(0, 8); // second line
|
||||||
OLED::print(HEADERS[screen]);
|
OLED::print(HEADERS[screen]);
|
||||||
@@ -724,7 +736,7 @@ void startGUITask(void const *argument __unused) {
|
|||||||
bool buttonLockout = false;
|
bool buttonLockout = false;
|
||||||
bool tempOnDisplay = false;
|
bool tempOnDisplay = false;
|
||||||
getTipRawTemp(2); // reset filter
|
getTipRawTemp(2); // 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) {
|
||||||
@@ -784,11 +796,11 @@ void startGUITask(void const *argument __unused) {
|
|||||||
OLED::setFont(0);
|
OLED::setFont(0);
|
||||||
OLED::displayOnOff(true); // turn lcd on
|
OLED::displayOnOff(true); // turn lcd on
|
||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
//Here we re-check for tip presence
|
//Here we re-check for tip presence
|
||||||
if (idealQCVoltage < 90)
|
if (idealQCVoltage < 90)
|
||||||
idealQCVoltage = calculateMaxVoltage(1,
|
idealQCVoltage = calculateMaxVoltage(1,
|
||||||
systemSettings.cutoutSetting); // 1 means use filtered values rather than do its own
|
systemSettings.cutoutSetting);// 1 means use filtered values rather than do its own
|
||||||
seekQC(idealQCVoltage,systemSettings.voltageDiv);
|
seekQC(idealQCVoltage,systemSettings.voltageDiv);
|
||||||
#endif
|
#endif
|
||||||
gui_solderingMode(0); // enter soldering mode
|
gui_solderingMode(0); // enter soldering mode
|
||||||
buttonLockout = true;
|
buttonLockout = true;
|
||||||
@@ -850,7 +862,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);
|
||||||
@@ -869,7 +881,7 @@ void startGUITask(void const *argument __unused) {
|
|||||||
// draw temp over the start soldering button
|
// draw temp over the start soldering button
|
||||||
// Location changes on screen rotation
|
// Location changes on screen rotation
|
||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
if (!OLED::getRotation()) {
|
if (!OLED::getRotation()) {
|
||||||
#else
|
#else
|
||||||
if (OLED::getRotation()) {
|
if (OLED::getRotation()) {
|
||||||
#endif
|
#endif
|
||||||
@@ -908,11 +920,11 @@ void startPIDTask(void const *argument __unused) {
|
|||||||
*/
|
*/
|
||||||
setTipPWM(0); // disable the output driver if the output is set to be off
|
setTipPWM(0); // disable the output driver if the output is set to be off
|
||||||
#ifdef MODEL_TS100
|
#ifdef MODEL_TS100
|
||||||
for (uint8_t i = 0; i < 50; i++) {
|
for (uint8_t i = 0; i < 50; i++) {
|
||||||
osDelay(10);
|
osDelay(10);
|
||||||
getTipRawTemp(1); // cycle up the tip temp filter
|
getTipRawTemp(1); // cycle up the tip temp filter
|
||||||
HAL_IWDG_Refresh(&hiwdg);
|
HAL_IWDG_Refresh(&hiwdg);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// On the TS80 we can measure the tip resistance before cycling the filter a
|
// On the TS80 we can measure the tip resistance before cycling the filter a
|
||||||
// bit
|
// bit
|
||||||
@@ -1009,20 +1021,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 };
|
||||||
@@ -1102,9 +1114,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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"/>
|
||||||
|
|||||||
@@ -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 "${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.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
|||||||
Reference in New Issue
Block a user