1
0
forked from me/IronOS

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.Instance = IWDG;
hiwdg.Init.Prescaler = IWDG_PRESCALER_256; hiwdg.Init.Prescaler = IWDG_PRESCALER_256;
hiwdg.Init.Reload = 50; hiwdg.Init.Reload = 100;
HAL_IWDG_Init(&hiwdg); HAL_IWDG_Init(&hiwdg);
} }

View File

@@ -760,14 +760,14 @@ void startGUITask(void const *argument) {
if (tipTemp < 50) { if (tipTemp < 50) {
if (systemSettings.sensitivity) { if (systemSettings.sensitivity) {
if ((xTaskGetTickCount() - lastMovementTime) > 6000 if ((xTaskGetTickCount() - lastMovementTime) > 6000
&& (xTaskGetTickCount() - lastButtonTime) > 6000) && (xTaskGetTickCount() - lastButtonTime) > 6000) {
lcd.displayOnOff(false); // turn lcd off when no movement lcd.displayOnOff(false); // turn lcd off when no movement
else } else
lcd.displayOnOff(true); // turn lcd on lcd.displayOnOff(true); // turn lcd on
} else } else
lcd.displayOnOff(true); // turn lcd on lcd.displayOnOff(true); // turn lcd on - disabled motion sleep
} else } else
lcd.displayOnOff(true); // turn lcd on lcd.displayOnOff(true); // turn lcd on when temp > 50C
if (tipTemp > 600) if (tipTemp > 600)
tipTemp = 0; tipTemp = 0;
@@ -841,9 +841,9 @@ void startPIDTask(void const *argument) {
int32_t integralCount = 0; int32_t integralCount = 0;
int32_t derivativeLastValue = 0; int32_t derivativeLastValue = 0;
int32_t kp, ki, kd; int32_t kp, ki, kd;
kp = 30; kp = 40;
ki = 60; ki = 60;
kd = 20; kd = 30;
// REMEBER ^^^^ These constants are backwards // REMEBER ^^^^ These constants are backwards
// They act as dividers, so to 'increase' a P term, you make the number // They act as dividers, so to 'increase' a P term, you make the number
// smaller. // smaller.
@@ -879,9 +879,9 @@ void startPIDTask(void const *argument) {
output = 0; output = 0;
} }
/*if (currentlyActiveTemperatureTarget < rawTemp) { if (currentlyActiveTemperatureTarget < rawTemp) {
output = 0; output = 0;
}*/ }
setTipPWM(output); setTipPWM(output);
derivativeLastValue = rawTemp; // store for next loop derivativeLastValue = rawTemp; // store for next loop

View File

@@ -12,35 +12,27 @@ extern TIM_HandleTypeDef htim1; //used for the systick
/******************************************************************************/ /******************************************************************************/
void NMI_Handler(void) { void NMI_Handler(void) {
NVIC_SystemReset();
} }
//We have the assembly for a breakpoint trigger here to halt the system when a debugger is connected //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 // Hardfault handler, often a screwup in the code
void HardFault_Handler(void) { void HardFault_Handler(void) {
while (1) { NVIC_SystemReset();
asm("bkpt");
}
} }
// Memory management unit had an error // Memory management unit had an error
void MemManage_Handler(void) { void MemManage_Handler(void) {
while (1) { NVIC_SystemReset();
asm("bkpt");
}
} }
// Prefetcher or busfault occured // Prefetcher or busfault occured
void BusFault_Handler(void) { void BusFault_Handler(void) {
while (1) { NVIC_SystemReset();
asm("bkpt");
}
} }
void UsageFault_Handler(void) { void UsageFault_Handler(void) {
while (1) { NVIC_SystemReset();
asm("bkpt");
}
} }
void DebugMon_Handler(void) { void DebugMon_Handler(void) {