Start linking in manual tip resistance
Some checks failed
CI / check_python (push) Has been cancelled
CI / check_shell (push) Has been cancelled
CI / check_readme (push) Has been cancelled
CI / build (MHP30) (push) Has been cancelled
CI / build (Pinecil) (push) Has been cancelled
CI / build (Pinecilv2) (push) Has been cancelled
CI / build (S60) (push) Has been cancelled
CI / build (S60P) (push) Has been cancelled
CI / build (T55) (push) Has been cancelled
CI / build (TS100) (push) Has been cancelled
CI / build (TS101) (push) Has been cancelled
CI / build (TS80) (push) Has been cancelled
CI / build (TS80P) (push) Has been cancelled
CI / build_multi-lang (Pinecil) (push) Has been cancelled
CI / build_multi-lang (Pinecilv2) (push) Has been cancelled
CI / tests (push) Has been cancelled
CI / check_c-cpp (push) Has been cancelled
CI / upload_metadata (push) Has been cancelled

This commit is contained in:
Ben V. Brown
2024-09-09 20:32:35 +10:00
parent 4e42cdda44
commit adf86b3461
9 changed files with 94 additions and 12 deletions

View File

@@ -1,4 +1,3 @@
version: "3"
name: "ironos" name: "ironos"
services: services:
builder: builder:

View File

@@ -382,9 +382,18 @@ uint8_t getTipResistanceX10() {
#ifdef TIP_RESISTANCE_SENSE_Pin #ifdef TIP_RESISTANCE_SENSE_Pin
// Return tip resistance in x10 ohms // Return tip resistance in x10 ohms
// We can measure this using the op-amp // We can measure this using the op-amp
return lastTipResistance; uint8_t user_selected_tip = getUserSelectedTipResistance();
if (user_selected_tip == 0) {
return lastTipResistance; // Auto mode
}
return user_selected_tip;
#else #else
return TIP_RESISTANCE; uint8_t user_selected_tip = getUserSelectedTipResistance();
if (user_selected_tip == 0) {
return TIP_RESISTANCE; // Auto mode
}
return user_selected_tip;
#endif #endif
} }
#ifdef TIP_RESISTANCE_SENSE_Pin #ifdef TIP_RESISTANCE_SENSE_Pin

View File

@@ -93,7 +93,13 @@ void setBuzzer(bool on) {}
uint8_t preStartChecks() { return 1; } uint8_t preStartChecks() { return 1; }
uint64_t getDeviceID() { return dbg_id_get(); } uint64_t getDeviceID() { return dbg_id_get(); }
uint8_t getTipResistanceX10() { return TIP_RESISTANCE; } uint8_t getTipResistanceX10() {
uint8_t user_selected_tip = getUserSelectedTipResistance();
if (user_selected_tip == 0) {
return TIP_RESISTANCE; // Auto mode
}
return user_selected_tip;
}
bool isTipShorted() { return false; } bool isTipShorted() { return false; }
uint8_t preStartChecksDone() { return 1; } uint8_t preStartChecksDone() { return 1; }

View File

@@ -152,7 +152,11 @@ uint8_t tipResistanceReadingSlot = 0;
uint8_t getTipResistanceX10() { uint8_t getTipResistanceX10() {
// Return tip resistance in x10 ohms // Return tip resistance in x10 ohms
// We can measure this using the op-amp // We can measure this using the op-amp
return lastTipResistance; uint8_t user_selected_tip = getUserSelectedTipResistance();
if (user_selected_tip == 0) {
return lastTipResistance; // Auto mode
}
return user_selected_tip;
} }
uint16_t getTipThermalMass() { return 120; } uint16_t getTipThermalMass() { return 120; }

View File

@@ -155,6 +155,8 @@
#define POW_EPR 1 #define POW_EPR 1
#define ENABLE_QC2 1 #define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1 #define MAG_SLEEP_SUPPORT 1
#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 #define DEVICE_HAS_VALIDATION_SUPPORT
#define OLED_96x16 1 #define OLED_96x16 1
#define TEMP_NTC #define TEMP_NTC

View File

