diff --git a/examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_ioports.c b/examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_ioports.c index 3ada2ee3e33d13..8b558f18fc059f 100644 --- a/examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_ioports.c +++ b/examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_ioports.c @@ -61,16 +61,25 @@ void rsi_hal_config_gpio(uint8_t gpio_number, uint8_t mode, uint8_t value) CMU_ClockEnable(cmuClock_GPIO, true); - switch(gpio_number) - { - case RSI_HAL_SLEEP_CONFIRM_PIN: GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1); break; + switch (gpio_number) + { + case RSI_HAL_SLEEP_CONFIRM_PIN: + GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1); + break; #ifndef LOGGING_STATS - case RSI_HAL_WAKEUP_INDICATION_PIN: GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, 0); break; + case RSI_HAL_WAKEUP_INDICATION_PIN: + GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, 0); + break; #endif - case RSI_HAL_RESET_PIN: GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, 1); break; - case RSI_HAL_LP_SLEEP_CONFIRM_PIN: GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1);break; - default: break; - } + case RSI_HAL_RESET_PIN: + GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, 1); + break; + case RSI_HAL_LP_SLEEP_CONFIRM_PIN: + GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1); + break; + default: + break; + } } /*===========================================================*/ @@ -82,19 +91,31 @@ void rsi_hal_config_gpio(uint8_t gpio_number, uint8_t mode, uint8_t value) * @return none * @description This API is used to drives or makes the host gpio value high. */ -void rsi_hal_set_gpio(uint8_t gpio_number) { - switch(gpio_number) - { - case RSI_HAL_SLEEP_CONFIRM_PIN: GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1); break; +void rsi_hal_set_gpio(uint8_t gpio_number) +{ + switch (gpio_number) + { + case RSI_HAL_SLEEP_CONFIRM_PIN: + GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1); + break; #ifndef LOGGING_STATS - case RSI_HAL_WAKEUP_INDICATION_PIN: GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeInput, 1); break; + case RSI_HAL_WAKEUP_INDICATION_PIN: + GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeInput, 1); + break; #else - case RSI_HAL_WAKEUP_INDICATION_PIN: GPIO_PinModeSet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin, gpioModeInput, 1); break; + case RSI_HAL_WAKEUP_INDICATION_PIN: + GPIO_PinModeSet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin, gpioModeInput, 1); + break; #endif - case RSI_HAL_RESET_PIN: GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModeWiredOrPullDown, 1); break; - case RSI_HAL_LP_SLEEP_CONFIRM_PIN: GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1);break; - default: break; - } + case RSI_HAL_RESET_PIN: + GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModeWiredOrPullDown, 1); + break; + case RSI_HAL_LP_SLEEP_CONFIRM_PIN: + GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1); + break; + default: + break; + } } /*===========================================================*/ /** @@ -105,21 +126,29 @@ void rsi_hal_set_gpio(uint8_t gpio_number) { * @return gpio pin value * @description This API is used to configure get the gpio pin value. */ -uint8_t rsi_hal_get_gpio(uint8_t gpio_number) { - switch(gpio_number) - { - case RSI_HAL_SLEEP_CONFIRM_PIN: return GPIO_PinInGet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); +uint8_t rsi_hal_get_gpio(uint8_t gpio_number) +{ + switch (gpio_number) + { + case RSI_HAL_SLEEP_CONFIRM_PIN: + return GPIO_PinInGet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); #ifndef LOGGING_STATS - case RSI_HAL_WAKEUP_INDICATION_PIN: return GPIO_PinInGet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin); + case RSI_HAL_WAKEUP_INDICATION_PIN: + return GPIO_PinInGet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin); #else - case RSI_HAL_WAKEUP_INDICATION_PIN: return GPIO_PinInGet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin); + case RSI_HAL_WAKEUP_INDICATION_PIN: + return GPIO_PinInGet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin); #endif - case RSI_HAL_RESET_PIN: return GPIO_PinInGet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); - case RSI_HAL_MODULE_INTERRUPT_PIN: return GPIO_PinInGet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin); - case RSI_HAL_LP_SLEEP_CONFIRM_PIN: return GPIO_PinInGet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); - default: break; - } - return 0; + case RSI_HAL_RESET_PIN: + return GPIO_PinInGet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); + case RSI_HAL_MODULE_INTERRUPT_PIN: + return GPIO_PinInGet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin); + case RSI_HAL_LP_SLEEP_CONFIRM_PIN: + return GPIO_PinInGet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); + default: + break; + } + return 0; } /*===========================================================*/ /** @@ -130,25 +159,34 @@ uint8_t rsi_hal_get_gpio(uint8_t gpio_number) { * @return none * @description This API is used to drives or makes the host gpio value low. */ -void rsi_hal_clear_gpio(uint8_t gpio_number) { - switch(gpio_number) - { +void rsi_hal_clear_gpio(uint8_t gpio_number) +{ + switch (gpio_number) + { case RSI_HAL_SLEEP_CONFIRM_PIN: - GPIO_PinOutClear(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); break; + GPIO_PinOutClear(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); + break; #ifndef LOGGING_STATS - //fall through + // fall through case RSI_HAL_WAKEUP_INDICATION_PIN: - GPIO_PinOutClear(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin); break; + GPIO_PinOutClear(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin); + break; #else - //fall through + // fall through case RSI_HAL_WAKEUP_INDICATION_PIN: - GPIO_PinOutClear(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin); break; + GPIO_PinOutClear(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin); + break; #endif - //fall through - case RSI_HAL_RESET_PIN: GPIO_PinOutClear(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); break; - //fall through - case RSI_HAL_LP_SLEEP_CONFIRM_PIN: GPIO_PinOutClear(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); break; - //fall through - default: break; - } + // fall through + case RSI_HAL_RESET_PIN: + GPIO_PinOutClear(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); + break; + // fall through + case RSI_HAL_LP_SLEEP_CONFIRM_PIN: + GPIO_PinOutClear(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin); + break; + // fall through + default: + break; + } } diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.c b/examples/platform/silabs/efr32/rs911x/rsi_if.c index abac307d1e181d..2a6c0aa955e996 100644 --- a/examples/platform/silabs/efr32/rs911x/rsi_if.c +++ b/examples/platform/silabs/efr32/rs911x/rsi_if.c @@ -657,7 +657,8 @@ void wfx_rsi_task(void * arg) #if CHIP_DEVICE_CONFIG_ENABLE_SED // enabling the power save mode for RS9116 if sleepy device is enabled rsi_status = rsi_wlan_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP); - if (status != RSI_SUCCESS) { + if (status != RSI_SUCCESS) + { WFX_RSI_LOG("Powersave Config Failed, Error Code : 0x%lX", status); return status; } @@ -685,7 +686,8 @@ void wfx_rsi_task(void * arg) #if CHIP_DEVICE_CONFIG_ENABLE_SED // enabling the power save mode for RS9116 if sleepy device is enabled rsi_status = rsi_wlan_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP); - if (rsi_status != RSI_SUCCESS) { + if (rsi_status != RSI_SUCCESS) + { WFX_RSI_LOG("Powersave Config Failed, Error Code : 0x%lX", rsi_status); } WFX_RSI_LOG("Powersave Config Success"); diff --git a/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp b/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp index 7f70b97c0f92b8..6fd67f1b9b6e9f 100644 --- a/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp +++ b/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp @@ -224,10 +224,8 @@ void ConnectivityManagerImpl::_OnWiFiStationProvisionChange() CHIP_ERROR ConnectivityManagerImpl::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & SEDIntervalsConfig) { // For now Wi-Fi uses DTIM power save mode - SEDIntervalsConfig.ActiveIntervalMS = - chip::System::Clock::Milliseconds32(50); - SEDIntervalsConfig.IdleIntervalMS = - chip::System::Clock::Milliseconds32(300); + SEDIntervalsConfig.ActiveIntervalMS = chip::System::Clock::Milliseconds32(50); + SEDIntervalsConfig.IdleIntervalMS = chip::System::Clock::Milliseconds32(300); return CHIP_NO_ERROR; }