From d0b4a0f01af56a6f23d43e2dabf1ad73ee7c60d0 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 1 Jan 2021 08:52:05 +1100 Subject: [PATCH 01/11] Rename PCBVersion to make more sense --- workspace/TS100/Core/Inc/main.hpp | 2 +- workspace/TS100/Core/Src/gui.cpp | 4 ++-- workspace/TS100/Core/Src/main.cpp | 2 +- workspace/TS100/Core/Threads/MOVThread.cpp | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/workspace/TS100/Core/Inc/main.hpp b/workspace/TS100/Core/Inc/main.hpp index effe5a05..206a329e 100755 --- a/workspace/TS100/Core/Inc/main.hpp +++ b/workspace/TS100/Core/Inc/main.hpp @@ -3,7 +3,7 @@ #include "OLED.hpp" #include "Setup.h" -extern uint8_t PCBVersion; +extern uint8_t DetectedAccelerometerVersion; extern uint32_t currentTempTargetDegC; extern bool settingsWereReset; extern bool usb_pd_available; diff --git a/workspace/TS100/Core/Src/gui.cpp b/workspace/TS100/Core/Src/gui.cpp index 002f9ef1..0e6778c2 100755 --- a/workspace/TS100/Core/Src/gui.cpp +++ b/workspace/TS100/Core/Src/gui.cpp @@ -371,7 +371,7 @@ static bool settings_setSleepTime(void) { systemSettings.SleepTime = 0; // can't set time over 10 mins } // Remember that ^ is the time of no movement - if (PCBVersion == 99) + if (DetectedAccelerometerVersion == 99) systemSettings.SleepTime = 0; // Disable sleep on no accel return systemSettings.SleepTime == 15; } @@ -394,7 +394,7 @@ static bool settings_setShutdownTime(void) { if (systemSettings.ShutdownTime > 60) { systemSettings.ShutdownTime = 0; // wrap to off } - if (PCBVersion == 99) + if (DetectedAccelerometerVersion == 99) systemSettings.ShutdownTime = 0; // Disable shutdown on no accel return systemSettings.ShutdownTime == 60; } diff --git a/workspace/TS100/Core/Src/main.cpp b/workspace/TS100/Core/Src/main.cpp index e9e3d62f..c638b0d8 100755 --- a/workspace/TS100/Core/Src/main.cpp +++ b/workspace/TS100/Core/Src/main.cpp @@ -11,7 +11,7 @@ #include #include "Settings.h" #include "cmsis_os.h" -uint8_t PCBVersion = 0; +uint8_t DetectedAccelerometerVersion = 0; bool settingsWereReset = false; // FreeRTOS variables diff --git a/workspace/TS100/Core/Threads/MOVThread.cpp b/workspace/TS100/Core/Threads/MOVThread.cpp index 84ff386e..79fdb18e 100755 --- a/workspace/TS100/Core/Threads/MOVThread.cpp +++ b/workspace/TS100/Core/Threads/MOVThread.cpp @@ -26,32 +26,32 @@ TickType_t lastMovementTime = 0; void detectAccelerometerVersion() { #ifdef ACCEL_MMA if (MMA8652FC::detect()) { - PCBVersion = 1; + DetectedAccelerometerVersion = 1; if (!MMA8652FC::initalize()) { - PCBVersion = 99; + DetectedAccelerometerVersion = 99; } } else #endif #ifdef ACCEL_LIS if (LIS2DH12::detect()) { - PCBVersion = 2; + DetectedAccelerometerVersion = 2; // Setup the ST Accelerometer if (!LIS2DH12::initalize()) { - PCBVersion = 99; + DetectedAccelerometerVersion = 99; } } else #endif #ifdef ACCEL_BMA if (BMA223::detect()) { - PCBVersion = 3; + DetectedAccelerometerVersion = 3; // Setup the ST Accelerometer if (!BMA223::initalize()) { - PCBVersion = 99; + DetectedAccelerometerVersion = 99; } } else #endif { - PCBVersion = 99; + DetectedAccelerometerVersion = 99; systemSettings.SleepTime = 0; systemSettings.ShutdownTime = 0; // No accel -> disable sleep systemSettings.sensitivity = 0; @@ -60,19 +60,19 @@ void detectAccelerometerVersion() { } inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) { #ifdef ACCEL_LIS - if (PCBVersion == 2) { + if (DetectedAccelerometerVersion == 2) { LIS2DH12::getAxisReadings(tx, ty, tz); rotation = LIS2DH12::getOrientation(); } else #endif #ifdef ACCEL_MMA - if (PCBVersion == 1) { + if (DetectedAccelerometerVersion == 1) { MMA8652FC::getAxisReadings(tx, ty, tz); rotation = MMA8652FC::getOrientation(); } else #endif #ifdef ACCEL_BMA - if (PCBVersion == 3) { + if (DetectedAccelerometerVersion == 3) { BMA223::getAxisReadings(tx, ty, tz); rotation = BMA223::getOrientation(); } else From 8e7fda03f1a84666b8d65daea7a66644db83ae3c Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 1 Jan 2021 09:32:32 +1100 Subject: [PATCH 02/11] [OLED] shrink codeside of draw swapped --- workspace/TS100/Core/Drivers/OLED.cpp | 12 ++++++++---- workspace/TS100/Core/Drivers/OLED.hpp | 22 +++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/workspace/TS100/Core/Drivers/OLED.cpp b/workspace/TS100/Core/Drivers/OLED.cpp index 84e20aa8..948c248e 100755 --- a/workspace/TS100/Core/Drivers/OLED.cpp +++ b/workspace/TS100/Core/Drivers/OLED.cpp @@ -22,6 +22,7 @@ bool OLED::inLeftHandedMode; // Whether the screen is in left or not (used for OLED::DisplayState OLED::displayState; uint8_t OLED::fontWidth, OLED::fontHeight; int16_t OLED::cursor_x, OLED::cursor_y; +bool OLED::initDone = false; uint8_t OLED::displayOffset; uint8_t OLED::screenBuffer[16 + (OLED_WIDTH * 2) + 10]; // The data buffer uint8_t OLED::secondFrameBuffer[OLED_WIDTH * 2]; @@ -102,6 +103,7 @@ void OLED::initialize() { } } setDisplayState(DisplayState::ON); + initDone = true; } void OLED::setFramebuffer(uint8_t *buffer) { if (buffer == NULL) { @@ -390,16 +392,14 @@ void OLED::drawAreaSwapped(int16_t x, int8_t y, uint8_t wide, uint8_t height, co if (y == 0) { // Splat first line of data - for (uint8_t xx = visibleStart; xx < visibleEnd; xx += 2) { + for (uint8_t xx = visibleStart; xx < visibleEnd; xx ++) { firstStripPtr[xx + x] = ptr[xx + 1]; - firstStripPtr[xx + x + 1] = ptr[xx]; } } if (y == 8 || height == 16) { // Splat the second line - for (uint8_t xx = visibleStart; xx < visibleEnd; xx += 2) { + for (uint8_t xx = visibleStart; xx < visibleEnd; xx++) { secondStripPtr[x + xx] = ptr[xx + 1 + (height == 16 ? wide : 0)]; - secondStripPtr[x + xx + 1] = ptr[xx + (height == 16 ? wide : 0)]; } } } @@ -481,3 +481,7 @@ void OLED::drawHeatSymbol(uint8_t state) { drawSymbol(14); drawFilledRect(cursor_x_temp, 0, cursor_x_temp + 12, 2 + (8 - state), true); } + +bool OLED::isInitDone() { + return initDone; +} diff --git a/workspace/TS100/Core/Drivers/OLED.hpp b/workspace/TS100/Core/Drivers/OLED.hpp index 5e3238a7..db6a2c52 100755 --- a/workspace/TS100/Core/Drivers/OLED.hpp +++ b/workspace/TS100/Core/Drivers/OLED.hpp @@ -34,7 +34,7 @@ public: }; static void initialize(); // Startup the I2C coms (brings screen out of reset etc) - + static bool isInitDone(); // Draw the buffer out to the LCD using the DMA Channel static void refresh() { FRToSI2C::Transmit( DEVICEADDR_OLED, screenBuffer, @@ -56,7 +56,7 @@ public: static int16_t getCursorX() { return cursor_x; } - static void print(const char *string);// Draw a string to the current location, with current font + static void print(const char *string); // Draw a string to the current location, with current font // Set the cursor location by pixels static void setCursor(int16_t x, int16_t y) { cursor_x = x; @@ -73,8 +73,7 @@ public: drawArea(x, 0, width, 16, buffer); } // Draws an image to the buffer, at x offset from top to bottom (fixed height renders) - static void printNumber(uint16_t number, uint8_t places, - bool noLeaderZeros = true); + static void printNumber(uint16_t number, uint8_t places, bool noLeaderZeros = true); // Draws a number at the current cursor location // Clears the buffer static void clearScreen() { @@ -89,15 +88,11 @@ public: drawSymbol((state) ? 16 : 17); } static void debugNumber(int32_t val); - static void drawSymbol(uint8_t symbolID);//Used for drawing symbols of a predictable width - static void drawArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, - const uint8_t *ptr); //Draw an area, but y must be aligned on 0/8 offset - static void drawAreaSwapped(int16_t x, int8_t y, uint8_t wide, - uint8_t height, const uint8_t *ptr); //Draw an area, but y must be aligned on 0/8 offset - static void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, - const uint8_t value); //Fill an area, but y must be aligned on 0/8 offset - static void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, - bool clear); + static void drawSymbol(uint8_t symbolID); //Used for drawing symbols of a predictable width + static void drawArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, const uint8_t *ptr); //Draw an area, but y must be aligned on 0/8 offset + static void drawAreaSwapped(int16_t x, int8_t y, uint8_t wide, uint8_t height, const uint8_t *ptr); //Draw an area, but y must be aligned on 0/8 offset + static void fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, const uint8_t value); //Fill an area, but y must be aligned on 0/8 offset + static void drawFilledRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool clear); static void drawHeatSymbol(uint8_t state); static void drawScrollIndicator(uint8_t p, uint8_t h); // Draws a scrolling position indicator static void transitionSecondaryFramebuffer(bool forwardNavigation); @@ -109,6 +104,7 @@ private: static uint8_t *firstStripPtr; // Pointers to the strips to allow for buffer having extra content static uint8_t *secondStripPtr; //Pointers to the strips static bool inLeftHandedMode; // Whether the screen is in left or not (used for offsets in GRAM) + static bool initDone; static DisplayState displayState; static uint8_t fontWidth, fontHeight; static int16_t cursor_x, cursor_y; From dd065e52f28ecd9555c11363f1c182d67807b895 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 1 Jan 2021 09:45:05 +1100 Subject: [PATCH 03/11] Add warning messages for no accel or no pd --- Translation Editor/translation_bg.json | 2 ++ Translation Editor/translation_cs.json | 2 ++ Translation Editor/translation_da.json | 2 ++ Translation Editor/translation_de.json | 2 ++ Translation Editor/translation_en.json | 2 ++ Translation Editor/translation_es.json | 2 ++ Translation Editor/translation_fi.json | 2 ++ Translation Editor/translation_fr.json | 4 +++- Translation Editor/translation_hr.json | 2 ++ Translation Editor/translation_hu.json | 2 ++ Translation Editor/translation_it.json | 4 +++- Translation Editor/translation_lt.json | 4 +++- Translation Editor/translation_nl.json | 2 ++ Translation Editor/translation_nl_be.json | 2 ++ Translation Editor/translation_no.json | 2 ++ Translation Editor/translation_pl.json | 4 +++- Translation Editor/translation_pt.json | 2 ++ Translation Editor/translation_ru.json | 4 +++- Translation Editor/translation_sk.json | 2 ++ Translation Editor/translation_sl.json | 2 ++ Translation Editor/translation_sr_cyrl.json | 2 ++ Translation Editor/translation_sr_latn.json | 2 ++ Translation Editor/translation_sv.json | 2 ++ Translation Editor/translation_tr.json | 4 +++- Translation Editor/translation_uk.json | 2 ++ Translation Editor/translations_def.js | 10 ++++++++++ workspace/TS100/Core/Inc/Translation.h | 2 ++ 27 files changed, 68 insertions(+), 6 deletions(-) diff --git a/Translation Editor/translation_bg.json b/Translation Editor/translation_bg.json index 29830d24..3fb24b8e 100644 --- a/Translation Editor/translation_bg.json +++ b/Translation Editor/translation_bg.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Нулиране завършено", "YourGainMessage": "Усилване:", "SettingsResetMessage": "Настройките бяха\nнулирани!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_cs.json b/Translation Editor/translation_cs.json index 98961268..af1103c9 100644 --- a/Translation Editor/translation_cs.json +++ b/Translation Editor/translation_cs.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Zisk:", "SettingsResetMessage": "Tov. nas. obnov.", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_da.json b/Translation Editor/translation_da.json index 8950c923..b98220a1 100644 --- a/Translation Editor/translation_da.json +++ b/Translation Editor/translation_da.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_de.json b/Translation Editor/translation_de.json index 0ba7c800..62aa6731 100644 --- a/Translation Editor/translation_de.json +++ b/Translation Editor/translation_de.json @@ -25,6 +25,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your Gain:", "SettingsResetMessage": "Einstellungen\nzurück gesetzt!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_en.json b/Translation Editor/translation_en.json index 7394907d..e7d66512 100644 --- a/Translation Editor/translation_en.json +++ b/Translation Editor/translation_en.json @@ -25,6 +25,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_es.json b/Translation Editor/translation_es.json index b5986ff9..8adca0d9 100644 --- a/Translation Editor/translation_es.json +++ b/Translation Editor/translation_es.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Hecho. ", "YourGainMessage": "Gananc.:", "SettingsResetMessage": "Ajustes borrados", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_fi.json b/Translation Editor/translation_fi.json index 3da677f0..d2319978 100644 --- a/Translation Editor/translation_fi.json +++ b/Translation Editor/translation_fi.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_fr.json b/Translation Editor/translation_fr.json index 2bb56164..ce77f890 100644 --- a/Translation Editor/translation_fr.json +++ b/Translation Editor/translation_fr.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Gain :", "SettingsResetMessage": "Réglage réinit. !", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": "VERROUIL", "UnlockingKeysString": "DEVERROU", "WarningKeysLockedString": "! VERR. !" @@ -274,4 +276,4 @@ "desc": "Sensibilité du capteur à effet Hall lors de la détection de mise en veille " } } -} +} \ No newline at end of file diff --git a/Translation Editor/translation_hr.json b/Translation Editor/translation_hr.json index f19e0d8f..11f6c884 100644 --- a/Translation Editor/translation_hr.json +++ b/Translation Editor/translation_hr.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_hu.json b/Translation Editor/translation_hu.json index 54c7a649..5941d22f 100644 --- a/Translation Editor/translation_hu.json +++ b/Translation Editor/translation_hu.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_it.json b/Translation Editor/translation_it.json index 6e1de23d..51845e80 100644 --- a/Translation Editor/translation_it.json +++ b/Translation Editor/translation_it.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Guad.: ", "SettingsResetMessage": "Reset effettuato", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": "Blocc.", "UnlockingKeysString": "Sblocc.", "WarningKeysLockedString": "BLOCCATO" @@ -274,4 +276,4 @@ "desc": "Blocca i tasti durante la modalità Saldatura; tieni premuto entrambi per bloccare/sbloccare " } } -} +} \ No newline at end of file diff --git a/Translation Editor/translation_lt.json b/Translation Editor/translation_lt.json index a7443461..ec91e1a0 100644 --- a/Translation Editor/translation_lt.json +++ b/Translation Editor/translation_lt.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Gain:", "SettingsResetMessage": "Nust. atstatyti!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " UŽRAKIN", "UnlockingKeysString": "ATRAKIN", "WarningKeysLockedString": "!UŽRAK!" @@ -274,4 +276,4 @@ "desc": "Lituodami, ilgai paspauskite abu mygtukus, kad juos užrakintumėte " } } -} +} \ No newline at end of file diff --git a/Translation Editor/translation_nl.json b/Translation Editor/translation_nl.json index adf99708..d4abf365 100644 --- a/Translation Editor/translation_nl.json +++ b/Translation Editor/translation_nl.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Niveau:", "SettingsResetMessage": "Instellingen zijn\ngereset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " GEBLOKKEERD", "UnlockingKeysString": "GEDEBLOKKEERD", "WarningKeysLockedString": "!GEBLOKKEERD!" diff --git a/Translation Editor/translation_nl_be.json b/Translation Editor/translation_nl_be.json index 9a168cb8..2713d418 100644 --- a/Translation Editor/translation_nl_be.json +++ b/Translation Editor/translation_nl_be.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_no.json b/Translation Editor/translation_no.json index 8df24c27..fa90ecf4 100644 --- a/Translation Editor/translation_no.json +++ b/Translation Editor/translation_no.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_pl.json b/Translation Editor/translation_pl.json index d4fc563f..320574d4 100644 --- a/Translation Editor/translation_pl.json +++ b/Translation Editor/translation_pl.json @@ -25,6 +25,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Us.zysk:", "SettingsResetMessage": "Ust. zresetowane", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " ZABLOK.", "UnlockingKeysString": "ODBLOK.", "WarningKeysLockedString": "!ZABLOK!" @@ -275,4 +277,4 @@ "desc": "W trybie lutowania, wciśnij oba przyciski aby je zablokować " } } -} +} \ No newline at end of file diff --git a/Translation Editor/translation_pt.json b/Translation Editor/translation_pt.json index e8d62a23..4bf003d1 100644 --- a/Translation Editor/translation_pt.json +++ b/Translation Editor/translation_pt.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_ru.json b/Translation Editor/translation_ru.json index 35357108..ae2e4db5 100644 --- a/Translation Editor/translation_ru.json +++ b/Translation Editor/translation_ru.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Сброс OK", "YourGainMessage": "Прирост:", "SettingsResetMessage": "Настройки сброшены!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" @@ -274,4 +276,4 @@ "desc": "При работе длинное нажатие обеих кнопок блокирует их " } } -} +} \ No newline at end of file diff --git a/Translation Editor/translation_sk.json b/Translation Editor/translation_sk.json index 4c47b721..05848f63 100644 --- a/Translation Editor/translation_sk.json +++ b/Translation Editor/translation_sk.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Zisk:", "SettingsResetMessage": "Nast. Obnovené!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_sl.json b/Translation Editor/translation_sl.json index f6d99f15..9658a6f4 100644 --- a/Translation Editor/translation_sl.json +++ b/Translation Editor/translation_sl.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Ojačan.:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_sr_cyrl.json b/Translation Editor/translation_sr_cyrl.json index 570df775..9fa61a14 100644 --- a/Translation Editor/translation_sr_cyrl.json +++ b/Translation Editor/translation_sr_cyrl.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_sr_latn.json b/Translation Editor/translation_sr_latn.json index a14cad93..43e64b7d 100644 --- a/Translation Editor/translation_sr_latn.json +++ b/Translation Editor/translation_sr_latn.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_sv.json b/Translation Editor/translation_sv.json index 1b6e039f..a3411b75 100644 --- a/Translation Editor/translation_sv.json +++ b/Translation Editor/translation_sv.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Reset OK", "YourGainMessage": "Your gain:", "SettingsResetMessage": "Settings were\nreset!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translation_tr.json b/Translation Editor/translation_tr.json index aba6a920..8c0f3881 100644 --- a/Translation Editor/translation_tr.json +++ b/Translation Editor/translation_tr.json @@ -23,7 +23,9 @@ "OffString": "Kapalı", "ResetOKMessage": "Sıfırlama Tamam", "YourGainMessage": "Kazancınız:", - "SettingsResetMessage": "Ayarlar Sıfırlandı" + "SettingsResetMessage": "Ayarlar Sıfırlandı", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!" }, "characters": { "SettingRightChar": "R", diff --git a/Translation Editor/translation_uk.json b/Translation Editor/translation_uk.json index ab83795f..4f1e2154 100644 --- a/Translation Editor/translation_uk.json +++ b/Translation Editor/translation_uk.json @@ -24,6 +24,8 @@ "ResetOKMessage": "Скидання OK", "YourGainMessage": "Приріст:", "SettingsResetMessage": "Налаштування скинуті!", + "NoAccelerometerMessage": "No accelerometer\ndetected!", + "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", "LockingKeysString": " LOCKED", "UnlockingKeysString": "UNLOCKED", "WarningKeysLockedString": "!LOCKED!" diff --git a/Translation Editor/translations_def.js b/Translation Editor/translations_def.js index aae794a7..82cc9ff0 100644 --- a/Translation Editor/translations_def.js +++ b/Translation Editor/translations_def.js @@ -95,6 +95,16 @@ var def = "maxLen": 16, "default": "Settings were\nreset!" }, + { + "id": "NoAccelerometerMessage", + "maxLen": 16, + "default": "No accelerometer\ndetected!" + }, + { + "id": "NoPowerDeliveryMessage", + "maxLen": 16, + "default": "No USB-PD IC\ndetected!" + }, { "id": "LockingKeysString", "maxLen": 8, diff --git a/workspace/TS100/Core/Inc/Translation.h b/workspace/TS100/Core/Inc/Translation.h index 1ee90e2a..b9a4421f 100755 --- a/workspace/TS100/Core/Inc/Translation.h +++ b/workspace/TS100/Core/Inc/Translation.h @@ -38,6 +38,8 @@ extern const char *OffString; extern const char *ResetOKMessage; extern const char *YourGainMessage; extern const char *SettingsResetMessage; +extern const char *NoAccelerometerMessage; +extern const char *NoPowerDeliveryMessage; extern const char *LockingKeysString; extern const char *UnlockingKeysString; extern const char *WarningKeysLockedString; From 120161857b53787c07d36c4cebacc8ff01809abe Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 1 Jan 2021 09:45:34 +1100 Subject: [PATCH 04/11] Make no-accel==99 a #define --- workspace/TS100/Core/Inc/main.hpp | 1 + workspace/TS100/Core/Src/gui.cpp | 5 ++--- workspace/TS100/Core/Threads/MOVThread.cpp | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/workspace/TS100/Core/Inc/main.hpp b/workspace/TS100/Core/Inc/main.hpp index 206a329e..3850ab6e 100755 --- a/workspace/TS100/Core/Inc/main.hpp +++ b/workspace/TS100/Core/Inc/main.hpp @@ -14,6 +14,7 @@ extern "C" { void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed portCHAR *pcTaskName); +#define NO_DETECTED_ACCELEROMETER 99 //Threads void startGUITask(void const *argument); void startPIDTask(void const *argument); diff --git a/workspace/TS100/Core/Src/gui.cpp b/workspace/TS100/Core/Src/gui.cpp index 0e6778c2..86674071 100755 --- a/workspace/TS100/Core/Src/gui.cpp +++ b/workspace/TS100/Core/Src/gui.cpp @@ -371,7 +371,7 @@ static bool settings_setSleepTime(void) { systemSettings.SleepTime = 0; // can't set time over 10 mins } // Remember that ^ is the time of no movement - if (DetectedAccelerometerVersion == 99) + if (DetectedAccelerometerVersion == NO_DETECTED_ACCELEROMETER) systemSettings.SleepTime = 0; // Disable sleep on no accel return systemSettings.SleepTime == 15; } @@ -394,7 +394,7 @@ static bool settings_setShutdownTime(void) { if (systemSettings.ShutdownTime > 60) { systemSettings.ShutdownTime = 0; // wrap to off } - if (DetectedAccelerometerVersion == 99) + if (DetectedAccelerometerVersion == NO_DETECTED_ACCELEROMETER) systemSettings.ShutdownTime = 0; // Disable shutdown on no accel return systemSettings.ShutdownTime == 60; } @@ -722,7 +722,6 @@ static bool settings_setCalibrateVIN(void) { // Jump to the voltage calibration subscreen OLED::setFont(0); OLED::clearScreen(); - OLED::setCursor(0, 0); for (;;) { OLED::setCursor(0, 0); diff --git a/workspace/TS100/Core/Threads/MOVThread.cpp b/workspace/TS100/Core/Threads/MOVThread.cpp index 79fdb18e..be6be6f9 100755 --- a/workspace/TS100/Core/Threads/MOVThread.cpp +++ b/workspace/TS100/Core/Threads/MOVThread.cpp @@ -28,7 +28,7 @@ void detectAccelerometerVersion() { if (MMA8652FC::detect()) { DetectedAccelerometerVersion = 1; if (!MMA8652FC::initalize()) { - DetectedAccelerometerVersion = 99; + DetectedAccelerometerVersion = NO_DETECTED_ACCELEROMETER; } } else #endif @@ -37,7 +37,7 @@ void detectAccelerometerVersion() { DetectedAccelerometerVersion = 2; // Setup the ST Accelerometer if (!LIS2DH12::initalize()) { - DetectedAccelerometerVersion = 99; + DetectedAccelerometerVersion = NO_DETECTED_ACCELEROMETER; } } else #endif @@ -46,12 +46,12 @@ void detectAccelerometerVersion() { DetectedAccelerometerVersion = 3; // Setup the ST Accelerometer if (!BMA223::initalize()) { - DetectedAccelerometerVersion = 99; + DetectedAccelerometerVersion = NO_DETECTED_ACCELEROMETER; } } else #endif { - DetectedAccelerometerVersion = 99; + DetectedAccelerometerVersion = NO_DETECTED_ACCELEROMETER; systemSettings.SleepTime = 0; systemSettings.ShutdownTime = 0; // No accel -> disable sleep systemSettings.sensitivity = 0; @@ -82,8 +82,10 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation } } void startMOVTask(void const *argument __unused) { - osDelay(1); //Make oled init happen first postRToSInit(); + while (OLED::isInitDone() == false) { + osDelay(1); //Make oled init happen first + } OLED::setRotation(systemSettings.OrientationMode & 1); detectAccelerometerVersion(); lastMovementTime = 0; @@ -148,7 +150,7 @@ void startMOVTask(void const *argument __unused) { // So now we have averages, we want to look if these are different by more // than the threshold - // If error has occurred then we update the tick timer + // If movement has occurred then we update the tick timer if (error > threshold) { lastMovementTime = xTaskGetTickCount(); } From 17fe10843268eb0eae72eee41d73687e165eb922 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Fri, 1 Jan 2021 09:56:52 +1100 Subject: [PATCH 05/11] Add warnings to show if accel or pd is missing on startup first 2 times --- .../TS100/Core/Drivers/TipThermoModel.cpp | 2 +- workspace/TS100/Core/Inc/Settings.h | 7 +- workspace/TS100/Core/Inc/main.hpp | 1 + workspace/TS100/Core/Src/Settings.cpp | 5 +- workspace/TS100/Core/Threads/GUIThread.cpp | 83 ++++++++++++------- workspace/TS100/Core/Threads/MOVThread.cpp | 17 +--- workspace/TS100A/.gitignore | 5 -- 7 files changed, 62 insertions(+), 58 deletions(-) delete mode 100644 workspace/TS100A/.gitignore diff --git a/workspace/TS100/Core/Drivers/TipThermoModel.cpp b/workspace/TS100/Core/Drivers/TipThermoModel.cpp index 5264130d..34d038c6 100755 --- a/workspace/TS100/Core/Drivers/TipThermoModel.cpp +++ b/workspace/TS100/Core/Drivers/TipThermoModel.cpp @@ -239,7 +239,7 @@ uint32_t TipThermoModel::getTipInF(bool sampleNow) { #endif uint32_t TipThermoModel::getTipMaxInC() { - uint32_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(0x7FFF - (80 * 5)); //back off approx 5 deg c from ADC max + uint32_t maximumTipTemp = TipThermoModel::convertTipRawADCToDegC(0x7FFF - (21 * 5)); //back off approx 5 deg c from ADC max maximumTipTemp += getHandleTemperature() / 10; //Add handle offset return maximumTipTemp - 1; } diff --git a/workspace/TS100/Core/Inc/Settings.h b/workspace/TS100/Core/Inc/Settings.h index 5cb56738..d18881db 100755 --- a/workspace/TS100/Core/Inc/Settings.h +++ b/workspace/TS100/Core/Inc/Settings.h @@ -11,7 +11,7 @@ #define SETTINGS_H_ #include #include "unit.h" -#define SETTINGSVERSION (0x23) +#define SETTINGSVERSION (0x24) /*Change this if you change the struct below to prevent people getting \ out of sync*/ @@ -38,7 +38,7 @@ typedef struct { uint8_t detailedIDLE :1; // Detailed idle screen uint8_t detailedSoldering :1; // Detailed soldering screens #ifdef ENABLED_FAHRENHEIT_SUPPORT - uint8_t temperatureInF : 1; // Should the temp be in F or C (true is F) + uint8_t temperatureInF :1; // Should the temp be in F or C (true is F) #endif uint8_t descriptionScrollSpeed :1; // Description scroll speed uint8_t lockingMode :2; // Store the locking mode @@ -51,11 +51,12 @@ typedef struct { uint8_t powerLimit; // Maximum power iron allowed to output - uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment uint16_t TempChangeLongStep; // Change the plus and minus button assigment uint16_t TempChangeShortStep; // Change the plus and minus button assigment uint8_t hallEffectSensitivity; //Operating mode of the hall effect sensor + uint8_t accelMissingWarningCounter; // Counter of how many times we have warned we cannot detect the accelerometer + uint8_t pdMissingWarningCounter; // Counter of how many times we have warned we cannot detect the pd interface uint32_t padding; // This is here for in case we are not an even divisor so // that nothing gets cut off diff --git a/workspace/TS100/Core/Inc/main.hpp b/workspace/TS100/Core/Inc/main.hpp index 3850ab6e..ede22bd5 100755 --- a/workspace/TS100/Core/Inc/main.hpp +++ b/workspace/TS100/Core/Inc/main.hpp @@ -15,6 +15,7 @@ void vApplicationStackOverflowHook(TaskHandle_t *pxTask, signed portCHAR *pcTaskName); #define NO_DETECTED_ACCELEROMETER 99 +#define ACCELEROMETERS_SCANNING 100 //Threads void startGUITask(void const *argument); void startPIDTask(void const *argument); diff --git a/workspace/TS100/Core/Src/Settings.cpp b/workspace/TS100/Core/Src/Settings.cpp index 3faa0ea3..9748d230 100755 --- a/workspace/TS100/Core/Src/Settings.cpp +++ b/workspace/TS100/Core/Src/Settings.cpp @@ -68,7 +68,7 @@ void resetSettings() { systemSettings.lockingMode = LOCKING_MODE; // Disable locking for safety systemSettings.coolingTempBlink = COOLING_TEMP_BLINK; // Blink the temperature on the cooling screen when its > 50C #ifdef ENABLED_FAHRENHEIT_SUPPORT - systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0 + systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0 #endif systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow systemSettings.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV @@ -78,6 +78,9 @@ void resetSettings() { systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; // systemSettings.KeepAwakePulse = POWER_PULSE_DEFAULT; systemSettings.hallEffectSensitivity = 1; + systemSettings.accelMissingWarningCounter = 0; + systemSettings.pdMissingWarningCounter = 0; + saveSettings(); // Save defaults } diff --git a/workspace/TS100/Core/Threads/GUIThread.cpp b/workspace/TS100/Core/Threads/GUIThread.cpp index e6835495..644cd09f 100755 --- a/workspace/TS100/Core/Threads/GUIThread.cpp +++ b/workspace/TS100/Core/Threads/GUIThread.cpp @@ -34,6 +34,7 @@ extern osThreadId MOVTaskHandle; extern osThreadId PIDTaskHandle; static bool shouldBeSleeping(bool inAutoStart = false); static bool shouldShutdown(); +void showWarnings(); #define MOVEMENT_INACTIVITY_TIME (60 * configTICK_RATE_HZ) #define BUTTON_INACTIVITY_TIME (60 * configTICK_RATE_HZ) static TickType_t lastHallEffectSleepStart = 0; @@ -43,6 +44,14 @@ static uint16_t min(uint16_t a, uint16_t b) { else return a; } +void warnUser(const char *warning, const int font, const int timeout) { + OLED::setFont(font); + OLED::clearScreen(); + OLED::setCursor(0, 0); + OLED::print(warning); + OLED::refresh(); + waitForButtonPressOrTimeout(timeout); +} void printVoltage() { uint32_t volt = getInputVoltageX10(systemSettings.voltageDiv, 0); @@ -473,38 +482,26 @@ static void gui_solderingMode(uint8_t jumpToSleep) { if (buttonsLocked && (systemSettings.lockingMode != 0)) { // If buttons locked switch (buttons) { case BUTTON_NONE: - // stay boostModeOn = false; break; case BUTTON_BOTH_LONG: // Unlock buttons buttonsLocked = false; - OLED::setCursor(0, 0); - OLED::clearScreen(); - OLED::setFont(0); - OLED::print(UnlockingKeysString); - OLED::refresh(); - waitForButtonPressOrTimeout(1000); + warnUser(UnlockingKeysString, 0, TICKS_SECOND); break; case BUTTON_F_LONG: // if boost mode is enabled turn it on if (systemSettings.BoostTemp && (systemSettings.lockingMode == 1)) { boostModeOn = true; - break; } - ; + break; // fall through case BUTTON_BOTH: case BUTTON_B_LONG: case BUTTON_F_SHORT: case BUTTON_B_SHORT: // Do nothing and display a lock warming - OLED::setCursor(0, 0); - OLED::clearScreen(); - OLED::setFont(0); - OLED::print(WarningKeysLockedString); - OLED::refresh(); - waitForButtonPressOrTimeout(500); + warnUser(WarningKeysLockedString, 0, TICKS_SECOND / 2); break; default: break; @@ -540,12 +537,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) { if (systemSettings.lockingMode != 0) { // Lock buttons buttonsLocked = true; - OLED::setCursor(0, 0); - OLED::clearScreen(); - OLED::setFont(0); - OLED::print(LockingKeysString); - OLED::refresh(); - waitForButtonPressOrTimeout(1000); + warnUser(LockingKeysString, 0, TICKS_SECOND); } break; default: @@ -706,7 +698,7 @@ void showDebugMenu(void) { break; case 10: // Print PCB ID number - OLED::printNumber(PCBVersion, 2); + OLED::printNumber(DetectedAccelerometerVersion, 2); break; case 11: // Power negotiation status @@ -752,6 +744,40 @@ void showDebugMenu(void) { GUIDelay(); } } + +void showWarnings() { + // Display alert if settings were reset + if (settingsWereReset) { + warnUser(SettingsResetMessage, 1, 10 * TICKS_SECOND); + } +#ifndef NO_WARN_MISSING + //We also want to alert if accel or pd is not detected / not responding + // In this case though, we dont want to nag the user _too_ much + // So only show first 2 times + while (DetectedAccelerometerVersion == ACCELEROMETERS_SCANNING) { + osDelay(1); + } + // Display alert if accelerometer is not detected + if (DetectedAccelerometerVersion == NO_DETECTED_ACCELEROMETER) { + if (systemSettings.accelMissingWarningCounter < 2) { + systemSettings.accelMissingWarningCounter++; + saveSettings(); + warnUser(NoAccelerometerMessage, 1, 10 * TICKS_SECOND); + } + } +#ifdef POW_PD +//We expect pd to be present + if (!usb_pd_detect()) { + if (systemSettings.pdMissingWarningCounter < 2) { + systemSettings.pdMissingWarningCounter++; + saveSettings(); + warnUser(NoPowerDeliveryMessage, 1, 10 * TICKS_SECOND); + } + } +#endif +#endif +} + uint8_t idleScreenBGF[sizeof(idleScreenBG)]; /* StartGUITask function */ void startGUITask(void const *argument __unused) { @@ -783,15 +809,8 @@ void startGUITask(void const *argument __unused) { GUIDelay(); } - if (settingsWereReset) { - // Display alert settings were reset - OLED::clearScreen(); - OLED::setFont(1); - OLED::setCursor(0, 0); - OLED::print(SettingsResetMessage); - OLED::refresh(); - waitForButtonPressOrTimeout(10000); - } + showWarnings(); + if (systemSettings.autoStartMode) { // jump directly to the autostart mode gui_solderingMode(systemSettings.autoStartMode - 1); @@ -925,7 +944,7 @@ void startGUITask(void const *argument __unused) { //Draw in missing tip symbol #ifdef OLED_FLIP - if (!OLED::getRotation()) { + if (!OLED::getRotation()) { #else if (OLED::getRotation()) { #endif diff --git a/workspace/TS100/Core/Threads/MOVThread.cpp b/workspace/TS100/Core/Threads/MOVThread.cpp index be6be6f9..479f9362 100755 --- a/workspace/TS100/Core/Threads/MOVThread.cpp +++ b/workspace/TS100/Core/Threads/MOVThread.cpp @@ -24,6 +24,7 @@ uint8_t accelInit = 0; TickType_t lastMovementTime = 0; void detectAccelerometerVersion() { + DetectedAccelerometerVersion = ACCELEROMETERS_SCANNING; #ifdef ACCEL_MMA if (MMA8652FC::detect()) { DetectedAccelerometerVersion = 1; @@ -83,16 +84,11 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation } void startMOVTask(void const *argument __unused) { postRToSInit(); - while (OLED::isInitDone() == false) { - osDelay(1); //Make oled init happen first - } - OLED::setRotation(systemSettings.OrientationMode & 1); detectAccelerometerVersion(); lastMovementTime = 0; if ((systemSettings.autoStartMode == 2 || systemSettings.autoStartMode == 3)) osDelay(2 * TICKS_SECOND); - lastMovementTime = 0; int16_t datax[MOVFilter] = { 0 }; int16_t datay[MOVFilter] = { 0 }; int16_t dataz[MOVFilter] = { 0 }; @@ -102,17 +98,6 @@ void startMOVTask(void const *argument __unused) { if (systemSettings.sensitivity > 9) systemSettings.sensitivity = 9; Orientation rotation = ORIENTATION_FLAT; -// OLED::setFont(1); -// for (;;) { -// OLED::clearScreen(); -// OLED::setCursor(0, 0); -// readAccelerometer(tx, ty, tz, rotation); -// OLED::printNumber(tx, 5, 0); -// OLED::setCursor(0, 8); -// OLED::printNumber(xTaskGetTickCount() / 10, 5, 1); -// OLED::refresh(); -// osDelay(50); -// } for (;;) { int32_t threshold = 1500 + (9 * 200); threshold -= systemSettings.sensitivity * 200; // 200 is the step size diff --git a/workspace/TS100A/.gitignore b/workspace/TS100A/.gitignore deleted file mode 100644 index 5221ec2e..00000000 --- a/workspace/TS100A/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/Release/ -/TS100/ -/TS100_LOCAL/ -/ReleaseTS80/ -/ReleaseTS100/ From 286119a3a63f6a59deb8b7b1c1d881bc632fd45c Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 2 Jan 2021 17:04:19 +1100 Subject: [PATCH 06/11] Update MOVThread.cpp --- workspace/TS100/Core/Threads/MOVThread.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workspace/TS100/Core/Threads/MOVThread.cpp b/workspace/TS100/Core/Threads/MOVThread.cpp index 479f9362..4b9e86a2 100755 --- a/workspace/TS100/Core/Threads/MOVThread.cpp +++ b/workspace/TS100/Core/Threads/MOVThread.cpp @@ -85,8 +85,10 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation void startMOVTask(void const *argument __unused) { postRToSInit(); detectAccelerometerVersion(); + osDelay(50); //wait ~50ms for setup of accel to finalise lastMovementTime = 0; - if ((systemSettings.autoStartMode == 2 || systemSettings.autoStartMode == 3)) + //Mask 2 seconds if we are in autostart so that if user is plugging in and then putting in stand it doesnt wake instantly + if (systemSettings.autoStartMode) osDelay(2 * TICKS_SECOND); int16_t datax[MOVFilter] = { 0 }; From dd38213729901d4f5650ad457d0c0edb8d0b2364 Mon Sep 17 00:00:00 2001 From: Dag0d Date: Sun, 3 Jan 2021 18:16:43 +0100 Subject: [PATCH 07/11] Improved German translation --- Translation Editor/translation_de.json | 66 +++++++++++++------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Translation Editor/translation_de.json b/Translation Editor/translation_de.json index 0ba7c800..8058bbd9 100644 --- a/Translation Editor/translation_de.json +++ b/Translation Editor/translation_de.json @@ -6,7 +6,7 @@ "messages": { "SettingsCalibrationDone": "Kalibrierung abgeschlossen!", "SettingsCalibrationWarning": "Vor dem Fortfahren muss die Lötspitze vollständig abgekühlt sein!", - "SettingsResetWarning": "Sind Sie sicher, dass Sie alle Werte zurücksetzen wollen?", + "SettingsResetWarning": "Bist du sicher, dass du alle Werte zurücksetzen willst?", "UVLOWarningString": "V niedr.", "UndervoltageString": "Unterspannung", "InputVoltageString": "V Eingang: ", @@ -14,7 +14,7 @@ "BadTipString": "Spitze Defekt", "SleepingSimpleString": "Zzz ", "SleepingAdvancedString": "Ruhemodus...", - "WarningSimpleString": "HEIß", + "WarningSimpleString": "HEIß!", "WarningAdvancedString": "! Achtung Heiß !", "SleepingTipAdvancedString": "Temp:", "IdleTipString": "Ist:", @@ -23,29 +23,29 @@ "SolderingAdvancedPowerPrompt": "Leistung: ", "OffString": "Aus", "ResetOKMessage": "Reset OK", - "YourGainMessage": "Your Gain:", - "SettingsResetMessage": "Einstellungen\nzurück gesetzt!", - "LockingKeysString": " LOCKED", - "UnlockingKeysString": "UNLOCKED", - "WarningKeysLockedString": "!LOCKED!" + "YourGainMessage": "Dein Faktor:", + "SettingsResetMessage": "Einstellungen zurückgesetzt!", + "LockingKeysString": "GESPERRT", + "UnlockingKeysString": "ENTSPERRT", + "WarningKeysLockedString": "!GESPERRT!" }, "characters": { "SettingRightChar": "R", "SettingLeftChar": "L", "SettingAutoChar": "A", - "SettingFastChar": "F", - "SettingSlowChar": "S", - "SettingStartSolderingChar": "T", - "SettingStartSleepChar": "S", + "SettingFastChar": "S", + "SettingSlowChar": "L", + "SettingStartSolderingChar": "L", + "SettingStartSleepChar": "R", "SettingStartSleepOffChar": "O", - "SettingStartNoneChar": "F", - "SettingSensitivityOff": "O", - "SettingSensitivityLow": "L", + "SettingStartNoneChar": "A", + "SettingSensitivityOff": "A", + "SettingSensitivityLow": "N", "SettingSensitivityMedium": "M", "SettingSensitivityHigh": "H", "SettingLockDisableChar": "D", "SettingLockBoostChar": "B", - "SettingLockFullChar": "F" + "SettingLockFullChar": "V" }, "menuGroups": { "SolderingMenu": { @@ -90,7 +90,7 @@ "Ruhetemp-", "eratur" ], - "desc": "Ruhetemperatur" + "desc": "Ruhetemperatur der Spitze" }, "SleepTimeout": { "text2": [ @@ -146,7 +146,7 @@ "Start im", "Lötmodus?" ], - "desc": "Automatischer Start-Modus beim Einschalten der Spannungsversorgung. " + "desc": "Automatischer Start-Modus beim Einschalten der Spannungsversorgung. " }, "CooldownBlink": { "text2": [ @@ -167,7 +167,7 @@ "Einstellungen", "zurücksetzen?" ], - "desc": "Einstellungen auf werkseinstellungen zurück setzen" + "desc": "Einstellungen auf Werkseinstellungen zurücksetzen" }, "VoltageCalibration": { "text2": [ @@ -188,7 +188,7 @@ "Scroll-", "geschw." ], - "desc": "Scrollgeschwindigkeit der Texte " + "desc": "Scrollgeschwindigkeit der Texte " }, "TipModel": { "text2": [ @@ -223,12 +223,12 @@ "Leistungs-", "Limit" ], - "desc": "Maximale aufnahme der Lötspitze " + "desc": "Maximale Leistungsaufnahme des Lötkolbens " }, "ReverseButtonTempChange": { "text2": [ "Taste +-", - "Umkehren?" + "umkehren?" ], "desc": "Temperatur-Änderungs-Tasten-Belegung Plus-Minus umkehren?" }, @@ -248,31 +248,31 @@ }, "PowerPulsePower": { "text2": [ - "Power", - "Pulse W" + "Leistungs-", + "impuls in Watt" ], - "desc": "Keep awake pulse power intensity" + "desc": "Halte das Netzteil mit einem Leistungsimpuls wach" }, "TipGain": { "text2": [ - "Modify", - "tip gain" + "Ändere", + "Spitzen Faktor" ], - "desc": "Tip gain" + "desc": "Spitzen Faktor" }, "HallEffSensitivity": { "text2": [ - "Hall Eff", - "Sensitivity" + "Hall Sensor", + "Empfindlichkeit" ], - "desc": "Sensitivity of the Hall effect sensor in detecting sleep " + "desc": "Empfindlichkeit des Hall Effekt Sensors beim erkennen des Ruhemodus " }, "LockingMode": { "text2": [ - "Allow buttons", - "locking" + "Erlaube Knopf-", + "Sperre" ], - "desc": "When soldering, long press on both buttons lock them " + "desc": "Langes drücken beider Knöpfe beim Löten, sperrt diese " } } } \ No newline at end of file From e2600b433657887d9c12e0353cac053d779a2d6a Mon Sep 17 00:00:00 2001 From: discip <53649486+discip@users.noreply.github.com> Date: Mon, 4 Jan 2021 02:53:18 +0100 Subject: [PATCH 08/11] Update translation_de.json --- Translation Editor/translation_de.json | 68 +++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/Translation Editor/translation_de.json b/Translation Editor/translation_de.json index 8058bbd9..78147ef8 100644 --- a/Translation Editor/translation_de.json +++ b/Translation Editor/translation_de.json @@ -6,7 +6,7 @@ "messages": { "SettingsCalibrationDone": "Kalibrierung abgeschlossen!", "SettingsCalibrationWarning": "Vor dem Fortfahren muss die Lötspitze vollständig abgekühlt sein!", - "SettingsResetWarning": "Bist du sicher, dass du alle Werte zurücksetzen willst?", + "SettingsResetWarning": "Sicher, dass alle Werte zurückgesetzt werden sollen?", "UVLOWarningString": "V niedr.", "UndervoltageString": "Unterspannung", "InputVoltageString": "V Eingang: ", @@ -22,9 +22,9 @@ "TipDisconnectedString": "Spitze fehlt", "SolderingAdvancedPowerPrompt": "Leistung: ", "OffString": "Aus", - "ResetOKMessage": "Reset OK", + "ResetOKMessage": "Reset abgeschlossen!", "YourGainMessage": "Dein Faktor:", - "SettingsResetMessage": "Einstellungen zurückgesetzt!", + "SettingsResetMessage": "Einstellungen \nzurückgesetzt!", "LockingKeysString": "GESPERRT", "UnlockingKeysString": "ENTSPERRT", "WarningKeysLockedString": "!GESPERRT!" @@ -57,7 +57,7 @@ }, "PowerSavingMenu": { "text2": [ - "Schlaf-", + "Ruhe-", "modus" ], "desc": "Energiespareinstellungen" @@ -87,8 +87,8 @@ }, "SleepTemperature": { "text2": [ - "Ruhetemp-", - "eratur" + "Ruhe- + "temperatur" ], "desc": "Ruhetemperatur der Spitze" }, @@ -111,7 +111,7 @@ "Bewegungs-", "empfindlichk." ], - "desc": "Bewegungsempfindlichkeit <0=Aus, 1=Minimal ... 9=Maximal>" + "desc": "Bewegungsempfindlichkeit <0=aus, 1=minimal ... 9=maximal>" }, "TemperatureUnit": { "text2": [ @@ -132,28 +132,28 @@ "Anzeige-", "ausrichtung" ], - "desc": "Ausrichtung der Anzeige " + "desc": "Ausrichtung der Anzeige " }, "BoostTemperature": { "text2": [ - "Boosttemp-", - "eratur" + "Boost-", + "temperatur" ], - "desc": "Temperatur im Boostmodus (In der eingestellten Einheit)" + "desc": "Temperatur im Boostmodus" }, "AutoStart": { "text2": [ "Start im", - "Lötmodus?" + "Lötmodus" ], - "desc": "Automatischer Start-Modus beim Einschalten der Spannungsversorgung. " + "desc": "Bestimmt das Heizverhalten beim Einschalten der Spannungsversorgung. " }, "CooldownBlink": { "text2": [ "Abkühl-", - "blinken?" + "blinken" ], - "desc": "Blinkende Temperaturanzeige beim Abkühlen, solange heiß ist." + "desc": "Temperaturanzeige blinkt beim Abkühlen, solange Spitze heiß ist." }, "TemperatureCalibration": { "text2": [ @@ -167,7 +167,7 @@ "Einstellungen", "zurücksetzen?" ], - "desc": "Einstellungen auf Werkseinstellungen zurücksetzen" + "desc": "Werte werden auf Werkseinstellungen zurückgesetzt" }, "VoltageCalibration": { "text2": [ @@ -188,7 +188,7 @@ "Scroll-", "geschw." ], - "desc": "Scrollgeschwindigkeit der Texte " + "desc": "Scrollgeschwindigkeit der Erläuterungen " }, "TipModel": { "text2": [ @@ -202,7 +202,7 @@ "Einfache", "Kalibrierung" ], - "desc": "Einfache Kalibrierung mittels heißem Wasser" + "desc": "Einfache Kalibrierung mittels heißen Wassers" }, "AdvancedCalibrationMode": { "text2": [ @@ -221,37 +221,37 @@ "PowerLimit": { "text2": [ "Leistungs-", - "Limit" + "limit" ], "desc": "Maximale Leistungsaufnahme des Lötkolbens " }, "ReverseButtonTempChange": { "text2": [ - "Taste +-", + "+- Tasten", "umkehren?" ], - "desc": "Temperatur-Änderungs-Tasten-Belegung Plus-Minus umkehren?" + "desc": "Tastenbelegung zur Temperaturänderung umkehren" }, "TempChangeShortStep": { "text2": [ - "T. Schritt", - "Taste kurz?" + "Temp-Schritt", + "kurzer Druck" ], - "desc": "Temperaturwechselschritte bei kurzem Tastendruck!" + "desc": "Schrittweite für Temperaturwechsel bei kurzem Tastendruck" }, "TempChangeLongStep": { "text2": [ - "T. Schritt", - "Taste Lang?" + "Temp-Schritt", + "langer Druck" ], - "desc": "Temperaturwechselschritte bei langem Tastendruck!" + "desc": "Schrittweite für Temperaturwechsel bei langem Tastendruck" }, "PowerPulsePower": { "text2": [ "Leistungs-", - "impuls in Watt" + "impuls" ], - "desc": "Halte das Netzteil mit einem Leistungsimpuls wach" + "desc": "Powerbank wird mittels eines Impulses wach gehalten " }, "TipGain": { "text2": [ @@ -265,14 +265,14 @@ "Hall Sensor", "Empfindlichkeit" ], - "desc": "Empfindlichkeit des Hall Effekt Sensors beim erkennen des Ruhemodus " + "desc": "Empfindlichkeit des Hall Effekt Sensors beim Erkennen des Ruhemodus " }, "LockingMode": { "text2": [ - "Erlaube Knopf-", - "Sperre" + "Knopf-", + "sperre" ], - "desc": "Langes drücken beider Knöpfe beim Löten, sperrt diese " + "desc": "Langes drücken beider Knöpfe im Lötmodus, sperrt diese " } } -} \ No newline at end of file +} From 5c493f2bbd411d279e2c3a37f04934b1f7dc36cd Mon Sep 17 00:00:00 2001 From: discip <53649486+discip@users.noreply.github.com> Date: Mon, 4 Jan 2021 03:10:57 +0100 Subject: [PATCH 09/11] Update translation_en.json --- Translation Editor/translation_en.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Translation Editor/translation_en.json b/Translation Editor/translation_en.json index 22873c8a..6340c91e 100644 --- a/Translation Editor/translation_en.json +++ b/Translation Editor/translation_en.json @@ -35,10 +35,10 @@ "SettingAutoChar": "A", "SettingFastChar": "F", "SettingSlowChar": "S", - "SettingStartSolderingChar": "T", - "SettingStartSleepChar": "S", - "SettingStartSleepOffChar": "O", - "SettingStartNoneChar": "F", + "SettingStartSolderingChar": "S", + "SettingStartSleepChar": "Z", + "SettingStartSleepOffChar": "R", + "SettingStartNoneChar": "O", "SettingSensitivityOff": "O", "SettingSensitivityLow": "L", "SettingSensitivityMedium": "M", @@ -146,7 +146,7 @@ "Auto", "start" ], - "desc": "Automatically starts the iron into soldering mode on power up " + "desc": "Starts the iron into soldering mode on power up " }, "CooldownBlink": { "text2": [ @@ -160,21 +160,21 @@ "Calibrate", "temperature?" ], - "desc": "Start tip offset calibrating procedure" + "desc": "Start tip temperature offset calibration" }, "SettingsReset": { "text2": [ "Factory", "reset?" ], - "desc": "Reset settings to default!" + "desc": "Reset settings to default" }, "VoltageCalibration": { "text2": [ "Calibrate", "input voltage?" ], - "desc": "VIN Calibration " + "desc": "Start VIN calibration " }, "AdvancedSoldering": { "text2": [ @@ -237,21 +237,21 @@ "Temp change", "short" ], - "desc": "Temperature change steps on short button press" + "desc": "Temperature change increment on short button press" }, "TempChangeLongStep": { "text2": [ "Temp change", "long" ], - "desc": "Temperature change steps on long button press" + "desc": "Temperature change increment on long button press" }, "PowerPulsePower": { "text2": [ "Power", "pulse" ], - "desc": "Intensity of power of keep-awake-pulse " + "desc": "Intensity of power of keep-awake-pulse " }, "TipGain": { "text2": [ @@ -265,7 +265,7 @@ "Hall sensor", "sensitivity" ], - "desc": "Sensitivity of the Hall effect sensor in detecting sleep " + "desc": "Sensitivity of the Hall effect sensor to detect sleep " }, "LockingMode": { "text2": [ From 5f732998a455b800c6cc27ad4d42c56d4e1a2a55 Mon Sep 17 00:00:00 2001 From: discip <53649486+discip@users.noreply.github.com> Date: Mon, 4 Jan 2021 03:17:25 +0100 Subject: [PATCH 10/11] Update translation_de.json --- Translation Editor/translation_de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translation Editor/translation_de.json b/Translation Editor/translation_de.json index 78147ef8..b7304799 100644 --- a/Translation Editor/translation_de.json +++ b/Translation Editor/translation_de.json @@ -87,7 +87,7 @@ }, "SleepTemperature": { "text2": [ - "Ruhe- + "Ruhe-", "temperatur" ], "desc": "Ruhetemperatur der Spitze" From 402ddd81080e5acac382d9ff1aab341204158308 Mon Sep 17 00:00:00 2001 From: Dag0d Date: Mon, 4 Jan 2021 09:52:57 +0100 Subject: [PATCH 11/11] added German translation for the 2 new warnings (USB PD and accelerometer) --- Translation Editor/translation_de.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Translation Editor/translation_de.json b/Translation Editor/translation_de.json index 849db672..247e02d7 100644 --- a/Translation Editor/translation_de.json +++ b/Translation Editor/translation_de.json @@ -22,11 +22,11 @@ "TipDisconnectedString": "Spitze fehlt", "SolderingAdvancedPowerPrompt": "Leistung: ", "OffString": "Aus", - "NoAccelerometerMessage": "No accelerometer\ndetected!", - "NoPowerDeliveryMessage": "No USB-PD IC\ndetected!", + "NoAccelerometerMessage": "Kein Bewegungssensor\nerkannt!", + "NoPowerDeliveryMessage": "Kein USB-PD IC\nerkannt!", "ResetOKMessage": "Reset abgeschlossen!", "YourGainMessage": "Dein Faktor:", - "SettingsResetMessage": "Einstellungen \nzurückgesetzt!", + "SettingsResetMessage": "Einstellungen\nzurückgesetzt!", "LockingKeysString": "GESPERRT", "UnlockingKeysString": "ENTSPERRT", "WarningKeysLockedString": "!GESPERRT!"