1
0
forked from me/IronOS

Merge pull request #632 from Ralim/feat/power-pulse-for-all

Enable Power Pulse for all models
This commit is contained in:
Ben V. Brown
2020-05-24 18:21:46 +10:00
committed by GitHub
32 changed files with 344 additions and 109 deletions

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -274,6 +274,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -277,6 +277,14 @@
"Taste Lang?" "Taste Lang?"
], ],
"desc": "Temperaturwechselschritte bei langem Tastendruck!" "desc": "Temperaturwechselschritte bei langem Tastendruck!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -276,6 +276,14 @@
"long" "long"
], ],
"desc": "Temperature change steps on long button press" "desc": "Temperature change steps on long button press"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -275,6 +275,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"Long?" "Long?"
], ],
"desc": "Incrément de changement de température sur appui long." "desc": "Incrément de changement de température sur appui long."
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -275,6 +275,14 @@
"pressione lunga" "pressione lunga"
], ],
"desc": "Varia la temperatura della punta attraverso una lunga pressione dei tasti" "desc": "Varia la temperatura della punta attraverso una lunga pressione dei tasti"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -275,6 +275,14 @@
"длин. наж." "длин. наж."
], ],
"desc": "Шаг изменения температуры при длинном нажатии кнопок" "desc": "Шаг изменения температуры при длинном нажатии кнопок"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -274,6 +274,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"long?" "long?"
], ],
"desc": "Temperature change steps on long button press!" "desc": "Temperature change steps on long button press!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -273,6 +273,14 @@
"довго?" "довго?"
], ],
"desc": "Змінювати температуру при довгому натисканні!" "desc": "Змінювати температуру при довгому натисканні!"
},
"PowerPulsePower":{
"text": "POWPLS",
"text2": [
"Power",
"Pulse W"
],
"desc": "Keep awake pulse power intensity"
} }
} }
} }

View File

@@ -282,6 +282,11 @@ var def =
"id": "TempChangeLongStep", "id": "TempChangeLongStep",
"maxLen": 6, "maxLen": 6,
"maxLen2": 16 "maxLen2": 16
},
{
"id": "PowerPulsePower",
"maxLen": 6,
"maxLen2": 16
} }
] ]
} }

View File

