diff options
46 files changed, 152 insertions, 6 deletions
diff --git a/Documentation/Logo.md b/Documentation/Logo.md index 9734fda3..a4947091 100644 --- a/Documentation/Logo.md +++ b/Documentation/Logo.md @@ -38,7 +38,7 @@ The model should be replaced by one of the following options: - `miniware` for older Miniware Irons -> TS100, TS80, TS80P - `pinecilv1` for the Pinecil V1 - `pinecilv2` for the Pinecil V2 -- `ts101` for the Miniware TS101 [^1] +- `ts101` for the Miniware TS101 [^1] [^2] - `s60` for the Squire S60 [^1] - `mhp30` for the Miniware MHP30 @@ -50,6 +50,28 @@ After processing its expected to have a `.hex` and `.dfu` file created to be use Note: make sure your image file is in the same folder as script files (img2logo.py, output_dfu.py, output_hex.py). [^1] Note that these devices have larger resolution screens that the logo system supports right now. Fixes are coming for this soon, roughly scheduled for 2.23. +[^2] The TS101 requires extra steps, see below. + +### TS101 Quirks + +When Miniware designed the TS101 they cut cost by using an STM32 clone with some odd quirks. They also re-wrote their USB bootloader, which has introduced new bugs for us to deal with. +Their bootloader appears to have kept the existing limit of not being able to flash small hex files, but they no longer fall for the older "just repeat the content" trick and instead reject the file. +Additionally, while the MCU in use has 128K of flash, their bootloader (at least for me) fails to write to anything above 99K. It _looks_ like a watchdog reset or hard crash. Unsure. + +This has flow on effects, where the settings can still be located in the upper ~28K of flash, but it cant be used for anything we flash over USB. +Of that 100K we can use, they waste 32K of it for their bootloader (Old bootloaders were 16K). +This means the main "app" of IronOS is limited to around 67K (100K-32K for bootloader, -1K for logo). + +For this device the Logo is not located at the end of flash but instead at the last writable page (99K). + +Additionally, as we need to do a large write, to avoid having to waste more flash space; the logo is merged with the normal firmware. This means that the firmware and logo are flashed together once. +Future updates can be done without merging as it will leave the logo data there as normal firmware doesnt touch that area of flash. + +To do this, download the latest version of IronOS and merge it with the logo using the `--merge` command line argument. + +To create the logo file for a TS101 the full command looks like `python3 img2logo.py <image file path> <output folder path> -m ts101 --merge <Path to main firmware>`. + +For this reason, there are no TS101 logo's generated by the IronOS-Meta repo. ## Flashing the Logo diff --git a/Translations/translation_BE.json b/Translations/translation_BE.json index e9c9e601..eb98c804 100644 --- a/Translations/translation_BE.json +++ b/Translations/translation_BE.json @@ -233,6 +233,8 @@ "displayText": "Эфект Хола\nадчувальнасць", "description": "Узровень адчувальнасці датчыка хола ў рэжыме сну (1=Мін. | ... | 9=Макс.)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Адзінкі\nтэмпературы", "description": "Адзінкі вымярэння тэмпературы (C=Цэльcія | F=Фарэнгейта)" diff --git a/Translations/translation_BG.json b/Translations/translation_BG.json index 6ed233c0..3599d232 100644 --- a/Translations/translation_BG.json +++ b/Translations/translation_BG.json @@ -233,6 +233,8 @@ "displayText": "Датчик\nна Хол", "description": "Чувствителност на сензора към магнитно поле (1=Слабо | ... | 9=Силно)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Единици за\nтемпературата", "description": "Единици за температурата (C=Целзии | F=Фаренхайт)" diff --git a/Translations/translation_CS.json b/Translations/translation_CS.json index b3e7ebc6..31a1a004 100644 --- a/Translations/translation_CS.json +++ b/Translations/translation_CS.json @@ -233,6 +233,8 @@ "displayText": "Citlivost\nHall. čidla", "description": "Citlivost Hallova čidla pro detekci spánku (1=nejméně citlivé | ... | 9=nejvíce citlivé)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Jednotka\nteploty", "description": "C=Celsius | F=Fahrenheit" diff --git a/Translations/translation_DA.json b/Translations/translation_DA.json index 351b1034..024ff5a0 100644 --- a/Translations/translation_DA.json +++ b/Translations/translation_DA.json @@ -233,6 +233,8 @@ "displayText": "Hall sensor\nfølsomhed", "description": "følsomhed overfor magneten (1=Mindst følsom | ... | 9=Mest følsom)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatur\nEnhed", "description": "Temperatur Enhed (C=Celsius | F=Fahrenheit)" diff --git a/Translations/translation_DE.json b/Translations/translation_DE.json index b9596d36..5f1092cc 100644 --- a/Translations/translation_DE.json +++ b/Translations/translation_DE.json @@ -233,6 +233,8 @@ "displayText": "Empfindlichkeit\nder Hall-Sonde", "description": "Empfindlichkeit der Hall-Sonde um den Ruhemodus auszulösen (1=minimal | ... | 9=maximal)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatur-\neinheit", "description": "C=°Celsius | F=°Fahrenheit" diff --git a/Translations/translation_EL.json b/Translations/translation_EL.json index aca0c02e..31601626 100644 --- a/Translations/translation_EL.json +++ b/Translations/translation_EL.json @@ -233,6 +233,8 @@ "displayText": "Ευαισθ. αισθ. \nφαιν. Hall", "description": "Ευαισθησία του αισθητήρα φαινομένου Hall για εντοπισμό αδράνειας (1=λιγότερο ευαίσθητο | ... | 9=περισσότερο ευαίσθητο)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Μονάδες\nθερμοκρασίας", "description": "C=Κελσίου | F=Φαρενάιτ" diff --git a/Translations/translation_EN.json b/Translations/translation_EN.json index c6f440a6..bbf0c0a3 100644 --- a/Translations/translation_EN.json +++ b/Translations/translation_EN.json @@ -233,6 +233,10 @@ "displayText": "Hall sensor\nsensitivity", "description": "Sensitivity to magnets (1=least sensitive | ... | 9=most sensitive)" }, + "HallEffSleepTimeout": { + "displayText": "HallSensor\nSleepTime", + "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperature\nunit", "description": "C=°Celsius | F=°Fahrenheit" diff --git a/Translations/translation_ES.json b/Translations/translation_ES.json index 01972280..9ada4245 100644 --- a/Translations/translation_ES.json +++ b/Translations/translation_ES.json @@ -233,6 +233,8 @@ "displayText": "Hall Eff\nSensibilidad", "description": "Sensibilidad del sensor de efecto Hall en la detección de reposo (1=menos sensible | ... | 9=más sensible)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Unidad de\ntemperatura", "description": "Unidad de temperatura (C=entígrados | F=Fahrenheit)" diff --git a/Translations/translation_ET.json b/Translations/translation_ET.json index fc084202..ef395ac0 100644 --- a/Translations/translation_ET.json +++ b/Translations/translation_ET.json @@ -233,6 +233,8 @@ "displayText": "Halli anduri\ntundlikkus", "description": "Tundlikkus magnetite suhtes (1=vähetundlikum | ... | 9=kõige tundlikum)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatuuri\nühik", "description": "C=°Celsius | F=°Fahrenheit" diff --git a/Translations/translation_FI.json b/Translations/translation_FI.json index b6ae9873..f73cdc95 100644 --- a/Translations/translation_FI.json +++ b/Translations/translation_FI.json @@ -233,6 +233,8 @@ "displayText": "Hall-\nherk.", "description": "Hall-efektianturin herkkyys lepotilan tunnistuksessa (1=vähäinen herkkyys | ... | 9=suurin herkkyys)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Lämpötilan\nyksikkö", "description": "C=celsius, F=fahrenheit" diff --git a/Translations/translation_FR.json b/Translations/translation_FR.json index 87e36489..9877807c 100644 --- a/Translations/translation_FR.json +++ b/Translations/translation_FR.json @@ -233,6 +233,8 @@ "displayText": "Sensibilité\ncapteur effet hall", "description": "Sensibilité du capteur à effet Hall pour la mise en veille (1=peu sensible | ... | 9=très sensible)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Unité de\ntempérature", "description": "C=Celsius | F=Fahrenheit" diff --git a/Translations/translation_HR.json b/Translations/translation_HR.json index f49ea448..ab0a7882 100644 --- a/Translations/translation_HR.json +++ b/Translations/translation_HR.json @@ -233,6 +233,8 @@ "displayText": "Osjetljivost\nHall senzora", "description": "Osjetljivost senzora magnetskog polja za detekciju spavanja (N=Najmanja | S=Srednja | V=Visoka)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Jedinica\ntemperature", "description": "Jedinica temperature (C=Celzij | F=Fahrenheit)" diff --git a/Translations/translation_HU.json b/Translations/translation_HU.json index b3456bf1..ccf6230e 100644 --- a/Translations/translation_HU.json +++ b/Translations/translation_HU.json @@ -233,6 +233,8 @@ "displayText": "Alvásérzékelő\nérzékenység", "description": "Alvásérzékelő gyorsulásmérő érzékenysége (1=legkevésbé érzékeny | ... | 9=legérzékenyebb)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Hőmérséklet\nmértékegysége", "description": "Hőmérséklet mértékegysége (C=Celsius | F=Fahrenheit)" diff --git a/Translations/translation_IT.json b/Translations/translation_IT.json index edf4de7f..4e7e6194 100644 --- a/Translations/translation_IT.json +++ b/Translations/translation_IT.json @@ -233,6 +233,8 @@ "displayText": "Sensore\nHall", "description": "Regola la sensibilità del sensore ad effetto Hall per entrare in modalità riposo [1: minima; 9: massima]" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Unità di\ntemperatura", "description": "Scegli l'unità di misura per la temperatura [C: grado Celsius; F: grado Farenheit]" diff --git a/Translations/translation_JA_JP.json b/Translations/translation_JA_JP.json index cc5adf5c..836b152a 100644 --- a/Translations/translation_JA_JP.json +++ b/Translations/translation_JA_JP.json @@ -233,6 +233,8 @@ "displayText": "磁界感度", "description": "スタンバイモードに入るのに使用される磁場センサーの感度 <1=最低感度 | ... | 9=最高感度>" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "温度単位", "description": "C=摂氏 | F=華氏" diff --git a/Translations/translation_LT.json b/Translations/translation_LT.json index abf8967a..eecb2d41 100644 --- a/Translations/translation_LT.json +++ b/Translations/translation_LT.json @@ -233,6 +233,8 @@ "displayText": "Holo\njutiklis", "description": "Holo jutiklio jautrumas nustatant miegą (1=Mažiausias | ... | 9=Didžiausias)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatūros\nvienetai", "description": "Temperatūros vienetai (C=Celsijus | F=Farenheitas)" diff --git a/Translations/translation_NB.json b/Translations/translation_NB.json index 8840c64e..18578803 100644 --- a/Translations/translation_NB.json +++ b/Translations/translation_NB.json @@ -233,6 +233,8 @@ "displayText": "Hall-sensor\nfølsomhet", "description": "Sensitiviteten til Hall-effekt-sensoren for å detektere inaktivitet (1=Minst følsom | ... | 9=Mest følsom)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "TmpEnh\n", "description": "Temperaturskala (C=Celsius | F=Fahrenheit)" diff --git a/Translations/translation_NL.json b/Translations/translation_NL.json index 23761d3f..f35ad386 100644 --- a/Translations/translation_NL.json +++ b/Translations/translation_NL.json @@ -233,6 +233,8 @@ "displayText": "Hall sensor\ngevoeligheid", "description": "Gevoeligheid naar de magneten (1=minst gevoelig | ... | 9=meest gevoelig)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatuur\neenheid", "description": "C=°Celsius | F=°Fahrenheit" diff --git a/Translations/translation_NL_BE.json b/Translations/translation_NL_BE.json index 554986d9..573fd2bb 100644 --- a/Translations/translation_NL_BE.json +++ b/Translations/translation_NL_BE.json @@ -233,6 +233,8 @@ "displayText": "Hall sensor\ngevoeligheid", "description": "Gevoeligheid naar de magneten (1=minst gevoelig | ... | 9=meest gevoelig)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatuur\nschaal", "description": "Temperatuurschaal (°C=Celsius | °F=Fahrenheit)" diff --git a/Translations/translation_PL.json b/Translations/translation_PL.json index b10a59c8..cdc3fb20 100644 --- a/Translations/translation_PL.json +++ b/Translations/translation_PL.json @@ -233,6 +233,8 @@ "displayText": "Czułość\ncz. Halla", "description": "Czułość czujnika Halla, używanego do przechodznia w tryb uśpienia (1: Minimalna | ... | 9: Maksymalna)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Jednostka\ntemperatury", "description": "Jednostka temperatury (C: Celciusz | F: Fahrenheit)" diff --git a/Translations/translation_PT.json b/Translations/translation_PT.json index 28c49905..92d96af2 100644 --- a/Translations/translation_PT.json +++ b/Translations/translation_PT.json @@ -233,6 +233,8 @@ "displayText": "Sensibilidade de\nmagnetismo", "description": "Sensibilidade de magnetismo (1=Menor | ... | 9=Maior)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Unidade\ntemperatura", "description": "Unidade de temperatura (C=Celsius | F=Fahrenheit)" diff --git a/Translations/translation_RO.json b/Translations/translation_RO.json index 5d046979..10e7c3e3 100644 --- a/Translations/translation_RO.json +++ b/Translations/translation_RO.json @@ -233,6 +233,8 @@ "displayText": "Sensibilitate\nsenzor Hall", "description": "Sensibilitate senzor cu efect Hall pentru a detecta repausul (1=putin sensibil | ... | 9=cel mai sensibil)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Unitate de\ntemperatură", "description": "C=Celsius | F=Fahrenheit" diff --git a/Translations/translation_RU.json b/Translations/translation_RU.json index 68254f40..84ac4be2 100644 --- a/Translations/translation_RU.json +++ b/Translations/translation_RU.json @@ -233,6 +233,8 @@ "displayText": "Датчик\nХолла", "description": "Чувствительность датчика Холла к магнитному полю (1=мин. | ... | 9=макс.)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Единицы\nизмерения", "description": "Единицы измерения температуры (C=°Цельcия | F=°Фаренгейта)" diff --git a/Translations/translation_SK.json b/Translations/translation_SK.json index 09b62baf..0f77f9c1 100644 --- a/Translations/translation_SK.json +++ b/Translations/translation_SK.json @@ -233,6 +233,8 @@ "displayText": "Citliv.\nHall", "description": "Citlivosť Hallovho senzora pre detekciu spánku (1=Min | ... | 9=Max)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Jednotka\nteploty", "description": "Jednotky merania teploty (C=stupne Celzia | F=stupne Fahrenheita)" diff --git a/Translations/translation_SL.json b/Translations/translation_SL.json index 81bc8911..ede853a9 100644 --- a/Translations/translation_SL.json +++ b/Translations/translation_SL.json @@ -233,6 +233,8 @@ "displayText": "Občut.\nHall son", "description": "Občutljivost Hallove sonde za zaznavanje spanja (1=najmanjša | ... | 9=največja)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Enota za\ntemperaturo", "description": "Enota za temperaturo (C=celzij | F=fahrenheit)" diff --git a/Translations/translation_SR_CYRL.json b/Translations/translation_SR_CYRL.json index a635eeb0..e42e223b 100644 --- a/Translations/translation_SR_CYRL.json +++ b/Translations/translation_SR_CYRL.json @@ -233,6 +233,8 @@ "displayText": "Hall sensor\nsensitivity", "description": "Sensitivity to magnets (1=најмање осетљиво | ... | 9=најосетљивије)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Јединица\nтемпературе", "description": "Јединице у којима се приказује температура. (C=целзијус | F=фаренхајт)" diff --git a/Translations/translation_SR_LATN.json b/Translations/translation_SR_LATN.json index 36c660f3..b9e673e6 100644 --- a/Translations/translation_SR_LATN.json +++ b/Translations/translation_SR_LATN.json @@ -233,6 +233,8 @@ "displayText": "Hall sensor\nsensitivity", "description": "Sensitivity to magnets (1=najmanje osetljivo | ... | 9=najosetljivije)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Jedinica\ntemperature", "description": "Jedinice u kojima se prikazuje temperatura. (C=celzijus | F=farenhajt)" diff --git a/Translations/translation_SV.json b/Translations/translation_SV.json index e545dbe6..d64ee4a7 100644 --- a/Translations/translation_SV.json +++ b/Translations/translation_SV.json @@ -233,6 +233,8 @@ "displayText": "Sensor-\nkänslght", "description": "Känslighet för halleffekt-sensorn för viloläges-detektering (1=minst känslig | ... | 9=mest känslig)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Temperatur-\nenheter", "description": "Temperaturenhet (C=Celsius | F=Fahrenheit)" diff --git a/Translations/translation_TR.json b/Translations/translation_TR.json index 88e1e750..ebfbe4d3 100644 --- a/Translations/translation_TR.json +++ b/Translations/translation_TR.json @@ -233,6 +233,8 @@ "displayText": "Hall Sensör\nHassasiyeti", "description": "Mıknatıslara duyarlılık (1=En az duyarlı | ... | 9=En duyarlı)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "SCKBRM\n", "description": "Sıcaklık Birimi (C=Celsius | F=Fahrenheit)" diff --git a/Translations/translation_UK.json b/Translations/translation_UK.json index 4e2bdb6c..3f447e50 100644 --- a/Translations/translation_UK.json +++ b/Translations/translation_UK.json @@ -233,6 +233,8 @@ "displayText": "Чутливість\nЕфекту Холла", "description": "Чутливість датчика ефекту Холла при виявленні сну (1=мін. чутливості | ... | 9=макс. чутливості)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Формат темпе-\nратури(C°/F°)", "description": "Одиниця виміру температури (C=Цельсій | F=Фаренгейт)" diff --git a/Translations/translation_VI.json b/Translations/translation_VI.json index 637cc900..7c9ff9fa 100644 --- a/Translations/translation_VI.json +++ b/Translations/translation_VI.json @@ -233,6 +233,8 @@ "displayText": "Hall\nđo nhay", "description": "Đo nhay cam bien Hall đe phát hien che đo ngu (1=ít nhay nhat |...| 9=nhay nhat)" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "Đon vi\nnhiet đo", "description": "C= Đo C | F= Đo F" diff --git a/Translations/translation_YUE_HK.json b/Translations/translation_YUE_HK.json index f9f5f701..b6254360 100644 --- a/Translations/translation_YUE_HK.json +++ b/Translations/translation_YUE_HK.json @@ -233,6 +233,8 @@ "displayText": "磁場敏感度", "description": "磁場感應器用嚟啓動待機模式嘅敏感度 <1=最低敏感度 | ... | 9=最高敏感度>" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "温度單位", "description": "C=攝氏 | F=華氏" diff --git a/Translations/translation_ZH_CN.json b/Translations/translation_ZH_CN.json index b2ed8bdd..f4c5e241 100644 --- a/Translations/translation_ZH_CN.json +++ b/Translations/translation_ZH_CN.json @@ -233,6 +233,8 @@ "displayText": "磁场灵敏度", "description": "霍尔效应传感器用作启动待机模式的灵敏度 <1=最低灵敏度 | ... | 9=最高灵敏度>" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "温度单位", "description": "C=摄氏 | F=华氏" diff --git a/Translations/translation_ZH_TW.json b/Translations/translation_ZH_TW.json index fe1b9947..3535d5d3 100644 --- a/Translations/translation_ZH_TW.json +++ b/Translations/translation_ZH_TW.json @@ -233,6 +233,8 @@ "displayText": "磁場敏感度", "description": "磁場感應器用作啟動待機模式的敏感度 <1=最低敏感度 | ... | 9=最高敏感度>" }, + "HallEffSleepTimeout": { "displayText": "HallSensor\nSleepTime", "description": "Interval before \"sleep mode\" starts when hall effect is above threshold" + }, "TemperatureUnit": { "displayText": "溫標", "description": "C=攝氏 | F=華氏" diff --git a/Translations/translations_definitions.json b/Translations/translations_definitions.json index 3b735c3a..5cfe4302 100644 --- a/Translations/translations_definitions.json +++ b/Translations/translations_definitions.json @@ -412,6 +412,13 @@ "description": "If the unit has a hall effect sensor (Pinecil), this adjusts how sensitive it is at detecting a magnet to put the device into sleep mode." }, { + "id": "HallEffSleepTimeout", + "maxLen": 10, + "maxLen2": 10, + "include": ["HALL_SENSOR"], + "description": "If the unit has a hall effect sensor (Pinecil), this adjusts how long the device takes before it drops down to the sleep temperature when hall sensor is over threshold." + }, + { "id": "TemperatureUnit", "maxLen": 6, "maxLen2": 13, diff --git a/source/Core/BSP/Miniware/configuration.h b/source/Core/BSP/Miniware/configuration.h index f22ada8c..c1e9c351 100644 --- a/source/Core/BSP/Miniware/configuration.h +++ b/source/Core/BSP/Miniware/configuration.h @@ -194,7 +194,7 @@ #define POWER_LIMIT_STEPS 5 #define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 #define TEMP_uV_LOOKUP_HAKKO -#define ACCEL_LIS_CLONE 1 +#define ACCEL_LIS_CLONE 1 #define HARDWARE_MAX_WATTAGE_X10 1000 #define TIP_THERMAL_MASS 65 // X10 watts to raise 1 deg C in 1 second #define TIP_RESISTANCE 75 // x10 ohms, 7.5 typical for ts100 tips @@ -272,7 +272,12 @@ #endif /* TS80P */ #ifdef MODEL_TS101 -#define FLASH_LOGOADDR (0x08000000 + (126 * 1024)) +// For whatever reason, Miniware decided to not build a reliable DFU bootloader +// It can't appear to flash to some of the upper pages of flash, +// I'm slightly suspect a watchdog or something runs out +// as device resets before file finishes copying +// So logo has to be located on page 99 or else it cant be flashed on stock bootloader +#define FLASH_LOGOADDR (0x08000000 + (99 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (127 * 1024)) #else #define FLASH_LOGOADDR (0x08000000 + (62 * 1024)) diff --git a/source/Core/Inc/Settings.h b/source/Core/Inc/Settings.h index 007e47b8..44d9a1ff 100644 --- a/source/Core/Inc/Settings.h +++ b/source/Core/Inc/Settings.h @@ -73,8 +73,9 @@ enum SettingsOptions { ProfilePhase5Temp = 50, // Temperature to target for the end of phase 5 ProfilePhase5Duration = 51, // Target duration for phase 5 ProfileCooldownSpeed = 52, // Maximum allowed cooldown speed in degrees per second + HallEffectSleepTime = 53, // Seconds (/5) timeout to sleep when hall effect over threshold // - SettingsOptionsLength = 53, // + SettingsOptionsLength = 54, // }; typedef enum { diff --git a/source/Core/Inc/Translation.h b/source/Core/Inc/Translation.h index 1e48b129..92185f67 100644 --- a/source/Core/Inc/Translation.h +++ b/source/Core/Inc/Translation.h @@ -84,6 +84,7 @@ enum class SettingsItemIndex : uint8_t { SleepTimeout,
ShutdownTimeout,
HallEffSensitivity,
+ HallEffSleepTimeout,
TemperatureUnit,
DisplayRotation,
CooldownBlink,
diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index 9425590f..1a4e3729 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -104,6 +104,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp { MIN_TEMP_C, MAX_TEMP_F, 5, 90}, // ProfilePhase5Temp { 10, 180, 5, 30}, // ProfilePhase5Duration { 1, 10, 1, 2}, // ProfileCooldownSpeed + { 0, 12, 1, 0}, // HallEffectSleepTime }; static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength)); diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index 1a9d4373..c21071a5 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -111,6 +111,7 @@ static void displayLogoTime(void); #ifdef HALL_SENSOR static void displayHallEffect(void); +static void displayHallEffectSleepTime(void); static bool showHallEffect(void); #endif /* HALL_SENSOR */ @@ -162,6 +163,7 @@ static void displayAdvancedMenu(void); * -Sleep Time * -Shutdown Time * Hall Sensor Sensitivity + * Hall Sensor Sleep Time * * UI * Temperature Unit @@ -346,6 +348,8 @@ const menuitem PowerSavingMenu[] = { #ifdef HALL_SENSOR /* Hall Effect Sensitivity */ {SETTINGS_DESC(SettingsItemIndex::HallEffSensitivity), nullptr, displayHallEffect, showHallEffect, SettingsOptions::HallEffectSensitivity, SettingsItemIndex::HallEffSensitivity, 7}, + /* Hall Effect Sleep Time */ + {SETTINGS_DESC(SettingsItemIndex::HallEffSleepTimeout), nullptr, displayHallEffectSleepTime, showHallEffect, SettingsOptions::HallEffectSleepTime, SettingsItemIndex::HallEffSleepTimeout, 5}, #endif /* HALL_SENSOR */ /* vvvv end of menu marker. DO NOT REMOVE vvvv */ {0, nullptr, nullptr, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::NUM_ITEMS, 0} @@ -740,6 +744,16 @@ static void displayHallEffect(void) { } } static bool showHallEffect(void) { return getHallSensorFitted(); } +static void displayHallEffectSleepTime(void) { + if (getSettingValue(SettingsOptions::HallEffectSleepTime)) { + OLED::printNumber(getSettingValue(SettingsOptions::HallEffectSleepTime) * 5, 2, FontStyle::LARGE, false); + OLED::print(LargeSymbolSeconds, FontStyle::LARGE); + } else { + // When sleep time is set to zero, we sleep for 1 second anyways. This is the default. + OLED::printNumber(1, 2, FontStyle::LARGE, false); + OLED::print(LargeSymbolSeconds, FontStyle::LARGE); + } +} #endif /* HALL_SENSOR */ static void setTempF(const enum SettingsOptions option) { diff --git a/source/Core/Src/syscalls.c b/source/Core/Src/syscalls.c index b1cefd18..8d8557ca 100644 --- a/source/Core/Src/syscalls.c +++ b/source/Core/Src/syscalls.c @@ -11,4 +11,14 @@ /* Functions */
void initialise_monitor_handles() {}
+/* Syscalls (stub implementations to avoid compile warnings and possibe future problems) */
int _getpid(void) { return 1; }
+
+#if defined(MODEL_Pinecil) || defined(MODEL_Pinecilv2)
+// do nothing here because some stubs and real implementations added for Pinecils already
+#else
+off_t _lseek(int fd, off_t ptr, int dir) { return -1; }
+ssize_t _read(int fd, void *ptr, size_t len) { return -1; }
+ssize_t _write(int fd, const void *ptr, size_t len) { return -1; }
+int _close(int fd) { return -1; }
+#endif
diff --git a/source/Core/Threads/UI/logic/utils/OperatingModeUtilities.h b/source/Core/Threads/UI/logic/utils/OperatingModeUtilities.h index dccbec2c..1bd0835e 100644 --- a/source/Core/Threads/UI/logic/utils/OperatingModeUtilities.h +++ b/source/Core/Threads/UI/logic/utils/OperatingModeUtilities.h @@ -7,6 +7,7 @@ void GUIDelay(); // bool checkForUnderVoltage(void); // uint32_t getSleepTimeout(void); // +uint32_t getHallEffectSleepTimeout(void); // bool shouldBeSleeping(); // bool shouldShutdown(void); // void printVoltage(void); // diff --git a/source/Core/Threads/UI/logic/utils/getHallEffectSleepTimeout.cpp b/source/Core/Threads/UI/logic/utils/getHallEffectSleepTimeout.cpp new file mode 100644 index 00000000..22028205 --- /dev/null +++ b/source/Core/Threads/UI/logic/utils/getHallEffectSleepTimeout.cpp @@ -0,0 +1,13 @@ +#include "OperatingModeUtilities.h" + +#ifndef NO_SLEEP_MODE +#ifdef HALL_SENSOR +uint32_t getHallEffectSleepTimeout(void) { + if (getSettingValue(SettingsOptions::HallEffectSensitivity) && getSettingValue(SettingsOptions::HallEffectSleepTime)) { + uint32_t sleepThres = getSettingValue(SettingsOptions::HallEffectSleepTime) * 5 * TICKS_SECOND; + return sleepThres; + } + return TICKS_SECOND; +} +#endif +#endif diff --git a/source/Core/Threads/UI/logic/utils/shouldDeviceSleep.cpp b/source/Core/Threads/UI/logic/utils/shouldDeviceSleep.cpp index 9e27f2eb..6b50800e 100644 --- a/source/Core/Threads/UI/logic/utils/shouldDeviceSleep.cpp +++ b/source/Core/Threads/UI/logic/utils/shouldDeviceSleep.cpp @@ -32,7 +32,7 @@ bool shouldBeSleeping() { if (lastHallEffectSleepStart == 0) { lastHallEffectSleepStart = xTaskGetTickCount(); } - if ((xTaskGetTickCount() - lastHallEffectSleepStart) > TICKS_SECOND) { + if ((xTaskGetTickCount() - lastHallEffectSleepStart) > getHallEffectSleepTimeout()) { return true; } } else { diff --git a/source/Makefile b/source/Makefile index 01cd929f..0754d7c6 100644 --- a/source/Makefile +++ b/source/Makefile @@ -84,7 +84,8 @@ DEVICE_BSP_DIR=./Core/BSP/Miniware LDSCRIPT=./Core/BSP/Miniware/stm32f103.ld
ifeq ($(model),$(filter $(model),TS101))
-flash_size=126k
+# 128K, but logo must be at 99K so their broken ass DFU can flash it
+flash_size=98k
bootldr_size=0x8000
DEVICE_DFU_ADDRESS=0x08008000
else
|