mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Move to lookuptable for tip calibration
This commit is contained in:
@@ -77,7 +77,6 @@ void resetSettings() {
|
||||
systemSettings.TempChangeShortStep = TEMP_CHANGE_SHORT_STEP; //
|
||||
systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; //
|
||||
systemSettings.KeepAwakePulse = POWER_PULSE_DEFAULT;
|
||||
systemSettings.TipGain = TIP_GAIN;
|
||||
systemSettings.hallEffectSensitivity = 1;
|
||||
saveSettings(); // Save defaults
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ static bool settings_setResetSettings(void);
|
||||
static void settings_displayResetSettings(void);
|
||||
static bool settings_setCalibrate(void);
|
||||
static void settings_displayCalibrate(void);
|
||||
static bool settings_setTipGain(void);
|
||||
static void settings_displayTipGain(void);
|
||||
//static bool settings_setTipGain(void);
|
||||
//static void settings_displayTipGain(void);
|
||||
static bool settings_setCalibrateVIN(void);
|
||||
static void settings_displayCalibrateVIN(void);
|
||||
static void settings_displayReverseButtonTempChangeEnabled(void);
|
||||
@@ -212,7 +212,7 @@ const menuitem advancedMenu[] = {
|
||||
{ (const char *) SettingsDescriptions[11], settings_setCalibrate, settings_displayCalibrate }, /*Calibrate tip*/
|
||||
{ (const char *) SettingsDescriptions[13], settings_setCalibrateVIN, settings_displayCalibrateVIN }, /*Voltage input cal*/
|
||||
{ (const char *) SettingsDescriptions[24], settings_setPowerPulse, settings_displayPowerPulse }, /*Power Pulse adjustment */
|
||||
{ (const char *) SettingsDescriptions[25], settings_setTipGain, settings_displayTipGain }, /*TipGain*/
|
||||
//{ (const char *) SettingsDescriptions[25], settings_setTipGain, settings_displayTipGain }, /*TipGain*/
|
||||
{ NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
|
||||
@@ -778,53 +778,53 @@ static bool settings_setCalibrateVIN(void) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool settings_setTipGain(void) {
|
||||
OLED::setFont(0);
|
||||
OLED::clearScreen();
|
||||
|
||||
for (;;) {
|
||||
OLED::setCursor(0, 0);
|
||||
OLED::printNumber(systemSettings.TipGain / 10, 2);
|
||||
OLED::print(SymbolDot);
|
||||
OLED::printNumber(systemSettings.TipGain % 10, 1);
|
||||
|
||||
ButtonState buttons = getButtonState();
|
||||
switch (buttons) {
|
||||
case BUTTON_F_SHORT:
|
||||
systemSettings.TipGain -= 1;
|
||||
break;
|
||||
|
||||
case BUTTON_B_SHORT:
|
||||
systemSettings.TipGain += 1;
|
||||
break;
|
||||
|
||||
case BUTTON_BOTH:
|
||||
case BUTTON_F_LONG:
|
||||
case BUTTON_B_LONG:
|
||||
saveSettings();
|
||||
return false;
|
||||
case BUTTON_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
OLED::refresh();
|
||||
osDelay(40);
|
||||
|
||||
// Cap to sensible values
|
||||
if (systemSettings.TipGain < 150) {
|
||||
systemSettings.TipGain = 150;
|
||||
} else if (systemSettings.TipGain > 300) {
|
||||
systemSettings.TipGain = 300;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void settings_displayTipGain(void) {
|
||||
printShortDescription(25, 5);
|
||||
}
|
||||
//
|
||||
//static bool settings_setTipGain(void) {
|
||||
// OLED::setFont(0);
|
||||
// OLED::clearScreen();
|
||||
//
|
||||
// for (;;) {
|
||||
// OLED::setCursor(0, 0);
|
||||
// OLED::printNumber(systemSettings.TipGain / 10, 2);
|
||||
// OLED::print(SymbolDot);
|
||||
// OLED::printNumber(systemSettings.TipGain % 10, 1);
|
||||
//
|
||||
// ButtonState buttons = getButtonState();
|
||||
// switch (buttons) {
|
||||
// case BUTTON_F_SHORT:
|
||||
// systemSettings.TipGain -= 1;
|
||||
// break;
|
||||
//
|
||||
// case BUTTON_B_SHORT:
|
||||
// systemSettings.TipGain += 1;
|
||||
// break;
|
||||
//
|
||||
// case BUTTON_BOTH:
|
||||
// case BUTTON_F_LONG:
|
||||
// case BUTTON_B_LONG:
|
||||
// saveSettings();
|
||||
// return false;
|
||||
// case BUTTON_NONE:
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// OLED::refresh();
|
||||
// osDelay(40);
|
||||
//
|
||||
// // Cap to sensible values
|
||||
// if (systemSettings.TipGain < 150) {
|
||||
// systemSettings.TipGain = 150;
|
||||
// } else if (systemSettings.TipGain > 300) {
|
||||
// systemSettings.TipGain = 300;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//static void settings_displayTipGain(void) {
|
||||
// printShortDescription(25, 5);
|
||||
//}
|
||||
|
||||
static bool settings_setReverseButtonTempChangeEnabled(void) {
|
||||
systemSettings.ReverseButtonTempChangeEnabled = !systemSettings.ReverseButtonTempChangeEnabled;
|
||||
|
||||
Reference in New Issue
Block a user