Merge branch 'master' into pinecil
This commit is contained in:
@@ -32,7 +32,7 @@ This project is considered feature complete for use as a soldering iron, *so ple
|
|||||||
* Boost mode lets you temporarily change the temperature when soldering (i.e. raise the temperature for short periods of time)
|
* Boost mode lets you temporarily change the temperature when soldering (i.e. raise the temperature for short periods of time)
|
||||||
* (TS100) Battery charge level indicator if power source set to a lipo cell count
|
* (TS100) Battery charge level indicator if power source set to a lipo cell count
|
||||||
* (TS80) Power bank operating voltage is displayed
|
* (TS80) Power bank operating voltage is displayed
|
||||||
* [Custom boot up logo support](Documentation/upgrading.md)
|
* [Custom boot up logo support](Documentation/Upgrading.md)
|
||||||
* Automatic LCD rotation based on the orientation
|
* Automatic LCD rotation based on the orientation
|
||||||
* Supports both the version 1 and version 2 hardware (different accelerometers)
|
* Supports both the version 1 and version 2 hardware (different accelerometers)
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ When on the main screen, the unit shows prompts for the two most common operatio
|
|||||||
* Holding the button near the tip will enter soldering temperature adjust mode (This is the same as the one in the soldering menu, just to let you edit before heating up)
|
* Holding the button near the tip will enter soldering temperature adjust mode (This is the same as the one in the soldering menu, just to let you edit before heating up)
|
||||||
* Holding the button near the USB end will show the firmware version details
|
* Holding the button near the USB end will show the firmware version details
|
||||||
|
|
||||||
Detailed operation details are over in the [Menu information.](Documentation/menu.md)
|
Detailed operation details are over in the [Menu information.](Documentation/Menu.md)
|
||||||
|
|
||||||
## Thanks
|
## Thanks
|
||||||
|
|
||||||
|
|||||||
@@ -774,7 +774,7 @@ def getSmallFontMap():
|
|||||||
"Ļ":"0x1f, 0x50, 0x30, 0x10, 0x10, 0x00,",
|
"Ļ":"0x1f, 0x50, 0x30, 0x10, 0x10, 0x00,",
|
||||||
"ļ":"0x00, 0x51, 0x3f, 0x10, 0x00, 0x00,",
|
"ļ":"0x00, 0x51, 0x3f, 0x10, 0x00, 0x00,",
|
||||||
"Ľ":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
"Ľ":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
||||||
"ľ":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
"ľ":"0x00, 0x41, 0x7f, 0x40, 0x03, 0x00,",
|
||||||
"Ŀ":"0x7f, 0x40, 0x40, 0x48, 0x40, 0x00,",
|
"Ŀ":"0x7f, 0x40, 0x40, 0x48, 0x40, 0x00,",
|
||||||
"ŀ":"0x00, 0x41, 0x7f, 0x40, 0x08, 0x00,",
|
"ŀ":"0x00, 0x41, 0x7f, 0x40, 0x08, 0x00,",
|
||||||
"Ł":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
"Ł":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
||||||
@@ -813,7 +813,7 @@ def getSmallFontMap():
|
|||||||
"Ţ":"0x01, 0x41, 0x3f, 0x01, 0x01, 0x00,",
|
"Ţ":"0x01, 0x41, 0x3f, 0x01, 0x01, 0x00,",
|
||||||
"ţ":"0x02, 0x4f, 0x32, 0x10, 0x08, 0x00,",
|
"ţ":"0x02, 0x4f, 0x32, 0x10, 0x08, 0x00,",
|
||||||
"Ť":"0x04, 0x05, 0x7e, 0x05, 0x04, 0x00,",
|
"Ť":"0x04, 0x05, 0x7e, 0x05, 0x04, 0x00,",
|
||||||
"ť":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
"ť":"0x04, 0x3e, 0x44, 0x40, 0x23, 0x00,",
|
||||||
"Ŧ":"0x01, 0x09, 0x7f, 0x09, 0x01, 0x00,",
|
"Ŧ":"0x01, 0x09, 0x7f, 0x09, 0x01, 0x00,",
|
||||||
"ŧ":"0x14, 0x3e, 0x54, 0x40, 0x20, 0x00,",
|
"ŧ":"0x14, 0x3e, 0x54, 0x40, 0x20, 0x00,",
|
||||||
"Ũ":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
"Ũ":"0x00, 0x00, 0x00, 0x00, 0x00, 0x00,",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"UndervoltageString": "DC INSUFFICIENTE",
|
"UndervoltageString": "DC INSUFFICIENTE",
|
||||||
"InputVoltageString": "V ingresso:",
|
"InputVoltageString": "V ingresso:",
|
||||||
"WarningTipTempString": "Temp punta:",
|
"WarningTipTempString": "Temp punta:",
|
||||||
"BadTipString": "PUNTA NO",
|
"BadTipString": "PUNTA KO",
|
||||||
"SleepingSimpleString": "Zzz ",
|
"SleepingSimpleString": "Zzz ",
|
||||||
"SleepingAdvancedString": "Standby",
|
"SleepingAdvancedString": "Standby",
|
||||||
"WarningSimpleString": "HOT!",
|
"WarningSimpleString": "HOT!",
|
||||||
|
|||||||
@@ -1,251 +1,253 @@
|
|||||||
{
|
{
|
||||||
"languageCode": "SK",
|
"languageCode": "SK",
|
||||||
"languageLocalName": "Slovenský",
|
"languageLocalName": "Slovenčina",
|
||||||
"cyrillicGlyphs": false,
|
"cyrillicGlyphs": false,
|
||||||
"messages": {
|
"messages": {
|
||||||
"SettingsCalibrationDone": "Calibration done!",
|
"SettingsCalibrationDone": "Kalibrácia hotová!",
|
||||||
"SettingsCalibrationWarning": "Najprv sa prosim uistite, ze hrot ma izbovu teplotu!",
|
"SettingsCalibrationWarning": "Najprv sa prosím uistite, že hrot má izbovú teplotu!",
|
||||||
"SettingsResetWarning": "Are you sure to reset settings to default values?",
|
"SettingsResetWarning": "Naozaj chcete obnovit nastavenia?",
|
||||||
"UVLOWarningString": "DC LOW",
|
"UVLOWarningString": "Nízke U!",
|
||||||
"UndervoltageString": "Undervoltage",
|
"UndervoltageString": "Nízke napätie",
|
||||||
"InputVoltageString": "Input V: ",
|
"InputVoltageString": "Vstupné U: ",
|
||||||
"WarningTipTempString": "Tip Temp: ",
|
"WarningTipTempString": "Tep. hrotu: ",
|
||||||
"BadTipString": "BAD TIP",
|
"BadTipString": "ZLÝ HROT",
|
||||||
"SleepingSimpleString": "Chrr",
|
"SleepingSimpleString": "Chrr",
|
||||||
"SleepingAdvancedString": "Kludovy rezim...",
|
"SleepingAdvancedString": "Kľudový režim...",
|
||||||
"WarningSimpleString": "HOT!",
|
"WarningSimpleString": "HOT!",
|
||||||
"WarningAdvancedString": "HROT JE HORUCI !",
|
"WarningAdvancedString": "HROT JE HORÚCI !",
|
||||||
"SleepingTipAdvancedString": "Tip:",
|
"SleepingTipAdvancedString": "Hrot:",
|
||||||
"IdleTipString": "Tip:",
|
"IdleTipString": "Hrot:",
|
||||||
"IdleSetString": " Set:",
|
"IdleSetString": " Set:",
|
||||||
"TipDisconnectedString": "TIP DISCONNECTED",
|
"TipDisconnectedString": "HROT ODPOJENÝ",
|
||||||
"SolderingAdvancedPowerPrompt": "Power: ",
|
"SolderingAdvancedPowerPrompt": "Výkon: ",
|
||||||
"OffString": "Off",
|
"OffString": "Vyp",
|
||||||
"ResetOKMessage": "Reset OK"
|
"ResetOKMessage": "Reset OK",
|
||||||
|
"YourGainMessage": "Zisk:",
|
||||||
|
"SettingsResetMessage": "Nast. Obnovené!"
|
||||||
},
|
},
|
||||||
"characters": {
|
"characters": {
|
||||||
"SettingRightChar": "R",
|
"SettingRightChar": "P",
|
||||||
"SettingLeftChar": "L",
|
"SettingLeftChar": "L",
|
||||||
"SettingAutoChar": "A",
|
"SettingAutoChar": "A",
|
||||||
"SettingFastChar": "F",
|
"SettingFastChar": "R",
|
||||||
"SettingSlowChar": "S",
|
"SettingSlowChar": "P",
|
||||||
"SettingStartSolderingChar": "T",
|
"SettingStartSolderingChar": "S",
|
||||||
"SettingStartSleepChar": "S",
|
"SettingStartSleepChar": "K",
|
||||||
"SettingStartSleepOffChar": "O",
|
"SettingStartSleepOffChar": "O",
|
||||||
"SettingStartNoneChar": "F"
|
"SettingStartNoneChar": "N"
|
||||||
},
|
},
|
||||||
"menuGroups": {
|
"menuGroups": {
|
||||||
"SolderingMenu": {
|
"SolderingMenu": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Soldering",
|
"Nastavenie",
|
||||||
"Settings"
|
"spájkovania"
|
||||||
],
|
],
|
||||||
"desc": "Soldering settings"
|
"desc": "Nastavenie spájkovania"
|
||||||
},
|
},
|
||||||
"PowerSavingMenu": {
|
"PowerSavingMenu": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Sleep",
|
"Úsporný",
|
||||||
"Modes"
|
"režim"
|
||||||
],
|
],
|
||||||
"desc": "Power Saving Settings"
|
"desc": "Nastavenia režimov úspory energie"
|
||||||
},
|
},
|
||||||
"UIMenu": {
|
"UIMenu": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"User",
|
"Nastavenie",
|
||||||
"Interface"
|
"zobrazenia"
|
||||||
],
|
],
|
||||||
"desc": "User Interface settings"
|
"desc": "Nastavenie zobrazenia"
|
||||||
},
|
},
|
||||||
"AdvancedMenu": {
|
"AdvancedMenu": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Advanced",
|
"Pokročilé",
|
||||||
"Options"
|
"nastavenia"
|
||||||
],
|
],
|
||||||
"desc": "Advanced options"
|
"desc": "Pokročilé nastavenia"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"menuOptions": {
|
"menuOptions": {
|
||||||
"PowerSource": {
|
"PowerSource": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"PWRSC",
|
"Zdroj",
|
||||||
""
|
"napätia"
|
||||||
],
|
],
|
||||||
"desc": "Zdroj napatia. Nastavit napatie pre vypnutie (cutoff) <DC=10V, nS=n*3.3V pre LiIon clanky>"
|
"desc": "Zdroj napätia. Nastavenie napätia pre vypnutie (cutoff) <DC=10V, nS=n*3.3V pre LiIon články>"
|
||||||
},
|
},
|
||||||
"SleepTemperature": {
|
"SleepTemperature": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"STMP",
|
"Kľudová",
|
||||||
""
|
"teplota"
|
||||||
],
|
],
|
||||||
"desc": "Kludova teplota (v nastavenych jednotkach)"
|
"desc": "Kľudová teplota (v nastavených jednotkách)"
|
||||||
},
|
},
|
||||||
"SleepTimeout": {
|
"SleepTimeout": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"STME",
|
"Kľudový",
|
||||||
""
|
"režim po"
|
||||||
],
|
],
|
||||||
"desc": "Kludovy rezim po <sekundach/minutach>"
|
"desc": "Kludovy rezim po <sekundach/minutach>"
|
||||||
},
|
},
|
||||||
"ShutdownTimeout": {
|
"ShutdownTimeout": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"SHTME",
|
"Vypnutie",
|
||||||
""
|
"po"
|
||||||
],
|
],
|
||||||
"desc": "Cas na vypnutie <minuty>"
|
"desc": "Čas na vypnutie <minuty>"
|
||||||
},
|
},
|
||||||
"MotionSensitivity": {
|
"MotionSensitivity": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"MSENSE",
|
"Citlivosť",
|
||||||
""
|
"pohybu"
|
||||||
],
|
],
|
||||||
"desc": "Citlivost detekcie pohybu <0=Vyp, 1=Min ... 9=Max>"
|
"desc": "Citlivosť detekcie pohybu <0=Vyp, 1=Min ... 9=Max>"
|
||||||
},
|
},
|
||||||
"TemperatureUnit": {
|
"TemperatureUnit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"TMPUNT",
|
"Jednotka",
|
||||||
""
|
"teploty"
|
||||||
],
|
],
|
||||||
"desc": "Jednotky merania teploty <C=stupne Celzia, F=stupne Fahrenheita>"
|
"desc": "Jednotky merania teploty <C=stupne Celzia, F=stupne Fahrenheita>"
|
||||||
},
|
},
|
||||||
"AdvancedIdle": {
|
"AdvancedIdle": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"ADVIDL",
|
"Detaily v",
|
||||||
""
|
"kľud. režime"
|
||||||
],
|
],
|
||||||
"desc": "Zobrazit detailne informacie v kludovom rezime <T=Zap, F=Vyp>"
|
"desc": "Zobraziť detailné informácie v kľudovom režime <T=Zap, F=Vyp>"
|
||||||
},
|
},
|
||||||
"DisplayRotation": {
|
"DisplayRotation": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"DSPROT",
|
"Orientácia",
|
||||||
""
|
"displeja"
|
||||||
],
|
],
|
||||||
"desc": "Orientacia displeja <A=Auto, L=Lavak, R=Pravak>"
|
"desc": "Orientácia displeja <A=Auto, L=Ľavák, P=Pravák>"
|
||||||
},
|
},
|
||||||
"BoostTemperature": {
|
"BoostTemperature": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"BTMP",
|
"Boost",
|
||||||
""
|
"teplota"
|
||||||
],
|
],
|
||||||
"desc": "Cielova teplota pre prudky nahrev (v nastavenych jednotkach)"
|
"desc": "Cieľová teplota pre prudký náhrev (v nastavených jednotkách)"
|
||||||
},
|
},
|
||||||
"AutoStart": {
|
"AutoStart": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"ASTART",
|
"Automatické",
|
||||||
""
|
"spustenie"
|
||||||
],
|
],
|
||||||
"desc": "Pri starte spustit rezim spajkovania <T=Zap, F=Vyp, S=Spanok>"
|
"desc": "Pri štarte spustiť režim spájkovania <S=Zap, N=Vyp, K=Spanok>"
|
||||||
},
|
},
|
||||||
"CooldownBlink": {
|
"CooldownBlink": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"CLBLNK",
|
"Blikanie pri",
|
||||||
""
|
"chladnutí"
|
||||||
],
|
],
|
||||||
"desc": "Blikanie ukazovatela teploty pocas chladnutia hrotu <T=Zap, F=Vyp>"
|
"desc": "Blikanie ukazovateľa teploty počas chladnutia hrotu"
|
||||||
},
|
},
|
||||||
"TemperatureCalibration": {
|
"TemperatureCalibration": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"TMP CAL?",
|
"Kalibrácia",
|
||||||
""
|
"teploty"
|
||||||
],
|
],
|
||||||
"desc": "Kalibracia posunu hrotu"
|
"desc": "Kalibrácia posunu teploty hrotu"
|
||||||
},
|
},
|
||||||
"SettingsReset": {
|
"SettingsReset": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"RESET?",
|
"Obnovenie",
|
||||||
""
|
"nastavení"
|
||||||
],
|
],
|
||||||
"desc": "Tovarenske nastavenia"
|
"desc": "Obnovenie nastavení na pôvodné hodnoty"
|
||||||
},
|
},
|
||||||
"VoltageCalibration": {
|
"VoltageCalibration": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"CAL VIN?",
|
"Kalibrácia",
|
||||||
""
|
"vst. napätia"
|
||||||
],
|
],
|
||||||
"desc": "Kalibracia VIN. Kratke stlacenie meni nastavenie, dlhe stlacenie pre navrat"
|
"desc": "Kalibrácia napätia. Krátke stlačenie mení nastavenie, dlhé stlačenie pre návrat"
|
||||||
},
|
},
|
||||||
"AdvancedSoldering": {
|
"AdvancedSoldering": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"ADVSLD",
|
"Detaily počas",
|
||||||
""
|
"spájkovania"
|
||||||
],
|
],
|
||||||
"desc": "Zobrazenie detailov pocas spajkovania <T=Zap, F=Vyp>"
|
"desc": "Zobrazenie detailov počas spájkovania"
|
||||||
},
|
},
|
||||||
"ScrollingSpeed": {
|
"ScrollingSpeed": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"DESCSP",
|
"Rýchlost",
|
||||||
""
|
"skrolovania"
|
||||||
],
|
],
|
||||||
"desc": "Speed this text scrolls past at"
|
"desc": "Rychlost pohybu tohoto textu"
|
||||||
},
|
},
|
||||||
"TipModel": {
|
"TipModel": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Tip",
|
"Typ",
|
||||||
"Model"
|
"hrotu"
|
||||||
],
|
],
|
||||||
"desc": "Tip Model selection"
|
"desc": "Zvolenie hrotu"
|
||||||
},
|
},
|
||||||
"SimpleCalibrationMode": {
|
"SimpleCalibrationMode": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Simple",
|
"Zjednodušená",
|
||||||
"Calibration"
|
"kalibrácia"
|
||||||
],
|
],
|
||||||
"desc": "Simple Calibration using Hot water"
|
"desc": "Zjednodušená kalibrácia pomocou horúcej vody"
|
||||||
},
|
},
|
||||||
"AdvancedCalibrationMode": {
|
"AdvancedCalibrationMode": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Advanced",
|
"Pokročilá",
|
||||||
"Calibration"
|
"kalibrácia"
|
||||||
],
|
],
|
||||||
"desc": "Advanced calibration using thermocouple on the tip"
|
"desc": "Pokročilá kalibrácia meraním teploty hrotu"
|
||||||
},
|
},
|
||||||
"PowerInput": {
|
"PowerInput": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Obmedzenie",
|
||||||
"Wattage"
|
"výkonu"
|
||||||
],
|
],
|
||||||
"desc": "Power Wattage of the power adapter used"
|
"desc": "Obmedzenie výkonu podľa použitého zdroja"
|
||||||
},
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Obmedzenie",
|
||||||
"Limit"
|
"výkonu"
|
||||||
],
|
],
|
||||||
"desc": "Maximum power the iron can use <Watts>"
|
"desc": "Obmedzenie výkonu podľa použitého zdroja <watt>"
|
||||||
},
|
},
|
||||||
"ReverseButtonTempChange": {
|
"ReverseButtonTempChange": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Key +-",
|
"Otočenie",
|
||||||
"reverse?"
|
"tlačidiel +/-"
|
||||||
],
|
],
|
||||||
"desc": "Reverse the tip temperature change buttons plus minus assignment."
|
"desc": "Prehodenie tlačidiel na nastavovanie teploty"
|
||||||
},
|
},
|
||||||
"TempChangeShortStep": {
|
"TempChangeShortStep": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Temp change",
|
"Malý krok",
|
||||||
"short?"
|
"teploty"
|
||||||
],
|
],
|
||||||
"desc": "Temperature change steps on short button press!"
|
"desc": "Zmena teploty pri krátkom stlačení tlačidla"
|
||||||
},
|
},
|
||||||
"TempChangeLongStep": {
|
"TempChangeLongStep": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Temp change",
|
"Veľký krok",
|
||||||
"long?"
|
"teploty"
|
||||||
],
|
],
|
||||||
"desc": "Temperature change steps on long button press!"
|
"desc": "Zmena teploty pri držaní tlačidla"
|
||||||
},
|
},
|
||||||
"PowerPulsePower":{
|
"PowerPulsePower": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Power",
|
"Impulz",
|
||||||
"Pulse W"
|
"W"
|
||||||
],
|
],
|
||||||
"desc": "Keep awake pulse power intensity"
|
"desc": "Impulz udržujúci napájací zdroj zapnutý <watt>"
|
||||||
},
|
},
|
||||||
"TipGain": {
|
"TipGain": {
|
||||||
"text2": [
|
"text2": [
|
||||||
"Modify",
|
"Zisk",
|
||||||
"tip gain"
|
"hrotu"
|
||||||
],
|
],
|
||||||
"desc": "Tip gain"
|
"desc": "Úprava zisku hrotu"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include "BSP_Flash.h"
|
#include "BSP_Flash.h"
|
||||||
#include "BSP_Power.h"
|
#include "BSP_Power.h"
|
||||||
#include "BSP_QC.h"
|
#include "BSP_QC.h"
|
||||||
#include "Defines.h"
|
#include "Defines.h"
|
||||||
#include "Model_Config.h"
|
#include "Model_Config.h"
|
||||||
#include "stdint.h"
|
|
||||||
/*
|
/*
|
||||||
* BSP.h -- Board Support
|
* BSP.h -- Board Support
|
||||||
*
|
*
|
||||||
@@ -16,11 +17,19 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// maximum htim2 PWM value
|
||||||
|
extern const uint16_t powerPWM;
|
||||||
|
// htim2.Init.Period, the full PWM cycle
|
||||||
|
extern uint16_t totalPWM;
|
||||||
|
|
||||||
// Called first thing in main() to init the hardware
|
// Called first thing in main() to init the hardware
|
||||||
void preRToSInit();
|
void preRToSInit();
|
||||||
// Called once the RToS has started for any extra work
|
// Called once the RToS has started for any extra work
|
||||||
void postRToSInit();
|
void postRToSInit();
|
||||||
|
|
||||||
|
// Called once from preRToSInit()
|
||||||
|
void BSPInit(void);
|
||||||
|
|
||||||
// Called to reset the hardware watchdog unit
|
// Called to reset the hardware watchdog unit
|
||||||
void resetWatchdog();
|
void resetWatchdog();
|
||||||
// Accepts a output level of 0.. to use to control the tip output PWM
|
// Accepts a output level of 0.. to use to control the tip output PWM
|
||||||
@@ -31,6 +40,9 @@ uint16_t getHandleTemperature();
|
|||||||
uint16_t getTipRawTemp(uint8_t refresh);
|
uint16_t getTipRawTemp(uint8_t refresh);
|
||||||
// Returns the main DC input voltage, using the adjustable divisor + sample flag
|
// Returns the main DC input voltage, using the adjustable divisor + sample flag
|
||||||
uint16_t getInputVoltageX10(uint16_t divisor, uint8_t sample);
|
uint16_t getInputVoltageX10(uint16_t divisor, uint8_t sample);
|
||||||
|
// Switch to the most suitable PWM freq given the desired period;
|
||||||
|
// returns true if the switch was performed and totalPWM changed
|
||||||
|
bool tryBetterPWM(uint8_t pwm);
|
||||||
|
|
||||||
// Readers for the two buttons
|
// Readers for the two buttons
|
||||||
// !! Returns 1 if held down, 0 if released
|
// !! Returns 1 if held down, 0 if released
|
||||||
|
|||||||
@@ -12,6 +12,14 @@
|
|||||||
volatile uint16_t PWMSafetyTimer = 0;
|
volatile uint16_t PWMSafetyTimer = 0;
|
||||||
volatile uint8_t pendingPWM = 0;
|
volatile uint8_t pendingPWM = 0;
|
||||||
|
|
||||||
|
const uint16_t powerPWM = 255;
|
||||||
|
static const uint8_t holdoffTicks = 13; // delay of 7 ms
|
||||||
|
static const uint8_t tempMeasureTicks = 17;
|
||||||
|
|
||||||
|
uint16_t totalPWM; //htim2.Init.Period, the full PWM cycle
|
||||||
|
|
||||||
|
static bool fastPWM;
|
||||||
|
|
||||||
//2 second filter (ADC is PID_TIM_HZ Hz)
|
//2 second filter (ADC is PID_TIM_HZ Hz)
|
||||||
history<uint16_t, PID_TIM_HZ> rawTempFilter = {{0}, 0, 0};
|
history<uint16_t, PID_TIM_HZ> rawTempFilter = {{0}, 0, 0};
|
||||||
void resetWatchdog()
|
void resetWatchdog()
|
||||||
@@ -206,6 +214,47 @@ void setTipPWM(uint8_t pulse)
|
|||||||
pendingPWM = pulse;
|
pendingPWM = pulse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void switchToFastPWM(void)
|
||||||
|
{
|
||||||
|
fastPWM = true;
|
||||||
|
totalPWM = powerPWM + tempMeasureTicks * 2;
|
||||||
|
htim2.Instance->ARR = totalPWM;
|
||||||
|
// ~3.5 Hz rate
|
||||||
|
htim2.Instance->CCR1 = powerPWM + holdoffTicks * 2;
|
||||||
|
// 2 MHz timer clock/2000 = 1 kHz tick rate
|
||||||
|
htim2.Instance->PSC = 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void switchToSlowPWM(void)
|
||||||
|
{
|
||||||
|
fastPWM = false;
|
||||||
|
totalPWM = powerPWM + tempMeasureTicks;
|
||||||
|
htim2.Instance->ARR = totalPWM;
|
||||||
|
// ~1.84 Hz rate
|
||||||
|
htim2.Instance->CCR1 = powerPWM + holdoffTicks;
|
||||||
|
// 2 MHz timer clock/4000 = 500 Hz tick rate
|
||||||
|
htim2.Instance->PSC = 4000;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool tryBetterPWM(uint8_t pwm)
|
||||||
|
{
|
||||||
|
if (fastPWM && pwm == powerPWM)
|
||||||
|
{
|
||||||
|
// maximum power for fast PWM reached, need to go slower to get more
|
||||||
|
switchToSlowPWM();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (!fastPWM && pwm < 230)
|
||||||
|
{
|
||||||
|
// 254 in fast PWM mode gives the same power as 239 in slow
|
||||||
|
// allow for some reasonable hysteresis by switching only when it goes
|
||||||
|
// below 230 (equivalent to 245 in fast mode)
|
||||||
|
switchToFastPWM();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// These are called by the HAL after the corresponding events from the system
|
// These are called by the HAL after the corresponding events from the system
|
||||||
// timers.
|
// timers.
|
||||||
|
|
||||||
@@ -326,9 +375,13 @@ uint8_t getButtonB()
|
|||||||
return HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ? 1 : 0;
|
return HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BSPInit(void)
|
||||||
|
{
|
||||||
|
switchToFastPWM();
|
||||||
|
}
|
||||||
|
|
||||||
void reboot()
|
void reboot()
|
||||||
{
|
{
|
||||||
|
|
||||||
NVIC_SystemReset();
|
NVIC_SystemReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -315,13 +315,15 @@ static void MX_TIM2_Init(void) {
|
|||||||
// Timer 2 is fairly slow as its being used to run the PWM and trigger the ADC
|
// Timer 2 is fairly slow as its being used to run the PWM and trigger the ADC
|
||||||
// in the PWM off time.
|
// in the PWM off time.
|
||||||
htim2.Instance = TIM2;
|
htim2.Instance = TIM2;
|
||||||
htim2.Init.Prescaler = 4000; //1mhz tick rate/800 = 1.25 KHz tick rate
|
// dummy value, will be reconfigured by BSPInit()
|
||||||
|
htim2.Init.Prescaler = 2000; // 2 MHz timer clock/2000 = 1 kHz tick rate
|
||||||
|
|
||||||
// pwm out is 10k from tim3, we want to run our PWM at around 10hz or slower on the output stage
|
// pwm out is 10k from tim3, we want to run our PWM at around 10hz or slower on the output stage
|
||||||
// These values give a rate of around 8Hz
|
// These values give a rate of around 3.5 Hz for "fast" mode and 1.84 Hz for "slow"
|
||||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
htim2.Init.Period = 255 + 17;
|
// dummy value, will be reconfigured by BSPInit()
|
||||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; // 4mhz before divide
|
htim2.Init.Period = 255 + 17 * 2;
|
||||||
|
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4; // 8 MHz (x2 APB1) before divide
|
||||||
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||||
htim2.Init.RepetitionCounter = 0;
|
htim2.Init.RepetitionCounter = 0;
|
||||||
HAL_TIM_Base_Init(&htim2);
|
HAL_TIM_Base_Init(&htim2);
|
||||||
@@ -337,7 +339,8 @@ static void MX_TIM2_Init(void) {
|
|||||||
HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig);
|
HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig);
|
||||||
|
|
||||||
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
||||||
sConfigOC.Pulse = 255 + 13; //13 -> Delay of 5ms
|
// dummy value, will be reconfigured by BSPInit()
|
||||||
|
sConfigOC.Pulse = 255 + 13 * 2; // 13 -> Delay of 7 ms
|
||||||
//255 is the largest time period of the drive signal, and then offset ADC sample to be a bit delayed after this
|
//255 is the largest time period of the drive signal, and then offset ADC sample to be a bit delayed after this
|
||||||
/*
|
/*
|
||||||
* It takes 4 milliseconds for output to be stable after PWM turns off.
|
* It takes 4 milliseconds for output to be stable after PWM turns off.
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ void preRToSInit() {
|
|||||||
*/
|
*/
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
Setup_HAL(); // Setup all the HAL objects
|
Setup_HAL(); // Setup all the HAL objects
|
||||||
|
BSPInit();
|
||||||
#ifdef I2C_SOFT
|
#ifdef I2C_SOFT
|
||||||
I2CBB::init();
|
I2CBB::init();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,6 +25,4 @@ extern expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory;
|
|||||||
int32_t tempToX10Watts(int32_t rawTemp);
|
int32_t tempToX10Watts(int32_t rawTemp);
|
||||||
void setTipX10Watts(int32_t mw);
|
void setTipX10Watts(int32_t mw);
|
||||||
uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample = 0);
|
uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample = 0);
|
||||||
int32_t PWMToX10Watts(uint8_t pwm, uint8_t sample = 0);
|
|
||||||
uint32_t availableW10(uint8_t sample) ;
|
|
||||||
#endif /* POWER_HPP_ */
|
#endif /* POWER_HPP_ */
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
#include <Settings.h>
|
#include <Settings.h>
|
||||||
#include <BSP.h>
|
#include <BSP.h>
|
||||||
|
|
||||||
const uint16_t powerPWM = 255;
|
static int32_t PWMToX10Watts(uint8_t pwm, uint8_t sample);
|
||||||
const uint16_t totalPWM = 255 + 17; //htim2.Init.Period, the full PWM cycle
|
|
||||||
|
|
||||||
expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory = { 0 };
|
expMovingAverage<uint32_t, wattHistoryFilter> x10WattHistory = { 0 };
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ void setTipX10Watts(int32_t mw) {
|
|||||||
x10WattHistory.update(actualMilliWatts);
|
x10WattHistory.update(actualMilliWatts);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t availableW10(uint8_t sample) {
|
static uint32_t availableW10(uint8_t sample) {
|
||||||
//P = V^2 / R, v*v = v^2 * 100
|
//P = V^2 / R, v*v = v^2 * 100
|
||||||
// R = R*10
|
// R = R*10
|
||||||
// P therefore is in V^2*100/R*10 = W*10.
|
// P therefore is in V^2*100/R*10 = W*10.
|
||||||
@@ -56,15 +55,22 @@ uint8_t X10WattsToPWM(int32_t milliWatts, uint8_t sample) {
|
|||||||
}
|
}
|
||||||
// if (milliWatts > (int(systemSettings.pidPowerLimit) * 10))
|
// if (milliWatts > (int(systemSettings.pidPowerLimit) * 10))
|
||||||
// milliWatts = (int(systemSettings.pidPowerLimit) * 10);
|
// milliWatts = (int(systemSettings.pidPowerLimit) * 10);
|
||||||
|
|
||||||
//Calculate desired milliwatts as a percentage of availableW10
|
//Calculate desired milliwatts as a percentage of availableW10
|
||||||
uint32_t pwm = (powerPWM * milliWatts) / availableW10(sample);
|
uint32_t pwm;
|
||||||
|
do {
|
||||||
|
pwm = (powerPWM * milliWatts) / availableW10(sample);
|
||||||
if (pwm > powerPWM) {
|
if (pwm > powerPWM) {
|
||||||
pwm = powerPWM; //constrain to max PWM counter, shouldnt be possible, but small cost for safety to avoid wraps
|
// constrain to max PWM counter, shouldn't be possible,
|
||||||
|
// but small cost for safety to avoid wraps
|
||||||
|
pwm = powerPWM;
|
||||||
}
|
}
|
||||||
|
} while (tryBetterPWM(pwm));
|
||||||
|
|
||||||
return pwm;
|
return pwm;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t PWMToX10Watts(uint8_t pwm, uint8_t sample) {
|
static int32_t PWMToX10Watts(uint8_t pwm, uint8_t sample) {
|
||||||
uint32_t maxMW = availableW10(sample); //Get the milliwatts for the max pwm period
|
uint32_t maxMW = availableW10(sample); //Get the milliwatts for the max pwm period
|
||||||
//Then convert pwm into percentage of powerPWM to get the percentage of the max mw
|
//Then convert pwm into percentage of powerPWM to get the percentage of the max mw
|
||||||
return (((uint32_t) pwm) * maxMW) / powerPWM;
|
return (((uint32_t) pwm) * maxMW) / powerPWM;
|
||||||
|
|||||||
@@ -139,12 +139,12 @@
|
|||||||
|
|
||||||
#ifdef MODEL_TS100
|
#ifdef MODEL_TS100
|
||||||
const int32_t tipMass = 45; // X10 watts to raise 1 deg C in 1 second
|
const int32_t tipMass = 45; // X10 watts to raise 1 deg C in 1 second
|
||||||
const uint8_t tipResistance = 85; //x10 ohms, 8.5 typical for ts100, 4.5 typical for ts80
|
const uint8_t tipResistance = 75; //x10 ohms, 7.5 typical for ts100 tips
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MODEL_Pinecil
|
#ifdef MODEL_Pinecil
|
||||||
const int32_t tipMass = 45; // X10 watts to raise 1 deg C in 1 second
|
const int32_t tipMass = 45; // X10 watts to raise 1 deg C in 1 second
|
||||||
const uint8_t tipResistance = 85; //x10 ohms, 8.5 typical for ts100, 4.5 typical for ts80
|
const uint8_t tipResistance = 75; //x10 ohms, 7.5 typical for ts100 tips
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MODEL_TS80
|
#ifdef MODEL_TS80
|
||||||
|
|||||||
Reference in New Issue
Block a user