1
0
forked from me/IronOS

Add macro to enable tip types for supported hardware only

This commit is contained in:
Ivan Zorin
2024-12-23 21:13:44 +03:00
parent 71a1e2a367
commit 0a63b6b5df
6 changed files with 38 additions and 4 deletions

View File

@@ -379,6 +379,8 @@ uint8_t preStartChecksDone() {
#endif
}
#ifdef TIP_TYPE_SUPPORT
// new version for models supporting tips of different length/resistance
uint8_t getTipResistanceX10() {
#ifdef TIP_RESISTANCE_SENSE_Pin
// Return tip resistance in x10 ohms
@@ -388,7 +390,6 @@ uint8_t getTipResistanceX10() {
return lastTipResistance; // Auto mode
}
return user_selected_tip;
#else
uint8_t user_selected_tip = getUserSelectedTipResistance();
if (user_selected_tip == 0) {
@@ -397,6 +398,18 @@ uint8_t getTipResistanceX10() {
return user_selected_tip;
#endif
}
#else /* no tip type support: legacy version */
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
}
#endif /* TIP_TYPE_SUPPORT */
#ifdef TIP_RESISTANCE_SENSE_Pin
bool isTipShorted() { return tipShorted; }
#else

View File

@@ -218,6 +218,7 @@
#define TEMP_NTC 1
#define ACCEL_I2CBB1 1
#define POW_EPR 1
#define TIP_TYPE_SUPPORT 1 // Support for tips of different types, i.e. resistance
#define AUTO_TIP_SELECTION 1 // Can auto-select the tip
#define TIPTYPE_T12 1 // Can manually pick a T12 tip
#define HAS_POWER_DEBUG_MENU

View File

@@ -154,6 +154,7 @@
#define POW_EPR 1
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define TIP_TYPE_SUPPORT 1 // Support for tips of different types, i.e. resistance
#define AUTO_TIP_SELECTION 1 // Can auto-select the tip
#define TIPTYPE_T12 1 // Can manually pick a T12 tip
#define DEVICE_HAS_VALIDATION_SUPPORT