mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Change rom_reset_usb_boot to simply call rom_reset_usb_boot_extra
(in order to reduce code-duplication)
This commit is contained in:
parent
1ca77d6afd
commit
974f70c744
1 changed files with 3 additions and 16 deletions
|
|
@ -33,21 +33,8 @@ bool rom_funcs_lookup(uint32_t *table, unsigned int count) {
|
||||||
|
|
||||||
|
|
||||||
void __attribute__((noreturn)) rom_reset_usb_boot(uint32_t usb_activity_gpio_pin_mask, uint32_t disable_interface_mask) {
|
void __attribute__((noreturn)) rom_reset_usb_boot(uint32_t usb_activity_gpio_pin_mask, uint32_t disable_interface_mask) {
|
||||||
#ifdef ROM_FUNC_RESET_USB_BOOT
|
int usb_activity_gpio_pin = usb_activity_gpio_pin_mask ? __builtin_ctz(usb_activity_gpio_pin_mask) : -1;
|
||||||
rom_reset_usb_boot_fn func = (rom_reset_usb_boot_fn) rom_func_lookup(ROM_FUNC_RESET_USB_BOOT);
|
rom_reset_usb_boot_extra(usb_activity_gpio_pin, disable_interface_mask, false);
|
||||||
func(usb_activity_gpio_pin_mask, disable_interface_mask);
|
|
||||||
#elif defined(ROM_FUNC_REBOOT)
|
|
||||||
uint32_t flags = disable_interface_mask;
|
|
||||||
if (usb_activity_gpio_pin_mask) {
|
|
||||||
flags |= BOOTSEL_FLAG_GPIO_PIN_SPECIFIED;
|
|
||||||
// the parameter is actually the gpio number, but we only care if BOOTSEL_FLAG_GPIO_PIN_SPECIFIED
|
|
||||||
usb_activity_gpio_pin_mask = (uint32_t)__builtin_ctz(usb_activity_gpio_pin_mask);
|
|
||||||
}
|
|
||||||
rom_reboot(REBOOT2_FLAG_REBOOT_TYPE_BOOTSEL | REBOOT2_FLAG_NO_RETURN_ON_SUCCESS, 10, flags, usb_activity_gpio_pin_mask);
|
|
||||||
__builtin_unreachable();
|
|
||||||
#else
|
|
||||||
panic_unsupported();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pin, uint32_t disable_interface_mask, bool usb_activity_gpio_pin_active_low) {
|
void __attribute__((noreturn)) rom_reset_usb_boot_extra(int usb_activity_gpio_pin, uint32_t disable_interface_mask, bool usb_activity_gpio_pin_active_low) {
|
||||||
|
|
@ -196,4 +183,4 @@ int rom_pick_ab_partition_during_update(uint32_t *workarea_base, uint32_t workar
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue