1
0
forked from me/IronOS

Larger OLED Support (#1713)

* Update header to declare full buffer size

* Strip refactoring

* Refactor the OLED scrolldown part 1

* High res capable scroll down

* Allow button press to skip scroll

* Bunch of Misc Fixups
This commit is contained in:
Ben V. Brown
2023-06-18 22:50:31 +10:00
committed by GitHub
parent d3d8e3d2d5
commit c6918093fb
8 changed files with 160 additions and 127 deletions

View File

@@ -379,20 +379,32 @@ uint8_t preStartChecksDone() {
}
uint8_t getTipResistanceX10() {
#ifdef TIP_RESISTANCE_SENSE_Pin
// Return tip resistance in x10 ohms
// We can measure this using the op-amp
return lastTipResistance;
#else
return TIP_RESISTANCE;
#endif
}
uint8_t getTipThermalMass() {
#ifdef TIP_RESISTANCE_SENSE_Pin
if (lastTipResistance >= 80) {
return TIP_THERMAL_MASS;
}
return 45;
#else
return TIP_THERMAL_MASS;
#endif
}
uint8_t getTipInertia() {
#ifdef TIP_RESISTANCE_SENSE_Pin
if (lastTipResistance >= 80) {
return TIP_THERMAL_MASS;
}
return 10;
#else
return TIP_THERMAL_MASS;
#endif
}

View File

@@ -5,7 +5,7 @@
#include "Settings.h"
#include "USBPD.h"
#include "configuration.h"
#include "stm32f1xx_hal.h"
void power_check() {
#ifdef POW_PD
// Cant start QC until either PD works or fails
@@ -27,7 +27,7 @@ bool getIsPoweredByDCIN() {
#endif
#ifdef MODEL_TS101
// TODO have to check what we are using
return false;
return HAL_GPIO_ReadPin(DC_SELECT_GPIO_Port, DC_SELECT_Pin) == GPIO_PIN_SET;
#endif
#ifdef MODEL_TS100
return true;

View File

@@ -113,7 +113,7 @@ uint16_t getADCVin(uint8_t sample) {
latestADC += hadc2.Instance->JDR2;
latestADC += hadc2.Instance->JDR3;
latestADC += hadc2.Instance->JDR4;
latestADC <<= 3;
latestADC <<= 1;
filter.update(latestADC);
}
return filter.average();
@@ -333,7 +333,7 @@ static void MX_TIP_CONTROL_TIMER_Init(void) {
#ifdef TIP_HAS_DIRECT_PWM
sConfigOC.Pulse = 0; // PWM is direct to tip
#else
sConfigOC.Pulse = 127; // 50% duty cycle, that is AC coupled through the cap to provide an on signal (This does not do tip at 50% duty cycle)
sConfigOC.Pulse = 127; // 50% duty cycle, that is AC coupled through the cap to provide an on signal (This does not do tip at 50% duty cycle)
#endif
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
sConfigOC.OCFastMode = TIM_OCFAST_ENABLE;
@@ -352,7 +352,7 @@ static void MX_TIP_CONTROL_TIMER_Init(void) {
// Remap TIM3_CH1 to be on PB4
__HAL_AFIO_REMAP_TIM3_PARTIAL();
#else
// No re-map required
// No re-map required
#endif
HAL_TIM_PWM_Start(&htimTip, PWM_Out_CHANNEL);
}
@@ -496,8 +496,8 @@ static void MX_GPIO_Init(void) {
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
#endif
#else
/* TS80 */
/* Leave USB lines open circuit*/
/* TS80 */
/* Leave USB lines open circuit*/
#endif

View File

@@ -224,10 +224,10 @@
#ifdef MODEL_TS80
#define VOLTAGE_DIV 780 // Default divider from schematic
#define CALIBRATION_OFFSET 900 // the adc offset in uV
#define PID_POWER_LIMIT 24 // Sets the max pwm power limit
#define POWER_LIMIT 24 // 24 watts default power limit
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit
#define POWER_LIMIT 32 // 24 watts default power limit
#define HARDWARE_MAX_WATTAGE_X10 180
#define HARDWARE_MAX_WATTAGE_X10 320
#define POW_QC
@@ -238,9 +238,9 @@
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
#define CALIBRATION_OFFSET 1500 // the adc offset in uV
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit
#define POWER_LIMIT 30 // 30 watts default power limit
#define POWER_LIMIT 32 // 30 watts default power limit
#define HARDWARE_MAX_WATTAGE_X10 300
#define HARDWARE_MAX_WATTAGE_X10 320
#define POW_PD 1
#define POW_QC 1