Skip to content

Commit 93642cb

Browse files
committed
Update Error_Handler to re-define Heater PWM GPIO to output and pull it low at error
1 parent 5e85d16 commit 93642cb

File tree

1 file changed

+3
-6
lines changed
  • AxxSolder_firmware/Core/Src

1 file changed

+3
-6
lines changed

AxxSolder_firmware/Core/Src/main.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ void settings_menu(){
723723
if(i >= menu_length-3){
724724
LCD_PutStr(190, 45+(i-menu_start)*25, " ", FONT_arial_20X23, RGB_to_BRG(C_WHITE), RGB_to_BRG(C_BLACK));
725725
}
726-
727726
}
728727
}
729728
}
@@ -2546,16 +2545,14 @@ void Error_Handler(void)
25462545
GPIO_InitTypeDef GPIO_InitStruct = {0};
25472546

25482547
/*Configure GPIO pin : CURRENT_Pin */
2549-
GPIO_InitStruct.Pin = CURRENT_Pin;
2548+
GPIO_InitStruct.Pin = HEATER_Pin;
25502549
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
25512550
GPIO_InitStruct.Pull = GPIO_NOPULL;
25522551
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
25532552
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
2553+
HAL_GPIO_WritePin(GPIOF, HEATER_Pin, GPIO_PIN_RESET);
25542554

2555-
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); // Replace GPIOx with the appropriate GPIO port
2556-
HAL_GPIO_WritePin(GPIOF, CURRENT_Pin, GPIO_PIN_RESET);
2557-
2558-
__disable_irq();
2555+
__disable_irq();
25592556
while (1)
25602557
{
25612558
}

0 commit comments

Comments
 (0)