Skip to content

Commit

Permalink
Implement getUserSelectedTipResistance() as stub
Browse files Browse the repository at this point in the history
  • Loading branch information
ia committed Dec 23, 2024
1 parent 0a63b6b commit 5f38e18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
13 changes: 0 additions & 13 deletions source/Core/BSP/Miniware/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ 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
Expand All @@ -398,17 +396,6 @@ 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; }
Expand Down
9 changes: 7 additions & 2 deletions source/Core/Inc/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,16 @@ typedef enum {
// #endif
TIP_TYPE_MAX, // Max value marker
} tipType_t;
uint8_t getUserSelectedTipResistance(); // returns the resistance matching the selected tip type or 0 for auto
#else
typedef enum { TIP_TYPE_MAX = 0 } tipType_t;
typedef enum {
TIP_TYPE_AUTO = 0, // value for the default case
TIP_TYPE_MAX = 0, // marker for settings when not supported
} tipType_t;
#endif /* TIP_TYPE_SUPPORT */

// returns the resistance matching the selected tip type or 0 for auto and when not supported
uint8_t getUserSelectedTipResistance();

// Settings wide operations
void saveSettings();
bool loadSettings();
Expand Down
2 changes: 2 additions & 0 deletions source/Core/Src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,6 @@ uint8_t getUserSelectedTipResistance() {
break;
}
}
#else
uint8_t getUserSelectedTipResistance() { return tipType_t::TIP_TYPE_AUTO; }
#endif /* TIP_TYPE_SUPPORT */

0 comments on commit 5f38e18

Please sign in to comment.