Handle different calibration offset ranges for MHP30
This commit is contained in:
@@ -94,8 +94,9 @@
|
|||||||
*/
|
*/
|
||||||
#define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0
|
#define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0
|
||||||
#define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0
|
#define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0
|
||||||
|
|
||||||
// Due to large thermal mass of the PCB being heated we need to pull this back a bit
|
// Due to large thermal mass of the PCB being heated we need to pull this back a bit
|
||||||
#define THERMAL_RUNAWAY_TIME_SEC 30
|
#define THERMAL_RUNAWAY_TIME_SEC 45
|
||||||
#define THERMAL_RUNAWAY_TEMP_C 3
|
#define THERMAL_RUNAWAY_TEMP_C 3
|
||||||
|
|
||||||
#define CUT_OUT_SETTING 0 // default to no cut-off voltage
|
#define CUT_OUT_SETTING 0 // default to no cut-off voltage
|
||||||
@@ -122,6 +123,7 @@
|
|||||||
#define VOLTAGE_DIV 360 // Default for MHP30
|
#define VOLTAGE_DIV 360 // Default for MHP30
|
||||||
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
|
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
|
||||||
#define CALIBRATION_OFFSET 0 // the adc offset in uV - MHP compensates automagically
|
#define CALIBRATION_OFFSET 0 // the adc offset in uV - MHP compensates automagically
|
||||||
|
#define MIN_CALIBRATION_OFFSET 0 // Min value for calibration
|
||||||
#define POWER_LIMIT 65 // 65 watts default power limit
|
#define POWER_LIMIT 65 // 65 watts default power limit
|
||||||
#define MAX_POWER_LIMIT 65 //
|
#define MAX_POWER_LIMIT 65 //
|
||||||
#define POWER_LIMIT_STEPS 1 //
|
#define POWER_LIMIT_STEPS 1 //
|
||||||
@@ -129,8 +131,8 @@
|
|||||||
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
|
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
|
||||||
#define MODEL_HAS_DCDC // Has inductor to current filter
|
#define MODEL_HAS_DCDC // Has inductor to current filter
|
||||||
#define PID_TIM_HZ (16) //
|
#define PID_TIM_HZ (16) //
|
||||||
#define MAX_TEMP_C 300 // Max soldering temp selectable °C
|
#define MAX_TEMP_C 350 // Max soldering temp selectable °C
|
||||||
#define MAX_TEMP_F 570 // Max soldering temp selectable °F
|
#define MAX_TEMP_F 660 // Max soldering temp selectable °F
|
||||||
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
|
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
|
||||||
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
|
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
|
||||||
#define MIN_BOOST_TEMP_C 150 // The min settable temp for boost mode °C
|
#define MIN_BOOST_TEMP_C 150 // The min settable temp for boost mode °C
|
||||||
|
|||||||
@@ -128,6 +128,7 @@
|
|||||||
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
|
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
|
||||||
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
|
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
|
||||||
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
|
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
|
||||||
|
#define MIN_CALIBRATION_OFFSET 100 // Min value for calibration
|
||||||
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
|
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
|
||||||
#define POWER_LIMIT 0 // 0 watts default limit
|
#define POWER_LIMIT 0 // 0 watts default limit
|
||||||
#define MAX_POWER_LIMIT 70 //
|
#define MAX_POWER_LIMIT 70 //
|
||||||
@@ -154,6 +155,7 @@
|
|||||||
#define VOLTAGE_DIV 780 // Default divider from schematic
|
#define VOLTAGE_DIV 780 // Default divider from schematic
|
||||||
#define PID_POWER_LIMIT 24 // Sets the max pwm power limit
|
#define PID_POWER_LIMIT 24 // Sets the max pwm power limit
|
||||||
#define CALIBRATION_OFFSET 900 // the adc offset in uV
|
#define CALIBRATION_OFFSET 900 // the adc offset in uV
|
||||||
|
#define MIN_CALIBRATION_OFFSET 100 // Min value for calibration
|
||||||
#define POWER_LIMIT 24 // 24 watts default power limit
|
#define POWER_LIMIT 24 // 24 watts default power limit
|
||||||
#define MAX_POWER_LIMIT 40 //
|
#define MAX_POWER_LIMIT 40 //
|
||||||
#define POWER_LIMIT_STEPS 2 //
|
#define POWER_LIMIT_STEPS 2 //
|
||||||
@@ -180,6 +182,7 @@
|
|||||||
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
|
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
|
||||||
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit
|
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit
|
||||||
#define CALIBRATION_OFFSET 1500 // the adc offset in uV
|
#define CALIBRATION_OFFSET 1500 // the adc offset in uV
|
||||||
|
#define MIN_CALIBRATION_OFFSET 100 // Min value for calibration
|
||||||
#define POWER_LIMIT 30 // 30 watts default power limit
|
#define POWER_LIMIT 30 // 30 watts default power limit
|
||||||
#define MAX_POWER_LIMIT 40 //
|
#define MAX_POWER_LIMIT 40 //
|
||||||
#define POWER_LIMIT_STEPS 2 //
|
#define POWER_LIMIT_STEPS 2 //
|
||||||
|
|||||||
@@ -117,6 +117,7 @@
|
|||||||
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
|
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
|
||||||
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
|
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
|
||||||
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
|
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
|
||||||
|
#define MIN_CALIBRATION_OFFSET 100 // Min value for calibration
|
||||||
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
|
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
|
||||||
#define POWER_LIMIT 0 // 0 watts default limit
|
#define POWER_LIMIT 0 // 0 watts default limit
|
||||||
#define MAX_POWER_LIMIT 70 //
|
#define MAX_POWER_LIMIT 70 //
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
|||||||
{1, POWER_PULSE_DURATION_MAX, 1, POWER_PULSE_DURATION_DEFAULT}, // KeepAwakePulseDuration
|
{1, POWER_PULSE_DURATION_MAX, 1, POWER_PULSE_DURATION_DEFAULT}, // KeepAwakePulseDuration
|
||||||
{360, 900, 1, VOLTAGE_DIV}, // VoltageDiv
|
{360, 900, 1, VOLTAGE_DIV}, // VoltageDiv
|
||||||
{MIN_TEMP_C, MAX_TEMP_F, 10, BOOST_TEMP}, // BoostTemp
|
{MIN_TEMP_C, MAX_TEMP_F, 10, BOOST_TEMP}, // BoostTemp
|
||||||
{100, 2500, 1, CALIBRATION_OFFSET}, // CalibrationOffset
|
{MIN_CALIBRATION_OFFSET, 2500, 1, CALIBRATION_OFFSET}, // CalibrationOffset
|
||||||
{0, MAX_POWER_LIMIT, POWER_LIMIT_STEPS, POWER_LIMIT}, // PowerLimit
|
{0, MAX_POWER_LIMIT, POWER_LIMIT_STEPS, POWER_LIMIT}, // PowerLimit
|
||||||
{0, 1, 1, REVERSE_BUTTON_TEMP_CHANGE}, // ReverseButtonTempChangeEnabled
|
{0, 1, 1, REVERSE_BUTTON_TEMP_CHANGE}, // ReverseButtonTempChangeEnabled
|
||||||
{5, TEMP_CHANGE_LONG_STEP_MAX, 5, TEMP_CHANGE_LONG_STEP}, // TempChangeLongStep
|
{5, TEMP_CHANGE_LONG_STEP_MAX, 5, TEMP_CHANGE_LONG_STEP}, // TempChangeLongStep
|
||||||
@@ -104,6 +104,7 @@ bool sanitiseSettings() {
|
|||||||
if (systemSettings.versionMarker != 0x55AA) {
|
if (systemSettings.versionMarker != 0x55AA) {
|
||||||
memset((void *)&systemSettings, 0xFF, sizeof(systemSettings));
|
memset((void *)&systemSettings, 0xFF, sizeof(systemSettings));
|
||||||
systemSettings.versionMarker = 0x55AA;
|
systemSettings.versionMarker = 0x55AA;
|
||||||
|
dirty = true;
|
||||||
}
|
}
|
||||||
if (systemSettings.padding != 0xFFFFFFFF) {
|
if (systemSettings.padding != 0xFFFFFFFF) {
|
||||||
systemSettings.padding = 0xFFFFFFFF; // Force padding to 0xFFFFFFFF so that rolling forwards / back should be easier
|
systemSettings.padding = 0xFFFFFFFF; // Force padding to 0xFFFFFFFF so that rolling forwards / back should be easier
|
||||||
@@ -120,7 +121,6 @@ bool sanitiseSettings() {
|
|||||||
// Check min max for all settings, if outside the range, move to default
|
// Check min max for all settings, if outside the range, move to default
|
||||||
if (systemSettings.settingsValues[i] < settingsConstants[i].min || systemSettings.settingsValues[i] > settingsConstants[i].max) {
|
if (systemSettings.settingsValues[i] < settingsConstants[i].min || systemSettings.settingsValues[i] > settingsConstants[i].max) {
|
||||||
systemSettings.settingsValues[i] = settingsConstants[i].defaultValue;
|
systemSettings.settingsValues[i] = settingsConstants[i].defaultValue;
|
||||||
|
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user