Update Makefile and build script
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
|
||||
OUTPUT_EXE=TS100_$(lang)
|
||||
ifndef lang
|
||||
lang:= EN
|
||||
endif
|
||||
|
||||
# Discover the source files to build
|
||||
SOURCE := $(shell find . -type f -name '*.c')
|
||||
SOURCE_CPP := $(shell find . -type f -name '*.cpp')
|
||||
@@ -29,12 +35,7 @@ OPTIM=-O2 -finline-small-functions -findirect-inlining -fdiagnostics-color
|
||||
|
||||
|
||||
# global defines ---------------------------------------------------------------
|
||||
# Enable ROM library
|
||||
#GLOBAL_DEFINES=-DTARGET_IS_BLIZZARD_RB1 -DUART_BUFFERED
|
||||
# Without ROM library
|
||||
#GLOBAL_DEFINES=-D DEPRECATED
|
||||
#GLOBAL_DEFINES += -D SIMULATION_BOARD
|
||||
GLOBAL_DEFINES += -D STM32F103T8Ux -D STM32F1 -D STM32 -D USE_HAL_DRIVER -D STM32F103xB -D USE_RTOS_SYSTICK
|
||||
GLOBAL_DEFINES += -D STM32F103T8Ux -D STM32F1 -D STM32 -D USE_HAL_DRIVER -D STM32F103xB -D USE_RTOS_SYSTICK -D LANG_$(lang)
|
||||
|
||||
# Enable debug code generation
|
||||
DEBUG=-g
|
||||
@@ -165,7 +166,7 @@ OBJS_CPP = $(SOURCE_CPP:.cpp=.o)
|
||||
OBJS_S = $(S_SRCS:.s=.o)
|
||||
|
||||
|
||||
OUTPUT_EXE=TS100
|
||||
|
||||
OUT_OBJS=$(addprefix $(OUTPUT_DIR)/,$(OBJS))
|
||||
OUT_OBJS_CPP=$(addprefix $(OUTPUT_DIR)/,$(OBJS_CPP))
|
||||
OUT_OBJS_S=$(addprefix $(OUTPUT_DIR)/,$(OBJS_S))
|
||||
@@ -178,9 +179,9 @@ all: $(OUT_HEXFILE).hex
|
||||
#
|
||||
|
||||
# Create hexfile
|
||||
$(OUT_HEXFILE).hex : $(OUT_HEXFILE).elf
|
||||
$(SIZE) -x $(OUT_HEXFILE).elf
|
||||
$(OBJCOPY) $(OUT_HEXFILE).elf -O ihex $(OUT_HEXFILE).hex
|
||||
%.hex : %.elf
|
||||
$(SIZE) -x $^
|
||||
$(OBJCOPY) $^ -O ihex $@
|
||||
|
||||
$(OUT_HEXFILE).elf : $(OUT_OBJS) $(OUT_OBJS_CPP) $(OUT_OBJS_S) Makefile $(LDSCRIPT)
|
||||
@test -d $(@D) || mkdir -p $(@D)
|
||||
|
||||
25
workspace/TS100/build.sh
Executable file
25
workspace/TS100/build.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
make clean
|
||||
make -j16 lang=EN
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=CS_CZ
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=DE
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=DK
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=ES
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=FR
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=HR
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=IT
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=PL
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=RU
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=SE
|
||||
rm -rf Objects/src
|
||||
make -j16 lang=TR
|
||||
rm -rf Objects/src
|
||||
@@ -32,17 +32,5 @@ extern const char SettingRightChar;
|
||||
extern const char SettingLeftChar;
|
||||
extern const char SettingAutoChar;
|
||||
|
||||
#define LANG_EN
|
||||
//#define LANG_RU
|
||||
//#define LANG_ES
|
||||
//#define LANG_SE
|
||||
//#define LANG_IT
|
||||
//#define LANG_FR
|
||||
//#define LANG_DE
|
||||
//#define LANG_CS_CZ
|
||||
//#define LANG_TR
|
||||
//#define LANG_HR
|
||||
//#define LANG_PL
|
||||
//#define LANG_DK
|
||||
|
||||
#endif /* TRANSLATION_H_ */
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
*/
|
||||
#include "Translation.h"
|
||||
|
||||
// TEMPLATES for short names - choose one and use it as base for your translation:
|
||||
// TEMPLATES for short names - choose one and use it as base for your
|
||||
// translation:
|
||||
|
||||
// const enum ShortNameType SettingsShortNameType = SHORT_NAME_SINGLE_LINE;
|
||||
// const char* SettingsShortNames[16][2] = {
|
||||
@@ -34,18 +35,25 @@
|
||||
// /* (<= 9) Sleep temperature */ {"Sleep", "temp"},
|
||||
// /* (<= 9) Sleep timeout */ {"Sleep", "timeout"},
|
||||
// /* (<= 11) Shutdown timeout */ {"Shutdown", "timeout"},
|
||||
// /* (<= 13) Motion sensitivity level */ {"Motion", "sensitivity"},
|
||||
// /* (<= 13) Motion sensitivity level */ {"Motion",
|
||||
// "sensitivity"},
|
||||
// /* (<= 13) Temperature in F and C */ {"Temperature", "units"},
|
||||
// /* (<= 13) Advanced idle display mode enabled */ {"Detailed", "idle screen"},
|
||||
// /* (<= 13) Display rotation mode */ {"Display", "orientation"},
|
||||
// /* (<= 13) Boost enabled */ {"Boost mode", "enabled"},
|
||||
// /* (<= 13) Advanced idle display mode enabled */ {"Detailed", "idle
|
||||
// screen"},
|
||||
// /* (<= 13) Display rotation mode */ {"Display",
|
||||
// "orientation"},
|
||||
// /* (<= 13) Boost enabled */ {"Boost mode",
|
||||
// "enabled"},
|
||||
// /* (<= 9) Boost temperature */ {"Boost", "temp"},
|
||||
// /* (<= 13) Automatic start mode */ {"Auto", "start"},
|
||||
// /* (<= 13) Cooldown blink */ {"Cooldown", "blink"},
|
||||
// /* (<= 16) Temperature calibration enter menu */ {"Calibrate", "temperature?"},
|
||||
// /* (<= 16) Temperature calibration enter menu */ {"Calibrate",
|
||||
// "temperature?"},
|
||||
// /* (<= 16) Settings reset command */ {"Factory", "Reset?"},
|
||||
// /* (<= 16) Calibrate input voltage */ {"Calibrate", "input voltage?"},
|
||||
// /* (<= 13) Advanced soldering screen enabled */ {"Detailed", "solder screen"},
|
||||
// /* (<= 16) Calibrate input voltage */ {"Calibrate", "input
|
||||
// voltage?"},
|
||||
// /* (<= 13) Advanced soldering screen enabled */ {"Detailed", "solder
|
||||
// screen"},
|
||||
//};
|
||||
|
||||
#ifdef LANG_EN
|
||||
@@ -92,16 +100,20 @@ const char* SettingsShortNames[16][2] = {
|
||||
/* (<= 11) Shutdown timeout */ {"Shutdown", "timeout"},
|
||||
/* (<= 13) Motion sensitivity level */ {"Motion", "sensitivity"},
|
||||
/* (<= 13) Temperature in F and C */ {"Temperature", "units"},
|
||||
/* (<= 13) Advanced idle display mode enabled */{ "Detailed", "idle screen" },
|
||||
/* (<= 13) Advanced idle display mode enabled */ {"Detailed",
|
||||
"idle screen"},
|
||||
/* (<= 13) Display rotation mode */ {"Display", "orientation"},
|
||||
/* (<= 13) Boost enabled */ {"Boost mode", "enabled"},
|
||||
/* (<= 9) Boost temperature */ {"Boost", "temp"},
|
||||
/* (<= 13) Automatic start mode */ {"Auto", "start"},
|
||||
/* (<= 13) Cooldown blink */ {"Cooldown", "blink"},
|
||||
/* (<= 16) Temperature calibration enter menu */{ "Calibrate", "temperature?" },
|
||||
/* (<= 16) Temperature calibration enter menu */ {"Calibrate",
|
||||
"temperature?"},
|
||||
/* (<= 16) Settings reset command */ {"Factory", "Reset?"},
|
||||
/* (<= 16) Calibrate input voltage */{ "Calibrate", "input voltage?" },
|
||||
/* (<= 13) Advanced soldering screen enabled */{ "Detailed", "solder screen" },
|
||||
/* (<= 16) Calibrate input voltage */ {"Calibrate",
|
||||
"input voltage?"},
|
||||
/* (<= 13) Advanced soldering screen enabled */ {"Detailed",
|
||||
"solder screen"},
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -127,7 +139,9 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Показывать детальную информацию при пайке.",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Убедитесь, что жало остыло до комнатной температуры, прежде чем продолжать!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Убедитесь, что жало остыло до комнатной температуры, прежде чем "
|
||||
"продолжать!";
|
||||
const char* UVLOWarningString = "БАТ РАЗР"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Хррр"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Ожидание..."; // <=17 chars
|
||||
@@ -189,7 +203,8 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Display detailed information while soldering",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Please ensure the tip is at room temperature before continuing!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Sleeping..."; // <=17 chars
|
||||
@@ -245,7 +260,8 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Display detailed information while soldering",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Please ensure the tip is at room temperature before continuing!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Sleeping..."; // <=17 chars
|
||||
@@ -301,7 +317,9 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Mostra informazioni dettagliate mentre stai saldando",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Assicurati che la punta si trovi a temperatura ambiente prima di continuare!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Assicurati che la punta si trovi a temperatura ambiente prima di "
|
||||
"continuare!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Standby"; // <=17 chars
|
||||
@@ -357,7 +375,8 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Afficher des informations detaillees pendant la soudure",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Please ensure the tip is at room temperature before continuing!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Sleeping..."; // <=17 chars
|
||||
@@ -413,7 +432,8 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Detaillierte Anzeige im Lötmodus <T=An, F=Aus>",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Vor dem Fortfahren muss die Lötspitze vollständig abgekühlt sein!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Vor dem Fortfahren muss die Lötspitze vollständig abgekühlt sein!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzz "; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Ruhemodus..."; // <=17 chars
|
||||
@@ -469,7 +489,8 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Zobrazenie detailov pocas spajkovania <T=Zap, F=Vyp>",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Najprv sa prosim uistite, ze hrot ma izbovu teplotu!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Najprv sa prosim uistite, ze hrot ma izbovu teplotu!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Chrr"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Kludovy rezim..."; // <=17 chars
|
||||
@@ -525,7 +546,8 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Lehimleme yaparken detaylı bilgi göster",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Lütfen devam etmeden önce ucun oda sıcaklığında olduğunu garantiye alın!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Lütfen devam etmeden önce ucun oda sıcaklığında olduğunu garantiye alın!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Uyuyor..."; // <=17 chars
|
||||
@@ -581,7 +603,9 @@ const char* SettingsLongNames[16] = {
|
||||
/* Advanced soldering screen enabled */"Prikazivanje detaljnih informacija tijekom lemljenja.",
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Provjerite da je vršak ohlađen na sobnu temperaturu prije nego što nastavite!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Provjerite da je vršak ohlađen na sobnu temperaturu prije nego što "
|
||||
"nastavite!";
|
||||
const char* UVLOWarningString = "NAPON!!!"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Spavanje..."; // <=17 chars
|
||||
@@ -619,25 +643,32 @@ const char* SettingsShortNames[16][2] = {
|
||||
const char* SettingsLongNames[16] = {
|
||||
/*These are all the help text for all the settings.*/
|
||||
/*No requirements on spacing or length*/
|
||||
"Zdroj napajeni. Pri nizsim napeti se odpoji <DC=10V, xS=x*3.3V pro LiPo,LiIon...>", //Power Source
|
||||
"Zdroj napajeni. Pri nizsim napeti se odpoji <DC=10V, xS=x*3.3V pro "
|
||||
"LiPo,LiIon...>", // Power Source
|
||||
"Teplota v rezimu spanku", // Sleep Temp
|
||||
"Cas do rezimu spanku <Minut/Sekund>", // Sleep Timeout
|
||||
"Cas do automatickeho vypnuti <Minut>", // Shutdown Time
|
||||
"Citlivost detekce pohybu <0=Vyp, 1=Min, ... 9=Max>", // Motion Sensitivity
|
||||
"Jednotky mereni teploty <C=Celsius, F=Fahrenheit>", // Temp Unit
|
||||
"Zobrazit podrobnosti na vychozi obrazovce <Z=Zap, V=Vyp>",//Detailed Information
|
||||
"Zobrazit podrobnosti na vychozi obrazovce <Z=Zap, V=Vyp>", // Detailed
|
||||
// Information
|
||||
"Otoceni displaye <A=Auto, L=Levak, P=Pravak>", // Orientation
|
||||
"Povolit boost drzenim leveho tlacitka pri pajeni <Z=Zap, V=Vyp>",//Boost enable
|
||||
"Povolit boost drzenim leveho tlacitka pri pajeni <Z=Zap, V=Vyp>", // Boost
|
||||
// enable
|
||||
"Teplota pri boostu", // Boost Temp
|
||||
"Pri startu ihned nahrivat hrot <Z=Zap, V=Vyp, S=Rezim spanku>",//Auto start
|
||||
"Blikani teploty pri chladnuti, dokud je hrot horky <Z=Zap, V=Vyp>",//Cooling Blink
|
||||
"Pri startu ihned nahrivat hrot <Z=Zap, V=Vyp, S=Rezim spanku>", // Auto
|
||||
// start
|
||||
"Blikani teploty pri chladnuti, dokud je hrot horky <Z=Zap, V=Vyp>", // Cooling
|
||||
// Blink
|
||||
"Kalibrovat mereni teploty", // Calibrate Tip
|
||||
"Obnovit tovarni nastaveni", // Reset Settings
|
||||
"Kalibrovat vstupni napeti. Tlacitky upravte, podrzenim potvrdte.",//VIN Cal
|
||||
"Kalibrovat vstupni napeti. Tlacitky upravte, podrzenim potvrdte.", // VIN
|
||||
// Cal
|
||||
"Zobrazit podrobnosti pri pajeni <Z=Zap, V=Vyp>", // ADV SLD
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Ujistete se, ze hrot ma pokojovou teplotu! "; //ending space needed
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Ujistete se, ze hrot ma pokojovou teplotu! "; // ending space needed
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzz "; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Rezim spanku..."; // <=17 chars
|
||||
@@ -656,44 +687,58 @@ const char* SettingsShortNames[16][2] = {
|
||||
/* (<= 9) Sleep temperature */ {"Teplota v", "r. spanku"},
|
||||
/* (<= 9) Sleep timeout */ {"Cas do", "r. spanku"},
|
||||
/* (<= 11) Shutdown timeout */ {"Cas do", "vypnuti"},
|
||||
/* (<= 13) Motion sensitivity level */ {"Citlivost", "det. pohybu"},
|
||||
/* (<= 13) Motion sensitivity level */ {"Citlivost",
|
||||
"det. pohybu"},
|
||||
/* (<= 13) Temperature in F and C */ {"Jednotky", "teploty"},
|
||||
/* (<= 13) Advanced idle display mode enabled */ {"Podrobnosti", "na vych. obr."},
|
||||
/* (<= 13) Advanced idle display mode enabled */ {"Podrobnosti",
|
||||
"na vych. obr."},
|
||||
/* (<= 13) Display rotation mode */ {"Otoceni", "obrazovky"},
|
||||
/* (<= 13) Boost enabled */ {"Povolit", "boost"},
|
||||
/* (<= 9) Boost temperature */ {"Teplota v", "r. boost"},
|
||||
/* (<= 13) Automatic start mode */ {"Auto", "start"},
|
||||
/* (<= 13) Cooldown blink */ {"Blikani pri", "chladnuti"},
|
||||
/* (<= 13) Cooldown blink */ {"Blikani pri",
|
||||
"chladnuti"},
|
||||
/* (<= 16) Temperature calibration enter menu */ {"Kalibrovat", "teplotu?"},
|
||||
/* (<= 16) Settings reset command */ {"Tovarni", "nastaveni?"},
|
||||
/* (<= 16) Calibrate input voltage */ {"Kalibrovat", "vstupni napeti?"},
|
||||
/* (<= 13) Advanced soldering screen enabled */ {"Podrobnosti", "pri pajeni"},
|
||||
/* (<= 16) Calibrate input voltage */ {"Kalibrovat",
|
||||
"vstupni napeti?"},
|
||||
/* (<= 13) Advanced soldering screen enabled */ {"Podrobnosti",
|
||||
"pri pajeni"},
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef LANG_HUN
|
||||
const char* SettingsLongNames[16] = {
|
||||
const char* SettingsLongNames[16] =
|
||||
{
|
||||
/*These are all the help text for all the settings.*/
|
||||
/*No requirements on spacing or length*/
|
||||
"Áramforrás. Beállítja a lekapcsolási feszültséget. <DC 10V> <S 3.3V cellánként>", //Power Source
|
||||
"Áramforrás. Beállítja a lekapcsolási feszültséget. <DC 10V> <S 3.3V "
|
||||
"cellánként>", // Power Source
|
||||
"Alvási hőmérséklet <C>", // Sleep Temp
|
||||
"Elalvási időzítő <Perc/Másodperc>", // Sleep Timeout
|
||||
"Kikapcsolási időzítő <Minutes>", // Shutdown Time
|
||||
"Mozgás érzékenység beállítása. <0.Ki 1.kevésbé érzékeny 9.legérzékenyebb>",//Motion Sensitivity
|
||||
"Mozgás érzékenység beállítása. <0.Ki 1.kevésbé érzékeny "
|
||||
"9.legérzékenyebb>", // Motion Sensitivity
|
||||
"Hőmérsékleti egység <C=Celsius F=Fahrenheit>", // Temp Unit
|
||||
"Részletes információ megjelenítése kisebb betűméretben a készenléti képernyőn.",//Detailed Information
|
||||
"Részletes információ megjelenítése kisebb betűméretben a készenléti "
|
||||
"képernyőn.", // Detailed Information
|
||||
"Megjelenítési tájolás <A. Automatikus L. Balkezes R. Jobbkezes>", // Orientation
|
||||
"Elülső gombbal lépjen boost módba, 450C forrasztás közben",//Boost enable
|
||||
"Elülső gombbal lépjen boost módba, 450C forrasztás közben", // Boost
|
||||
// enable
|
||||
"Hőmérséklet \"boost\" módban", // Boost Temp
|
||||
"Bekapcsolás után automatikusan lépjen forrasztás módba. T=Forrasztás, S=Alvó mód,F=Ki",//Auto start
|
||||
"Villogjon a hőmérséklet hűlés közben, amíg a hegy forró.",//Cooling Blink
|
||||
"Bekapcsolás után automatikusan lépjen forrasztás módba. T=Forrasztás, "
|
||||
"S=Alvó mód,F=Ki", // Auto start
|
||||
"Villogjon a hőmérséklet hűlés közben, amíg a hegy forró.", // Cooling
|
||||
// Blink
|
||||
"Hegy hőmérsékletének kalibrálása", // Calibrate Tip
|
||||
"Beállítások alaphelyzetbe állítása", // Reset Settings
|
||||
"A bemeneti feszültség kalibrálása. Röviden megnyomva állítsa be, hosszan nyomja meg a kilépéshez.",//VIN Cal
|
||||
"A bemeneti feszültség kalibrálása. Röviden megnyomva állítsa be, "
|
||||
"hosszan nyomja meg a kilépéshez.", // VIN Cal
|
||||
"Részletes információk megjelenítése forrasztás közben", // ADV SLD
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Folytatás előtt győződj meg róla, hogy a hegy szobahőmérsékletű!";
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Folytatás előtt győződj meg róla, hogy a hegy szobahőmérsékletű!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Alvás..."; // <=17 chars
|
||||
@@ -727,79 +772,27 @@ const char* SettingsShortNames[16][2] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef LANG_TR
|
||||
const char* SettingsLongNames[16] = {
|
||||
/*These are all the help text for all the settings.*/
|
||||
/*No requirements on spacing or length*/
|
||||
/* Power source (DC or batt) */"Güç Kaynağı. kesim geriliminı ayarlar. <DC 10V> <S 3.3V hücre başına>", //Power Source
|
||||
/* Sleep temperature */"Uyku Sıcaklığı <C>",//Sleep Temp
|
||||
/* Sleep timeout */"Uyku Zaman Aşımı <Dakika/Saniye>",//Sleep Timeout
|
||||
/* Shutdown timeout */"Kapatma Zaman Aşımı <Dakika>",//Shutdown Time
|
||||
/* Motion sensitivity level */"Hareket Hassasiyeti <0.Kapalı 1.En az duyarlı 9.En duyarlı>",//Motion Sensitivity
|
||||
/* Temperature in F and C */"Sıcaklık Ünitesi <C=Celsius F=Fahrenheit>",//Temp Unit
|
||||
/* Advanced idle display mode enabled */"Boş ekranda ayrıntılı bilgileri daha küçük bir yazı tipi ile göster.",//Detailed Information
|
||||
/* Display rotation mode */"Görüntü Yönlendirme <A. Otomatik L. Solak R. Sağlak>",//Orientation
|
||||
/* Boost enabled */"Lehimleme yaparken ön tuşa basmak Boost moduna sokar(450C)",//Boost enable
|
||||
/* Boost temperature */"\"boost\" Modu Derecesi",//Boost Temp
|
||||
/* Automatic start mode */"Güç verildiğinde otomatik olarak lehimleme modunda başlat. T=Lehimleme Modu, S= Uyku Modu,F=Kapalı",//Auto start
|
||||
/* Cooldown blink */"Soğutma ekranında uç hala sıcakken derece yanıp sönsün.",//Cooling Blink
|
||||
/* Temperature calibration enter menu */"Ucu kalibre et.",//Calibrate Tip
|
||||
/* Settings reset command */"Bütün ayarları sıfırla",//Reset Settings
|
||||
/* Calibrate input voltage */"VIN Kalibrasyonu. Düğmeler ayarlar, çıkmak için uzun bas.",//VIN Cal
|
||||
/* Advanced soldering screen enabled */"Lehimleme yaparken detaylı bilgi göster",//ADV SLD
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning = "Lütfen devam etmeden önce ucun oda sıcaklığında olduğunu garantiye alın!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; //Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzzz";// Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Uyuyor...";// <=17 chars
|
||||
const char* WarningSimpleString = "HOT!";//Must be <= 4 chars
|
||||
const char* WarningAdvancedString = "UYARI! UÇ SICAK!";
|
||||
|
||||
const char SettingTrueChar = 'T';
|
||||
const char SettingFalseChar = 'F';
|
||||
const char SettingRightChar = 'R';
|
||||
const char SettingLeftChar = 'L';
|
||||
const char SettingAutoChar = 'A';
|
||||
|
||||
const enum ShortNameType SettingsShortNameType = SHORT_NAME_SINGLE_LINE;
|
||||
const char* SettingsShortNames[16][2] = {
|
||||
/* (<= 5) Power source (DC or batt) */{"PWRSC"},
|
||||
/* (<= 4) Sleep temperature */{"STMP"},
|
||||
/* (<= 4) Sleep timeout */{"STME"},
|
||||
/* (<= 5) Shutdown timeout */{"SHTME"},
|
||||
/* (<= 6) Motion sensitivity level */{"MSENSE"},
|
||||
/* (<= 6) Temperature in F and C */{"TMPUNT"},
|
||||
/* (<= 6) Advanced idle display mode enabled */{"ADVIDL"},
|
||||
/* (<= 6) Display rotation mode */{"DSPROT"},
|
||||
/* (<= 6) Boost enabled */{"BOOST"},
|
||||
/* (<= 4) Boost temperature */{"BTMP"},
|
||||
/* (<= 6) Automatic start mode */{"ASTART"},
|
||||
/* (<= 6) Cooldown blink */{"CLBLNK"},
|
||||
/* (<= 8) Temperature calibration enter menu */{"TMP CAL?"},
|
||||
/* (<= 8) Settings reset command */{"RESET?"},
|
||||
/* (<= 8) Calibrate input voltage */{"CAL VIN?"},
|
||||
/* (<= 6) Advanced soldering screen enabled */{"ADVSLD"},
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef LANG_DK
|
||||
const char* SettingsLongNames[16] =
|
||||
{
|
||||
const char* SettingsLongNames[16] = {
|
||||
/*These are all the help text for all the settings.*/
|
||||
/*No requirements on spacing or length*/
|
||||
"Strømforsyning. Indstil Cutoff Spændingen. <DC 10V <S 3.3V per cell", // Power Source
|
||||
"Dvale Temperatur <C", // Sleep Temp
|
||||
"Dvale Timeout <Minutter/Sekunder", // Sleep Timeout
|
||||
"sluknings Timeout <Minutter", // Shutdown Time
|
||||
"Bevægelsesfølsomhed <0.Slukket 1.Mindst følsom 9.Mest følsom",//Motion Sensitivity
|
||||
"Bevægelsesfølsomhed <0.Slukket 1.Mindst følsom 9.Mest følsom", // Motion
|
||||
// Sensitivity
|
||||
"Temperatur Enhed <C=Celsius F=Fahrenheit", // Temp Unit
|
||||
"Vis detialieret information med en mindre skriftstørrelse på standby skærmen.",//Detailed Information
|
||||
"Vis detialieret information med en mindre skriftstørrelse på standby "
|
||||
"skærmen.", // Detailed Information
|
||||
"Skærm Orientering <A. Automatisk V. Venstre Håndet H. Højre Håndet", // Orientation
|
||||
"Ved tryk på front knap Aktiveres boost-funktionen, 450C tilstand når der loddes",//Boost enable
|
||||
"Ved tryk på front knap Aktiveres boost-funktionen, 450C tilstand når der "
|
||||
"loddes", // Boost enable
|
||||
"Temperatur i \"boost\" mode", // Boost Temp
|
||||
"Start automatisk med lodning når strøm sættes til. L=Lodning, D= Dvale tilstand,S=Slukket",//Auto start
|
||||
"Blink temperaturen på skærmen, mens spidsen stadig er varm.",//Cooling Blink
|
||||
"Start automatisk med lodning når strøm sættes til. L=Lodning, D= Dvale "
|
||||
"tilstand,S=Slukket", // Auto start
|
||||
"Blink temperaturen på skærmen, mens spidsen stadig er varm.", // Cooling
|
||||
// Blink
|
||||
"kalibrere spids temperatur.", // Calibrate Tip
|
||||
"Gendan alle indstillinger", // Reset Settings
|
||||
"VIN kalibrering. Knapperne justere, Lang tryk for at gå ud", // VIN Cal
|
||||
@@ -841,30 +834,41 @@ const char* SettingsShortNames[16][2] = {
|
||||
};
|
||||
#endif
|
||||
#ifdef LANG_PL
|
||||
const char* SettingsLongNames[16] =
|
||||
const char*
|
||||
SettingsLongNames[16] =
|
||||
{
|
||||
/*These are all the help text for all the settings.*/
|
||||
/*No requirements on spacing or length*/
|
||||
"Źródło zasilania. Ustaw napięcie odcięcia. <DC 10V> <S 3.3V dla ogniw Li>", //Power Source
|
||||
"Źródło zasilania. Ustaw napięcie odcięcia. <DC 10V> <S 3.3V dla "
|
||||
"ogniw Li>", // Power Source
|
||||
"Temperatura uśpienia <°C>", // Sleep Temp
|
||||
"Czas uśpienia <Minuty/Sekundy>", // Sleep Timeout
|
||||
"Czas wyłączenia <Minuty>", // Shutdown Time
|
||||
"Czułość ruchu <0.Wyłączona 1.minimalna 9.maksymalna>",//Motion Sensitivity
|
||||
"Czułość ruchu <0.Wyłączona 1.minimalna 9.maksymalna>", // Motion
|
||||
// Sensitivity
|
||||
"Jednostka temperatury <C=Celsius F=Fahrenheit>", // Temp Unit
|
||||
"Wyświetla szczegółowe informacje za pomocą mniejszej czcionki na ekranie bezczynnośći <T = wł., N = wył.>",//Detailed Information
|
||||
"Orientacja wyświetlacza <A. Automatyczna L. Leworęczna P. Praworęczna>",//Orientation
|
||||
"Użyj przycisku przedniego w celu zwiększenia temperatury <T = wł., N = wył.>",//Boost enable
|
||||
"Wyświetla szczegółowe informacje za pomocą mniejszej czcionki na "
|
||||
"ekranie bezczynnośći <T = wł., N = wył.>", // Detailed Information
|
||||
"Orientacja wyświetlacza <A. Automatyczna L. Leworęczna P. "
|
||||
"Praworęczna>", // Orientation
|
||||
"Użyj przycisku przedniego w celu zwiększenia temperatury <T = "
|
||||
"wł., N = wył.>", // Boost enable
|
||||
"Temperatura w trybie \"boost\" ", // Boost Temp
|
||||
"Automatyczne uruchamianie trybu lutowania po włączeniu zasilania. T=Lutowanie, S= Tryb Uspienia ,N=Wyłącz",//Auto start
|
||||
"Temperatura na ekranie miga, gdy grot jest jeszcze gorący. <T = wł., N = wył.>",//Cooling Blink
|
||||
"Automatyczne uruchamianie trybu lutowania po włączeniu zasilania. "
|
||||
"T=Lutowanie, S= Tryb Uspienia ,N=Wyłącz", // Auto start
|
||||
"Temperatura na ekranie miga, gdy grot jest jeszcze gorący. <T = "
|
||||
"wł., N = wył.>", // Cooling Blink
|
||||
"Kalibracja temperatury grota lutownicy", // Calibrate Tip
|
||||
"Zresetuj wszystkie ustawienia", // Reset Settings
|
||||
"Kalibracja napięcia wejściowego. Krótkie naciśnięcie, aby ustawić, długie naciśnięcie, aby wyjść.",//VIN Cal
|
||||
"Wyświetl szczegółowe informacje podczas lutowania <T = wł., N = wył.>",//ADV SLD
|
||||
"Kalibracja napięcia wejściowego. Krótkie naciśnięcie, aby "
|
||||
"ustawić, długie naciśnięcie, aby wyjść.", // VIN Cal
|
||||
"Wyświetl szczegółowe informacje podczas lutowania <T = wł., N = "
|
||||
"wył.>", // ADV SLD
|
||||
};
|
||||
|
||||
const char* SettingsCalibrationWarning =
|
||||
"Przed kontynuowaniem upewnij się, że końcówka osiągnela temperature pokojowa!";
|
||||
"Przed kontynuowaniem upewnij się, że końcówka osiągnela temperature "
|
||||
"pokojowa!";
|
||||
const char* UVLOWarningString = "LOW VOLT"; // Fixed width 8 chars
|
||||
const char* SleepingSimpleString = "Zzz!"; // Must be <= 4 chars
|
||||
const char* SleepingAdvancedString = "Uspienie..."; // <=17 chars
|
||||
@@ -894,5 +898,6 @@ const char* SettingsShortNames[16][2] = {
|
||||
/* (<= 8) Temperature calibration enter menu */ {"TMP CAL?"},
|
||||
/* (<= 8) Settings reset command */ {"RESET?"},
|
||||
/* (<= 8) Calibrate input voltage */ {"CAL VIN?"},
|
||||
/* (<= 6) Advanced soldering screen enabled */{"ADVSLD"},};
|
||||
/* (<= 6) Advanced soldering screen enabled */ {"ADVSLD"},
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "gui.h"
|
||||
#include "string.h"
|
||||
#include "hardware.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "hardware.h"
|
||||
#include "string.h"
|
||||
static void settings_setInputVRange(void);
|
||||
static void settings_displayInputVRange(void);
|
||||
static void settings_setSleepTemp(void);
|
||||
@@ -44,27 +44,59 @@ static void settings_setCalibrateVIN(void);
|
||||
static void settings_displayCalibrateVIN(void);
|
||||
|
||||
bool settingsResetRequest = false;
|
||||
const menuitem settingsMenu[] = { /*Struct used for all settings options in the settings menu*/
|
||||
{ (const char*) SettingsLongNames[0], { settings_setInputVRange }, { settings_displayInputVRange } },/*Voltage input*/
|
||||
{ (const char*) SettingsLongNames[1], { settings_setSleepTemp }, { settings_displaySleepTemp } }, /*Sleep Temp*/
|
||||
{ (const char*) SettingsLongNames[2], { settings_setSleepTime }, { settings_displaySleepTime } }, /*Sleep Time*/
|
||||
{ (const char*) SettingsLongNames[3], { settings_setShutdownTime }, { settings_displayShutdownTime } }, /*Shutdown Time*/
|
||||
{ (const char*) SettingsLongNames[4], { settings_setSensitivity }, { settings_displaySensitivity } },/* Motion Sensitivity*/
|
||||
{ (const char*) SettingsLongNames[5], { settings_setTempF }, { settings_displayTempF } },/* Motion Sensitivity*/
|
||||
{ (const char*) SettingsLongNames[6], { settings_setAdvancedIDLEScreens }, { settings_displayAdvancedIDLEScreens } },/* Advanced screens*/
|
||||
{ (const char*) SettingsLongNames[15], { settings_setAdvancedSolderingScreens }, { settings_displayAdvancedSolderingScreens } },/* Advanced screens*/
|
||||
{ (const char*) SettingsLongNames[7], { settings_setDisplayRotation }, { settings_displayDisplayRotation } }, /*Display Rotation*/
|
||||
{ (const char*) SettingsLongNames[8], { settings_setBoostModeEnabled }, { settings_displayBoostModeEnabled } }, /*Enable Boost*/
|
||||
{ (const char*) SettingsLongNames[9], { settings_setBoostTemp }, { settings_displayBoostTemp } }, /*Boost Temp*/
|
||||
{ (const char*) SettingsLongNames[10], { settings_setAutomaticStartMode }, { settings_displayAutomaticStartMode } },/*Auto start*/
|
||||
{ (const char*) SettingsLongNames[11], { settings_setCoolingBlinkEnabled }, { settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/
|
||||
{ (const char*) SettingsLongNames[12], { settings_setCalibrate }, { settings_displayCalibrate } }, /*Calibrate tip*/
|
||||
{ (const char*) SettingsLongNames[13], { settings_setResetSettings }, { settings_displayResetSettings } }, /*Resets settings*/
|
||||
{ (const char*) SettingsLongNames[14], { settings_setCalibrateVIN }, { settings_displayCalibrateVIN } }, /*Voltage input cal*/
|
||||
const menuitem settingsMenu[] = {
|
||||
/*Struct used for all settings options in the settings menu*/
|
||||
{(const char*)SettingsLongNames[0],
|
||||
{settings_setInputVRange},
|
||||
{settings_displayInputVRange}}, /*Voltage input*/
|
||||
{(const char*)SettingsLongNames[1],
|
||||
{settings_setSleepTemp},
|
||||
{settings_displaySleepTemp}}, /*Sleep Temp*/
|
||||
{(const char*)SettingsLongNames[2],
|
||||
{settings_setSleepTime},
|
||||
{settings_displaySleepTime}}, /*Sleep Time*/
|
||||
{(const char*)SettingsLongNames[3],
|
||||
{settings_setShutdownTime},
|
||||
{settings_displayShutdownTime}}, /*Shutdown Time*/
|
||||
{(const char*)SettingsLongNames[4],
|
||||
{settings_setSensitivity},
|
||||
{settings_displaySensitivity}}, /* Motion Sensitivity*/
|
||||
{(const char*)SettingsLongNames[5],
|
||||
{settings_setTempF},
|
||||
{settings_displayTempF}}, /* Motion Sensitivity*/
|
||||
{(const char*)SettingsLongNames[6],
|
||||
{settings_setAdvancedIDLEScreens},
|
||||
{settings_displayAdvancedIDLEScreens}}, /* Advanced screens*/
|
||||
{(const char*)SettingsLongNames[15],
|
||||
{settings_setAdvancedSolderingScreens},
|
||||
{settings_displayAdvancedSolderingScreens}}, /* Advanced screens*/
|
||||
{(const char*)SettingsLongNames[7],
|
||||
{settings_setDisplayRotation},
|
||||
{settings_displayDisplayRotation}}, /*Display Rotation*/
|
||||
{(const char*)SettingsLongNames[8],
|
||||
{settings_setBoostModeEnabled},
|
||||
{settings_displayBoostModeEnabled}}, /*Enable Boost*/
|
||||
{(const char*)SettingsLongNames[9],
|
||||
{settings_setBoostTemp},
|
||||
{settings_displayBoostTemp}}, /*Boost Temp*/
|
||||
{(const char*)SettingsLongNames[10],
|
||||
{settings_setAutomaticStartMode},
|
||||
{settings_displayAutomaticStartMode}}, /*Auto start*/
|
||||
{(const char*)SettingsLongNames[11],
|
||||
{settings_setCoolingBlinkEnabled},
|
||||
{settings_displayCoolingBlinkEnabled}}, /*Cooling blink warning*/
|
||||
{(const char*)SettingsLongNames[12],
|
||||
{settings_setCalibrate},
|
||||
{settings_displayCalibrate}}, /*Calibrate tip*/
|
||||
{(const char*)SettingsLongNames[13],
|
||||
{settings_setResetSettings},
|
||||
{settings_displayResetSettings}}, /*Resets settings*/
|
||||
{(const char*)SettingsLongNames[14],
|
||||
{settings_setCalibrateVIN},
|
||||
{settings_displayCalibrateVIN}}, /*Voltage input cal*/
|
||||
{NULL, {NULL}, {NULL}} // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
|
||||
|
||||
static void printShortDescriptionSingleLine(uint32_t shortDescIndex) {
|
||||
lcd.setFont(0);
|
||||
lcd.setCharCursor(0, 0);
|
||||
@@ -83,14 +115,15 @@ static void printShortDescriptionDoubleLine(uint32_t shortDescIndex) {
|
||||
* Prints two small lines of short description
|
||||
* and prepares cursor in big font after it.
|
||||
* @param shortDescIndex Index to of short description.
|
||||
* @param cursorCharPosition Custom cursor char position to set after printing description.
|
||||
* @param cursorCharPosition Custom cursor char position to set after printing
|
||||
* description.
|
||||
*/
|
||||
static void printShortDescription(uint32_t shortDescIndex, uint16_t cursorCharPosition) {
|
||||
static void printShortDescription(uint32_t shortDescIndex,
|
||||
uint16_t cursorCharPosition) {
|
||||
// print short description (default single line, explicit double line)
|
||||
if (SettingsShortNameType == SHORT_NAME_DOUBLE_LINE) {
|
||||
printShortDescriptionDoubleLine(shortDescIndex);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
printShortDescriptionSingleLine(shortDescIndex);
|
||||
}
|
||||
|
||||
@@ -99,7 +132,6 @@ static void printShortDescription(uint32_t shortDescIndex, uint16_t cursorCharPo
|
||||
lcd.setCharCursor(cursorCharPosition, 0);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setInputVRange(void) {
|
||||
systemSettings.cutoutSetting = (systemSettings.cutoutSetting + 1) % 5;
|
||||
}
|
||||
@@ -110,17 +142,14 @@ static void settings_displayInputVRange(void) {
|
||||
if (systemSettings.cutoutSetting) {
|
||||
lcd.drawChar('0' + 2 + systemSettings.cutoutSetting);
|
||||
lcd.drawChar('S');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lcd.print("DC");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void settings_setSleepTemp(void) {
|
||||
systemSettings.SleepTemp += 10;
|
||||
if (systemSettings.SleepTemp > 300)
|
||||
systemSettings.SleepTemp = 50;
|
||||
if (systemSettings.SleepTemp > 300) systemSettings.SleepTemp = 50;
|
||||
}
|
||||
|
||||
static void settings_displaySleepTemp(void) {
|
||||
@@ -128,7 +157,6 @@ static void settings_displaySleepTemp(void) {
|
||||
lcd.printNumber(systemSettings.SleepTemp, 3);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setSleepTime(void) {
|
||||
systemSettings.SleepTime++; // Go up 1 minute at a time
|
||||
if (systemSettings.SleepTime >= 16) {
|
||||
@@ -143,14 +171,12 @@ static void settings_displaySleepTime(void) {
|
||||
if (systemSettings.SleepTime < 6) {
|
||||
lcd.printNumber(systemSettings.SleepTime * 10, 2);
|
||||
lcd.drawChar('S');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
lcd.printNumber(systemSettings.SleepTime - 5, 2);
|
||||
lcd.drawChar('M');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void settings_setShutdownTime(void) {
|
||||
systemSettings.ShutdownTime++;
|
||||
if (systemSettings.ShutdownTime > 60) {
|
||||
@@ -163,7 +189,6 @@ static void settings_displayShutdownTime(void) {
|
||||
lcd.printNumber(systemSettings.ShutdownTime, 2);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setTempF(void) {
|
||||
systemSettings.temperatureInF = !systemSettings.temperatureInF;
|
||||
}
|
||||
@@ -171,14 +196,9 @@ static void settings_setTempF(void) {
|
||||
static void settings_displayTempF(void) {
|
||||
printShortDescription(5, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(systemSettings.temperatureInF)
|
||||
? 'F'
|
||||
: 'C'
|
||||
);
|
||||
lcd.drawChar((systemSettings.temperatureInF) ? 'F' : 'C');
|
||||
}
|
||||
|
||||
|
||||
static void settings_setSensitivity(void) {
|
||||
systemSettings.sensitivity++;
|
||||
systemSettings.sensitivity = systemSettings.sensitivity % 10;
|
||||
@@ -189,7 +209,6 @@ static void settings_displaySensitivity(void) {
|
||||
lcd.printNumber(systemSettings.sensitivity, 1);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setAdvancedSolderingScreens(void) {
|
||||
systemSettings.detailedSoldering = !systemSettings.detailedSoldering;
|
||||
}
|
||||
@@ -197,14 +216,10 @@ static void settings_setAdvancedSolderingScreens(void) {
|
||||
static void settings_displayAdvancedSolderingScreens(void) {
|
||||
printShortDescription(15, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(systemSettings.detailedSoldering)
|
||||
? SettingTrueChar
|
||||
: SettingFalseChar
|
||||
);
|
||||
lcd.drawChar((systemSettings.detailedSoldering) ? SettingTrueChar
|
||||
: SettingFalseChar);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setAdvancedIDLEScreens(void) {
|
||||
systemSettings.detailedIDLE = !systemSettings.detailedIDLE;
|
||||
}
|
||||
@@ -212,14 +227,10 @@ static void settings_setAdvancedIDLEScreens(void) {
|
||||
static void settings_displayAdvancedIDLEScreens(void) {
|
||||
printShortDescription(6, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(systemSettings.detailedIDLE)
|
||||
? SettingTrueChar
|
||||
: SettingFalseChar
|
||||
);
|
||||
lcd.drawChar((systemSettings.detailedIDLE) ? SettingTrueChar
|
||||
: SettingFalseChar);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setDisplayRotation(void) {
|
||||
systemSettings.OrientationMode++;
|
||||
systemSettings.OrientationMode = systemSettings.OrientationMode % 3;
|
||||
@@ -238,10 +249,12 @@ static void settings_displayDisplayRotation(void) {
|
||||
case 2:
|
||||
lcd.drawChar(SettingAutoChar);
|
||||
break;
|
||||
default:
|
||||
lcd.drawChar(SettingRightChar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void settings_setBoostModeEnabled(void) {
|
||||
systemSettings.boostModeEnabled = !systemSettings.boostModeEnabled;
|
||||
}
|
||||
@@ -249,22 +262,17 @@ static void settings_setBoostModeEnabled(void) {
|
||||
static void settings_displayBoostModeEnabled(void) {
|
||||
printShortDescription(8, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(systemSettings.boostModeEnabled)
|
||||
? SettingTrueChar
|
||||
: SettingFalseChar
|
||||
);
|
||||
lcd.drawChar((systemSettings.boostModeEnabled) ? SettingTrueChar
|
||||
: SettingFalseChar);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setBoostTemp(void) {
|
||||
systemSettings.BoostTemp += 10; // Go up 10 at a time
|
||||
if (systemSettings.temperatureInF) {
|
||||
if (systemSettings.BoostTemp > 850) {
|
||||
systemSettings.BoostTemp = 480; // loop back at 250
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (systemSettings.BoostTemp > 450) {
|
||||
systemSettings.BoostTemp = 250; // loop back at 250
|
||||
}
|
||||
@@ -276,7 +284,6 @@ static void settings_displayBoostTemp(void) {
|
||||
lcd.printNumber(systemSettings.BoostTemp, 3);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setAutomaticStartMode(void) {
|
||||
systemSettings.autoStartMode++;
|
||||
systemSettings.autoStartMode %= 2;
|
||||
@@ -285,14 +292,10 @@ static void settings_setAutomaticStartMode(void) {
|
||||
static void settings_displayAutomaticStartMode(void) {
|
||||
printShortDescription(10, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(systemSettings.autoStartMode)
|
||||
? SettingTrueChar
|
||||
: SettingFalseChar
|
||||
);
|
||||
lcd.drawChar((systemSettings.autoStartMode) ? SettingTrueChar
|
||||
: SettingFalseChar);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setCoolingBlinkEnabled(void) {
|
||||
systemSettings.coolingTempBlink = !systemSettings.coolingTempBlink;
|
||||
}
|
||||
@@ -300,14 +303,10 @@ static void settings_setCoolingBlinkEnabled(void) {
|
||||
static void settings_displayCoolingBlinkEnabled(void) {
|
||||
printShortDescription(11, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(systemSettings.coolingTempBlink)
|
||||
? SettingTrueChar
|
||||
: SettingFalseChar
|
||||
);
|
||||
lcd.drawChar((systemSettings.coolingTempBlink) ? SettingTrueChar
|
||||
: SettingFalseChar);
|
||||
}
|
||||
|
||||
|
||||
static void settings_setResetSettings(void) {
|
||||
settingsResetRequest = !settingsResetRequest;
|
||||
}
|
||||
@@ -315,11 +314,7 @@ static void settings_setResetSettings(void) {
|
||||
static void settings_displayResetSettings(void) {
|
||||
printShortDescription(13, 7);
|
||||
|
||||
lcd.drawChar(
|
||||
(settingsResetRequest)
|
||||
? SettingTrueChar
|
||||
: SettingFalseChar
|
||||
);
|
||||
lcd.drawChar((settingsResetRequest) ? SettingTrueChar : SettingFalseChar);
|
||||
}
|
||||
|
||||
static void settings_setCalibrate(void) {
|
||||
@@ -333,7 +328,8 @@ static void settings_setCalibrate(void) {
|
||||
lcd.setCursor(0, 0);
|
||||
|
||||
for (;;) {
|
||||
int16_t descriptionOffset = (((HAL_GetTick() - descriptionStart) / 150) % maxOffset);
|
||||
int16_t descriptionOffset =
|
||||
(((HAL_GetTick() - descriptionStart) / 150) % maxOffset);
|
||||
|
||||
lcd.setCursor(12 * (7 - descriptionOffset), 0);
|
||||
lcd.print(SettingsCalibrationWarning);
|
||||
@@ -350,7 +346,8 @@ static void settings_setCalibrate(void) {
|
||||
|
||||
setCalibrationOffset(0); // turn off the current offset
|
||||
for (uint8_t i = 0; i < 20; i++) {
|
||||
getTipRawTemp(1); //cycle through the filter a fair bit to ensure we're stable.
|
||||
getTipRawTemp(1); // cycle through the filter a fair bit to ensure
|
||||
// we're stable.
|
||||
osDelay(20);
|
||||
}
|
||||
osDelay(100);
|
||||
@@ -358,7 +355,8 @@ static void settings_setCalibrate(void) {
|
||||
uint16_t rawTempC = tipMeasurementToC(getTipRawTemp(0));
|
||||
// We now measure the current reported tip temperature
|
||||
uint16_t handleTempC = getHandleTemperature() / 10;
|
||||
//We now have an error between these that we want to store as the offset
|
||||
// We now have an error between these that we want to store as the
|
||||
// offset
|
||||
rawTempC = rawTempC - handleTempC;
|
||||
systemSettings.CalibrationOffset = rawTempC;
|
||||
setCalibrationOffset(rawTempC); // store the error
|
||||
@@ -374,6 +372,8 @@ static void settings_setCalibrate(void) {
|
||||
|
||||
case BUTTON_NONE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
lcd.refresh();
|
||||
@@ -381,10 +381,7 @@ static void settings_setCalibrate(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static void settings_displayCalibrate(void) {
|
||||
printShortDescription(12, 5);
|
||||
}
|
||||
|
||||
static void settings_displayCalibrate(void) { printShortDescription(12, 5); }
|
||||
|
||||
static void settings_setCalibrateVIN(void) {
|
||||
// Jump to the voltage calibration subscreen
|
||||
@@ -416,6 +413,7 @@ static void settings_setCalibrateVIN(void) {
|
||||
return;
|
||||
|
||||
case BUTTON_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -425,13 +423,10 @@ static void settings_setCalibrateVIN(void) {
|
||||
// Cap to sensible values
|
||||
if (systemSettings.voltageDiv < 90) {
|
||||
systemSettings.voltageDiv = 90;
|
||||
}
|
||||
else if (systemSettings.voltageDiv > 130) {
|
||||
} else if (systemSettings.voltageDiv > 130) {
|
||||
systemSettings.voltageDiv = 130;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void settings_displayCalibrateVIN(void) {
|
||||
printShortDescription(14, 5);
|
||||
}
|
||||
static void settings_displayCalibrateVIN(void) { printShortDescription(14, 5); }
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// By Ben V. Brown - V2.0 of the TS100 firmware
|
||||
#include <main.hpp>
|
||||
#include <MMA8652FC.hpp>
|
||||
#include "stm32f1xx_hal.h"
|
||||
#include "cmsis_os.h"
|
||||
#include <main.hpp>
|
||||
#include "OLED.hpp"
|
||||
#include "Settings.h"
|
||||
#include "Translation.h"
|
||||
#include "string.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "gui.h"
|
||||
#include "stdlib.h"
|
||||
#include "stm32f1xx_hal.h"
|
||||
#include "string.h"
|
||||
|
||||
// C++ objects
|
||||
OLED lcd(&hi2c1);
|
||||
@@ -35,13 +35,15 @@ void startRotationTask(void const * argument);
|
||||
|
||||
// Main inits hardware then hands over to the FreeRTOS kernel
|
||||
int main(void) {
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
|
||||
*/
|
||||
HAL_Init();
|
||||
Setup_HAL(); // Setup all the HAL objects
|
||||
setTipPWM(0);
|
||||
lcd.initialize(); // start up the LCD
|
||||
lcd.setFont(0); // default to bigger font
|
||||
accel.initalize(); //this sets up the I2C registers and loads up the default settings
|
||||
accel.initalize(); // this sets up the I2C registers and loads up the default
|
||||
// settings
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
restoreSettings(); // load the settings from flash
|
||||
setCalibrationOffset(systemSettings.CalibrationOffset);
|
||||
@@ -63,8 +65,10 @@ int main(void) {
|
||||
MOVTaskHandle = osThreadCreate(osThread(MOVTask), NULL);
|
||||
|
||||
/* Create the objects*/
|
||||
rotationChangedSemaphore = xSemaphoreCreateBinary(); // Used to unlock rotation thread
|
||||
accelDataAvailableSemaphore = xSemaphoreCreateBinary(); // Used to unlock the movement thread
|
||||
rotationChangedSemaphore =
|
||||
xSemaphoreCreateBinary(); // Used to unlock rotation thread
|
||||
accelDataAvailableSemaphore =
|
||||
xSemaphoreCreateBinary(); // Used to unlock the movement thread
|
||||
/* Start scheduler */
|
||||
osKernelStart();
|
||||
|
||||
@@ -88,7 +92,6 @@ void gui_drawTipTemp() {
|
||||
// Temp = systemSettings.SolderingTemp;
|
||||
|
||||
lcd.printNumber(Temp, 3); // Draw the tip temp out finally
|
||||
|
||||
}
|
||||
ButtonState getButtonState() {
|
||||
/*
|
||||
@@ -96,25 +99,26 @@ ButtonState getButtonState() {
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the previous state was 00 Then we want to latch the new state if different & update time
|
||||
* If the previous state was !00 Then we want to search if we trigger long press (buttons still down), or if release we trigger press (downtime>filter)
|
||||
* If the previous state was 00 Then we want to latch the new state if
|
||||
* different & update time
|
||||
* If the previous state was !00 Then we want to search if we trigger long
|
||||
* press (buttons still down), or if release we trigger press
|
||||
* (downtime>filter)
|
||||
*/
|
||||
static uint8_t previousState = 0;
|
||||
static uint32_t previousStateChange = 0;
|
||||
const uint16_t timeout = 400;
|
||||
uint8_t currentState;
|
||||
currentState = (
|
||||
HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ?
|
||||
1 : 0) << 0;
|
||||
currentState |= (
|
||||
HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ?
|
||||
1 : 0) << 1;
|
||||
currentState =
|
||||
(HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0)
|
||||
<< 0;
|
||||
currentState |=
|
||||
(HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ? 1 : 0)
|
||||
<< 1;
|
||||
|
||||
if (currentState)
|
||||
lastButtonTime = HAL_GetTick();
|
||||
if (currentState) lastButtonTime = HAL_GetTick();
|
||||
if (currentState == previousState) {
|
||||
if (currentState == 0)
|
||||
return BUTTON_NONE;
|
||||
if (currentState == 0) return BUTTON_NONE;
|
||||
if ((HAL_GetTick() - previousStateChange) > timeout) {
|
||||
// User has been holding the button down
|
||||
// We want to send a buttong is held message
|
||||
@@ -134,7 +138,8 @@ ButtonState getButtonState() {
|
||||
|
||||
} else {
|
||||
// User has released buttons
|
||||
// If they previously had the buttons down we want to check if they were < long hold and trigger a press
|
||||
// If they previously had the buttons down we want to check if they were <
|
||||
// long hold and trigger a press
|
||||
if ((HAL_GetTick() - previousStateChange) < timeout) {
|
||||
// The user didn't hold the button for long
|
||||
// So we send button press
|
||||
@@ -146,7 +151,6 @@ ButtonState getButtonState() {
|
||||
else
|
||||
retVal = BUTTON_BOTH; // Both being held case
|
||||
}
|
||||
|
||||
}
|
||||
previousState = currentState;
|
||||
previousStateChange = HAL_GetTick();
|
||||
@@ -177,13 +181,10 @@ static void waitForButtonPressOrTimeout(uint32_t timeout) {
|
||||
// Make timeout our exit value
|
||||
for (;;) {
|
||||
ButtonState buttons = getButtonState();
|
||||
if (buttons)
|
||||
return;
|
||||
if (HAL_GetTick() > timeout)
|
||||
return;
|
||||
if (buttons) return;
|
||||
if (HAL_GetTick() > timeout) return;
|
||||
GUIDelay();
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,11 +199,9 @@ static bool checkVoltageForExit() {
|
||||
lcd.print("Undervoltage");
|
||||
lcd.setCursor(0, 8);
|
||||
lcd.print("Input V: ");
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10,
|
||||
2);
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10, 2);
|
||||
lcd.drawChar('.');
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10,
|
||||
1);
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10, 1);
|
||||
lcd.print("V");
|
||||
|
||||
} else {
|
||||
@@ -222,19 +221,15 @@ static void gui_drawBatteryIcon() {
|
||||
// User is on a lithium battery
|
||||
// we need to calculate which of the 10 levels they are on
|
||||
uint8_t cellCount = systemSettings.cutoutSetting + 2;
|
||||
uint16_t cellV = getInputVoltageX10(systemSettings.voltageDiv)
|
||||
/ cellCount;
|
||||
uint16_t cellV = getInputVoltageX10(systemSettings.voltageDiv) / cellCount;
|
||||
// Should give us approx cell voltage X10
|
||||
// Range is 42 -> 33 = 9 steps therefore we will use battery 1-10
|
||||
if (cellV < 33)
|
||||
cellV = 33;
|
||||
if (cellV < 33) cellV = 33;
|
||||
cellV -= 33; // Should leave us a number of 0-9
|
||||
if (cellV > 9)
|
||||
cellV = 9;
|
||||
if (cellV > 9) cellV = 9;
|
||||
lcd.drawBattery(cellV + 1);
|
||||
} else
|
||||
lcd.drawSymbol(16); // Draw the DC Logo
|
||||
|
||||
}
|
||||
static void gui_solderingTempAdjust() {
|
||||
uint32_t lastChange = HAL_GetTick();
|
||||
@@ -244,8 +239,7 @@ static void gui_solderingTempAdjust() {
|
||||
lcd.clearScreen();
|
||||
lcd.setFont(0);
|
||||
ButtonState buttons = getButtonState();
|
||||
if (buttons)
|
||||
lastChange = HAL_GetTick();
|
||||
if (buttons) lastChange = HAL_GetTick();
|
||||
switch (buttons) {
|
||||
case BUTTON_NONE:
|
||||
// stay
|
||||
@@ -274,6 +268,8 @@ static void gui_solderingTempAdjust() {
|
||||
systemSettings.SolderingTemp -= 10; // sub 10
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// constrain between 50-450 C
|
||||
if (systemSettings.temperatureInF) {
|
||||
@@ -288,8 +284,7 @@ static void gui_solderingTempAdjust() {
|
||||
if (systemSettings.SolderingTemp < 120)
|
||||
systemSettings.SolderingTemp = 120;
|
||||
} else {
|
||||
if (systemSettings.SolderingTemp < 50)
|
||||
systemSettings.SolderingTemp = 50;
|
||||
if (systemSettings.SolderingTemp < 50) systemSettings.SolderingTemp = 50;
|
||||
}
|
||||
|
||||
if (HAL_GetTick() - lastChange > 1500)
|
||||
@@ -314,8 +309,8 @@ static void gui_settingsMenu() {
|
||||
settingsResetRequest = false;
|
||||
bool earlyExit = false;
|
||||
uint32_t descriptionStart = 0;
|
||||
while ((settingsMenu[currentScreen].incrementHandler.func != NULL)
|
||||
&& earlyExit == false) {
|
||||
while ((settingsMenu[currentScreen].incrementHandler.func != NULL) &&
|
||||
earlyExit == false) {
|
||||
lcd.setFont(0);
|
||||
lcd.clearScreen();
|
||||
lcd.setCursor(0, 0);
|
||||
@@ -326,13 +321,11 @@ static void gui_settingsMenu() {
|
||||
} else {
|
||||
// Draw description
|
||||
// draw string starting from descriptionOffset
|
||||
int16_t maxOffset = strlen(settingsMenu[currentScreen].description)
|
||||
+ 5;
|
||||
if (descriptionStart == 0)
|
||||
descriptionStart = HAL_GetTick();
|
||||
int16_t maxOffset = strlen(settingsMenu[currentScreen].description) + 5;
|
||||
if (descriptionStart == 0) descriptionStart = HAL_GetTick();
|
||||
|
||||
int16_t descriptionOffset = (((HAL_GetTick() - descriptionStart)
|
||||
/ 10) % (maxOffset * 12));
|
||||
int16_t descriptionOffset =
|
||||
(((HAL_GetTick() - descriptionStart) / 3) % (maxOffset * 12));
|
||||
//^ Rolling offset based on time
|
||||
lcd.setCursor(((7 * 12) - descriptionOffset), 0);
|
||||
lcd.print(settingsMenu[currentScreen].description);
|
||||
@@ -373,21 +366,19 @@ static void gui_settingsMenu() {
|
||||
}
|
||||
break;
|
||||
case BUTTON_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
lcd.refresh(); // update the LCD
|
||||
osDelay(20);
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
}
|
||||
if (settingsResetRequest)
|
||||
resetSettings();
|
||||
if (settingsResetRequest) resetSettings();
|
||||
saveSettings();
|
||||
}
|
||||
static int gui_showTipTempWarning() {
|
||||
for (;;) {
|
||||
|
||||
uint16_t tipTemp = tipMeasurementToC(getTipRawTemp(0));
|
||||
lcd.clearScreen();
|
||||
lcd.setCursor(0, 0);
|
||||
@@ -419,8 +410,7 @@ static int gui_showTipTempWarning() {
|
||||
}
|
||||
}
|
||||
if (systemSettings.coolingTempBlink && tipTemp > 50) {
|
||||
if (HAL_GetTick() % 500 < 250)
|
||||
lcd.clearScreen();
|
||||
if (HAL_GetTick() % 500 < 250) lcd.clearScreen();
|
||||
}
|
||||
lcd.refresh();
|
||||
ButtonState buttons = getButtonState();
|
||||
@@ -429,8 +419,7 @@ static int gui_showTipTempWarning() {
|
||||
else if (buttons == BUTTON_B_SHORT || buttons == BUTTON_BOTH)
|
||||
return 0;
|
||||
|
||||
if (tipTemp < 30)
|
||||
return 0;
|
||||
if (tipTemp < 30) return 0;
|
||||
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
GUIDelay();
|
||||
@@ -447,22 +436,18 @@ static int gui_SolderingSleepingMode() {
|
||||
|
||||
for (;;) {
|
||||
ButtonState buttons = getButtonState();
|
||||
if (buttons)
|
||||
return 0;
|
||||
if ((HAL_GetTick() - lastMovementTime < 1000)
|
||||
|| (HAL_GetTick() - lastButtonTime < 1000))
|
||||
if (buttons) return 0;
|
||||
if ((HAL_GetTick() - lastMovementTime < 1000) ||
|
||||
(HAL_GetTick() - lastButtonTime < 1000))
|
||||
return 0; // user moved or pressed a button, go back to soldering
|
||||
if (checkVoltageForExit())
|
||||
return 1; //return non-zero on error
|
||||
if (checkVoltageForExit()) return 1; // return non-zero on error
|
||||
|
||||
if (systemSettings.temperatureInF)
|
||||
currentlyActiveTemperatureTarget = ftoTipMeasurement(
|
||||
min(systemSettings.SleepTemp,
|
||||
systemSettings.SolderingTemp));
|
||||
min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
|
||||
else
|
||||
currentlyActiveTemperatureTarget = ctoTipMeasurement(
|
||||
min(systemSettings.SleepTemp,
|
||||
systemSettings.SolderingTemp));
|
||||
min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
|
||||
// draw the lcd
|
||||
uint16_t tipTemp;
|
||||
if (systemSettings.temperatureInF)
|
||||
@@ -484,11 +469,9 @@ static int gui_SolderingSleepingMode() {
|
||||
lcd.print("C");
|
||||
|
||||
lcd.print(" ");
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10,
|
||||
2);
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10, 2);
|
||||
lcd.drawChar('.');
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10,
|
||||
1);
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10, 1);
|
||||
lcd.drawChar('V');
|
||||
} else {
|
||||
lcd.setFont(0);
|
||||
@@ -501,8 +484,8 @@ static int gui_SolderingSleepingMode() {
|
||||
}
|
||||
if (systemSettings.ShutdownTime) // only allow shutdown exit if time > 0
|
||||
if (lastMovementTime)
|
||||
if (((uint32_t) (HAL_GetTick() - lastMovementTime))
|
||||
> (uint32_t) (systemSettings.ShutdownTime * 60 * 1000)) {
|
||||
if (((uint32_t)(HAL_GetTick() - lastMovementTime)) >
|
||||
(uint32_t)(systemSettings.ShutdownTime * 60 * 1000)) {
|
||||
// shutdown
|
||||
currentlyActiveTemperatureTarget = 0;
|
||||
return 1; // we want to exit soldering mode
|
||||
@@ -510,7 +493,6 @@ static int gui_SolderingSleepingMode() {
|
||||
lcd.refresh();
|
||||
GUIDelay();
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
}
|
||||
}
|
||||
static void gui_solderingMode() {
|
||||
@@ -522,7 +504,8 @@ static void gui_solderingMode() {
|
||||
* ---> Use buttons to change forward and back on temperature
|
||||
* ---> Both buttons or timeout for exiting
|
||||
* --> Long hold front button to enter boost mode
|
||||
* ---> Just temporarily sets the system into the alternate temperature for PID control
|
||||
* ---> Just temporarily sets the system into the alternate temperature for
|
||||
* PID control
|
||||
* --> Long hold back button to exit
|
||||
* --> Double button to exit
|
||||
*/
|
||||
@@ -550,8 +533,7 @@ static void gui_solderingMode() {
|
||||
break;
|
||||
case BUTTON_F_LONG:
|
||||
// if boost mode is enabled turn it on
|
||||
if (systemSettings.boostModeEnabled)
|
||||
boostModeOn = true;
|
||||
if (systemSettings.boostModeEnabled) boostModeOn = true;
|
||||
break;
|
||||
case BUTTON_F_SHORT:
|
||||
case BUTTON_B_SHORT: {
|
||||
@@ -560,7 +542,8 @@ static void gui_solderingMode() {
|
||||
if (oldTemp != systemSettings.SolderingTemp) {
|
||||
saveSettings(); // only save on change
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// else we update the screen information
|
||||
@@ -601,7 +584,6 @@ static void gui_solderingMode() {
|
||||
else
|
||||
lcd.drawSymbol(15);
|
||||
} else {
|
||||
|
||||
// Draw heating/cooling symbols
|
||||
// If tip PWM > 10% then we are 'heating'
|
||||
if (getTipPWM() > 10)
|
||||
@@ -631,19 +613,19 @@ static void gui_solderingMode() {
|
||||
// Update the setpoints for the temperature
|
||||
if (boostModeOn) {
|
||||
if (systemSettings.temperatureInF)
|
||||
currentlyActiveTemperatureTarget = ftoTipMeasurement(
|
||||
systemSettings.BoostTemp);
|
||||
currentlyActiveTemperatureTarget =
|
||||
ftoTipMeasurement(systemSettings.BoostTemp);
|
||||
else
|
||||
currentlyActiveTemperatureTarget = ctoTipMeasurement(
|
||||
systemSettings.BoostTemp);
|
||||
currentlyActiveTemperatureTarget =
|
||||
ctoTipMeasurement(systemSettings.BoostTemp);
|
||||
|
||||
} else {
|
||||
if (systemSettings.temperatureInF)
|
||||
currentlyActiveTemperatureTarget = ftoTipMeasurement(
|
||||
systemSettings.SolderingTemp);
|
||||
currentlyActiveTemperatureTarget =
|
||||
ftoTipMeasurement(systemSettings.SolderingTemp);
|
||||
else
|
||||
currentlyActiveTemperatureTarget = ctoTipMeasurement(
|
||||
systemSettings.SolderingTemp);
|
||||
currentlyActiveTemperatureTarget =
|
||||
ctoTipMeasurement(systemSettings.SolderingTemp);
|
||||
}
|
||||
|
||||
// Undervoltage test
|
||||
@@ -653,8 +635,8 @@ static void gui_solderingMode() {
|
||||
|
||||
lcd.refresh();
|
||||
if (systemSettings.sensitivity)
|
||||
if (HAL_GetTick() - lastMovementTime > sleepThres
|
||||
&& HAL_GetTick() - lastButtonTime > sleepThres) {
|
||||
if (HAL_GetTick() - lastMovementTime > sleepThres &&
|
||||
HAL_GetTick() - lastButtonTime > sleepThres) {
|
||||
if (gui_SolderingSleepingMode()) {
|
||||
return; // If the function returns non-0 then exit
|
||||
}
|
||||
@@ -662,7 +644,6 @@ static void gui_solderingMode() {
|
||||
GUIDelay();
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
}
|
||||
|
||||
}
|
||||
#define ACCELDEBUG 0
|
||||
/* StartGUITask function */
|
||||
@@ -677,7 +658,8 @@ void startGUITask(void const * argument) {
|
||||
* ---> Use buttons to change forward and back on temperature
|
||||
* ---> Both buttons or timeout for exiting
|
||||
* --> Long hold front button to enter boost mode
|
||||
* ---> Just temporarily sets the system into the alternate temperature for PID control
|
||||
* ---> Just temporarily sets the system into the alternate temperature for
|
||||
* PID control
|
||||
* --> Long hold back button to exit
|
||||
* --> Double button to exit
|
||||
* * Settings Menu (gui_settingsMenu)
|
||||
@@ -691,13 +673,11 @@ void startGUITask(void const * argument) {
|
||||
uint8_t tempWarningState = 0;
|
||||
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
if (showBootLogoIfavailable())
|
||||
waitForButtonPressOrTimeout(2000);
|
||||
if (showBootLogoIfavailable()) waitForButtonPressOrTimeout(2000);
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
if (systemSettings.autoStartMode) {
|
||||
// jump directly to the autostart mode
|
||||
if (systemSettings.autoStartMode == 1)
|
||||
gui_solderingMode();
|
||||
if (systemSettings.autoStartMode == 1) gui_solderingMode();
|
||||
}
|
||||
#if ACCELDEBUG
|
||||
|
||||
@@ -710,8 +690,7 @@ void startGUITask(void const * argument) {
|
||||
|
||||
for (;;) {
|
||||
ButtonState buttons = getButtonState();
|
||||
if (tempWarningState == 2)
|
||||
buttons = BUTTON_F_SHORT;
|
||||
if (tempWarningState == 2) buttons = BUTTON_F_SHORT;
|
||||
switch (buttons) {
|
||||
case BUTTON_NONE:
|
||||
// Do nothing
|
||||
@@ -732,7 +711,6 @@ void startGUITask(void const * argument) {
|
||||
lcd.refresh();
|
||||
waitForButtonPress();
|
||||
lcd.setFont(0); // reset font
|
||||
|
||||
}
|
||||
break;
|
||||
case BUTTON_F_LONG:
|
||||
@@ -750,23 +728,26 @@ void startGUITask(void const * argument) {
|
||||
lcd.displayOnOff(true); // turn lcd on
|
||||
gui_settingsMenu(); // enter the settings menu
|
||||
saveSettings();
|
||||
setCalibrationOffset(systemSettings.CalibrationOffset); //ensure cal offset is applied
|
||||
setCalibrationOffset(
|
||||
systemSettings.CalibrationOffset); // ensure cal offset is applied
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
currentlyActiveTemperatureTarget = 0; // ensure tip is off
|
||||
|
||||
if (systemSettings.sensitivity) {
|
||||
if ((HAL_GetTick() - lastMovementTime) > 60000
|
||||
&& (HAL_GetTick() - lastButtonTime) > 60000)
|
||||
if ((HAL_GetTick() - lastMovementTime) > 60000 &&
|
||||
(HAL_GetTick() - lastButtonTime) > 60000)
|
||||
lcd.displayOnOff(false); // turn lcd off when no movement
|
||||
else if (HAL_GetTick() - lastMovementTime < 1000
|
||||
|| HAL_GetTick() - lastButtonTime < 1000) /*Use short time for test, and prevent lots of I2C writes for no need*/
|
||||
else if (HAL_GetTick() - lastMovementTime < 1000 ||
|
||||
HAL_GetTick() - lastButtonTime <
|
||||
1000) /*Use short time for test, and prevent lots of I2C
|
||||
writes for no need*/
|
||||
lcd.displayOnOff(true); // turn lcd back on
|
||||
|
||||
}
|
||||
uint16_t tipTemp = tipMeasurementToC(getTipRawTemp(0));
|
||||
if (tipTemp > 600)
|
||||
tipTemp = 0;
|
||||
if (tipTemp > 600) tipTemp = 0;
|
||||
if (tipTemp > 50) {
|
||||
if (tempWarningState == 0) {
|
||||
currentlyActiveTemperatureTarget = 0; // ensure tip is off
|
||||
@@ -797,11 +778,9 @@ void startGUITask(void const * argument) {
|
||||
}
|
||||
lcd.setCursor(0, 8);
|
||||
lcd.print("Input V: ");
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10,
|
||||
2);
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) / 10, 2);
|
||||
lcd.drawChar('.');
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10,
|
||||
1);
|
||||
lcd.printNumber(getInputVoltageX10(systemSettings.voltageDiv) % 10, 1);
|
||||
lcd.print("V");
|
||||
|
||||
} else {
|
||||
@@ -815,24 +794,25 @@ void startGUITask(void const * argument) {
|
||||
lcd.setCursor(84, 0);
|
||||
gui_drawBatteryIcon();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lcd.refresh();
|
||||
animationStep++;
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
GUIDelay();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* StartPIDTask function */
|
||||
void startPIDTask(void const *argument) {
|
||||
/*
|
||||
* We take the current tip temperature & evaluate the next step for the tip control PWM
|
||||
* Tip temperature is measured by getTipTemperature(1) so we get instant result
|
||||
* We take the current tip temperature & evaluate the next step for the tip
|
||||
* control PWM
|
||||
* Tip temperature is measured by getTipTemperature(1) so we get instant
|
||||
* result
|
||||
* This comes in Cx10 format
|
||||
* We then control the tip temperature to aim for the setpoint in the settings struct
|
||||
* We then control the tip temperature to aim for the setpoint in the settings
|
||||
* struct
|
||||
*
|
||||
*/
|
||||
int32_t integralCount = 0;
|
||||
@@ -844,13 +824,15 @@ void startPIDTask(void const * argument) {
|
||||
kd = 40;
|
||||
kb = 0;
|
||||
// REMEBER ^^^^ These constants are backwards
|
||||
// They act as dividers, so to 'increase' a P term, you make the number smaller.
|
||||
// They act as dividers, so to 'increase' a P term, you make the number
|
||||
// smaller.
|
||||
const int32_t itermMax = 40;
|
||||
for (;;) {
|
||||
uint16_t rawTemp = getTipRawTemp(1); // get instantaneous reading
|
||||
if (currentlyActiveTemperatureTarget) {
|
||||
// Compute the PID loop in here
|
||||
//Because our values here are quite large for all measurements (0-16k ~= 33 counts per C)
|
||||
// Because our values here are quite large for all measurements (0-16k ~=
|
||||
// 33 counts per C)
|
||||
// P I & D are divisors, so inverse logic applies (beware)
|
||||
|
||||
int32_t rawTempError = currentlyActiveTemperatureTarget - rawTemp;
|
||||
@@ -865,12 +847,9 @@ void startPIDTask(void const * argument) {
|
||||
|
||||
/*Compute PID Output*/
|
||||
int32_t output = (rawTempError / kp);
|
||||
if (ki)
|
||||
output += integralCount;
|
||||
if (kd)
|
||||
output -= (dInput / kd);
|
||||
if (kb)
|
||||
output -= backoffOverflow / kb;
|
||||
if (ki) output += integralCount;
|
||||
if (kd) output -= (dInput / kd);
|
||||
if (kb) output -= backoffOverflow / kb;
|
||||
|
||||
if (output > 100) {
|
||||
backoffOverflow = output;
|
||||
@@ -888,7 +867,8 @@ void startPIDTask(void const * argument) {
|
||||
}
|
||||
setTipPWM(output);
|
||||
} else {
|
||||
setTipPWM(0); //disable the output driver if the output is set to be off elsewhere
|
||||
setTipPWM(0); // disable the output driver if the output is set to be off
|
||||
// elsewhere
|
||||
integralCount = 0;
|
||||
backoffOverflow = 0;
|
||||
derivativeLastValue = 0;
|
||||
@@ -910,8 +890,7 @@ void startMOVTask(void const * argument) {
|
||||
memset(dataz, 0, MOVFilter * sizeof(int16_t));
|
||||
int16_t tx, ty, tz;
|
||||
int32_t avgx, avgy, avgz;
|
||||
if (systemSettings.sensitivity > 9)
|
||||
systemSettings.sensitivity = 9;
|
||||
if (systemSettings.sensitivity > 9) systemSettings.sensitivity = 9;
|
||||
#if ACCELDEBUG
|
||||
uint32_t max = 0;
|
||||
#endif
|
||||
@@ -950,10 +929,10 @@ void startMOVTask(void const * argument) {
|
||||
|
||||
lcd.printNumber((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)), 5);
|
||||
lcd.refresh();
|
||||
if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET)
|
||||
max = 0;
|
||||
if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET) max = 0;
|
||||
#endif
|
||||
//Only run the actual processing if the sensitivity is set (aka we are enabled)
|
||||
// Only run the actual processing if the sensitivity is set (aka we are
|
||||
// enabled)
|
||||
if (systemSettings.sensitivity) {
|
||||
// calculate averages
|
||||
avgx = avgy = avgz = 0;
|
||||
@@ -966,7 +945,8 @@ void startMOVTask(void const * argument) {
|
||||
avgy /= MOVFilter;
|
||||
avgz /= MOVFilter;
|
||||
|
||||
//So now we have averages, we want to look if these are different by more than the threshold
|
||||
// So now we have averages, we want to look if these are different by more
|
||||
// than the threshold
|
||||
int32_t error = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz));
|
||||
// If error has occured then we update the tick timer
|
||||
if (error > threshold) {
|
||||
@@ -975,7 +955,6 @@ void startMOVTask(void const * argument) {
|
||||
}
|
||||
|
||||
osDelay(100); // Slow down update rate
|
||||
|
||||
}
|
||||
}
|
||||
/* StartRotationTask function */
|
||||
@@ -989,7 +968,8 @@ void startRotationTask(void const * argument) {
|
||||
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
|
||||
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
||||
//^ We hold off enabling these until now to ensure the semaphore is available to be used first
|
||||
//^ We hold off enabling these until now to ensure the semaphore is available
|
||||
// to be used first
|
||||
switch (systemSettings.OrientationMode) {
|
||||
case 0:
|
||||
lcd.setRotation(false);
|
||||
@@ -1000,18 +980,19 @@ void startRotationTask(void const * argument) {
|
||||
case 2:
|
||||
lcd.setRotation(false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
for (;;) {
|
||||
if ( xSemaphoreTake( rotationChangedSemaphore, portMAX_DELAY ) == pdTRUE
|
||||
|| (HAL_GPIO_ReadPin(INT_Orientation_GPIO_Port,
|
||||
INT_Orientation_Pin) == GPIO_PIN_RESET)) {
|
||||
if (xSemaphoreTake(rotationChangedSemaphore, portMAX_DELAY) == pdTRUE ||
|
||||
(HAL_GPIO_ReadPin(INT_Orientation_GPIO_Port, INT_Orientation_Pin) ==
|
||||
GPIO_PIN_RESET)) {
|
||||
// a rotation event has occured
|
||||
bool rotation = accel.getOrientation();
|
||||
if (systemSettings.OrientationMode == 2)
|
||||
lcd.setRotation(rotation); // link the data through
|
||||
}
|
||||
osDelay(300);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1019,16 +1000,16 @@ void startRotationTask(void const * argument) {
|
||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
||||
static signed long xHigherPriorityTaskWoken;
|
||||
if (GPIO_Pin == INT_Orientation_Pin) {
|
||||
xSemaphoreGiveFromISR(rotationChangedSemaphore,
|
||||
&xHigherPriorityTaskWoken);
|
||||
xSemaphoreGiveFromISR(rotationChangedSemaphore, &xHigherPriorityTaskWoken);
|
||||
} else if (GPIO_Pin == INT_Movement_Pin) {
|
||||
// New data is available for reading from the unit
|
||||
//xSemaphoreGiveFromISR(accelDataAvailableSemaphore, &xHigherPriorityTaskWoken);
|
||||
|
||||
// xSemaphoreGiveFromISR(accelDataAvailableSemaphore,
|
||||
// &xHigherPriorityTaskWoken);
|
||||
}
|
||||
}
|
||||
|
||||
#define FLASH_LOGOADDR (0x8000000|0xB800) /*second last page of flash set aside for logo image*/
|
||||
#define FLASH_LOGOADDR \
|
||||
(0x8000000 | 0xB800) /*second last page of flash set aside for logo image*/
|
||||
|
||||
bool showBootLogoIfavailable() {
|
||||
// check if the header is there (0xAA,0x55,0xF0,0x0D)
|
||||
@@ -1042,20 +1023,14 @@ bool showBootLogoIfavailable() {
|
||||
for (uint8_t i = 0; i < 98; i++) {
|
||||
temp8[i * 2] = temp[i] >> 8;
|
||||
temp8[i * 2 + 1] = temp[i] & 0xFF;
|
||||
|
||||
}
|
||||
|
||||
if (temp8[0] != 0xAA)
|
||||
return false;
|
||||
if (temp8[1] != 0x55)
|
||||
return false;
|
||||
if (temp8[2] != 0xF0)
|
||||
return false;
|
||||
if (temp8[3] != 0x0D)
|
||||
return false;
|
||||
if (temp8[0] != 0xAA) return false;
|
||||
if (temp8[1] != 0x55) return false;
|
||||
if (temp8[2] != 0xF0) return false;
|
||||
if (temp8[3] != 0x0D) return false;
|
||||
|
||||
lcd.drawArea(0, 0, 96, 16, (uint8_t *)(temp8 + 4));
|
||||
lcd.refresh();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user