From 5e22c09660ea82b6c2ee3d86502e9a906db1f14b Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Sun, 15 May 2022 15:01:44 -0500 Subject: [PATCH] convert unlikely panic to hard_assert to not waste space for string (#826) --- .../rp2040_usb_device_enumeration.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c b/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c index e1073ca..ad9e822 100644 --- a/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c +++ b/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c @@ -90,9 +90,7 @@ static void hw_enumeration_fix_force_ls_j(void) { // DM must be 0 for this to work. This is true if it is selected // to any other function. fn 8 on this pin is only for debug so shouldn't // be selected - if (gpio_get_function(dm) == 8) { - panic("Not expecting DM to be function 8"); - } + hard_assert(gpio_get_function(dm) != 8); // Before changing any pin state, take a copy of the current gpio control register gpio_ctrl_prev = iobank0_hw->io[dp].ctrl;