Skip to content

Commit

Permalink
Enhanced V calibration (#1758)
Browse files Browse the repository at this point in the history
  • Loading branch information
discip authored Jul 24, 2023
1 parent 6ba2a5c commit 118fa09
Show file tree
Hide file tree
Showing 37 changed files with 44 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Translations/translation_BE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Беларуская",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Каліброўка\nзроблена!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Български",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Český",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Kalibrace\ndokončena!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_DA.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Dansk",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Deutsch",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Erfolgreich\nkalibriert!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_EL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Greek",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Βαθμονόμηση\nολοκληρώθηκε!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "English",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Castellano",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "¡Calibracion\nlista!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_FI.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Suomi",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Français",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Étalonnage\nterminé!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_HR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Hrvatski",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Kalibracija\ndovršena!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Magyar",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Kalibráció\nkész!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Italiano",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibrazione\ncompletata!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_JA_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "日本語",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration done!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Lietuvių",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_NB.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Norsk bokmål",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Nederlands",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_NL_BE.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Vlaams",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Polski",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Kalibracja\nwykonana!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Português",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibração\nefetuada!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_RO.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Română",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Русский",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Калибровка\nзавершена!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_SK.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Slovenčina",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_SL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Slovenščina",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_SR_CYRL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Српски",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_SR_LATN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Srpski",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_SV.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Svenska",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Türkçe",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_UK.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Українська",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "КХС\nвідкалібровано!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_VI.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "Tieng Viet",
"tempUnitFahrenheit": false,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration\ndone!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_YUE_HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "廣東話 (香港)",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration done!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_ZH_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "简体中文",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration done!"
},
"ResetOKMessage": {
Expand Down
2 changes: 1 addition & 1 deletion Translations/translation_ZH_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languageLocalName": "正體中文",
"tempUnitFahrenheit": true,
"messagesWarn": {
"CJCCalibrationDone": {
"CalibrationDone": {
"message": "Calibration done!"
},
"ResetOKMessage": {
Expand Down
4 changes: 2 additions & 2 deletions Translations/translations_definitions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"messagesWarn": [{
"id": "CJCCalibrationDone",
"description": "Confirmation message indicating CJC calibration is complete."
"id": "CalibrationDone",
"description": "Confirmation message indicating calibration is complete."
},
{
"id": "ResetOKMessage",
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Inc/Translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 7 additions & 5 deletions source/Core/Src/settingsGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,29 +884,31 @@ 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:
case BUTTON_B_LONG:
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:
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Threads/OperatingModes/CJC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 118fa09

Please sign in to comment.