aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2018-03-29 21:36:16 +1100
committerBen V. Brown <[email protected]>2018-03-29 21:36:16 +1100
commitfe5ee911044446f135a7fd2d05ec2ccc673c7db0 (patch)
tree24931b1e09974d6f70275836ac8fd806ea926fea
parent762236b485ce6e649b3208f2c74d234e9db18a93 (diff)
downloadIronOS-fe5ee911044446f135a7fd2d05ec2ccc673c7db0.tar.gz
IronOS-fe5ee911044446f135a7fd2d05ec2ccc673c7db0.zip
Swap breakpoints to resets to try and prevent lockups
-rw-r--r--workspace/TS100/src/Setup.c2
-rw-r--r--workspace/TS100/src/main.cpp18
-rw-r--r--workspace/TS100/src/stm32f1xx_it.c18
3 files changed, 15 insertions, 23 deletions
diff --git a/workspace/TS100/src/Setup.c b/workspace/TS100/src/Setup.c
index f69a26e5..fb6ee650 100644
--- a/workspace/TS100/src/Setup.c
+++ b/workspace/TS100/src/Setup.c
@@ -170,7 +170,7 @@ static void MX_IWDG_Init(void) {
hiwdg.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_256;
- hiwdg.Init.Reload = 50;
+ hiwdg.Init.Reload = 100;
HAL_IWDG_Init(&hiwdg);
}
diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp
index 499e98bb..daa356f9 100644
--- a/workspace/TS100/src/main.cpp
+++ b/workspace/TS100/src/main.cpp
@@ -760,14 +760,14 @@ void startGUITask(void const *argument) {
if (tipTemp < 50) {
if (systemSettings.sensitivity) {
if ((xTaskGetTickCount() - lastMovementTime) > 6000
- && (xTaskGetTickCount() - lastButtonTime) > 6000)
+ && (xTaskGetTickCount() - lastButtonTime) > 6000) {
lcd.displayOnOff(false); // turn lcd off when no movement
- else
+ } else
lcd.displayOnOff(true); // turn lcd on
} else
- lcd.displayOnOff(true); // turn lcd on
+ lcd.displayOnOff(true); // turn lcd on - disabled motion sleep
} else
- lcd.displayOnOff(true); // turn lcd on
+ lcd.displayOnOff(true); // turn lcd on when temp > 50C
if (tipTemp > 600)
tipTemp = 0;
@@ -841,9 +841,9 @@ void startPIDTask(void const *argument) {
int32_t integralCount = 0;
int32_t derivativeLastValue = 0;
int32_t kp, ki, kd;
- kp = 30;
+ kp = 40;
ki = 60;
- kd = 20;
+ kd = 30;
// REMEBER ^^^^ These constants are backwards
// They act as dividers, so to 'increase' a P term, you make the number
// smaller.
@@ -879,9 +879,9 @@ void startPIDTask(void const *argument) {
output = 0;
}
- /*if (currentlyActiveTemperatureTarget < rawTemp) {
- output = 0;
- }*/
+ if (currentlyActiveTemperatureTarget < rawTemp) {
+ output = 0;
+ }
setTipPWM(output);
derivativeLastValue = rawTemp; // store for next loop
diff --git a/workspace/TS100/src/stm32f1xx_it.c b/workspace/TS100/src/stm32f1xx_it.c
index dae01223..68c4658e 100644
--- a/workspace/TS100/src/stm32f1xx_it.c
+++ b/workspace/TS100/src/stm32f1xx_it.c
@@ -12,35 +12,27 @@ extern TIM_HandleTypeDef htim1; //used for the systick
/******************************************************************************/
void NMI_Handler(void) {
-
+ NVIC_SystemReset();
}
//We have the assembly for a breakpoint trigger here to halt the system when a debugger is connected
// Hardfault handler, often a screwup in the code
void HardFault_Handler(void) {
- while (1) {
- asm("bkpt");
- }
+ NVIC_SystemReset();
}
// Memory management unit had an error
void MemManage_Handler(void) {
- while (1) {
- asm("bkpt");
- }
+ NVIC_SystemReset();
}
// Prefetcher or busfault occured
void BusFault_Handler(void) {
- while (1) {
- asm("bkpt");
- }
+ NVIC_SystemReset();
}
void UsageFault_Handler(void) {
- while (1) {
- asm("bkpt");
- }
+ NVIC_SystemReset();
}
void DebugMon_Handler(void) {