aboutsummaryrefslogtreecommitdiffhomepage
path: root/source
diff options
context:
space:
mode:
authordiscip <[email protected]>2023-07-24 10:23:04 +0200
committerGitHub <[email protected]>2023-07-24 18:23:04 +1000
commit118fa09ce776711865716478b55544cb0461d7bc (patch)
tree0298d451eb3589ac7c1654232194c38abaa7f678 /source
parent6ba2a5c259a7abd0eb42c0dba50c167ac538792c (diff)
downloadIronOS-118fa09ce776711865716478b55544cb0461d7bc.tar.gz
IronOS-118fa09ce776711865716478b55544cb0461d7bc.zip
Enhanced V calibration (#1758)
Diffstat (limited to 'source')
-rw-r--r--source/Core/Inc/Translation.h2
-rw-r--r--source/Core/Src/settingsGUI.cpp12
-rw-r--r--source/Core/Threads/OperatingModes/CJC.cpp2
3 files changed, 9 insertions, 7 deletions
diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h
index 1f1f3964..45632eda 100644
--- a/source/Core/Inc/Translation.h
+++ b/source/Core/Inc/Translation.h
@@ -107,7 +107,7 @@ enum class SettingsItemIndex : uint8_t {
};
struct TranslationIndexTable {
- uint16_t CJCCalibrationDone;
+ uint16_t CalibrationDone;
uint16_t ResetOKMessage;
uint16_t SettingsResetMessage;
uint16_t NoAccelerometerMessage;
diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp
index 87a17b6a..9542b08c 100644
--- a/source/Core/Src/settingsGUI.cpp
+++ b/source/Core/Src/settingsGUI.cpp
@@ -884,19 +884,21 @@ static bool setCalibrateVIN(void) {
OLED::clearScreen();
for (;;) {
- OLED::setCursor(0, 0);
+ OLED::setCursor(25, 0);
uint16_t voltage = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
OLED::printNumber(voltage / 10, 2, FontStyle::LARGE);
OLED::print(LargeSymbolDot, FontStyle::LARGE);
OLED::printNumber(voltage % 10, 1, FontStyle::LARGE, false);
OLED::print(LargeSymbolVolts, FontStyle::LARGE);
+ OLED::setCursor(0, 8);
+ OLED::printNumber(getSettingValue(SettingsOptions::VoltageDiv), 3, FontStyle::SMALL);
switch (getButtonState()) {
case BUTTON_F_SHORT:
- nextSettingValue(SettingsOptions::VoltageDiv);
+ prevSettingValue(SettingsOptions::VoltageDiv);
break;
case BUTTON_B_SHORT:
- prevSettingValue(SettingsOptions::VoltageDiv);
+ nextSettingValue(SettingsOptions::VoltageDiv);
break;
case BUTTON_BOTH:
case BUTTON_F_LONG:
@@ -904,9 +906,9 @@ static bool setCalibrateVIN(void) {
saveSettings();
OLED::clearScreen();
OLED::setCursor(0, 0);
- OLED::printNumber(getSettingValue(SettingsOptions::VoltageDiv), 3, FontStyle::LARGE);
+ warnUser(translatedString(Tr->CalibrationDone), 3 * TICKS_SECOND);
OLED::refresh();
- waitForButtonPressOrTimeout(1 * TICKS_SECOND);
+ waitForButtonPressOrTimeout(0.5 * TICKS_SECOND);
return false;
case BUTTON_NONE:
default:
diff --git a/source/Core/Threads/OperatingModes/CJC.cpp b/source/Core/Threads/OperatingModes/CJC.cpp
index 25fef8d8..4da688f9 100644
--- a/source/Core/Threads/OperatingModes/CJC.cpp
+++ b/source/Core/Threads/OperatingModes/CJC.cpp
@@ -30,7 +30,7 @@ void performCJCC(void) {
}
setSettingValue(SettingsOptions::CalibrationOffset, setoffset);
OLED::clearScreen();
- warnUser(translatedString(Tr->CJCCalibrationDone), 3 * TICKS_SECOND);
+ warnUser(translatedString(Tr->CalibrationDone), 3 * TICKS_SECOND);
OLED::refresh();
// Preventing to repeat calibration at boot automatically (only one shot).
setSettingValue(SettingsOptions::CalibrateCJC, 0);