From 0fc3464017aaa8ef8c5e1ab085075a983a98dc2d Mon Sep 17 00:00:00 2001 From: Chirag Bansal Date: Thu, 22 Jun 2023 12:21:26 +0000 Subject: [PATCH] Pull request #907: [Silabs][Wf200] Disabling sleep Merge in WMN_TOOLS/matter from bugfix/wf200_sleep to RC_2.1.0-1.1 Squashed commit of the following: commit c14edfc41dd9e8427fd242f3fcd3055043cb33ec Author: Chirag Bansal Date: Thu Jun 22 11:24:49 2023 +0530 changing the condition so that wf200 doesn't go in sleep by default commit 694226bfb43e8fdfe0e2bb16fd8570bb740aec07 Author: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Mon May 29 10:11:02 2023 -0400 Fix matter shell with wf200 (#26845) --- examples/platform/silabs/efr32/uart.cpp | 13 ++++++------- examples/platform/silabs/efr32/wf200/host_if.cpp | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/platform/silabs/efr32/uart.cpp b/examples/platform/silabs/efr32/uart.cpp index 8fab5f11fe4b00..650f482bc65346 100644 --- a/examples/platform/silabs/efr32/uart.cpp +++ b/examples/platform/silabs/efr32/uart.cpp @@ -134,8 +134,6 @@ static uint8_t sRxFifoBuffer[MAX_BUFFER_SIZE]; static Fifo_t sReceiveFifo; static void UART_rx_callback(UARTDRV_Handle_t handle, Ecode_t transferStatus, uint8_t * data, UARTDRV_Count_t transferCount); -static void UART_tx_callback(struct UARTDRV_HandleData * handle, Ecode_t transferStatus, uint8_t * data, - UARTDRV_Count_t transferCount); static void uartSendBytes(uint8_t * buffer, uint16_t nbOfBytes); static bool InitFifo(Fifo_t * fifo, uint8_t * pDataBuffer, uint16_t bufferSize) @@ -474,14 +472,15 @@ void uartSendBytes(uint8_t * buffer, uint16_t nbOfBytes) #endif #if (defined(EFR32MG24) && defined(WF200_WIFI)) + // Blocking transmit for the MG24 + WF200 since UART TX is multiplexed with + // WF200 SPI IRQ pre_uart_transfer(); -#endif /* EFR32MG24 && WF200_WIFI */ - + UARTDRV_ForceTransmit(vcom_handle, (uint8_t *) buffer, nbOfBytes); + post_uart_transfer(); +#else + // Non Blocking Transmit UARTDRV_Transmit(vcom_handle, (uint8_t *) buffer, nbOfBytes, UART_tx_callback); ulTaskNotifyTake(pdTRUE, portMAX_DELAY); - -#if (defined(EFR32MG24) && defined(WF200_WIFI)) - post_uart_transfer(); #endif /* EFR32MG24 && WF200_WIFI */ #if defined(SL_CATALOG_POWER_MANAGER_PRESENT) diff --git a/examples/platform/silabs/efr32/wf200/host_if.cpp b/examples/platform/silabs/efr32/wf200/host_if.cpp index 1d0f061e77d1bc..c48c5754640de4 100644 --- a/examples/platform/silabs/efr32/wf200/host_if.cpp +++ b/examples/platform/silabs/efr32/wf200/host_if.cpp @@ -602,7 +602,7 @@ static void wfx_events_task(void * p_arg) retryJoin = 0; retryInterval = WLAN_MIN_RETRY_TIMER_MS; wfx_lwip_set_sta_link_up(); -#ifdef SLEEP_ENABLED +#if CHIP_DEVICE_CONFIG_ENABLE_SED if (!(wfx_get_wifi_state() & SL_WFX_AP_INTERFACE_UP)) { // Enable the power save @@ -610,7 +610,7 @@ static void wfx_events_task(void * p_arg) sl_wfx_set_power_mode(WFM_PM_MODE_DTIM, WFM_PM_POLL_FAST_PS, BEACON_1); sl_wfx_enable_device_power_save(); } -#endif // SLEEP_ENABLED +#endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */ } if (flags & SL_WFX_DISCONNECT)