mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
19392: ztimer: Fix doc on ztimer_remove r=benpicco a=bergzand ### Contribution description See the subject ### Testing procedure Read the modified docs ### Issues/PRs references None 19398: gnrc_ipv6_static_addr: fix build with only static address r=benpicco a=benpicco 19399: drivers/usbdev_synopsys_dwc2: add ESP32x power management r=benpicco a=gschorcht ### Contribution description This PR adds power management handling for ESP32x SoCs. ### Testing procedure Use and ESP32-S2 or ESP32-S3 board and flash `tests/periph_pm` using the `stdio_cdc_acm` ``` USEMODULE=stdio_cdc_acm BOARD=esp32s3-devkit make -j8 -C tests/periph_pm flash ``` Connect the terminal to the board and execute command: ``` set_rtc 1 1 ``` The console should continue to work after the 1-s light sleep. ### Issues/PRs references Co-authored-by: Koen Zandberg <koen@bergzand.net> Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de> Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
This commit is contained in:
commit
1a787d4669
@ -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 = {
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user