diff options
author | Ben V. Brown <[email protected]> | 2018-03-30 19:16:38 +1100 |
---|---|---|
committer | Ben V. Brown <[email protected]> | 2018-03-30 19:16:38 +1100 |
commit | 8eadb98496e26173e105d0efe90b923e4d13cd12 (patch) | |
tree | 51353d8adc239df201a972d8ca2b20c3adef1d04 | |
parent | fe5ee911044446f135a7fd2d05ec2ccc673c7db0 (diff) | |
download | IronOS-8eadb98496e26173e105d0efe90b923e4d13cd12.tar.gz IronOS-8eadb98496e26173e105d0efe90b923e4d13cd12.zip |
Enable SWD back, Add Off mode for Sleepv2.03
-rw-r--r-- | workspace/TS100/.cproject | 6 | ||||
-rw-r--r-- | workspace/TS100/inc/Translation.h | 1 | ||||
-rw-r--r-- | workspace/TS100/inc/main.hpp | 2 | ||||
-rw-r--r-- | workspace/TS100/src/Settings.cpp | 2 | ||||
-rw-r--r-- | workspace/TS100/src/Translation.cpp | 17 | ||||
-rw-r--r-- | workspace/TS100/src/gui.cpp | 57 | ||||
-rw-r--r-- | workspace/TS100/src/main.cpp | 3 | ||||
-rw-r--r-- | workspace/TS100/src/stm32f1xx_hal_msp.c | 4 |
8 files changed, 61 insertions, 31 deletions
diff --git a/workspace/TS100/.cproject b/workspace/TS100/.cproject index 20577e3b..c9b40cb8 100644 --- a/workspace/TS100/.cproject +++ b/workspace/TS100/.cproject @@ -22,7 +22,7 @@ <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.317155453" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/> <builder buildPath="${workspace_loc:/TS100}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.910934658" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross"/> <tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.319926124" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler"> - <option id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.1178790692" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.debug" valueType="enumerated"/> + <option id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.1178790692" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated"/> <option id="gnu.c.compiler.option.debugging.level.1214895662" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/> <option id="gnu.c.compiler.option.include.paths.1766485383" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""${ProjDirPath}/inc""/> @@ -44,11 +44,12 @@ <listOptionValue builtIn="false" value="USE_RTOS_SYSTICK"/> </option> <option id="gnu.c.compiler.option.dialect.std.565083189" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/> + <option id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.fdata.338139343" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.fdata" useByScannerDiscovery="false" value="true" valueType="boolean"/> <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.176392389" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/> <inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.893418158" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/> </tool> <tool id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1941847243" name="MCU G++ Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler"> - <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1283353237" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.debug" valueType="enumerated"/> + <option id="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level.1283353237" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.cpp.optimization.level.size" valueType="enumerated"/> <option id="gnu.cpp.compiler.option.debugging.level.224874042" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> <option id="gnu.cpp.compiler.option.include.paths.1749257477" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""${ProjDirPath}/inc""/> @@ -70,6 +71,7 @@ <listOptionValue builtIn="false" value="USE_RTOS_SYSTICK"/> </option> <option id="gnu.cpp.compiler.option.dialect.std.1681974405" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/> + <option id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.fdata.1463726438" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.fdata" useByScannerDiscovery="false" value="true" valueType="boolean"/> <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp.149685854" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.cpp"/> <inputType id="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s.1092052043" superClass="fr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.input.s"/> </tool> diff --git a/workspace/TS100/inc/Translation.h b/workspace/TS100/inc/Translation.h index 84721fde..d13c9157 100644 --- a/workspace/TS100/inc/Translation.h +++ b/workspace/TS100/inc/Translation.h @@ -39,6 +39,7 @@ extern const char* IdleTipString; extern const char* IdleSetString; extern const char* TipDisconnectedString; extern const char* SolderingAdvancedPowerPrompt; +extern const char* OffString; extern const char SettingTrueChar; extern const char SettingFalseChar; diff --git a/workspace/TS100/inc/main.hpp b/workspace/TS100/inc/main.hpp index edb11ac8..3e522de0 100644 --- a/workspace/TS100/inc/main.hpp +++ b/workspace/TS100/inc/main.hpp @@ -7,7 +7,7 @@ extern OLED lcd; extern MMA8652FC accel; - +extern uint8_t PCBVersion; enum ButtonState { BUTTON_NONE = 0, /* No buttons pressed / < filter time*/ BUTTON_F_SHORT = 1, /* User has pressed the front button*/ diff --git a/workspace/TS100/src/Settings.cpp b/workspace/TS100/src/Settings.cpp index 88d4d924..40c2912e 100644 --- a/workspace/TS100/src/Settings.cpp +++ b/workspace/TS100/src/Settings.cpp @@ -66,7 +66,7 @@ void restoreSettings() { */ uint8_t lookupVoltageLevel(uint8_t level) { if (level == 0) - return 100; //10V since iron does not function effectively below this + return 90; //9V since iron does not function effectively below this else return (level * 33) + (33 * 2); } diff --git a/workspace/TS100/src/Translation.cpp b/workspace/TS100/src/Translation.cpp index aa6aebda..59c74ce3 100644 --- a/workspace/TS100/src/Translation.cpp +++ b/workspace/TS100/src/Translation.cpp @@ -93,6 +93,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSet const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -176,6 +177,7 @@ const char* IdleTipString = "Връх:"; // IdleTipString+ const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "ВРЪХ ЛОША ВРЪЗКА"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Захранване: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -258,6 +260,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSe const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max /* * #TODO change support for multibyte constants here @@ -345,6 +348,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSe const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'D'; // D is "Derecha" = Right const char SettingLeftChar = 'I'; // I is "Izquierda" = Left @@ -425,6 +429,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSe const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -506,6 +511,7 @@ const char* IdleTipString = "Punta:"; // IdleTipString+IdleSetS const char* IdleSetString = "/"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "PUNTA ASSENTE"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Potenza:"; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'D'; const char SettingLeftChar = 'S'; @@ -587,6 +593,7 @@ const char* IdleTipString = "PANNE:"; // IdleTipString+IdleS const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "PANNE DEBRANCH"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Puissance: "; // <= 12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'D'; const char SettingLeftChar = 'G'; @@ -668,6 +675,7 @@ const char* IdleTipString = "Ist:"; // IdleTipString+IdleSe const char* IdleSetString = " Soll:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "Spitze fehlt"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Leistung: "; // <= 12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -748,6 +756,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSe const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -828,6 +837,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSet const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -908,6 +918,7 @@ const char* IdleTipString = "Vrh: "; // IdleTipString+IdleSet const char* IdleSetString = " / "; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "VRH NIJE SPOJEN!"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Snaga: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'D'; const char SettingLeftChar = 'L'; @@ -986,6 +997,7 @@ const char* IdleTipString = "Hrot:"; // IdleTipString+IdleSet const char* IdleSetString = " Cíl:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "HROT NEPŘIPOJEN"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Ohřev: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'P'; const char SettingLeftChar = 'L'; @@ -1070,6 +1082,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSet const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'R'; const char SettingLeftChar = 'L'; @@ -1150,6 +1163,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSet const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'H'; const char SettingLeftChar = 'V'; @@ -1230,6 +1244,7 @@ const char* IdleTipString = "Tip:"; // IdleTipString+IdleSet const char* IdleSetString = " Set:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "TIP DISCONNECTED"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'P'; const char SettingLeftChar = 'L'; @@ -1310,6 +1325,7 @@ const char* IdleTipString = "Ponta:"; // IdleTipString+IdleSetSt const char* IdleSetString = " Aj:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "SEM PONTA"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Power: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'D'; const char SettingLeftChar = 'C'; @@ -1390,6 +1406,7 @@ const char* IdleTipString = "Ant:"; // IdleTipString+Idle const char* IdleSetString = " Nust:"; // preferably start with a space; IdleTipString+IdleSetString <= 10 const char* TipDisconnectedString = "ANTGAL ATJUNGTAS"; // <=16 chars const char* SolderingAdvancedPowerPrompt = "Maitinimas: "; // <=12 chars +const char* OffString ="Off";// 3 chars max const char SettingRightChar = 'D'; const char SettingLeftChar = 'K'; diff --git a/workspace/TS100/src/gui.cpp b/workspace/TS100/src/gui.cpp index 94d6def6..e4acb844 100644 --- a/workspace/TS100/src/gui.cpp +++ b/workspace/TS100/src/gui.cpp @@ -228,15 +228,11 @@ static int userConfirmation(const char* message) { int16_t lastOffset = -1; bool lcdRefresh = true; - for (;;) { - int16_t messageOffset = - ((xTaskGetTickCount() - messageStart) - / (systemSettings.descriptionScrollSpeed == 1 ? - 1 : 2)); - messageOffset %= messageWidth; //Roll around at the end - + int16_t messageOffset = ((xTaskGetTickCount() - messageStart) + / (systemSettings.descriptionScrollSpeed == 1 ? 1 : 2)); + messageOffset %= messageWidth; //Roll around at the end if (lastOffset != messageOffset) { lcd.clearScreen(); @@ -302,15 +298,18 @@ static void settings_displaySleepTemp(void) { static void settings_setSleepTime(void) { systemSettings.SleepTime++; // Go up 1 minute at a time if (systemSettings.SleepTime >= 16) { - systemSettings.SleepTime = 1; // can't set time over 10 mins + systemSettings.SleepTime = 0; // can't set time over 10 mins } // Remember that ^ is the time of no movement + if (PCBVersion == 3) + systemSettings.SleepTime = 0; //Disable sleep on no accel } static void settings_displaySleepTime(void) { printShortDescription(2, 5); - - if (systemSettings.SleepTime < 6) { + if (systemSettings.SleepTime == 0) { + lcd.print(OffString); + } else if (systemSettings.SleepTime < 6) { lcd.printNumber(systemSettings.SleepTime * 10, 2); lcd.drawChar('S'); } else { @@ -324,11 +323,18 @@ static void settings_setShutdownTime(void) { if (systemSettings.ShutdownTime > 60) { systemSettings.ShutdownTime = 0; // wrap to off } + if (PCBVersion == 3) + systemSettings.ShutdownTime = 0; //Disable shutdown on no accel } static void settings_displayShutdownTime(void) { - printShortDescription(3, 6); - lcd.printNumber(systemSettings.ShutdownTime, 2); + printShortDescription(3, 5); + if (systemSettings.ShutdownTime == 0) { + lcd.print(OffString); + } else { + lcd.printNumber(systemSettings.ShutdownTime, 2); + lcd.drawChar('M'); + } } static void settings_setTempF(void) { @@ -388,18 +394,18 @@ static void settings_setDisplayRotation(void) { systemSettings.OrientationMode++; systemSettings.OrientationMode = systemSettings.OrientationMode % 3; switch (systemSettings.OrientationMode) { - case 0: - lcd.setRotation(false); - break; - case 1: - lcd.setRotation(true); - break; - case 2: - //do nothing on auto - break; - default: - break; - } + case 0: + lcd.setRotation(false); + break; + case 1: + lcd.setRotation(true); + break; + case 2: + //do nothing on auto + break; + default: + break; + } } static void settings_displayDisplayRotation(void) { @@ -719,7 +725,8 @@ void gui_Menu(const menuitem* menu) { if ((PRESS_ACCEL_INTERVAL_MAX - autoRepeatAcceleration) < PRESS_ACCEL_INTERVAL_MIN) { - autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN; + autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX + - PRESS_ACCEL_INTERVAL_MIN; } if (lcdRefresh) { diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp index daa356f9..22b2bc06 100644 --- a/workspace/TS100/src/main.cpp +++ b/workspace/TS100/src/main.cpp @@ -47,6 +47,7 @@ int main(void) { lcd.setFont(0); // default to bigger font //Testing for new weird board version uint8_t buffer[1]; + HAL_IWDG_Refresh(&hiwdg); if (HAL_I2C_Mem_Read(&hi2c1, 29 << 1, 0x0F, I2C_MEMADD_SIZE_8BIT, buffer, 1, 1000) == HAL_OK) { PCBVersion = 1; @@ -59,6 +60,8 @@ int main(void) { accel2.initalize(); //startup the accelerometer } else { PCBVersion = 3; + systemSettings.SleepTime=0; + systemSettings.ShutdownTime=0;//No accel -> disable sleep } HAL_IWDG_Refresh(&hiwdg); restoreSettings(); // load the settings from flash diff --git a/workspace/TS100/src/stm32f1xx_hal_msp.c b/workspace/TS100/src/stm32f1xx_hal_msp.c index 6b8884b6..bf10730f 100644 --- a/workspace/TS100/src/stm32f1xx_hal_msp.c +++ b/workspace/TS100/src/stm32f1xx_hal_msp.c @@ -28,8 +28,8 @@ void HAL_MspInit(void) { /**NOJTAG: JTAG-DP Disabled and SW-DP Enabled */ -// __HAL_AFIO_REMAP_SWJ_NOJTAG() - __HAL_AFIO_REMAP_SWJ_DISABLE(); /*Disable swd for debug io use*/ + __HAL_AFIO_REMAP_SWJ_NOJTAG(); +// __HAL_AFIO_REMAP_SWJ_DISABLE(); /*Disable swd for debug io use*/ } |