Swap breakpoints to resets to try and prevent lockups

This commit is contained in:
Ben V. Brown
2018-03-29 21:36:16 +11:00
parent 762236b485
commit fe5ee91104
3 changed files with 15 additions and 23 deletions

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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) {