mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
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
|
# Discover the source files to build
|
||||||
SOURCE := $(shell find . -type f -name '*.c')
|
SOURCE := $(shell find . -type f -name '*.c')
|
||||||
SOURCE_CPP := $(shell find . -type f -name '*.cpp')
|
SOURCE_CPP := $(shell find . -type f -name '*.cpp')
|
||||||
@@ -29,12 +35,7 @@ OPTIM=-O2 -finline-small-functions -findirect-inlining -fdiagnostics-color
|
|||||||
|
|
||||||
|
|
||||||
# global defines ---------------------------------------------------------------
|
# global defines ---------------------------------------------------------------
|
||||||
# Enable ROM library
|
GLOBAL_DEFINES += -D STM32F103T8Ux -D STM32F1 -D STM32 -D USE_HAL_DRIVER -D STM32F103xB -D USE_RTOS_SYSTICK -D LANG_$(lang)
|
||||||
#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
|
|
||||||
|
|
||||||
# Enable debug code generation
|
# Enable debug code generation
|
||||||
DEBUG=-g
|
DEBUG=-g
|
||||||
@@ -165,7 +166,7 @@ OBJS_CPP = $(SOURCE_CPP:.cpp=.o)
|
|||||||
OBJS_S = $(S_SRCS:.s=.o)
|
OBJS_S = $(S_SRCS:.s=.o)
|
||||||
|
|
||||||
|
|
||||||
OUTPUT_EXE=TS100
|
|
||||||
OUT_OBJS=$(addprefix $(OUTPUT_DIR)/,$(OBJS))
|
OUT_OBJS=$(addprefix $(OUTPUT_DIR)/,$(OBJS))
|
||||||
OUT_OBJS_CPP=$(addprefix $(OUTPUT_DIR)/,$(OBJS_CPP))
|
OUT_OBJS_CPP=$(addprefix $(OUTPUT_DIR)/,$(OBJS_CPP))
|
||||||
OUT_OBJS_S=$(addprefix $(OUTPUT_DIR)/,$(OBJS_S))
|
OUT_OBJS_S=$(addprefix $(OUTPUT_DIR)/,$(OBJS_S))
|
||||||
@@ -178,9 +179,9 @@ all: $(OUT_HEXFILE).hex
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Create hexfile
|
# Create hexfile
|
||||||
$(OUT_HEXFILE).hex : $(OUT_HEXFILE).elf
|
%.hex : %.elf
|
||||||
$(SIZE) -x $(OUT_HEXFILE).elf
|
$(SIZE) -x $^
|
||||||
$(OBJCOPY) $(OUT_HEXFILE).elf -O ihex $(OUT_HEXFILE).hex
|
$(OBJCOPY) $^ -O ihex $@
|
||||||
|
|
||||||
$(OUT_HEXFILE).elf : $(OUT_OBJS) $(OUT_OBJS_CPP) $(OUT_OBJS_S) Makefile $(LDSCRIPT)
|
$(OUT_HEXFILE).elf : $(OUT_OBJS) $(OUT_OBJS_CPP) $(OUT_OBJS_S) Makefile $(LDSCRIPT)
|
||||||
@test -d $(@D) || mkdir -p $(@D)
|
@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 SettingLeftChar;
|
||||||
extern const char SettingAutoChar;
|
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_ */
|
#endif /* TRANSLATION_H_ */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,9 +6,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "string.h"
|
|
||||||
#include "hardware.h"
|
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
|
#include "hardware.h"
|
||||||
|
#include "string.h"
|
||||||
static void settings_setInputVRange(void);
|
static void settings_setInputVRange(void);
|
||||||
static void settings_displayInputVRange(void);
|
static void settings_displayInputVRange(void);
|
||||||
static void settings_setSleepTemp(void);
|
static void settings_setSleepTemp(void);
|
||||||
@@ -44,27 +44,59 @@ static void settings_setCalibrateVIN(void);
|
|||||||
static void settings_displayCalibrateVIN(void);
|
static void settings_displayCalibrateVIN(void);
|
||||||
|
|
||||||
bool settingsResetRequest = false;
|
bool settingsResetRequest = false;
|
||||||
const menuitem settingsMenu[] = { /*Struct used for all settings options in the settings menu*/
|
const menuitem settingsMenu[] = {
|
||||||
{ (const char*) SettingsLongNames[0], { settings_setInputVRange }, { settings_displayInputVRange } },/*Voltage input*/
|
/*Struct used for all settings options in the settings menu*/
|
||||||
{ (const char*) SettingsLongNames[1], { settings_setSleepTemp }, { settings_displaySleepTemp } }, /*Sleep Temp*/
|
{(const char*)SettingsLongNames[0],
|
||||||
{ (const char*) SettingsLongNames[2], { settings_setSleepTime }, { settings_displaySleepTime } }, /*Sleep Time*/
|
{settings_setInputVRange},
|
||||||
{ (const char*) SettingsLongNames[3], { settings_setShutdownTime }, { settings_displayShutdownTime } }, /*Shutdown Time*/
|
{settings_displayInputVRange}}, /*Voltage input*/
|
||||||
{ (const char*) SettingsLongNames[4], { settings_setSensitivity }, { settings_displaySensitivity } },/* Motion Sensitivity*/
|
{(const char*)SettingsLongNames[1],
|
||||||
{ (const char*) SettingsLongNames[5], { settings_setTempF }, { settings_displayTempF } },/* Motion Sensitivity*/
|
{settings_setSleepTemp},
|
||||||
{ (const char*) SettingsLongNames[6], { settings_setAdvancedIDLEScreens }, { settings_displayAdvancedIDLEScreens } },/* Advanced screens*/
|
{settings_displaySleepTemp}}, /*Sleep Temp*/
|
||||||
{ (const char*) SettingsLongNames[15], { settings_setAdvancedSolderingScreens }, { settings_displayAdvancedSolderingScreens } },/* Advanced screens*/
|
{(const char*)SettingsLongNames[2],
|
||||||
{ (const char*) SettingsLongNames[7], { settings_setDisplayRotation }, { settings_displayDisplayRotation } }, /*Display Rotation*/
|
{settings_setSleepTime},
|
||||||
{ (const char*) SettingsLongNames[8], { settings_setBoostModeEnabled }, { settings_displayBoostModeEnabled } }, /*Enable Boost*/
|
{settings_displaySleepTime}}, /*Sleep Time*/
|
||||||
{ (const char*) SettingsLongNames[9], { settings_setBoostTemp }, { settings_displayBoostTemp } }, /*Boost Temp*/
|
{(const char*)SettingsLongNames[3],
|
||||||
{ (const char*) SettingsLongNames[10], { settings_setAutomaticStartMode }, { settings_displayAutomaticStartMode } },/*Auto start*/
|
{settings_setShutdownTime},
|
||||||
{ (const char*) SettingsLongNames[11], { settings_setCoolingBlinkEnabled }, { settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/
|
{settings_displayShutdownTime}}, /*Shutdown Time*/
|
||||||
{ (const char*) SettingsLongNames[12], { settings_setCalibrate }, { settings_displayCalibrate } }, /*Calibrate tip*/
|
{(const char*)SettingsLongNames[4],
|
||||||
{ (const char*) SettingsLongNames[13], { settings_setResetSettings }, { settings_displayResetSettings } }, /*Resets settings*/
|
{settings_setSensitivity},
|
||||||
{ (const char*) SettingsLongNames[14], { settings_setCalibrateVIN }, { settings_displayCalibrateVIN } }, /*Voltage input cal*/
|
{settings_displaySensitivity}}, /* Motion Sensitivity*/
|
||||||
{ NULL, { NULL }, { NULL } } //end of menu marker. DO NOT REMOVE
|
{(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) {
|
static void printShortDescriptionSingleLine(uint32_t shortDescIndex) {
|
||||||
lcd.setFont(0);
|
lcd.setFont(0);
|
||||||
lcd.setCharCursor(0, 0);
|
lcd.setCharCursor(0, 0);
|
||||||
@@ -83,23 +115,23 @@ static void printShortDescriptionDoubleLine(uint32_t shortDescIndex) {
|
|||||||
* Prints two small lines of short description
|
* Prints two small lines of short description
|
||||||
* and prepares cursor in big font after it.
|
* and prepares cursor in big font after it.
|
||||||
* @param shortDescIndex Index to of short description.
|
* @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,
|
||||||
//print short description (default single line, explicit double line)
|
uint16_t cursorCharPosition) {
|
||||||
if(SettingsShortNameType == SHORT_NAME_DOUBLE_LINE) {
|
// print short description (default single line, explicit double line)
|
||||||
|
if (SettingsShortNameType == SHORT_NAME_DOUBLE_LINE) {
|
||||||
printShortDescriptionDoubleLine(shortDescIndex);
|
printShortDescriptionDoubleLine(shortDescIndex);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
printShortDescriptionSingleLine(shortDescIndex);
|
printShortDescriptionSingleLine(shortDescIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
//prepare cursor for value
|
// prepare cursor for value
|
||||||
lcd.setFont(0);
|
lcd.setFont(0);
|
||||||
lcd.setCharCursor(cursorCharPosition, 0);
|
lcd.setCharCursor(cursorCharPosition, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setInputVRange(void) {
|
static void settings_setInputVRange(void) {
|
||||||
systemSettings.cutoutSetting = (systemSettings.cutoutSetting + 1) % 5;
|
systemSettings.cutoutSetting = (systemSettings.cutoutSetting + 1) % 5;
|
||||||
}
|
}
|
||||||
@@ -110,17 +142,14 @@ static void settings_displayInputVRange(void) {
|
|||||||
if (systemSettings.cutoutSetting) {
|
if (systemSettings.cutoutSetting) {
|
||||||
lcd.drawChar('0' + 2 + systemSettings.cutoutSetting);
|
lcd.drawChar('0' + 2 + systemSettings.cutoutSetting);
|
||||||
lcd.drawChar('S');
|
lcd.drawChar('S');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lcd.print("DC");
|
lcd.print("DC");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setSleepTemp(void) {
|
static void settings_setSleepTemp(void) {
|
||||||
systemSettings.SleepTemp += 10;
|
systemSettings.SleepTemp += 10;
|
||||||
if (systemSettings.SleepTemp > 300)
|
if (systemSettings.SleepTemp > 300) systemSettings.SleepTemp = 50;
|
||||||
systemSettings.SleepTemp = 50;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void settings_displaySleepTemp(void) {
|
static void settings_displaySleepTemp(void) {
|
||||||
@@ -128,13 +157,12 @@ static void settings_displaySleepTemp(void) {
|
|||||||
lcd.printNumber(systemSettings.SleepTemp, 3);
|
lcd.printNumber(systemSettings.SleepTemp, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setSleepTime(void) {
|
static void settings_setSleepTime(void) {
|
||||||
systemSettings.SleepTime++; //Go up 1 minute at a time
|
systemSettings.SleepTime++; // Go up 1 minute at a time
|
||||||
if (systemSettings.SleepTime >= 16) {
|
if (systemSettings.SleepTime >= 16) {
|
||||||
systemSettings.SleepTime = 1; //can't set time over 10 mins
|
systemSettings.SleepTime = 1; // can't set time over 10 mins
|
||||||
}
|
}
|
||||||
//Remember that ^ is the time of no movement
|
// Remember that ^ is the time of no movement
|
||||||
}
|
}
|
||||||
|
|
||||||
static void settings_displaySleepTime(void) {
|
static void settings_displaySleepTime(void) {
|
||||||
@@ -143,18 +171,16 @@ static void settings_displaySleepTime(void) {
|
|||||||
if (systemSettings.SleepTime < 6) {
|
if (systemSettings.SleepTime < 6) {
|
||||||
lcd.printNumber(systemSettings.SleepTime * 10, 2);
|
lcd.printNumber(systemSettings.SleepTime * 10, 2);
|
||||||
lcd.drawChar('S');
|
lcd.drawChar('S');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lcd.printNumber(systemSettings.SleepTime - 5, 2);
|
lcd.printNumber(systemSettings.SleepTime - 5, 2);
|
||||||
lcd.drawChar('M');
|
lcd.drawChar('M');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setShutdownTime(void) {
|
static void settings_setShutdownTime(void) {
|
||||||
systemSettings.ShutdownTime++;
|
systemSettings.ShutdownTime++;
|
||||||
if (systemSettings.ShutdownTime > 60) {
|
if (systemSettings.ShutdownTime > 60) {
|
||||||
systemSettings.ShutdownTime = 0; //wrap to off
|
systemSettings.ShutdownTime = 0; // wrap to off
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +189,6 @@ static void settings_displayShutdownTime(void) {
|
|||||||
lcd.printNumber(systemSettings.ShutdownTime, 2);
|
lcd.printNumber(systemSettings.ShutdownTime, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setTempF(void) {
|
static void settings_setTempF(void) {
|
||||||
systemSettings.temperatureInF = !systemSettings.temperatureInF;
|
systemSettings.temperatureInF = !systemSettings.temperatureInF;
|
||||||
}
|
}
|
||||||
@@ -171,14 +196,9 @@ static void settings_setTempF(void) {
|
|||||||
static void settings_displayTempF(void) {
|
static void settings_displayTempF(void) {
|
||||||
printShortDescription(5, 7);
|
printShortDescription(5, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((systemSettings.temperatureInF) ? 'F' : 'C');
|
||||||
(systemSettings.temperatureInF)
|
|
||||||
? 'F'
|
|
||||||
: 'C'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setSensitivity(void) {
|
static void settings_setSensitivity(void) {
|
||||||
systemSettings.sensitivity++;
|
systemSettings.sensitivity++;
|
||||||
systemSettings.sensitivity = systemSettings.sensitivity % 10;
|
systemSettings.sensitivity = systemSettings.sensitivity % 10;
|
||||||
@@ -189,7 +209,6 @@ static void settings_displaySensitivity(void) {
|
|||||||
lcd.printNumber(systemSettings.sensitivity, 1);
|
lcd.printNumber(systemSettings.sensitivity, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setAdvancedSolderingScreens(void) {
|
static void settings_setAdvancedSolderingScreens(void) {
|
||||||
systemSettings.detailedSoldering = !systemSettings.detailedSoldering;
|
systemSettings.detailedSoldering = !systemSettings.detailedSoldering;
|
||||||
}
|
}
|
||||||
@@ -197,14 +216,10 @@ static void settings_setAdvancedSolderingScreens(void) {
|
|||||||
static void settings_displayAdvancedSolderingScreens(void) {
|
static void settings_displayAdvancedSolderingScreens(void) {
|
||||||
printShortDescription(15, 7);
|
printShortDescription(15, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((systemSettings.detailedSoldering) ? SettingTrueChar
|
||||||
(systemSettings.detailedSoldering)
|
: SettingFalseChar);
|
||||||
? SettingTrueChar
|
|
||||||
: SettingFalseChar
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setAdvancedIDLEScreens(void) {
|
static void settings_setAdvancedIDLEScreens(void) {
|
||||||
systemSettings.detailedIDLE = !systemSettings.detailedIDLE;
|
systemSettings.detailedIDLE = !systemSettings.detailedIDLE;
|
||||||
}
|
}
|
||||||
@@ -212,14 +227,10 @@ static void settings_setAdvancedIDLEScreens(void) {
|
|||||||
static void settings_displayAdvancedIDLEScreens(void) {
|
static void settings_displayAdvancedIDLEScreens(void) {
|
||||||
printShortDescription(6, 7);
|
printShortDescription(6, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((systemSettings.detailedIDLE) ? SettingTrueChar
|
||||||
(systemSettings.detailedIDLE)
|
: SettingFalseChar);
|
||||||
? SettingTrueChar
|
|
||||||
: SettingFalseChar
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setDisplayRotation(void) {
|
static void settings_setDisplayRotation(void) {
|
||||||
systemSettings.OrientationMode++;
|
systemSettings.OrientationMode++;
|
||||||
systemSettings.OrientationMode = systemSettings.OrientationMode % 3;
|
systemSettings.OrientationMode = systemSettings.OrientationMode % 3;
|
||||||
@@ -238,10 +249,12 @@ static void settings_displayDisplayRotation(void) {
|
|||||||
case 2:
|
case 2:
|
||||||
lcd.drawChar(SettingAutoChar);
|
lcd.drawChar(SettingAutoChar);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
lcd.drawChar(SettingRightChar);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setBoostModeEnabled(void) {
|
static void settings_setBoostModeEnabled(void) {
|
||||||
systemSettings.boostModeEnabled = !systemSettings.boostModeEnabled;
|
systemSettings.boostModeEnabled = !systemSettings.boostModeEnabled;
|
||||||
}
|
}
|
||||||
@@ -249,24 +262,19 @@ static void settings_setBoostModeEnabled(void) {
|
|||||||
static void settings_displayBoostModeEnabled(void) {
|
static void settings_displayBoostModeEnabled(void) {
|
||||||
printShortDescription(8, 7);
|
printShortDescription(8, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((systemSettings.boostModeEnabled) ? SettingTrueChar
|
||||||
(systemSettings.boostModeEnabled)
|
: SettingFalseChar);
|
||||||
? SettingTrueChar
|
|
||||||
: SettingFalseChar
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setBoostTemp(void) {
|
static void settings_setBoostTemp(void) {
|
||||||
systemSettings.BoostTemp += 10; //Go up 10 at a time
|
systemSettings.BoostTemp += 10; // Go up 10 at a time
|
||||||
if (systemSettings.temperatureInF) {
|
if (systemSettings.temperatureInF) {
|
||||||
if (systemSettings.BoostTemp > 850) {
|
if (systemSettings.BoostTemp > 850) {
|
||||||
systemSettings.BoostTemp = 480; //loop back at 250
|
systemSettings.BoostTemp = 480; // loop back at 250
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (systemSettings.BoostTemp > 450) {
|
if (systemSettings.BoostTemp > 450) {
|
||||||
systemSettings.BoostTemp = 250; //loop back at 250
|
systemSettings.BoostTemp = 250; // loop back at 250
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,7 +284,6 @@ static void settings_displayBoostTemp(void) {
|
|||||||
lcd.printNumber(systemSettings.BoostTemp, 3);
|
lcd.printNumber(systemSettings.BoostTemp, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setAutomaticStartMode(void) {
|
static void settings_setAutomaticStartMode(void) {
|
||||||
systemSettings.autoStartMode++;
|
systemSettings.autoStartMode++;
|
||||||
systemSettings.autoStartMode %= 2;
|
systemSettings.autoStartMode %= 2;
|
||||||
@@ -285,14 +292,10 @@ static void settings_setAutomaticStartMode(void) {
|
|||||||
static void settings_displayAutomaticStartMode(void) {
|
static void settings_displayAutomaticStartMode(void) {
|
||||||
printShortDescription(10, 7);
|
printShortDescription(10, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((systemSettings.autoStartMode) ? SettingTrueChar
|
||||||
(systemSettings.autoStartMode)
|
: SettingFalseChar);
|
||||||
? SettingTrueChar
|
|
||||||
: SettingFalseChar
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setCoolingBlinkEnabled(void) {
|
static void settings_setCoolingBlinkEnabled(void) {
|
||||||
systemSettings.coolingTempBlink = !systemSettings.coolingTempBlink;
|
systemSettings.coolingTempBlink = !systemSettings.coolingTempBlink;
|
||||||
}
|
}
|
||||||
@@ -300,14 +303,10 @@ static void settings_setCoolingBlinkEnabled(void) {
|
|||||||
static void settings_displayCoolingBlinkEnabled(void) {
|
static void settings_displayCoolingBlinkEnabled(void) {
|
||||||
printShortDescription(11, 7);
|
printShortDescription(11, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((systemSettings.coolingTempBlink) ? SettingTrueChar
|
||||||
(systemSettings.coolingTempBlink)
|
: SettingFalseChar);
|
||||||
? SettingTrueChar
|
|
||||||
: SettingFalseChar
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void settings_setResetSettings(void) {
|
static void settings_setResetSettings(void) {
|
||||||
settingsResetRequest = !settingsResetRequest;
|
settingsResetRequest = !settingsResetRequest;
|
||||||
}
|
}
|
||||||
@@ -315,16 +314,12 @@ static void settings_setResetSettings(void) {
|
|||||||
static void settings_displayResetSettings(void) {
|
static void settings_displayResetSettings(void) {
|
||||||
printShortDescription(13, 7);
|
printShortDescription(13, 7);
|
||||||
|
|
||||||
lcd.drawChar(
|
lcd.drawChar((settingsResetRequest) ? SettingTrueChar : SettingFalseChar);
|
||||||
(settingsResetRequest)
|
|
||||||
? SettingTrueChar
|
|
||||||
: SettingFalseChar
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void settings_setCalibrate(void) {
|
static void settings_setCalibrate(void) {
|
||||||
//Calibrate the offset
|
// Calibrate the offset
|
||||||
//We split off here to confirm with the user
|
// We split off here to confirm with the user
|
||||||
uint8_t maxOffset = strlen(SettingsCalibrationWarning) + 5;
|
uint8_t maxOffset = strlen(SettingsCalibrationWarning) + 5;
|
||||||
uint32_t descriptionStart = HAL_GetTick();
|
uint32_t descriptionStart = HAL_GetTick();
|
||||||
|
|
||||||
@@ -333,7 +328,8 @@ static void settings_setCalibrate(void) {
|
|||||||
lcd.setCursor(0, 0);
|
lcd.setCursor(0, 0);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int16_t descriptionOffset = (((HAL_GetTick() - descriptionStart) / 150) % maxOffset);
|
int16_t descriptionOffset =
|
||||||
|
(((HAL_GetTick() - descriptionStart) / 150) % maxOffset);
|
||||||
|
|
||||||
lcd.setCursor(12 * (7 - descriptionOffset), 0);
|
lcd.setCursor(12 * (7 - descriptionOffset), 0);
|
||||||
lcd.print(SettingsCalibrationWarning);
|
lcd.print(SettingsCalibrationWarning);
|
||||||
@@ -341,27 +337,29 @@ static void settings_setCalibrate(void) {
|
|||||||
ButtonState buttons = getButtonState();
|
ButtonState buttons = getButtonState();
|
||||||
switch (buttons) {
|
switch (buttons) {
|
||||||
case BUTTON_F_SHORT: {
|
case BUTTON_F_SHORT: {
|
||||||
//User confirmed
|
// User confirmed
|
||||||
//So we now perform the actual calculation
|
// So we now perform the actual calculation
|
||||||
lcd.clearScreen();
|
lcd.clearScreen();
|
||||||
lcd.setCursor(0, 0);
|
lcd.setCursor(0, 0);
|
||||||
lcd.print(".....");
|
lcd.print(".....");
|
||||||
lcd.refresh();
|
lcd.refresh();
|
||||||
|
|
||||||
setCalibrationOffset(0); //turn off the current offset
|
setCalibrationOffset(0); // turn off the current offset
|
||||||
for (uint8_t i = 0; i < 20; i++) {
|
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(20);
|
||||||
}
|
}
|
||||||
osDelay(100);
|
osDelay(100);
|
||||||
|
|
||||||
uint16_t rawTempC = tipMeasurementToC(getTipRawTemp(0));
|
uint16_t rawTempC = tipMeasurementToC(getTipRawTemp(0));
|
||||||
//We now measure the current reported tip temperature
|
// We now measure the current reported tip temperature
|
||||||
uint16_t handleTempC = getHandleTemperature() / 10;
|
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;
|
rawTempC = rawTempC - handleTempC;
|
||||||
systemSettings.CalibrationOffset = rawTempC;
|
systemSettings.CalibrationOffset = rawTempC;
|
||||||
setCalibrationOffset(rawTempC); //store the error
|
setCalibrationOffset(rawTempC); // store the error
|
||||||
osDelay(100);
|
osDelay(100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -374,6 +372,8 @@ static void settings_setCalibrate(void) {
|
|||||||
|
|
||||||
case BUTTON_NONE:
|
case BUTTON_NONE:
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd.refresh();
|
lcd.refresh();
|
||||||
@@ -381,13 +381,10 @@ static void settings_setCalibrate(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void settings_displayCalibrate(void) {
|
static void settings_displayCalibrate(void) { printShortDescription(12, 5); }
|
||||||
printShortDescription(12, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void settings_setCalibrateVIN(void) {
|
static void settings_setCalibrateVIN(void) {
|
||||||
//Jump to the voltage calibration subscreen
|
// Jump to the voltage calibration subscreen
|
||||||
lcd.setFont(0);
|
lcd.setFont(0);
|
||||||
lcd.clearScreen();
|
lcd.clearScreen();
|
||||||
lcd.setCursor(0, 0);
|
lcd.setCursor(0, 0);
|
||||||
@@ -416,22 +413,20 @@ static void settings_setCalibrateVIN(void) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case BUTTON_NONE:
|
case BUTTON_NONE:
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd.refresh();
|
lcd.refresh();
|
||||||
osDelay(50);
|
osDelay(50);
|
||||||
|
|
||||||
//Cap to sensible values
|
// Cap to sensible values
|
||||||
if (systemSettings.voltageDiv < 90) {
|
if (systemSettings.voltageDiv < 90) {
|
||||||
systemSettings.voltageDiv = 90;
|
systemSettings.voltageDiv = 90;
|
||||||
}
|
} else if (systemSettings.voltageDiv > 130) {
|
||||||
else if (systemSettings.voltageDiv > 130) {
|
|
||||||
systemSettings.voltageDiv = 130;
|
systemSettings.voltageDiv = 130;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void settings_displayCalibrateVIN(void) {
|
static void settings_displayCalibrateVIN(void) { printShortDescription(14, 5); }
|
||||||
printShortDescription(14, 5);
|
|
||||||
}
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user