From fa0ab40920c154fad37685032279ff80c3d256d0 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Tue, 14 Mar 2023 18:16:47 +0100 Subject: [PATCH 1/4] ztimer: Fix doc on ztimer_remove --- sys/include/ztimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/include/ztimer.h b/sys/include/ztimer.h index 30b9428532..a59201614c 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. From 3f2d36d14f058a015247d964a6dca5d401fb516f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 16 Mar 2023 11:19:53 +0100 Subject: [PATCH 2/4] gnrc_static: fix build if only static address is set --- .../gnrc/network_layer/ipv6/static_addr/gnrc_ipv6_static_addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..49ce13f96b 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; } From d3880558505ca521d0c3e7bb5c1be98f9f214398 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Thu, 16 Mar 2023 12:27:47 +0100 Subject: [PATCH 3/4] drivers/usbdev_synopsys_dwc2: add ESP32x power management --- drivers/usbdev_synopsys_dwc2/usbdev_synopsys_dwc2.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 = { From a473ca9ed521db88d9f2686e271f9323a32b5c6f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 16 Mar 2023 11:20:23 +0100 Subject: [PATCH 4/4] gnrc_static: auto-select interface if there is only one --- .../ipv6/static_addr/gnrc_ipv6_static_addr.c | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) 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 49ce13f96b..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 @@ -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; + } } }