@@ -12,7 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include "stm32f1xx_hal.h" #include "stm32f1xx_hal.h"
#include "unit.h" #include "unit.h"
#define SETTINGSVERSION ( 0x1E ) #define SETTINGSVERSION ( 0x1F )
/*Change this if you change the struct below to prevent people getting \ /*Change this if you change the struct below to prevent people getting \
out of sync*/ out of sync*/
@@ -21,6 +21,8 @@
* flash in uint16_t chunks * flash in uint16_t chunks
*/ */
typedef struct { 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 SolderingTemp; // current set point for the iron
uint16_t SleepTemp; // temp to drop to in sleep uint16_t SleepTemp; // temp to drop to in sleep
uint8_t SleepTime; // minutes timeout to sleep uint8_t SleepTime; // minutes timeout to sleep
@@ -37,26 +39,27 @@ typedef struct {
uint8_t detailedIDLE :1; // Detailed idle screen uint8_t detailedIDLE :1; // Detailed idle screen
uint8_t detailedSoldering :1; // Detailed soldering screens uint8_t detailedSoldering :1; // Detailed soldering screens
#ifdef ENABLED_FAHRENHEIT_SUPPORT #ifdef ENABLED_FAHRENHEIT_SUPPORT
uint8_t temperatureInF; // 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 #endif
uint8_t descriptionScrollSpeed :1; // Description scroll speed uint8_t descriptionScrollSpeed :1; // Description scroll speed
uint8_t KeepAwakePulse; // Keep Awake pulse power in 0.1 watts (10 = 1Watt)
uint16_t voltageDiv; // Voltage divisor factor uint16_t voltageDiv; // Voltage divisor factor
uint16_t BoostTemp; // Boost mode set point for the iron uint16_t BoostTemp; // Boost mode set point for the iron
uint16_t CalibrationOffset; // This stores the temperature offset for this tip uint16_t CalibrationOffset; // This stores the temperature offset for this tip
// in the iron. // in the iron.
uint8_t pidPowerLimit;
uint8_t powerLimitEnable; // Allow toggling of power limit without changing value uint8_t powerLimitEnable; // Allow toggling of power limit without changing value
uint8_t powerLimit; // Maximum power iron allowed to output uint8_t powerLimit; // Maximum power iron allowed to output
uint8_t version; // Used to track if a reset is needed on firmware upgrade
uint32_t padding; // This is here for in case we are not an even divisor so
// that nothing gets cut off
uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment uint8_t ReverseButtonTempChangeEnabled; // Change the plus and minus button assigment
uint16_t TempChangeLongStep; // 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 uint16_t TempChangeShortStep; // Change the plus and minus button assigment
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; } systemSettingsType;
extern volatile systemSettingsType systemSettings; extern volatile systemSettingsType systemSettings;

View File

@@ -19,8 +19,8 @@ extern const uint8_t USER_FONT_6x8[];
* use SettingsShortNames as SettingsShortNames[16][1].. second column undefined * use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
*/ */
extern const enum ShortNameType SettingsShortNameType; extern const enum ShortNameType SettingsShortNameType;
extern const char *SettingsShortNames[26][2]; extern const char *SettingsShortNames[27][2];
extern const char *SettingsDescriptions[26]; extern const char *SettingsDescriptions[27];
extern const char *SettingsMenuEntries[4]; extern const char *SettingsMenuEntries[4];
extern const char *SettingsCalibrationDone; extern const char *SettingsCalibrationDone;

View File

@@ -101,10 +101,10 @@ void resetSettings() {
systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow systemSettings.descriptionScrollSpeed = DESCRIPTION_SCROLL_SPEED; // default to slow
systemSettings.powerLimitEnable = POWER_LIMIT_ENABLE; // Default to no power limit systemSettings.powerLimitEnable = POWER_LIMIT_ENABLE; // Default to no power limit
systemSettings.CalibrationOffset = CALIBRATION_OFFSET; // the adc offset in uV 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 systemSettings.powerLimit = POWER_LIMIT; // 30 watts default limit
systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; // systemSettings.ReverseButtonTempChangeEnabled = REVERSE_BUTTON_TEMP_CHANGE; //
systemSettings.TempChangeShortStep = TEMP_CHANGE_SHORT_STEP; // systemSettings.TempChangeShortStep = TEMP_CHANGE_SHORT_STEP; //
systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; // systemSettings.TempChangeLongStep = TEMP_CHANGE_LONG_STEP; //
systemSettings.KeepAwakePulse= POWER_PULSE_DEFAULT;
saveSettings(); // Save defaults saveSettings(); // Save defaults
} }

View File

