Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address settings bounds checks #1116 #1117

Merged
merged 6 commits into from
Dec 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions source/Core/BSP/MHP30/configuration.h
Original file line number Diff line number Diff line change
@@ -95,8 +95,9 @@
#define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0
#define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0

#define THERMAL_RUNAWAY_TIME_SEC 20
#define THERMAL_RUNAWAY_TEMP_C 20
// Due to large thermal mass of the PCB being heated we need to pull this back a bit
#define THERMAL_RUNAWAY_TIME_SEC 45
#define THERMAL_RUNAWAY_TEMP_C 3

#define CUT_OUT_SETTING 0 // default to no cut-off voltage
#define RECOM_VOL_CELL 33 // Minimum voltage per cell (Recommended 3.3V (33))
@@ -118,25 +119,26 @@
#endif

#ifdef MODEL_MHP30
#define SOLDERING_TEMP 200 // Default soldering temp is 200.0 °C
#define VOLTAGE_DIV 360 // Default for MHP30
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 0 // the adc offset in uV - MHP compensates automagically
#define POWER_LIMIT 65 // 65 watts default power limit
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 1 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_MHP30 //
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define MODEL_HAS_DCDC // Has inductor to current filter
#define PID_TIM_HZ (16) //
#define MAX_TEMP_C 300 // Max soldering temp selectable °C
#define MAX_TEMP_F 570 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#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_F 300 // The min settable temp for boost mode °F
#define NO_DISPLAY_ROTATE // Disable OLED rotation by accel
#define SLEW_LIMIT 50 // Limit to 3.0 Watts per 64ms pid loop update rate slew rate
#define SOLDERING_TEMP 200 // Default soldering temp is 200.0 °C
#define VOLTAGE_DIV 360 // Default for MHP30
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
#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 MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 1 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_MHP30 //
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define MODEL_HAS_DCDC // Has inductor to current filter
#define PID_TIM_HZ (16) //
#define MAX_TEMP_C 350 // Max soldering temp selectable °C
#define MAX_TEMP_F 660 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#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_F 300 // The min settable temp for boost mode °F
#define NO_DISPLAY_ROTATE // Disable OLED rotation by accel
#define SLEW_LIMIT 50 // Limit to 3.0 Watts per 64ms pid loop update rate slew rate
#define ACCEL_MSA
#define POW_PD 1
#define TEMP_NTC
105 changes: 54 additions & 51 deletions source/Core/BSP/Miniware/configuration.h
Original file line number Diff line number Diff line change
@@ -125,23 +125,24 @@
#endif

#ifdef MODEL_TS100
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
#define POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 70 //
#define POWER_LIMIT_STEPS 5 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 //
#define TEMP_uV_LOOKUP_HAKKO //
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#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 POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 70 //
#define POWER_LIMIT_STEPS 5 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 //
#define TEMP_uV_LOOKUP_HAKKO //
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define POW_DC
#define ACCEL_MMA
#define POW_PD 0
@@ -150,23 +151,24 @@
#endif

#ifdef MODEL_TS80
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 780 // Default divider from schematic
#define PID_POWER_LIMIT 24 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 900 // the adc offset in uV
#define POWER_LIMIT 24 // 24 watts default power limit
#define MAX_POWER_LIMIT 40 //
#define POWER_LIMIT_STEPS 2 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS80 //
#define TEMP_uV_LOOKUP_TS80 //
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 780 // Default divider from schematic
#define PID_POWER_LIMIT 24 // Sets the max pwm power limit
#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 MAX_POWER_LIMIT 40 //
#define POWER_LIMIT_STEPS 2 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS80 //
#define TEMP_uV_LOOKUP_TS80 //
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define ACCEL_LIS
#define POW_QC
#define POW_PD 0
@@ -176,23 +178,24 @@
#endif

#ifdef MODEL_TS80P
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 1500 // the adc offset in uV
#define POWER_LIMIT 30 // 30 watts default power limit
#define MAX_POWER_LIMIT 40 //
#define POWER_LIMIT_STEPS 2 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS80 //
#define TEMP_uV_LOOKUP_TS80 //
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 650 // Default for TS80P with slightly different resistors
#define PID_POWER_LIMIT 35 // Sets the max pwm power limit
#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 MAX_POWER_LIMIT 40 //
#define POWER_LIMIT_STEPS 2 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS80 //
#define TEMP_uV_LOOKUP_TS80 //
#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define ACCEL_LIS
#define ACCEL_MSA
#define POW_PD 1
35 changes: 18 additions & 17 deletions source/Core/BSP/Pine64/configuration.h
Original file line number Diff line number Diff line change
@@ -114,23 +114,24 @@
#endif

#ifdef MODEL_Pinecil
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
#define POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 70 //
#define POWER_LIMIT_STEPS 5 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_PINECIL // Uses TS100 resistors
#define TEMP_uV_LOOKUP_HAKKO // Use Hakko lookup table
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#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 POWER_LIMIT 0 // 0 watts default limit
#define MAX_POWER_LIMIT 70 //
#define POWER_LIMIT_STEPS 5 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_PINECIL // Uses TS100 resistors
#define TEMP_uV_LOOKUP_HAKKO // Use Hakko lookup table
#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate
#define PID_TIM_HZ (8) // Tick rate of the PID loop
#define MAX_TEMP_C 450 // Max soldering temp selectable °C
#define MAX_TEMP_F 850 // Max soldering temp selectable °F
#define MIN_TEMP_C 10 // Min soldering temp selectable °C
#define MIN_TEMP_F 60 // Min soldering temp selectable °F
#define MIN_BOOST_TEMP_C 250 // The min settable temp for boost mode °C
#define MIN_BOOST_TEMP_F 480 // The min settable temp for boost mode °F

#define POW_PD 1
#define POW_QC 1
2 changes: 1 addition & 1 deletion source/Core/Drivers/usb-pd
Loading