Custom tip type selection (#1977)
* Minor doc updates * pydoc * Draft tip selection menu * Start linking in manual tip resistance * Enable on Pinecilv1 / TS10x * Fixup drawing tip type * Update Settings.cpp * Rename JBC type * Add translations * Handle one tip type * Refactor header includes * Fixup translation_IT.json * Fixing up includes * Format * Apply suggestions from code review Co-authored-by: discip <53649486+discip@users.noreply.github.com> * Update Documentation/Hardware.md Co-authored-by: discip <53649486+discip@users.noreply.github.com> --------- Co-authored-by: = <=> Co-authored-by: discip <53649486+discip@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#ifndef CONFIGURATION_H_
|
||||
#define CONFIGURATION_H_
|
||||
#include "Settings.h"
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* Configuration.h
|
||||
@@ -147,7 +146,7 @@
|
||||
#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 TIPTYPE_MHP30 1 // It's own special tip
|
||||
#define ACCEL_SC7
|
||||
#define ACCEL_MSA
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "BootLogo.h"
|
||||
#include "I2C_Wrapper.hpp"
|
||||
#include "Pins.h"
|
||||
#include "Settings.h"
|
||||
#include "Setup.h"
|
||||
#include "TipThermoModel.h"
|
||||
#include "USBPD.h"
|
||||
@@ -382,9 +383,18 @@ uint8_t getTipResistanceX10() {
|
||||
#ifdef TIP_RESISTANCE_SENSE_Pin
|
||||
// Return tip resistance in x10 ohms
|
||||
// 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
|
||||
return TIP_RESISTANCE;
|
||||
uint8_t user_selected_tip = getUserSelectedTipResistance();
|
||||
if (user_selected_tip == 0) {
|
||||
return TIP_RESISTANCE; // Auto mode
|
||||
}
|
||||
return user_selected_tip;
|
||||
#endif
|
||||
}
|
||||
#ifdef TIP_RESISTANCE_SENSE_Pin
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#ifndef CONFIGURATION_H_
|
||||
#define CONFIGURATION_H_
|
||||
#include "Settings.h"
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* Configuration.h
|
||||
@@ -181,6 +180,7 @@
|
||||
#define I2C_SOFT_BUS_1 1
|
||||
#define OLED_I2CBB1 1
|
||||
#define ACCEL_I2CBB1 1
|
||||
#define TIPTYPE_T12 1 // Can manually pick a T12 tip
|
||||
|
||||
#define TEMP_TMP36
|
||||
#endif /* TS100 */
|
||||
@@ -213,6 +213,8 @@
|
||||
#define TEMP_NTC 1
|
||||
#define ACCEL_I2CBB1 1
|
||||
#define POW_EPR 1
|
||||
#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
|
||||
#define DEBUG_POWER_MENU_BUTTON_B
|
||||
|
||||
@@ -230,6 +232,8 @@
|
||||
#define I2C_SOFT_BUS_2 1
|
||||
#define LIS_ORI_FLIP
|
||||
#define OLED_FLIP
|
||||
#define TIPTYPE_TS80 1 // Only one tip type so far
|
||||
|
||||
#endif /* TS80(P) */
|
||||
|
||||
#ifdef MODEL_TS80
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "I2C_Wrapper.hpp"
|
||||
#include "IRQ.h"
|
||||
#include "Pins.h"
|
||||
#include "Settings.h"
|
||||
#include "Setup.h"
|
||||
#include "TipThermoModel.h"
|
||||
#include "configuration.h"
|
||||
@@ -93,7 +94,13 @@ void setBuzzer(bool on) {}
|
||||
uint8_t preStartChecks() { return 1; }
|
||||
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; }
|
||||
uint8_t preStartChecksDone() { return 1; }
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#ifndef CONFIGURATION_H_
|
||||
#define CONFIGURATION_H_
|
||||
#include "Settings.h"
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* Configuration.h
|
||||
@@ -155,6 +154,7 @@
|
||||
#define POW_QC_20V 1
|
||||
#define ENABLE_QC2 1
|
||||
#define MAG_SLEEP_SUPPORT 1
|
||||
#define TIPTYPE_T12 1 // Can manually pick a T12 tip
|
||||
#define TEMP_TMP36
|
||||
#define ACCEL_BMA
|
||||
#define ACCEL_SC7
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "I2C_Wrapper.hpp"
|
||||
#include "IRQ.h"
|
||||
#include "Pins.h"
|
||||
#include "Settings.h"
|
||||
#include "Setup.h"
|
||||
#include "TipThermoModel.h"
|
||||
#include "USBPD.h"
|
||||
@@ -152,7 +153,11 @@ uint8_t tipResistanceReadingSlot = 0;
|
||||
uint8_t getTipResistanceX10() {
|
||||
// Return tip resistance in x10 ohms
|
||||
// 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; }
|
||||
@@ -289,4 +294,4 @@ TemperatureType_t getCustomTipMaxInC() {
|
||||
TemperatureType_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(max_reading);
|
||||
maximumTipTemp += getHandleTemperature(0) / 10; // Add handle offset
|
||||
return maximumTipTemp - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#ifndef CONFIGURATION_H_
|
||||
#define CONFIGURATION_H_
|
||||
#include "Settings.h"
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* Configuration.h
|
||||
@@ -155,6 +154,8 @@
|
||||
#define POW_EPR 1
|
||||
#define ENABLE_QC2 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 OLED_96x16 1
|
||||
#define TEMP_NTC
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "HUB238.hpp"
|
||||
#include "I2C_Wrapper.hpp"
|
||||
#include "Pins.h"
|
||||
#include "Settings.h"
|
||||
#include "Setup.h"
|
||||
#include "TipThermoModel.h"
|
||||
#include "configuration.h"
|
||||
@@ -262,7 +263,11 @@ uint8_t getTipResistanceX10() {
|
||||
|
||||
return TIP_RESISTANCE + ((TIP_RESISTANCE * scaler) / 100000);
|
||||
#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
|
||||
}
|
||||
bool isTipShorted() { return false; }
|
||||
@@ -277,4 +282,4 @@ void showBootLogo(void) { BootLogo::handleShowingLogo((uint8_t *)FLASH_LOGOADDR)
|
||||
|
||||
#ifdef CUSTOM_MAX_TEMP_C
|
||||
TemperatureType_t getCustomTipMaxInC() { return MAX_TEMP_C; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#ifndef CONFIGURATION_H_
|
||||
#define CONFIGURATION_H_
|
||||
#include "Settings.h"
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* Configuration.h
|
||||
|
||||
Reference in New Issue
Block a user