Merge branch 'master' into powerPulses
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<project>
|
||||
<configuration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.980996604" name="Release">
|
||||
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-348041022799175818" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
</extension>
|
||||
</configuration>
|
||||
</project>
|
||||
@@ -11,7 +11,7 @@
|
||||
#define SETTINGS_H_
|
||||
#include <stdint.h>
|
||||
#include "stm32f1xx_hal.h"
|
||||
#define SETTINGSVERSION ( 0x1A )
|
||||
#define SETTINGSVERSION ( 0x1B )
|
||||
/*Change this if you change the struct below to prevent people getting \
|
||||
out of sync*/
|
||||
|
||||
@@ -53,7 +53,7 @@ typedef struct {
|
||||
extern volatile systemSettingsType systemSettings;
|
||||
|
||||
void saveSettings();
|
||||
void restoreSettings();
|
||||
bool restoreSettings();
|
||||
uint8_t lookupVoltageLevel(uint8_t level);
|
||||
void resetSettings();
|
||||
bool showBootLogoIfavailable();
|
||||
|
||||
@@ -1,72 +1,73 @@
|
||||
/*
|
||||
* Translation.h
|
||||
*
|
||||
* Created on: 31Aug.,2017
|
||||
* Author: Ben V. Brown
|
||||
*/
|
||||
|
||||
#ifndef TRANSLATION_H_
|
||||
#define TRANSLATION_H_
|
||||
#include "stm32f1xx_hal.h"
|
||||
enum ShortNameType {
|
||||
SHORT_NAME_SINGLE_LINE = 1, SHORT_NAME_DOUBLE_LINE = 2,
|
||||
};
|
||||
extern const uint8_t USER_FONT_12[];
|
||||
extern const uint8_t USER_FONT_6x8[];
|
||||
/*
|
||||
* When SettingsShortNameType is SHORT_NAME_SINGLE_LINE
|
||||
* use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
|
||||
*/
|
||||
extern const enum ShortNameType SettingsShortNameType;
|
||||
extern const char* SettingsShortNames[21][2];
|
||||
extern const char* SettingsDescriptions[21];
|
||||
extern const char* SettingsMenuEntries[4];
|
||||
|
||||
extern const char* SettingsCalibrationDone;
|
||||
extern const char* SettingsCalibrationWarning;
|
||||
extern const char* SettingsResetWarning;
|
||||
extern const char* UVLOWarningString;
|
||||
extern const char* UndervoltageString;
|
||||
extern const char* InputVoltageString;
|
||||
extern const char* WarningTipTempString;
|
||||
extern const char* BadTipString;
|
||||
|
||||
extern const char* SleepingSimpleString;
|
||||
extern const char* SleepingAdvancedString;
|
||||
extern const char* WarningSimpleString;
|
||||
extern const char* WarningAdvancedString;
|
||||
extern const char* SleepingTipAdvancedString;
|
||||
extern const char* IdleTipString;
|
||||
extern const char* IdleSetString;
|
||||
extern const char* TipDisconnectedString;
|
||||
extern const char* SolderingAdvancedPowerPrompt;
|
||||
extern const char* OffString;
|
||||
extern const char* ResetOKMessage;
|
||||
extern const char* YourGainMessage;
|
||||
|
||||
extern const char* SettingTrueChar;
|
||||
extern const char* SettingFalseChar;
|
||||
extern const char* SettingRightChar;
|
||||
extern const char* SettingLeftChar;
|
||||
extern const char* SettingAutoChar;
|
||||
|
||||
extern const char* SettingFastChar;
|
||||
extern const char* SettingSlowChar;
|
||||
extern const char* TipModelStrings[];
|
||||
extern const char* DebugMenu[];
|
||||
extern const char* SymbolPlus;
|
||||
extern const char* SymbolMinus;
|
||||
extern const char* SymbolSpace;
|
||||
extern const char* SymbolDot;
|
||||
extern const char* SymbolDegC;
|
||||
extern const char* SymbolDegF;
|
||||
extern const char* SymbolMinutes;
|
||||
extern const char* SymbolSeconds;
|
||||
extern const char* SymbolWatts;
|
||||
extern const char* SymbolVolts;
|
||||
extern const char* SymbolDC;
|
||||
extern const char* SymbolCellCount;
|
||||
extern const char* SymbolVersionNumber;
|
||||
|
||||
extern const char* DebugMenu[];
|
||||
#endif /* TRANSLATION_H_ */
|
||||
/*
|
||||
* Translation.h
|
||||
*
|
||||
* Created on: 31Aug.,2017
|
||||
* Author: Ben V. Brown
|
||||
*/
|
||||
|
||||
#ifndef TRANSLATION_H_
|
||||
#define TRANSLATION_H_
|
||||
#include "stm32f1xx_hal.h"
|
||||
enum ShortNameType {
|
||||
SHORT_NAME_SINGLE_LINE = 1, SHORT_NAME_DOUBLE_LINE = 2,
|
||||
};
|
||||
extern const uint8_t USER_FONT_12[];
|
||||
extern const uint8_t USER_FONT_6x8[];
|
||||
/*
|
||||
* When SettingsShortNameType is SHORT_NAME_SINGLE_LINE
|
||||
* use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
|
||||
*/
|
||||
extern const enum ShortNameType SettingsShortNameType;
|
||||
extern const char* SettingsShortNames[21][2];
|
||||
extern const char* SettingsDescriptions[21];
|
||||
extern const char* SettingsMenuEntries[4];
|
||||
|
||||
extern const char* SettingsCalibrationDone;
|
||||
extern const char* SettingsCalibrationWarning;
|
||||
extern const char* SettingsResetWarning;
|
||||
extern const char* UVLOWarningString;
|
||||
extern const char* UndervoltageString;
|
||||
extern const char* InputVoltageString;
|
||||
extern const char* WarningTipTempString;
|
||||
extern const char* BadTipString;
|
||||
|
||||
extern const char* SleepingSimpleString;
|
||||
extern const char* SleepingAdvancedString;
|
||||
extern const char* WarningSimpleString;
|
||||
extern const char* WarningAdvancedString;
|
||||
extern const char* SleepingTipAdvancedString;
|
||||
extern const char* IdleTipString;
|
||||
extern const char* IdleSetString;
|
||||
extern const char* TipDisconnectedString;
|
||||
extern const char* SolderingAdvancedPowerPrompt;
|
||||
extern const char* OffString;
|
||||
extern const char* ResetOKMessage;
|
||||
extern const char* YourGainMessage;
|
||||
extern const char* SettingsResetMessage;
|
||||
|
||||
extern const char* SettingTrueChar;
|
||||
extern const char* SettingFalseChar;
|
||||
extern const char* SettingRightChar;
|
||||
extern const char* SettingLeftChar;
|
||||
extern const char* SettingAutoChar;
|
||||
|
||||
extern const char* SettingFastChar;
|
||||
extern const char* SettingSlowChar;
|
||||
extern const char* TipModelStrings[];
|
||||
extern const char* DebugMenu[];
|
||||
extern const char* SymbolPlus;
|
||||
extern const char* SymbolMinus;
|
||||
extern const char* SymbolSpace;
|
||||
extern const char* SymbolDot;
|
||||
extern const char* SymbolDegC;
|
||||
extern const char* SymbolDegF;
|
||||
extern const char* SymbolMinutes;
|
||||
extern const char* SymbolSeconds;
|
||||
extern const char* SymbolWatts;
|
||||
extern const char* SymbolVolts;
|
||||
extern const char* SymbolDC;
|
||||
extern const char* SymbolCellCount;
|
||||
extern const char* SymbolVersionNumber;
|
||||
|
||||
extern const char* DebugMenu[];
|
||||
#endif /* TRANSLATION_H_ */
|
||||
|
||||
@@ -6,19 +6,20 @@
|
||||
#include "Setup.h"
|
||||
extern uint8_t PCBVersion;
|
||||
extern uint32_t currentTempTargetDegC;
|
||||
extern bool settingsWereReset;
|
||||
enum ButtonState {
|
||||
BUTTON_NONE = 0, /* No buttons pressed / < filter time*/
|
||||
BUTTON_F_SHORT = 1, /* User has pressed the front button*/
|
||||
BUTTON_B_SHORT = 2, /* User has pressed the back button*/
|
||||
BUTTON_F_LONG = 4, /* User is holding the front button*/
|
||||
BUTTON_B_LONG = 8, /* User is holding the back button*/
|
||||
BUTTON_BOTH = 16, /* User has pressed both buttons*/
|
||||
BUTTON_NONE = 0, /* No buttons pressed / < filter time*/
|
||||
BUTTON_F_SHORT = 1, /* User has pressed the front button*/
|
||||
BUTTON_B_SHORT = 2, /* User has pressed the back button*/
|
||||
BUTTON_F_LONG = 4, /* User is holding the front button*/
|
||||
BUTTON_B_LONG = 8, /* User is holding the back button*/
|
||||
BUTTON_BOTH = 16, /* User has pressed both buttons*/
|
||||
|
||||
/*
|
||||
* Note:
|
||||
* Pressed means press + release, we trigger on a full \__/ pulse
|
||||
* holding means it has gone low, and been low for longer than filter time
|
||||
*/
|
||||
/*
|
||||
* Note:
|
||||
* Pressed means press + release, we trigger on a full \__/ pulse
|
||||
* holding means it has gone low, and been low for longer than filter time
|
||||
*/
|
||||
};
|
||||
|
||||
ButtonState getButtonState();
|
||||
@@ -37,7 +38,7 @@ void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
|
||||
void vApplicationStackOverflowHook(xTaskHandle *pxTask,
|
||||
signed portCHAR *pcTaskName);
|
||||
signed portCHAR *pcTaskName);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
|
||||
OLED::print(SolderingAdvancedPowerPrompt); // Power:
|
||||
OLED::printNumber(x10WattHistory.average() / 10, 2);
|
||||
OLED::print(SymbolDot);
|
||||
OLED::printNumber(x10WattHistory.average()% 10, 1);
|
||||
OLED::printNumber(x10WattHistory.average() % 10, 1);
|
||||
OLED::print(SymbolWatts);
|
||||
|
||||
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
||||
@@ -702,6 +702,17 @@ void startGUITask(void const *argument __unused) {
|
||||
ticks = xTaskGetTickCount(); // make timeout now so we will exit
|
||||
GUIDelay();
|
||||
}
|
||||
|
||||
if (settingsWereReset) {
|
||||
//Display alert settings were reset
|
||||
OLED::setFont(1);
|
||||
OLED::setCursor(0, 0);
|
||||
OLED::print(SettingsResetMessage);
|
||||
OLED::refresh();
|
||||
waitForButtonPressOrTimeout(1000);
|
||||
|
||||
}
|
||||
|
||||
if (systemSettings.autoStartMode) {
|
||||
// jump directly to the autostart mode
|
||||
if (systemSettings.autoStartMode == 1)
|
||||
@@ -756,7 +767,6 @@ void startGUITask(void const *argument __unused) {
|
||||
break;
|
||||
case BUTTON_B_SHORT:
|
||||
enterSettingsMenu(); // enter the settings menu
|
||||
saveSettings();
|
||||
buttonLockout = true;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -155,7 +155,17 @@ void OLED::setFont(uint8_t fontNumber) {
|
||||
fontWidth = 12;
|
||||
}
|
||||
}
|
||||
|
||||
inline void stripLeaderZeros(char *buffer) {
|
||||
//Removing the leading zero's by swapping them to SymbolSpace
|
||||
// Stop 1 short so that we dont blank entire number if its zero
|
||||
for (int i = 0; i < 6; i++) {
|
||||
if (buffer[i] == 2) {
|
||||
buffer[i] = SymbolSpace[0];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// maximum places is 5
|
||||
void OLED::printNumber(uint16_t number, uint8_t places) {
|
||||
char buffer[7] = { 0 };
|
||||
@@ -185,14 +195,7 @@ void OLED::printNumber(uint16_t number, uint8_t places) {
|
||||
}
|
||||
|
||||
buffer[0] = 2 + number % 10;
|
||||
//Removing the leading zero's by swapping them to SymbolSpace
|
||||
for (int i = 0; i < 7; i++) {
|
||||
if (buffer[i] == 2) {
|
||||
buffer[i] = SymbolSpace[0];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
stripLeaderZeros(buffer);
|
||||
print(buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,47 +17,49 @@
|
||||
volatile systemSettingsType systemSettings;
|
||||
|
||||
void saveSettings() {
|
||||
// First we erase the flash
|
||||
FLASH_EraseInitTypeDef pEraseInit;
|
||||
pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES;
|
||||
pEraseInit.Banks = FLASH_BANK_1;
|
||||
pEraseInit.NbPages = 1;
|
||||
pEraseInit.PageAddress = FLASH_ADDR;
|
||||
uint32_t failingAddress = 0;
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR |
|
||||
FLASH_FLAG_BSY);
|
||||
HAL_FLASH_Unlock();
|
||||
HAL_Delay(10);
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
HAL_FLASHEx_Erase(&pEraseInit, &failingAddress);
|
||||
//^ Erase the page of flash (1024 bytes on this stm32)
|
||||
// erased the chunk
|
||||
// now we program it
|
||||
uint16_t *data = (uint16_t *)&systemSettings;
|
||||
HAL_FLASH_Unlock();
|
||||
// First we erase the flash
|
||||
FLASH_EraseInitTypeDef pEraseInit;
|
||||
pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES;
|
||||
pEraseInit.Banks = FLASH_BANK_1;
|
||||
pEraseInit.NbPages = 1;
|
||||
pEraseInit.PageAddress = FLASH_ADDR;
|
||||
uint32_t failingAddress = 0;
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
__HAL_FLASH_CLEAR_FLAG(
|
||||
FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR | FLASH_FLAG_BSY);
|
||||
HAL_FLASH_Unlock();
|
||||
HAL_Delay(10);
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
HAL_FLASHEx_Erase(&pEraseInit, &failingAddress);
|
||||
//^ Erase the page of flash (1024 bytes on this stm32)
|
||||
// erased the chunk
|
||||
// now we program it
|
||||
uint16_t *data = (uint16_t*) &systemSettings;
|
||||
HAL_FLASH_Unlock();
|
||||
|
||||
for (uint8_t i = 0; i < (sizeof(systemSettingsType) / 2); i++) {
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, FLASH_ADDR + (i * 2),
|
||||
data[i]);
|
||||
}
|
||||
HAL_FLASH_Lock();
|
||||
for (uint8_t i = 0; i < (sizeof(systemSettingsType) / 2); i++) {
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, FLASH_ADDR + (i * 2),
|
||||
data[i]);
|
||||
}
|
||||
HAL_FLASH_Lock();
|
||||
}
|
||||
|
||||
void restoreSettings() {
|
||||
// We read the flash
|
||||
uint16_t *data = (uint16_t *)&systemSettings;
|
||||
for (uint8_t i = 0; i < (sizeof(systemSettingsType) / 2); i++) {
|
||||
data[i] = *((uint16_t *)(FLASH_ADDR + (i * 2)));
|
||||
}
|
||||
bool restoreSettings() {
|
||||
// We read the flash
|
||||
uint16_t *data = (uint16_t*) &systemSettings;
|
||||
for (uint8_t i = 0; i < (sizeof(systemSettingsType) / 2); i++) {
|
||||
data[i] = *((uint16_t*) (FLASH_ADDR + (i * 2)));
|
||||
}
|
||||
|
||||
// if the version is correct were done
|
||||
// if not we reset and save
|
||||
if (systemSettings.version != SETTINGSVERSION) {
|
||||
// probably not setup
|
||||
resetSettings();
|
||||
}
|
||||
// if the version is correct were done
|
||||
// if not we reset and save
|
||||
if (systemSettings.version != SETTINGSVERSION) {
|
||||
// probably not setup
|
||||
resetSettings();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Lookup function for cutoff setting -> X10 voltage
|
||||
/*
|
||||
@@ -68,52 +70,47 @@ void restoreSettings() {
|
||||
* 4=6S
|
||||
*/
|
||||
uint8_t lookupVoltageLevel(uint8_t level) {
|
||||
if (level == 0)
|
||||
return 90; // 9V since iron does not function effectively below this
|
||||
else
|
||||
return (level * 33) + (33 * 2);
|
||||
if (level == 0)
|
||||
return 90; // 9V since iron does not function effectively below this
|
||||
else
|
||||
return (level * 33) + (33 * 2);
|
||||
}
|
||||
void resetSettings() {
|
||||
memset((void *)&systemSettings, 0, sizeof(systemSettingsType));
|
||||
systemSettings.SleepTemp =
|
||||
150; // Temperature the iron sleeps at - default 150.0 C
|
||||
systemSettings.SleepTime = 6; // How many seconds/minutes we wait until going
|
||||
// to sleep - default 1 min
|
||||
systemSettings.SolderingTemp = 320; // Default soldering temp is 320.0 C
|
||||
systemSettings.cutoutSetting = 0; // default to no cut-off voltage (or 18W for TS80)
|
||||
systemSettings.version =
|
||||
SETTINGSVERSION; // Store the version number to allow for easier upgrades
|
||||
systemSettings.detailedSoldering = 0; // Detailed soldering screen
|
||||
systemSettings.detailedIDLE =
|
||||
0; // Detailed idle screen (off for first time users)
|
||||
systemSettings.OrientationMode = 2; // Default to automatic
|
||||
systemSettings.sensitivity = 7; // Default high sensitivity
|
||||
memset((void*) &systemSettings, 0, sizeof(systemSettingsType));
|
||||
systemSettings.SleepTemp = 150; // Temperature the iron sleeps at - default 150.0 C
|
||||
systemSettings.SleepTime = 6; // How many seconds/minutes we wait until going
|
||||
// to sleep - default 1 min
|
||||
systemSettings.SolderingTemp = 320; // Default soldering temp is 320.0 C
|
||||
systemSettings.cutoutSetting = 0; // default to no cut-off voltage (or 18W for TS80)
|
||||
systemSettings.version =
|
||||
SETTINGSVERSION; // Store the version number to allow for easier upgrades
|
||||
systemSettings.detailedSoldering = 0; // Detailed soldering screen
|
||||
systemSettings.detailedIDLE = 0; // Detailed idle screen (off for first time users)
|
||||
systemSettings.OrientationMode = 2; // Default to automatic
|
||||
systemSettings.sensitivity = 7; // Default high sensitivity
|
||||
#ifdef MODEL_TS80
|
||||
systemSettings.voltageDiv = 780; // Default divider from schematic
|
||||
systemSettings.voltageDiv = 780; // Default divider from schematic
|
||||
|
||||
#else
|
||||
systemSettings.voltageDiv = 467; // Default divider from schematic
|
||||
#endif
|
||||
systemSettings.ShutdownTime =
|
||||
10; // How many minutes until the unit turns itself off
|
||||
systemSettings.boostModeEnabled =
|
||||
1; // Default to having boost mode on as most people prefer it
|
||||
systemSettings.BoostTemp = 420; // default to 400C
|
||||
systemSettings.autoStartMode = 0; // Auto start off for safety
|
||||
systemSettings.coolingTempBlink =
|
||||
0; // Blink the temperature on the cooling screen when its > 50C
|
||||
systemSettings.temperatureInF = 0; // default to 0
|
||||
systemSettings.descriptionScrollSpeed = 0; // default to slow
|
||||
systemSettings.ShutdownTime = 10; // How many minutes until the unit turns itself off
|
||||
systemSettings.boostModeEnabled = 1; // Default to having boost mode on as most people prefer it
|
||||
systemSettings.BoostTemp = 420; // default to 400C
|
||||
systemSettings.autoStartMode = 0; // Auto start off for safety
|
||||
systemSettings.coolingTempBlink = 0; // Blink the temperature on the cooling screen when its > 50C
|
||||
systemSettings.temperatureInF = 0; // default to 0
|
||||
systemSettings.descriptionScrollSpeed = 0; // default to slow
|
||||
|
||||
#ifdef MODEL_TS100
|
||||
systemSettings.CalibrationOffset = 850; // the adc offset in uV
|
||||
systemSettings.CalibrationOffset = 900; // the adc offset in uV
|
||||
systemSettings.pidPowerLimit=70; // Sets the max pwm power limit
|
||||
|
||||
#endif
|
||||
#ifdef MODEL_TS80
|
||||
systemSettings.pidPowerLimit=24; // Sets the max pwm power limit
|
||||
systemSettings.pidPowerLimit = 24; // Sets the max pwm power limit
|
||||
|
||||
systemSettings.CalibrationOffset = 300; // the adc offset in uV
|
||||
systemSettings.CalibrationOffset = 900; // the adc offset in uV
|
||||
#endif
|
||||
saveSettings(); // Save defaults
|
||||
saveSettings(); // Save defaults
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@
|
||||
#include "TipThermoModel.h"
|
||||
#include "string.h"
|
||||
extern uint32_t lastButtonTime;
|
||||
void gui_Menu(const menuitem* menu);
|
||||
void gui_Menu(const menuitem *menu);
|
||||
#ifdef MODEL_TS100
|
||||
static void settings_setInputVRange(void);
|
||||
static void settings_displayInputVRange(void);
|
||||
@@ -105,9 +105,8 @@ const menuitem rootSettingsMenu[] {
|
||||
* Exit
|
||||
*/
|
||||
#ifdef MODEL_TS100
|
||||
{ (const char*)SettingsDescriptions[0],
|
||||
{ settings_setInputVRange},
|
||||
{ settings_displayInputVRange}}, /*Voltage input*/
|
||||
{ (const char*) SettingsDescriptions[0], { settings_setInputVRange }, {
|
||||
settings_displayInputVRange } }, /*Voltage input*/
|
||||
#else
|
||||
{ (const char*) SettingsDescriptions[20], { settings_setInputPRange }, {
|
||||
settings_displayInputPRange } }, /*Voltage input*/
|
||||
@@ -231,7 +230,7 @@ static void printShortDescription(uint32_t shortDescIndex,
|
||||
OLED::setCharCursor(cursorCharPosition, 0);
|
||||
}
|
||||
|
||||
static int userConfirmation(const char* message) {
|
||||
static int userConfirmation(const char *message) {
|
||||
uint16_t messageWidth = FONT_12_WIDTH * (strlen(message) + 7);
|
||||
uint32_t messageStart = xTaskGetTickCount();
|
||||
|
||||
@@ -697,7 +696,7 @@ static void settings_enterAdvancedMenu(void) {
|
||||
gui_Menu(advancedMenu);
|
||||
}
|
||||
|
||||
void gui_Menu(const menuitem* menu) {
|
||||
void gui_Menu(const menuitem *menu) {
|
||||
// Draw the settings menu and provide iteration support etc
|
||||
uint8_t currentScreen = 0;
|
||||
uint32_t autoRepeatTimer = 0;
|
||||
@@ -731,11 +730,8 @@ void gui_Menu(const menuitem* menu) {
|
||||
/ (systemSettings.descriptionScrollSpeed == 1 ?
|
||||
1 : 2));
|
||||
descriptionOffset %= descriptionWidth; // Roll around at the end
|
||||
|
||||
if (lastOffset != descriptionOffset) {
|
||||
OLED::clearScreen();
|
||||
|
||||
//^ Rolling offset based on time
|
||||
OLED::setCursor((OLED_WIDTH - descriptionOffset), 0);
|
||||
OLED::print(menu[currentScreen].description);
|
||||
lastOffset = descriptionOffset;
|
||||
@@ -807,6 +803,12 @@ void gui_Menu(const menuitem* menu) {
|
||||
osDelay(40);
|
||||
lcdRefresh = false;
|
||||
}
|
||||
if ((xTaskGetTickCount() - lastButtonTime) > (1000 * 30)) {
|
||||
// If user has not pressed any buttons in 30 seconds, exit back a menu layer
|
||||
// This will trickle the user back to the main screen eventually
|
||||
earlyExit = true;
|
||||
descriptionStart = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ uint8_t PCBVersion = 0;
|
||||
uint32_t currentTempTargetDegC = 0; // Current temperature target in C
|
||||
uint32_t lastMovementTime = 0;
|
||||
int16_t idealQCVoltage = 0;
|
||||
bool settingsWereReset = false;
|
||||
// FreeRTOS variables
|
||||
|
||||
osThreadId GUITaskHandle;
|
||||
@@ -74,7 +75,7 @@ int main(void) {
|
||||
systemSettings.sensitivity = 0;
|
||||
}
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
restoreSettings(); // load the settings from flash
|
||||
settingsWereReset = restoreSettings(); // load the settings from flash
|
||||
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
@@ -291,7 +292,7 @@ bool showBootLogoIfavailable() {
|
||||
uint16_t temp[98];
|
||||
|
||||
for (uint8_t i = 0; i < (98); i++) {
|
||||
temp[i] = *(uint16_t *) (FLASH_LOGOADDR + (i * 2));
|
||||
temp[i] = *(uint16_t*) (FLASH_LOGOADDR + (i * 2));
|
||||
}
|
||||
uint8_t temp8[98 * 2];
|
||||
for (uint8_t i = 0; i < 98; i++) {
|
||||
@@ -308,7 +309,7 @@ bool showBootLogoIfavailable() {
|
||||
if (temp8[3] != 0x0D)
|
||||
return false;
|
||||
|
||||
OLED::drawArea(0, 0, 96, 16, (uint8_t *) (temp8 + 4));
|
||||
OLED::drawArea(0, 0, 96, 16, (uint8_t*) (temp8 + 4));
|
||||
OLED::refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,11 @@ then
|
||||
echo "Building firmware for $model in $lang"
|
||||
make -j lang="$lang" model="$model" >/dev/null
|
||||
checkLastCommand
|
||||
rm -rf Objects >/dev/null
|
||||
echo "Cleanup Temp files 1 for $model in $lang"
|
||||
rm -rf Objects/Core >/dev/null
|
||||
checkLastCommand
|
||||
echo "Cleanup Temp files 2 for $model in $lang"
|
||||
rm -rf Objects/Src >/dev/null
|
||||
checkLastCommand
|
||||
done
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user