Merge branch 'master' into pinecil

This commit is contained in:
Ben V. Brown
2020-11-01 14:16:00 +11:00
34 changed files with 1935 additions and 1297 deletions

View File

@@ -42,7 +42,7 @@ ButtonState getButtonState() {
else if (currentState == 0x02)
return BUTTON_B_LONG;
else
return BUTTON_NONE; // Both being held case, we dont long hold this
return BUTTON_BOTH_LONG; // Both being held case
} else
return BUTTON_NONE;
} else {

View File

@@ -17,6 +17,7 @@ enum ButtonState {
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_BOTH_LONG = 32, /* User is holding both buttons*/
/*
* Note:

View File

@@ -11,7 +11,7 @@
#define SETTINGS_H_
#include <stdint.h>
#include "unit.h"
#define SETTINGSVERSION ( 0x21 )
#define SETTINGSVERSION (0x22)
/*Change this if you change the struct below to prevent people getting \
out of sync*/
@@ -19,45 +19,48 @@
* This struct must be a multiple of 2 bytes as it is saved / restored from
* flash in uint16_t chunks
*/
typedef struct {
uint8_t version; // Used to track if a reset is needed on firmware upgrade
typedef struct
{
uint8_t version; // Used to track if a reset is needed on firmware upgrade
uint16_t SolderingTemp; // current set point for the iron
uint16_t SleepTemp; // temp to drop to in sleep
uint8_t SleepTime; // minutes timeout to sleep
uint8_t cutoutSetting; // The voltage we cut out at for under voltage OR Power level for TS80
uint8_t OrientationMode :2; // If true we want to invert the display for lefties
uint8_t sensitivity :4; // Sensitivity of accelerometer (5 bits)
uint8_t autoStartMode :2; // Should the unit automatically jump straight
// into soldering mode when power is applied
uint8_t ShutdownTime; // Time until unit shuts down if left alone
uint16_t SolderingTemp; // current set point for the iron
uint16_t SleepTemp; // temp to drop to in sleep
uint8_t SleepTime; // minutes timeout to sleep
uint8_t cutoutSetting; // The voltage we cut out at for under voltage OR Power level for TS80
uint8_t OrientationMode : 2; // If true we want to invert the display for lefties
uint8_t sensitivity : 4; // Sensitivity of accelerometer (5 bits)
uint8_t autoStartMode : 2; // Should the unit automatically jump straight
// into soldering mode when power is applied
uint8_t ShutdownTime; // Time until unit shuts down if left alone
uint8_t coolingTempBlink :1; // Should the temperature blink on the cool
// down screen until its <50C
uint8_t detailedIDLE :1; // Detailed idle screen
uint8_t detailedSoldering :1; // Detailed soldering screens
uint8_t coolingTempBlink : 1; // Should the temperature blink on the cool
// down screen until its <50C
uint8_t detailedIDLE : 1; // Detailed idle screen
uint8_t detailedSoldering : 1; // Detailed soldering screens
#ifdef ENABLED_FAHRENHEIT_SUPPORT
uint8_t temperatureInF :1; // Should the temp be in F or C (true is F)
uint8_t temperatureInF : 1; // Should the temp be in F or C (true is F)
#endif
uint8_t descriptionScrollSpeed :1; // Description scroll speed
uint8_t KeepAwakePulse; // Keep Awake pulse power in 0.1 watts (10 = 1Watt)
uint8_t descriptionScrollSpeed : 1; // Description scroll speed
uint8_t lockingMode : 2; // Store the locking mode
uint8_t KeepAwakePulse; // Keep Awake pulse power in 0.1 watts (10 = 1Watt)
uint16_t voltageDiv; // Voltage divisor factor
uint16_t BoostTemp; // Boost mode set point for the iron
uint16_t voltageDiv; // Voltage divisor factor
uint16_t BoostTemp; // Boost mode set point for the iron
uint16_t CalibrationOffset; // This stores the temperature offset for this tip
// in the iron.
uint8_t powerLimit; // Maximum power iron allowed to output
uint8_t powerLimit; // Maximum power iron allowed to output
uint16_t TipGain; // uV/C * 10, it can be used to convert tip thermocouple voltage to temperateture TipV/TipGain = TipTemp
uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment
uint16_t TempChangeLongStep; // Change the plus and minus button assigment
uint16_t TempChangeShortStep; // Change the plus and minus button assigment
uint8_t hallEffectSensitivity; //Operating mode of the hall effect sensor
uint32_t padding; // This is here for in case we are not an even divisor so
// that nothing gets cut off
//MUST BE LAST
uint16_t TempChangeLongStep; // Change the plus and minus button assigment
uint16_t TempChangeShortStep; // Change the plus and minus button assigment
uint8_t hallEffectSensitivity; //Operating mode of the hall effect sensor
uint32_t padding; // This is here for in case we are not an even divisor so
// that nothing gets cut off
//MUST BE LAST
} systemSettingsType;

View File

@@ -15,8 +15,8 @@ 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 char *SettingsShortNames[28][2];
extern const char *SettingsDescriptions[28];
extern const char *SettingsShortNames[29][2];
extern const char *SettingsDescriptions[29];
extern const char *SettingsMenuEntries[4];
extern const char *SettingsCalibrationDone;
@@ -41,6 +41,9 @@ extern const char *OffString;
extern const char *ResetOKMessage;
extern const char *YourGainMessage;
extern const char *SettingsResetMessage;
extern const char *LockingKeysString;
extern const char *UnlockingKeysString;
extern const char *WarningKeysLockedString;
extern const char *SettingTrueChar;
extern const char *SettingFalseChar;
@@ -55,6 +58,9 @@ extern const char *SettingSensitivityOff;
extern const char *SettingSensitivityLow;
extern const char *SettingSensitivityMedium;
extern const char *SettingSensitivityHigh;
extern const char *SettingLockDisableChar;
extern const char *SettingLockBoostChar;
extern const char *SettingLockFullChar;
extern const char *SettingFastChar;
extern const char *SettingSlowChar;

View File

@@ -65,6 +65,7 @@ void resetSettings() {
systemSettings.ShutdownTime = SHUTDOWN_TIME; // How many minutes until the unit turns itself off
systemSettings.BoostTemp = BOOST_TEMP; // default to 400C
systemSettings.autoStartMode = AUTO_START_MODE; // Auto start off for safety
systemSettings.lockingMode = LOCKING_MODE; // Disable locking for safety
systemSettings.coolingTempBlink = COOLING_TEMP_BLINK; // Blink the temperature on the cooling screen when its > 50C
#ifdef ENABLED_FAHRENHEIT_SUPPORT
systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0

File diff suppressed because it is too large Load Diff

View File

@@ -432,8 +432,10 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
* PID control
* --> Long hold back button to exit
* --> Double button to exit
* --> Long hold double button to toggle key lock
*/
bool boostModeOn = false;
bool buttonsLocked = false;
if (jumpToSleep) {
if (gui_SolderingSleepingMode(jumpToSleep == 2)) {
@@ -443,34 +445,86 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
}
for (;;) {
ButtonState buttons = getButtonState();
switch (buttons) {
case BUTTON_NONE:
// stay
boostModeOn = false;
break;
case BUTTON_BOTH:
// exit
return;
break;
case BUTTON_B_LONG:
return; // exit on back long hold
break;
case BUTTON_F_LONG:
// if boost mode is enabled turn it on
if (systemSettings.BoostTemp)
boostModeOn = true;
break;
case BUTTON_F_SHORT:
case BUTTON_B_SHORT: {
uint16_t oldTemp = systemSettings.SolderingTemp;
gui_solderingTempAdjust(); // goto adjust temp mode
if (oldTemp != systemSettings.SolderingTemp) {
saveSettings(); // only save on change
if (buttonsLocked && (systemSettings.lockingMode != 0)) { // If buttons locked
switch (buttons) {
case BUTTON_NONE:
// stay
boostModeOn = false;
break;
case BUTTON_BOTH_LONG:
// Unlock buttons
buttonsLocked = false;
OLED::setCursor(0, 0);
OLED::clearScreen();
OLED::setFont(0);
OLED::print(UnlockingKeysString);
OLED::refresh();
waitForButtonPressOrTimeout(1000);
break;
case BUTTON_F_LONG:
// if boost mode is enabled turn it on
if (systemSettings.BoostTemp && (systemSettings.lockingMode == 1)) {
boostModeOn = true;
break;
};
// fall through
case BUTTON_BOTH:
case BUTTON_B_LONG:
case BUTTON_F_SHORT:
case BUTTON_B_SHORT:
// Do nothing and display a lock warming
OLED::setCursor(0, 0);
OLED::clearScreen();
OLED::setFont(0);
OLED::print(WarningKeysLockedString);
OLED::refresh();
waitForButtonPressOrTimeout(500);
break;
default:
break;
}
} else { // Button not locked
switch (buttons) {
case BUTTON_NONE:
// stay
boostModeOn = false;
break;
case BUTTON_BOTH:
// exit
return;
break;
case BUTTON_B_LONG:
return; // exit on back long hold
break;
case BUTTON_F_LONG:
// if boost mode is enabled turn it on
if (systemSettings.BoostTemp)
boostModeOn = true;
break;
case BUTTON_F_SHORT:
case BUTTON_B_SHORT: {
uint16_t oldTemp = systemSettings.SolderingTemp;
gui_solderingTempAdjust(); // goto adjust temp mode
if (oldTemp != systemSettings.SolderingTemp) {
saveSettings(); // only save on change
}
}
break;
case BUTTON_BOTH_LONG:
if (systemSettings.lockingMode != 0) {
// Lock buttons
buttonsLocked = true;
OLED::setCursor(0, 0);
OLED::clearScreen();
OLED::setFont(0);
OLED::print(LockingKeysString);
OLED::refresh();
waitForButtonPressOrTimeout(1000);
}
break;
default:
break;
}
}
break;
default:
break;
}
// else we update the screen information
OLED::setCursor(0, 0);

View File

@@ -40,6 +40,16 @@
*/
#define AUTO_START_MODE 0 // Default to none
/**
* Locking Mode
* When in soldering mode a long press on both keys toggle the lock of the buttons
* Possible values are:
* 0 - Desactivated
* 1 - Lock except boost
* 2 - Full lock
*/
#define LOCKING_MODE 0 // Default to desactivated for safety
/**
* OLED Orientation
*