@@ -68,6 +68,8 @@ static void settings_displayTempChangeShortStep(void);
static void settings_setTempChangeShortStep(void); static void settings_setTempChangeShortStep(void);
static void settings_displayTempChangeLongStep(void); static void settings_displayTempChangeLongStep(void);
static void settings_setTempChangeLongStep(void); static void settings_setTempChangeLongStep(void);
static void settings_displayPowerPulse(void);
static void settings_setPowerPulse(void);
// Menu functions // Menu functions
static void settings_displaySolderingMenu(void); static void settings_displaySolderingMenu(void);
@@ -175,13 +177,16 @@ const menuitem UIMenu[] = {
{ (const char*) SettingsDescriptions[5], { settings_setTempF }, { { (const char*) SettingsDescriptions[5], { settings_setTempF }, {
settings_displayTempF } }, /* Temperature units*/ settings_displayTempF } }, /* Temperature units*/
#endif #endif
{ (const char*) SettingsDescriptions[7], { settings_setDisplayRotation }, { { (const char*) SettingsDescriptions[7],
{ settings_setDisplayRotation }, {
settings_displayDisplayRotation } }, /*Display Rotation*/ settings_displayDisplayRotation } }, /*Display Rotation*/
{ (const char*) SettingsDescriptions[11], { settings_setCoolingBlinkEnabled }, { { (const char*) SettingsDescriptions[11], {
settings_setCoolingBlinkEnabled }, {
settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/ settings_displayCoolingBlinkEnabled } }, /*Cooling blink warning*/
{ (const char*) SettingsDescriptions[16], { settings_setScrollSpeed }, { { (const char*) SettingsDescriptions[16], { settings_setScrollSpeed }, {
settings_displayScrollSpeed } }, /*Scroll Speed for descriptions*/ settings_displayScrollSpeed } }, /*Scroll Speed for descriptions*/
{ (const char*) SettingsDescriptions[23], { settings_setReverseButtonTempChangeEnabled }, { { (const char*) SettingsDescriptions[23], {
settings_setReverseButtonTempChangeEnabled }, {
settings_displayReverseButtonTempChangeEnabled } }, /* Reverse Temp change buttons + - */ settings_displayReverseButtonTempChangeEnabled } }, /* Reverse Temp change buttons + - */
{ NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
}; };
@@ -212,6 +217,7 @@ const menuitem advancedMenu[] = {
* Calibrate Temperature * Calibrate Temperature
* Calibrate Input V * Calibrate Input V
* Reset Settings * Reset Settings
* Power Pulse
*/ */
{ (const char*) SettingsDescriptions[21], { settings_setPowerLimitEnable }, { { (const char*) SettingsDescriptions[21], { settings_setPowerLimitEnable }, {
settings_displayPowerLimitEnable } }, /*Power limit enable*/ settings_displayPowerLimitEnable } }, /*Power limit enable*/
@@ -228,6 +234,8 @@ const menuitem advancedMenu[] = {
settings_displayCalibrate } }, /*Calibrate tip*/ settings_displayCalibrate } }, /*Calibrate tip*/
{ (const char*) SettingsDescriptions[14], { settings_setCalibrateVIN }, { { (const char*) SettingsDescriptions[14], { settings_setCalibrateVIN }, {
settings_displayCalibrateVIN } }, /*Voltage input cal*/ settings_displayCalibrateVIN } }, /*Voltage input cal*/
{ (const char*) SettingsDescriptions[26], { settings_setPowerPulse }, {
settings_displayPowerPulse } }, /*Power Pulse adjustment */
{ NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE { NULL, { NULL }, { NULL } } // end of menu marker. DO NOT REMOVE
}; };
@@ -366,8 +374,7 @@ static void settings_setSleepTemp(void) {
systemSettings.SleepTemp += 20; systemSettings.SleepTemp += 20;
if (systemSettings.SleepTemp > 580) if (systemSettings.SleepTemp > 580)
systemSettings.SleepTemp = 120; systemSettings.SleepTemp = 120;
} } else
else
#endif #endif
{ {
systemSettings.SleepTemp += 10; systemSettings.SleepTemp += 10;
@@ -746,7 +753,8 @@ static void settings_setCalibrateVIN(void) {
} }
static void settings_setReverseButtonTempChangeEnabled(void) { static void settings_setReverseButtonTempChangeEnabled(void) {
systemSettings.ReverseButtonTempChangeEnabled = !systemSettings.ReverseButtonTempChangeEnabled; systemSettings.ReverseButtonTempChangeEnabled =
!systemSettings.ReverseButtonTempChangeEnabled;
} }
static void settings_displayReverseButtonTempChangeEnabled(void) { static void settings_displayReverseButtonTempChangeEnabled(void) {
@@ -776,6 +784,22 @@ static void settings_displayTempChangeLongStep(void) {
OLED::printNumber(systemSettings.TempChangeLongStep, 3); OLED::printNumber(systemSettings.TempChangeLongStep, 3);
} }
static void settings_setPowerPulse(void) {
systemSettings.KeepAwakePulse += POWER_PULSE_INCREMENT;
systemSettings.KeepAwakePulse %= POWER_PULSE_MAX;
}
static void settings_displayPowerPulse(void) {
printShortDescription(26, 5);
if (systemSettings.KeepAwakePulse) {
OLED::printNumber(systemSettings.KeepAwakePulse / 10, 1);
OLED::print(SymbolDot);
OLED::printNumber(systemSettings.KeepAwakePulse % 10, 1);
} else {
OLED::drawCheckbox(false);
}
}
static void displayMenu(size_t index) { static void displayMenu(size_t index) {
// Call into the menu // Call into the menu
OLED::setFont(1); OLED::setFont(1);
@@ -785,7 +809,8 @@ static void displayMenu(size_t index) {
// Draw symbol // Draw symbol
// 16 pixel wide image // 16 pixel wide image
// 2 pixel wide scrolling indicator // 2 pixel wide scrolling indicator
OLED::drawArea(96 - 16 - 2, 0, 16, 16, (&SettingsMenuIcons[(16 * 2) * index])); OLED::drawArea(96 - 16 - 2, 0, 16, 16,
(&SettingsMenuIcons[(16 * 2) * index]));
} }
static void settings_displayCalibrateVIN(void) { static void settings_displayCalibrateVIN(void) {

View File

@@ -36,16 +36,13 @@ uint32_t MOVTaskBuffer[MOVTaskStackSize];
osStaticThreadDef_t MOVTaskControlBlock; osStaticThreadDef_t MOVTaskControlBlock;
static TaskHandle_t pidTaskNotification = NULL; static TaskHandle_t pidTaskNotification = NULL;
static TickType_t powerPulseRate = 1000;
static TickType_t powerPulseDuration = 50;
void startGUITask(void const *argument); void startGUITask(void const *argument);
void startPIDTask(void const *argument); void startPIDTask(void const *argument);
void startMOVTask(void const *argument); void startMOVTask(void const *argument);
// End FreeRTOS // End FreeRTOS
static const int maxPowerIdleTicks = 1000;
static const int powerPulseTicks = 50;
static const int x10PowerPulseWatts = 3;
// Main sets up the hardware then hands over to the FreeRTOS kernel // Main sets up the hardware then hands over to the FreeRTOS kernel
int main(void) { int main(void) {
/* Reset of all peripherals, Initializes the Flash interface and the Systick. /* Reset of all peripherals, Initializes the Flash interface and the Systick.
@@ -113,14 +110,9 @@ void startPIDTask(void const *argument __unused) {
* control PWM. * control PWM.
*/ */
setTipX10Watts(0); // disable the output driver if the output is set to be off setTipX10Watts(0); // disable the output driver if the output is set to be off
TickType_t lastPowerPulseStart = 0;
TickType_t lastPowerPulseEnd = 0;
#ifdef MODEL_TS80
//Set power management code to the tip resistance in ohms * 10
TickType_t lastPowerPulse = 0;
#else
#endif
history<int32_t, PID_TIM_HZ> tempError = { { 0 }, 0, 0 }; history<int32_t, PID_TIM_HZ> tempError = { { 0 }, 0, 0 };
currentTempTargetDegC = 0; // Force start with no output (off). If in sleep / soldering this will currentTempTargetDegC = 0; // Force start with no output (off). If in sleep / soldering this will
// be over-ridden rapidly // be over-ridden rapidly
@@ -183,18 +175,23 @@ void startPIDTask(void const *argument __unused) {
// Unfortunately, our temp signal is too noisy to really help. // Unfortunately, our temp signal is too noisy to really help.
} }
#ifdef MODEL_TS80 //If the user turns on the option of using an occasional pulse to keep the power bank on
//If its a TS80, we want to have the option of using an occasional pulse to keep the power bank on if (systemSettings.KeepAwakePulse) {
if (((xTaskGetTickCount() - lastPowerPulse) > maxPowerIdleTicks)
&& (x10WattsOut < x10PowerPulseWatts)) { if (xTaskGetTickCount() - lastPowerPulseStart
x10WattsOut = x10PowerPulseWatts; > powerPulseRate) {
lastPowerPulseStart = xTaskGetTickCount();
lastPowerPulseEnd = lastPowerPulseStart
+ powerPulseDuration;
} }
if (((xTaskGetTickCount() - lastPowerPulse)
> (maxPowerIdleTicks + powerPulseTicks)) //If current PID is less than the pulse level, check if we want to constrain to the pulse as the floor
&& (x10WattsOut >= x10PowerPulseWatts)) { if (x10WattsOut < systemSettings.KeepAwakePulse
lastPowerPulse = xTaskGetTickCount(); && xTaskGetTickCount() < lastPowerPulseEnd) {
x10WattsOut = systemSettings.KeepAwakePulse;
} }
#endif }
//Secondary safety check to forcefully disable header when within ADC noise of top of ADC //Secondary safety check to forcefully disable header when within ADC noise of top of ADC
if (getTipRawTemp(0) > (0x7FFF - 150)) { if (getTipRawTemp(0) > (0x7FFF - 150)) {
x10WattsOut = 0; x10WattsOut = 0;
@@ -263,8 +260,7 @@ void startMOVTask(void const *argument __unused) {
datax[currentPointer] = (int32_t) tx; datax[currentPointer] = (int32_t) tx;
datay[currentPointer] = (int32_t) ty; datay[currentPointer] = (int32_t) ty;
dataz[currentPointer] = (int32_t) tz; dataz[currentPointer] = (int32_t) tz;
if (!accelInit) if (!accelInit) {
{
for (uint8_t i = currentPointer + 1; i < MOVFilter; i++) { for (uint8_t i = currentPointer + 1; i < MOVFilter; i++) {
datax[i] = (int32_t) tx; datax[i] = (int32_t) tx;
datay[i] = (int32_t) ty; datay[i] = (int32_t) ty;
@@ -310,7 +306,8 @@ void startMOVTask(void const *argument __unused) {
bool showBootLogoIfavailable() { bool showBootLogoIfavailable() {
// Do not show logo data if signature is not found. // Do not show logo data if signature is not found.
if (LOGO_HEADER_VALUE != *(reinterpret_cast<const uint32_t *>(FLASH_LOGOADDR))) { if (LOGO_HEADER_VALUE
!= *(reinterpret_cast<const uint32_t*>(FLASH_LOGOADDR))) {
return false; return false;
} }
@@ -344,12 +341,10 @@ void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
FRToSI2C::CpltCallback(); FRToSI2C::CpltCallback();
} }
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) { void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c __unused) {
asm("bkpt");
FRToSI2C::CpltCallback(); FRToSI2C::CpltCallback();
} }
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) { void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
//asm("bkpt");
FRToSI2C::CpltCallback(); FRToSI2C::CpltCallback();
} }
@@ -358,7 +353,7 @@ void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c __unused) {
} }
void vApplicationStackOverflowHook(xTaskHandle *pxTask __unused, void vApplicationStackOverflowHook(xTaskHandle *pxTask __unused,
signed portCHAR *pcTaskName __unused) { signed portCHAR *pcTaskName __unused) {
asm("bkpt");
// We dont have a good way to handle a stack overflow at this point in time // We dont have a good way to handle a stack overflow at this point in time
NVIC_SystemReset(); NVIC_SystemReset();
} }

View File

@@ -54,7 +54,14 @@
#define TEMP_CHANGE_SHORT_STEP_MAX 50 // Temp change short step MAX value #define TEMP_CHANGE_SHORT_STEP_MAX 50 // Temp change short step MAX value
#define TEMP_CHANGE_LONG_STEP_MAX 100 // Temp change long step MAX value #define TEMP_CHANGE_LONG_STEP_MAX 100 // Temp change long step MAX value
/* Power pulse for keeping power banks awake*/
#define POWER_PULSE_INCREMENT 1
#define POWER_PULSE_MAX 50 // x10 max watts
#ifdef MODEL_TS100
#define POWER_PULSE_DEFAULT 0
#else
#define POWER_PULSE_DEFAULT 5
#endif
/** /**
* OLED Orientation Sensitivity on Automatic mode! * OLED Orientation Sensitivity on Automatic mode!
* Motion Sensitivity <0=Off 1=Least Sensitive 9=Most Sensitive> * Motion Sensitivity <0=Off 1=Least Sensitive 9=Most Sensitive>