From afa8257bce81ec9c32d22a092c3641c4eb9c9f78 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 4 Nov 2017 14:37:47 +1100 Subject: [PATCH] Add rough russian --- workspace/TS100/inc/Translation.h | 10 ----- workspace/TS100/src/OLED.cpp | 1 + workspace/TS100/src/Translation.c | 66 +++++++++++++++++++++++-------- workspace/TS100/src/main.cpp | 26 ++++++------ 4 files changed, 66 insertions(+), 37 deletions(-) diff --git a/workspace/TS100/inc/Translation.h b/workspace/TS100/inc/Translation.h index 28ae4840..9624bfb1 100644 --- a/workspace/TS100/inc/Translation.h +++ b/workspace/TS100/inc/Translation.h @@ -24,16 +24,6 @@ extern const char SettingLeftChar; extern const char SettingAutoChar; #define LANG_EN -#define LANG - -#ifndef LANG -#define LANG_EN -#define LANG -#endif - -#ifndef LANG -#error NO LANGUAGE DEFINED -#endif #endif /* TRANSLATION_H_ */ diff --git a/workspace/TS100/src/OLED.cpp b/workspace/TS100/src/OLED.cpp index 147b4031..8945f37a 100644 --- a/workspace/TS100/src/OLED.cpp +++ b/workspace/TS100/src/OLED.cpp @@ -86,6 +86,7 @@ void OLED::refresh() { screenBuffer[12] = 0x40; //start of data marker taskENTER_CRITICAL(); + //Because I2C is shared, we cant task switch in the middle of the xfer HAL_I2C_Master_Transmit(i2c, DEVICEADDR_OLED, screenBuffer, 12 + 96 * 2 + 1, 0xFFFF); taskEXIT_CRITICAL(); diff --git a/workspace/TS100/src/Translation.c b/workspace/TS100/src/Translation.c index a9fb22e8..cd1d3a1f 100644 --- a/workspace/TS100/src/Translation.c +++ b/workspace/TS100/src/Translation.c @@ -7,25 +7,60 @@ #include "Translation.h" #ifdef LANG_EN +const char* SettingsLongNames[16] = { + /*These are all the help text for all the settings.*/ + /*No requirements on spacing or length*/ + "Power source. Sets cutoff voltage. ", //Power Source + "Sleep Temperature ",//Sleep Temp + "Sleep Timeout ",//Sleep Timeout + "Shutdown Timeout ",//Shutdown Time + "Motion Sensitivity <0.Off 1.least sensitive 9.most sensitive>",//Motion Sensitivity + "Temperature Unit ",//Temp Unit + "Display detailed information in a smaller font on the idle screen.",//Detailed Information + "Display Orientation ",//Orientation + "Enable front key enters boost mode 450C mode when soldering",//Boost enable + "Temperature when in \"boost\" mode",//Boost Temp + "Automatically starts the iron into soldering on power up. T=Soldering, S= Sleep mode,F=Off",//Auto start + "Blink the temperature on the cooling screen while the tip is still hot.",//Cooling Blink + "Calibrate tip offset.",//Calibrate Tip + "Reset all settings",//Reset Settings + "VIN Calibration. Buttons adjust, long press to exit",//VIN Cal + "Display detailed information while soldering",//ADV SLD +}; + +const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!"; +const char* UVLOWarningString = "LOW VOLT"; //Fixed width 8 chars +const char* SleepingSimpleString = "Zzzz";// Must be <= 4 chars +const char* SleepingAdvancedString = "Sleeping...";// <=17 chars +const char* WarningSimpleString = "HOT!";//Must be <= 4 chars +const char* WarningAdvancedString = "WARNING! TIP HOT!"; + +const char SettingTrueChar = 'T'; +const char SettingFalseChar = 'F'; +const char SettingRightChar = 'R'; +const char SettingLeftChar = 'L'; +const char SettingAutoChar = 'A'; +#endif +#ifdef LANG_RU const char* SettingsLongNames[16] = { /*These are all the help text for all the settings.*/ /*No requirements on spacing or length*/ -"Power source. Sets cutoff voltage. ", //Power Source - "Sleep Temperature ", //Sleep Temp - "Sleep Timeout ", //Sleep Timeout - "Shutdown Timeout ", //Shutdown Time - "Motion Sensitivity <0.Off 1.least sensitive 9.most sensitive>", //Motion Sensitivity - "Temperature Unit ", //Temp Unit + "Источник питания. Установка напряжения отключения. ", //Cell count + "Температура Сна <С>", //Sleep Temp + "Переход в режим Сна <Минуты>", //Sleep timeout + "Переходит в режим ожидания <Минуты>", //Shutdown timeout + "Акселерометр <0. Выкл. 1. мин. чувствительный 9. макс. чувствительный>", //Sensitivity + "В чем измерять температуру", //Temp Unit "Display detailed information in a smaller font on the idle screen.", //Detailed Information - "Display Orientation ", //Orientation - "Enable front key enters boost mode 450C mode when soldering", //Boost enable - "Temperature when in \"boost\" mode", //Boost Temp - "Automatically starts the iron into soldering on power up. T=Soldering, S= Sleep mode,F=Off", //Auto start - "Blink the temperature on the cooling screen while the tip is still hot.", //Cooling Blink - "Calibrate tip offset.", //Calibrate Tip + "Ориентация Дисплея ", //Orientation + "Активация кнопки A для Турбо режима до 450С при пайке ", //Boost enable + "Установка температуры для Турбо режима", //Boost temp + "Автоматический запуск паяльника при включении питания. T=Нагрев, S= Режим Сна,F=Выкл.", //Auto start + "Мигает температура на экране охлаждения, пока жало остается горячим." //Cooling blink + "Calibrate tip offset.",//Calibrate Tip "Reset all settings", //Reset Settings "VIN Calibration. Buttons adjust, long press to exit", //VIN Cal - "Display detailed information while soldering",//ADV SLD + "Display detailed information while soldering", //ADV SLD }; const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!"; @@ -41,7 +76,7 @@ const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; const char SettingAutoChar = 'A'; #endif - +//Currently the settings names are not translated const char* SettingsShortNames[16] = { /**/ "PWRSC ", // Power Source (DC or batt) "STMP ", // Sleep Temperature @@ -57,6 +92,5 @@ const char* SettingsShortNames[16] = { /**/ "CLBLNK ", // Cooldown blink "TMP CAL?", // Temperature calibration enter menu "RESET? ", // Settings reset command - "CAL VIN?", - "ADVSLD ", //advanced soldering screens + "CAL VIN?", "ADVSLD ", //advanced soldering screens }; diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp index 3dcc107b..5615f56c 100644 --- a/workspace/TS100/src/main.cpp +++ b/workspace/TS100/src/main.cpp @@ -73,7 +73,7 @@ int main(void) { } } void GUIDelay() { - osDelay(50);//20Hz + osDelay(50); //20Hz } ButtonState getButtonState() { /* @@ -411,11 +411,11 @@ static int gui_showTipTempWarning() { GUIDelay(); } } -static uint16_t min(uint16_t a,uint16_t b) -{ - if(a>b) +static uint16_t min(uint16_t a, uint16_t b) { + if (a > b) return b; - else return a; + else + return a; } static int gui_SolderingSleepingMode() { //Drop to sleep temperature and display until movement or button press @@ -430,9 +430,11 @@ static int gui_SolderingSleepingMode() { return 1; //return non-zero on error if (systemSettings.temperatureInF) - currentlyActiveTemperatureTarget = ftoTipMeasurement(min(systemSettings.SleepTemp,systemSettings.SolderingTemp)); + currentlyActiveTemperatureTarget = ftoTipMeasurement( + min(systemSettings.SleepTemp, systemSettings.SolderingTemp)); else - currentlyActiveTemperatureTarget = ctoTipMeasurement(min(systemSettings.SleepTemp,systemSettings.SolderingTemp)); + currentlyActiveTemperatureTarget = ctoTipMeasurement( + min(systemSettings.SleepTemp, systemSettings.SolderingTemp)); //draw the lcd uint16_t tipTemp; if (systemSettings.temperatureInF) @@ -797,9 +799,11 @@ void startPIDTask(void const * argument) { int32_t kp, ki, kd, kb; int32_t backoffOverflow = 0; kp = 20; - ki = 40; - kd = 30; + ki = 50; + kd = 40; kb = 0; + // REMEBER ^^^^ These constants are backwards + // They act as dividers, so to 'increase' a P term, you make the number smaller. const int32_t itermMax = 40; for (;;) { uint16_t rawTemp = getTipRawTemp(1); //get instantaneous reading @@ -892,7 +896,7 @@ void startMOVTask(void const * argument) { lcd.print(" "); lcd.printNumber(abs(avgy - (int32_t) ty), 5); if ((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)) > max) - max = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)); + max = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)); lcd.setCursor(0, 8); lcd.printNumber(max, 5); lcd.print(" "); @@ -900,7 +904,7 @@ void startMOVTask(void const * argument) { lcd.printNumber((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)), 5); lcd.refresh(); if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET) - max = 0; + max = 0; #endif //Only run the actual processing if the sensitivity is set (aka we are enabled) if (systemSettings.sensitivity) {