mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
WiP Power limit
This commit is contained in:
@@ -48,6 +48,9 @@ typedef struct {
|
||||
uint8_t customTipGain; // Tip gain value if custom tuned, or 0 if using a
|
||||
// tipType param
|
||||
uint8_t tipType;
|
||||
#ifdef MODEL_TS80
|
||||
uint8_t pidPowerLimit;
|
||||
#endif
|
||||
uint32_t padding; // This is here for in case we are not an even divisor so
|
||||
// that nothing gets cut off
|
||||
} systemSettingsType;
|
||||
|
||||
@@ -114,7 +114,7 @@ void resetSettings() {
|
||||
systemSettings.tipType = TS_B2; // Default to the B2 Tip
|
||||
#endif
|
||||
#ifdef MODEL_TS80
|
||||
|
||||
systemSettings.pidPowerLimit=24; // Sets the max pwm power limit
|
||||
systemSettings.tipType = TS_B02; // Default to the B2 Tip
|
||||
#endif
|
||||
saveSettings(); // Save defaults
|
||||
|
||||
@@ -318,15 +318,17 @@ static void settings_setInputPRange(void) {
|
||||
|
||||
static void settings_displayInputPRange(void) {
|
||||
printShortDescription(0, 5);
|
||||
//0 = 18W, 1=24W
|
||||
//0 = 9V, 1=12V (Fixed Voltages, these imply 1.5A limits)
|
||||
//2 = 18W, 2=24W (Auto Adjusting V, estimated from the tip resistance???) # TODO
|
||||
// Need to come back and look at these ^ as there were issues with voltage hunting
|
||||
switch (systemSettings.cutoutSetting) {
|
||||
case 0:
|
||||
OLED::printNumber(18, 2);
|
||||
OLED::print(SymbolWatts);
|
||||
OLED::printNumber(9, 2);
|
||||
OLED::print(SymbolVolts);
|
||||
break;
|
||||
case 1:
|
||||
OLED::printNumber(24, 2);
|
||||
OLED::print(SymbolWatts);
|
||||
OLED::printNumber(12, 2);
|
||||
OLED::print(SymbolVolts);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -28,6 +28,8 @@ int32_t tempToMilliWatts(int32_t rawTemp, uint16_t mass, uint8_t rawC) {
|
||||
}
|
||||
|
||||
void setTipMilliWatts(int32_t mw) {
|
||||
//Enforce Max Watts Limiter # TODO
|
||||
|
||||
int32_t output = milliWattsToPWM(mw, systemSettings.voltageDiv / 10,1);
|
||||
setTipPWM(output);
|
||||
uint16_t actualMilliWatts = PWMToMilliWatts(output,
|
||||
|
||||
Reference in New Issue
Block a user