diff --git a/drivers/usbdev_synopsys_dwc2/usbdev_synopsys_dwc2.c b/drivers/usbdev_synopsys_dwc2/usbdev_synopsys_dwc2.c index 3977d5d5ac..1564aaf37c 100644 --- a/drivers/usbdev_synopsys_dwc2/usbdev_synopsys_dwc2.c +++ b/drivers/usbdev_synopsys_dwc2/usbdev_synopsys_dwc2.c @@ -596,6 +596,8 @@ static void _sleep_periph(const dwc2_usb_otg_fshs_config_t *conf) /* switch USB core clock source either to LFXO or LFRCO */ CMU_ClockSelectSet(cmuClock_USB, CLOCK_LFA); pm_unblock(EFM32_PM_MODE_EM2); +#elif defined(MCU_ESP32) + pm_unblock(ESP_PM_LIGHT_SLEEP); #endif } @@ -613,6 +615,8 @@ static void _wake_periph(const dwc2_usb_otg_fshs_config_t *conf) #else #error "EFM32 family not yet supported" #endif +#elif defined(MCU_ESP32) + pm_block(ESP_PM_LIGHT_SLEEP); #endif *_pcgcctl_reg(conf) &= ~USB_OTG_PCGCCTL_STOPCLK; _flush_rx_fifo(conf); @@ -692,6 +696,9 @@ static void _usbdev_init(usbdev_t *dev) #elif defined(MCU_ESP32) + pm_block(ESP_PM_DEEP_SLEEP); + pm_block(ESP_PM_LIGHT_SLEEP); + usb_phy_handle_t phy_hdl; /* only needed temporarily */ usb_phy_config_t phy_conf = { diff --git a/sys/include/ztimer.h b/sys/include/ztimer.h index f87066031b..006729e17c 100644 --- a/sys/include/ztimer.h +++ b/sys/include/ztimer.h @@ -487,7 +487,7 @@ unsigned ztimer_is_set(const ztimer_clock_t *clock, const ztimer_t *timer); /** * @brief Remove a timer from a clock * - * This will place @p timer in the timer targets queue for @p clock. + * This will remove @p timer from the timer targets queue for @p clock. * * This function does nothing if @p timer is not found in the timer queue of * @p clock. diff --git a/sys/net/gnrc/network_layer/ipv6/static_addr/gnrc_ipv6_static_addr.c b/sys/net/gnrc/network_layer/ipv6/static_addr/gnrc_ipv6_static_addr.c index 29f2a15515..71c9b1b738 100644 --- a/sys/net/gnrc/network_layer/ipv6/static_addr/gnrc_ipv6_static_addr.c +++ b/sys/net/gnrc/network_layer/ipv6/static_addr/gnrc_ipv6_static_addr.c @@ -84,7 +84,7 @@ static void _config_downstream(gnrc_netif_t *downstream) DEBUG("gnrc_ipv6_static_addr: interface %u selected as downstream\n", downstream->pid); - if (CONFIG_GNRC_IPV6_STATIC_PREFIX == NULL) { + if (static_prefix == NULL) { return; } @@ -113,25 +113,34 @@ static void _config_downstream(gnrc_netif_t *downstream) void auto_init_gnrc_ipv6_static_addr(void) { - gnrc_netif_t *netif = NULL; gnrc_netif_t *upstream = NULL; gnrc_netif_t *downstream = NULL; - if (IS_ACTIVE(CONFIG_GNRC_IPV6_STATIC_ADDR_UPSTREAM)) { - upstream = gnrc_netif_get_by_pid(CONFIG_GNRC_IPV6_STATIC_ADDR_UPSTREAM); - } + if (gnrc_netif_highlander() || gnrc_netif_numof() == 1) { + upstream = gnrc_netif_iter(NULL); - if (IS_ACTIVE(CONFIG_GNRC_IPV6_STATIC_ADDR_DOWNSTREAM)) { - downstream = gnrc_netif_get_by_pid(CONFIG_GNRC_IPV6_STATIC_ADDR_DOWNSTREAM); - } + if (IS_ACTIVE(CONFIG_GNRC_IPV6_STATIC_ADDR_UPSTREAM)) { + assert(upstream->pid == CONFIG_GNRC_IPV6_STATIC_ADDR_UPSTREAM); + } + } else { - while ((netif = gnrc_netif_iter(netif))) { - bool is_wired = gnrc_netapi_get(netif->pid, NETOPT_IS_WIRED, 0, NULL, 0) == 1; + if (IS_ACTIVE(CONFIG_GNRC_IPV6_STATIC_ADDR_UPSTREAM)) { + upstream = gnrc_netif_get_by_pid(CONFIG_GNRC_IPV6_STATIC_ADDR_UPSTREAM); + } - if (!upstream && is_wired) { - upstream = netif; - } else if (!downstream && !is_wired) { - downstream = netif; + if (IS_ACTIVE(CONFIG_GNRC_IPV6_STATIC_ADDR_DOWNSTREAM)) { + downstream = gnrc_netif_get_by_pid(CONFIG_GNRC_IPV6_STATIC_ADDR_DOWNSTREAM); + } + + gnrc_netif_t *netif = NULL; + while ((netif = gnrc_netif_iter(netif))) { + bool is_wired = gnrc_netapi_get(netif->pid, NETOPT_IS_WIRED, 0, NULL, 0) == 1; + + if (!upstream && is_wired) { + upstream = netif; + } else if (!downstream && !is_wired) { + downstream = netif; + } } }