@@ -262,7 +262,11 @@ uint8_t getTipResistanceX10() {
return TIP_RESISTANCE + ((TIP_RESISTANCE * scaler) / 100000); return TIP_RESISTANCE + ((TIP_RESISTANCE * scaler) / 100000);
#else #else
return TIP_RESISTANCE; uint8_t user_selected_tip = getUserSelectedTipResistance();
if (user_selected_tip == 0) {
return TIP_RESISTANCE; // Auto mode
}
return user_selected_tip;
#endif #endif
} }
bool isTipShorted() { return false; } bool isTipShorted() { return false; }

View File

@@ -11,7 +11,7 @@
#define CORE_SETTINGS_H_ #define CORE_SETTINGS_H_
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include "configuration.h"
#ifdef MODEL_Pinecilv2 #ifdef MODEL_Pinecilv2
// Required settings reset for PR #1916 // Required settings reset for PR #1916
#define SETTINGSVERSION (0x55AB) // This number is frozen, do not edit #define SETTINGSVERSION (0x55AB) // This number is frozen, do not edit
@@ -124,7 +124,7 @@ typedef enum {
*/ */
typedef enum { typedef enum {
#ifdef AUTO_TIP_SELECTION #ifdef AUTO_TIP_SELECTION
AUTO, // If the hardware supports automatic detection TIP_TYPE_AUTO, // If the hardware supports automatic detection
#endif #endif
#ifdef TIPTYPE_T12 #ifdef TIPTYPE_T12
@@ -137,11 +137,12 @@ typedef enum {
// We do not know of other tuning tips (?yet?) // We do not know of other tuning tips (?yet?)
#endif #endif
#ifdef TIPTYPE_JBC #ifdef TIPTYPE_JBC
JBC_2_5_OHM, // Small JBC tips as used in the S60 JBC_210_2_5_OHM, // Small JBC tips as used in the S60/S60P
#endif #endif
TIP_TYPE_MAX, // Max value marker TIP_TYPE_MAX, // Max value marker
} tipType_t; } tipType_t;
uint8_t getUserSelectedTipResistance();
// Settings wide operations // Settings wide operations
void saveSettings(); void saveSettings();

View File

@@ -304,12 +304,69 @@ const char *lookupTipName() {
switch (value) { switch (value) {
#ifdef AUTO_TIP_SELECTION #ifdef AUTO_TIP_SELECTION
case tipType_t::AUTO: case tipType_t::TIP_TYPE_AUTO:
return translatedString(Tr->USBPDModeDefault); return translatedString(Tr->TipTypeAuto);
break;
#endif
#ifdef TIPTYPE_T12
case tipType_t::T12_8_OHM:
return translatedString(Tr->TipTypeT12Long);
break;
case tipType_t::T12_6_2_OHM:
return translatedString(Tr->TipTypeT12Short);
break;
case tipType_t::T12_4_OHM:
return translatedString(Tr->TipTypeT12PTS);
break;
#endif
#ifdef TIPTYE_TS80
case tipType_t::TS80_4_5_OHM:
return translatedString(Tr->TipTypeTS80);
break;
#endif
#ifdef TIPTYPE_JBC
case tipType_t::JBC_210_2_5_OHM:
return translatedString(Tr->TipTypeJBC);
break; break;
#endif #endif
default: default:
return nullptr; return nullptr;
break; break;
} }
}
// Returns the resistance for the current tip selected by the user or 0 for auto
uint8_t getUserSelectedTipResistance() {
tipType_t value = (tipType_t)getSettingValue(SettingsOptions::SolderingTipType);
switch (value) {
#ifdef AUTO_TIP_SELECTION
case tipType_t::TIP_TYPE_AUTO:
return 0;
break;
#endif
#ifdef TIPTYPE_T12
case tipType_t::T12_8_OHM:
return 80;
break;
case tipType_t::T12_6_2_OHM:
return 62;
break;
case tipType_t::T12_4_OHM:
return 40;
break;
#endif
#ifdef TIPTYE_TS80
case tipType_t::TS80_4_5_OHM:
return 45;
break;
#endif
#ifdef TIPTYPE_JBC
case tipType_t::JBC_210_2_5_OHM:
return 25;
break;
#endif
default:
return 0;
break;
}
} }

View File

@@ -1,5 +1,5 @@
ifndef model ifndef model
model:=Pinecil model:=Pinecilv2
endif endif
ALL_MINIWARE_MODELS=TS100 TS80 TS80P TS101 ALL_MINIWARE_MODELS=TS100 TS80 TS80P TS101