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

@@ -123,6 +123,7 @@ typedef enum {
* Some devices allow multiple types of tips to be fitted, this allows selecting them or overriding the logic
* The first type will be the default (gets value of 0)
*/
#ifdef TIP_TYPE_SUPPORT
typedef enum {
#ifdef AUTO_TIP_SELECTION
TIP_TYPE_AUTO, // If the hardware supports automatic detection
@@ -143,6 +144,9 @@ typedef enum {
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;
#endif /* TIP_TYPE_SUPPORT */
// Settings wide operations
void saveSettings();
@@ -162,5 +166,7 @@ void setSettingValue(const enum SettingsOptions option, const uint16_t newValue)
// Special access helpers, to reduce logic duplication
uint8_t lookupVoltageLevel();
uint16_t lookupHallEffectThreshold();
#ifdef TIP_TYPE_SUPPORT
const char *lookupTipName(); // Get the name string for the current soldering tip
#endif /* TIP_TYPE_SUPPORT */
#endif /* SETTINGS_H_ */