aboutsummaryrefslogtreecommitdiffstats
path: root/src/rp2040
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-07-25 13:17:23 -0400
committerKevin O'Connor <kevin@koconnor.net>2022-07-29 11:40:54 -0400
commit18ff84aa04c3dbf39166d4bad210e91a9381960f (patch)
tree543ed2f14b4176a4ce7e8507cc3a2371dcc64b65 /src/rp2040
parent48b60a8021bd02d998fd3d6ea9e55645e3dc75e4 (diff)
downloadkutter-18ff84aa04c3dbf39166d4bad210e91a9381960f.tar.gz
kutter-18ff84aa04c3dbf39166d4bad210e91a9381960f.tar.xz
kutter-18ff84aa04c3dbf39166d4bad210e91a9381960f.zip
usb_cdc: Rename usb_request_bootloader() to bootloader_request()
Rename this board API function to a more generic name. This is in preparation for calling the function from the canbus code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/rp2040')
-rw-r--r--src/rp2040/main.c14
-rw-r--r--src/rp2040/usbserial.c7
2 files changed, 14 insertions, 7 deletions
diff --git a/src/rp2040/main.c b/src/rp2040/main.c
index fbbe3b56..462e69c6 100644
--- a/src/rp2040/main.c
+++ b/src/rp2040/main.c
@@ -5,11 +5,13 @@
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <stdint.h> // uint32_t
+#include "board/misc.h" // bootloader_request
#include "hardware/structs/clocks.h" // clock_hw_t
#include "hardware/structs/pll.h" // pll_hw_t
#include "hardware/structs/resets.h" // sio_hw
#include "hardware/structs/watchdog.h" // watchdog_hw
#include "hardware/structs/xosc.h" // xosc_hw
+#include "internal.h" // enable_pclock
#include "sched.h" // sched_main
@@ -37,6 +39,18 @@ DECL_INIT(watchdog_init);
/****************************************************************
+ * Bootloader
+ ****************************************************************/
+
+void
+bootloader_request(void)
+{
+ // Use the bootrom-provided code to reset into BOOTSEL mode
+ reset_to_usb_boot(0, 0);
+}
+
+
+/****************************************************************
* Clock setup
****************************************************************/
diff --git a/src/rp2040/usbserial.c b/src/rp2040/usbserial.c
index 83838d2d..aafe53ef 100644
--- a/src/rp2040/usbserial.c
+++ b/src/rp2040/usbserial.c
@@ -160,13 +160,6 @@ usb_set_configure(void)
USB_BUF_CTRL_AVAIL | USB_BUF_CTRL_LAST | DPBUF_SIZE);
}
-void
-usb_request_bootloader(void)
-{
- // Use the bootrom-provided code to reset into BOOTSEL mode
- reset_to_usb_boot(0, 0);
-}
-
/****************************************************************
* USB Errata workaround