mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-20 13:17:55 -06:00
stm32: Move usb_request_bootloader() to chip specific code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
fce98c5519
commit
8cb3d09484
4 changed files with 24 additions and 20 deletions
|
@ -10,7 +10,6 @@
|
|||
#include "board/armcm_timer.h" // udelay
|
||||
#include "board/gpio.h" // gpio_out_setup
|
||||
#include "board/io.h" // writeb
|
||||
#include "board/irq.h" // irq_disable
|
||||
#include "board/usb_cdc.h" // usb_notify_ep0
|
||||
#include "board/usb_cdc_ep.h" // USB_CDC_EP_BULK_IN
|
||||
#include "command.h" // DECL_CONSTANT_STR
|
||||
|
@ -207,20 +206,6 @@ usb_set_configure(void)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
usb_request_bootloader(void)
|
||||
{
|
||||
if (!CONFIG_STM32_FLASH_START_2000)
|
||||
return;
|
||||
// Enter "stm32duino" bootloader
|
||||
irq_disable();
|
||||
RCC->APB1ENR |= RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN;
|
||||
PWR->CR |= PWR_CR_DBP;
|
||||
BKP->DR10 = 0x01;
|
||||
PWR->CR &=~ PWR_CR_DBP;
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Setup and interrupts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue