diff --git a/source/Core/BSP/Miniware/BSP.cpp b/source/Core/BSP/Miniware/BSP.cpp index fed937e322..f14612582e 100644 --- a/source/Core/BSP/Miniware/BSP.cpp +++ b/source/Core/BSP/Miniware/BSP.cpp @@ -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 } \ No newline at end of file diff --git a/source/Core/BSP/Miniware/Power.cpp b/source/Core/BSP/Miniware/Power.cpp index 423fe528e9..58eebe5220 100644 --- a/source/Core/BSP/Miniware/Power.cpp +++ b/source/Core/BSP/Miniware/Power.cpp @@ -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; diff --git a/source/Core/BSP/Miniware/Setup.cpp b/source/Core/BSP/Miniware/Setup.cpp index 2bdc7a8938..27b3b1e8af 100644 --- a/source/Core/BSP/Miniware/Setup.cpp +++ b/source/Core/BSP/Miniware/Setup.cpp @@ -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 diff --git a/source/Core/BSP/Miniware/configuration.h b/source/Core/BSP/Miniware/configuration.h index 9be7918ba1..8c4145d0a1 100644 --- a/source/Core/BSP/Miniware/configuration.h +++ b/source/Core/BSP/Miniware/configuration.h @@ -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