aboutsummaryrefslogtreecommitdiffhomepage
path: root/workspace/ts100/src/Settings.c
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2016-10-03 19:01:57 +1100
committerBen V. Brown <[email protected]>2016-10-03 19:01:57 +1100
commit0bbdda5b553556875901900f6295faab3182a986 (patch)
treee14ea77eb86edf9221239c25ee52017226880923 /workspace/ts100/src/Settings.c
parentacb97f1d464346d6b00f85078780160fa0f2affa (diff)
downloadIronOS-0bbdda5b553556875901900f6295faab3182a986.tar.gz
IronOS-0bbdda5b553556875901900f6295faab3182a986.zip
Add FlipDisplay, Fahrenheit, Better Fontv1.01
Diffstat (limited to 'workspace/ts100/src/Settings.c')
-rw-r--r--workspace/ts100/src/Settings.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/workspace/ts100/src/Settings.c b/workspace/ts100/src/Settings.c
index 849a6dc9..cfa60a76 100644
--- a/workspace/ts100/src/Settings.c
+++ b/workspace/ts100/src/Settings.c
@@ -8,9 +8,9 @@
*/
#include "Settings.h"
-#define FLASH_ADDR (0x8000000|48896)
+#define FLASH_ADDR (0x8000000|48896)/*Flash start OR'ed with the maximum amount of flash - 256 bytes*/
void saveSettings() {
-//First we erase the flash
+ //First we erase the flash
FLASH_Unlock(); //unlock flash writing
FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
while (FLASH_ErasePage(FLASH_ADDR) != FLASH_COMPLETE)
@@ -26,9 +26,8 @@ void saveSettings() {
void restoreSettings() {
//We read the flash
uint16_t *data = (uint16_t*) &systemSettings;
- for(uint8_t i=0;i<(sizeof(systemSettings)/2);i++)
- {
- data[i] = *(uint16_t *)(FLASH_ADDR + (i*2));
+ for (uint8_t i = 0; i < (sizeof(systemSettings) / 2); i++) {
+ data[i] = *(uint16_t *) (FLASH_ADDR + (i * 2));
}
//if the version is correct were done
//if not we reset and save
@@ -42,11 +41,13 @@ void restoreSettings() {
void resetSettings() {
- systemSettings.SleepTemp = 900;
- systemSettings.SleepTime = 1;
- systemSettings.SolderingTemp = 3200;
- systemSettings.movementEnabled = 1; //we use movement detection
- systemSettings.cutoutVoltage = 9;
- systemSettings.version=SETTINGSVERSION;
+ systemSettings.SleepTemp = 1500; //Temperature the iron sleeps at - default 150.0 C
+ systemSettings.SleepTime = 1; //How many minutes we wait until going to sleep - default 1 min
+ systemSettings.SolderingTemp = 3200; //Default soldering temp is 320.0 C
+ systemSettings.movementEnabled = 1; //we use movement detection by default
+ systemSettings.cutoutVoltage = 10; //10V is the minium cutout voltage as the unit V measurement is unstable below 9.5V
+ systemSettings.version = SETTINGSVERSION; //Store the version number to allow for easier upgrades
+ systemSettings.displayTempInF =0; //default to C
+ systemSettings.flipDisplay=0; //Default to right handed mode
}