Merge pull request #585 from GeminiServer/PR-#1-Configuration

PR #1 - Unified the default configuration/setting values and parameters into …
This commit is contained in:
Ben V. Brown
2020-03-17 10:04:27 +11:00
committed by GitHub
6 changed files with 1739 additions and 1675 deletions

View File

@@ -10,6 +10,7 @@
#include <stdlib.h>
#include "Translation.h"
#include "cmsis_os.h"
#include "../../configuration.h"
const uint8_t *OLED::currentFont; // Pointer to the current font used for
// rendering to the buffer
@@ -65,7 +66,7 @@ void OLED::initialize() {
cursor_x = cursor_y = 0;
currentFont = USER_FONT_12;
fontWidth = 12;
inLeftHandedMode = false;
inLeftHandedMode = IN_LEFT_HANDED_MODE;
firstStripPtr = &screenBuffer[FRAMEBUFFER_START];
secondStripPtr = &screenBuffer[FRAMEBUFFER_START + OLED_WIDTH];
fontHeight = 16;

View File

@@ -10,6 +10,7 @@
#include "Settings.h"
#include "Setup.h"
#include "../../configuration.h"
#define FLASH_ADDR \
(0x8000000 | \
0xFC00) /*Flash start OR'ed with the maximum amount of flash - 1024 bytes*/
@@ -77,40 +78,28 @@ uint8_t lookupVoltageLevel(uint8_t level) {
}
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
systemSettings.SleepTemp = SLEEP_TEMP; // Temperature the iron sleeps at - default 150.0 C
systemSettings.SleepTime = SLEEP_TIME; // 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.SolderingTemp = SOLDERING_TEMP; // Default soldering temp is 320.0 C
systemSettings.cutoutSetting = CUT_OUT_SETTING; // 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
#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.powerLimitEnable = 0; // Default to no power limit
#ifdef MODEL_TS100
systemSettings.CalibrationOffset = 900; // the adc offset in uV
systemSettings.pidPowerLimit = 70; // Sets the max pwm power limit
systemSettings.powerLimit = 30; // 30 watts default limit
#endif
#ifdef MODEL_TS80
systemSettings.pidPowerLimit = 24; // Sets the max pwm power limit
systemSettings.CalibrationOffset = 900; // the adc offset in uV
systemSettings.powerLimit = 24; // 24 watts default power limit
#endif
systemSettings.detailedSoldering = DETAILED_SOLDERING; // Detailed soldering screen
systemSettings.detailedIDLE = DETAILED_IDLE; // Detailed idle screen (off for first time users)
systemSettings.OrientationMode = ORIENTATION_MODE; // Default to automatic
systemSettings.sensitivity = SENSITIVITY; // Default high sensitivity
systemSettings.voltageDiv = VOLTAGE_DIV; // Default divider from schematic
systemSettings.ShutdownTime = SHUTDOWN_TIME; // How many minutes until the unit turns itself off
systemSettings.boostModeEnabled = BOOST_MODE_ENABLED; // Default to having boost mode on as most people prefer it
systemSettings.BoostTemp = BOOST_TEMP; // default to 400C
systemSettings.autoStartMode = AUTO_START_MODE; // Auto start off for safety
systemSettings.coolingTempBlink = COOLING_TEMP_BLINK; // Blink the temperature on the cooling screen when its > 50C
systemSettings.temperatureInF = TEMPERATURE_INF; // default to 0
systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow
systemSettings.powerLimitEnable = POWER_LIMIT_ENABLE; // Default to no power limit
systemSettings.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV
systemSettings.pidPowerLimit = PID_POWER_LIMIT; // Sets the max pwm power limit
systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit
saveSettings(); // Save defaults
}

View File

@@ -8,6 +8,7 @@
#include "TipThermoModel.h"
#include "Settings.h"
#include "hardware.h"
#include "../../configuration.h"
/*
* The hardware is laid out as a non-inverting op-amp
@@ -26,18 +27,6 @@
* This was bought to my attention by <Kuba Sztandera>
*/
// TIP_GAIN = TIP_GAIN/1000 == uV per deg C constant of the tip
#ifdef MODEL_TS100
#define OP_AMP_Rf 750*1000 /*750 Kilo-ohms -> From schematic, R1*/
#define OP_AMP_Rin 2370 /*2.37 Kilo-ohms -> From schematic, R2*/
#define TIP_GAIN 405
#else
#define OP_AMP_Rf 180*1000 /*180 Kilo-ohms -> From schematic, R6*/
#define OP_AMP_Rin 2000 /*2.0 Kilo-ohms -> From schematic, R3*/
#define TIP_GAIN 115
#endif
#define op_amp_gain_stage (1+(OP_AMP_Rf/OP_AMP_Rin))
uint32_t TipThermoModel::convertTipRawADCTouV(uint16_t rawADC) {
// This takes the raw ADC samples, converts these to uV

File diff suppressed because it is too large Load Diff

View File

@@ -11,16 +11,19 @@
#include "main.hpp"
#include "TipThermoModel.h"
#include "string.h"
#include "../../configuration.h"
extern uint32_t lastButtonTime;
void gui_Menu(const menuitem *menu);
#ifdef MODEL_TS100
static void settings_setInputVRange(void);
static void settings_displayInputVRange(void);
#else
static void settings_setInputPRange(void);
static void settings_displayInputPRange(void);
#ifdef MODEL_TS100
static void settings_setInputVRange(void);
static void settings_displayInputVRange(void);
#else
static void settings_setInputPRange(void);
static void settings_displayInputPRange(void);
#endif
static void settings_setSleepTemp(void);
static void settings_displaySleepTemp(void);
static void settings_setSleepTime(void);
@@ -463,18 +466,10 @@ static void settings_displayPowerLimitEnable(void) {
}
static void settings_setPowerLimit(void) {
#ifdef MODEL_TS100
if (systemSettings.powerLimit >= 65)
systemSettings.powerLimit = 5;
if (systemSettings.powerLimit >= MAX_POWER_LIMIT)
systemSettings.powerLimit = POWER_LIMIT_STEPS;
else
systemSettings.powerLimit += 5;
#endif
#ifdef MODEL_TS80
if(systemSettings.powerLimit >= 30)
systemSettings.powerLimit = 2;
else
systemSettings.powerLimit += 2;
#endif
systemSettings.powerLimit += POWER_LIMIT_STEPS;
}
static void settings_displayPowerLimit(void) {

View File

@@ -0,0 +1,99 @@
#pragma once
/**
* Configuration.h
* Define here your default pre settings for TS80 or TS100
*
*/
//===========================================================================
//============================= Default Settings ============================
//===========================================================================
/**
* Default soldering temp is 320.0 C
* Temperature the iron sleeps at - default 150.0 C
*/
#define SOLDERING_TEMP 320 // Default soldering temp is 320.0 °C
#define SLEEP_TEMP 150 // Default sleep temperature
#define BOOST_TEMP 420 // Default boost temp.
#define BOOST_MODE_ENABLED 1 // 0: Disable 1: Enable
/**
* Blink the temperature on the cooling screen when its > 50C
*/
#define COOLING_TEMP_BLINK 0 // 0: Disable 1: Enable
/**
* How many seconds/minutes we wait until going to sleep/shutdown.
* Values -> SLEEP_TIME * 10; i.e. 5*10 = 50 Seconds!
*/
#define SLEEP_TIME 5 // x10 Seconds
#define SHUTDOWN_TIME 10 // Minutes
/**
* Auto start off for safety.
* Pissible values are:
* 0 - none
* 1 - Soldering Temperature
* 2 - Sleep Temperature
* 3 - Sleep Off Temperature
*/
#define AUTO_START_MODE 0 // Default to none
/**
* OLED Orientation
*
*/
#define ORIENTATION_MODE 0 // 0: Right 1:Left 2:Automatic - Default right
#define IN_LEFT_HANDED_MODE 0 // 0:FALSE 1:TRUE - Default false
/**
* OLED Orientation Sensitivity on Automatic mode!
* Motion Sensitivity <0=Off 1=Least Sensitive 9=Most Sensitive>
*/
#define SENSITIVITY 7 // Default 7
/**
* Detailed soldering screen
* Detailed idle screen (off for first time users)
*/
#define DETAILED_SOLDERING 0 // 0: Disable 1: Enable - Default 0
#define DETAILED_IDLE 0 // 0: Disable 1: Enable - Default 0
#define CUT_OUT_SETTING 0 // default to no cut-off voltage (or 18W for TS80)
#define TEMPERATURE_INF 0 // default to 0
#define DESCRIPTION_SCROLL_SPEED 0 // 0: Slow 1: Fast - default to slow
#define POWER_LIMIT_ENABLE 0 // 0: Disable 1: Enable - Default disabled power limit
#ifdef MODEL_TS100
#define VOLTAGE_DIV 467 // 467 - Default divider from schematic
#define CALIBRATION_OFFSET 900 // 900 - Default adc offset in uV
#define PID_POWER_LIMIT 70 // Sets the max pwm power limit
#define POWER_LIMIT 30 // 30 watts default limit
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 5 //
/**
* TIP_GAIN = TIP_GAIN/1000 == uV per deg C constant of the tip
*/
#define OP_AMP_Rf 750*1000 // 750 Kilo-ohms -> From schematic, R1
#define OP_AMP_Rin 2370 // 2.37 Kilo-ohms -> From schematic, R2
#define TIP_GAIN 405
#endif
#ifdef MODEL_TS80
#define VOLTAGE_DIV 780 // Default divider from schematic
#define PID_POWER_LIMIT 24 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 900 // the adc offset in uV
#define POWER_LIMIT 24 // 24 watts default power limit
#define MAX_POWER_LIMIT 30 //
#define POWER_LIMIT_STEPS 2
/**
* TIP_GAIN = TIP_GAIN/1000 == uV per deg C constant of the tip
*/
#define OP_AMP_Rf 180*1000 // 180 Kilo-ohms -> From schematic, R6
#define OP_AMP_Rin 2000 // 2.0 Kilo-ohms -> From schematic, R3
#define TIP_GAIN 115
#endif